diff --git a/quantum/keymap_introspection.c b/quantum/keymap_introspection.c index 39c409d27e2..0bc9f986092 100644 --- a/quantum/keymap_introspection.c +++ b/quantum/keymap_introspection.c @@ -206,9 +206,10 @@ __attribute__((weak)) uint8_t pointing_modes_map_count(void) { * * @return uint16_t keycode at pointing mode map location */ -uint16_t keycode_at_pointing_modes_map_location_raw(pointing_modes_map_location_t map_loc) { - if (map_loc.map_id < pointing_modes_map_count()) { - return pgm_read_word(&pointing_modes_maps[map_loc.map_id][map_loc.dir]); +uint16_t keycode_at_pointing_modes_map_location_raw(uint8_t map_loc) { + pointing_modes_map_location_t pm_map_loc = {.raw = map_loc}; + if (pm_map_loc.map_id < pointing_modes_map_count()) { + return pgm_read_word(&pointing_modes_maps[pm_map_loc.map_id][pm_map_loc.dir]); } return KC_NO; } @@ -223,7 +224,7 @@ uint16_t keycode_at_pointing_modes_map_location_raw(pointing_modes_map_location_ * * @return uint16_t keycode at pointing mode map location */ -__attribute__((weak)) uint16_t keycode_at_pointing_modes_map_location(pointing_modes_map_location_t map_loc) { +__attribute__((weak)) uint16_t keycode_at_pointing_modes_map_location(uint8_t map_loc) { return keycode_at_pointing_modes_map_location_raw(map_loc); } #endif // POINTING_DEVICE_MODES_ENABLE && POINTING_MODES_MAP_ENABLE diff --git a/quantum/keymap_introspection.h b/quantum/keymap_introspection.h index 5f1cdc7d73b..ba7fd0716ba 100644 --- a/quantum/keymap_introspection.h +++ b/quantum/keymap_introspection.h @@ -112,7 +112,7 @@ const key_override_t* key_override_get(uint16_t key_override_idx); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Pointing Mode Mapping -#if defined(POINTING_DEVICE_MODES_ENABLE) +#if defined(POINTING_DEVICE_MODES_ENABLE) && defined(POINTING_MODES_MAP_ENABLE) // Get the number of pointing mode maps, stored in firmware uint8_t pointing_modes_map_count_raw(void); @@ -124,4 +124,4 @@ uint16_t keycode_at_pointing_modes_map_location_raw(uint8_t map_loc); // Get the keycode for the encoder mapping location, potentially stored dynamically uint16_t keycode_at_pointing_modes_map_location(uint8_t map_loc); -#endif // defined(POINTING_DEVICE_MODES_ENABLE) +#endif // defined(POINTING_DEVICE_MODES_ENABLE)&& defined(POINTING_MODES_MAP_ENABLE)