| 1234567891011121314151617181920212223242526 |
- #include "led.h"
- #include "gd32e230_gpio.h"
- #include "SysTick.h"
- unsigned char led_flash_flag;
- void led_init(void)
- {
- rcu_periph_clock_enable(RCU_GPIOA);
- gpio_mode_set(GPIOA, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, GPIO_PIN_8);
- gpio_output_options_set(GPIOA, GPIO_OTYPE_PP, GPIO_OSPEED_50MHZ, GPIO_PIN_8);
- gpio_bit_set(GPIOA, GPIO_PIN_8);
- led_flash_flag = 0;
- }
- void led_flash(unsigned char id)
- {
- if(led_flash_flag)
- {
- gpio_bit_toggle(GPIOA,GPIO_PIN_8);
- led_flash_flag = 0;
- }
- }
|