mirror of
https://gitee.com/moluo-tech/AT-Command
synced 2025-06-18 08:27:51 +00:00
53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
![]() |
/******************************************************************************
|
|||
|
* @brief ƽ̨<EFBFBD><EFBFBD><EFBFBD>س<EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|||
|
*
|
|||
|
* 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 ϵͳ<EFBFBD>δ<EFBFBD><EFBFBD>ж<EFBFBD>
|
|||
|
* @param[in] none
|
|||
|
* @return none
|
|||
|
*/
|
|||
|
void SysTick_Handler(void)
|
|||
|
{
|
|||
|
systick_increase(SYS_TICK_INTERVAL);
|
|||
|
}
|
|||
|
|
|||
|
/*
|
|||
|
* @brief <EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>printf
|
|||
|
*/
|
|||
|
int fputc(int c, FILE *f)
|
|||
|
{
|
|||
|
tty.write(&c, 1);
|
|||
|
while (!tty.rx_isempty()) {}
|
|||
|
while (tty.tx_isfull()) {} //<2F><>ֹ<EFBFBD><D6B9>LOG
|
|||
|
return c;
|
|||
|
}
|
|||
|
|
|||
|
/*
|
|||
|
* @brief Ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
|
|||
|
* @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)); //<2F><><EFBFBD><EFBFBD>ϵͳʱ<CDB3><CAB1>
|
|||
|
NVIC_SetPriority(SysTick_IRQn, 0);
|
|||
|
|
|||
|
}system_init("bsp", bsp_init);
|