Floating point in ISR?

cmason
Posts: 9
Joined: Thu Dec 29, 2016 6:39 pm

Floating point in ISR?

Postby cmason » Fri Dec 30, 2016 7:24 pm

Is use of floating point instructions disallowed in interrupt routines?

Thanks,

-c

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

Re: Floating point in ISR?

Postby ESP_Sprite » Mon Jan 02, 2017 2:03 pm

It's not a good idea, no. The floating point registers aren't saved on ISR entry, so using floats in an interrupt means that the fpu registers as used by the currently running thread are corrupted. If there's no such thread, I'm not exactly sure what happens, but my guess would be a coprocessor exception resulting in a panic.

We're aware of this restriction, we're brooding on a nice way to fix it in the future, but for now, please do not use floating point stuff in ISRs.

Who is online

Users browsing this forum: Bing [Bot], ramder and 18 guests