From 9af995c59b2655fa347e43b1eab2122e72ef7fe3 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 22:28:28 +0300 Subject: Initial structure for Ergodox as subprojects Only the EZ default keymaps compiles at the moment though. --- keyboards/ergodox/ez/config.h | 84 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 keyboards/ergodox/ez/config.h (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h new file mode 100644 index 000000000..2bb56731b --- /dev/null +++ b/keyboards/ergodox/ez/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2012 Jun Wako +Copyright 2013 Oleg Kostyuk + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1307 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ErgoDox EZ +#define PRODUCT ErgoDox EZ +#define DESCRIPTION QMK keyboard firmware for Ergodox EZ + +/* key matrix size */ +#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 + +/* 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 + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +// #define NO_DEBUG + +/* disable print */ +// #define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION +//#define DEBUG_MATRIX_SCAN_RATE + +#endif -- cgit v1.2.3 From e7670f6d19639ba2a0cead228cc58ff58eef5a60 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 9 Jul 2016 11:26:15 +0300 Subject: Move some of the Ergodox config settings to shared --- keyboards/ergodox/config.h | 24 ++++++++++++++++++++++++ keyboards/ergodox/ez/config.h | 29 +++++------------------------ keyboards/ergodox/infinity/config.h | 21 ++++++++------------- 3 files changed, 37 insertions(+), 37 deletions(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h index c37c10e93..edc60caae 100644 --- a/keyboards/ergodox/config.h +++ b/keyboards/ergodox/config.h @@ -1,6 +1,30 @@ #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 diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 2bb56731b..59fc0fda7 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -19,7 +19,7 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H -#include "config_common.h" +#include "../config.h" /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -33,34 +33,15 @@ along with this program. If not, see . #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 diff --git a/keyboards/ergodox/infinity/config.h b/keyboards/ergodox/infinity/config.h index d24ee0f05..83d7c5837 100644 --- a/keyboards/ergodox/infinity/config.h +++ b/keyboards/ergodox/infinity/config.h @@ -18,6 +18,8 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H +#include "../config.h" + /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -35,25 +37,18 @@ along with this program. If not, see . #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 -- cgit v1.2.3 From 426e9ecc6fb8366c1c17af692deddd90df570cd8 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 12:01:28 +0300 Subject: Fix config.h include guards --- keyboards/ergodox/ez/config.h | 4 ++-- keyboards/ergodox/infinity/config.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 59fc0fda7..084a044ee 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#ifndef ERGODOX_EZ_CONFIG_H +#define ERGODOX_EZ_CONFIG_H #include "../config.h" diff --git a/keyboards/ergodox/infinity/config.h b/keyboards/ergodox/infinity/config.h index 83d7c5837..9e264083b 100644 --- a/keyboards/ergodox/infinity/config.h +++ b/keyboards/ergodox/infinity/config.h @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#ifndef INFINITY_ERGODOX_CONFIG_H +#define INFINITY_ERGODOX_CONFIG_H #include "../config.h" -- cgit v1.2.3 From 06a2677b7eedbf58532fa1a673ba1277e756174d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 21 Nov 2016 20:17:32 -0500 Subject: fix infinity --- keyboards/ergodox/config.h | 2 -- keyboards/ergodox/ez/config.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h index 049c707a5..edc60caae 100644 --- a/keyboards/ergodox/config.h +++ b/keyboards/ergodox/config.h @@ -1,8 +1,6 @@ #ifndef KEYBOARDS_ERGODOX_CONFIG_H_ #define KEYBOARDS_ERGODOX_CONFIG_H_ -#include "config_common.h" - #define MOUSEKEY_DELAY 100 #define MOUSEKEY_INTERVAL 20 #define MOUSEKEY_MAX_SPEED 3 diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 084a044ee..67a856e51 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -21,6 +21,8 @@ along with this program. If not, see . #include "../config.h" +#include "config_common.h" + /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x1307 -- cgit v1.2.3 From 2d0ada01902a0103dc4f4f54a416f0666c641b5b Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Mon, 28 Nov 2016 07:55:02 -0500 Subject: Pulls LED config into common config for EZ --- keyboards/ergodox/ez/config.h | 11 +++++++++++ keyboards/ergodox/keymaps/erez_experimental/config.h | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 67a856e51..0b7e8b2ee 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -45,6 +45,17 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 +/* ws2812 RGB LED */ +#define RGB_DI_PIN D7 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 15 // Number of LEDs +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 255 +#define RGBLIGHT_VAL_STEP 12 + +#define RGB_MIDI +#define RGBW_BB_TWI + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/ergodox/keymaps/erez_experimental/config.h b/keyboards/ergodox/keymaps/erez_experimental/config.h index fbd12ab79..4da18c65a 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/config.h +++ b/keyboards/ergodox/keymaps/erez_experimental/config.h @@ -9,15 +9,5 @@ #undef LEADER_TIMEOUT #define LEADER_TIMEOUT 300 -/* ws2812 RGB LED */ -#define RGB_DI_PIN D7 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 15 // Number of LEDs -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 255 -#define RGBLIGHT_VAL_STEP 12 - -#define RGB_MIDI -#define RGBW_BB_TWI #endif -- cgit v1.2.3 From d0cefef946660865dae80877886fcce610920a27 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 29 Nov 2016 00:09:56 -0500 Subject: enable rgblight by default for ez --- keyboards/ergodox/ez/config.h | 11 +++++++++++ keyboards/ergodox/ez/rules.mk | 1 + 2 files changed, 12 insertions(+) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 67a856e51..c2750a321 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -41,6 +41,17 @@ along with this program. If not, see . #define LED_BRIGHTNESS_LO 15 #define LED_BRIGHTNESS_HI 255 +/* ws2812 RGB LED */ +#define RGB_DI_PIN D7 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 15 // Number of LEDs +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 255 +#define RGBLIGHT_VAL_STEP 12 + +#define RGB_MIDI +#define RGBW_BB_TWI + /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/keyboards/ergodox/ez/rules.mk b/keyboards/ergodox/ez/rules.mk index f570061fe..893cfa7a8 100644 --- a/keyboards/ergodox/ez/rules.mk +++ b/keyboards/ergodox/ez/rules.mk @@ -73,6 +73,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=512 SLEEP_LED_ENABLE = no API_SYSEX_ENABLE ?= yes +RGBLIGHT_ENABLE ?= yes ifndef QUANTUM_DIR include ../../../Makefile -- cgit v1.2.3 From f946d830f98da0161753d37da9659caa7469cf4f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 29 Nov 2016 00:11:11 -0500 Subject: guess i didnt pull --- keyboards/ergodox/ez/config.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index f3e1020bd..c2750a321 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -56,17 +56,6 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 -/* ws2812 RGB LED */ -#define RGB_DI_PIN D7 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 15 // Number of LEDs -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 255 -#define RGBLIGHT_VAL_STEP 12 - -#define RGB_MIDI -#define RGBW_BB_TWI - /* * Feature disable options * These options are also useful to firmware size reduction. -- cgit v1.2.3 From 83e613ad239459582ae28f78b6c81535b9b138d7 Mon Sep 17 00:00:00 2001 From: Kyle Smith Date: Wed, 14 Dec 2016 23:24:40 -0500 Subject: Allow power consumption to be set per-keyboard. --- keyboards/ergodox/ez/config.h | 2 ++ tmk_core/protocol/lufa/descriptor.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index c2750a321..a3dc5bf15 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -56,6 +56,8 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 +#define USB_MAX_POWER_CONSUMPTION 50 + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/tmk_core/protocol/lufa/descriptor.c b/tmk_core/protocol/lufa/descriptor.c index bf47787d2..14d99b50b 100644 --- a/tmk_core/protocol/lufa/descriptor.c +++ b/tmk_core/protocol/lufa/descriptor.c @@ -40,6 +40,9 @@ #include "report.h" #include "descriptor.h" +#ifndef USB_MAX_POWER_CONSUMPTION +#define USB_MAX_POWER_CONSUMPTION 500 +#endif /******************************************************************************* * HID Report Descriptors @@ -294,7 +297,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .ConfigAttributes = (USB_CONFIG_ATTR_RESERVED | USB_CONFIG_ATTR_REMOTEWAKEUP), - .MaxPowerConsumption = USB_CONFIG_POWER_MA(500) + .MaxPowerConsumption = USB_CONFIG_POWER_MA(USB_MAX_POWER_CONSUMPTION) }, /* -- cgit v1.2.3 From 06c64bbff3e228df542149acde64eadaf59b9b0f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 19 Dec 2016 11:18:18 -0500 Subject: rgb clean-up, api clean-up --- keyboards/ergodox/ez/config.h | 1 + quantum/api.c | 43 +++++++++++++++++++++-------------------- quantum/audio/audio.c | 15 ++++++++++----- quantum/audio/voices.c | 45 +++++++++++++++++++++++++++++++++++++++++-- quantum/audio/voices.h | 1 + quantum/light_ws2812.h | 7 ------- 6 files changed, 77 insertions(+), 35 deletions(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index c2750a321..f532b2d5a 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -52,6 +52,7 @@ along with this program. If not, see . #define RGB_MIDI #define RGBW_BB_TWI +#define RGBW 1 /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 diff --git a/quantum/api.c b/quantum/api.c index 4ca3b9676..6a7c0a433 100644 --- a/quantum/api.c +++ b/quantum/api.c @@ -116,28 +116,29 @@ void process_api(uint16_t length, uint8_t * data) { MT_GET_DATA_ACK(DT_KEYMAP_SIZE, keymap_size, 2); break; } - case DT_KEYMAP: { - uint8_t keymap_data[MATRIX_ROWS * MATRIX_COLS * 4 + 3]; - keymap_data[0] = data[2]; - keymap_data[1] = MATRIX_ROWS; - keymap_data[2] = MATRIX_COLS; - for (int i = 0; i < MATRIX_ROWS; i++) { - for (int j = 0; j < MATRIX_COLS; j++) { - keymap_data[3 + (i*MATRIX_COLS*2) + (j*2)] = pgm_read_word(&keymaps[data[2]][i][j]) >> 8; - keymap_data[3 + (i*MATRIX_COLS*2) + (j*2) + 1] = pgm_read_word(&keymaps[data[2]][i][j]) & 0xFF; - } - } - MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, MATRIX_ROWS * MATRIX_COLS * 4 + 3); - // uint8_t keymap_data[5]; - // keymap_data[0] = data[2]; - // keymap_data[1] = data[3]; - // keymap_data[2] = data[4]; - // keymap_data[3] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) >> 8; - // keymap_data[4] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) & 0xFF; + // This may be too much + // case DT_KEYMAP: { + // uint8_t keymap_data[MATRIX_ROWS * MATRIX_COLS * 4 + 3]; + // keymap_data[0] = data[2]; + // keymap_data[1] = MATRIX_ROWS; + // keymap_data[2] = MATRIX_COLS; + // for (int i = 0; i < MATRIX_ROWS; i++) { + // for (int j = 0; j < MATRIX_COLS; j++) { + // keymap_data[3 + (i*MATRIX_COLS*2) + (j*2)] = pgm_read_word(&keymaps[data[2]][i][j]) >> 8; + // keymap_data[3 + (i*MATRIX_COLS*2) + (j*2) + 1] = pgm_read_word(&keymaps[data[2]][i][j]) & 0xFF; + // } + // } + // MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, MATRIX_ROWS * MATRIX_COLS * 4 + 3); + // // uint8_t keymap_data[5]; + // // keymap_data[0] = data[2]; + // // keymap_data[1] = data[3]; + // // keymap_data[2] = data[4]; + // // keymap_data[3] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) >> 8; + // // keymap_data[4] = pgm_read_word(&keymaps[data[2]][data[3]][data[4]]) & 0xFF; - // MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, 5); - break; - } + // // MT_GET_DATA_ACK(DT_KEYMAP, keymap_data, 5); + // break; + // } default: break; } diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index ead5fbf3e..2a315fd16 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -77,6 +77,7 @@ static bool audio_initialized = false; audio_config_t audio_config; uint16_t envelope_index = 0; +bool glissando = true; void audio_init() { @@ -205,13 +206,17 @@ ISR(TIMER3_COMPA_vect) freq = frequencies[voice_place]; #endif } else { - if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { - frequency = frequency * pow(2, 440/frequency/12/2); - } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { - frequency = frequency * pow(2, -440/frequency/12/2); + if (glissando) { + if (frequency != 0 && frequency < frequencies[voices - 1] && frequency < frequencies[voices - 1] * pow(2, -440/frequencies[voices - 1]/12/2)) { + frequency = frequency * pow(2, 440/frequency/12/2); + } else if (frequency != 0 && frequency > frequencies[voices - 1] && frequency > frequencies[voices - 1] * pow(2, 440/frequencies[voices - 1]/12/2)) { + frequency = frequency * pow(2, -440/frequency/12/2); + } else { + frequency = frequencies[voices - 1]; + } } else { frequency = frequencies[voices - 1]; - } + } #ifdef VIBRATO_ENABLE if (vibrato_strength > 0) { diff --git a/quantum/audio/voices.c b/quantum/audio/voices.c index 19f7b646e..06ff275ba 100644 --- a/quantum/audio/voices.c +++ b/quantum/audio/voices.c @@ -6,6 +6,7 @@ extern uint16_t envelope_index; extern float note_timbre; extern float polyphony_rate; +extern bool glissando; voice_type voice = default_voice; @@ -27,11 +28,13 @@ float voice_envelope(float frequency) { switch (voice) { case default_voice: + glissando = true; note_timbre = TIMBRE_50; polyphony_rate = 0; break; case something: + glissando = false; polyphony_rate = 0; switch (compensated_index) { case 0 ... 9: @@ -43,16 +46,51 @@ float voice_envelope(float frequency) { break; case 20 ... 200: - note_timbre = .25 + .125 + pow(((float)compensated_index - 20) / (200 - 20), 2)*.125; + note_timbre = .125 + .125; break; default: - note_timbre = .25; + note_timbre = .125; break; } break; + case drums: + glissando = false; + polyphony_rate = 0; + note_timbre = 0; + switch (envelope_index) { + case 0 ... 20: + note_timbre = 0.5; + default: + frequency = (rand() % (int)(frequency * 1.2 - frequency)) + (frequency * 0.8); + break; + } + // if (frequency < 80.0) { + // switch (envelope_index % 4) { + // case 0: + // frequency = 348.0; + // case 1: + // frequency = 53.0; + // case 2: + // frequency = 128.0; + // case 3: + // frequency = 934.0; + // default: + // break; + // } + // } else if (frequency < 160.0) { + + // } else if (frequency < 320.0) { + + // } else if (frequency < 640.0) { + + // } else if (frequency < 1280.0) { + + // } + break; case butts_fader: + glissando = true; polyphony_rate = 0; switch (compensated_index) { case 0 ... 9: @@ -100,6 +138,7 @@ float voice_envelope(float frequency) { case duty_osc: // This slows the loop down a substantial amount, so higher notes may freeze + glissando = true; polyphony_rate = 0; switch (compensated_index) { default: @@ -114,6 +153,7 @@ float voice_envelope(float frequency) { break; case duty_octave_down: + glissando = true; polyphony_rate = 0; note_timbre = (envelope_index % 2) * .125 + .375 * 2; if ((envelope_index % 4) == 0) @@ -122,6 +162,7 @@ float voice_envelope(float frequency) { note_timbre = 0; break; case delayed_vibrato: + glissando = true; polyphony_rate = 0; note_timbre = TIMBRE_50; #define VOICE_VIBRATO_DELAY 150 diff --git a/quantum/audio/voices.h b/quantum/audio/voices.h index b43def3d7..72f139e9c 100644 --- a/quantum/audio/voices.h +++ b/quantum/audio/voices.h @@ -12,6 +12,7 @@ float voice_envelope(float frequency); typedef enum { default_voice, something, + drums, butts_fader, octave_crunch, duty_osc, diff --git a/quantum/light_ws2812.h b/quantum/light_ws2812.h index 9498e550e..2f78c20fc 100755 --- a/quantum/light_ws2812.h +++ b/quantum/light_ws2812.h @@ -18,13 +18,6 @@ //#include "ws2812_config.h" //#include "i2cmaster.h" -#define LIGHT_I2C 1 -#define LIGHT_I2C_ADDR 0x84 -#define LIGHT_I2C_ADDR_WRITE ( (LIGHT_I2C_ADDR<<1) | I2C_WRITE ) -#define LIGHT_I2C_ADDR_READ ( (LIGHT_I2C_ADDR<<1) | I2C_READ ) - -#define RGBW 1 - #ifdef RGBW #define LED_TYPE struct cRGBW #else -- cgit v1.2.3 From ffc1d97672bcfcf9d7b687025cb70e284c75fd67 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 2 Jan 2017 09:57:39 -0500 Subject: Update config.h --- keyboards/ergodox/ez/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 2e273eb97..6a8c66d7d 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -57,7 +57,7 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 -#define USB_MAX_POWER_CONSUMPTION 50 +#define USB_MAX_POWER_CONSUMPTION 500 /* * Feature disable options -- cgit v1.2.3 From 841d7e6a1d74b1fc45575ed551132ec27353ebf3 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 23 Jan 2017 13:55:24 -0500 Subject: turn off rgb_midi in ez --- keyboards/ergodox/ez/config.h | 2 +- keyboards/ergodox/ez/ez.c | 8 ++++---- quantum/process_keycode/process_music.c | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'keyboards/ergodox/ez/config.h') diff --git a/keyboards/ergodox/ez/config.h b/keyboards/ergodox/ez/config.h index 6a8c66d7d..e4f95c302 100644 --- a/keyboards/ergodox/ez/config.h +++ b/keyboards/ergodox/ez/config.h @@ -49,7 +49,7 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 255 #define RGBLIGHT_VAL_STEP 12 -#define RGB_MIDI +// #define RGB_MIDI #define RGBW_BB_TWI #define RGBW 1 diff --git a/keyboards/ergodox/ez/ez.c b/keyboards/ergodox/ez/ez.c index 039e4c6bb..3e19f2302 100644 --- a/keyboards/ergodox/ez/ez.c +++ b/keyboards/ergodox/ez/ez.c @@ -52,9 +52,9 @@ uint8_t init_mcp23018(void) { // I2C subsystem - uint8_t sreg_prev; - sreg_prev=SREG; - cli(); + // uint8_t sreg_prev; + // sreg_prev=SREG; + // cli(); if (i2c_initialized == 0) { i2c_init(); // on pins D(1,0) i2c_initialized++; @@ -83,7 +83,7 @@ uint8_t init_mcp23018(void) { out: i2c_stop(); - SREG=sreg_prev; + // SREG=sreg_prev; return mcp23018_status; } diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index ca68bef6c..1e2648bff 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -114,6 +114,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { music_sequence_interval+=10; return false; } + #define MUSIC_MODE_GUITAR #ifdef MUSIC_MODE_CHROMATIC float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + record->event.key.col + music_offset)/12.0+(MATRIX_ROWS - record->event.key.row)); -- cgit v1.2.3