Commit 274dcfc7 authored by Sven Greiner's avatar Sven Greiner
Browse files

Move state back into RAM

With this change I was able to remove most (if not all) of the
weirdness (at the cost of additional 14 bytes of flash). I assume that
cutting the power at the wrong time caused a specific state of the
registers that led to wrong jumps in the optimized code.
parent 0d7acfeb
......@@ -109,7 +109,7 @@ const uint8_t __flash voltage_table[] = { 0, BAT_25P, BAT_50P, BAT_75P };
// Non-initialized variables
uint8_t cold_boot_detect[CBD_BYTES] __attribute__((section(".noinit")));
register enum State state asm("r2");
volatile enum State state __attribute__((section(".noinit")));
register uint8_t output asm("r3");
register uint8_t fast_presses asm("r4");
register uint8_t ramping_up asm("r5");
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment