TT12-MCU/applications/main.c
murmur e52c58d659 iwdt --ok
led --ok
2023-04-27 17:29:44 +08:00

48 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2023-04-27 RT-Thread first version
*/
#include <rtthread.h>
#define LOG_TAG "main"
#define LOG_LVL LOG_LVL_DBG
#include <ulog.h>
#include <board.h>
int main(void)
{
LOG_D("SYSCLK_Frequency = %d", HAL_RCC_GetSysClockFreq());
LOG_D("HCLK_Frequency = %d", HAL_RCC_GetHCLKFreq());
LOG_D("PCLK1_Frequency = %d", HAL_RCC_GetPCLK1Freq());
LOG_D("PCLK2_Frequency = %d", HAL_RCC_GetPCLK2Freq());
#define LED_HEART GET_PIN(E,3)
/* 设置PIN脚模式为输出 */
rt_pin_mode(LED_HEART, PIN_MODE_OUTPUT);
while(1)
{
/* 拉低PIN脚 */
rt_pin_write(LED_HEART, PIN_LOW);
/* 延时1ms省电 */
rt_thread_mdelay(1);//去掉延时共用print替换
// rt_kprintf("Heartbeat.\n");
/* 拉高PIN脚 */
rt_pin_write(LED_HEART, PIN_HIGH);
rt_thread_mdelay(1000);
}
return RT_EOK;
}
//fastlz_test -c demo.bin f.bin