Skip to content

Conversation

@Daft-Freak
Copy link
Contributor

This fixes a issue that results in the backlight getting disabled with some firmware builds and a lua script containing an error.

More explanation to make that sound less absurd:

  • lua_pcall /lua_error use setjmp/longjmp
  • newlib's setjmp/longjmp don't save/restore floating point regs
  • sleep_fade in the firmware is a float
  • incorrect float registers break sleep updates (ends up removing the clamp to 1.0)
  • out of bounds sleep_fade results in invalid PWM values for backlight
  • /me gets very confused and spends ages debugging

So here's some custom exception handling that saves more registers and seems to work...

Newlib doesn't handle the fpu, causing extremely wierd firmware bugs.
@Daft-Freak Daft-Freak merged commit 17ef70a into 32blit:main Jan 28, 2023
@Daft-Freak Daft-Freak deleted the setjmp branch January 28, 2023 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant