From 95d73bff77c6e582b69055c1c26067f4a937cd81 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 20 Jul 2017 00:29:41 -0400 Subject: [PATCH] updates clueboard configuration --- keyboards/clueboard60/chconf.h | 12 ++++----- keyboards/clueboard60/config.h | 4 +-- keyboards/clueboard60/matrix.c | 43 ++++++++++++++++++++++++--------- keyboards/clueboard60/mcuconf.h | 4 +++ keyboards/clueboard60/rules.mk | 24 +++++++++--------- 5 files changed, 57 insertions(+), 30 deletions(-) diff --git a/keyboards/clueboard60/chconf.h b/keyboards/clueboard60/chconf.h index 7eca0bcd15..5a9b833107 100644 --- a/keyboards/clueboard60/chconf.h +++ b/keyboards/clueboard60/chconf.h @@ -252,7 +252,7 @@ * requirements. * @note Requires @p CH_CFG_USE_MESSAGES. */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE /** * @brief Mailboxes APIs. @@ -328,7 +328,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_SYSTEM_STATE_CHECK TRUE +#define CH_DBG_SYSTEM_STATE_CHECK FALSE /** * @brief Debug option, parameters checks. @@ -337,7 +337,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_ENABLE_CHECKS TRUE +#define CH_DBG_ENABLE_CHECKS FALSE /** * @brief Debug option, consistency checks. @@ -347,7 +347,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_ENABLE_ASSERTS TRUE +#define CH_DBG_ENABLE_ASSERTS FALSE /** * @brief Debug option, trace buffer. @@ -355,7 +355,7 @@ * * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_ALL +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED /** * @brief Trace buffer entries. @@ -384,7 +384,7 @@ * * @note The default is @p FALSE. */ -#define CH_DBG_FILL_THREADS TRUE +#define CH_DBG_FILL_THREADS FALSE /** * @brief Debug option, threads profiling. diff --git a/keyboards/clueboard60/config.h b/keyboards/clueboard60/config.h index 924d077f08..16e9270922 100644 --- a/keyboards/clueboard60/config.h +++ b/keyboards/clueboard60/config.h @@ -28,7 +28,7 @@ #define USBSTR_MANUFACTURER 'C', '\x00', 'l', '\x00', 'u', '\x00', 'e', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00' #define PRODUCT "Clueboard60" #define USBSTR_PRODUCT 'C', '\x00', 'l', '\x00', 'u', '\x00', 'e', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '6', '\x00', '0', '\x00' -#define DESCRIPTION Clueboard 60% PCB +#define DESCRIPTION Clueboard 60 PCB /* key matrix size */ #define MATRIX_ROWS 5 @@ -134,6 +134,6 @@ * * STM32F042x6 */ -#define STM32_REMAP_PINS +// #define STM32_REMAP_PINS #endif diff --git a/keyboards/clueboard60/matrix.c b/keyboards/clueboard60/matrix.c index 430395fd81..237766e892 100644 --- a/keyboards/clueboard60/matrix.c +++ b/keyboards/clueboard60/matrix.c @@ -24,6 +24,22 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static bool debouncing = false; static uint16_t debouncing_time = 0; +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + void matrix_init(void) { printf("matrix init\n"); @@ -57,8 +73,10 @@ void matrix_init(void) { memset(matrix_debouncing, 0, MATRIX_ROWS); /* Setup capslock */ - palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL); - palClearPad(GPIOB, 7); + // palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL); + // palClearPad(GPIOB, 7); + + matrix_init_quantum(); } uint8_t matrix_scan(void) { @@ -82,18 +100,18 @@ uint8_t matrix_scan(void) { palReadPad(GPIOA, 2) << 0 | palReadPad(GPIOA, 3) << 1 | palReadPad(GPIOA, 6) << 2 | - palReadPad(GPIOA, 14) << 3 | - palReadPad(GPIOA, 15) << 4 | + palReadPad(GPIOB, 14) << 3 | + palReadPad(GPIOB, 15) << 4 | palReadPad(GPIOA, 8) << 5 | palReadPad(GPIOA, 9) << 6 | palReadPad(GPIOA, 7) << 7 | - palReadPad(GPIOA, 3) << 8 | - palReadPad(GPIOA, 4) << 9 | - palReadPad(GPIOA, 14) << 10 | - palReadPad(GPIOA, 15) << 11 | - palReadPad(GPIOA, 13) << 12 | - palReadPad(GPIOA, 5) << 13 | - palReadPad(GPIOA, 6) << 14 + palReadPad(GPIOB, 3) << 8 | + palReadPad(GPIOB, 4) << 9 | + palReadPad(GPIOC, 14) << 10 | + palReadPad(GPIOC, 15) << 11 | + palReadPad(GPIOC, 13) << 12 | + palReadPad(GPIOB, 5) << 13 | + palReadPad(GPIOB, 6) << 14 ); // unstrobe row { PB0, PB1, PB2, PA15, PA10 } @@ -117,6 +135,9 @@ uint8_t matrix_scan(void) { } debouncing = false; } + + matrix_scan_quantum(); + return 1; } diff --git a/keyboards/clueboard60/mcuconf.h b/keyboards/clueboard60/mcuconf.h index 059d889a93..776a3d2ac9 100644 --- a/keyboards/clueboard60/mcuconf.h +++ b/keyboards/clueboard60/mcuconf.h @@ -66,6 +66,10 @@ #define STM32_USB_CLOCK_REQUIRED TRUE #define STM32_USBPRE STM32_USBPRE_DIV1P5 +#undef STM32_HSE_BYPASS +// #error "oh no" +// #endif + /* * ADC driver system settings. */ diff --git a/keyboards/clueboard60/rules.mk b/keyboards/clueboard60/rules.mk index 6340d03071..cf24e8808f 100644 --- a/keyboards/clueboard60/rules.mk +++ b/keyboards/clueboard60/rules.mk @@ -14,13 +14,13 @@ MCU_SERIES = STM32F3xx MCU_LDSCRIPT = STM32F303xC # Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ MCU_STARTUP = stm32f3xx # Board: it should exist either in /os/hal/boards/ # or /boards BOARD = GENERIC_STM32_F303XC -#BOARD = ST_STM32F3_DISCOVERY +# BOARD = ST_STM32F3_DISCOVERY # Cortex version MCU = cortex-m4 @@ -31,7 +31,7 @@ ARMV = 7 # Vector table for application # 0x00000000-0x00001000 area is occupied by bootlaoder.*/ # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB -#OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 OPT_DEFS = # Options to pass to dfu-util when flashing @@ -40,11 +40,13 @@ DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration -MOUSEKEY_ENABLE ?= yes # Mouse keys -EXTRAKEY_ENABLE ?= yes # Audio control and System control -CONSOLE_ENABLE ?= yes # Console for debug -COMMAND_ENABLE ?= yes # Commands for debug and configuration -#SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover -CUSTOM_MATRIX ?= yes # Custom matrix file +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +#CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = yes # Custom matrix file +# SERIAL_LINK_ENABLE = yes \ No newline at end of file