cc2530dk and Sensinode example udp server code cleanup

This commit is contained in:
George Oikonomou 2012-04-27 12:15:39 +01:00
parent fea95ae088
commit efd6d12831
2 changed files with 3 additions and 8 deletions

View file

@ -96,8 +96,6 @@ print_stats()
PRINTF("llrx=%lu, lltx=%lu, rx=%lu, tx=%lu\n", PRINTF("llrx=%lu, lltx=%lu, rx=%lu, tx=%lu\n",
rimestats.llrx, rimestats.lltx, rimestats.rx, rimestats.tx); rimestats.llrx, rimestats.lltx, rimestats.rx, rimestats.tx);
} }
#else
#define print_stats()
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static void
@ -146,9 +144,6 @@ create_dag()
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
PROCESS_THREAD(udp_server_process, ev, data) PROCESS_THREAD(udp_server_process, ev, data)
{ {
#if BUTTON_SENSOR_ON
static struct sensors_sensor *b1;
#endif
PROCESS_BEGIN(); PROCESS_BEGIN();
putstring("Starting UDP server\n"); putstring("Starting UDP server\n");
@ -170,7 +165,7 @@ PROCESS_THREAD(udp_server_process, ev, data)
PROCESS_YIELD(); PROCESS_YIELD();
if(ev == tcpip_event) { if(ev == tcpip_event) {
tcpip_handler(); tcpip_handler();
#if BUTTON_SENSOR_ON #if (BUTTON_SENSOR_ON && (DEBUG==DEBUG_PRINT))
} else if(ev == sensors_event && data == &button_sensor) { } else if(ev == sensors_event && data == &button_sensor) {
print_stats(); print_stats();
#endif /* BUTTON_SENSOR_ON */ #endif /* BUTTON_SENSOR_ON */

View file

@ -159,8 +159,8 @@ create_dag()
PROCESS_THREAD(udp_server_process, ev, data) PROCESS_THREAD(udp_server_process, ev, data)
{ {
#if (CONTIKI_TARGET_SENSINODE && BUTTON_SENSOR_ON) #if (CONTIKI_TARGET_SENSINODE && BUTTON_SENSOR_ON)
static struct sensors_sensor *b1; static const struct sensors_sensor *b1;
static struct sensors_sensor *b2; static const struct sensors_sensor *b2;
#endif #endif
PROCESS_BEGIN(); PROCESS_BEGIN();