From 560166477ea85b0845713aa86be156084fefdbb2 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Mon, 19 Sep 2022 23:43:20 -0400 Subject: [PATCH] [stm32f401 nucleo] update main.c revert blinking LED --- bsp/stm32/stm32f401-st-nucleo/applications/main.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bsp/stm32/stm32f401-st-nucleo/applications/main.c b/bsp/stm32/stm32f401-st-nucleo/applications/main.c index ec1936eb15..36a52e02a8 100644 --- a/bsp/stm32/stm32f401-st-nucleo/applications/main.c +++ b/bsp/stm32/stm32f401-st-nucleo/applications/main.c @@ -6,16 +6,25 @@ * Change Logs: * Date Author Notes * 2018-11-06 SummerGift first version - * 2022-04-19 Meco Man solve LED interferes with SPI */ #include +#include +#include + +/* defined the LD2 (user LED) pin: PB1 */ +#define LED2_PIN GET_PIN(A, 5) int main(void) { + /* set LED0 pin mode to output */ + rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT); + while (1) { - rt_kprintf("Hello RT-Thread!\n"); - rt_thread_mdelay(1000); + rt_pin_write(LED2_PIN, PIN_HIGH); + rt_thread_mdelay(500); + rt_pin_write(LED2_PIN, PIN_LOW); + rt_thread_mdelay(500); } }