Patch up fnv use in dynamic keymap

This commit is contained in:
zvecr 2022-07-28 01:42:32 +01:00
parent 0d0a3a938b
commit 81ac1a5df5

View File

@ -19,7 +19,10 @@
#include "progmem.h" // to read default from flash #include "progmem.h" // to read default from flash
#include "quantum.h" // for send_string() #include "quantum.h" // for send_string()
#include "dynamic_keymap.h" #include "dynamic_keymap.h"
#ifdef FNV_ENABLE
# include "fnv.h" # include "fnv.h"
#endif
#ifdef VIA_ENABLE #ifdef VIA_ENABLE
# include "via.h" // for VIA_EEPROM_CONFIG_END # include "via.h" // for VIA_EEPROM_CONFIG_END
@ -149,6 +152,7 @@ void dynamic_keymap_set_encoder(uint8_t layer, uint8_t encoder_id, bool clockwis
#endif // ENCODER_MAP_ENABLE #endif // ENCODER_MAP_ENABLE
static uint32_t dynamic_keymap_compute_hash(void) { static uint32_t dynamic_keymap_compute_hash(void) {
#ifdef FNV_ENABLE
Fnv32_t hash = FNV1_32A_INIT; Fnv32_t hash = FNV1_32A_INIT;
uint16_t keycode; uint16_t keycode;
@ -169,8 +173,10 @@ static uint32_t dynamic_keymap_compute_hash(void) {
} }
# endif // ENCODER_MAP_ENABLE # endif // ENCODER_MAP_ENABLE
} }
return hash; return hash;
#else
return 0;
#endif
} }
static uint32_t dynamic_keymap_hash(void) { static uint32_t dynamic_keymap_hash(void) {