aboutsummaryrefslogtreecommitdiff
path: root/keyboards/mitosis
diff options
context:
space:
mode:
authorMichael Terhar <michael.terhar@pararray.com>2017-08-30 11:50:31 -0400
committerJack Humbert <jack.humb@gmail.com>2017-08-30 11:50:31 -0400
commita4316ba486ae25eae93174f5d7e4952811680601 (patch)
treecfbb93193d0b506328d7697a04a870ff147343dd /keyboards/mitosis
parentda83f04a30903a98b9a8dbe29c2d6cef4f9da3a7 (diff)
downloadqmk_firmware-a4316ba486ae25eae93174f5d7e4952811680601.tar.gz
qmk_firmware-a4316ba486ae25eae93174f5d7e4952811680601.zip
Fixed mitosis-mjt audio (#1653)
* copied mjt keymaps from archive * All mjt boards now compile * fixed jd45-mjt breathing * Updates to fix SpaceFN but not tested yet. * Still missing either spacebar or an adjacent keypress. * Debugging rigged up for use with hid_listen. * Reverted the default keymap to use tap_layer_key rather than custom. Moved custom approach to keymap_debug.c * Fixed the lower-left side of the keymap, which needed more spacers due to the matrix being directly put into the array rather than using the keymap function. * Cleaned up JD45 keymap that uses tapkey. * Redid minivan keymap with numsym rather than raise/lower. Untested. * Created my MJT keymap for HHKB Enabled dynamic macros and moved somoe of the shortcuts around. * Minor keymap fixes to make them compile without errors. * Added home/end to right arrow cluster on DYN layer. * Added more keys to fn and dyn layers. * It wasn't using my custom layer last time somehow...? Now it will. * Compiled and installed at end of day on 8/23 * Moved macros to FKEY layer because Adjust was too hard to get into and out of without some sort of feedback. * Fixed volume controls... were reversed and disabled. * Added F13-F15 back to fkeys layer in Minivan * Created new Planck Keymap that uses the NumSym and FKeys layer approach like the Minivan. * Removed DYN layer. * Fixed diagram in planck numsym. * Cleanup for pull request. * Roadkit flip phone warning. * Replaced PLAY_NOTES_ARRAY to PLAY_SONG * reset the submodules * checked out specific commits for submodules * Removed debugging from JD45 shared config.h * Moved custom rules.mk to apropriate keymap Reset the shared rules.mk file. * Trailing return issue in rules.mk Gotta make for a smooth pull request :-) * Mitosis music troubleshooting Also updated the song playing function. Does not work currently. * Fixed mitosis audio * Put mitosis/rules.mk back to QMK master
Diffstat (limited to 'keyboards/mitosis')
-rw-r--r--keyboards/mitosis/keymaps/mjt/Makefile17
-rw-r--r--keyboards/mitosis/keymaps/mjt/config.h78
-rw-r--r--keyboards/mitosis/keymaps/mjt/keymap.c24
3 files changed, 50 insertions, 69 deletions
diff --git a/keyboards/mitosis/keymaps/mjt/Makefile b/keyboards/mitosis/keymaps/mjt/Makefile
new file mode 100644
index 000000000..a4137ad00
--- /dev/null
+++ b/keyboards/mitosis/keymaps/mjt/Makefile
@@ -0,0 +1,17 @@
1BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
2MOUSEKEY_ENABLE = no # Mouse keys(+4700)
3EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
4CONSOLE_ENABLE = no # Console for debug(+400)
5COMMAND_ENABLE = no # Commands for debug and configuration
6NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
7BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
8MIDI_ENABLE = no # MIDI controls
9AUDIO_ENABLE = yes # Audio output on port C6
10UNICODE_ENABLE = no # Unicode
11BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
12RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
13API_SYSEX_ENABLE = no
14
15ifndef QUANTUM_DIR
16 include ../../../../Makefile
17endif
diff --git a/keyboards/mitosis/keymaps/mjt/config.h b/keyboards/mitosis/keymaps/mjt/config.h
index 2209a9e0d..71adc5a2d 100644
--- a/keyboards/mitosis/keymaps/mjt/config.h
+++ b/keyboards/mitosis/keymaps/mjt/config.h
@@ -1,74 +1,24 @@
1#ifndef CONFIG_H
2#define CONFIG_H
3 1
4#include "config_common.h" 2#ifndef CONFIG_USER_H
3#define CONFIG_USER_H
5 4
6/* USB Device descriptor parameter */ 5#include "../../config.h"
7 6
8#define VENDOR_ID 0xFEEB 7#ifdef AUDIO_ENABLE
9#define PRODUCT_ID 0x6060 8 #define STARTUP_SONG SONG(PLANCK_SOUND)
10#define DEVICE_VER 0x0001 9 // #define STARTUP_SONG SONG(NO_SOUND)
11#define MANUFACTURER MJT
12#define PRODUCT Mitosis
13#define DESCRIPTION q.m.k. keyboard firmware for Mitosis
14 10
15/* key matrix size */ 11 #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
16#define MATRIX_ROWS 5 12 SONG(COLEMAK_SOUND), \
17#define MATRIX_COLS 10 13 SONG(DVORAK_SOUND) \
14 }
15#endif
16
17#define AUDIO_VOICES
18#define C6_AUDIO
18 19
19// fix iPhone power adapter issue 20// fix iPhone power adapter issue
20#define USB_MAX_POWER_CONSUMPTION 50 21#define USB_MAX_POWER_CONSUMPTION 50
21// #define CATERINA_BOOTLOADER
22
23/* define if matrix has ghost */
24//#define MATRIX_HAS_GHOST
25
26/* number of backlight levels */
27//#define BACKLIGHT_LEVELS 3
28
29#define ONESHOT_TIMEOUT 500
30
31
32/* key combination for command */
33#define IS_COMMAND() ( \
34 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
35)
36
37/*
38 * Feature disable options
39 * These options are also useful to firmware size reduction.
40 */
41
42#define PREVENT_STUCK_MODIFIERS
43
44/* disable debug print */
45//#define NO_DEBUG
46
47/* disable print */
48//#define NO_PRINT
49
50/* disable action features */
51//#define NO_ACTION_LAYER
52//#define NO_ACTION_TAPPING
53//#define NO_ACTION_ONESHOT
54//#define NO_ACTION_MACRO
55//#define NO_ACTION_FUNCTION
56 22
57//UART settings for communication with the RF microcontroller
58#define SERIAL_UART_BAUD 1000000
59#define SERIAL_UART_DATA UDR1
60#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
61#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
62#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
63#define SERIAL_UART_INIT() do { \
64 /* baud rate */ \
65 UBRR1L = SERIAL_UART_UBRR; \
66 /* baud rate */ \
67 UBRR1H = SERIAL_UART_UBRR >> 8; \
68 /* enable TX and RX */ \
69 UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
70 /* 8-bit data */ \
71 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
72 } while(0)
73 23
74#endif 24#endif
diff --git a/keyboards/mitosis/keymaps/mjt/keymap.c b/keyboards/mitosis/keymaps/mjt/keymap.c
index 01443d5f4..4663c0acf 100644
--- a/keyboards/mitosis/keymaps/mjt/keymap.c
+++ b/keyboards/mitosis/keymaps/mjt/keymap.c
@@ -28,6 +28,7 @@ enum mitosis_keycodes
28 MACSLEEP, 28 MACSLEEP,
29 FNMAC, 29 FNMAC,
30 FNPC, 30 FNPC,
31 AUDIOTEST,
31 DYNAMIC_MACRO_RANGE, 32 DYNAMIC_MACRO_RANGE,
32}; 33};
33 34
@@ -236,7 +237,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
236 if (record->event.pressed) { 237 if (record->event.pressed) {
237 persistent_function_layer_set(_FUNCTIONPC); 238 persistent_function_layer_set(_FUNCTIONPC);
238 #ifdef AUDIO_ENABLE 239 #ifdef AUDIO_ENABLE
239 PLAY_NOTE_ARRAY(tone_fnpc, false, 0); 240 PLAY_SONG(tone_fnpc);
240 #endif 241 #endif
241 } 242 }
242 return false; 243 return false;
@@ -245,9 +246,22 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
245 if (record->event.pressed) { 246 if (record->event.pressed) {
246 persistent_function_layer_set(_FUNCTIONMAC); 247 persistent_function_layer_set(_FUNCTIONMAC);
247 #ifdef AUDIO_ENABLE 248 #ifdef AUDIO_ENABLE
248 PLAY_NOTE_ARRAY(tone_fnmac, false, 0); 249 PLAY_SONG(tone_fnmac);
249 #endif 250 #endif
250 } 251 }
252 return false;
253 break;
254 case AUDIOTEST:
255 if (record->event.pressed) {
256 #ifdef AUDIO_ENABLE
257 PLAY_SONG(music_scale);
258 register_code(KC_M);
259 unregister_code(KC_M);
260 #endif
261 register_code(KC_A);
262 } else {
263 unregister_code(KC_A);
264 }
251 return false; 265 return false;
252 break; 266 break;
253 //If any other key was pressed during the layer mod hold period, 267 //If any other key was pressed during the layer mod hold period,
@@ -279,12 +293,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
279void startup_user() 293void startup_user()
280{ 294{
281 _delay_ms(20); // gets rid of tick 295 _delay_ms(20); // gets rid of tick
282 PLAY_NOTE_ARRAY(tone_startup, false, 0); 296 PLAY_SONG(tone_startup);
283} 297}
284 298
285void shutdown_user() 299void shutdown_user()
286{ 300{
287 PLAY_NOTE_ARRAY(tone_goodbye, false, 0); 301 PLAY_SONG(tone_goodbye);
288 _delay_ms(150); 302 _delay_ms(150);
289 stop_all_notes(); 303 stop_all_notes();
290} 304}
@@ -296,7 +310,7 @@ void music_on_user(void)
296 310
297void music_scale_user(void) 311void music_scale_user(void)
298{ 312{
299 PLAY_NOTE_ARRAY(music_scale, false, 0); 313 PLAY_SONG(music_scale);
300} 314}
301 315
302#endif 316#endif