diff options
| author | Drashna Jaelre <drashna@live.com> | 2021-11-05 11:24:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-05 11:24:58 -0700 |
| commit | 69ef8d630c5f35cf50b56e05b6816413a99d1271 (patch) | |
| tree | cef4a6b4d8240150c218a4e8ffb998688c08250b | |
| parent | f10753614dc71eb831c452daa99003a40ce2cbe9 (diff) | |
| download | qmk_firmware-69ef8d630c5f35cf50b56e05b6816413a99d1271.tar.gz qmk_firmware-69ef8d630c5f35cf50b56e05b6816413a99d1271.zip | |
[Keyboard] Fix compilation issues for yanghu Unicorne (#15068)
| -rw-r--r-- | keyboards/yanghu/unicorne/unicorne.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/keyboards/yanghu/unicorne/unicorne.c b/keyboards/yanghu/unicorne/unicorne.c index 27b87253d..bce8f5207 100644 --- a/keyboards/yanghu/unicorne/unicorne.c +++ b/keyboards/yanghu/unicorne/unicorne.c | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ | 15 | */ |
| 16 | #include "unicorne.h" | 16 | #include "unicorne.h" |
| 17 | 17 | #include "i2c_master.h" | |
| 18 | 18 | ||
| 19 | // Custom i2c init to enable internal pull up resistor for i2c. | 19 | // Custom i2c init to enable internal pull up resistor for i2c. |
| 20 | void i2c_init(void) { | 20 | void i2c_init(void) { |
| @@ -23,13 +23,13 @@ void i2c_init(void) { | |||
| 23 | is_initialised = true; | 23 | is_initialised = true; |
| 24 | 24 | ||
| 25 | // Try releasing special pins for a short time | 25 | // Try releasing special pins for a short time |
| 26 | palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_INPUT); | 26 | palSetLineMode(I2C1_SCL_PIN, PAL_MODE_INPUT); |
| 27 | palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_INPUT); | 27 | palSetLineMode(I2C1_SDA_PIN, PAL_MODE_INPUT); |
| 28 | 28 | ||
| 29 | chThdSleepMilliseconds(10); | 29 | chThdSleepMilliseconds(10); |
| 30 | // Use internal pull up since we do not have pull up on i2c pins in v1 design. | 30 | // Use internal pull up since we do not have pull up on i2c pins in v1 design. |
| 31 | palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); | 31 | palSetLineMode(I2C1_SCL_PIN, PAL_MODE_ALTERNATE(I2C1_SCL_PAL_MODE) | PAL_OUTPUT_TYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); |
| 32 | palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); | 32 | palSetLineMode(I2C1_SDA_PIN, PAL_MODE_ALTERNATE(I2C1_SDA_PAL_MODE) | PAL_OUTPUT_TYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); |
| 33 | } | 33 | } |
| 34 | } | 34 | } |
| 35 | 35 | ||
| @@ -58,7 +58,7 @@ led_config_t g_led_config = {{ | |||
| 58 | {208, 44}, | 58 | {208, 44}, |
| 59 | {130, 60} | 59 | {130, 60} |
| 60 | }, {// LED Index to Flag | 60 | }, {// LED Index to Flag |
| 61 | LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, | 61 | LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, |
| 62 | LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL | 62 | LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL |
| 63 | }}; | 63 | }}; |
| 64 | // clang-format on | 64 | // clang-format on |
| @@ -138,11 +138,13 @@ void set_keylog(uint16_t keycode, keyrecord_t *record) { | |||
| 138 | __attribute__((weak)) void oled_render_keylog(void) { oled_write(keylog_str, false); } | 138 | __attribute__((weak)) void oled_render_keylog(void) { oled_write(keylog_str, false); } |
| 139 | 139 | ||
| 140 | // Keymaps can override this function | 140 | // Keymaps can override this function |
| 141 | __attribute__((weak)) void oled_task_user(void) { | 141 | __attribute__((weak)) bool oled_task_kb(void) { |
| 142 | if (!oled_task_user()) { return false; } | ||
| 142 | /* oled_render_keylog(); */ | 143 | /* oled_render_keylog(); */ |
| 143 | oled_render_layer(); | 144 | oled_render_layer(); |
| 144 | oled_render_mods(); | 145 | oled_render_mods(); |
| 145 | led_t led_state = host_keyboard_led_state(); | 146 | led_t led_state = host_keyboard_led_state(); |
| 146 | oled_render_capslock(led_state.caps_lock); | 147 | oled_render_capslock(led_state.caps_lock); |
| 148 | return true; | ||
| 147 | } | 149 | } |
| 148 | #endif | 150 | #endif |
