cycle channel on keypress.

This commit is contained in:
Mariano Alvira 2010-12-24 14:30:06 -05:00
parent 92e5a4f78d
commit d8d8c77a2c

View file

@ -50,6 +50,7 @@ void maca_rx_callback(volatile packet_t *p) {
void main(void) {
volatile packet_t *p;
volatile uint8_t chan;
gpio_data(0);
@ -72,7 +73,8 @@ void main(void) {
gpio_pad_dir_set( 1ULL << 44 );
set_power(0x0f); /* 0dbm */
set_channel(0); /* channel 11 */
chan = 0;
set_channel(chan); /* channel 11 */
print_welcome("rftest-rx");
while(1) {
@ -87,5 +89,14 @@ void main(void) {
print_packet(p);
free_packet(p);
}
if(uart1_can_get()) {
uart1_getc();
chan++;
if(chan >= 16) { chan = 0; }
set_channel(chan);
printf("channel: %d\n\r", chan);
}
}
}