From 186b44fc174eb7eea5ecc349080eade68983a258 Mon Sep 17 00:00:00 2001 From: tech2077 Date: Sat, 29 Aug 2020 16:19:42 -0500 Subject: [PATCH] Cleanup to fix C15 eeprom/spi build errors (#11) * Cleanup to fix C15 eeprom/spi build errors * add newline at eof --- keyboards/annepro2/c15/config.h | 1 + keyboards/annepro2/c18/config.h | 1 + keyboards/annepro2/keymaps/tech2077/keymap.c | 15 ++++--- keyboards/annepro2/keymaps/tech2077/rules.mk | 42 ++------------------ 4 files changed, 16 insertions(+), 43 deletions(-) diff --git a/keyboards/annepro2/c15/config.h b/keyboards/annepro2/c15/config.h index 111efbf86abb..76d0217cca7c 100644 --- a/keyboards/annepro2/c15/config.h +++ b/keyboards/annepro2/c15/config.h @@ -26,6 +26,7 @@ #define DESCRIPTION Anne Pro 2 with QMK #define NAME_SLUG "annepro2" +#define ANNEPRO2_C15 // key matrix size #define MATRIX_ROWS 5 diff --git a/keyboards/annepro2/c18/config.h b/keyboards/annepro2/c18/config.h index 96b8c1f3e085..f47d622229bf 100644 --- a/keyboards/annepro2/c18/config.h +++ b/keyboards/annepro2/c18/config.h @@ -26,6 +26,7 @@ #define DESCRIPTION Anne Pro 2 (c18) with QMK #define NAME_SLUG "annepro2" +#define ANNEPRO2_C18 // key matrix size #define MATRIX_ROWS 5 diff --git a/keyboards/annepro2/keymaps/tech2077/keymap.c b/keyboards/annepro2/keymaps/tech2077/keymap.c index a3f238dbd01f..28d76edab02f 100644 --- a/keyboards/annepro2/keymaps/tech2077/keymap.c +++ b/keyboards/annepro2/keymaps/tech2077/keymap.c @@ -1,9 +1,10 @@ #include "annepro2.h" #include #include -#include #include "qmk_ap2_led.h" +#ifdef ANNEPRO2_C18 #include "eeprom_w25x20cl.h" +#endif // layout using eeprom and bidir-comms to keep user led settings persistent @@ -64,7 +65,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_UP), - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, LT(KC_RALT, KC_LEFT), LT(_FN1_LAYER, KC_DOWN), RCTL_T(KC_RGHT)), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, LT(_FN2_LAYER, KC_LEFT), LT(_FN1_LAYER, KC_DOWN), RCTL_T(KC_RGHT)), /* * Layer _FN1_LAYER * ,-----------------------------------------------------------------------------------------. @@ -148,6 +149,7 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { */ bool process_record_user(uint16_t keycode, keyrecord_t* record) { +#ifdef ANNEPRO2_C18 switch (keycode) { case KC_AP_LED_OFF: if (record->event.pressed) { @@ -171,6 +173,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record) default: break; } +#endif return true; } @@ -182,6 +185,7 @@ void keyboard_post_init_user(void) //debug_keyboard=true; //debug_mouse=true; +#ifdef ANNEPRO2_C18 // Read the user config from EEPROM eeprom_read((void*)&user_config, 0, sizeof(user_config_t)); @@ -194,8 +198,6 @@ void keyboard_post_init_user(void) eeprom_write((void*)&user_config, 0, sizeof(user_config_t)); } - numProfiles = annepro2LedGetNumProfiles(); - if (user_config.leds_on) { // send profile before so that we don't get a flicker on startup annepro2LedSetProfile(user_config.leds_profile); @@ -203,4 +205,7 @@ void keyboard_post_init_user(void) } else { annepro2LedDisable(); } -} \ No newline at end of file +#endif + + numProfiles = annepro2LedGetNumProfiles(); +} diff --git a/keyboards/annepro2/keymaps/tech2077/rules.mk b/keyboards/annepro2/keymaps/tech2077/rules.mk index 59a7f53b85cf..73e1375afc0a 100644 --- a/keyboards/annepro2/keymaps/tech2077/rules.mk +++ b/keyboards/annepro2/keymaps/tech2077/rules.mk @@ -1,47 +1,13 @@ -# Anne Pro 2 -SRC = \ - matrix.c \ - hardfault_handler.c \ - annepro2_ble.c \ - qmk_ap2_led.c - -LAYOUTS += - -# MCU -MCU = cortex-m0plus -ARMV = 6 -USE_FPU = no -MCU_FAMILY = HT32 -MCU_SERIES = HT32F523x2 -MCU_LDSCRIPT = HT32F52342_ANNEPRO2 -MCU_STARTUP = ht32f523x2 - -BOARD = ANNEPRO2_C18 - -OPT_DEFS = -Wno-unused-function -fdump-rtl-dfinish -fstack-usage -#EXTRALDFLAGS = -Wl,--print-memory-usage - -# Options - -# Keys -CUSTOM_MATRIX = yes -NKRO_ENABLE = no -MOUSEKEY_ENABLE = no -EXTRAKEY_ENABLE = yes -KEY_LOCK_ENABLE = no - # Other featues -BOOTMAGIC_ENABLE = no CONSOLE_ENABLE = yes COMMAND_ENABLE = yes DEBUG_EEPROM = yes -RAW_ENABLE = no -MIDI_ENABLE = no -VIRTSER_ENABLE = no -COMBO_ENABLE = no + +ifeq ($(strip $(BOARD)), ANNEPRO2_C18) ANNEPRO2_EEPROM = yes +endif ifeq ($(strip $(ANNEPRO2_EEPROM)), yes) OPT_DEFS += -DANNEPRO2_EEPROM SRC += spi_master.c eeprom_w25x20cl.c -endif \ No newline at end of file +endif