Skip to content

Commit

Permalink
Support for ESP8266 - NodeMCU modules
Browse files Browse the repository at this point in the history
Fixed a crash of the ESP8266 - NodeMCU modules.
  • Loading branch information
Estylos authored Jul 2, 2017
1 parent 36b67c2 commit 14579da
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions PS2Keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const PROGMEM PS2Keymap_t PS2Keymap_US = {
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
0, 0, 0, PS2_F7 },
0
{0}
};


Expand Down Expand Up @@ -190,7 +190,7 @@ const PROGMEM PS2Keymap_t PS2Keymap_German = {
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
0, 0, 0, PS2_F7 },
1,
{1},
// with altgr
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, 0, 0,
Expand Down Expand Up @@ -249,7 +249,7 @@ const PROGMEM PS2Keymap_t PS2Keymap_French = {
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
0, 0, 0, PS2_F7 },
1,
{1},
// with altgr
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, 0, 0,
Expand Down Expand Up @@ -307,7 +307,7 @@ const PROGMEM PS2Keymap_t PS2Keymap_Spanish = {
'0', '.', '2', '5', '6', '8', PS2_ESC, 0 /*NumLock*/,
PS2_F11, '+', '3', '-', '*', '9', PS2_SCROLL, 0,
0, 0, 0, PS2_F7 },
1,
{1},
// with altgr
{0, PS2_F9, 0, PS2_F5, PS2_F3, PS2_F1, PS2_F2, PS2_F12,
0, PS2_F10, PS2_F8, PS2_F6, PS2_F4, PS2_TAB, '\\', 0,
Expand Down
9 changes: 8 additions & 1 deletion PS2Keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,14 @@
typedef struct {
uint8_t noshift[PS2_KEYMAP_SIZE];
uint8_t shift[PS2_KEYMAP_SIZE];
uint8_t uses_altgr;
uint8_t uses_altgr[1];
/*
* "uint8_t uses_altgr;" makes the ESP8266 - NodeMCU modules crash.
* So, I replaced it with a array and... It works!
* I think it's because of the 32-bit architecture of the ESP8266
* and the use of the flash memory to store the keymaps.
* Maybe I'm wrong, it remains a hypothesis.
*/
uint8_t altgr[PS2_KEYMAP_SIZE];
} PS2Keymap_t;

Expand Down

0 comments on commit 14579da

Please sign in to comment.