Experimenting w/FreeRTOS

Dependencies:   FreeRTOS mbed MMA7660 LM75B

main.cpp

Committer:
tkatolrnmcu
Date:
2017-08-19
Revision:
0:ef389421b079
Child:
1:1990d6e600c2

File content as of revision 0:ef389421b079:

#include "mbed.h"
#include "FreeRTOS.h"
#include "task.h"

DigitalOut myled(LED1);

void vHello(void *pvParameters);
void vGbye(void *pvParameters);

int main() {
    /*while(1) {
        myled = 1;
        wait(0.2);
        myled = 0;
        wait(0.2);
    }*/
    
    
    xTaskCreate(vHello, "HELLO", configMINIMAL_STACK_SIZE, (void*)NULL, tskIDLE_PRIORITY, NULL);
    
    xTaskCreate(vGbye, "BYE", configMINIMAL_STACK_SIZE, (void*)NULL, tskIDLE_PRIORITY, NULL);
    
    
    for (;;);
}

void vHello(void *pvParameters)
{
    int *ptr;
    ptr = (int *)pvParameters;
    
    for(;;)
    {
        printf("Hello World!\n");
    }
}

void vGbye(void *pvParameters)
{
    int *ptr;
    ptr = (int *)pvParameters;
    
    for(;;)
    {
        printf("Goodbye World!\n");
    }
}