void Delay(__IO uint32_t nCount)
{
for(; nCount != 0; nCount--);
}
int main(void)
{
/*!< At this stage the microcontroller clock setting is already configured,
this is done through SystemInit() function which is called from startup
file (KEIL_startup_hk32f030m.s) before to branch to application main.
To reconfigure the default setting of SystemInit() function, refer to
system_hk32f030m.c file
*/
/* Initialize LEDs mounted on EVAL board */
HK_EVAL_LEDInit(LED1);
HK_EVAL_LEDInit(LED2);
HK_EVAL_LEDInit(LED3);
/* Configure PC4 in interrupt mode */
EXTI4_Config();
/* Configure PA1 in interrupt mode */
EXTI1_Config();
/* Delay(838709/5);Infinite loop */
while (1)
{
Delay(838709/5);
}
}
/* Clear the EXTI line 0 pending bit */
EXTI_ClearITPendingBit(EXTI_Line1);
}
}
/**
* @brief This function handles External line 4 interrupt request.
* @param None
* @retval None
*/
void EXTI4_IRQHandler(void)
{
if(EXTI_GetITStatus(EXTI_Line4) != RESET)
{
/* Toggle LED1 */
HK_EVAL_LEDToggle(LED1);
/* Clear the EXTI line 4 pending bit */
EXTI_ClearITPendingBit(EXTI_Line4);
}
}
#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(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */