Skip to content

Commit

Permalink
Merge pull request qmk#503 from fredizzimo/ergodox_subproject
Browse files Browse the repository at this point in the history
Add both Ergodox EZ and Infinity Ergodox as sub-projects of Ergodox
  • Loading branch information
jackhumbert committed Jul 30, 2016
2 parents 9c07189 + 2299e59 commit 9bd8012
Show file tree
Hide file tree
Showing 225 changed files with 1,651 additions and 1,795 deletions.
34 changes: 34 additions & 0 deletions keyboards/ergodox/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#----------------------------------------------------------------------------
# On command line:
#
# make = Make software.
#
# make clean = Clean out built project files.
#
# That's pretty much all you need. To compile, always go make clean,
# followed by make.
#
# For advanced users only:
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
#----------------------------------------------------------------------------
SUBPROJECT_DEFAULT = ez

# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= no # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
MIDI_ENABLE ?= no # MIDI controls
UNICODE_ENABLE ?= yes # Unicode

ifndef QUANTUM_DIR
include ../../Makefile
endif
36 changes: 36 additions & 0 deletions keyboards/ergodox/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#ifndef KEYBOARDS_ERGODOX_CONFIG_H_
#define KEYBOARDS_ERGODOX_CONFIG_H_

#define MOUSEKEY_DELAY 100
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_MAX_SPEED 3
#define MOUSEKEY_TIME_TO_MAX 10

#define TAPPING_TOGGLE 1

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

#define TAPPING_TERM 200
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
)

#ifdef SUBPROJECT_ez
#include "ez/config.h"
#endif
#ifdef SUBPROJECT_infinity
#include "infinity/config.h"
#endif


#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */
Empty file added keyboards/ergodox/ergodox.c
Empty file.
10 changes: 10 additions & 0 deletions keyboards/ergodox/ergodox.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#ifndef KEYBOARDS_ERGODOX_ERGODOX_H_
#define KEYBOARDS_ERGODOX_ERGODOX_H_
#ifdef SUBPROJECT_ez
#include "ez.h"
#endif
#ifdef SUBPROJECT_infinity
#include "infinity.h"
#endif

#endif /* KEYBOARDS_ERGODOX_ERGODOX_H_ */
File renamed without changes.
12 changes: 1 addition & 11 deletions keyboards/ergodox_ez/Makefile → keyboards/ergodox/ez/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE ?= no # Console for debug(+400)
COMMAND_ENABLE ?= yes # Commands for debug and configuration
CUSTOM_MATRIX ?= yes # Custom matrix file for the ErgoDox EZ
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
MIDI_ENABLE ?= no # MIDI controls
UNICODE_ENABLE ?= yes # Unicode

ifndef QUANTUM_DIR
include ../../Makefile
include ../../../Makefile
endif
33 changes: 7 additions & 26 deletions keyboards/ergodox_ez/config.h → keyboards/ergodox/ez/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H
#ifndef ERGODOX_EZ_CONFIG_H
#define ERGODOX_EZ_CONFIG_H

#include "config_common.h"
#include "../config.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
Expand All @@ -33,34 +33,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 14
#define MATRIX_COLS 6

#define MOUSEKEY_DELAY 100
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_MAX_SPEED 3
#define MOUSEKEY_TIME_TO_MAX 10

#define TAPPING_TOGGLE 1

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* number of backlight levels */
#define BACKLIGHT_LEVELS 3

#define LED_BRIGHTNESS_LO 15
#define LED_BRIGHTNESS_HI 255


/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
#define TAPPING_TERM 200
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
)

/*
* Feature disable options
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ergodox_ez.h"
#include "ez.h"
#include "i2cmaster.h"

bool i2c_initialized = 0;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "debug.h"
#include "util.h"
#include "matrix.h"
#include "ergodox_ez.h"
#include "ez.h"
#include "i2cmaster.h"
#ifdef DEBUG_MATRIX_SCAN_RATE
#include "timer.h"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,26 @@ 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.
#
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
VISUALIZER_ENABLE ?= yes
VISUALIZER_ENABLE ?= no #temporarily disabled to make everything compile
LCD_ENABLE ?= yes
LED_ENABLE ?= yes
LCD_BACKLIGHT_ENABLE ?= yes

ifndef QUANTUM_DIR
include ../../../Makefile
endif

ifdef LCD_ENABLE
include drivers/gdisp/st7565ergodox/driver.mk
include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
endif

ifdef LED_ENABLE
include drivers/gdisp/IS31FL3731C/driver.mk
include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk
endif

ifndef QUANTUM_DIR
include ../../Makefile
endif
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H
#ifndef INFINITY_ERGODOX_CONFIG_H
#define INFINITY_ERGODOX_CONFIG_H

#include "../config.h"


/* USB Device descriptor parameter */
Expand All @@ -35,25 +37,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 5
#define LOCAL_MATRIX_ROWS 9

/* number of backlight levels */
#define BACKLIGHT_LEVELS 3

#define LED_BRIGHTNESS_LO 15
#define LED_BRIGHTNESS_HI 255

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
//#define LOCKING_RESYNC_ENABLE

/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* Keymap for Infiity prototype */
#define INFINITY_PROTOTYPE

#define SERIAL_LINK_BAUD 562500
#define SERIAL_LINK_THREAD_PRIORITY (NORMALPRIO - 1)
// The visualizer needs gfx thread priorities
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -74,3 +76,57 @@ void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
CHANNEL_GREEN.CnV = g;
CHANNEL_BLUE.CnV = b;
}
#endif

__attribute__ ((weak))
void matrix_init_user(void) {
}

__attribute__ ((weak))
void matrix_scan_user(void) {
}


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();
}

void ergodox_board_led_on(void){
}

void ergodox_right_led_1_on(void){
}

void ergodox_right_led_2_on(void){
}

void ergodox_right_led_3_on(void){
}

void ergodox_right_led_on(uint8_t led){
}

void ergodox_board_led_off(void){
}

void ergodox_right_led_1_off(void){
}

void ergodox_right_led_2_off(void){
}

void ergodox_right_led_3_off(void){
}

void ergodox_right_led_off(uint8_t led){
}
Loading

0 comments on commit 9bd8012

Please sign in to comment.