72 lines
1.5 KiB
C
72 lines
1.5 KiB
C
/**
|
|
******************************************************************************
|
|
* @file main.c
|
|
* @author Alexander
|
|
* @version V1.0
|
|
* @date 2022-xx-xx
|
|
* @brief 测试led
|
|
******************************************************************************
|
|
* @attention
|
|
*
|
|
* 实验平台:HK32F030M开发板
|
|
* 论坛 :https://bbs.21ic.com/iclist-1010-1.html
|
|
*
|
|
******************************************************************************
|
|
*/
|
|
#include "hk32f030m.h"
|
|
#include "bsp_led.h"
|
|
|
|
#define SOFT_DELAY Delay(0x0FFFFF);
|
|
|
|
void Delay(__IO uint32_t nCount);
|
|
|
|
/**
|
|
* @brief 主函数
|
|
* @param 无
|
|
* @retval 无
|
|
*/
|
|
|
|
int main(void)
|
|
{
|
|
/* LED 端口初始化 */
|
|
LED_GPIO_Config();
|
|
|
|
while (1)
|
|
{
|
|
LED2_ON;
|
|
LED2_OFF;
|
|
// digitalLo(LED2_GPIO_PORT,LED2_GPIO_PIN);
|
|
//SOFT_DELAY;
|
|
// digitalHi(LED2_GPIO_PORT,LED2_GPIO_PIN);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
void Delay(__IO uint32_t nCount) //简单的延时函数
|
|
{
|
|
for(; nCount != 0; nCount--);
|
|
}
|
|
|
|
#ifdef USE_FULL_ASSERT
|
|
/**
|
|
* @brief Reports the name of the source file and the source line number
|
|
* where the assert_param error has occurred.
|
|
* @param file: pointer to the source file name
|
|
* @param line: assert_param error line source number
|
|
* @retval None
|
|
*/
|
|
void assert_failed(char* file , uint32_t line)
|
|
{
|
|
/* User can add his own implementation to report the file name and line number,
|
|
tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
|
/* Infinite loop */
|
|
|
|
while (1)
|
|
{
|
|
}
|
|
}
|
|
#endif /* USE_FULL_ASSERT */
|
|
|
|
|