From 151feb4723fcae6eaef1e8cfd39f051e1641bcdd Mon Sep 17 00:00:00 2001 From: "jonathan.liu" Date: Fri, 28 Sep 2018 17:54:08 -0700 Subject: [PATCH] Change back to LED IDs starting at 1 --- tmk_core/protocol/arm_atsam/led_matrix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index 898649c8fa8..1ab16969a3b 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -394,8 +394,8 @@ void led_matrix_run(led_setup_t *f) led_run_pattern(f, &ro, &go, &bo, led_cur->px); } else { uint8_t skip; - uint8_t modid = led_cur->id / 32; //PS: Calculate which id# contains the led bit - uint32_t modidbit = 1 << (led_cur->id % 32); //PS: Calculate the bit within the id# + uint8_t modid = (led_cur->id - 1) / 32; //PS: Calculate which id# contains the led bit + uint32_t modidbit = 1 << ((led_cur->id - 1) % 32); //PS: Calculate the bit within the id# uint32_t *bitfield; //PS: Will point to the id# within the current instruction while (!led_cur_instruction->end) {