Los Putacos / Mbed OS WearableDevice_Nucleo_New

Dependencies:   MPU9250_SPI

Fork of WearableDevice_Nucleo by Los Putacos

main.cpp

Committer:
gusteibolt
Date:
2017-10-11
Revision:
1:a6dc717fb060
Parent:
0:73cd0cb02330
Child:
3:26aeff25f610

File content as of revision 1:a6dc717fb060:

/*
* Los Putacos
* Copyright (C) 2017, All rights reserved.
* ________________________________________ 
*
* Created by: Gustavo Campana, Michael Schmidt, Miguel Lopez
*       Date: 11-Oct-2017
*    Version: V0.1
*/

//-----------------------------------------------------------------
//     Board: NUCLEO - F401RE
//   Version: MR1136 rev C
//-----------------------------------------------------------------

//-----------------------------------------------------------------
// Includes
#include "mbed.h"
#include "rtos.h"
//-----------------------------------------------------------------

//-----------------------------------------------------------------
// Declarations
DigitalOut led1(LED1);
//-----------------------------------------------------------------

//-----------------------------------------------------------------
// Global Variables
//-----------------------------------------------------------------

//-----------------------------------------------------------------
void print_char(char c = '*')
{
    printf("%c", c);
    fflush(stdout);
}
//-----------------------------------------------------------------

//-----------------------------------------------------------------
void print_thread(void const *argument)
{
    while (true) {
        Thread::wait(1000);
        print_char();
    }
}
//-----------------------------------------------------------------

//-----------------------------------------------------------------
int main()
{
    printf("\n\n*** RTOS basic example ***\n");
    Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE);
    while (true) {
        led1 = !led1;
        Thread::wait(500);
    }
}
//-----------------------------------------------------------------