Move all remaining state into the single store, woot!

This commit is contained in:
Josh Klar
2018-09-03 15:21:34 -07:00
parent b9dfffd2b3
commit ffd47c478f
4 changed files with 139 additions and 34 deletions

View File

@@ -2,17 +2,32 @@ from micropython import const
KEY_UP_EVENT = const(1)
KEY_DOWN_EVENT = const(2)
INIT_FIRMWARE_EVENT = const(3)
def key_up_event(keycode):
def init_firmware(keymap, row_pins, col_pins, diode_orientation):
return {
'type': INIT_FIRMWARE_EVENT,
'keymap': keymap,
'row_pins': row_pins,
'col_pins': col_pins,
'diode_orientation': diode_orientation,
}
def key_up_event(keycode, row, col):
return {
'type': KEY_UP_EVENT,
'keycode': keycode,
'row': row,
'col': col,
}
def key_down_event(keycode):
def key_down_event(keycode, row, col):
return {
'type': KEY_DOWN_EVENT,
'keycode': keycode,
'row': row,
'col': col,
}