/****************** (C) COPYRIGHT 風馳iCreate嵌入式開發工作室 *****************
* 文件名 :main.c
* 描述 :按鍵掃描
* 實驗平臺:iCreate STM8開發板
* 庫版本 :V2.1.0
* 作者 :風馳 QQ:779814207
* 博客 :
* 修改時間 :2011-12-20
*******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"
#include "led.h"
#include "key_scan.h"
#include "sysclock.h"
/* Private defines -----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
int main(void)
{
/* 設置外部24M晶振為系統主時鐘 */
SystemClock_Init(HSE_Clock);
Key_Init();
LED_Init();
//LED_Operation(LED_1, ON);
while (1)
{
/* 添加你的代碼 */
if (!Key_State_Check(KEY_1)) {
LED_Reverse(LED_2);
}
if (!Key_State_Check(KEY_2)) {
LED_Reverse(LED_3);
}
}
}
#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(u8* file, u32 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) */
/* Infinite loop */
while (1)
{
}
}
#endif
/******************* (C) COPYRIGHT 風馳iCreate嵌入式開發工作室 *****END OF FILE****/
|