You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kaleidoscope/KeyboardEEPROM.h

20 lines
294 B

#include <EEPROM.h>
void save_current_layer(byte layer)
{
EEPROM.write(EEPROM_LAYER_LOCATION, layer);
}
byte load_current_layer()
{
byte layer = EEPROM.read(EEPROM_LAYER_LOCATION);
if (layer >= LAYERS ) {
return 0; // undefined positions get saved as 255
}
return layer;
}