113 Star 909 Fork 443

魔罗/CodeBrick

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
platform.c 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
魔罗 提交于 2021-03-07 18:40 +08:00 . 适配并调通低功耗管理模块
/******************************************************************************
* @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);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/moluo-tech/CodeBrick.git
git@gitee.com:moluo-tech/CodeBrick.git
moluo-tech
CodeBrick
CodeBrick
master

搜索帮助