Cleanup magic number and functions
This commit is contained in:
committed by
Florian Didron
parent
d550603b8c
commit
6198382cb1
@@ -112,3 +112,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
#define MUSIC_MAP
|
||||
|
||||
|
||||
#define FIRMWARE_VERSION_SIZE 17
|
||||
#define DYNAMIC_KEYMAP_EEPROM_ADDR (EECONFIG_SIZE + FIRMWARE_VERSION_SIZE)
|
||||
|
||||
@@ -236,18 +236,16 @@ void eeconfig_init_oryx(void) {
|
||||
// reread settings from flash into eeprom
|
||||
dynamic_keymap_reset();
|
||||
dynamic_keymap_macro_reset();
|
||||
eeprom_update_block(FIRMWARE_VERSION, (uint8_t *)EECONFIG_SIZE, sizeof(uint8_t)*17);
|
||||
eeprom_update_block(FIRMWARE_VERSION, (uint8_t *)EECONFIG_SIZE, sizeof(uint8_t)*FIRMWARE_VERSION_SIZE);
|
||||
}
|
||||
|
||||
// since I'm being lazy, ATM
|
||||
void matrix_setup(void) {
|
||||
uint8_t temp[17];
|
||||
uint8_t firmware[17] = FIRMWARE_VERSION;
|
||||
eeprom_read_block(&temp, (uint8_t *)EECONFIG_SIZE, sizeof(uint8_t)*17);
|
||||
if (!memcmp(&temp, &firmware, sizeof(uint8_t)*17)) {
|
||||
void matrix_init_oryx(void) {
|
||||
uint8_t temp[FIRMWARE_VERSION_SIZE];
|
||||
uint8_t firmware[FIRMWARE_VERSION_SIZE] = FIRMWARE_VERSION;
|
||||
eeprom_read_block(&temp, (uint8_t *)EECONFIG_SIZE, sizeof(uint8_t)*FIRMWARE_VERSION_SIZE);
|
||||
if (!memcmp(&temp, &firmware, sizeof(uint8_t)*FIRMWARE_VERSION_SIZE)) {
|
||||
eeconfig_init_oryx();
|
||||
}
|
||||
}
|
||||
// FIRMWARE_VERSION
|
||||
|
||||
#endif
|
||||
|
||||
@@ -79,4 +79,4 @@ bool is_oryx_live_training_enabled(void);
|
||||
bool process_record_oryx(uint16_t keycode, keyrecord_t *record);
|
||||
void layer_state_set_oryx(layer_state_t state);
|
||||
void eeconfig_init_oryx(void);
|
||||
void keyboard_pre_init_oryx(void);
|
||||
void matrix_init_oryx(void);
|
||||
|
||||
@@ -587,6 +587,9 @@ void matrix_init_quantum() {
|
||||
if (!eeconfig_is_enabled()) {
|
||||
eeconfig_init();
|
||||
}
|
||||
#ifdef ORYX_ENABLE
|
||||
matrix_init_oryx();
|
||||
#endif
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
# ifdef LED_MATRIX_ENABLE
|
||||
led_matrix_init();
|
||||
|
||||
Reference in New Issue
Block a user