Cleanup to fix C15 eeprom/spi build errors (#11)

* Cleanup to fix C15 eeprom/spi build errors

* add newline at eof
This commit is contained in:
tech2077
2021-09-12 09:26:16 +02:00
committed by bwisn
parent 4bbc680a28
commit fffa641adf
4 changed files with 16 additions and 43 deletions
+1
View File
@@ -26,6 +26,7 @@
#define DESCRIPTION Anne Pro 2 with QMK #define DESCRIPTION Anne Pro 2 with QMK
#define NAME_SLUG "annepro2" #define NAME_SLUG "annepro2"
#define ANNEPRO2_C15
// key matrix size // key matrix size
#define MATRIX_ROWS 5 #define MATRIX_ROWS 5
+1
View File
@@ -26,6 +26,7 @@
#define DESCRIPTION Anne Pro 2 (c18) with QMK #define DESCRIPTION Anne Pro 2 (c18) with QMK
#define NAME_SLUG "annepro2" #define NAME_SLUG "annepro2"
#define ANNEPRO2_C18
// key matrix size // key matrix size
#define MATRIX_ROWS 5 #define MATRIX_ROWS 5
+10 -5
View File
@@ -1,9 +1,10 @@
#include "annepro2.h" #include "annepro2.h"
#include <stdint.h> #include <stdint.h>
#include <print.h> #include <print.h>
#include <string.h>
#include "qmk_ap2_led.h" #include "qmk_ap2_led.h"
#ifdef ANNEPRO2_C18
#include "eeprom_w25x20cl.h" #include "eeprom_w25x20cl.h"
#endif
// layout using eeprom and bidir-comms to keep user led settings persistent // 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_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_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_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 * 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) bool process_record_user(uint16_t keycode, keyrecord_t* record)
{ {
#ifdef ANNEPRO2_C18
switch (keycode) { switch (keycode) {
case KC_AP_LED_OFF: case KC_AP_LED_OFF:
if (record->event.pressed) { if (record->event.pressed) {
@@ -171,6 +173,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record)
default: default:
break; break;
} }
#endif
return true; return true;
} }
@@ -182,6 +185,7 @@ void keyboard_post_init_user(void)
//debug_keyboard=true; //debug_keyboard=true;
//debug_mouse=true; //debug_mouse=true;
#ifdef ANNEPRO2_C18
// Read the user config from EEPROM // Read the user config from EEPROM
eeprom_read((void*)&user_config, 0, sizeof(user_config_t)); 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)); eeprom_write((void*)&user_config, 0, sizeof(user_config_t));
} }
numProfiles = annepro2LedGetNumProfiles();
if (user_config.leds_on) { if (user_config.leds_on) {
// send profile before so that we don't get a flicker on startup // send profile before so that we don't get a flicker on startup
annepro2LedSetProfile(user_config.leds_profile); annepro2LedSetProfile(user_config.leds_profile);
@@ -203,4 +205,7 @@ void keyboard_post_init_user(void)
} else { } else {
annepro2LedDisable(); annepro2LedDisable();
} }
} #endif
numProfiles = annepro2LedGetNumProfiles();
}
+4 -38
View File
@@ -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 # Other featues
BOOTMAGIC_ENABLE = no
CONSOLE_ENABLE = yes CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
DEBUG_EEPROM = yes DEBUG_EEPROM = yes
RAW_ENABLE = no
MIDI_ENABLE = no ifeq ($(strip $(BOARD)), ANNEPRO2_C18)
VIRTSER_ENABLE = no
COMBO_ENABLE = no
ANNEPRO2_EEPROM = yes ANNEPRO2_EEPROM = yes
endif
ifeq ($(strip $(ANNEPRO2_EEPROM)), yes) ifeq ($(strip $(ANNEPRO2_EEPROM)), yes)
OPT_DEFS += -DANNEPRO2_EEPROM OPT_DEFS += -DANNEPRO2_EEPROM
SRC += spi_master.c eeprom_w25x20cl.c SRC += spi_master.c eeprom_w25x20cl.c
endif endif