From e01b4c3fd9a7b66276ffd22dcac25d569d7bb7ff Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 9 Jul 2016 00:41:15 +0300 Subject: [PATCH] Most ergodox keymaps compiles on Infinity There are linker errors due to missing led funcitonality though --- .../gdisp/IS31FL3731C/board_IS31FL3731C.h | 0 .../drivers/gdisp/IS31FL3731C/driver.mk | 0 .../gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 0 .../gdisp/IS31FL3731C/gdisp_lld_config.h | 0 .../drivers/gdisp/emulator_lcd/driver.mk | 0 .../drivers/gdisp/emulator_lcd/emulator_lcd.c | 0 .../drivers/gdisp/emulator_led/driver.mk | 0 .../drivers/gdisp/emulator_led/emulator_led.c | 0 .../gdisp/st7565ergodox/board_ST7565.h | 0 .../drivers/gdisp/st7565ergodox/driver.mk | 0 .../gdisp/st7565ergodox/gdisp_lld_ST7565.c | 0 .../gdisp/st7565ergodox/gdisp_lld_config.h | 0 .../drivers/gdisp/st7565ergodox/st7565.h | 0 keyboards/ergodox/ergodox.c | 8 ----- keyboards/ergodox/ergodox.h | 1 - keyboards/ergodox/infinity/Makefile | 4 +-- keyboards/ergodox/infinity/infinity.c | 21 +++++++++-- keyboards/ergodox/infinity/infinity.h | 36 +++++++++---------- keyboards/ergodox/infinity/matrix.c | 3 ++ quantum/quantum.h | 1 + tmk_core/common/print.h | 4 ++- 21 files changed, 46 insertions(+), 32 deletions(-) rename keyboards/ergodox/{infinity => }/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/IS31FL3731C/driver.mk (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/emulator_lcd/driver.mk (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/emulator_lcd/emulator_lcd.c (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/emulator_led/driver.mk (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/emulator_led/emulator_led.c (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/st7565ergodox/board_ST7565.h (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/st7565ergodox/driver.mk (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/st7565ergodox/gdisp_lld_config.h (100%) rename keyboards/ergodox/{infinity => }/drivers/gdisp/st7565ergodox/st7565.h (100%) diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h rename to keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk rename to keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c rename to keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h rename to keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk rename to keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c rename to keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk b/keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk rename to keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c rename to keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h rename to keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk rename to keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c rename to keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h rename to keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h similarity index 100% rename from keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h rename to keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h diff --git a/keyboards/ergodox/ergodox.c b/keyboards/ergodox/ergodox.c index 992e95d811..e69de29bb2 100644 --- a/keyboards/ergodox/ergodox.c +++ b/keyboards/ergodox/ergodox.c @@ -1,8 +0,0 @@ -/* - * ergodox.c - * - * Created on: 7 jul 2016 - * Author: Fred Wales - */ - - diff --git a/keyboards/ergodox/ergodox.h b/keyboards/ergodox/ergodox.h index fe54e3260f..f8ec8b5bf2 100644 --- a/keyboards/ergodox/ergodox.h +++ b/keyboards/ergodox/ergodox.h @@ -1,6 +1,5 @@ #ifndef KEYBOARDS_ERGODOX_ERGODOX_H_ #define KEYBOARDS_ERGODOX_ERGODOX_H_ - #ifdef SUBPROJECT_ez #include "ez.h" #endif diff --git a/keyboards/ergodox/infinity/Makefile b/keyboards/ergodox/infinity/Makefile index 942032f83c..22065e4d2d 100644 --- a/keyboards/ergodox/infinity/Makefile +++ b/keyboards/ergodox/infinity/Makefile @@ -52,14 +52,14 @@ 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=0x00002000 +OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 # Build Options # comment out to disable the options. # CUSTOM_MATRIX ?= yes # Custom matrix file SERIAL_LINK_ENABLE = yes -VISUALIZER_ENABLE ?= yes +VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile LCD_ENABLE ?= yes LED_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c index 87ed40fabf..85e61e3aa6 100644 --- a/keyboards/ergodox/infinity/infinity.c +++ b/keyboards/ergodox/infinity/infinity.c @@ -1,8 +1,10 @@ -#include "infinity_ergodox.h" +#include "infinity.h" #include "ch.h" #include "hal.h" #include "serial_link/system/serial_link.h" +#ifdef VISUALIZER_ENABLE #include "lcd_backlight.h" +#endif void init_serial_link_hal(void) { PORTA->PCR[1] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(2); @@ -36,7 +38,7 @@ void init_serial_link_hal(void) { // Using a higher pre-scalar without flicker is possible but FTM0_MOD will need to be reduced // Which will reduce the brightness range #define PRESCALAR_DEFINE 0 - +#ifdef VISUALIZER_ENABLE void lcd_backlight_hal_init(void) { // Setup Backlight SIM->SCGC6 |= SIM_SCGC6_FTM0; @@ -74,3 +76,18 @@ void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { CHANNEL_GREEN.CnV = g; CHANNEL_BLUE.CnV = b; } +#endif + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} diff --git a/keyboards/ergodox/infinity/infinity.h b/keyboards/ergodox/infinity/infinity.h index de72675946..a92aa89bb6 100644 --- a/keyboards/ergodox/infinity/infinity.h +++ b/keyboards/ergodox/infinity/infinity.h @@ -21,24 +21,24 @@ B04, \ B14, B24, B34 \ ) { \ - { KC_NO, KC_NO, KC_NO, KC_##A03, KC_##A04 }, \ - { KC_NO, KC_NO, KC_NO, KC_##A13, KC_##A14 }, \ - { KC_##A20, KC_##A21, KC_NO, KC_##A23, KC_##A24 }, \ - { KC_##A30, KC_##A31, KC_##A32, KC_##A33, KC_##A34 }, \ - { KC_##A40, KC_##A41, KC_##A42, KC_##A43, KC_##A44 }, \ - { KC_##A50, KC_##A51, KC_##A52, KC_##A53, KC_##A54 }, \ - { KC_##A60, KC_##A61, KC_##A62, KC_##A63, KC_##A64 }, \ - { KC_##A70, KC_##A71, KC_##A72, KC_##A73, KC_##A74 }, \ - { KC_##A80, KC_##A81, KC_##A82, KC_##A83, KC_##A84 }, \ - { KC_NO, KC_NO, KC_NO, KC_##B03, KC_##B04 }, \ - { KC_NO, KC_NO, KC_NO, KC_##B13, KC_##B14 }, \ - { KC_##B20, KC_##B21, KC_NO, KC_##B23, KC_##B24 }, \ - { KC_##B30, KC_##B31, KC_##B32, KC_##B33, KC_##B34 }, \ - { KC_##B40, KC_##B41, KC_##B42, KC_##B43, KC_##B44 }, \ - { KC_##B50, KC_##B51, KC_##B52, KC_##B53, KC_##B54 }, \ - { KC_##B60, KC_##B61, KC_##B62, KC_##B63, KC_##B64 }, \ - { KC_##B70, KC_##B71, KC_##B72, KC_##B73, KC_##B74 }, \ - { KC_##B80, KC_##B81, KC_##B82, KC_##B83, KC_##B84 } \ + { KC_NO, KC_NO, KC_NO, A03, A04 }, \ + { KC_NO, KC_NO, KC_NO, A13, A14 }, \ + { A20, A21, KC_NO, A23, A24 }, \ + { A30, A31, A32, A33, A34 }, \ + { A40, A41, A42, A43, A44 }, \ + { A50, A51, A52, A53, A54 }, \ + { A60, A61, A62, A63, A64 }, \ + { A70, A71, A72, A73, A74 }, \ + { A80, A81, A82, A83, A84 }, \ + { KC_NO, KC_NO, KC_NO, B03, B04 }, \ + { KC_NO, KC_NO, KC_NO, B13, B14 }, \ + { B20, B21, KC_NO, B23, B24 }, \ + { B30, B31, B32, B33, B34 }, \ + { B40, B41, B42, B43, B44 }, \ + { B50, B51, B52, B53, B54 }, \ + { B60, B61, B62, B63, B64 }, \ + { B70, B71, B72, B73, B74 }, \ + { B80, B81, B82, B83, B84 } \ } #endif /* KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ */ diff --git a/keyboards/ergodox/infinity/matrix.c b/keyboards/ergodox/infinity/matrix.c index 2b806cd649..1fda904849 100644 --- a/keyboards/ergodox/infinity/matrix.c +++ b/keyboards/ergodox/infinity/matrix.c @@ -63,6 +63,8 @@ void matrix_init(void) memset(matrix, 0, MATRIX_ROWS); memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS); + + matrix_init_quantum(); } uint8_t matrix_scan(void) @@ -127,6 +129,7 @@ uint8_t matrix_scan(void) } debouncing = false; } + matrix_scan_quantum(); return 1; } diff --git a/quantum/quantum.h b/quantum/quantum.h index 7ebfb24e30..6e3fbcc792 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -25,6 +25,7 @@ #include "led.h" #include "action_util.h" #include +#include "print.h" extern uint32_t default_layer_state; diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index 0368bcd4a1..a1352527fc 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -29,7 +29,9 @@ #include #include "util.h" - +#if defined(PROTOCOL_CHIBIOS) +#define PSTR(x) x +#endif #ifndef NO_PRINT