]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - keyboard/onekey/keymap.c
core: Clean up code of Locking key support
[max/tmk_keyboard.git] / keyboard / onekey / keymap.c
index 11804bf34cd8d7c2d4942de79ebc67ff8b7a046e..dca32d27f398cc82bf47c7374e5f1a18c540c1f9 100644 (file)
@@ -16,7 +16,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #include <stdint.h>
 #include <stdbool.h>
-#include <avr/pgmspace.h>
 #include "keycode.h"
 #include "action.h"
 #include "action_macro.h"
@@ -27,40 +26,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "keymap.h"
 
 
-static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     {{KC_A}},
 };
 
 /*
  * Fn action definition
  */
-static const action_t PROGMEM fn_actions[] = {
+const action_t PROGMEM fn_actions[] = {
 };
-
-
-
-#define KEYMAPS_SIZE    (sizeof(keymaps) / sizeof(keymaps[0]))
-#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    if (layer < KEYMAPS_SIZE) {
-        return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-    } else {
-        // fall back to layer 0
-        return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
-    }
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    action_t action;
-    if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
-        action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
-    } else {
-        action = (action_t)ACTION_NO;
-    }
-    return action;
-}