Fix x5_ansi_red (WestBerry): 1->Mac OS cannot enter EFI mode. 2->After refreshing the firmware, optimize the first startup time to 1 second.

This commit is contained in:
KeychronMacro 2023-12-11 11:01:33 +08:00
parent 9c266ce053
commit 6156d66569
4 changed files with 13 additions and 6 deletions

View File

@ -118,4 +118,5 @@ __attribute__((weak)) void keyboard_post_init_kb(void) {
void restart_usb_driver(USBDriver *usbp) {
// Do nothing. Restarting the USB driver on these boards breaks it.
wait_ms(150);
}

View File

@ -44,4 +44,3 @@
#define EXTERNAL_EEPROM_WP_PIN B7
#define EXTERNAL_EEPROM_I2C_BASE_ADDRESS 0b10100010
#define USB_SUSPEND_WAKEUP_DELAY 600

View File

@ -30,7 +30,7 @@
#undef STM32_PLLQ_VALUE
#define STM32_PLLQ_VALUE 7
/*
#undef WB32_PLLDIV_VALUE
#define WB32_PLLDIV_VALUE 2
@ -39,6 +39,6 @@
#undef WB32_USBPRE
#define WB32_USBPRE WB32_USBPRE_DIV2
*/
#undef WB32_I2C_USE_I2C1
#define WB32_I2C_USE_I2C1 TRUE

View File

@ -151,13 +151,20 @@ void dynamic_keymap_set_encoder(uint8_t layer, uint8_t encoder_id, bool clockwis
#endif // ENCODER_MAP_ENABLE
void dynamic_keymap_reset(void) {
uint16_t MATRIX_ROWS_temp[MATRIX_ROWS][MATRIX_COLS];
uint16_t keycode_temp;
// Reset the keymaps in EEPROM to what is in flash.
for (int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++) {
for (int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++) {
for (int row = 0; row < MATRIX_ROWS; row++) {
for (int column = 0; column < MATRIX_COLS; column++) {
dynamic_keymap_set_keycode(layer, row, column, keycode_at_keymap_location_raw(layer, row, column));
}
//dynamic_keymap_set_keycode(layer, row, column, keycode_at_keymap_location_raw(layer, row, column));
keycode_temp=keycode_at_keymap_location_raw(layer, row, column);
MATRIX_ROWS_temp[row][column]=((keycode_temp&0XFF)<<8)|((keycode_temp>>8)&0XFF);
}
}
eeprom_update_block(MATRIX_ROWS_temp,dynamic_keymap_key_to_eeprom_address(layer, 0, 0),sizeof(MATRIX_ROWS_temp));
#ifdef ENCODER_MAP_ENABLE
for (int encoder = 0; encoder < NUM_ENCODERS; encoder++) {
dynamic_keymap_set_encoder(layer, encoder, true, keycode_at_encodermap_location_raw(layer, encoder, true));