Skip to content

Commit 7d8cfef

Browse files
committed
删除driver中的led相应文件改成直接使用pin操作
1 parent 0c25d7c commit 7d8cfef

File tree

6 files changed

+179
-300
lines changed

6 files changed

+179
-300
lines changed

bsp/acm32f0x0-nucleo/applications/main.c

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,19 @@
1111
#include <rthw.h>
1212
#include <rtthread.h>
1313
#include "board.h"
14+
#include <drivers/pin.h>
1415

15-
/*******************************************************************************
16-
* Function Name : assert_failed
17-
* Description : Reports the name of the source file and the source line number
18-
* where the assert error has occurred.
19-
* Input : - file: pointer to the source file name
20-
* - line: assert error line source number
21-
* Output : None
22-
* Return : None
23-
*******************************************************************************/
24-
25-
void assert_failed(uint8_t *file, uint32_t line)
26-
{
27-
rt_kprintf("\n\r Wrong parameter value detected on\r\n");
28-
rt_kprintf(" file %s\r\n", file);
29-
rt_kprintf(" line %d\r\n", line);
30-
31-
while (1) ;
32-
}
16+
#define LED_PIN_NUM 1 /* PA1 */
3317

3418
int main(void)
3519
{
36-
rt_hw_led_init();
20+
rt_pin_mode(LED_PIN_NUM, PIN_MODE_OUTPUT);
21+
3722
while(1)
3823
{
39-
rt_hw_led_on(0);
24+
rt_pin_write(LED_PIN_NUM, PIN_LOW);
4025
rt_thread_delay(RT_TICK_PER_SECOND/2);
41-
rt_hw_led_off(0);
26+
rt_pin_write(LED_PIN_NUM, PIN_HIGH);
4227
rt_thread_delay(RT_TICK_PER_SECOND/2);
4328
}
4429
}

bsp/acm32f0x0-nucleo/drivers/board.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#include <rtconfig.h>
1515
#include "ACM32Fxx_HAL.h"
16-
#include "led.h"
1716

1817
/*-------------------------- UART CONFIG BEGIN --------------------------*/
1918

bsp/acm32f0x0-nucleo/drivers/led.c

Lines changed: 0 additions & 67 deletions
This file was deleted.

bsp/acm32f0x0-nucleo/drivers/led.h

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)