
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
32 lines
673 B
C
32 lines
673 B
C
/*
|
||
* 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);
|
||
}
|