pass by value to save some flash

pull/365/head
Jesse Vincent 7 years ago
parent 9b44d02e6e
commit b565dab644

@ -75,7 +75,7 @@ void TestMode_::test_leds(void) {
void TestMode_::handleKeyEvent(side_data_t *side, keydata_t oldState, keydata_t newState, uint8_t row, uint8_t col, uint8_t col_offset) {
void TestMode_::handleKeyEvent(side_data_t *side, keydata_t *oldState, keydata_t *newState, uint8_t row, uint8_t col, uint8_t col_offset) {
cRGB red = { b: 0, g: 0, r: 201 } ;
cRGB blue = { b: 201, g: 0, r: 0 } ;
@ -83,8 +83,8 @@ void TestMode_::handleKeyEvent(side_data_t *side, keydata_t oldState, keydata_t
uint8_t keynum = (row * 8) + (col);
uint8_t keyState = ((bitRead(oldState.all, keynum) << 1) |
(bitRead(newState.all, keynum) << 0));
uint8_t keyState = ((bitRead(oldState->all, keynum) << 1) |
(bitRead(newState->all, keynum) << 0));
if (keyState == TOGGLED_ON) {
if (side->cyclesSinceStateChange[keynum] < CHATTER_CYCLE_LIMIT) {
bitSet(side->badKeys, keynum);
@ -128,8 +128,8 @@ void TestMode_::testMatrix() {
}
for (byte row = 0; row < 4; row++) {
for (byte col = 0; col < 8; col++) {
handleKeyEvent(&left, KeyboardHardware.previousLeftHandState, KeyboardHardware.leftHandState, row, col, 7);
handleKeyEvent(&right, KeyboardHardware.previousRightHandState, KeyboardHardware.rightHandState, row, col, 15);
handleKeyEvent(&left, &(KeyboardHardware.previousLeftHandState), &(KeyboardHardware.leftHandState), row, col, 7);
handleKeyEvent(&right, &(KeyboardHardware.previousRightHandState), &(KeyboardHardware.rightHandState), row, col, 15);
}
}
LEDControl.syncLeds();

@ -22,7 +22,7 @@ class TestMode_ : public KaleidoscopePlugin {
static void test_leds();
static void testMatrix();
static void toggle_programming_leds_on();
static void handleKeyEvent(side_data_t *side, keydata_t oldState, keydata_t newState, uint8_t row, uint8_t col, uint8_t col_offset);
static void handleKeyEvent(side_data_t *side, keydata_t *oldState, keydata_t *newState, uint8_t row, uint8_t col, uint8_t col_offset);
static void waitForKeypress();
static void loopHook(bool postClear);
static void set_leds(cRGB color);

Loading…
Cancel
Save