代码拉取完成,页面将自动刷新
/******************************************************************************
* @brief 平台相关初始化(无低功耗管理)
*
* Copyright (c) 2020, <morro_luo@163.com>
*
* SPDX-License-Identifier: Apache-2.0
*
******************************************************************************/
#include "module.h"
#include "public.h"
#include "config.h"
#include "platform.h"
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include "tty.h"
/*
* @brief 系统滴答中断
* @param[in] none
* @return none
*/
void SysTick_Handler(void)
{
systick_increase(SYS_TICK_INTERVAL);
}
/*
* @brief 重定向printf
*/
int fputc(int c, FILE *f)
{
tty.write(&c, 1);
while (tty.tx_isfull()) {} //防止丢LOG
return c;
}
/*
* @brief 硬件驱动初始化
* @param[in] none
* @return none
*/
static void bsp_init(void)
{
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
tty.init(115200);
SystemCoreClockUpdate();
SysTick_Config(SystemCoreClock / (1000 / SYS_TICK_INTERVAL)); //配置系统时钟
NVIC_SetPriority(SysTick_IRQn, 0);
wdog_conf(MAX_DOG_FEED_TIME); //初始化看门狗
}system_init("bsp", bsp_init);
/*
* @brief 喂狗任务
*/
static void wdog_task(void)
{
IWDG_ReloadCounter();
}task_register("dog", wdog_task, 1000);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。