Initial commit

This commit is contained in:
2026-04-06 19:02:09 +08:00
commit d186d7dcc7
743 changed files with 521821 additions and 0 deletions

22
FW/Core/my_src/delay.c Normal file
View File

@@ -0,0 +1,22 @@
#include "stm32h7xx.h"
#include "stm32h7xx_ll_tim.h"
void delay_us(unsigned int nus)
{
LL_TIM_SetCounter(TIM6,0);
LL_TIM_SetAutoReload(TIM6,(10*nus-1));
LL_TIM_EnableCounter(TIM6);
while(!(LL_TIM_IsActiveFlag_UPDATE(TIM6))){
;
}
LL_TIM_ClearFlag_UPDATE(TIM6);
LL_TIM_DisableCounter(TIM6);
}
void delay_ms(unsigned int nms)
{
unsigned int i = 0;
for(i=0;i<nms;i++){
delay_us(1000);
}
}