1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/openwsn/patches/openwsn.c.patch

208 lines
4.8 KiB
Diff
Raw Normal View History

*** stock_iot-lab_M3/openwsn/openwsn.c Thu Apr 24 11:01:37 2014
--- riot-openwsn-wip/openwsn/openwsn.c Thu Apr 24 16:55:54 2014
***************
*** 5,10 ****
--- 5,14 ----
*/
#include "openwsn.h"
+ #include "scheduler.h"
+ #include "thread.h"
+ #include "board_ow.h"
+ #include "leds_ow.h"
//===== drivers
#include "openserial.h"
//===== stack
***************
*** 33,45 ****
#include "opencoap.h"
//-- app (common)
//#include "rreg.h"
! //#include "rwellknown.h"
! //#include "rinfo.h"
//===== applications
//-- TCP
! #include "tcpecho.h"
! #include "tcpinject.h"
! #include "tcpprint.h"
#include "ohlone.h"
//-- UDP
#include "udpecho.h"
--- 37,49 ----
#include "opencoap.h"
//-- app (common)
//#include "rreg.h"
! #include "rwellknown.h"
! #include "rinfo.h"
//===== applications
//-- TCP
! //#include "tcpecho.h"
! //#include "tcpinject.h"
! //#include "tcpprint.h"
#include "ohlone.h"
//-- UDP
#include "udpecho.h"
***************
*** 49,78 ****
//#include "udplatency.h"
//#include "udpstorm.h"
//-- CoAP
! //#include "rleds.h"
//#include "rt.h"
//#include "rex.h"
//#include "rheli.h"
//#include "rrube.h"
//#include "rxl1.h"
//#include "layerdebug.h"
//-- misc
//#include "heli.h"
//#include "imu.h"
//=========================== variables =======================================
//=========================== prototypes ======================================
! void openwsn_init();
//=========================== public ==========================================
//=========================== private =========================================
! void openwsn_init() {
//===== drivers
! openserial_init();
//===== stack
//-- cross-layer
--- 53,108 ----
//#include "udplatency.h"
//#include "udpstorm.h"
//-- CoAP
! //#include "rleds_ow.h"
//#include "rt.h"
//#include "rex.h"
//#include "rheli.h"
//#include "rrube.h"
//#include "rxl1.h"
//#include "layerdebug.h"
+ //#include "r6t.h"
//-- misc
//#include "heli.h"
//#include "imu.h"
+ #define ENABLE_DEBUG (1)
+ #include "debug.h"
+
//=========================== variables =======================================
+ static char openwsn_stack[KERNEL_CONF_STACKSIZE_MAIN];
+
//=========================== prototypes ======================================
! void openwsn_init(void);
! void openwsn_start(void);
//=========================== public ==========================================
+ void openwsn_start_thread(void) {
+ DEBUG("%s\n",__PRETTY_FUNCTION__);
+ thread_create(openwsn_stack, KERNEL_CONF_STACKSIZE_MAIN,
+ PRIORITY_OPENWSN, CREATE_STACKTEST,
+ openwsn_start, "openwsn thread");
+ }
+
+ void openwsn_start(void) {
+ DEBUG("%s\n",__PRETTY_FUNCTION__);
+ leds_all_off();
+ board_init_ow();
+ scheduler_init();
+ openwsn_init();
+ puts("OpenWSN thread started.");
+ scheduler_start();
+ }
+
//=========================== private =========================================
! void openwsn_init(void) {
! DEBUG("%s\n",__PRETTY_FUNCTION__);
!
//===== drivers
! //openserial_init();
//===== stack
//-- cross-layer
***************
*** 100,113 ****
opencoap_init(); // initialize before any of the CoAP applications
//-- app (common)
//rreg_init();
! //rwellknown_init();
! //rinfo_init();
//===== applications
//-- TCP
! tcpecho_init();
! tcpinject_init();
! tcpprint_init();
ohlone_init();
//-- UDP
udpecho_init();
--- 130,143 ----
opencoap_init(); // initialize before any of the CoAP applications
//-- app (common)
//rreg_init();
! rwellknown_init();
! rinfo_init();
//===== applications
//-- TCP
! // tcpecho_init();
! // tcpinject_init();
! // tcpprint_init();
ohlone_init();
//-- UDP
udpecho_init();
***************
*** 117,129 ****
//udplatency_init();
//udpstorm_init();
//-- CoAP
! //rleds_init();
//rt_init();
//rex_init();
//rheli_init();
//rrube_init();
//rxl1_init();
//layerdebug_init();
//-- misc
//heli_init();
//imu_init();
--- 147,160 ----
//udplatency_init();
//udpstorm_init();
//-- CoAP
! //rleds_init_ow();
//rt_init();
//rex_init();
//rheli_init();
//rrube_init();
//rxl1_init();
//layerdebug_init();
+ //r6t_init();
//-- misc
//heli_init();
//imu_init();
***************
*** 131,134 ****
openserial_printInfo(COMPONENT_OPENWSN,ERR_BOOTED,
(errorparameter_t)0,
(errorparameter_t)0);
! }
\ No newline at end of file
--- 162,166 ----
openserial_printInfo(COMPONENT_OPENWSN,ERR_BOOTED,
(errorparameter_t)0,
(errorparameter_t)0);
! // leds_all_off();
! }