Commit 82fa080d authored by Sven Greiner's avatar Sven Greiner

Move more global variables into registers

Now we use registers in the function call area. But we don't use any
functions with many arguments, so this is not a problem and saves 56
parent 4c9c54e5
......@@ -103,17 +103,19 @@ const uint8_t __flash ramp_values[] = { RAMP_VALUES };
const uint8_t __flash fixed_values[] = { FIXED_VALUES };
const uint8_t __flash voltage_table[] = { 0, BAT_25P, BAT_50P, BAT_75P };
// Variables that are not initialized and survive a restart for a short time
uint8_t cold_boot_detect[CBD_BYTES] __attribute__((section(".noinit")));
enum State state __attribute__((section(".noinit")));
uint8_t output __attribute__((section(".noinit")));
uint8_t fast_presses __attribute__((section(".noinit")));
uint8_t ramping_up __attribute__((section(".noinit")));
register Options options asm("r7");
register uint8_t output_eeprom asm("r6");
register uint8_t output_eeprom_pos asm("r5");
register uint8_t microticks asm("r4");
register uint8_t ticks asm("r3");
register enum State state asm("r2");
register uint8_t output asm("r3");
register uint8_t fast_presses asm("r4");
register uint8_t ramping_up asm("r5");
// Variables that will be initialized on start
register Options options asm("r6");
register uint8_t output_eeprom asm("r7");
register uint8_t output_eeprom_pos asm("r8");
register uint8_t microticks asm("r9");
register uint8_t ticks asm("r10");
* Busy wait delay with 10 ms resolution. This function allows to choose the
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment