74 lines
2.3 KiB
C
74 lines
2.3 KiB
C
/*
|
|
* @Author: mbw
|
|
* @Date: 2024-08-19 10:10:06
|
|
* @LastEditors: mbw && 1600520629@qq.com
|
|
* @LastEditTime: 2024-09-04 11:42:27
|
|
* @FilePath: \USART1_Interrupt - RT-Thread\user\Source\main.c
|
|
* @Description:
|
|
*
|
|
* Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
|
|
*/
|
|
/************************************************************************************************/
|
|
/**
|
|
* @file main.c
|
|
* @author MCU Ecosystem Development Team
|
|
* @brief 应用程序主流程。
|
|
*
|
|
*
|
|
**************************************************************************************************
|
|
* @attention
|
|
* Copyright (c) CEC Huada Electronic Design Co.,Ltd. All rights reserved.
|
|
*
|
|
**************************************************************************************************
|
|
*/
|
|
|
|
/*------------------------------------------includes--------------------------------------------*/
|
|
|
|
#include "rtthread.h"
|
|
#include "drv_uart.h"
|
|
#include "bsp_rtc.h"
|
|
|
|
|
|
#define LOG_TAG "main"
|
|
#define LOG_LVL LOG_LVL_DBG
|
|
#include <ulog.h>
|
|
|
|
/*--------------------------------------------variables-----------------------------------------*/
|
|
|
|
/*-------------------------------------------functions------------------------------------------*/
|
|
|
|
int main(void)
|
|
{
|
|
// uint8_t rtctime[3], rtcdate[3];
|
|
|
|
// LOG_I("test CIU32 L051 RT-Thread!\r\n");
|
|
// LOG_I("SystemCoreClock = %d MHZ\n", SystemCoreClock/1000000);
|
|
|
|
// UART1_SendString("test CIU32 L051 uart1 dma send RT-Thread!\r\n");
|
|
// LPUART1_SendString("test CIU32 L051 Lpuart1 interrupt send RT-Thread!\r\n");
|
|
|
|
while (1)
|
|
{
|
|
// UART1_SendString("test CIU32 L051 uart1 dma send RT-Thread!\r\n");
|
|
// LPUART1_SendString("test CIU32 L051 lpuart1 send RT-Thread!\r\n");
|
|
/* 获取日历日期与时间 */
|
|
// BSP_Rtc_Get_Calendar(rtcdate, rtctime);
|
|
// LOG_D("RTC Time: %04d-%02d-%02d %02d:%02d:%02d\n",
|
|
// 2000 + std_rtc_convert_bcd2bin(rtcdate[0]),std_rtc_convert_bcd2bin(rtcdate[1]), std_rtc_convert_bcd2bin(rtcdate[2]),
|
|
// std_rtc_convert_bcd2bin(rtctime[0]), std_rtc_convert_bcd2bin(rtctime[1]), std_rtc_convert_bcd2bin(rtctime[2]));
|
|
rt_thread_mdelay(10);
|
|
}
|
|
}
|
|
|
|
// 软件复位函数
|
|
void System_Reset(void)
|
|
{
|
|
NVIC_SystemReset(); // 进行软件复位
|
|
}
|
|
/* 导出到 msh 命令列表中 */
|
|
MSH_CMD_EXPORT(System_Reset, "System_Reset");
|
|
|
|
|
|
|
|
|