GIU\ZF
Dependencies: MCP23017 WattBob_TextLCD mbed-rtos mbed
Fork of rtos_basic by
main.cpp
- Committer:
- ihexx
- Date:
- 2018-03-27
- Revision:
- 16:0ada6cbd41e2
- Parent:
- 15:524de2b2ef8e
- Child:
- 17:a29ce6fc667c
File content as of revision 16:0ada6cbd41e2:
#include "core.h" DigitalOut led1(LED3); Thread thread; //Merge tasks with same frequency namespace runTimeParams{ Mutex liveAccess; float brakeForce = 0.0f; float accelForce = 0.0f; float newSpeed = 0.0f; float avgSpeed = 0.0f; float odometer = 0.0f; #if DEBUG_MODE string debugLog = "task,execution_time_ms,lastSleep,drift\n\r"; #endif } 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); return 0; } int main() { init(); while (true) { led1 = !led1; Thread::wait(500); } }