GIU\ZF

Dependencies:   MCP23017 WattBob_TextLCD mbed-rtos mbed

Fork of rtos_basic by mbed official

main.cpp

Committer:
ihexx
Date:
2018-03-27
Revision:
15:524de2b2ef8e
Parent:
14:8a6c20435523
Child:
16:0ada6cbd41e2

File content as of revision 15:524de2b2ef8e:

#include "core.h"

DigitalOut led1(LED3);
DigitalOut led2(LED2);
Thread thread;

//Merge tasks with same frequency
namespace runTimeParams{
    Mutex liveAccess;
    float brakeForce = 0.0f;
    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
    }

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);
    }
}