aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/via.h
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-01-19 16:30:34 +0000
committerGitHub <noreply@github.com>2020-01-19 16:30:34 +0000
commit667045b4928badaedb38f535d885a46ff8a454fb (patch)
tree5ae5e7002381a7359eabe627b936f0c253e2822e /quantum/via.h
parentf5209aa4e941c7f3a942ef4a7e256ab432ec98ce (diff)
downloadfirmware-667045b4928badaedb38f535d885a46ff8a454fb.tar.gz
firmware-667045b4928badaedb38f535d885a46ff8a454fb.tar.bz2
firmware-667045b4928badaedb38f535d885a46ff8a454fb.zip
Run clang-format manually to fix recently changed files (#7934)
* Run clang-format manually to fix recently changed files * Run clang-format manually to fix recently changed files - revert template files * Run clang-format manually to fix recently changed files - format off for ascii_to_keycode_lut
Diffstat (limited to 'quantum/via.h')
-rw-r--r--quantum/via.h61
1 files changed, 27 insertions, 34 deletions
diff --git a/quantum/via.h b/quantum/via.h
index f9a8017b2..98f8dea8c 100644
--- a/quantum/via.h
+++ b/quantum/via.h
@@ -16,7 +16,7 @@
#pragma once
-#include <tmk_core/common/eeconfig.h> // for EECONFIG_SIZE
+#include <tmk_core/common/eeconfig.h> // for EECONFIG_SIZE
// Keyboard level code can change where VIA stores the magic.
// The magic is the build date YYMMDD encoded as BCD in 3 bytes,
@@ -25,34 +25,33 @@
// The only reason this is important is in case EEPROM usage changes
// and the EEPROM was not explicitly reset by bootmagic lite.
#ifndef VIA_EEPROM_MAGIC_ADDR
-# define VIA_EEPROM_MAGIC_ADDR (EECONFIG_SIZE)
+# define VIA_EEPROM_MAGIC_ADDR (EECONFIG_SIZE)
#endif
-#define VIA_EEPROM_LAYOUT_OPTIONS_ADDR (VIA_EEPROM_MAGIC_ADDR+3)
+#define VIA_EEPROM_LAYOUT_OPTIONS_ADDR (VIA_EEPROM_MAGIC_ADDR + 3)
// Changing the layout options size after release will invalidate EEPROM,
// but this is something that should be set correctly on initial implementation.
// 1 byte is enough for most uses (i.e. 8 binary states, or 6 binary + 1 ternary/quaternary )
#ifndef VIA_EEPROM_LAYOUT_OPTIONS_SIZE
-# define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 1
+# define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 1
#endif
// The end of the EEPROM memory used by VIA
// By default, dynamic keymaps will start at this if there is no
// custom config
-#define VIA_EEPROM_CUSTOM_CONFIG_ADDR (VIA_EEPROM_LAYOUT_OPTIONS_ADDR+VIA_EEPROM_LAYOUT_OPTIONS_SIZE)
+#define VIA_EEPROM_CUSTOM_CONFIG_ADDR (VIA_EEPROM_LAYOUT_OPTIONS_ADDR + VIA_EEPROM_LAYOUT_OPTIONS_SIZE)
#ifndef VIA_EEPROM_CUSTOM_CONFIG_SIZE
-# define VIA_EEPROM_CUSTOM_CONFIG_SIZE 0
+# define VIA_EEPROM_CUSTOM_CONFIG_SIZE 0
#endif
// This is changed only when the command IDs change,
-// so VIA Configurator can detect compatible firmware.
+// so VIA Configurator can detect compatible firmware.
#define VIA_PROTOCOL_VERSION 0x0009
-enum via_command_id
-{
- id_get_protocol_version = 0x01, // always 0x01
+enum via_command_id {
+ id_get_protocol_version = 0x01, // always 0x01
id_get_keyboard_value,
id_set_keyboard_value,
id_dynamic_keymap_get_keycode,
@@ -74,12 +73,7 @@ enum via_command_id
id_unhandled = 0xFF,
};
-enum via_keyboard_value_id
-{
- id_uptime = 0x01,
- id_layout_options,
- id_switch_matrix_state
-};
+enum via_keyboard_value_id { id_uptime = 0x01, id_layout_options, id_switch_matrix_state };
// Can't use SAFE_RANGE here, it might change if someone adds
// new values to enum quantum_keycodes.
@@ -108,22 +102,22 @@ enum via_keycodes {
};
enum user_keycodes {
- USER00 = 0x5F80,
- USER01,
- USER02,
- USER03,
- USER04,
- USER05,
- USER06,
- USER07,
- USER08,
- USER09,
- USER10,
- USER11,
- USER12,
- USER13,
- USER14,
- USER15,
+ USER00 = 0x5F80,
+ USER01,
+ USER02,
+ USER03,
+ USER04,
+ USER05,
+ USER06,
+ USER07,
+ USER08,
+ USER09,
+ USER10,
+ USER11,
+ USER12,
+ USER13,
+ USER14,
+ USER15,
};
// Can be called in an overriding via_init_kb() to test if keyboard level code usage of
@@ -144,8 +138,7 @@ void via_init(void);
// Used by VIA to store and retrieve the layout options.
uint32_t via_get_layout_options(void);
-void via_set_layout_options(uint32_t value);
+void via_set_layout_options(uint32_t value);
// Called by QMK core to process VIA-specific keycodes.
bool process_record_via(uint16_t keycode, keyrecord_t *record);
-