Exemplo n.º 1
0
static void print_info(const struct iwinfo_ops *iw, const char *ifname)
{
	printf("%-9s ESSID: %s\n",
		ifname,
		print_ssid(iw, ifname));
	printf("          Access Point: %s\n",
		print_bssid(iw, ifname));
	printf("          Type: %s  HW Mode(s): %s\n",
		print_type(iw, ifname),
		print_hwmodes(iw, ifname));
	printf("          Mode: %s  Channel: %s (%s)\n",
		print_mode(iw, ifname),
		print_channel(iw, ifname),
		print_frequency(iw, ifname));
	printf("          Tx-Power: %s  Link Quality: %s/%s\n",
		print_txpower(iw, ifname),
		print_quality(iw, ifname),
		print_quality_max(iw, ifname));
	printf("          Signal: %s  Noise: %s\n",
		print_signal(iw, ifname),
		print_noise(iw, ifname));
	printf("          Bit Rate: %s\n",
		print_rate(iw, ifname));
	printf("          Encryption: %s\n",
		print_encryption(iw, ifname));
	printf("          Supports VAPs: %s\n",
		print_mbssid_supp(iw, ifname));
}
Exemplo n.º 2
0
__interrupt void read_buttons(void)
{
	if(!debounce()) return;

    //wave state can be 0, 1, 2
	// 0 is SINE
	// 1 is SAW TOOTH
	// 2 is SQUARE

	static u8 wave_type = 1;

	//frequency can be 1, 2, 3, 4, 5
	//1 100Hz
	//2 200Hz
	//3 300Hz
	//4 400Hz
	//5 500Hz
	static u8 frequency = 1;
	//duty cycle can be 1, 2, 3, 4, 5, 6, 7, 8, 9
	//for 10, 20, 30, 40, 50.. % duty cycle
	static u8 duty_cycle = 10;

	u8 flags = P1IFG & (FREQ_SEL_BUTTON | WAVE_SEL_BUTTON | DUTY_SEL_BUTTON);

	display_reset();

	switch(flags)
	{
	case WAVE_SEL_BUTTON:
		LCD_FIRST_LINE();
		lcd_print("Set Wave Type");

		if (wave_type >= 3) wave_type = 1;
		else wave_type++;

		LCD_SECOND_LINE();

		switch(wave_type)
		{
		case 1:
			lcd_print("Square");
			break;
		case 2:
			lcd_print("Tri");
			break;
		case 3:
			lcd_print("Sine");
			break;
		}

        fg_change_waveform(wave_type);

		P1IFG &= ~WAVE_SEL_BUTTON;
		break;

	case FREQ_SEL_BUTTON:
		LCD_FIRST_LINE();

		if (frequency >= 5) { frequency = 1; }
		else {frequency ++; }

        lcd_print("Freq:");
        LCD_SECOND_LINE();
        print_frequency(frequency);

        fg_change_frequency(frequency);

		P1IFG &= ~FREQ_SEL_BUTTON;
		break;

	case DUTY_SEL_BUTTON:
		lcd_print("Duty:");
		P1IFG &= ~DUTY_SEL_BUTTON;
		break;
	default:
		P1IFG = 0;
	}

}