GIU\ZF
Dependencies: MCP23017 WattBob_TextLCD mbed-rtos mbed
Fork of rtos_basic by
Diff: main.cpp
- Revision:
- 15:524de2b2ef8e
- Parent:
- 14:8a6c20435523
- Child:
- 16:0ada6cbd41e2
--- a/main.cpp Tue Mar 27 16:11:18 2018 +0000 +++ b/main.cpp Tue Mar 27 18:55:43 2018 +0000 @@ -2,7 +2,7 @@ DigitalOut led1(LED3); DigitalOut led2(LED2); -Thread thread,thread_group_2HZ,thread_group_1HZ; +Thread thread; //Merge tasks with same frequency namespace runTimeParams{ @@ -11,6 +11,7 @@ float accelForce = 0.0f; float avgSpeed = 0.0f; float odometer = 0.0f; + float newSpeed = 0.0f; #if DEBUG_MODE string debugLog = "task,execution_time_ms,lastSleep,drift\n\r"; #endif @@ -19,23 +20,16 @@ int init(){ //Start task hotloops task_group_1::thread.start(task_group_1::runTask); + task_group_2::thread.start(task_group_2::runTask); enqueueMail::thread.start(enqueueMail::runTask); dequeueMail::thread.start(dequeueMail::runTask); - -// getControls::thread.start(getControls::runTask); return 0; } -void led2_thread() { - while (true) { - led2 = !led2; - Thread::wait(1000); - } -} + int main() { init(); - thread.start(led2_thread); while (true) { led1 = !led1;