From f8c07e05c2756931138cfd7a0fbb56e7cdec9744 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 13 Dec 2018 14:33:54 -0500 Subject: [PATCH] add pin mapping and sweet16 test --- build_keyboard.mk | 3 +- .../sweet16/keymaps/default/keymap.c | 8 +++-- quantum/config_common.h | 34 +++++++++++++++++++ quantum/mcu_selection.mk | 2 +- quantum/stm32/proton_c.mk | 3 ++ 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index d0a5ba1685..96d3701c38 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -88,8 +88,9 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","") endif ifeq ($(strip $(PROTON)), yes) - OPT_DEFS += -DPROTON_CONVERSION + TARGET := $(TARGET)_proton_c include $(STM32_PATH)/proton_c.mk + OPT_DEFS += -DPROTON_CONVERSION endif include quantum/mcu_selection.mk diff --git a/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c index 2ddf8acb41..18b6a71e99 100644 --- a/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c @@ -6,9 +6,9 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_4x4( - KC_7, KC_8, KC_9, KC_ASTR, - KC_4, KC_5, KC_6, KC_SLSH, - KC_1, KC_2, KC_3, KC_MINS, + KC_7, KC_8, KC_9, KC_ASTR, + KC_4, KC_5, KC_6, KC_SLSH, + KC_1, KC_2, KC_3, KC_MINS, KC_0, KC_ENT, KC_DOT, KC_EQL ) }; @@ -27,6 +27,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void led_set_user(uint8_t usb_led) { + #ifndef PROTON_CONVERSION /* Map RXLED to USB_LED_NUM_LOCK */ if (usb_led & (1 << USB_LED_NUM_LOCK)) { DDRB |= (1 << 0); PORTB &= ~(1 << 0); @@ -40,4 +41,5 @@ void led_set_user(uint8_t usb_led) { } else { DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); } + #endif } diff --git a/quantum/config_common.h b/quantum/config_common.h index cbff372eaf..22afa91132 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h @@ -125,6 +125,39 @@ #endif #elif defined(PROTOCOL_CHIBIOS) + #ifdef PROTON_CONVERSION + // Left side (front) + #define D3 PAL_LINE(GPIOA, 9) + #define D2 PAL_LINE(GPIOA, 10) + // GND + // GND + #define D1 PAL_LINE(GPIOB, 7) + #define D0 PAL_LINE(GPIOB, 6) + #define D4 PAL_LINE(GPIOB, 5) + #define C6 PAL_LINE(GPIOB, 4) + #define C7 PAL_LINE(GPIOB, 3) + #define E6 PAL_LINE(GPIOB, 2) + #define B4 PAL_LINE(GPIOB, 1) + #define B5 PAL_LINE(GPIOB, 0) + + // Right side (front) + // RAW + // GND + // RESET + // VCC + #define F4 PAL_LINE(GPIOA, 2) + #define F5 PAL_LINE(GPIOA, 1) + #define F6 PAL_LINE(GPIOA, 0) + #define F7 PAL_LINE(GPIOB, 8) + #define B1 PAL_LINE(GPIOB, 13) + #define B3 PAL_LINE(GPIOB, 14) + #define B2 PAL_LINE(GPIOB, 15) + #define B6 PAL_LINE(GPIOB, 9) + + // LEDs + #define D5 PAL_LINE(GPIOC, 13) + #define B0 PAL_LINE(GPIOC, 14) + #else #define A0 PAL_LINE(GPIOA, 0) #define A1 PAL_LINE(GPIOA, 1) #define A2 PAL_LINE(GPIOA, 2) @@ -221,6 +254,7 @@ #define F13 PAL_LINE(GPIOF, 13) #define F14 PAL_LINE(GPIOF, 14) #define F15 PAL_LINE(GPIOF, 15) + #endif #endif /* USART configuration */ diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk index 537d7a70a2..100a9d9b77 100644 --- a/quantum/mcu_selection.mk +++ b/quantum/mcu_selection.mk @@ -1,5 +1,5 @@ -ifneq ($(findstring STM32, $(MCU)),) +ifneq ($(findstring STM32F303, $(MCU)),) ## chip/board settings # - the next two should match the directories in # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) diff --git a/quantum/stm32/proton_c.mk b/quantum/stm32/proton_c.mk index 71657e32de..33b1c98df7 100644 --- a/quantum/stm32/proton_c.mk +++ b/quantum/stm32/proton_c.mk @@ -33,3 +33,6 @@ OPT_DEFS = # Options to pass to dfu-util when flashing DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = yes