esrille / new-keyboard

The Esrille New Keyboard
https://www.esrille.com/keyboard/
47 stars 22 forks source link

Document what `__EEPROM_DATA` does in KeyboardCommon.c #5

Closed listx closed 8 years ago

listx commented 8 years ago

Hello this is Linus (recent purchaser of the Nisse keyboard).

I am assuming that the line

__EEPROM_DATA(BASE_QWERTY, KANA_ROMAJI, OS_PC, 1 /* delay */, 0 /* mod */, LED_DEFAULT, IME_MS, 0 /* mouse */);

(found in https://github.com/esrille/new-keyboard/blob/master/firmware/src/KeyboardCommon.c#L34) sets the default initial EEPROM state of the keyboard.

Am I correct?

Could you please document what "delay" and "mod" above means?

I am in the process of writing my own custom layout by modifying the firmware (I am going to modify the unused BASE_COLEMAK layout) and wanted to know more about what this __EEPROM_DATA does.

Thanks.

listx commented 8 years ago

I have a rough idea of what "delay" and "mod" are by looking at this page http://www.esrille.com/keyboard/fn.html. Perhaps we should either link to that page or at least mention in the source code directly what those things mean.

ShikiOkasaka commented 8 years ago

Hi Linus,

You're correct __EEPROM_DATA sets the default values of the FN-F2 to FN-F9 settings. The __EEPROM_DATA macro is provided by XC8, and documented in MPLAB ® XC8 C Compiler User’s Guide.

As you guessed, "delay" is for FN-F5 (DELAY), and "mod" is for FN-F6 (MOD). Probably, I will add macro definitions for those constant values, too.

ShikiOkasaka commented 8 years ago

Done at 4fb3d2cb7967e170b6f931743d3e7606799e0a2f.