Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/main.cpp
- Revision:
- 3:8ea4db957749
- Parent:
- 1:057d8fc6cb2f
- Child:
- 7:c0c03193612d
diff -r da28f21b72a1 -r 8ea4db957749 src/main.cpp --- a/src/main.cpp Thu Sep 01 20:32:42 2016 +0000 +++ b/src/main.cpp Tue Sep 06 17:51:37 2016 +0000 @@ -1,5 +1,5 @@ /****************************************************************************** - * + * * File: main.cpp * Desciption: main ICE driver routine * @@ -12,12 +12,10 @@ #include "ConfigurationHandler.h" #include "AnalyticsLogger.h" #include "ModbusMaster.h" -#include "CloudDataHandler.h" #include "BLEDataHandler.h" // main thread identifier (for signaling) osThreadId mainThreadId = NULL; - int sig_continue = 0x1; // data handler to configuration hanlder mailbox @@ -59,37 +57,39 @@ int main( void ) { mDot *dot; - dot = mDot::getInstance(); + + // for signaling from the configuration handler mainThreadId = osThreadGetId(); - + banner(); printf("\rMultiTech mDot library version: %s\n", dot->getId().c_str()); - - // start the configuration handler - Thread ch_thread(ConfigurationHandler); - + + // start the configuration handler + Thread configHandler_thread(ConfigurationHandler); + // wait for the configuration handler to signal us osSignalWait(sig_continue, osWaitForever); - + printf("\r%s: continuing to initialize...\n", __func__); - - Thread al_thread(AnalyticsLogger); - Thread mm_thread(ModbusMaster); - Thread cdh_thread(CloudDataHandler); - Thread ble_thread(BLEDataHandler); - + + Thread anaylticsLogger_thread(AnalyticsLogger); + Thread modbusMaster_thread(ModbusMaster); + Thread BLE_thread(BLEDataHandler); + Thread::wait(1000); - - // display free memory on the heap - __heapstats((__heapprt)fprintf,stdout); - + + // display free memory on the heap + __heapstats((__heapprt)fprintf,stdout); + + printf("\r\n"); Thread::wait(2000); printf("\r\n"); - - // start the command shell + + // start the command shell ntshell_execute(&ntshell, func_read, func_write, func_cb_ntshell); - - //ch_thread.join(); - for (;;) {} -} + + while ( true ) { + // do stuff + } +} \ No newline at end of file