From c44d75f1bc5aa3842fe62dcf830fe54173e1dfe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Mon, 9 Jan 2017 02:40:20 +0100 Subject: [PATCH] Enable as many LED rows as possible without interfering with I2C communication. --- right/src/led_driver.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/right/src/led_driver.c b/right/src/led_driver.c index 78b0f5d..f5b3cce 100644 --- a/right/src/led_driver.c +++ b/right/src/led_driver.c @@ -38,4 +38,32 @@ void LedDriver_SetAllLedsTo(uint8_t val) LedDriver_WriteRegister(address, i, 0x00); } } + + for (uint8_t i=FRAME_REGISTER_PWM_FIRST; i<=FRAME_REGISTER_PWM_LAST; i++) { + LedDriver_WriteRegister(I2C_ADDRESS_LED_DRIVER_RIGHT, i, 0xff); + } + + uint8_t buffer[] = { + FRAME_REGISTER_PWM_FIRST, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // keys 1 + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // keys 2 + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // keys 3 + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // keys 4 + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // keys 5 blocks slowly + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // keys 6 blocks slowly + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // keys 7 blocks slowly + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // keys 8 blocks slowly + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // keys 9 blocks quickly + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // display + }; + I2cWrite(I2C_MAIN_BUS_BASEADDR, I2C_ADDRESS_LED_DRIVER_LEFT, buffer, sizeof(buffer)); + }