aboutsummaryrefslogtreecommitdiff
path: root/keyboards/preonic
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2021-09-19 14:43:37 -0400
committerGitHub <noreply@github.com>2021-09-19 11:43:37 -0700
commitfa5d21a58ebfe9782225c857ad2e533a0f65d161 (patch)
treeea7c0c8e70b2c0f64396fa92ed521a5f2f4cd40c /keyboards/preonic
parent0e34efd9a2dd401a7cd38f552f7247b8afcb65fc (diff)
downloadqmk_firmware-fa5d21a58ebfe9782225c857ad2e533a0f65d161.tar.gz
qmk_firmware-fa5d21a58ebfe9782225c857ad2e533a0f65d161.zip
[Keyboard] Enables I2C for OLKB rev*_drop boards (#14514)
Co-authored-by: daskygit <32983009+daskygit@users.noreply.github.com>
Diffstat (limited to 'keyboards/preonic')
-rw-r--r--keyboards/preonic/rev3_drop/halconf.h1
-rw-r--r--keyboards/preonic/rev3_drop/matrix.c12
-rw-r--r--keyboards/preonic/rev3_drop/mcuconf.h4
3 files changed, 11 insertions, 6 deletions
diff --git a/keyboards/preonic/rev3_drop/halconf.h b/keyboards/preonic/rev3_drop/halconf.h
index 48b76d2f4..153eacb21 100644
--- a/keyboards/preonic/rev3_drop/halconf.h
+++ b/keyboards/preonic/rev3_drop/halconf.h
@@ -18,5 +18,6 @@
18#define HAL_USE_PWM TRUE 18#define HAL_USE_PWM TRUE
19#define HAL_USE_GPT TRUE 19#define HAL_USE_GPT TRUE
20#define HAL_USE_DAC TRUE 20#define HAL_USE_DAC TRUE
21#define HAL_USE_I2C TRUE
21 22
22#include_next <halconf.h> 23#include_next <halconf.h>
diff --git a/keyboards/preonic/rev3_drop/matrix.c b/keyboards/preonic/rev3_drop/matrix.c
index b094d28cd..392997e0a 100644
--- a/keyboards/preonic/rev3_drop/matrix.c
+++ b/keyboards/preonic/rev3_drop/matrix.c
@@ -43,7 +43,7 @@ __attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
43__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } 43__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
44 44
45void matrix_init(void) { 45void matrix_init(void) {
46 printf("matrix init\n"); 46 dprintf("matrix init\n");
47 // debug_matrix = true; 47 // debug_matrix = true;
48 48
49 // actual matrix setup 49 // actual matrix setup
@@ -153,16 +153,16 @@ bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & (1 << col));
153matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } 153matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }
154 154
155void matrix_print(void) { 155void matrix_print(void) {
156 printf("\nr/c 01234567\n"); 156 dprintf("\nr/c 01234567\n");
157 for (uint8_t row = 0; row < MATRIX_ROWS; row++) { 157 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
158 printf("%X0: ", row); 158 dprintf("%X0: ", row);
159 matrix_row_t data = matrix_get_row(row); 159 matrix_row_t data = matrix_get_row(row);
160 for (int col = 0; col < MATRIX_COLS; col++) { 160 for (int col = 0; col < MATRIX_COLS; col++) {
161 if (data & (1 << col)) 161 if (data & (1 << col))
162 printf("1"); 162 dprintf("1");
163 else 163 else
164 printf("0"); 164 dprintf("0");
165 } 165 }
166 printf("\n"); 166 dprintf("\n");
167 } 167 }
168} 168}
diff --git a/keyboards/preonic/rev3_drop/mcuconf.h b/keyboards/preonic/rev3_drop/mcuconf.h
index 31abf13b6..b51bf6708 100644
--- a/keyboards/preonic/rev3_drop/mcuconf.h
+++ b/keyboards/preonic/rev3_drop/mcuconf.h
@@ -37,3 +37,7 @@
37// TIM2 to TIM3. 37// TIM2 to TIM3.
38#undef STM32_ST_USE_TIMER 38#undef STM32_ST_USE_TIMER
39#define STM32_ST_USE_TIMER 3 39#define STM32_ST_USE_TIMER 3
40
41// enable i2c
42#undef STM32_I2C_USE_I2C1
43#define STM32_I2C_USE_I2C1 TRUE \ No newline at end of file