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:
- 75:96512ccc0443
- Parent:
- 74:03ccf04998b5
- Child:
- 76:e5690c40e6b1
--- a/src/main.cpp Mon Sep 19 12:54:55 2016 +0000 +++ b/src/main.cpp Mon Sep 19 14:42:19 2016 +0000 @@ -21,7 +21,10 @@ // main thread identifier (for signaling) osThreadId mainThreadId = NULL; -int sig_continue = 0x1; + +// bootup sequence signals +int sig_output_continue = 0x1; +int sig_config_continue = 0x2; // data handler to configuration hanlder mailbox Mail<Message_t, 16> MailBox; @@ -63,7 +66,7 @@ //rtc_get_time(&iyr, &imo, &idy, &ihr, &imn, &isc); - printf("\n\n\r\nWelcome to Project: ICE v0.0.35\n"); + printf("\n\n\r\nWelcome to Project: ICE v0.0.69\n"); printf("\rThe Intelligent Connected Experience\n"); printf("\rCopyright 2016 Nalco Water, an Ecolab Company\n"); @@ -76,7 +79,9 @@ //printf("\r\nCurrent time is: %04d-%02d-%02d %02d:%02d:%02d\r\n", iyr, imo, idy, ihr, imn, isc); - printf("\r\n\r\n\r\r\n"); + printf("\r\n\r\n\r\n"); + printf("\rMultiTech mDot library version: %s\n", GLOBAL_mdot->getId().c_str()); + } /***************************************************************************** @@ -112,17 +117,19 @@ mainThreadId = osThreadGetId(); banner(); - printf("\rMultiTech mDot library version: %s\n", dot->getId().c_str()); - + + // start the output task + Thread outputTask_thread (OutputTask, NULL, osPriorityNormal, (1024*8), NULL); + // wait for a signal from the output task to start the control task + osSignalWait(sig_output_continue, osWaitForever); + // start the configuration handler Thread configHandler_thread(ConfigurationHandler, NULL, osPriorityNormal, (1024*3), NULL); - Thread outputTask_thread (OutputTask, NULL, osPriorityNormal, (1024*8), NULL); - Thread controlTask_thread (ControlTask, NULL, osPriorityNormal, (1024*2), NULL); + osSignalWait(sig_config_continue, osWaitForever); - // wait for the configuration handler to signal us - osSignalWait(sig_continue, osWaitForever); - - printf("\r%s: continuing to initialize...\n", __func__); + // start running the controls + Thread controlTask_thread (ControlTask, NULL, osPriorityNormal, (1024*2), NULL); + //printf("\r%s: continuing to initialize...\n", __func__); Thread analyticsLoggerThread(AnalyticsLogger); Thread modbusMaster_thread(ModbusMaster, NULL, osPriorityHigh, (1024*10), NULL); @@ -139,15 +146,6 @@ GLOBAL_outputTask_thread = &outputTask_thread; Thread::wait(1000); - -#if 0 - // display free memory on the heap - printf("\r\n"); - __heapstats((__heapprt)fprintf,stdout); -#endif - - printf("\r\n"); - Thread::wait(1000); printf("\r\n"); // start the command shell