Changes int project

1. InitCode for modules generated to different files
2. Added correct interrupt stucture PWM-ADC-MainCode
3. PWM freq and BaseTime freq defined using DEFINES in main.c
This commit is contained in:
on4ip84 2023-08-18 17:04:11 +03:00
parent d1674a69e7
commit ee1319b10e
26 changed files with 1380 additions and 749 deletions

32
App/appIsrCallBacks.c Normal file
View file

@ -0,0 +1,32 @@
/*
* appIsrCallBacks.c
*
* Created on: 18 авг. 2023 г.
* Author: on4ip
*/
#include "main.h"
uint32_t adcTick=0;
uint16_t adc1Data=0;
uint16_t adc2Data=0;
void adcIsrCallBack(void){
adcTick++;
adc1Data = LL_ADC_INJ_ReadConversionData12(ADC1, LL_ADC_INJ_RANK_1);
adc2Data = LL_ADC_INJ_ReadConversionData12(ADC1, LL_ADC_INJ_RANK_2);
LL_ADC_ClearFlag_JEOS(ADC1);
}
uint32_t tim1msTick=0;
void tim1msCallBack(void){
tim1msTick++;
LL_GPIO_TogglePin(LED1_GPIO_Port, LED1_Pin);
LL_TIM_ClearFlag_UPDATE(TIM2);
}
uint32_t timPwmTick =0;
void timPwmCallBack(void){
timPwmTick++;
LL_GPIO_TogglePin(LED2_GPIO_Port, LED2_Pin);
LL_TIM_ClearFlag_CC4(TIM1);
}

16
App/appIsrCallBacks.h Normal file
View file

@ -0,0 +1,16 @@
/*
* appIsrCallBacks.h
*
* Created on: 18 авг. 2023 г.
* Author: on4ip
*/
#ifndef APPISRCALLBACKS_H_
#define APPISRCALLBACKS_H_
void adcIsrCallBack(void);
void tim1msCallBack(void);
void timPwmCallBack(void);
#endif /* APPISRCALLBACKS_H_ */