You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
959 B
47 lines
959 B
/*
|
|
* Copyright (c) 2023, Erich Styger
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include "platform.h"
|
|
#include "application.h"
|
|
#include "McuLED.h"
|
|
#include "McuGPIO.h"
|
|
#include "McuWait.h"
|
|
#include "McuRTOS.h"
|
|
#include "leds.h"
|
|
|
|
#if McuLib_CONFIG_SDK_USE_FREERTOS
|
|
static void blinky(void *pv) {
|
|
for(;;) {
|
|
LEDS_On(LEDS_GREEN);
|
|
vTaskDelay(pdMS_TO_TICKS(50));
|
|
LEDS_Off(LEDS_GREEN);
|
|
LEDS_On(LEDS_RED);
|
|
vTaskDelay(pdMS_TO_TICKS(50));
|
|
LEDS_Off(LEDS_RED);
|
|
vTaskDelay(pdMS_TO_TICKS(500));
|
|
}
|
|
}
|
|
#endif
|
|
|
|
void APP_Run(void) {
|
|
PL_Init();
|
|
#if McuLib_CONFIG_SDK_USE_FREERTOS
|
|
if (xTaskCreate(blinky, "blinky", 300/sizeof(StackType_t), NULL, tskIDLE_PRIORITY+1, NULL)!=pdPASS) {
|
|
for(;;) {}
|
|
}
|
|
vTaskStartScheduler();
|
|
#else
|
|
for(;;) {
|
|
LEDS_On(LEDS_GREEN);
|
|
McuWait_Waitms(50);
|
|
LEDS_Off(LEDS_GREEN);
|
|
LEDS_On(LEDS_RED);
|
|
McuWait_Waitms(50);
|
|
LEDS_Off(LEDS_RED);
|
|
McuWait_Waitms(500);
|
|
}
|
|
#endif
|
|
}
|
|
|