Update .clang-format and apply

Update .clang-format for LLVM 14.0, available on Ubuntu 22.04.

There is still plenty that clang-format sucks at or does wrong, so
either add some more blocks to disable it, or just put up with it.

Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-01-06 13:47:21 -07:00
committed by Jeremy Soller
parent c3267fc4ad
commit e032c5f0f2
99 changed files with 1766 additions and 1517 deletions

View File

@ -36,19 +36,29 @@ bool keymap_erase_config(void) {
bool keymap_load_config(void) {
// Check signature
if (flash_read_u16(CONFIG_ADDR) != CONFIG_SIGNATURE) return false;
if (flash_read_u16(CONFIG_ADDR) != CONFIG_SIGNATURE)
return false;
// Read the keymap if signature is valid
flash_read(CONFIG_ADDR + sizeof(CONFIG_SIGNATURE), (uint8_t *)DYNAMIC_KEYMAP, sizeof(DYNAMIC_KEYMAP));
flash_read(
CONFIG_ADDR + sizeof(CONFIG_SIGNATURE),
(uint8_t *)DYNAMIC_KEYMAP,
sizeof(DYNAMIC_KEYMAP)
);
return true;
}
bool keymap_save_config(void) {
// Erase config region
if (!keymap_erase_config()) return false;
if (!keymap_erase_config())
return false;
// Write the keymap
flash_write(CONFIG_ADDR + sizeof(CONFIG_SIGNATURE), (uint8_t *)DYNAMIC_KEYMAP, sizeof(DYNAMIC_KEYMAP));
flash_write(
CONFIG_ADDR + sizeof(CONFIG_SIGNATURE),
(uint8_t *)DYNAMIC_KEYMAP,
sizeof(DYNAMIC_KEYMAP)
);
// Write the length of the keymap, as a signature
flash_write_u16(CONFIG_ADDR, CONFIG_SIGNATURE);
@ -57,7 +67,7 @@ bool keymap_save_config(void) {
return flash_read_u16(CONFIG_ADDR) == CONFIG_SIGNATURE;
}
bool keymap_get(uint8_t layer, uint8_t output, uint8_t input, uint16_t * value) {
bool keymap_get(uint8_t layer, uint8_t output, uint8_t input, uint16_t *value) {
if (layer < KM_LAY && output < KM_OUT && input < KM_IN) {
*value = DYNAMIC_KEYMAP[layer][output][input];
return true;