From c68ee60ecaec9222da3e4a3baac948cd0bfd2da9 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Sat, 30 Mar 2019 18:20:43 +0900 Subject: [PATCH] update split_common/transport.c, improves maintainability of serial transaction IDs. No change in build result. --- quantum/split_common/transport.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index 8a6128f1fe..4d52039aa0 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -128,9 +128,15 @@ volatile Serial_s2m_buffer_t serial_s2m_buffer = {}; volatile Serial_m2s_buffer_t serial_m2s_buffer = {}; uint8_t volatile status0 = 0; +enum serial_transaction_id { + GET_SLAVE_MATRIX = 0, +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + PUT_RGBLIGHT, +#endif +}; + SSTD_t transactions[] = { - { -#define GET_SLAVE_MATRIX 0 + [GET_SLAVE_MATRIX] = { (uint8_t *)&status0, sizeof(serial_m2s_buffer), (uint8_t *)&serial_m2s_buffer, @@ -138,12 +144,11 @@ SSTD_t transactions[] = { (uint8_t *)&serial_s2m_buffer, }, #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) -#define PUT_RGBLIGHT 1 - { + [PUT_RGBLIGHT] = { (uint8_t *)&status_rgblight, sizeof(serial_rgblight), (uint8_t *)&serial_rgblight, - 0, NULL + 0, NULL // no slave to master transfer }, #endif };