some questions when use IRAM_ATTR

edisonPan
Posts: 1
Joined: Wed Jan 10, 2018 12:43 am

some questions when use IRAM_ATTR

Postby edisonPan » Wed Jan 10, 2018 1:17 am

dear:

in my esp32 app,there is a Timer group0 ISR handler,as follow:
float dataFloat;
int dataInt;
void IRAM_ATTR imer_group0_isr(void *para)
{
dtaInt = 123;
dataFloat = (float)dataInt;
// will be error when i use "make monitor" to run it,but it is ok when compile when i use "make flash"
。。。。。。。。。。。。。。
}
void Test_int_to_float()
{
dtaInt = 123;
dataFloat = (float)dataInt;
// it is ok
}
in the IRAM_ATTR function,the software will reboot because of "dataFloat = (float)dataInt",,,but when i put this in a function has no "IRAM_ATTR " ,it is ok.
please help me ,thanks!

ESP_Sprite
Posts: 8999
Joined: Thu Nov 26, 2015 4:08 am

Re: some questions when use IRAM_ATTR

Postby ESP_Sprite » Wed Jan 10, 2018 2:16 am

Sorry, you can't use floating point calculations in an ISR at the moment because the ISR handler does not save/restore the floating point coprocessor state.

Who is online

Users browsing this forum: Baidu [Spider], ESP_Roland, hugerobber, SvanteKaiser and 100 guests