Floating point calculation in ISRs
Hi there,
I am using an STM32 G4 MCU for my project, and the FPU is enabled for this project. I need to implement complex floating point calculations in different ISRs with different priorities. Are there any potential risks associated with doing this? If so, are there any solutions to mitigate the problem?
A short code snippet is shown below:
#incldue <math.h>
float a;
float b;
float k = const_float_value;
float c;
float d = const_float_valued;
float e;
void isr_adc_high_handler(void)
{
a = some_float_value; //ADC value converted to a
b = some_other_float_value // ADC value converted to b
c = k * (a + b)/(a-b);
}
void isr_sys_tick_low_handler(void)
{
e = c * d; //Convert ADC sample result to e every 1ms
}
Thanks!
