update 1.8

This commit is contained in:
qiyongshuang
2023-09-06 10:08:11 +08:00
parent b79c6ac80d
commit 64be955461
760 changed files with 42517 additions and 30957 deletions
@@ -0,0 +1,71 @@
/********************************** (C) COPYRIGHT *******************************
* File Name : main.c
* Author : WCH
* Version : V1.0.0
* Date : 2021/06/06
* Description : Main program body.
*********************************************************************************
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
* Attention: This software (modified or not) and binary are used for
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
*******************************************************************************/
/*
*@Note
*Systick interrupt:
*USART1_Tx(PA9).
*
*
*/
#include "debug.h"
/* Global typedef */
/* Global define */
/* Global Variable */
void SysTick_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
u32 counter=0;
void SYSTICK_Init_Config(u64 ticks)
{
SysTick->SR = 0;
SysTick->CNT = 0;
SysTick->CMP = ticks;
SysTick->CTLR =0xF;
NVIC_SetPriority(SysTicK_IRQn, 15);
NVIC_EnableIRQ(SysTicK_IRQn);
}
void SysTick_Handler(void)
{
printf("welcome to WCH\r\n");
SysTick->SR = 0;
counter++;
printf("Counter:%d\r\n",counter);
}
/*********************************************************************
* @fn main
*
* @brief Main program.
*
* @return none
*/
int main(void)
{
SystemCoreClockUpdate();
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
USART_Printf_Init(115200);
printf("SystemClk:%d\r\n", SystemCoreClock);
printf( "ChipID:%08x\r\n", DBGMCU_GetCHIPID() );
SYSTICK_Init_Config(SystemCoreClock-1);
while(1)
{
}
}