Skip to content

Commit afd9e4c

Browse files
committed
main.c在NANO时调用了device驱动而报错
1 parent 2e9d16a commit afd9e4c

File tree

1 file changed

+14
-0
lines changed
  • bsp/stm32/stm32f429-armfly-v6/applications

1 file changed

+14
-0
lines changed

bsp/stm32/stm32f429-armfly-v6/applications/main.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99
*/
1010

1111
#include <rtthread.h>
12+
#ifndef RT_USING_NANO
1213
#include <rtdevice.h>
14+
#endif
1315
#include <board.h>
1416
#include <drv_ext_io.h>
1517

1618
int main(void)
1719
{
20+
#ifndef RT_USING_NANO
1821
HC574_SetPin(LED1,0);
1922
HC574_SetPin(LED2,0);
2023
HC574_SetPin(LED3,0);
@@ -27,4 +30,15 @@ int main(void)
2730
HC574_SetPin(LED1,0);
2831
rt_thread_mdelay(500);
2932
}
33+
#else
34+
#define LED_PB_8 GET_PIN(B, 8)
35+
rt_pin_mode(LED_PB_8, PIN_MODE_OUTPUT);
36+
while (1)
37+
{
38+
rt_pin_write(LED_PB_8, PIN_HIGH);
39+
rt_thread_mdelay(500);
40+
rt_pin_write(LED_PB_8, PIN_LOW);
41+
rt_thread_mdelay(500);
42+
}
43+
#endif
3044
}

0 commit comments

Comments
 (0)