From 95db91c259883f8cedf9c90ac5b59a309f93a36d Mon Sep 17 00:00:00 2001 From: Thomas Eichinger Date: Tue, 25 Nov 2014 15:46:55 +0100 Subject: [PATCH 3/5] Fix old style definitions --- Makefile | 5 ++- bsp/boards/board.h | 40 ----------------- bsp/boards/board_ow.h | 2 +- bsp/boards/bsp_timer.h | 2 +- bsp/boards/radiotimer.h | 2 +- bsp/boards/riot-adaption/Makefile | 2 +- bsp/boards/spi.h | 2 +- bsp/boards/uart.h | 2 +- drivers/common/Makefile | 2 + drivers/common/openserial.c | 24 +++++----- drivers/common/opentimers.c | 4 +- kernel/openos/Makefile | 2 +- kernel/openos/scheduler.c | 6 +-- openapps/Makefile | 2 +- openapps/c6t/Makefile | 2 +- openapps/c6t/c6t.c | 2 +- openapps/cexample/cexample.c | 6 +-- openapps/cinfo/cinfo.c | 2 +- openapps/cleds/cleds.c | 2 +- openapps/cstorm/cstorm.c | 4 +- openapps/cwellknown/cwellknown.c | 2 +- openapps/techo/Makefile | 2 +- openapps/techo/techo.c | 6 +-- openapps/tohlone/tohlone.c | 8 ++-- openapps/uecho/Makefile | 2 +- openapps/uecho/uecho.c | 4 +- openstack/02a-MAClow/IEEE802154E.c | 64 +++++++++++++-------------- openstack/02a-MAClow/Makefile | 2 +- openstack/02a-MAClow/adaptive_sync.c | 6 +-- openstack/02b-MAChigh/Makefile | 2 +- openstack/02b-MAChigh/neighbors.c | 12 ++--- openstack/02b-MAChigh/schedule.c | 20 ++++----- openstack/02b-MAChigh/sixtop.c | 18 ++++---- openstack/03a-IPHC/Makefile | 2 +- openstack/03a-IPHC/iphc.c | 2 +- openstack/03a-IPHC/openbridge.c | 4 +- openstack/03b-IPv6/Makefile | 2 +- openstack/03b-IPv6/forwarding.c | 2 +- openstack/03b-IPv6/icmpv6.c | 2 +- openstack/03b-IPv6/icmpv6echo.c | 4 +- openstack/03b-IPv6/icmpv6rpl.c | 16 +++---- openstack/04-TRAN/Makefile | 2 +- openstack/04-TRAN/opencoap.c | 2 +- openstack/04-TRAN/opentcp.c | 8 ++-- openstack/04-TRAN/openudp.c | 4 +- openstack/Makefile | 2 +- openstack/cross-layers/Makefile | 2 +- openstack/cross-layers/idmanager.c | 8 ++-- openstack/cross-layers/openqueue.c | 10 ++--- openstack/cross-layers/openrandom.c | 4 +- projects/common/03oos_openwsn/03oos_openwsn.c | 35 ++++++++++++++- projects/common/03oos_openwsn/03oos_openwsn.h | 6 +++ projects/common/03oos_openwsn/Makefile | 2 +- 53 files changed, 192 insertions(+), 190 deletions(-) delete mode 100644 bsp/boards/board.h create mode 100644 drivers/common/Makefile diff --git a/Makefile b/Makefile index 66d60f8..f1917fa 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ -MODULE:=$(shell basename $(CURDIR)) +export MODULE:=$(shell basename $(CURDIR)) export OPENWSN_ROOT=$(CURDIR) DIRS += $(OPENWSN_ROOT)/projects/common/03oos_openwsn \ $(OPENWSN_ROOT)/openstack \ $(OPENWSN_ROOT)/openapps \ - $(OPENWSN_ROOT)/kernel/openos + $(OPENWSN_ROOT)/kernel/openos \ + $(OPENWSN_ROOT)/drivers/common INCLUDES += -I$(OPENWSN_ROOT)/kernel \ -I$(OPENWSN_ROOT)/inc \ diff --git a/bsp/boards/board.h b/bsp/boards/board.h deleted file mode 100644 index 63f90ac..0000000 --- a/bsp/boards/board.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef __BOARD_H -#define __BOARD_H - -/** -\addtogroup BSP -\{ -\addtogroup board -\{ - -\brief Cross-platform declaration "board" bsp module. - -\author Thomas Watteyne , February 2012. -*/ - -#include "board_info.h" -#include "toolchain_defs.h" - -//=========================== define ========================================== - -typedef enum { - DO_NOT_KICK_SCHEDULER, - KICK_SCHEDULER, -} kick_scheduler_t; - -//=========================== typedef ========================================= - -//=========================== variables ======================================= - -//=========================== prototypes ====================================== - -void board_init(void); -void board_sleep(void); -void board_reset(void); - -/** -\} -\} -*/ - -#endif diff --git a/bsp/boards/board_ow.h b/bsp/boards/board_ow.h index adc373c..bd78e7b 100644 --- a/bsp/boards/board_ow.h +++ b/bsp/boards/board_ow.h @@ -28,7 +28,7 @@ typedef enum { //=========================== prototypes ====================================== -void board_init(void); +void board_init_ow(void); void board_sleep(void); void board_reset(void); diff --git a/bsp/boards/bsp_timer.h b/bsp/boards/bsp_timer.h index 67f751e..b491b83 100644 --- a/bsp/boards/bsp_timer.h +++ b/bsp/boards/bsp_timer.h @@ -13,7 +13,7 @@ */ #include "stdint.h" -#include "board.h" +#include "board_ow.h" //=========================== define ========================================== diff --git a/bsp/boards/radiotimer.h b/bsp/boards/radiotimer.h index 5058ba5..6b6b27c 100644 --- a/bsp/boards/radiotimer.h +++ b/bsp/boards/radiotimer.h @@ -13,7 +13,7 @@ */ #include "stdint.h" -#include "board.h" +#include "board_ow.h" //=========================== define ========================================== diff --git a/bsp/boards/riot-adaption/Makefile b/bsp/boards/riot-adaption/Makefile index fad1c2e..a7c0bdc 100644 --- a/bsp/boards/riot-adaption/Makefile +++ b/bsp/boards/riot-adaption/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base \ No newline at end of file diff --git a/bsp/boards/spi.h b/bsp/boards/spi.h index fae2b79..943f94e 100644 --- a/bsp/boards/spi.h +++ b/bsp/boards/spi.h @@ -8,7 +8,7 @@ #define __SPI_H #include "stdint.h" -#include "board.h" +#include "board_ow.h" //=========================== define ========================================== diff --git a/bsp/boards/uart.h b/bsp/boards/uart.h index 4add6f7..4f02a23 100644 --- a/bsp/boards/uart.h +++ b/bsp/boards/uart.h @@ -13,7 +13,7 @@ */ #include "stdint.h" -#include "board.h" +#include "board_ow.h" //=========================== define ========================================== diff --git a/drivers/common/Makefile b/drivers/common/Makefile new file mode 100644 index 0000000..fbf6584 --- /dev/null +++ b/drivers/common/Makefile @@ -0,0 +1,2 @@ + +include $(RIOTBASE)/Makefile.base \ No newline at end of file diff --git a/drivers/common/openserial.c b/drivers/common/openserial.c index 5b02499..edd059e 100644 --- a/drivers/common/openserial.c +++ b/drivers/common/openserial.c @@ -43,7 +43,7 @@ void inputHdlcClose(void); //=========================== public ========================================== -void openserial_init() { +void openserial_init(void) { uint16_t crc; // reset variable @@ -200,7 +200,7 @@ owerror_t openserial_printCritical(uint8_t calling_component, uint8_t error_code ); } -uint8_t openserial_getNumDataBytes() { +uint8_t openserial_getNumDataBytes(void) { uint8_t inputBufFill; INTERRUPT_DECLARATION(); @@ -233,7 +233,7 @@ uint8_t openserial_getInputBuffer(uint8_t* bufferToWrite, uint8_t maxNumBytes) { return numBytesWritten; } -void openserial_startInput() { +void openserial_startInput(void) { INTERRUPT_DECLARATION(); if (openserial_vars.inputBufFill>0) { @@ -265,7 +265,7 @@ void openserial_startInput() { ENABLE_INTERRUPTS(); } -void openserial_startOutput() { +void openserial_startOutput(void) { //schedule a task to get new status in the output buffer uint8_t debugPrintCounter; @@ -349,7 +349,7 @@ void openserial_startOutput() { ENABLE_INTERRUPTS(); } -void openserial_stop() { +void openserial_stop(void) { uint8_t inputBufFill; uint8_t cmdByte; bool busyReceiving; @@ -415,7 +415,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_outBufferIndexes() { +bool debugPrint_outBufferIndexes(void) { uint16_t temp_buffer[2]; INTERRUPT_DECLARATION(); DISABLE_INTERRUPTS(); @@ -433,7 +433,7 @@ bool debugPrint_outBufferIndexes() { /** \brief Start an HDLC frame in the output buffer. */ -port_INLINE void outputHdlcOpen() { +port_INLINE void outputHdlcOpen(void) { // initialize the value of the CRC openserial_vars.outputCrc = HDLC_CRCINIT; @@ -459,7 +459,7 @@ port_INLINE void outputHdlcWrite(uint8_t b) { /** \brief Finalize the outgoing HDLC frame. */ -port_INLINE void outputHdlcClose() { +port_INLINE void outputHdlcClose(void) { uint16_t finalCrc; // finalize the calculation of the CRC @@ -478,7 +478,7 @@ port_INLINE void outputHdlcClose() { /** \brief Start an HDLC frame in the input buffer. */ -port_INLINE void inputHdlcOpen() { +port_INLINE void inputHdlcOpen(void) { // reset the input buffer index openserial_vars.inputBufFill = 0; @@ -508,7 +508,7 @@ port_INLINE void inputHdlcWrite(uint8_t b) { /** \brief Finalize the incoming HDLC frame. */ -port_INLINE void inputHdlcClose() { +port_INLINE void inputHdlcClose(void) { // verify the validity of the frame if (openserial_vars.inputCrc==HDLC_CRCGOOD) { @@ -527,7 +527,7 @@ port_INLINE void inputHdlcClose() { //=========================== interrupt handlers ============================== //executed in ISR, called from scheduler.c -void isr_openserial_tx() { +void isr_openserial_tx(void) { switch (openserial_vars.mode) { case MODE_INPUT: openserial_vars.reqFrameIdx++; @@ -550,7 +550,7 @@ void isr_openserial_tx() { } // executed in ISR, called from scheduler.c -void isr_openserial_rx() { +void isr_openserial_rx(void) { uint8_t rxbyte; uint8_t inputBufFill; diff --git a/drivers/common/opentimers.c b/drivers/common/opentimers.c index f361faf..5c6ba4f 100644 --- a/drivers/common/opentimers.c +++ b/drivers/common/opentimers.c @@ -30,7 +30,7 @@ void opentimers_timer_callback(void); Initializes data structures and hardware timer. */ -void opentimers_init(){ +void opentimers_init(void) { uint8_t i; // initialize local variables @@ -196,7 +196,7 @@ This function maps the expiration event to possibly multiple timers, calls the corresponding callback(s), and restarts the hardware timer with the next timer to expire. */ -void opentimers_timer_callback() { +void opentimers_timer_callback(void) { opentimer_id_t id; PORT_TIMER_WIDTH min_timeout; diff --git a/kernel/openos/Makefile b/kernel/openos/Makefile index 66fcdd0..6cea0de 100644 --- a/kernel/openos/Makefile +++ b/kernel/openos/Makefile @@ -1,4 +1,4 @@ -MODULE = openwsn +#MODULE = openwsn INCLUDES += -I$(CURDIR)/.. INCLUDES += -I$(OPENWSN_ROOT)/bsp/boards diff --git a/kernel/openos/scheduler.c b/kernel/openos/scheduler.c index 9d9d0d2..367513c 100644 --- a/kernel/openos/scheduler.c +++ b/kernel/openos/scheduler.c @@ -6,7 +6,7 @@ #include "opendefs.h" #include "scheduler.h" -#include "board.h" +#include "board_ow.h" #include "debugpins.h" #include "leds.h" @@ -21,7 +21,7 @@ void consumeTask(uint8_t taskId); //=========================== public ========================================== -void scheduler_init() { +void scheduler_init(void) { // initialization module variables memset(&scheduler_vars,0,sizeof(scheduler_vars_t)); @@ -31,7 +31,7 @@ void scheduler_init() { SCHEDULER_ENABLE_INTERRUPT(); } -void scheduler_start() { +void scheduler_start(void) { taskList_item_t* pThisTask; while (1) { while(scheduler_vars.task_list!=NULL) { diff --git a/openapps/Makefile b/openapps/Makefile index 56af055..ab615ba 100644 --- a/openapps/Makefile +++ b/openapps/Makefile @@ -1,4 +1,4 @@ -MODULE = openwsn +#MODULE = openwsn DIRS += $(CURDIR)/c6t \ $(CURDIR)/uecho \ diff --git a/openapps/c6t/Makefile b/openapps/c6t/Makefile index 694bb09..47289c6 100644 --- a/openapps/c6t/Makefile +++ b/openapps/c6t/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base diff --git a/openapps/c6t/c6t.c b/openapps/c6t/c6t.c index 74206ae..cdb037c 100644 --- a/openapps/c6t/c6t.c +++ b/openapps/c6t/c6t.c @@ -34,7 +34,7 @@ void c6t_sendDone( //=========================== public ========================================== -void c6t_init() { +void c6t_init(void) { if(idmanager_getIsDAGroot()==TRUE) return; // prepare the resource descriptor for the /6t path diff --git a/openapps/cexample/cexample.c b/openapps/cexample/cexample.c index ee8bfb4..719e1f0 100644 --- a/openapps/cexample/cexample.c +++ b/openapps/cexample/cexample.c @@ -39,7 +39,7 @@ void cexample_sendDone(OpenQueueEntry_t* msg, //=========================== public ========================================== -void cexample_init() { +void cexample_init(void) { // prepare the resource descriptor for the /ex path cexample_vars.desc.path0len = sizeof(cexample_path0)-1; @@ -67,11 +67,11 @@ owerror_t cexample_receive(OpenQueueEntry_t* msg, //timer fired, but we don't want to execute task in ISR mode //instead, push task to scheduler with COAP priority, and let scheduler take care of it -void cexample_timer_cb(){ +void cexample_timer_cb(void) { scheduler_push_task(cexample_task_cb,TASKPRIO_COAP); } -void cexample_task_cb() { +void cexample_task_cb(void) { OpenQueueEntry_t* pkt; owerror_t outcome; uint8_t numOptions; diff --git a/openapps/cinfo/cinfo.c b/openapps/cinfo/cinfo.c index a143d92..4ea853a 100644 --- a/openapps/cinfo/cinfo.c +++ b/openapps/cinfo/cinfo.c @@ -37,7 +37,7 @@ void cinfo_sendDone( /** \brief Initialize this module. */ -void cinfo_init() { +void cinfo_init(void) { // do not run if DAGroot if(idmanager_getIsDAGroot()==TRUE) return; diff --git a/openapps/cleds/cleds.c b/openapps/cleds/cleds.c index 74bd91a..5aea308 100644 --- a/openapps/cleds/cleds.c +++ b/openapps/cleds/cleds.c @@ -30,7 +30,7 @@ void cleds_sendDone( //=========================== public ========================================== -void cleds__init() { +void cleds__init(void) { // prepare the resource descriptor for the /l path cleds_vars.desc.path0len = sizeof(cleds_path0)-1; diff --git a/openapps/cstorm/cstorm.c b/openapps/cstorm/cstorm.c index 6366d18..ffcf106 100644 --- a/openapps/cstorm/cstorm.c +++ b/openapps/cstorm/cstorm.c @@ -140,11 +140,11 @@ owerror_t cstorm_receive( \note timer fired, but we don't want to execute task in ISR mode instead, push task to scheduler with CoAP priority, and let scheduler take care of it. */ -void cstorm_timer_cb(){ +void cstorm_timer_cb(void) { scheduler_push_task(cstorm_task_cb,TASKPRIO_COAP); } -void cstorm_task_cb() { +void cstorm_task_cb(void) { OpenQueueEntry_t* pkt; owerror_t outcome; uint8_t numOptions; diff --git a/openapps/cwellknown/cwellknown.c b/openapps/cwellknown/cwellknown.c index b38445c..3b45da5 100644 --- a/openapps/cwellknown/cwellknown.c +++ b/openapps/cwellknown/cwellknown.c @@ -28,7 +28,7 @@ void cwellknown_sendDone( //=========================== public ========================================== -void cwellknown_init() { +void cwellknown_init(void) { if(idmanager_getIsDAGroot()==TRUE) return; // prepare the resource descriptor for the /.well-known/core path diff --git a/openapps/techo/Makefile b/openapps/techo/Makefile index 694bb09..47289c6 100644 --- a/openapps/techo/Makefile +++ b/openapps/techo/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base diff --git a/openapps/techo/techo.c b/openapps/techo/techo.c index a7e314e..df3bdb3 100644 --- a/openapps/techo/techo.c +++ b/openapps/techo/techo.c @@ -10,10 +10,10 @@ //=========================== public ========================================== -void techo_init() { +void techo_init(void) { } -bool techo_shouldIlisten() { +bool techo_shouldIlisten(void) { return TRUE; } @@ -46,7 +46,7 @@ void techo_sendDone(OpenQueueEntry_t* msg, owerror_t error) { void techo_connectDone(owerror_t error) { } -bool techo_debugPrint() { +bool techo_debugPrint(void) { return FALSE; } diff --git a/openapps/tohlone/tohlone.c b/openapps/tohlone/tohlone.c index fdaf9ad..6136c03 100644 --- a/openapps/tohlone/tohlone.c +++ b/openapps/tohlone/tohlone.c @@ -18,18 +18,18 @@ bool tohlone_check4chars(uint8_t c1[4], uint8_t c2[4]); //=========================== public ========================================== -void tohlone_init() { +void tohlone_init(void) { tohlone_vars.httpChunk = 0; tohlone_vars.getRequest[0] = '/'; tohlone_vars.getRequest[1] = ' '; tohlone_webpages_init(); } -bool tohlone_shouldIlisten() { +bool tohlone_shouldIlisten(void) { return TRUE; } -void tohlone_sendpkt() { +void tohlone_sendpkt(void) { uint8_t buffer[TCP_DEFAULT_WINDOW_SIZE]; uint8_t buffer_len; @@ -106,7 +106,7 @@ void tohlone_sendDone(OpenQueueEntry_t* msg, owerror_t error) { void tohlone_connectDone(owerror_t error) { } -bool tohlone_debugPrint() { +bool tohlone_debugPrint(void) { return FALSE; } diff --git a/openapps/uecho/Makefile b/openapps/uecho/Makefile index 694bb09..47289c6 100644 --- a/openapps/uecho/Makefile +++ b/openapps/uecho/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base diff --git a/openapps/uecho/uecho.c b/openapps/uecho/uecho.c index b7fb405..1141c51 100644 --- a/openapps/uecho/uecho.c +++ b/openapps/uecho/uecho.c @@ -11,7 +11,7 @@ //=========================== public ========================================== -void uecho_init() { +void uecho_init(void) { } void uecho_receive(OpenQueueEntry_t* request) { @@ -55,7 +55,7 @@ void uecho_sendDone(OpenQueueEntry_t* msg, owerror_t error) { openqueue_freePacketBuffer(msg); } -bool uecho_debugPrint() { +bool uecho_debugPrint(void) { return FALSE; } diff --git a/openstack/02a-MAClow/IEEE802154E.c b/openstack/02a-MAClow/IEEE802154E.c index 6720529..461a8bd 100644 --- a/openstack/02a-MAClow/IEEE802154E.c +++ b/openstack/02a-MAClow/IEEE802154E.c @@ -99,7 +99,7 @@ void isr_ieee154e_timer(void); Call this function once before any other function in this module, possibly during boot-up. */ -void ieee154e_init() { +void ieee154e_init(void) { // initialize variables memset(&ieee154e_vars,0,sizeof(ieee154e_vars_t)); @@ -166,7 +166,7 @@ PORT_RADIOTIMER_WIDTH ieee154e_asnDiff(asn_t* someASN) { This function executes in ISR mode, when the new slot timer fires. */ -void isr_ieee154e_newSlot() { +void isr_ieee154e_newSlot(void) { radio_setTimerPeriod(TsSlotDuration); if (ieee154e_vars.isSync==FALSE) { if (idmanager_getIsDAGroot()==TRUE) { @@ -187,7 +187,7 @@ void isr_ieee154e_newSlot() { This function executes in ISR mode, when the FSM timer fires. */ -void isr_ieee154e_timer() { +void isr_ieee154e_timer(void) { switch (ieee154e_vars.state) { case S_TXDATAOFFSET: activity_ti2(); @@ -354,7 +354,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_asn() { +bool debugPrint_asn(void) { asn_t output; output.byte4 = ieee154e_vars.asn.byte4; output.bytes2and3 = ieee154e_vars.asn.bytes2and3; @@ -371,7 +371,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_isSync() { +bool debugPrint_isSync(void) { uint8_t output=0; output = ieee154e_vars.isSync; openserial_printStatus(STATUS_ISSYNC,(uint8_t*)&output,sizeof(uint8_t)); @@ -386,7 +386,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_macStats() { +bool debugPrint_macStats(void) { // send current stats over serial openserial_printStatus(STATUS_MACSTATS,(uint8_t*)&ieee154e_stats,sizeof(ieee154e_stats_t)); return TRUE; @@ -396,7 +396,7 @@ bool debugPrint_macStats() { //======= SYNCHRONIZING -port_INLINE void activity_synchronize_newSlot() { +port_INLINE void activity_synchronize_newSlot(void) { // I'm in the middle of receiving a packet if (ieee154e_vars.state==S_SYNCRX) { return; @@ -747,7 +747,7 @@ port_INLINE bool ieee154e_processIEs(OpenQueueEntry_t* pkt, uint16_t* lenIE) { //======= TX -port_INLINE void activity_ti1ORri1() { +port_INLINE void activity_ti1ORri1(void) { cellType_t cellType; open_addr_t neighbor; uint8_t i; @@ -915,7 +915,7 @@ port_INLINE void activity_ti1ORri1() { } } -port_INLINE void activity_ti2() { +port_INLINE void activity_ti2(void) { // change state changeState(S_TXDATAPREPARE); @@ -940,7 +940,7 @@ port_INLINE void activity_ti2() { changeState(S_TXDATAREADY); } -port_INLINE void activity_tie1() { +port_INLINE void activity_tie1(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_MAXTXDATAPREPARE_OVERFLOW, (errorparameter_t)ieee154e_vars.state, @@ -950,7 +950,7 @@ port_INLINE void activity_tie1() { endSlot(); } -port_INLINE void activity_ti3() { +port_INLINE void activity_ti3(void) { // change state changeState(S_TXDATADELAY); @@ -961,7 +961,7 @@ port_INLINE void activity_ti3() { radio_txNow(); } -port_INLINE void activity_tie2() { +port_INLINE void activity_tie2(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_WDRADIO_OVERFLOWS, (errorparameter_t)ieee154e_vars.state, @@ -986,7 +986,7 @@ port_INLINE void activity_ti4(PORT_RADIOTIMER_WIDTH capturedTime) { radiotimer_schedule(DURATION_tt4); } -port_INLINE void activity_tie3() { +port_INLINE void activity_tie3(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_WDDATADURATION_OVERFLOWS, (errorparameter_t)ieee154e_vars.state, @@ -1034,7 +1034,7 @@ port_INLINE void activity_ti5(PORT_RADIOTIMER_WIDTH capturedTime) { } } -port_INLINE void activity_ti6() { +port_INLINE void activity_ti6(void) { // change state changeState(S_RXACKPREPARE); @@ -1056,7 +1056,7 @@ port_INLINE void activity_ti6() { changeState(S_RXACKREADY); } -port_INLINE void activity_tie4() { +port_INLINE void activity_tie4(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_MAXRXACKPREPARE_OVERFLOWS, (errorparameter_t)ieee154e_vars.state, @@ -1066,7 +1066,7 @@ port_INLINE void activity_tie4() { endSlot(); } -port_INLINE void activity_ti7() { +port_INLINE void activity_ti7(void) { // change state changeState(S_RXACKLISTEN); @@ -1077,7 +1077,7 @@ port_INLINE void activity_ti7() { radiotimer_schedule(DURATION_tt7); } -port_INLINE void activity_tie5() { +port_INLINE void activity_tie5(void) { // indicate transmit failed to schedule to keep stats schedule_indicateTx(&ieee154e_vars.asn,FALSE); @@ -1113,7 +1113,7 @@ port_INLINE void activity_ti8(PORT_RADIOTIMER_WIDTH capturedTime) { radiotimer_schedule(DURATION_tt8); } -port_INLINE void activity_tie6() { +port_INLINE void activity_tie6(void) { // abort endSlot(); } @@ -1248,7 +1248,7 @@ port_INLINE void activity_ti9(PORT_RADIOTIMER_WIDTH capturedTime) { //======= RX -port_INLINE void activity_ri2() { +port_INLINE void activity_ri2(void) { // change state changeState(S_RXDATAPREPARE); @@ -1270,7 +1270,7 @@ port_INLINE void activity_ri2() { changeState(S_RXDATAREADY); } -port_INLINE void activity_rie1() { +port_INLINE void activity_rie1(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_MAXRXDATAPREPARE_OVERFLOWS, (errorparameter_t)ieee154e_vars.state, @@ -1280,7 +1280,7 @@ port_INLINE void activity_rie1() { endSlot(); } -port_INLINE void activity_ri3() { +port_INLINE void activity_ri3(void) { // change state changeState(S_RXDATALISTEN); @@ -1291,7 +1291,7 @@ port_INLINE void activity_ri3() { radiotimer_schedule(DURATION_rt3); } -port_INLINE void activity_rie2() { +port_INLINE void activity_rie2(void) { // abort endSlot(); } @@ -1313,7 +1313,7 @@ port_INLINE void activity_ri4(PORT_RADIOTIMER_WIDTH capturedTime) { radiotimer_schedule(DURATION_rt4); } -port_INLINE void activity_rie3() { +port_INLINE void activity_rie3(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_WDDATADURATION_OVERFLOWS, @@ -1465,7 +1465,7 @@ port_INLINE void activity_ri5(PORT_RADIOTIMER_WIDTH capturedTime) { endSlot(); } -port_INLINE void activity_ri6() { +port_INLINE void activity_ri6(void) { PORT_SIGNED_INT_WIDTH timeCorrection; header_IE_ht header_desc; @@ -1546,7 +1546,7 @@ port_INLINE void activity_ri6() { changeState(S_TXACKREADY); } -port_INLINE void activity_rie4() { +port_INLINE void activity_rie4(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_MAXTXACKPREPARE_OVERFLOWS, (errorparameter_t)ieee154e_vars.state, @@ -1556,7 +1556,7 @@ port_INLINE void activity_rie4() { endSlot(); } -port_INLINE void activity_ri7() { +port_INLINE void activity_ri7(void) { // change state changeState(S_TXACKDELAY); @@ -1567,7 +1567,7 @@ port_INLINE void activity_ri7() { radio_txNow(); } -port_INLINE void activity_rie5() { +port_INLINE void activity_rie5(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_WDRADIOTX_OVERFLOWS, (errorparameter_t)ieee154e_vars.state, @@ -1591,7 +1591,7 @@ port_INLINE void activity_ri8(PORT_RADIOTIMER_WIDTH capturedTime) { radiotimer_schedule(DURATION_rt8); } -port_INLINE void activity_rie6() { +port_INLINE void activity_rie6(void) { // log the error openserial_printError(COMPONENT_IEEE802154E,ERR_WDACKDURATION_OVERFLOWS, (errorparameter_t)ieee154e_vars.state, @@ -1695,7 +1695,7 @@ port_INLINE bool isValidAck(ieee802154_header_iht* ieee802514_header, OpenQueueE //======= ASN handling -port_INLINE void incrementAsnOffset() { +port_INLINE void incrementAsnOffset(void) { // increment the asn ieee154e_vars.asn.bytes0and1++; if (ieee154e_vars.asn.bytes0and1==0) { @@ -1890,7 +1890,7 @@ void notif_receive(OpenQueueEntry_t* packetReceived) { //======= stats -port_INLINE void resetStats() { +port_INLINE void resetStats(void) { ieee154e_stats.numSyncPkt = 0; ieee154e_stats.numSyncAck = 0; ieee154e_stats.minCorrection = 127; @@ -1997,7 +1997,7 @@ have been sent to the upper layer. Similarly, in a Tx slot, the sendDone function should already have been done. If this is not the case, this function will do that for you, but assume that something went wrong. */ -void endSlot() { +void endSlot(void) { // turn off the radio radio_rfOff(); @@ -2079,6 +2079,6 @@ void endSlot() { changeState(S_SLEEP); } -bool ieee154e_isSynch(){ +bool ieee154e_isSynch(void) { return ieee154e_vars.isSync; } diff --git a/openstack/02a-MAClow/Makefile b/openstack/02a-MAClow/Makefile index 694bb09..47289c6 100644 --- a/openstack/02a-MAClow/Makefile +++ b/openstack/02a-MAClow/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base diff --git a/openstack/02a-MAClow/adaptive_sync.c b/openstack/02a-MAClow/adaptive_sync.c index 76c4cc9..0386bcc 100644 --- a/openstack/02a-MAClow/adaptive_sync.c +++ b/openstack/02a-MAClow/adaptive_sync.c @@ -32,7 +32,7 @@ adaptive_sync_vars_t adaptive_sync_vars; /** \brief initial this module */ -void adaptive_sync_init() { +void adaptive_sync_init(void) { // reset local variables memset(&adaptive_sync_vars,0x00,sizeof(adaptive_sync_vars_t)); @@ -170,7 +170,7 @@ void adaptive_sync_calculateCompensatedSlots(int16_t timeCorrection) { Once compensationTimeout == 0, extend or shorten current slot length for one tick. */ -void adaptive_sync_countCompensationTimeout() { +void adaptive_sync_countCompensationTimeout(void) { uint16_t newSlotDuration; newSlotDuration = TsSlotDuration; @@ -262,7 +262,7 @@ void adaptive_sync_countCompensationTimeout_compoundSlots(uint16_t compoundSlots /** \brief set driftChanged to true. */ -void adaptive_sync_driftChanged() { +void adaptive_sync_driftChanged(void) { #ifndef NOADAPTIVESYNC adaptive_sync_vars.driftChanged = TRUE; #endif diff --git a/openstack/02b-MAChigh/Makefile b/openstack/02b-MAChigh/Makefile index 694bb09..47289c6 100644 --- a/openstack/02b-MAChigh/Makefile +++ b/openstack/02b-MAChigh/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base diff --git a/openstack/02b-MAChigh/neighbors.c b/openstack/02b-MAChigh/neighbors.c index 7e136e9..ba465ef 100644 --- a/openstack/02b-MAChigh/neighbors.c +++ b/openstack/02b-MAChigh/neighbors.c @@ -31,7 +31,7 @@ bool isThisRowMatching( /** \brief Initializes this module. */ -void neighbors_init() { +void neighbors_init(void) { // clear module variables memset(&neighbors_vars,0,sizeof(neighbors_vars_t)); @@ -51,7 +51,7 @@ void neighbors_init() { \returns This mote's current DAG rank. */ -dagrank_t neighbors_getMyDAGrank() { +dagrank_t neighbors_getMyDAGrank(void) { return neighbors_vars.myDAGrank; } @@ -60,7 +60,7 @@ dagrank_t neighbors_getMyDAGrank() { \returns The number of neighbors this mote's currently knows of. */ -uint8_t neighbors_getNumNeighbors() { +uint8_t neighbors_getNumNeighbors(void) { uint8_t i; uint8_t returnVal; @@ -494,7 +494,7 @@ routing decisions to change. Examples are: very low DAGrank, I may want to change by routing parent. - I became a DAGroot, so my DAGrank should be 0. */ -void neighbors_updateMyDAGrankAndNeighborPreference() { +void neighbors_updateMyDAGrankAndNeighborPreference(void) { uint8_t i; uint16_t rankIncrease; uint32_t tentativeDAGrank; // 32-bit since is used to sum @@ -550,7 +550,7 @@ void neighbors_updateMyDAGrankAndNeighborPreference() { //===== maintenance -void neighbors_removeOld() { +void neighbors_removeOld(void) { uint8_t i; uint16_t timeSinceHeard; @@ -574,7 +574,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_neighbors() { +bool debugPrint_neighbors(void) { debugNeighborEntry_t temp; neighbors_vars.debugRow=(neighbors_vars.debugRow+1)%MAXNUMNEIGHBORS; temp.row=neighbors_vars.debugRow; diff --git a/openstack/02b-MAChigh/schedule.c b/openstack/02b-MAChigh/schedule.c index c2e2394..fafb6f6 100644 --- a/openstack/02b-MAChigh/schedule.c +++ b/openstack/02b-MAChigh/schedule.c @@ -22,7 +22,7 @@ void schedule_resetEntry(scheduleEntry_t* pScheduleEntry); \post Call this function before calling any other function in this module. */ -void schedule_init() { +void schedule_init(void) { uint8_t i; slotOffset_t running_slotOffset; open_addr_t temp_neighbor; @@ -87,7 +87,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_schedule() { +bool debugPrint_schedule(void) { debugScheduleEntry_t temp; // increment the row just printed @@ -138,7 +138,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_backoff() { +bool debugPrint_backoff(void) { uint8_t temp[2]; // gather status data @@ -417,7 +417,7 @@ void schedule_syncSlotOffset(slotOffset_t targetSlotOffset) { /** \brief advance to next active slot */ -void schedule_advanceSlot() { +void schedule_advanceSlot(void) { INTERRUPT_DECLARATION(); DISABLE_INTERRUPTS(); @@ -430,7 +430,7 @@ void schedule_advanceSlot() { /** \brief return slotOffset of next active slot */ -slotOffset_t schedule_getNextActiveSlotOffset() { +slotOffset_t schedule_getNextActiveSlotOffset(void) { slotOffset_t res; INTERRUPT_DECLARATION(); @@ -448,7 +448,7 @@ slotOffset_t schedule_getNextActiveSlotOffset() { \returns The frame length. */ -frameLength_t schedule_getFrameLength() { +frameLength_t schedule_getFrameLength(void) { frameLength_t returnVal; INTERRUPT_DECLARATION(); @@ -466,7 +466,7 @@ frameLength_t schedule_getFrameLength() { \returns The type of the current schedule entry. */ -cellType_t schedule_getType() { +cellType_t schedule_getType(void) { cellType_t returnVal; INTERRUPT_DECLARATION(); @@ -499,7 +499,7 @@ void schedule_getNeighbor(open_addr_t* addrToWrite) { \returns The channel offset of the current schedule entry. */ -channelOffset_t schedule_getChannelOffset() { +channelOffset_t schedule_getChannelOffset(void) { channelOffset_t returnVal; INTERRUPT_DECLARATION(); @@ -524,7 +524,7 @@ Note that the backoff counter is global, not per slot. \returns TRUE if it is OK to send on this slot, FALSE otherwise. */ -bool schedule_getOkToSend() { +bool schedule_getOkToSend(void) { bool returnVal; INTERRUPT_DECLARATION(); @@ -558,7 +558,7 @@ bool schedule_getOkToSend() { /** \brief Reset the backoff and backoffExponent. */ -void schedule_resetBackoff() { +void schedule_resetBackoff(void) { INTERRUPT_DECLARATION(); DISABLE_INTERRUPTS(); diff --git a/openstack/02b-MAChigh/sixtop.c b/openstack/02b-MAChigh/sixtop.c index 6913957..8abc76c 100644 --- a/openstack/02b-MAChigh/sixtop.c +++ b/openstack/02b-MAChigh/sixtop.c @@ -115,7 +115,7 @@ bool sixtop_areAvailableCellsToBeScheduled( //=========================== public ========================================== -void sixtop_init() { +void sixtop_init(void) { sixtop_vars.periodMaintenance = 872 +(openrandom_get16b()&0xff); sixtop_vars.busySendingKA = FALSE; @@ -337,7 +337,7 @@ owerror_t sixtop_send(OpenQueueEntry_t *msg) { //======= from lower layer -void task_sixtopNotifSendDone() { +void task_sixtopNotifSendDone(void) { OpenQueueEntry_t* msg; // get recently-sent packet from openqueue @@ -410,7 +410,7 @@ void task_sixtopNotifSendDone() { } } -void task_sixtopNotifReceive() { +void task_sixtopNotifReceive(void) { OpenQueueEntry_t* msg; uint16_t lenIE; @@ -495,7 +495,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_myDAGrank() { +bool debugPrint_myDAGrank(void) { uint16_t output; output = 0; @@ -513,7 +513,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_kaPeriod() { +bool debugPrint_kaPeriod(void) { uint16_t output; output = sixtop_vars.kaPeriod; @@ -582,11 +582,11 @@ owerror_t sixtop_send_internal( // timer interrupt callbacks -void sixtop_maintenance_timer_cb() { +void sixtop_maintenance_timer_cb(void) { scheduler_push_task(timer_sixtop_management_fired,TASKPRIO_SIXTOP); } -void sixtop_timeout_timer_cb() { +void sixtop_timeout_timer_cb(void) { scheduler_push_task(timer_sixtop_six2six_timeout_fired,TASKPRIO_SIXTOP_TIMEOUT); } @@ -626,7 +626,7 @@ This is one of the MAC management tasks. This function inlines in the timers_res_fired() function, but is declared as a separate function for better readability of the code. */ -port_INLINE void sixtop_sendEB() { +port_INLINE void sixtop_sendEB(void) { OpenQueueEntry_t* adv; uint8_t len; @@ -695,7 +695,7 @@ This is one of the MAC management tasks. This function inlines in the timers_res_fired() function, but is declared as a separate function for better readability of the code. */ -port_INLINE void sixtop_sendKA() { +port_INLINE void sixtop_sendKA(void) { OpenQueueEntry_t* kaPkt; open_addr_t* kaNeighAddr; diff --git a/openstack/03a-IPHC/Makefile b/openstack/03a-IPHC/Makefile index 694bb09..47289c6 100644 --- a/openstack/03a-IPHC/Makefile +++ b/openstack/03a-IPHC/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base diff --git a/openstack/03a-IPHC/iphc.c b/openstack/03a-IPHC/iphc.c index 3ff5bd1..2b25466 100644 --- a/openstack/03a-IPHC/iphc.c +++ b/openstack/03a-IPHC/iphc.c @@ -48,7 +48,7 @@ void iphc_retrieveIPv6HopByHopHeader( //=========================== public ========================================== -void iphc_init() { +void iphc_init(void) { } // send from upper layer: I need to add 6LoWPAN header diff --git a/openstack/03a-IPHC/openbridge.c b/openstack/03a-IPHC/openbridge.c index 6ee4ba3..eaf672f 100644 --- a/openstack/03a-IPHC/openbridge.c +++ b/openstack/03a-IPHC/openbridge.c @@ -11,10 +11,10 @@ //=========================== prototypes ====================================== //=========================== public ========================================== -void openbridge_init() { +void openbridge_init(void) { } -void openbridge_triggerData() { +void openbridge_triggerData(void) { uint8_t input_buffer[136];//worst case: 8B of next hop + 128B of data OpenQueueEntry_t* pkt; uint8_t numDataBytes; diff --git a/openstack/03b-IPv6/Makefile b/openstack/03b-IPv6/Makefile index 694bb09..47289c6 100644 --- a/openstack/03b-IPv6/Makefile +++ b/openstack/03b-IPv6/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base diff --git a/openstack/03b-IPv6/forwarding.c b/openstack/03b-IPv6/forwarding.c index 532e14c..25a3094 100644 --- a/openstack/03b-IPv6/forwarding.c +++ b/openstack/03b-IPv6/forwarding.c @@ -45,7 +45,7 @@ void forwarding_createFlowLabel(uint32_t* flow_label,uint8_t flags); /** \brief Initialize this module. */ -void forwarding_init() { +void forwarding_init(void) { } /** diff --git a/openstack/03b-IPv6/icmpv6.c b/openstack/03b-IPv6/icmpv6.c index b895b98..ab5af97 100644 --- a/openstack/03b-IPv6/icmpv6.c +++ b/openstack/03b-IPv6/icmpv6.c @@ -12,7 +12,7 @@ //=========================== public ========================================== -void icmpv6_init() { +void icmpv6_init(void) { } owerror_t icmpv6_send(OpenQueueEntry_t* msg) { diff --git a/openstack/03b-IPv6/icmpv6echo.c b/openstack/03b-IPv6/icmpv6echo.c index 3967969..24f8eab 100644 --- a/openstack/03b-IPv6/icmpv6echo.c +++ b/openstack/03b-IPv6/icmpv6echo.c @@ -14,12 +14,12 @@ icmpv6echo_vars_t icmpv6echo_vars; //=========================== public ========================================== -void icmpv6echo_init() { +void icmpv6echo_init(void) { icmpv6echo_vars.busySending = FALSE; icmpv6echo_vars.seq = 0; } -void icmpv6echo_trigger() { +void icmpv6echo_trigger(void) { uint8_t number_bytes_from_input_buffer; uint8_t input_buffer[16]; OpenQueueEntry_t* msg; diff --git a/openstack/03b-IPv6/icmpv6rpl.c b/openstack/03b-IPv6/icmpv6rpl.c index cd422be..32c3e7d 100644 --- a/openstack/03b-IPv6/icmpv6rpl.c +++ b/openstack/03b-IPv6/icmpv6rpl.c @@ -31,7 +31,7 @@ void sendDAO(void); /** \brief Initialize this module. */ -void icmpv6rpl_init() { +void icmpv6rpl_init(void) { uint8_t dodagid[16]; // retrieve my prefix and EUI64 @@ -145,7 +145,7 @@ void icmpv6rpl_writeDODAGid(uint8_t* dodagid) { icmpv6rpl_vars.fDodagidWritten = 1; } -uint8_t icmpv6rpl_getRPLIntanceID(){ +uint8_t icmpv6rpl_getRPLIntanceID(void) { return icmpv6rpl_vars.dao.rplinstanceId; } @@ -248,7 +248,7 @@ void icmpv6rpl_receive(OpenQueueEntry_t* msg) { \note This function is executed in interrupt context, and should only push a task. */ -void icmpv6rpl_timer_DIO_cb() { +void icmpv6rpl_timer_DIO_cb(void) { scheduler_push_task(icmpv6rpl_timer_DIO_task,TASKPRIO_RPL); } @@ -257,7 +257,7 @@ void icmpv6rpl_timer_DIO_cb() { \note This function is executed in task context, called by the scheduler. */ -void icmpv6rpl_timer_DIO_task() { +void icmpv6rpl_timer_DIO_task(void) { // update the delayDIO icmpv6rpl_vars.delayDIO = (icmpv6rpl_vars.delayDIO+1)%5; @@ -283,7 +283,7 @@ void icmpv6rpl_timer_DIO_task() { /** \brief Prepare and a send a RPL DIO. */ -void sendDIO() { +void sendDIO(void) { OpenQueueEntry_t* msg; // stop if I'm not sync'ed @@ -369,7 +369,7 @@ void sendDIO() { \note This function is executed in interrupt context, and should only push a task. */ -void icmpv6rpl_timer_DAO_cb() { +void icmpv6rpl_timer_DAO_cb(void) { scheduler_push_task(icmpv6rpl_timer_DAO_task,TASKPRIO_RPL); } @@ -378,7 +378,7 @@ void icmpv6rpl_timer_DAO_cb() { \note This function is executed in task context, called by the scheduler. */ -void icmpv6rpl_timer_DAO_task() { +void icmpv6rpl_timer_DAO_task(void) { // update the delayDAO icmpv6rpl_vars.delayDAO = (icmpv6rpl_vars.delayDAO+1)%5; @@ -404,7 +404,7 @@ void icmpv6rpl_timer_DAO_task() { /** \brief Prepare and a send a RPL DAO. */ -void sendDAO() { +void sendDAO(void) { OpenQueueEntry_t* msg; // pointer to DAO messages uint8_t nbrIdx; // running neighbor index uint8_t numTransitParents,numTargetParents; // the number of parents indicated in transit option diff --git a/openstack/04-TRAN/Makefile b/openstack/04-TRAN/Makefile index 013e4fb..e8c21c9 100644 --- a/openstack/04-TRAN/Makefile +++ b/openstack/04-TRAN/Makefile @@ -1,4 +1,4 @@ -MODULE = openwsn +#MODULE = openwsn INCLUDES += -I$(OPENWSN_ROOT)/openapps/techo \ -I$(OPENWSN_ROOT)/openapps/uecho diff --git a/openstack/04-TRAN/opencoap.c b/openstack/04-TRAN/opencoap.c index 13d490f..050fb40 100644 --- a/openstack/04-TRAN/opencoap.c +++ b/openstack/04-TRAN/opencoap.c @@ -26,7 +26,7 @@ opencoap_vars_t opencoap_vars; /** \brief Initialize this module. */ -void opencoap_init() { +void opencoap_init(void) { // initialize the resource linked list opencoap_vars.resources = NULL; diff --git a/openstack/04-TRAN/opentcp.c b/openstack/04-TRAN/opentcp.c index 4285e53..3444e6d 100644 --- a/openstack/04-TRAN/opentcp.c +++ b/openstack/04-TRAN/opentcp.c @@ -24,7 +24,7 @@ void opentcp_timer_cb(void); //=========================== public ========================================== -void opentcp_init() { +void opentcp_init(void) { // reset local variables memset(&tcp_vars,0,sizeof(tcp_vars_t)); // reset state machine @@ -567,7 +567,7 @@ void opentcp_receive(OpenQueueEntry_t* msg) { } } -owerror_t opentcp_close() { //[command] teardown +owerror_t opentcp_close(void) { //[command] teardown OpenQueueEntry_t* tempPkt; if ( tcp_vars.state==TCP_STATE_ALMOST_CLOSE_WAIT || tcp_vars.state==TCP_STATE_CLOSE_WAIT || @@ -666,7 +666,7 @@ bool containsControlBits(OpenQueueEntry_t* msg, uint8_t ack, uint8_t rst, uint8_ return return_value; } -void opentcp_reset() { +void opentcp_reset(void) { tcp_change_state(TCP_STATE_CLOSED); tcp_vars.mySeqNum = TCP_INITIAL_SEQNUM; tcp_vars.hisNextSeqNum = 0; @@ -694,6 +694,6 @@ void tcp_change_state(uint8_t new_tcp_state) { } } -void opentcp_timer_cb() { +void opentcp_timer_cb(void) { scheduler_push_task(timers_tcp_fired,TASKPRIO_TCP_TIMEOUT); } diff --git a/openstack/04-TRAN/openudp.c b/openstack/04-TRAN/openudp.c index 079c2b1..3100f70 100644 --- a/openstack/04-TRAN/openudp.c +++ b/openstack/04-TRAN/openudp.c @@ -14,7 +14,7 @@ //=========================== public ========================================== -void openudp_init() { +void openudp_init(void) { } owerror_t openudp_send(OpenQueueEntry_t* msg) { @@ -106,7 +106,7 @@ void openudp_receive(OpenQueueEntry_t* msg) { } } -bool openudp_debugPrint() { +bool openudp_debugPrint(void) { return FALSE; } diff --git a/openstack/Makefile b/openstack/Makefile index a3c3aab..33de77f 100644 --- a/openstack/Makefile +++ b/openstack/Makefile @@ -1,4 +1,4 @@ -MODULE = openwsn +#MODULE = openwsn DIRS +=02a-MAClow DIRS +=02b-MAChigh diff --git a/openstack/cross-layers/Makefile b/openstack/cross-layers/Makefile index 694bb09..47289c6 100644 --- a/openstack/cross-layers/Makefile +++ b/openstack/cross-layers/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base diff --git a/openstack/cross-layers/idmanager.c b/openstack/cross-layers/idmanager.c index a0a276c..a6f5e2c 100644 --- a/openstack/cross-layers/idmanager.c +++ b/openstack/cross-layers/idmanager.c @@ -13,7 +13,7 @@ idmanager_vars_t idmanager_vars; //=========================== public ========================================== -void idmanager_init() { +void idmanager_init(void) { // reset local variables memset(&idmanager_vars, 0, sizeof(idmanager_vars_t)); @@ -53,7 +53,7 @@ void idmanager_init() { packetfunctions_mac64bToMac16b(&idmanager_vars.my64bID,&idmanager_vars.my16bID); } -bool idmanager_getIsDAGroot() { +bool idmanager_getIsDAGroot(void) { bool res; INTERRUPT_DECLARATION(); @@ -171,7 +171,7 @@ bool idmanager_isMyAddress(open_addr_t* addr) { } } -void idmanager_triggerAboutRoot() { +void idmanager_triggerAboutRoot(void) { uint8_t number_bytes_from_input_buffer; uint8_t input_buffer[9]; open_addr_t myPrefix; @@ -230,7 +230,7 @@ status information about several modules in the OpenWSN stack. \returns TRUE if this function printed something, FALSE otherwise. */ -bool debugPrint_id() { +bool debugPrint_id(void) { debugIDManagerEntry_t output; output.isDAGroot = idmanager_vars.isDAGroot; diff --git a/openstack/cross-layers/openqueue.c b/openstack/cross-layers/openqueue.c index 74de9db..28ad4a6 100644 --- a/openstack/cross-layers/openqueue.c +++ b/openstack/cross-layers/openqueue.c @@ -19,7 +19,7 @@ void openqueue_reset_entry(OpenQueueEntry_t* entry); /** \brief Initialize this module. */ -void openqueue_init() { +void openqueue_init(void) { uint8_t i; for (i=0;iaddr_16b[0]*256; random_vars.shift_reg += idmanager_getMyID(ADDR_16B)->addr_16b[1]; } -uint16_t openrandom_get16b() { +uint16_t openrandom_get16b(void) { uint8_t i; uint16_t random_value; random_value = 0; diff --git a/projects/common/03oos_openwsn/03oos_openwsn.c b/projects/common/03oos_openwsn/03oos_openwsn.c index 31021d4..3f4b36e 100644 --- a/projects/common/03oos_openwsn/03oos_openwsn.c +++ b/projects/common/03oos_openwsn/03oos_openwsn.c @@ -4,11 +4,44 @@ \author Thomas Watteyne , August 2010 */ -#include "board.h" +#include "thread.h" + +#include "board_ow.h" +#include "leds.h" #include "scheduler.h" #include "openstack.h" #include "opendefs.h" +#include "03oos_openwsn.h" + +#define ENABLE_DEBUG (0) +#include "debug.h" + +static char openwsn_stack[THREAD_STACKSIZE_MAIN]; +int openwsn_pid = -1; + +void openwsn_init(void); +void* openwsn_start(void *arg); + +void openwsn_start_thread(void) { + DEBUG("%s\n",__PRETTY_FUNCTION__); + openwsn_pid = thread_create(openwsn_stack, THREAD_STACKSIZE_MAIN, + PRIORITY_OPENWSN-2, CREATE_STACKTEST, + openwsn_start, NULL, "openwsn thread"); +} + +void* openwsn_start(void *arg) { + DEBUG("%s\n",__PRETTY_FUNCTION__); + (void)arg; + leds_all_off(); + board_init_ow(); + scheduler_init(); + openstack_init(); + puts("OpenWSN thread started."); + scheduler_start(); + return NULL; +} + int mote_main(void) { // initialize diff --git a/projects/common/03oos_openwsn/03oos_openwsn.h b/projects/common/03oos_openwsn/03oos_openwsn.h index 138cb12..5a9f1fa 100644 --- a/projects/common/03oos_openwsn/03oos_openwsn.h +++ b/projects/common/03oos_openwsn/03oos_openwsn.h @@ -7,4 +7,10 @@ #ifndef __openwsn_H #define __openwsn_H +void openwsn_start_thread(void); + +//=========================== define ========================================== + +#define PRIORITY_OPENWSN THREAD_PRIORITY_MAIN-1 + #endif diff --git a/projects/common/03oos_openwsn/Makefile b/projects/common/03oos_openwsn/Makefile index 694bb09..47289c6 100644 --- a/projects/common/03oos_openwsn/Makefile +++ b/projects/common/03oos_openwsn/Makefile @@ -1,3 +1,3 @@ -MODULE = openwsn +#MODULE = openwsn include $(RIOTBASE)/Makefile.base -- 2.2.0