diff options
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/split_common/transport.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index 977b5dc33..61b61ea08 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c | |||
| @@ -78,9 +78,9 @@ static I2C_slave_buffer_t *const i2c_buffer = (I2C_slave_buffer_t *)i2c_slave_re | |||
| 78 | // Get rows from other half over i2c | 78 | // Get rows from other half over i2c |
| 79 | bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { | 79 | bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) { |
| 80 | i2c_readReg(SLAVE_I2C_ADDRESS, I2C_KEYMAP_SLAVE_START, (void *)slave_matrix, sizeof(i2c_buffer->smatrix), TIMEOUT); | 80 | i2c_readReg(SLAVE_I2C_ADDRESS, I2C_KEYMAP_SLAVE_START, (void *)slave_matrix, sizeof(i2c_buffer->smatrix), TIMEOUT); |
| 81 | #ifdef SPLIT_TRANSPORT_MIRROR | 81 | # ifdef SPLIT_TRANSPORT_MIRROR |
| 82 | i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_KEYMAP_MASTER_START, (void *)master_matrix, sizeof(i2c_buffer->mmatrix), TIMEOUT); | 82 | i2c_writeReg(SLAVE_I2C_ADDRESS, I2C_KEYMAP_MASTER_START, (void *)master_matrix, sizeof(i2c_buffer->mmatrix), TIMEOUT); |
| 83 | #endif | 83 | # endif |
| 84 | 84 | ||
| 85 | // write backlight info | 85 | // write backlight info |
| 86 | # ifdef BACKLIGHT_ENABLE | 86 | # ifdef BACKLIGHT_ENABLE |
| @@ -153,10 +153,10 @@ void transport_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) | |||
| 153 | sync_timer_update(i2c_buffer->sync_timer); | 153 | sync_timer_update(i2c_buffer->sync_timer); |
| 154 | # endif | 154 | # endif |
| 155 | // Copy matrix to I2C buffer | 155 | // Copy matrix to I2C buffer |
| 156 | memcpy((void*)i2c_buffer->smatrix, (void *)slave_matrix, sizeof(i2c_buffer->smatrix)); | 156 | memcpy((void *)i2c_buffer->smatrix, (void *)slave_matrix, sizeof(i2c_buffer->smatrix)); |
| 157 | #ifdef SPLIT_TRANSPORT_MIRROR | 157 | # ifdef SPLIT_TRANSPORT_MIRROR |
| 158 | memcpy((void*)master_matrix, (void *)i2c_buffer->mmatrix, sizeof(i2c_buffer->mmatrix)); | 158 | memcpy((void *)master_matrix, (void *)i2c_buffer->mmatrix, sizeof(i2c_buffer->mmatrix)); |
| 159 | #endif | 159 | # endif |
| 160 | 160 | ||
| 161 | // Read Backlight Info | 161 | // Read Backlight Info |
| 162 | # ifdef BACKLIGHT_ENABLE | 162 | # ifdef BACKLIGHT_ENABLE |
| @@ -208,23 +208,23 @@ typedef struct _Serial_s2m_buffer_t { | |||
| 208 | 208 | ||
| 209 | typedef struct _Serial_m2s_buffer_t { | 209 | typedef struct _Serial_m2s_buffer_t { |
| 210 | # ifdef SPLIT_MODS_ENABLE | 210 | # ifdef SPLIT_MODS_ENABLE |
| 211 | uint8_t real_mods; | 211 | uint8_t real_mods; |
| 212 | uint8_t weak_mods; | 212 | uint8_t weak_mods; |
| 213 | # ifndef NO_ACTION_ONESHOT | 213 | # ifndef NO_ACTION_ONESHOT |
| 214 | uint8_t oneshot_mods; | 214 | uint8_t oneshot_mods; |
| 215 | # endif | 215 | # endif |
| 216 | # endif | 216 | # endif |
| 217 | # ifndef DISABLE_SYNC_TIMER | 217 | # ifndef DISABLE_SYNC_TIMER |
| 218 | uint32_t sync_timer; | 218 | uint32_t sync_timer; |
| 219 | # endif | 219 | # endif |
| 220 | # ifdef SPLIT_TRANSPORT_MIRROR | 220 | # ifdef SPLIT_TRANSPORT_MIRROR |
| 221 | matrix_row_t mmatrix[ROWS_PER_HAND]; | 221 | matrix_row_t mmatrix[ROWS_PER_HAND]; |
| 222 | # endif | 222 | # endif |
| 223 | # ifdef BACKLIGHT_ENABLE | 223 | # ifdef BACKLIGHT_ENABLE |
| 224 | uint8_t backlight_level; | 224 | uint8_t backlight_level; |
| 225 | # endif | 225 | # endif |
| 226 | # ifdef WPM_ENABLE | 226 | # ifdef WPM_ENABLE |
| 227 | uint8_t current_wpm; | 227 | uint8_t current_wpm; |
| 228 | # endif | 228 | # endif |
| 229 | } Serial_m2s_buffer_t; | 229 | } Serial_m2s_buffer_t; |
| 230 | 230 | ||
| @@ -316,10 +316,10 @@ bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) | |||
| 316 | 316 | ||
| 317 | // TODO: if MATRIX_COLS > 8 change to unpack() | 317 | // TODO: if MATRIX_COLS > 8 change to unpack() |
| 318 | for (int i = 0; i < ROWS_PER_HAND; ++i) { | 318 | for (int i = 0; i < ROWS_PER_HAND; ++i) { |
| 319 | slave_matrix[i] = serial_s2m_buffer.smatrix[i]; | 319 | slave_matrix[i] = serial_s2m_buffer.smatrix[i]; |
| 320 | #ifdef SPLIT_TRANSPORT_MIRROR | 320 | # ifdef SPLIT_TRANSPORT_MIRROR |
| 321 | serial_m2s_buffer.mmatrix[i] = master_matrix[i]; | 321 | serial_m2s_buffer.mmatrix[i] = master_matrix[i]; |
| 322 | #endif | 322 | # endif |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | # ifdef BACKLIGHT_ENABLE | 325 | # ifdef BACKLIGHT_ENABLE |
| @@ -358,9 +358,9 @@ void transport_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[]) | |||
| 358 | // TODO: if MATRIX_COLS > 8 change to pack() | 358 | // TODO: if MATRIX_COLS > 8 change to pack() |
| 359 | for (int i = 0; i < ROWS_PER_HAND; ++i) { | 359 | for (int i = 0; i < ROWS_PER_HAND; ++i) { |
| 360 | serial_s2m_buffer.smatrix[i] = slave_matrix[i]; | 360 | serial_s2m_buffer.smatrix[i] = slave_matrix[i]; |
| 361 | #ifdef SPLIT_TRANSPORT_MIRROR | 361 | # ifdef SPLIT_TRANSPORT_MIRROR |
| 362 | master_matrix[i] = serial_m2s_buffer.mmatrix[i]; | 362 | master_matrix[i] = serial_m2s_buffer.mmatrix[i]; |
| 363 | #endif | 363 | # endif |
| 364 | } | 364 | } |
| 365 | # ifdef BACKLIGHT_ENABLE | 365 | # ifdef BACKLIGHT_ENABLE |
| 366 | backlight_set(serial_m2s_buffer.backlight_level); | 366 | backlight_set(serial_m2s_buffer.backlight_level); |
