[Keyboard] Enables I2C for OLKB rev*_drop boards (#14514)
Co-authored-by: daskygit <32983009+daskygit@users.noreply.github.com>
This commit is contained in:
parent
0e34efd9a2
commit
fa5d21a58e
@ -18,5 +18,6 @@
|
|||||||
#define HAL_USE_PWM TRUE
|
#define HAL_USE_PWM TRUE
|
||||||
#define HAL_USE_GPT TRUE
|
#define HAL_USE_GPT TRUE
|
||||||
#define HAL_USE_DAC TRUE
|
#define HAL_USE_DAC TRUE
|
||||||
|
#define HAL_USE_I2C TRUE
|
||||||
|
|
||||||
#include_next <halconf.h>
|
#include_next <halconf.h>
|
||||||
|
@ -43,7 +43,7 @@ __attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
|
|||||||
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
||||||
|
|
||||||
void matrix_init(void) {
|
void matrix_init(void) {
|
||||||
printf("matrix init\n");
|
dprintf("matrix init\n");
|
||||||
// debug_matrix = true;
|
// debug_matrix = true;
|
||||||
|
|
||||||
// actual matrix setup
|
// actual matrix setup
|
||||||
@ -151,16 +151,16 @@ bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & (1 << col));
|
|||||||
matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }
|
matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }
|
||||||
|
|
||||||
void matrix_print(void) {
|
void matrix_print(void) {
|
||||||
printf("\nr/c 01234567\n");
|
dprintf("\nr/c 01234567\n");
|
||||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
printf("%X0: ", row);
|
dprintf("%X0: ", row);
|
||||||
matrix_row_t data = matrix_get_row(row);
|
matrix_row_t data = matrix_get_row(row);
|
||||||
for (int col = 0; col < MATRIX_COLS; col++) {
|
for (int col = 0; col < MATRIX_COLS; col++) {
|
||||||
if (data & (1 << col))
|
if (data & (1 << col))
|
||||||
printf("1");
|
dprintf("1");
|
||||||
else
|
else
|
||||||
printf("0");
|
dprintf("0");
|
||||||
}
|
}
|
||||||
printf("\n");
|
dprintf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,3 +37,8 @@
|
|||||||
// TIM2 to TIM3.
|
// TIM2 to TIM3.
|
||||||
#undef STM32_ST_USE_TIMER
|
#undef STM32_ST_USE_TIMER
|
||||||
#define STM32_ST_USE_TIMER 3
|
#define STM32_ST_USE_TIMER 3
|
||||||
|
|
||||||
|
// enable i2c
|
||||||
|
#undef STM32_I2C_USE_I2C1
|
||||||
|
#define STM32_I2C_USE_I2C1 TRUE
|
||||||
|
|
||||||
|
@ -18,5 +18,6 @@
|
|||||||
#define HAL_USE_PWM TRUE
|
#define HAL_USE_PWM TRUE
|
||||||
#define HAL_USE_GPT TRUE
|
#define HAL_USE_GPT TRUE
|
||||||
#define HAL_USE_DAC TRUE
|
#define HAL_USE_DAC TRUE
|
||||||
|
#define HAL_USE_I2C TRUE
|
||||||
|
|
||||||
#include_next <halconf.h>
|
#include_next <halconf.h>
|
||||||
|
@ -43,7 +43,7 @@ __attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
|
|||||||
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
||||||
|
|
||||||
void matrix_init(void) {
|
void matrix_init(void) {
|
||||||
printf("matrix init\n");
|
dprintf("matrix init\n");
|
||||||
// debug_matrix = true;
|
// debug_matrix = true;
|
||||||
|
|
||||||
// actual matrix setup
|
// actual matrix setup
|
||||||
@ -153,16 +153,16 @@ bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & (1 << col));
|
|||||||
matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }
|
matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }
|
||||||
|
|
||||||
void matrix_print(void) {
|
void matrix_print(void) {
|
||||||
printf("\nr/c 01234567\n");
|
dprintf("\nr/c 01234567\n");
|
||||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
printf("%X0: ", row);
|
dprintf("%X0: ", row);
|
||||||
matrix_row_t data = matrix_get_row(row);
|
matrix_row_t data = matrix_get_row(row);
|
||||||
for (int col = 0; col < MATRIX_COLS; col++) {
|
for (int col = 0; col < MATRIX_COLS; col++) {
|
||||||
if (data & (1 << col))
|
if (data & (1 << col))
|
||||||
printf("1");
|
dprintf("1");
|
||||||
else
|
else
|
||||||
printf("0");
|
dprintf("0");
|
||||||
}
|
}
|
||||||
printf("\n");
|
dprintf("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,3 +37,7 @@
|
|||||||
// TIM2 to TIM3.
|
// TIM2 to TIM3.
|
||||||
#undef STM32_ST_USE_TIMER
|
#undef STM32_ST_USE_TIMER
|
||||||
#define STM32_ST_USE_TIMER 3
|
#define STM32_ST_USE_TIMER 3
|
||||||
|
|
||||||
|
// enable i2c
|
||||||
|
#undef STM32_I2C_USE_I2C1
|
||||||
|
#define STM32_I2C_USE_I2C1 TRUE
|
Loading…
Reference in New Issue
Block a user