aboutsummaryrefslogtreecommitdiff
path: root/keyboards/dc01
diff options
context:
space:
mode:
authorJames Churchill <pelrun@gmail.com>2019-01-23 02:57:13 +1000
committerDrashna Jaelre <drashna@live.com>2019-01-22 08:57:13 -0800
commit8cf7265f8fae6f94b17c5d78ed41e52b22e2b218 (patch)
tree232852c96d17fc612a78f788ab8ce713b99c3ffe /keyboards/dc01
parent127ec5f1e38e9472990f956a4b76192c07508feb (diff)
downloadqmk_firmware-8cf7265f8fae6f94b17c5d78ed41e52b22e2b218.tar.gz
qmk_firmware-8cf7265f8fae6f94b17c5d78ed41e52b22e2b218.zip
Rename i2c_slave functions so it can coexist with i2c_master (#4875)
Also merges tx/rx buffers, as only one is necessary.
Diffstat (limited to 'keyboards/dc01')
-rw-r--r--keyboards/dc01/arrow/matrix.c12
-rw-r--r--keyboards/dc01/numpad/matrix.c12
-rw-r--r--keyboards/dc01/right/matrix.c12
3 files changed, 18 insertions, 18 deletions
diff --git a/keyboards/dc01/arrow/matrix.c b/keyboards/dc01/arrow/matrix.c
index 68abb6791..85591f602 100644
--- a/keyboards/dc01/arrow/matrix.c
+++ b/keyboards/dc01/arrow/matrix.c
@@ -195,14 +195,14 @@ uint8_t matrix_scan(void)
195 debouncing = false; 195 debouncing = false;
196 } 196 }
197# endif 197# endif
198 198
199 if (USB_DeviceState != DEVICE_STATE_Configured){ 199 if (USB_DeviceState != DEVICE_STATE_Configured){
200 txbuffer[1] = 0x55; 200 i2c_slave_reg[1] = 0x55;
201 for (uint8_t i = 0; i < MATRIX_ROWS; i++){ 201 for (uint8_t i = 0; i < MATRIX_ROWS; i++){
202 txbuffer[i+2] = matrix[i]; //send matrix over i2c 202 i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c
203 } 203 }
204 } 204 }
205 205
206 matrix_scan_quantum(); 206 matrix_scan_quantum();
207 return 1; 207 return 1;
208} 208}
@@ -396,9 +396,9 @@ static void unselect_cols(void)
396 396
397//this replases tmk code 397//this replases tmk code
398void matrix_setup(void){ 398void matrix_setup(void){
399 399
400 if (USB_DeviceState != DEVICE_STATE_Configured){ 400 if (USB_DeviceState != DEVICE_STATE_Configured){
401 i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c 401 i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
402 sei(); //enable interupts 402 sei(); //enable interupts
403 } 403 }
404} \ No newline at end of file 404} \ No newline at end of file
diff --git a/keyboards/dc01/numpad/matrix.c b/keyboards/dc01/numpad/matrix.c
index f9a9a7f63..39637241d 100644
--- a/keyboards/dc01/numpad/matrix.c
+++ b/keyboards/dc01/numpad/matrix.c
@@ -195,14 +195,14 @@ uint8_t matrix_scan(void)
195 debouncing = false; 195 debouncing = false;
196 } 196 }
197# endif 197# endif
198 198
199 if (USB_DeviceState != DEVICE_STATE_Configured){ 199 if (USB_DeviceState != DEVICE_STATE_Configured){
200 txbuffer[1] = 0x55; 200 i2c_slave_reg[1] = 0x55;
201 for (uint8_t i = 0; i < MATRIX_ROWS; i++){ 201 for (uint8_t i = 0; i < MATRIX_ROWS; i++){
202 txbuffer[i+2] = matrix[i]; //send matrix over i2c 202 i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c
203 } 203 }
204 } 204 }
205 205
206 matrix_scan_quantum(); 206 matrix_scan_quantum();
207 return 1; 207 return 1;
208} 208}
@@ -396,9 +396,9 @@ static void unselect_cols(void)
396 396
397//this replases tmk code 397//this replases tmk code
398void matrix_setup(void){ 398void matrix_setup(void){
399 399
400 if (USB_DeviceState != DEVICE_STATE_Configured){ 400 if (USB_DeviceState != DEVICE_STATE_Configured){
401 i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c 401 i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
402 sei(); //enable interupts 402 sei(); //enable interupts
403 } 403 }
404} \ No newline at end of file 404} \ No newline at end of file
diff --git a/keyboards/dc01/right/matrix.c b/keyboards/dc01/right/matrix.c
index aa2e880d0..50fe19b8d 100644
--- a/keyboards/dc01/right/matrix.c
+++ b/keyboards/dc01/right/matrix.c
@@ -195,14 +195,14 @@ uint8_t matrix_scan(void)
195 debouncing = false; 195 debouncing = false;
196 } 196 }
197# endif 197# endif
198 198
199 if (USB_DeviceState != DEVICE_STATE_Configured){ 199 if (USB_DeviceState != DEVICE_STATE_Configured){
200 txbuffer[1] = 0x55; 200 i2c_slave_reg[1] = 0x55;
201 for (uint8_t i = 0; i < MATRIX_ROWS; i++){ 201 for (uint8_t i = 0; i < MATRIX_ROWS; i++){
202 txbuffer[i+2] = matrix[i]; //send matrix over i2c 202 i2c_slave_reg[i+2] = matrix[i]; //send matrix over i2c
203 } 203 }
204 } 204 }
205 205
206 matrix_scan_quantum(); 206 matrix_scan_quantum();
207 return 1; 207 return 1;
208} 208}
@@ -396,9 +396,9 @@ static void unselect_cols(void)
396 396
397//this replases tmk code 397//this replases tmk code
398void matrix_setup(void){ 398void matrix_setup(void){
399 399
400 if (USB_DeviceState != DEVICE_STATE_Configured){ 400 if (USB_DeviceState != DEVICE_STATE_Configured){
401 i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c 401 i2c_slave_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
402 sei(); //enable interupts 402 sei(); //enable interupts
403 } 403 }
404} \ No newline at end of file 404} \ No newline at end of file