keyboard_comm: fix macro buffer size retrieval, fix unit tests
parent
464228cb4b
commit
dfc37b143f
|
|
@ -170,7 +170,7 @@ class Keyboard:
|
||||||
""" Loads macro information from the keyboard """
|
""" Loads macro information from the keyboard """
|
||||||
data = self.usb_send(self.dev, struct.pack("B", CMD_VIA_MACRO_GET_COUNT))
|
data = self.usb_send(self.dev, struct.pack("B", CMD_VIA_MACRO_GET_COUNT))
|
||||||
self.macro_count = data[1]
|
self.macro_count = data[1]
|
||||||
data = self.usb_send(self.dev, struct.pack(">H", CMD_VIA_MACRO_GET_BUFFER_SIZE))
|
data = self.usb_send(self.dev, struct.pack("B", CMD_VIA_MACRO_GET_BUFFER_SIZE))
|
||||||
self.macro_memory = struct.unpack(">H", data[1:3])[0]
|
self.macro_memory = struct.unpack(">H", data[1:3])[0]
|
||||||
|
|
||||||
def set_key(self, layer, row, col, code):
|
def set_key(self, layer, row, col, code):
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,10 @@ class TestKeyboard(unittest.TestCase):
|
||||||
dev.expect_encoders(encoders)
|
dev.expect_encoders(encoders)
|
||||||
# layout options
|
# layout options
|
||||||
dev.expect("0202", "020200000000")
|
dev.expect("0202", "020200000000")
|
||||||
|
# macro count
|
||||||
|
dev.expect("0C", "0C00")
|
||||||
|
# macro buffer size
|
||||||
|
dev.expect("0D", "0D0000")
|
||||||
|
|
||||||
kb = Keyboard(dev, dev.sim_send)
|
kb = Keyboard(dev, dev.sim_send)
|
||||||
# simulate old VIA keymap retrieval in tests for now
|
# simulate old VIA keymap retrieval in tests for now
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue