From 123e3cae414e16e3fbe8e087c1aa916ee61a51ff Mon Sep 17 00:00:00 2001 From: dak664 Date: Sat, 23 Oct 2010 15:26:46 +0000 Subject: [PATCH] Fix compiler warnings --- cpu/avr/dev/usb/rndis/cdc_ecm.c | 3 +++ cpu/avr/dev/usb/rndis/rndis.c | 5 ++++- cpu/avr/dev/usb/rndis/rndis_task.c | 4 ++++ cpu/avr/dev/usb/serial/cdc_task.c | 0 cpu/avr/dev/usb/serial/cdc_task.h | 0 cpu/avr/dev/usb/serial/uart_usb_lib.c | 1 + cpu/avr/dev/usb/usb_specific_request.c | 4 +++- platform/avr-ravenusb/cdc_task.c | 3 +++ platform/avr-ravenusb/contiki-conf.h | 13 ++++++++++--- platform/avr-ravenusb/contiki-raven-main.c | 12 ++++++++---- platform/avr-ravenusb/httpd-simple-avr.c | 7 ++++++- 11 files changed, 42 insertions(+), 10 deletions(-) delete mode 100644 cpu/avr/dev/usb/serial/cdc_task.c delete mode 100644 cpu/avr/dev/usb/serial/cdc_task.h diff --git a/cpu/avr/dev/usb/rndis/cdc_ecm.c b/cpu/avr/dev/usb/rndis/cdc_ecm.c index 4fd1d62ba..f10061323 100644 --- a/cpu/avr/dev/usb/rndis/cdc_ecm.c +++ b/cpu/avr/dev/usb/rndis/cdc_ecm.c @@ -9,6 +9,9 @@ #include "uip.h" #include "sicslow_ethernet.h" #include +#if RF230BB +#include "rf230bb.h" +#endif #include #include diff --git a/cpu/avr/dev/usb/rndis/rndis.c b/cpu/avr/dev/usb/rndis/rndis.c index b49e0674d..42c3b2b4e 100644 --- a/cpu/avr/dev/usb/rndis/rndis.c +++ b/cpu/avr/dev/usb/rndis/rndis.c @@ -72,6 +72,9 @@ RNDIS Status Information: #include "sicslow_ethernet.h" #include #include +#if RF230BB +#include "rf230bb.h" +#endif #include #include @@ -600,7 +603,7 @@ void rndis_query_process(void) #define PARMVALUELENGTH CFGBUF->ParameterValueLength #define PARM_NAME_LENGTH 25 /* Maximum parameter name length */ -bool +void rndis_handle_config_parm(const char* parmname,const uint8_t* parmvalue,size_t parmlength) { if (strncmp_P(parmname, PSTR("rawmode"), 7) == 0) { if (parmvalue[0] == '0') { diff --git a/cpu/avr/dev/usb/rndis/rndis_task.c b/cpu/avr/dev/usb/rndis/rndis_task.c index e2088ec36..dbfc586ee 100644 --- a/cpu/avr/dev/usb/rndis/rndis_task.c +++ b/cpu/avr/dev/usb/rndis/rndis_task.c @@ -52,12 +52,16 @@ #include "usb_specific_request.h" #include "rndis/rndis_task.h" #include "rndis/rndis_protocol.h" +#if RF230BB +#include "rf230bb.h" +#endif #include "uip.h" #include "sicslow_ethernet.h" #include #include #include +#include "watchdog.h" #include "rndis/cdc_ecm.h" #include "rndis/cdc_eem.h" diff --git a/cpu/avr/dev/usb/serial/cdc_task.c b/cpu/avr/dev/usb/serial/cdc_task.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/cpu/avr/dev/usb/serial/cdc_task.h b/cpu/avr/dev/usb/serial/cdc_task.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/cpu/avr/dev/usb/serial/uart_usb_lib.c b/cpu/avr/dev/usb/serial/uart_usb_lib.c index 3b160f3f1..53e32d287 100644 --- a/cpu/avr/dev/usb/serial/uart_usb_lib.c +++ b/cpu/avr/dev/usb/serial/uart_usb_lib.c @@ -46,6 +46,7 @@ #include "usb_drv.h" #include "usb_descriptors.h" #include "serial/uart_usb_lib.h" +#include "cdc_task.h" #include /** diff --git a/cpu/avr/dev/usb/usb_specific_request.c b/cpu/avr/dev/usb/usb_specific_request.c index e2b2e556c..6cc07e952 100644 --- a/cpu/avr/dev/usb/usb_specific_request.c +++ b/cpu/avr/dev/usb/usb_specific_request.c @@ -51,6 +51,7 @@ #include "usb_specific_request.h" #include "rndis/rndis_protocol.h" #include "rndis/cdc_ecm.h" +#include "rndis/rndis_task.h" #include "serial/uart_usb_lib.h" #include "storage/ctrl_access.h" #include "uip.h" @@ -416,7 +417,8 @@ void cdc_set_line_coding (void) void cdc_set_control_line_state (void) { U8 controlLineState = Usb_read_byte(); - U8 dummy = Usb_read_byte(); +// U8 dummy = Usb_read_byte(); //Compiler warning + if (Usb_read_byte()) {}; U8 interface = Usb_read_byte(); Usb_ack_receive_setup(); diff --git a/platform/avr-ravenusb/cdc_task.c b/platform/avr-ravenusb/cdc_task.c index f8e410d35..e9bee0805 100644 --- a/platform/avr-ravenusb/cdc_task.c +++ b/platform/avr-ravenusb/cdc_task.c @@ -61,6 +61,9 @@ #else #include "radio.h" #endif +#if USB_CONF_RS232 +#include "dev/rs232.h" +#endif #include #include #include "dev/watchdog.h" diff --git a/platform/avr-ravenusb/contiki-conf.h b/platform/avr-ravenusb/contiki-conf.h index f5a29f5fc..927fa2357 100644 --- a/platform/avr-ravenusb/contiki-conf.h +++ b/platform/avr-ravenusb/contiki-conf.h @@ -182,12 +182,19 @@ extern void mac_log_802_15_4_rx(const uint8_t* buffer, size_t total_len); /* ************************************************************************** */ //#pragma mark Serial Port Settings /* ************************************************************************** */ - +/* Set USB_CONF_MACINTOSH to prefer CDC-ECM+DEBUG enumeration for Mac/Linux + * Leave undefined to prefer RNDIS+DEBUG enumeration for Windows/Linux + * TODO:Serial port will enumerate in all cases and prevent falling through to + * the supported network interface if USB_CONF_MACINTOSH is used with Windows + * or vice versa. If Windows has previously cached the RNDIS driver for the stick + * it will attempt to use it and give "device can not start" error. + * This doesn't seem to hurt anything but can potentially damage the OS! + */ +//#define USB_CONF_MACINTOSH 1 /* Disable mass storage enumeration for more program space */ /* TODO: Mass storage is currently broken */ -#define USB_CONF_STORAGE 0 +//#define USB_CONF_STORAGE 1 /* Use either USB CDC or RS232 for stdout (or neither) */ -/* TODO:CDC is currently broken on windows/linux, use RS232 */ #define USB_CONF_CDC 1 //#define USB_CONF_RS232 1 diff --git a/platform/avr-ravenusb/contiki-raven-main.c b/platform/avr-ravenusb/contiki-raven-main.c index 5cce89a37..5a683ec48 100644 --- a/platform/avr-ravenusb/contiki-raven-main.c +++ b/platform/avr-ravenusb/contiki-raven-main.c @@ -70,7 +70,8 @@ #include "usb_task.h" #if USB_CONF_CDC #include "cdc_task.h" -#elif USB_CONF_RS232 +#endif +#if USB_CONF_RS232 #include "dev/rs232.h" #endif @@ -243,6 +244,7 @@ get_eui64_from_eeprom(uint8_t macptr[8]) { return macptr[0]!=0xFF; } +#if JACKDAW_CONF_RANDOM_MAC static bool set_eui64_to_eeprom(const uint8_t macptr[8]) { #if JACKDAW_CONF_USE_SETTINGS @@ -264,6 +266,7 @@ generate_new_eui64(uint8_t eui64[8]) { eui64[6] = rng_get_uint8(); eui64[7] = rng_get_uint8(); } +#endif /* JACKDAW_CONF_RANDOM_MAC */ static uint16_t get_panid_from_eeprom(void) { @@ -302,7 +305,7 @@ static void initialize(void) { /* Clock */ clock_init(); - #if USB_CONF_RS232 + #if USB_CONF_RS232 /* Use rs232 port for serial out (tx, rx, gnd are the three pads behind jackdaw leds */ rs232_init(RS232_PORT_0, USART_BAUD_57600,USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8); /* Redirect stdout to second port */ @@ -450,9 +453,10 @@ static void initialize(void) { #endif /* RF230BB */ printf_P(PSTR("System online.\n\r")); } -#elif USB_CONF_RS232 - printf_P(PSTR("System online.\n")); #endif /* USB_CONF_CDC */ +#if USB_CONF_RS232 + printf_P(PSTR("System online.\n")); +#endif /* USB_CONF_RS232 */ #endif /* ANNOUNCE */ } diff --git a/platform/avr-ravenusb/httpd-simple-avr.c b/platform/avr-ravenusb/httpd-simple-avr.c index d1d89fb9b..62fe13e87 100644 --- a/platform/avr-ravenusb/httpd-simple-avr.c +++ b/platform/avr-ravenusb/httpd-simple-avr.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: httpd-simple-avr.c,v 1.2 2010/10/19 18:29:05 adamdunkels Exp $ + * $Id: httpd-simple-avr.c,v 1.3 2010/10/23 15:26:46 dak664 Exp $ */ /** @@ -133,6 +133,10 @@ generate_string_P(void *sstr) #endif } /*---------------------------------------------------------------------------*/ +#if FIND_THE_SCRIPT +/* Needed if more than one script is implemented. + * The generate_routes RPL page is hard coded at present + */ static PT_THREAD(send_string_P(struct httpd_state *s, char *str)) { @@ -140,6 +144,7 @@ PT_THREAD(send_string_P(struct httpd_state *s, char *str)) PSOCK_GENERATOR_SEND(&s->sout, generate_string_P, str); PSOCK_END(&s->sout); } +#endif /*---------------------------------------------------------------------------*/ char http_content_type_html[] PROGMEM = "Content-type: text/html\r\n\r\n"; static