|
18 | 18 | #include <sstream>
|
19 | 19 | #include <vector>
|
20 | 20 | #include "mbed-trace/mbed_trace.h"
|
21 |
| -#include "eventOS_scheduler.h" |
22 |
| -#include "eventOS_event.h" |
23 |
| -#include "nsdynmemLIB.h" |
24 |
| -#include "platform/arm_hal_timer.h" |
25 |
| -#include "ns_event_loop.h" |
26 | 21 |
|
27 | 22 | #include "security.h"
|
28 | 23 |
|
@@ -54,9 +49,19 @@ LoWPANNDInterface mesh;
|
54 | 49 | ThreadInterface mesh;
|
55 | 50 | #endif
|
56 | 51 |
|
| 52 | +#ifndef MESH |
| 53 | +#include "eventOS_scheduler.h" |
| 54 | +#include "eventOS_event.h" |
| 55 | +#include "nsdynmemLIB.h" |
| 56 | +#include "platform/arm_hal_timer.h" |
| 57 | +#include "ns_event_loop.h" |
| 58 | + |
57 | 59 | #define HEAP_SIZE 32500
|
58 | 60 | static uint8_t app_stack_heap[HEAP_SIZE + 1];
|
59 | 61 |
|
| 62 | +#endif |
| 63 | + |
| 64 | + |
60 | 65 | Serial output(USBTX, USBRX);
|
61 | 66 |
|
62 | 67 | // These are example resource values for the Device Object
|
@@ -254,12 +259,14 @@ int main() {
|
254 | 259 | mbed_trace_init();
|
255 | 260 | mbed_trace_print_function_set(trace_printer);
|
256 | 261 |
|
| 262 | +#ifndef MESH |
257 | 263 | ns_dyn_mem_init(app_stack_heap, HEAP_SIZE,
|
258 | 264 | NULL, 0);
|
259 | 265 | platform_timer_enable();
|
260 | 266 | eventOS_scheduler_init();
|
261 | 267 | ns_event_loop_thread_create();
|
262 | 268 | ns_event_loop_thread_start();
|
| 269 | +#endif |
263 | 270 |
|
264 | 271 | NetworkStack *network_stack = 0;
|
265 | 272 | #if defined WIFI
|
@@ -325,7 +332,9 @@ int main() {
|
325 | 332 | while (true) {
|
326 | 333 | updates.wait(25000);
|
327 | 334 | if(registered) {
|
328 |
| - mbed_client.test_update_register(); |
| 335 | + if(!clicked) { |
| 336 | + mbed_client.test_update_register(); |
| 337 | + } |
329 | 338 | }else {
|
330 | 339 | break;
|
331 | 340 | }
|
|
0 commit comments