stakwork / sphinx-key

Lightning hardware signer on ESP32
29 stars 1 forks source link

Custom stack size #103

Closed irriden closed 1 year ago

irriden commented 1 year ago

This customizes the stack sizes of both the LED and the button loops.

I would have expected a 16K increase in available DRAM, since we go from 10K stack size to 2.5K for button stack size, and to 1.5K for led stack size. But available DRAM only increases by 2K compared to master.

So this is a soft pull request. Happy to close if not worth it.

I also introduce three unsafe calls in main.rs, as these allow me to be able to loop on the attempt to spawn the thread while still passing ownership into the thread. I looked into avoiding these unsafe calls, but didn't find an immediate solution.

Happy to look into it further.

irriden commented 1 year ago

Right now the addition of the LED and button loops costs 13K bytes, so we are at about 90K bytes after startup.

Comment out the led and the button loops in main, and we get right back to 103K.