upload
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

magic.c 719B

123456789101112131415161718192021222324252627282930313233343536
  1. #include <stdint.h>
  2. #include <stdbool.h>
  3. #include <util/delay.h>
  4. #include "matrix.h"
  5. #include "bootloader.h"
  6. #include "debug.h"
  7. #include "keymap.h"
  8. #include "host.h"
  9. #include "action_layer.h"
  10. #include "eeconfig.h"
  11. #include "magic.h"
  12. keymap_config_t keymap_config;
  13. void magic(void)
  14. {
  15. /* check signature */
  16. if (!eeconfig_is_enabled()) {
  17. eeconfig_init();
  18. }
  19. /* debug enable */
  20. debug_config.raw = eeconfig_read_debug();
  21. /* keymap config */
  22. keymap_config.raw = eeconfig_read_keymap();
  23. #ifdef NKRO_ENABLE
  24. keyboard_nkro = keymap_config.nkro;
  25. #endif
  26. uint8_t default_layer = 0;
  27. default_layer = eeconfig_read_default_layer();
  28. default_layer_set((uint32_t)default_layer);
  29. }