From 9c28e7574073507108daa81009443bd4963ca380 Mon Sep 17 00:00:00 2001 From: zhyinch <zhyinch@gmail.com> Date: 星期五, 03 十二月 2021 15:04:00 +0800 Subject: [PATCH] 修改注册标签记录容量 --- 源码/核心板/Src/OnChipDevices/Rcc_Nvic_Systick.c | 53 ++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 42 insertions(+), 11 deletions(-) diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Rcc_Nvic_Systick.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Rcc_Nvic_Systick.c" index e526fb3..c24e061 100644 --- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Rcc_Nvic_Systick.c" +++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/OnChipDevices/Rcc_Nvic_Systick.c" @@ -133,19 +133,50 @@ NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; - NVIC_Init(&NVIC_InitStructure); - - NVIC_InitStructure.NVIC_IRQChannel = RTCAlarm_IRQn; - NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; - NVIC_InitStructure.NVIC_IRQChannelCmd =ENABLE; +// NVIC_InitStructure.NVIC_IRQChannel = USART1_IRQn; +// NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; +// NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; +// NVIC_Init(&NVIC_InitStructure); +// +// NVIC_InitStructure.NVIC_IRQChannel = RTCAlarm_IRQn; +// NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; +// NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; +// NVIC_InitStructure.NVIC_IRQChannelCmd =ENABLE; NVIC_Init(&NVIC_InitStructure); } - +//?????3????? +//???????APB1?2?,?APB1?36M +//arr:?????? +//psc:?????? +//?????????3! +void TIM3_Int_Init(void) +{ + TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; + NVIC_InitTypeDef NVIC_InitStructure; + + RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); //???? + + //???TIM3??? + TIM_TimeBaseStructure.TIM_Period = 1000-1; //??????????????????????????? + TIM_TimeBaseStructure.TIM_Prescaler =72-1; //??????TIMx??????????? + TIM_TimeBaseStructure.TIM_ClockDivision = TIM_CKD_DIV1; //??????:TDTS = Tck_tim + TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up; //TIM?????? + TIM_TimeBaseInit(TIM3, &TIM_TimeBaseStructure); //??????????TIMx??????? + + TIM_ITConfig(TIM3,TIM_IT_Update,ENABLE ); //?????TIM3??,?????? + + //?????NVIC?? + NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn; //TIM3?? + NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; //?????0? + NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; //????3? + NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQ????? + NVIC_Init(&NVIC_InitStructure); //???NVIC??? + + + TIM_Cmd(TIM3, ENABLE); //??TIMx +} +//???3?????? int Systick_Init(void) { int time_retry = 500; @@ -164,7 +195,7 @@ void delay_us(uint32_t nTimer) { uint32_t i=0; - for(i=0;i<nTimer;i++){ + for(i=0;i<nTimer*5;i++){ __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP(); __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP(); __NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP();__NOP(); -- Gitblit v1.9.3