Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Cleanup to fix C15 eeprom/spi build errors #11

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions keyboards/annepro2/c15/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions keyboards/annepro2/c18/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions keyboards/annepro2/keymaps/tech2077/keymap.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include "annepro2.h"
#include <stdint.h>
#include <print.h>
#include <string.h>
#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

Expand Down Expand Up @@ -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
* ,-----------------------------------------------------------------------------------------.
Expand Down Expand Up @@ -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) {
Expand All @@ -171,6 +173,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t* record)
default:
break;
}
#endif
return true;
}

Expand All @@ -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));

Expand All @@ -194,13 +198,14 @@ 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);
annepro2LedEnable();
} else {
annepro2LedDisable();
}
}
#endif

numProfiles = annepro2LedGetNumProfiles();
}
42 changes: 4 additions & 38 deletions keyboards/annepro2/keymaps/tech2077/rules.mk
Original file line number Diff line number Diff line change
@@ -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
endif