Network, SD, Readall. comments added
Dependencies: Peripherals Buffer_lib_v2 SD_Lib_EffedUP_ERP Time_Lib_v2 Year3_Version5 BMP280 Network_Lib TextLCD BME280
Diff: main.cpp
- Revision:
- 20:15f22e814788
- Parent:
- 19:8c5615d0768d
- Child:
- 22:a100ca027173
diff -r 8c5615d0768d -r 15f22e814788 main.cpp --- a/main.cpp Fri Jan 18 18:43:21 2019 +0000 +++ b/main.cpp Mon Jan 21 20:23:24 2019 +0000 @@ -12,9 +12,6 @@ #define SD_Present #endif -#ifndef DEBUG -#define DEBUG -#endif //Serial pc(SERIAL_TX, SERIAL_RX); time_t currentTime; @@ -22,11 +19,15 @@ int setting; int t; -Thread t1(osPriorityRealtime); //sensor thread is highest priority -Thread t2(osPriorityNormal); -Thread t3(osPriorityNormal); -Thread t4(osPriorityNormal); -Thread t5(osPriorityNormal); + + + +Thread sensor_thread(osPriorityRealtime); //sensor thread is highest priority +Thread serial_thread(osPriorityNormal); +Thread SD_Card_thread(osPriorityNormal); +Thread Network_thread(osPriorityNormal); +Thread Update_time_thread(osPriorityNormal); +Thread Print_thread(osPriorityNormal); //LDR sensor @@ -44,9 +45,11 @@ //FunctionSD1(); // run threads - t1.start(FunctionSensor); - t2.start(FunctionSerial); - t3.start(FunctionSD1); - t4.start(Network); - t5.start(UpdateTime); + sensor_thread.start(FunctionSensor); + serial_thread.start(FunctionSerial); + SD_Card_thread.start(FunctionSD1); + Network_thread.start(Network); + Update_time_thread.start(UpdateTime); + Print_thread.start(callback(&printQueue, &EventQueue::dispatch_forever)); + //printQueue.call(printf, "Event Queue Initialised \n\r"); }