CIU32_L051_M307R/user/Source/main.c

72 lines
1.9 KiB
C

/*
* @Author: mbw
* @Date: 2024-08-19 10:10:06
* @LastEditors: mbw && 1600520629@qq.com
* @LastEditTime: 2024-09-05 13:38:33
* @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"
#include "drv_gpio.h"
#include "dev_pin.h"
#include "user_rtt.h"
#define LOG_TAG "main"
#define LOG_LVL LOG_LVL_DBG
#include <ulog.h>
/*--------------------------------------------variables-----------------------------------------*/
#define LED0_PIN GET_PIN(B, 8)
/*-------------------------------------------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);
rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
while (1)
{
rt_pin_write(LED0_PIN, PIN_HIGH);
rt_thread_mdelay(1000);
rt_pin_write(LED0_PIN, PIN_LOW);
rt_thread_mdelay(1000);
}
}
// 软件复位函数
void System_Reset(void)
{
NVIC_SystemReset(); // 进行软件复位
}
/* 导出到 msh 命令列表中 */
MSH_CMD_EXPORT(System_Reset, "System_Reset");