Debut RTOS_7

pull/1414/head
adustm 2015-11-09 17:40:08 +01:00
parent 9a09066812
commit 9783c7bf38
2 changed files with 2 additions and 10 deletions

View File

@ -205,6 +205,8 @@ typedef enum {
// Generic signals namings
LED1 = PG_13, // Corresponds to LD3 on MB1075B
LED2 = PG_14, // Corresponds to LD4 on MB1075B
LED3 = PG_13,
LED4 = PG_14,
USER_BUTTON = PA_0,
SERIAL_TX = PA_9,
SERIAL_RX = PA_10,

View File

@ -2,15 +2,9 @@
#include "test_env.h"
#include "rtos.h"
#if defined(TARGET_DISCO_F429ZI)
DigitalOut LEDs[2] = {
DigitalOut(LED1), DigitalOut(LED2)
};
#else
DigitalOut LEDs[4] = {
DigitalOut(LED1), DigitalOut(LED2), DigitalOut(LED3), DigitalOut(LED4)
};
#endif
void print_char(char c = '*')
{
@ -36,17 +30,13 @@ int main(void) {
RtosTimer led_1_timer(blink, osTimerPeriodic, (void *)0);
RtosTimer led_2_timer(blink, osTimerPeriodic, (void *)1);
#if !defined(TARGET_DISCO_F429ZI)
RtosTimer led_3_timer(blink, osTimerPeriodic, (void *)2);
RtosTimer led_4_timer(blink, osTimerPeriodic, (void *)3);
#endif
led_1_timer.start(200);
led_2_timer.start(100);
#if !defined(TARGET_DISCO_F429ZI)
led_3_timer.start(50);
led_4_timer.start(25);
#endif
Thread::wait(osWaitForever);
}