Skip to content

Commit bb0b10a

Browse files
committed
stm32: do not declare ADC interrupts unless using SIMPLEFOC_STM32_ADC_INTERRUPT
1 parent 9608741 commit bb0b10a

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/current_sense/hardware_specific/stm32/stm32f1/stm32f1_hal.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ int _adc_gpio_init(Stm32CurrentSenseParams* cs_params, const int pinA, const int
190190
return 0;
191191
}
192192

193-
193+
#ifdef SIMPLEFOC_STM32_ADC_INTERRUPT
194194
extern "C" {
195195
void ADC1_2_IRQHandler(void)
196196
{
@@ -207,5 +207,6 @@ extern "C" {
207207
}
208208
#endif
209209
}
210+
#endif
210211

211212
#endif

src/current_sense/hardware_specific/stm32/stm32g4/stm32g4_hal.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ int _adc_gpio_init(Stm32CurrentSenseParams* cs_params, const int pinA, const int
246246
return 0;
247247
}
248248

249-
249+
#ifdef SIMPLEFOC_STM32_ADC_INTERRUPT
250250
extern "C" {
251251
void ADC1_2_IRQHandler(void)
252252
{
@@ -279,4 +279,5 @@ extern "C" {
279279
}
280280
#endif
281281
}
282+
#endif
282283
#endif

src/current_sense/hardware_specific/stm32/stm32h7/stm32h7_hal.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int _adc_gpio_init(Stm32CurrentSenseParams* cs_params, const int pinA, const int
227227
return 0;
228228
}
229229

230-
230+
#ifdef SIMPLEFOC_STM32_ADC_INTERRUPT
231231
extern "C" {
232232
void ADC_IRQHandler(void)
233233
{
@@ -247,5 +247,6 @@ extern "C" {
247247
}
248248
}
249249
#endif
250+
#endif
250251

251252
#endif

src/current_sense/hardware_specific/stm32/stm32l4/stm32l4_hal.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ int _adc_gpio_init(Stm32CurrentSenseParams* cs_params, const int pinA, const int
245245
return 0;
246246
}
247247

248+
#ifdef SIMPLEFOC_STM32_ADC_INTERRUPT
248249
extern "C" {
249250
void ADC1_2_IRQHandler(void)
250251
{
@@ -277,5 +278,6 @@ extern "C" {
277278
}
278279
#endif
279280
}
281+
#endif
280282

281283
#endif

0 commit comments

Comments
 (0)