Skip to content

Commit

Permalink
Merge pull request #1049 from UltimateHackingKeyboard/fix_hwconfig_order
Browse files Browse the repository at this point in the history
Fix update order of hardware config stuff.
  • Loading branch information
mondalaci authored Dec 20, 2024
2 parents fba425d + 20e8b5c commit cbbe38c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions device/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,9 @@ int main(void) {

}

if (DEVICE_IS_UHK80_LEFT || DEVICE_IS_UHK80_RIGHT) {
Ledmap_InitLedLayout();
}

bt_enable(NULL);
bt_enable(NULL); // has to be before InitSettings

// has to be after bt_enable, has to be before ApplyConfig
// has to be after bt_enable; has to be before ApplyConfig
InitSettings();

// read configurations
Expand All @@ -141,6 +137,10 @@ int main(void) {
Flash_ReadAreaSync(hardwareConfigArea, 0, HardwareConfigBuffer.buffer, HARDWARE_CONFIG_SIZE);
USB_SetSerialNumber(HardwareConfig->uniqueId);

if (DEVICE_IS_UHK80_LEFT || DEVICE_IS_UHK80_RIGHT) {
Ledmap_InitLedLayout(); // has to be after hwconfig read
}

if (DEVICE_IS_UHK80_RIGHT) {
printk("Reading user config\n");
Flash_ReadAreaSync(userConfigArea, 0, StagingUserConfigBuffer.buffer, USER_CONFIG_SIZE);
Expand Down

0 comments on commit cbbe38c

Please sign in to comment.