diff --git a/cpu/avr/dev/usb/serial/cdc_task.c b/cpu/avr/dev/usb/serial/cdc_task.c index 508b2e230..731db433e 100644 --- a/cpu/avr/dev/usb/serial/cdc_task.c +++ b/cpu/avr/dev/usb/serial/cdc_task.c @@ -59,6 +59,7 @@ #include #include +#include #include #define BUF ((struct uip_eth_hdr *)&uip_buf[0]) @@ -221,6 +222,8 @@ void menu_process(char c) //If valid input, change it if (tempchannel) { radio_set_operating_channel(tempchannel); + eeprom_write_byte(9, tempchannel); //Write channel + eeprom_write_byte(10, ~tempchannel); //Bit inverse as check } menustate = normal; diff --git a/cpu/avr/dev/usb/usb_specific_request.c b/cpu/avr/dev/usb/usb_specific_request.c index 0f873935f..2df219c3e 100644 --- a/cpu/avr/dev/usb/usb_specific_request.c +++ b/cpu/avr/dev/usb/usb_specific_request.c @@ -128,7 +128,7 @@ Bool usb_user_read_request(U8 type, U8 request) /* We don't have a real serial port - so these aren't applicable. We advertise that we support nothing, so shouldn't get them anyway */ - /* case GET_LINE_CODING: + case GET_LINE_CODING: cdc_get_line_coding(); return TRUE; break; @@ -142,8 +142,7 @@ Bool usb_user_read_request(U8 type, U8 request) cdc_set_control_line_state(); return TRUE; break; - */ - default: + default: break; } diff --git a/cpu/avr/radio/mac/sicslowmac.c b/cpu/avr/radio/mac/sicslowmac.c index 4153ba77b..f4104b4c1 100644 --- a/cpu/avr/radio/mac/sicslowmac.c +++ b/cpu/avr/radio/mac/sicslowmac.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: sicslowmac.c,v 1.3 2008/10/14 18:36:07 c_oflynn Exp $ + * $Id: sicslowmac.c,v 1.4 2008/10/27 18:03:26 c_oflynn Exp $ */ @@ -483,7 +483,17 @@ PROCESS_THREAD(mac_process, ev, data) } #endif - radio_set_operating_channel(24); + uint8_t eeprom_channel; + uint8_t eeprom_check; + + eeprom_channel = eeprom_read_byte(9); + eeprom_check = eeprom_read_byte(10); + + if ((eeprom_channel < 11) || (eeprom_channel > 26) || ((uint8_t)eeprom_channel != (uint8_t)~eeprom_check)) { + eeprom_channel = 24; //Default + } + + radio_set_operating_channel(eeprom_channel); radio_use_auto_tx_crc(true); radio_set_trx_state(TRX_OFF);