From 3568065141279baa3dfff0e6a65fbf6ab8d14676 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 12 Feb 2016 09:33:38 +0200 Subject: Add readme --- readme.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 000000000..82bf8bfdf --- /dev/null +++ b/readme.md @@ -0,0 +1 @@ +A visualization library for the TMK keyboard firmware -- cgit v1.2.3-24-g4f1b From 4452f4965dae25bb3707e64858221784318c4f56 Mon Sep 17 00:00:00 2001 From: fredizzimo Date: Fri, 12 Feb 2016 09:59:39 +0200 Subject: Add MIT license --- LICENSE.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 000000000..d7cc3198c --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. -- cgit v1.2.3-24-g4f1b From bb75446b0beb4db28b775a2e2db61d91f0f0324a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Feb 2016 16:44:14 +0200 Subject: Add uGFX submodule v 2.4 --- .gitmodules | 3 +++ ugfx | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 ugfx diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..2ab25f688 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "ugfx"] + path = ugfx + url = https://bitbucket.org/Tectu/ugfx.git diff --git a/ugfx b/ugfx new file mode 160000 index 000000000..2b66ac524 --- /dev/null +++ b/ugfx @@ -0,0 +1 @@ +Subproject commit 2b66ac524bd56853ba97b917683971f3ebc0104c -- cgit v1.2.3-24-g4f1b From fb681b5a60ae5b13a0413c815b4564d60fa200c5 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Feb 2016 17:47:39 +0200 Subject: Add makefile that includes ugfx --- visualizer.mk | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 visualizer.mk diff --git a/visualizer.mk b/visualizer.mk new file mode 100644 index 000000000..c5ae0dfa9 --- /dev/null +++ b/visualizer.mk @@ -0,0 +1,26 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Fred Sundvik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +GFXLIB = $(VISUALIZER_DIR)/ugfx +include $(GFXLIB)/gfx.mk +SRC += $(GFXSRC) +INC += $(GFXINC) -- cgit v1.2.3-24-g4f1b From 01b955aa64766d51191a716d3a9d74d35f221b28 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Feb 2016 19:21:16 +0200 Subject: Add LCD backlight support Also possibility to disable the LCD support --- lcd_backlight.c | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lcd_backlight.h | 42 ++++++++++++++++++++++++++++ visualizer.mk | 9 +++++- 3 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 lcd_backlight.c create mode 100644 lcd_backlight.h diff --git a/lcd_backlight.c b/lcd_backlight.c new file mode 100644 index 000000000..70187d1e0 --- /dev/null +++ b/lcd_backlight.c @@ -0,0 +1,85 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "lcd_backlight.h" +#include + +static uint8_t current_hue = 0x00; +static uint8_t current_saturation = 0x00; +static uint8_t current_intensity = 0xFF; +static uint8_t current_brightness = 0x7F; + +void lcd_backlight_init(void) { + lcd_backlight_hal_init(); + lcd_backlight_color(current_hue, current_saturation, current_intensity); +} + +// This code is based on Brian Neltner's blogpost and example code +// "Why every LED light should be using HSI colorspace". +// http://blog.saikoled.com/post/43693602826/why-every-led-light-should-be-using-hsi +static void hsi_to_rgb(float h, float s, float i, uint16_t* r_out, uint16_t* g_out, uint16_t* b_out) { + unsigned int r, g, b; + h = fmodf(h, 360.0f); // cycle h around to 0-360 degrees + h = 3.14159f * h / 180.0f; // Convert to radians. + s = s > 0.0f ? (s < 1.0f ? s : 1.0f) : 0.0f; // clamp s and i to interval [0,1] + i = i > 0.0f ? (i < 1.0f ? i : 1.0f) : 0.0f; + + // Math! Thanks in part to Kyle Miller. + if(h < 2.09439f) { + r = 65535.0f * i/3.0f *(1.0f + s * cos(h) / cosf(1.047196667f - h)); + g = 65535.0f * i/3.0f *(1.0f + s *(1.0f - cosf(h) / cos(1.047196667f - h))); + b = 65535.0f * i/3.0f *(1.0f - s); + } else if(h < 4.188787) { + h = h - 2.09439; + g = 65535.0f * i/3.0f *(1.0f + s * cosf(h) / cosf(1.047196667f - h)); + b = 65535.0f * i/3.0f *(1.0f + s * (1.0f - cosf(h) / cosf(1.047196667f - h))); + r = 65535.0f * i/3.0f *(1.0f - s); + } else { + h = h - 4.188787; + b = 65535.0f*i/3.0f * (1.0f + s * cosf(h) / cosf(1.047196667f - h)); + r = 65535.0f*i/3.0f * (1.0f + s * (1.0f - cosf(h) / cosf(1.047196667f - h))); + g = 65535.0f*i/3.0f * (1.0f - s); + } + *r_out = r > 65535 ? 65535 : r; + *g_out = g > 65535 ? 65535 : g; + *b_out = b > 65535 ? 65535 : b; +} + +void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity) { + uint16_t r, g, b; + float hue_f = 360.0f * (float)hue / 255.0f; + float saturation_f = (float)saturation / 255.0f; + float intensity_f = (float)intensity / 255.0f; + intensity_f *= (float)current_brightness / 255.0f; + hsi_to_rgb(hue_f, saturation_f, intensity_f, &r, &g, &b); + current_hue = hue; + current_saturation = saturation; + current_intensity = intensity; + lcd_backlight_hal_color(r, g, b); +} + +void lcd_backlight_brightness(uint8_t b) { + current_brightness = b; + lcd_backlight_color(current_hue, current_saturation, current_intensity); +} diff --git a/lcd_backlight.h b/lcd_backlight.h new file mode 100644 index 000000000..dd3e37a06 --- /dev/null +++ b/lcd_backlight.h @@ -0,0 +1,42 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef LCD_BACKLIGHT_H_ +#define LCD_BACKLIGHT_H_ +#include "stdint.h" + +// Helper macros for storing hue, staturation and intensity as unsigned integers +#define LCD_COLOR(hue, saturation, intensity) (hue << 16 | saturation << 8 | intensity) +#define LCD_HUE(color) ((color >> 16) & 0xFF) +#define LCD_SAT(color) ((color >> 8) & 0xFF) +#define LCD_INT(color) (color & 0xFF) + +void lcd_backlight_init(void); +void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity); +void lcd_backlight_brightness(uint8_t b); + +void lcd_backlight_hal_init(void); +void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b); + +#endif /* LCD_BACKLIGHT_H_ */ diff --git a/visualizer.mk b/visualizer.mk index c5ae0dfa9..8ffc1e4ac 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -21,6 +21,13 @@ # SOFTWARE. GFXLIB = $(VISUALIZER_DIR)/ugfx +ifdef LCD_ENABLE include $(GFXLIB)/gfx.mk +endif SRC += $(GFXSRC) -INC += $(GFXINC) +INC += $(GFXINC) $(VISUALIZER_DIR) + +ifdef LCD_BACKLIGHT_ENABLE +SRC += $(VISUALIZER_DIR)/lcd_backlight.c +SRC += lcd_backlight_hal.c +endif -- cgit v1.2.3-24-g4f1b From 9e58d022ba4320ce0917defe4b81c1c7b5de77bb Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Feb 2016 19:38:23 +0200 Subject: Add visualizer A generic visualizer that supports animations. There's a few predefined keyframe types included, and more can be added by the user. --- visualizer.c | 349 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ visualizer.h | 120 ++++++++++++++++++++ visualizer.mk | 4 +- 3 files changed, 472 insertions(+), 1 deletion(-) create mode 100644 visualizer.c create mode 100644 visualizer.h diff --git a/visualizer.c b/visualizer.c new file mode 100644 index 000000000..2a92524e2 --- /dev/null +++ b/visualizer.c @@ -0,0 +1,349 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "visualizer.h" +#include "ch.h" +#include + +#ifdef LCD_ENABLE +#include "gfx.h" +#endif + +#ifdef LCD_BACKLIGHT_ENABLE +#include "lcd_backlight.h" +#endif + +//#define DEBUG_VISUALIZER + +#ifdef DEBUG_VISUALIZER +#include "debug.h" +#else +#include "nodebug.h" +#endif + + +static visualizer_keyboard_status_t current_status = { + .layer = 0xFFFFFFFF, + .default_layer = 0xFFFFFFFF, + .leds = 0xFFFFFFFF, +}; + +static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboard_status_t* status2) { + return memcmp(status1, status2, sizeof(visualizer_keyboard_status_t)) == 0; +} + +static event_source_t layer_changed_event; +static bool visualizer_enabled = false; + +#define MAX_SIMULTANEOUS_ANIMATIONS 4 +static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {}; + +void start_keyframe_animation(keyframe_animation_t* animation) { + animation->current_frame = -1; + animation->time_left_in_frame = 0; + animation->need_update = true; + int free_index = -1; + for (int i=0;icurrent_frame = animation->num_frames; + animation->time_left_in_frame = 0; + animation->need_update = true; + for (int i=0;icurrent_frame, + animation->time_left_in_frame, delta); + if (animation->current_frame == animation->num_frames) { + animation->need_update = false; + return false; + } + if (animation->current_frame == -1) { + animation->current_frame = 0; + animation->time_left_in_frame = animation->frame_lengths[0]; + animation->need_update = true; + } else { + animation->time_left_in_frame -= delta; + while (animation->time_left_in_frame <= 0) { + int left = animation->time_left_in_frame; + if (animation->need_update) { + animation->time_left_in_frame = 0; + (*animation->frame_functions[animation->current_frame])(animation, state); + } + animation->current_frame++; + animation->need_update = true; + if (animation->current_frame == animation->num_frames) { + if (animation->loop) { + animation->current_frame = 0; + } + else { + stop_keyframe_animation(animation); + return false; + } + } + delta = -left; + animation->time_left_in_frame = animation->frame_lengths[animation->current_frame]; + animation->time_left_in_frame -= delta; + } + } + if (animation->need_update) { + animation->need_update = (*animation->frame_functions[animation->current_frame])(animation, state); + } + + int wanted_sleep = animation->need_update ? 10 : animation->time_left_in_frame; + if ((unsigned)wanted_sleep < *sleep_time) { + *sleep_time = wanted_sleep; + } + + return true; +} + +bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + (void)state; + return false; +} + +#ifdef LCD_BACKLIGHT_ENABLE +bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state) { + int frame_length = animation->frame_lengths[1]; + int current_pos = frame_length - animation->time_left_in_frame; + uint8_t t_h = LCD_HUE(state->target_lcd_color); + uint8_t t_s = LCD_SAT(state->target_lcd_color); + uint8_t t_i = LCD_INT(state->target_lcd_color); + uint8_t p_h = LCD_HUE(state->prev_lcd_color); + uint8_t p_s = LCD_SAT(state->prev_lcd_color); + uint8_t p_i = LCD_INT(state->prev_lcd_color); + + uint8_t d_h1 = t_h - p_h; //Modulo arithmetic since we want to wrap around + int d_h2 = t_h - p_h; + // Chose the shortest way around + int d_h = abs(d_h2) < d_h1 ? d_h2 : d_h1; + int d_s = t_s - p_s; + int d_i = t_i - p_i; + + int hue = (d_h * current_pos) / frame_length; + int sat = (d_s * current_pos) / frame_length; + int intensity = (d_i * current_pos) / frame_length; + //dprintf("%X -> %X = %X\n", p_h, t_h, hue); + hue += p_h; + sat += p_s; + intensity += p_i; + state->current_lcd_color = LCD_COLOR(hue, sat, intensity); + lcd_backlight_color( + LCD_HUE(state->current_lcd_color), + LCD_SAT(state->current_lcd_color), + LCD_INT(state->current_lcd_color)); + + return true; +} + +bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + state->prev_lcd_color = state->target_lcd_color; + state->current_lcd_color = state->target_lcd_color; + lcd_backlight_color( + LCD_HUE(state->current_lcd_color), + LCD_SAT(state->current_lcd_color), + LCD_INT(state->current_lcd_color)); + return false; +} +#endif // LCD_BACKLIGHT_ENABLE + +#ifdef LCD_ENABLE +bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + gdispClear(White); + gdispDrawString(0, 10, state->layer_text, state->font_dejavusansbold12, Black); + gdispFlush(); + return false; +} + +static void format_layer_bitmap_string(uint16_t default_layer, uint16_t layer, char* buffer) { + for (int i=0; i<16;i++) + { + uint32_t mask = (1u << i); + if (default_layer & mask) { + if (layer & mask) { + *buffer = 'B'; + } else { + *buffer = 'D'; + } + } else if (layer & mask) { + *buffer = '1'; + } else { + *buffer = '0'; + } + ++buffer; + + if (i==3 || i==7 || i==11) { + *buffer = ' '; + ++buffer; + } + } + *buffer = 0; +} + +bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + const char* layer_help = "1=On D=Default B=Both"; + char layer_buffer[16 + 4]; // 3 spaces and one null terminator + gdispClear(White); + gdispDrawString(0, 0, layer_help, state->font_fixed5x8, Black); + format_layer_bitmap_string(state->status.default_layer, state->status.layer, layer_buffer); + gdispDrawString(0, 10, layer_buffer, state->font_fixed5x8, Black); + format_layer_bitmap_string(state->status.default_layer >> 16, state->status.layer >> 16, layer_buffer); + gdispDrawString(0, 20, layer_buffer, state->font_fixed5x8, Black); + gdispFlush(); + return false; +} +#endif // LCD_ENABLE + +bool user_visualizer_inited(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + (void)state; + dprint("User visualizer inited\n"); + visualizer_enabled = true; + return false; +} + +// TODO: Optimize the stack size, this is probably way too big +static THD_WORKING_AREA(visualizerThreadStack, 1024); +static THD_FUNCTION(visualizerThread, arg) { + (void)arg; + + event_listener_t event_listener; + chEvtRegister(&layer_changed_event, &event_listener, 0); + + visualizer_state_t state = { + .status = { + .default_layer = 0xFFFFFFFF, + .layer = 0xFFFFFFFF, + .leds = 0xFFFFFFFF, + }, + + .current_lcd_color = 0, +#ifdef LCD_ENABLE + .font_fixed5x8 = gdispOpenFont("fixed_5x8"), + .font_dejavusansbold12 = gdispOpenFont("DejaVuSansBold12") +#endif + }; + initialize_user_visualizer(&state); + state.prev_lcd_color = state.current_lcd_color; + +#ifdef LCD_BACKLIGHT_ENABLE + lcd_backlight_color( + LCD_HUE(state.current_lcd_color), + LCD_SAT(state.current_lcd_color), + LCD_INT(state.current_lcd_color)); +#endif + + systime_t sleep_time = TIME_INFINITE; + systime_t current_time = chVTGetSystemTimeX(); + + while(true) { + systime_t new_time = chVTGetSystemTimeX(); + systime_t delta = new_time - current_time; + current_time = new_time; + bool enabled = visualizer_enabled; + if (!same_status(&state.status, ¤t_status)) { + if (visualizer_enabled) { + state.status = current_status; + update_user_visualizer_state(&state); + state.prev_lcd_color = state.current_lcd_color; + } + } + sleep_time = TIME_INFINITE; + for (int i=0;i update_delta) { + sleep_time -= update_delta; + } + else { + sleep_time = 0; + } + } + dprintf("Update took %d, last delta %d, sleep_time %d\n", update_delta, delta, sleep_time); + chEvtWaitOneTimeout(EVENT_MASK(0), sleep_time); + } +#ifdef LCD_ENABLE + gdispCloseFont(state.font_fixed5x8); + gdispCloseFont(state.font_dejavusansbold12); +#endif +} + +void visualizer_init(void) { + // We are using a low priority thread, the idea is to have it run only + // when the main thread is sleeping during the matrix scanning + chEvtObjectInit(&layer_changed_event); + (void)chThdCreateStatic(visualizerThreadStack, sizeof(visualizerThreadStack), + LOWPRIO, visualizerThread, NULL); +} + +void visualizer_set_state(uint32_t default_state, uint32_t state, uint32_t leds) { + // Note that there's a small race condition here, the thread could read + // a state where one of these are set but not the other. But this should + // not really matter as it will be fixed during the next loop step. + // Alternatively a mutex could be used instead of the volatile variables + bool changed = false; + visualizer_keyboard_status_t new_status = { + .layer = state, + .default_layer = default_state, + .leds = leds, + }; + if (!same_status(¤t_status, &new_status)) { + changed = true; + } + current_status = new_status; + if (changed) { + chEvtBroadcast(&layer_changed_event); + } +} diff --git a/visualizer.h b/visualizer.h new file mode 100644 index 000000000..b7b0a3a7d --- /dev/null +++ b/visualizer.h @@ -0,0 +1,120 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef VISUALIZER_H +#define VISUALIZER_H +#include +#include +#include + +#ifdef LCD_ENABLE +#include "gfx.h" +#endif + +#ifdef LCD_BACKLIGHT_ENABLE +#include "lcd_backlight.h" +#endif + +// This need to be called once at the start +void visualizer_init(void); +// This should be called before every matrix scan +void visualizer_set_state(uint32_t default_state, uint32_t state, uint32_t leds); + +// If you need support for more than 8 keyframes per animation, you can change this +#define MAX_VISUALIZER_KEY_FRAMES 8 + +struct keyframe_animation_t; + +typedef struct { + uint32_t layer; + uint32_t default_layer; + uint32_t leds; // See led.h for available statuses +} visualizer_keyboard_status_t; + +// The state struct is used by the various keyframe functions +// It's also used for setting the LCD color and layer text +// from the user customized code +typedef struct visualizer_state_t { + // The user code should primarily be modifying these + uint32_t target_lcd_color; + const char* layer_text; + + // The user visualizer(and animation functions) can read these + visualizer_keyboard_status_t status; + + // These are used by the animation functions + uint32_t current_lcd_color; + uint32_t prev_lcd_color; +#ifdef LCD_ENABLE + font_t font_fixed5x8; + font_t font_dejavusansbold12; +#endif +} visualizer_state_t; + +// Any custom keyframe function should have this signature +// return true to get continuous updates, otherwise you will only get one +// update per frame +typedef bool (*frame_func)(struct keyframe_animation_t*, visualizer_state_t*); + +// Represents a keyframe animation, so fields are internal to the system +// while others are meant to be initialized by the user code +typedef struct keyframe_animation_t { + // These should be initialized + int num_frames; + bool loop; + int frame_lengths[MAX_VISUALIZER_KEY_FRAMES]; + frame_func frame_functions[MAX_VISUALIZER_KEY_FRAMES]; + + // Used internally by the system, and can also be read by + // keyframe update functions + int current_frame; + int time_left_in_frame; + bool need_update; + +} keyframe_animation_t; + +void start_keyframe_animation(keyframe_animation_t* animation); +void stop_keyframe_animation(keyframe_animation_t* animation); + +// Some predefined keyframe functions that can be used by the user code +// Does nothing, useful for adding delays +bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state); +// Animates the LCD backlight color between the current color and the target color (of the state) +bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state); +// Sets the backlight color to the target color +bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state); +// Displays the layer text centered vertically on the screen +bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state); +// Displays a bitmap (0/1) of all the currently active layers +bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); +// Call this once, when the initial animation has finished, alternatively you can call it +// directly from the initalize_user_visualizer function (the animation can be null) +bool user_visualizer_inited(keyframe_animation_t* animation, visualizer_state_t* state); + +// These two functions have to be implemented by the user +void initialize_user_visualizer(visualizer_state_t* state); +void update_user_visualizer_state(visualizer_state_t* state); + + +#endif /* VISUALIZER_H */ diff --git a/visualizer.mk b/visualizer.mk index 8ffc1e4ac..ff4b61f08 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -23,11 +23,13 @@ GFXLIB = $(VISUALIZER_DIR)/ugfx ifdef LCD_ENABLE include $(GFXLIB)/gfx.mk +OPT_DEFS += -DLCD_ENABLE endif -SRC += $(GFXSRC) +SRC += $(GFXSRC) $(VISUALIZER_DIR)/visualizer.c INC += $(GFXINC) $(VISUALIZER_DIR) ifdef LCD_BACKLIGHT_ENABLE SRC += $(VISUALIZER_DIR)/lcd_backlight.c SRC += lcd_backlight_hal.c +OPT_DEFS += -DLCD_BACKLIGHT_ENABLE endif -- cgit v1.2.3-24-g4f1b From 209167d4d6a7e65a728fab5d996904cc5fb33a3c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Feb 2016 19:52:57 +0200 Subject: Compile the user visualizer --- visualizer.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/visualizer.mk b/visualizer.mk index ff4b61f08..e6e0d63d0 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -33,3 +33,8 @@ SRC += $(VISUALIZER_DIR)/lcd_backlight.c SRC += lcd_backlight_hal.c OPT_DEFS += -DLCD_BACKLIGHT_ENABLE endif + +ifndef VISUALIZER_USER +VISUALIZER_USER = visualizer_user.c +endif +SRC += $(VISUALIZER_USER) \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 8ce60649c85f1ad5371d443675f91c8fc36c3d2e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Feb 2016 20:29:49 +0200 Subject: Initialize backlight and LCD during visualizer_init --- visualizer.c | 7 +++++++ visualizer.mk | 1 + 2 files changed, 8 insertions(+) diff --git a/visualizer.c b/visualizer.c index 2a92524e2..402bbd151 100644 --- a/visualizer.c +++ b/visualizer.c @@ -321,6 +321,13 @@ static THD_FUNCTION(visualizerThread, arg) { } void visualizer_init(void) { +#ifdef LCD_ENABLE + gfxInit(); +#endif + +#ifdef LCD_BACKLIGHT_ENABLE + lcd_backlight_init(); +#endif // We are using a low priority thread, the idea is to have it run only // when the main thread is sleeping during the matrix scanning chEvtObjectInit(&layer_changed_event); diff --git a/visualizer.mk b/visualizer.mk index e6e0d63d0..eef2d5cc8 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -24,6 +24,7 @@ GFXLIB = $(VISUALIZER_DIR)/ugfx ifdef LCD_ENABLE include $(GFXLIB)/gfx.mk OPT_DEFS += -DLCD_ENABLE +OPT_LIBS += -lm endif SRC += $(GFXSRC) $(VISUALIZER_DIR)/visualizer.c INC += $(GFXINC) $(VISUALIZER_DIR) -- cgit v1.2.3-24-g4f1b From 8479e6aa390bdd7711753d9fa1141bd1073e2b0a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Feb 2016 22:08:49 +0200 Subject: Update readme and license Also add integration examples --- LICENSE.md | 8 + example_integration/callbacks.c | 50 +++++ example_integration/gfxconf.h | 325 ++++++++++++++++++++++++++++++++ example_integration/lcd_backlight_hal.c | 90 +++++++++ example_integration/visualizer_user.c | 135 +++++++++++++ readme.md | 19 +- 6 files changed, 626 insertions(+), 1 deletion(-) create mode 100644 example_integration/callbacks.c create mode 100644 example_integration/gfxconf.h create mode 100644 example_integration/lcd_backlight_hal.c create mode 100644 example_integration/visualizer_user.c diff --git a/LICENSE.md b/LICENSE.md index d7cc3198c..22d4c3f08 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,11 @@ +The files in this project are licensed under the MIT license +It uses the following libraries +uGFX - with it's own license, see the license.html file in the uGFX subfolder for more information +tmk_core - is indirectly used and not included in the repository. It's licensed under the GPLv2 license +Chibios - which is used by tmk_core is licensed under GPLv3. + +Therefore the effective license for any project using the library is GPLv3 + The MIT License (MIT) Copyright (c) 2016 Fred Sundvik diff --git a/example_integration/callbacks.c b/example_integration/callbacks.c new file mode 100644 index 000000000..21b2d9f74 --- /dev/null +++ b/example_integration/callbacks.c @@ -0,0 +1,50 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +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 . +*/ + +#include "keyboard.h" +#include "action_layer.h" +#include "visualizer.h" +#include "host.h" + +void post_keyboard_init(void) { + visualizer_init(); +} + +void post_keyboard_task() { + visualizer_set_state(default_layer_state, layer_state, host_keyboard_leds()); +} diff --git a/example_integration/gfxconf.h b/example_integration/gfxconf.h new file mode 100644 index 000000000..304c5d187 --- /dev/null +++ b/example_integration/gfxconf.h @@ -0,0 +1,325 @@ +/** + * This file has a different license to the rest of the uGFX system. + * You can copy, modify and distribute this file as you see fit. + * You do not need to publish your source modifications to this file. + * The only thing you are not permitted to do is to relicense it + * under a different license. + */ + +/** + * Copy this file into your project directory and rename it as gfxconf.h + * Edit your copy to turn on the uGFX features you want to use. + * The values below are the defaults. + * + * Only remove the comments from lines where you want to change the + * default value. This allows definitions to be included from + * driver makefiles when required and provides the best future + * compatibility for your project. + * + * Please use spaces instead of tabs in this file. + */ + +#ifndef _GFXCONF_H +#define _GFXCONF_H + + +/////////////////////////////////////////////////////////////////////////// +// GOS - One of these must be defined, preferably in your Makefile // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_OS_CHIBIOS TRUE +//#define GFX_USE_OS_FREERTOS FALSE +// #define GFX_FREERTOS_USE_TRACE FALSE +//#define GFX_USE_OS_WIN32 FALSE +//#define GFX_USE_OS_LINUX FALSE +//#define GFX_USE_OS_OSX FALSE +//#define GFX_USE_OS_ECOS FALSE +//#define GFX_USE_OS_RAWRTOS FALSE +//#define GFX_USE_OS_ARDUINO FALSE +//#define GFX_USE_OS_KEIL FALSE +//#define GFX_USE_OS_CMSIS FALSE +//#define GFX_USE_OS_RAW32 FALSE +// #define INTERRUPTS_OFF() optional_code +// #define INTERRUPTS_ON() optional_code +// These are not defined by default for some reason +#define GOS_NEED_X_THREADS FALSE +#define GOS_NEED_X_HEAP FALSE + +// Options that (should where relevant) apply to all operating systems + #define GFX_NO_INLINE FALSE +// #define GFX_COMPILER GFX_COMPILER_UNKNOWN +// #define GFX_CPU GFX_CPU_UNKNOWN +// #define GFX_OS_HEAP_SIZE 0 +// #define GFX_OS_NO_INIT FALSE +// #define GFX_OS_INIT_NO_WARNING FALSE +// #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine +// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine +// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine + + +/////////////////////////////////////////////////////////////////////////// +// GDISP // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GDISP TRUE + +//#define GDISP_NEED_AUTOFLUSH FALSE +//#define GDISP_NEED_TIMERFLUSH FALSE +//#define GDISP_NEED_VALIDATION TRUE +//#define GDISP_NEED_CLIP TRUE +//#define GDISP_NEED_CIRCLE FALSE +//#define GDISP_NEED_ELLIPSE FALSE +//#define GDISP_NEED_ARC FALSE +//#define GDISP_NEED_ARCSECTORS FALSE +//#define GDISP_NEED_CONVEX_POLYGON FALSE +//#define GDISP_NEED_SCROLL FALSE +//#define GDISP_NEED_PIXELREAD FALSE +//#define GDISP_NEED_CONTROL FALSE +//#define GDISP_NEED_QUERY FALSE +//#define GDISP_NEED_MULTITHREAD FALSE +//#define GDISP_NEED_STREAMING FALSE +#define GDISP_NEED_TEXT TRUE +// #define GDISP_NEED_TEXT_WORDWRAP FALSE +// #define GDISP_NEED_ANTIALIAS FALSE +// #define GDISP_NEED_UTF8 FALSE + #define GDISP_NEED_TEXT_KERNING TRUE +// #define GDISP_INCLUDE_FONT_UI1 FALSE +// #define GDISP_INCLUDE_FONT_UI2 FALSE // The smallest preferred font. +// #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS20 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE + #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 TRUE +// #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE +// #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE + #define GDISP_INCLUDE_FONT_FIXED_5X8 TRUE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS20_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE +// #define GDISP_INCLUDE_USER_FONTS FALSE + +//#define GDISP_NEED_IMAGE FALSE +// #define GDISP_NEED_IMAGE_NATIVE FALSE +// #define GDISP_NEED_IMAGE_GIF FALSE +// #define GDISP_NEED_IMAGE_BMP FALSE +// #define GDISP_NEED_IMAGE_BMP_1 FALSE +// #define GDISP_NEED_IMAGE_BMP_4 FALSE +// #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE +// #define GDISP_NEED_IMAGE_BMP_8 FALSE +// #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE +// #define GDISP_NEED_IMAGE_BMP_16 FALSE +// #define GDISP_NEED_IMAGE_BMP_24 FALSE +// #define GDISP_NEED_IMAGE_BMP_32 FALSE +// #define GDISP_NEED_IMAGE_JPG FALSE +// #define GDISP_NEED_IMAGE_PNG FALSE +// #define GDISP_NEED_IMAGE_ACCOUNTING FALSE + +//#define GDISP_NEED_PIXMAP FALSE +// #define GDISP_NEED_PIXMAP_IMAGE FALSE + +//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used. +//#define GDISP_LINEBUF_SIZE 128 +//#define GDISP_STARTUP_COLOR Black +#define GDISP_NEED_STARTUP_LOGO FALSE + +//#define GDISP_TOTAL_DISPLAYS 1 + +//#define GDISP_DRIVER_LIST GDISPVMT_Win32, GDISPVMT_Win32 +// #ifdef GDISP_DRIVER_LIST +// // For code and speed optimization define as TRUE or FALSE if all controllers have the same capability +// #define GDISP_HARDWARE_STREAM_WRITE FALSE +// #define GDISP_HARDWARE_STREAM_READ FALSE +// #define GDISP_HARDWARE_STREAM_POS FALSE +// #define GDISP_HARDWARE_DRAWPIXEL FALSE +// #define GDISP_HARDWARE_CLEARS FALSE +// #define GDISP_HARDWARE_FILLS FALSE +// #define GDISP_HARDWARE_BITFILLS FALSE +// #define GDISP_HARDWARE_SCROLL FALSE +// #define GDISP_HARDWARE_PIXELREAD FALSE +// #define GDISP_HARDWARE_CONTROL FALSE +// #define GDISP_HARDWARE_QUERY FALSE +// #define GDISP_HARDWARE_CLIP FALSE + + #define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 +// #endif + +// The custom format is not defined for some reason, so define it as error +// so we don't get compiler warnings +#define GDISP_PIXELFORMAT_CUSTOM GDISP_PIXELFORMAT_ERROR + +#define GDISP_USE_GFXNET FALSE +// #define GDISP_GFXNET_PORT 13001 +// #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE +// #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE +// #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GWIN // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GWIN FALSE + +//#define GWIN_NEED_WINDOWMANAGER FALSE +// #define GWIN_REDRAW_IMMEDIATE FALSE +// #define GWIN_REDRAW_SINGLEOP FALSE +// #define GWIN_NEED_FLASHING FALSE +// #define GWIN_FLASHING_PERIOD 250 + +//#define GWIN_NEED_CONSOLE FALSE +// #define GWIN_CONSOLE_USE_HISTORY FALSE +// #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE +// #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE +// #define GWIN_CONSOLE_ESCSEQ FALSE +// #define GWIN_CONSOLE_USE_BASESTREAM FALSE +// #define GWIN_CONSOLE_USE_FLOAT FALSE +//#define GWIN_NEED_GRAPH FALSE +//#define GWIN_NEED_GL3D FALSE + +//#define GWIN_NEED_WIDGET FALSE +//#define GWIN_FOCUS_HIGHLIGHT_WIDTH 1 +// #define GWIN_NEED_LABEL FALSE +// #define GWIN_LABEL_ATTRIBUTE FALSE +// #define GWIN_NEED_BUTTON FALSE +// #define GWIN_BUTTON_LAZY_RELEASE FALSE +// #define GWIN_NEED_SLIDER FALSE +// #define GWIN_SLIDER_NOSNAP FALSE +// #define GWIN_SLIDER_DEAD_BAND 5 +// #define GWIN_SLIDER_TOGGLE_INC 20 +// #define GWIN_NEED_CHECKBOX FALSE +// #define GWIN_NEED_IMAGE FALSE +// #define GWIN_NEED_IMAGE_ANIMATION FALSE +// #define GWIN_NEED_RADIO FALSE +// #define GWIN_NEED_LIST FALSE +// #define GWIN_NEED_LIST_IMAGES FALSE +// #define GWIN_NEED_PROGRESSBAR FALSE +// #define GWIN_PROGRESSBAR_AUTO FALSE +// #define GWIN_NEED_KEYBOARD FALSE +// #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_English1 +// #define GWIN_NEED_KEYBOARD_ENGLISH1 TRUE +// #define GWIN_NEED_TEXTEDIT FALSE +// #define GWIN_FLAT_STYLING FALSE +// #define GWIN_WIDGET_TAGS FALSE + +//#define GWIN_NEED_CONTAINERS FALSE +// #define GWIN_NEED_CONTAINER FALSE +// #define GWIN_NEED_FRAME FALSE +// #define GWIN_NEED_TABSET FALSE +// #define GWIN_TABSET_TABHEIGHT 18 + + +/////////////////////////////////////////////////////////////////////////// +// GEVENT // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GEVENT FALSE + +//#define GEVENT_ASSERT_NO_RESOURCE FALSE +//#define GEVENT_MAXIMUM_SIZE 32 +//#define GEVENT_MAX_SOURCE_LISTENERS 32 + + +/////////////////////////////////////////////////////////////////////////// +// GTIMER // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GTIMER FALSE + +//#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY +//#define GTIMER_THREAD_WORKAREA_SIZE 2048 + + +/////////////////////////////////////////////////////////////////////////// +// GQUEUE // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GQUEUE FALSE + +//#define GQUEUE_NEED_ASYNC FALSE +//#define GQUEUE_NEED_GSYNC FALSE +//#define GQUEUE_NEED_FSYNC FALSE +//#define GQUEUE_NEED_BUFFERS FALSE + +/////////////////////////////////////////////////////////////////////////// +// GINPUT // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GINPUT FALSE + +//#define GINPUT_NEED_MOUSE FALSE +// #define GINPUT_TOUCH_STARTRAW FALSE +// #define GINPUT_TOUCH_NOTOUCH FALSE +// #define GINPUT_TOUCH_NOCALIBRATE FALSE +// #define GINPUT_TOUCH_NOCALIBRATE_GUI FALSE +// #define GINPUT_MOUSE_POLL_PERIOD 25 +// #define GINPUT_MOUSE_CLICK_TIME 300 +// #define GINPUT_TOUCH_CXTCLICK_TIME 700 +// #define GINPUT_TOUCH_USER_CALIBRATION_LOAD FALSE +// #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE +// #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32 +//#define GINPUT_NEED_KEYBOARD FALSE +// #define GINPUT_KEYBOARD_POLL_PERIOD 200 +// #define GKEYBOARD_DRIVER_LIST GKEYBOARDVMT_Win32, GKEYBOARDVMT_Win32 +// #define GKEYBOARD_LAYOUT_OFF FALSE +// #define GKEYBOARD_LAYOUT_SCANCODE2_US FALSE +//#define GINPUT_NEED_TOGGLE FALSE +//#define GINPUT_NEED_DIAL FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GFILE // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GFILE FALSE + +//#define GFILE_NEED_PRINTG FALSE +//#define GFILE_NEED_SCANG FALSE +//#define GFILE_NEED_STRINGS FALSE +//#define GFILE_NEED_FILELISTS FALSE +//#define GFILE_NEED_STDIO FALSE +//#define GFILE_NEED_NOAUTOMOUNT FALSE +//#define GFILE_NEED_NOAUTOSYNC FALSE + +//#define GFILE_NEED_MEMFS FALSE +//#define GFILE_NEED_ROMFS FALSE +//#define GFILE_NEED_RAMFS FALSE +//#define GFILE_NEED_FATFS FALSE +//#define GFILE_NEED_NATIVEFS FALSE +//#define GFILE_NEED_CHBIOSFS FALSE + +//#define GFILE_ALLOW_FLOATS FALSE +//#define GFILE_ALLOW_DEVICESPECIFIC FALSE +//#define GFILE_MAX_GFILES 3 + +/////////////////////////////////////////////////////////////////////////// +// GADC // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GADC FALSE + +//#define GADC_MAX_LOWSPEED_DEVICES 4 + + +/////////////////////////////////////////////////////////////////////////// +// GAUDIO // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GAUDIO FALSE +// There seems to be a bug in the ugfx code, the wrong define is used +// So define it in order to avoid warnings +#define GFX_USE_GAUDIN GFX_USE_GAUDIO +// #define GAUDIO_NEED_PLAY FALSE +// #define GAUDIO_NEED_RECORD FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GMISC // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GMISC FALSE + +//#define GMISC_NEED_ARRAYOPS FALSE +//#define GMISC_NEED_FASTTRIG FALSE +//#define GMISC_NEED_FIXEDTRIG FALSE +//#define GMISC_NEED_INVSQRT FALSE +// #define GMISC_INVSQRT_MIXED_ENDIAN FALSE +// #define GMISC_INVSQRT_REAL_SLOW FALSE +//#define GMISC_NEED_MATRIXFLOAT2D FALSE +//#define GMISC_NEED_MATRIXFIXED2D FALSE + +#endif /* _GFXCONF_H */ diff --git a/example_integration/lcd_backlight_hal.c b/example_integration/lcd_backlight_hal.c new file mode 100644 index 000000000..0f35cb675 --- /dev/null +++ b/example_integration/lcd_backlight_hal.c @@ -0,0 +1,90 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ +#include "lcd_backlight.h" +#include "hal.h" + +#define RED_PIN 1 +#define GREEN_PIN 2 +#define BLUE_PIN 3 +#define CHANNEL_RED FTM0->CHANNEL[0] +#define CHANNEL_GREEN FTM0->CHANNEL[1] +#define CHANNEL_BLUE FTM0->CHANNEL[2] + +#define RGB_PORT PORTC +#define RGB_PORT_GPIO GPIOC + +// Base FTM clock selection (72 MHz system clock) +// @ 0xFFFF period, 72 MHz / (0xFFFF * 2) = Actual period +// Higher pre-scalar will use the most power (also look the best) +// Pre-scalar calculations +// 0 - 72 MHz -> 549 Hz +// 1 - 36 MHz -> 275 Hz +// 2 - 18 MHz -> 137 Hz +// 3 - 9 MHz -> 69 Hz (Slightly visible flicker) +// 4 - 4 500 kHz -> 34 Hz (Visible flickering) +// 5 - 2 250 kHz -> 17 Hz +// 6 - 1 125 kHz -> 9 Hz +// 7 - 562 500 Hz -> 4 Hz +// 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 + +void lcd_backlight_hal_init(void) { + // Setup Backlight + SIM->SCGC6 |= SIM_SCGC6_FTM0; + FTM0->CNT = 0; // Reset counter + + // PWM Period + // 16-bit maximum + FTM0->MOD = 0xFFFF; + + // Set FTM to PWM output - Edge Aligned, Low-true pulses +#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0) + CHANNEL_RED.CnSC = CNSC_MODE; + CHANNEL_GREEN.CnSC = CNSC_MODE; + CHANNEL_BLUE.CnSC = CNSC_MODE; + + // System clock, /w prescalar setting + FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE); + + CHANNEL_RED.CnV = 0; + CHANNEL_GREEN.CnV = 0; + CHANNEL_BLUE.CnV = 0; + + RGB_PORT_GPIO->PDDR |= (1 << RED_PIN); + RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN); + RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN); + +#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4) + RGB_PORT->PCR[RED_PIN] = RGB_MODE; + RGB_PORT->PCR[GREEN_PIN] = RGB_MODE; + RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; +} + +void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { + CHANNEL_RED.CnV = r; + CHANNEL_GREEN.CnV = g; + CHANNEL_BLUE.CnV = b; +} + diff --git a/example_integration/visualizer_user.c b/example_integration/visualizer_user.c new file mode 100644 index 000000000..a50ecc60d --- /dev/null +++ b/example_integration/visualizer_user.c @@ -0,0 +1,135 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +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 . +*/ + +// Currently we are assuming that both the backlight and LCD are enabled +// But it's entirely possible to write a custom visualizer that use only +// one of them +#ifndef LCD_BACKLIGHT_ENABLE +#error This visualizer needs that LCD backlight is enabled +#endif + +#ifndef LCD_ENABLE +#error This visualizer needs that LCD is enabled +#endif + +#include "visualizer.h" + +static const char* welcome_text[] = {"TMK", "Infinity Ergodox"}; + +// Just an example how to write custom keyframe functions, we could have moved +// all this into the init function +bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + // Read the uGFX documentation for information how to use the displays + // http://wiki.ugfx.org/index.php/Main_Page + gdispClear(White); + // You can use static variables for things that can't be found in the animation + // or state structs + gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black); + gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black); + // Always remember to flush the display + gdispFlush(); + // you could set the backlight color as well, but we won't do it here, since + // it's part of the following animation + // lcd_backlight_color(hue, saturation, intensity); + // We don't need constant updates, just drawing the screen once is enough + return false; +} + +// Feel free to modify the animations below, or even add new ones if needed + +// Don't worry, if the startup animation is long, you can use the keyboard like normal +// during that time +static keyframe_animation_t startup_animation = { + .num_frames = 4, + .loop = false, + .frame_lengths = {0, MS2ST(1000), MS2ST(5000), 0}, + .frame_functions = {display_welcome, keyframe_animate_backlight_color, keyframe_no_operation, user_visualizer_inited}, +}; + +// The color animation animates the LCD color when you change layers +static keyframe_animation_t color_animation = { + .num_frames = 2, + .loop = false, + // Note that there's a 200 ms no-operation frame, + // this prevents the color from changing when activating the layer + // momentarily + .frame_lengths = {MS2ST(200), MS2ST(500)}, + .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color}, +}; + +// The LCD animation alternates between the layer name display and a +// bitmap that displays all active layers +static keyframe_animation_t lcd_animation = { + .num_frames = 2, + .loop = true, + .frame_lengths = {MS2ST(2000), MS2ST(2000)}, + .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap}, +}; + +void initialize_user_visualizer(visualizer_state_t* state) { + // The brightness will be dynamically adjustable in the future + // But for now, change it here. + lcd_backlight_brightness(0x50); + state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF); + state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); + start_keyframe_animation(&startup_animation); +} + +void update_user_visualizer_state(visualizer_state_t* state) { + // Add more tests, change the colors and layer texts here + // Usually you want to check the high bits (higher layers first) + // because that's the order layers are processed for keypresses + // You can for check for example: + // state->status.layer + // state->status.default_layer + // state->status.leds (see led.h for available statuses) + if (state->status.layer & 0x2) { + state->target_lcd_color = LCD_COLOR(0xA0, 0xB0, 0xFF); + state->layer_text = "Layer 2"; + } + else { + state->target_lcd_color = LCD_COLOR(0x50, 0xB0, 0xFF); + state->layer_text = "Layer 1"; + } + // You can also stop existing animations, and start your custom ones here + // remember that you should normally have only one animation for the LCD + // and one for the background. But you can also combine them if you want. + start_keyframe_animation(&lcd_animation); + start_keyframe_animation(&color_animation); +} diff --git a/readme.md b/readme.md index 82bf8bfdf..545ba2270 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,18 @@ -A visualization library for the TMK keyboard firmware +# A visualization library for the TMK keyboard firmware + +This library is designed to work together with the [TMK keyboard firmware](https://github.com/tmk/tmk_keyboard). Currently it only works for [Chibios](http://www.chibios.org/) + flavors, but it would be possible to add support for other configurations as well. The LCD display functionality is provided by the [uGFX library](http://www.ugfx.org/). + +## To use this library as a user +You can and should modify the visualizer\_user.c file. Check the comments in the file for more information. + +## To add this library to custom keyboard projects + +1. Add tmk_visualizer as a submodule to your project +1. Set VISUALIZER_DIR in the main keyboard project makefile to point to the submodule +1. Define LCD\_ENABLE and/or LCD\_BACKLIGHT\_ENABLE, to enable support +1. Include the visualizer.mk make file +1. Copy the files in the example\_integration folder to your keyboard project +1. All other files than the callback.c file are included automatically, so you will need to add callback.c to your makefile manually. If you already have a similar file in your project, you can just copy the functions instead of the whole file. +1. Edit the files to match your hardware. You might might want to read the Chibios and UGfx documentation, for more information. +1. If you enable LCD support you might also have to write a custom uGFX display driver, check the uGFX documentation for that. You probably also want to enable SPI support in your Chibios configuration. -- cgit v1.2.3-24-g4f1b From c5db02925c6bf73ef1df1f718e09ff304266a535 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 13 Feb 2016 22:19:49 +0200 Subject: Clean up wrong license information --- example_integration/callbacks.c | 14 -------------- example_integration/lcd_backlight_hal.c | 1 + example_integration/visualizer_user.c | 14 -------------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/example_integration/callbacks.c b/example_integration/callbacks.c index 21b2d9f74..2539615d6 100644 --- a/example_integration/callbacks.c +++ b/example_integration/callbacks.c @@ -22,20 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -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 . -*/ - #include "keyboard.h" #include "action_layer.h" #include "visualizer.h" diff --git a/example_integration/lcd_backlight_hal.c b/example_integration/lcd_backlight_hal.c index 0f35cb675..913131b16 100644 --- a/example_integration/lcd_backlight_hal.c +++ b/example_integration/lcd_backlight_hal.c @@ -21,6 +21,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + #include "lcd_backlight.h" #include "hal.h" diff --git a/example_integration/visualizer_user.c b/example_integration/visualizer_user.c index a50ecc60d..6c4619d95 100644 --- a/example_integration/visualizer_user.c +++ b/example_integration/visualizer_user.c @@ -22,20 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -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 . -*/ - // Currently we are assuming that both the backlight and LCD are enabled // But it's entirely possible to write a custom visualizer that use only // one of them -- cgit v1.2.3-24-g4f1b From ffc425603dcbedf0da1d6aa1759f8f14f3a5e841 Mon Sep 17 00:00:00 2001 From: fredizzimo Date: Sat, 13 Feb 2016 23:26:39 +0200 Subject: Initial commit --- LICENSE | 21 +++++++++++++++++++++ README.md | 1 + 2 files changed, 22 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..d66406efd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 fredizzimo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 000000000..94af9125c --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# tmk_serial_link \ No newline at end of file -- cgit v1.2.3-24-g4f1b From e70cefc12fb897f7221f7b1bc6fe0ce595eb2de1 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 00:05:58 +0200 Subject: Add cgreen unit test library and makefile --- .gitmodules | 3 +++ cgreen/Makefile | 38 ++++++++++++++++++++++++++++++++++++++ cgreen/Makefile.build | 33 +++++++++++++++++++++++++++++++++ cgreen/cgreen | 1 + serial_link.mk | 11 +++++++++++ 5 files changed, 86 insertions(+) create mode 100644 .gitmodules create mode 100644 cgreen/Makefile create mode 100644 cgreen/Makefile.build create mode 160000 cgreen/cgreen create mode 100644 serial_link.mk diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..991cfe96d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "cgreen/cgreen"] + path = cgreen/cgreen + url = http://github.com/cgreen-devs/cgreen diff --git a/cgreen/Makefile b/cgreen/Makefile new file mode 100644 index 000000000..6b31a3f92 --- /dev/null +++ b/cgreen/Makefile @@ -0,0 +1,38 @@ +# This Makefile ensures that the build is made out of source in a subdirectory called 'build' +# If it doesn't exist, it is created and a Makefile created there (from Makefile.build) +# +# This Makefile also contains delegation of the most common make commands +# +# If you have cmake installed you should be able to do: +# +# make +# make test +# make install +# make package +# +# That should build cgreen for C and C++, run some tests, install it locally and +# generate two distributable packages. + +all: build + cd $(CGREEN_BUILD_DIR); make all + +test: build + cd $(CGREEN_BUILD_DIR); make test + +clean: build + cd $(CGREEN_BUILD_DIR); make clean + +package: build + cd $(CGREEN_BUILD_DIR); make package + +install: + cd $(CGREEN_BUILD_DIR); make install + +############# Internal + +build: + mkdir -p $(CGREEN_BUILD_DIR) + cp Makefile.build $(CGREEN_BUILD_DIR)/Makefile + + +.SILENT: diff --git a/cgreen/Makefile.build b/cgreen/Makefile.build new file mode 100644 index 000000000..f76165244 --- /dev/null +++ b/cgreen/Makefile.build @@ -0,0 +1,33 @@ +# This Makefile is copied from the cgreen top directory (where it is +# named Makefile.build) and put in a subdirectory called 'build' where +# builds are made This Makefile then automatically creates +# subdirectories for C and C++ builds configuring them using the cmake +# command. Once created you can always tweak the cmake setup as with +# any cmake build directory + +all: build-c build-c++ + for d in build-* ; do cd $$d; make ; cd .. ; done + +clean: + for d in build-* ; do cd $$d; make clean ; cd .. ; done + +check test: + for d in build-* ; do cd $$d; make check ; cd .. ; done + +package: + for d in build-* ; do cd $$d; make package ; cd .. ; done + +install: + for d in build-* ; do cd $$d; make install ; cd .. ; done + +############ Internal + +build-c: + mkdir build-c + cd build-c; cmake -G "Unix Makefiles" $(CGREEN_DIR) + +build-c++: + mkdir build-c++ + cd build-c++; cmake -G "Unix Makefiles" -DWITH_CXX:bool=ON $(CGREEN_DIR) + +.SILENT: diff --git a/cgreen/cgreen b/cgreen/cgreen new file mode 160000 index 000000000..d4d438dda --- /dev/null +++ b/cgreen/cgreen @@ -0,0 +1 @@ +Subproject commit d4d438dda1b7131f0bd0530b2c258e9dea6a2a9f diff --git a/serial_link.mk b/serial_link.mk new file mode 100644 index 000000000..51d33fcb4 --- /dev/null +++ b/serial_link.mk @@ -0,0 +1,11 @@ +CGREEN_LIB = $(BUILDDIR)/cgreen/build-c/src/libcgreen.a + +.phony testserial: +testserial: $(CGREEN_LIB) + +CGREEN_DIR = "$(CURDIR)/$(SERIAL_DIR)/cgreen/cgreen" +CGREEN_BUILD_DIR = "$(CURDIR)/$(BUILDDIR)/cgreen" +export CGREEN_DIR +export CGREEN_BUILD_DIR +$(CGREEN_LIB): + make -C $(SERIAL_DIR)/cgreen \ No newline at end of file -- cgit v1.2.3-24-g4f1b From e9a1474bb6a92024c8d4e3095d6b871833db1cf4 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 00:20:14 +0200 Subject: Add makefile for compiling and running unit tests --- serial_link.mk | 1 + tests/Makefile | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 tests/Makefile diff --git a/serial_link.mk b/serial_link.mk index 51d33fcb4..8e8de807f 100644 --- a/serial_link.mk +++ b/serial_link.mk @@ -2,6 +2,7 @@ CGREEN_LIB = $(BUILDDIR)/cgreen/build-c/src/libcgreen.a .phony testserial: testserial: $(CGREEN_LIB) + make -C $(SERIAL_DIR)/tests BUILDDIR=../../$(BUILDDIR) CGREEN_DIR = "$(CURDIR)/$(SERIAL_DIR)/cgreen/cgreen" CGREEN_BUILD_DIR = "$(CURDIR)/$(BUILDDIR)/cgreen" diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 000000000..239e9f609 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,49 @@ +CC = gcc +CFLAGS = +INCLUDES = -I. +LDFLAGS = -L$(BUILDDIR)/cgreen/build-c/src +LDLIBS = -lcgreen +UNITOBJ = $(BUILDDIR)/testserial/unitobj +DEPDIR = $(BUILDDIR)/testserial/unit.d +UNITEXE = $(BUILDDIR)/testserial/unitexe +DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td +EXT = +UNAME := $(shell uname) +ifneq (, $(findstring mingw, $(UNAME))) + EXT += exe +endif +ifneq (, $(findstring cygwin, $(UNAME))) + EXT += exe +endif + +SRC = $(wildcard *.c) +EXE = $(patsubst %.c, $(UNITEXE)/%$(EXT), $(SRC)) +$(shell mkdir -p $(DEPDIR) >/dev/null) + +test: $(EXE) + @for f in $^; do \ + echo "++++++++++++++++++"; \ + echo "Running unit tests"; \ + echo $$(basename $$f); \ + echo "++++++++++++++++++"; \ + echo ""; \ + $$f || exit 1; \ + echo ""; \ + echo "******************"; \ + echo ""; \ + done + +$(UNITEXE)/%$(EXT): $(UNITOBJ)/%.o + mkdir -p $(UNITEXE) + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +$(UNITOBJ)/%.o : %.c +$(UNITOBJ)/%.o: %.c $(DEPDIR)/%.d + mkdir -p $(UNITOBJ) + $(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@ + mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d + +$(DEPDIR)/%.d: ; +.PRECIOUS: $(DEPDIR)/%.d + +-include $(patsubst %,$(DEPDIR)/%.d,$(basename $(SRC).c)) \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 3c6b93a491ab6ea280c30be26980e2ca91ba5c4c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 01:31:01 +0200 Subject: Add separate makefile for tests --- serial_link.mk | 12 ------------ serial_link_tests.mk | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 serial_link_tests.mk diff --git a/serial_link.mk b/serial_link.mk index 8e8de807f..e69de29bb 100644 --- a/serial_link.mk +++ b/serial_link.mk @@ -1,12 +0,0 @@ -CGREEN_LIB = $(BUILDDIR)/cgreen/build-c/src/libcgreen.a - -.phony testserial: -testserial: $(CGREEN_LIB) - make -C $(SERIAL_DIR)/tests BUILDDIR=../../$(BUILDDIR) - -CGREEN_DIR = "$(CURDIR)/$(SERIAL_DIR)/cgreen/cgreen" -CGREEN_BUILD_DIR = "$(CURDIR)/$(BUILDDIR)/cgreen" -export CGREEN_DIR -export CGREEN_BUILD_DIR -$(CGREEN_LIB): - make -C $(SERIAL_DIR)/cgreen \ No newline at end of file diff --git a/serial_link_tests.mk b/serial_link_tests.mk new file mode 100644 index 000000000..36d7c09b3 --- /dev/null +++ b/serial_link_tests.mk @@ -0,0 +1,13 @@ +CGREEN_LIB = $(BUILDDIR)/cgreen/build-c/src/libcgreen.a + +CGREEN_DIR = "$(CURDIR)/$(SERIAL_DIR)/cgreen/cgreen" +CGREEN_BUILD_DIR = "$(CURDIR)/$(BUILDDIR)/cgreen" +export CGREEN_DIR +export CGREEN_BUILD_DIR +$(CGREEN_LIB): + make -C $(SERIAL_DIR)/cgreen + +.PHONY serialtest: +serialtest : $(CGREEN_LIB) + @echo $(CGREEN_LIB) + make -C $(SERIAL_DIR)/tests BUILDDIR=../../$(BUILDDIR) \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 3eaddd65141f880ddc7d23fc05cafb01ca5477ac Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 01:58:26 +0200 Subject: Use cgreen test runner instead of executables --- tests/Makefile | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 239e9f609..3f89cba47 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,40 +1,30 @@ CC = gcc CFLAGS = INCLUDES = -I. -LDFLAGS = -L$(BUILDDIR)/cgreen/build-c/src +LDFLAGS = -L$(BUILDDIR)/cgreen/build-c/src -shared LDLIBS = -lcgreen -UNITOBJ = $(BUILDDIR)/testserial/unitobj -DEPDIR = $(BUILDDIR)/testserial/unit.d -UNITEXE = $(BUILDDIR)/testserial/unitexe +UNITOBJ = $(BUILDDIR)/serialtest/unitobj +DEPDIR = $(BUILDDIR)/serialtest/unit.d +UNITTESTS = $(BUILDDIR)/serialtest/unittests DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td -EXT = +EXT = .so UNAME := $(shell uname) -ifneq (, $(findstring mingw, $(UNAME))) - EXT += exe +ifneq (, $(findstring MINGW, $(UNAME))) + EXT = .dll endif -ifneq (, $(findstring cygwin, $(UNAME))) - EXT += exe +ifneq (, $(findstring CYGWIN, $(UNAME))) + EXT = .dll endif SRC = $(wildcard *.c) -EXE = $(patsubst %.c, $(UNITEXE)/%$(EXT), $(SRC)) +TESTFILES = $(patsubst %.c, $(UNITTESTS)/%$(EXT), $(SRC)) $(shell mkdir -p $(DEPDIR) >/dev/null) -test: $(EXE) - @for f in $^; do \ - echo "++++++++++++++++++"; \ - echo "Running unit tests"; \ - echo $$(basename $$f); \ - echo "++++++++++++++++++"; \ - echo ""; \ - $$f || exit 1; \ - echo ""; \ - echo "******************"; \ - echo ""; \ - done +test: $(TESTFILES) + @$(BUILDDIR)/cgreen/build-c/tools/cgreen-runner --color $(TESTFILES) -$(UNITEXE)/%$(EXT): $(UNITOBJ)/%.o - mkdir -p $(UNITEXE) +$(UNITTESTS)/%$(EXT): $(UNITOBJ)/%.o + mkdir -p $(UNITTESTS) $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) $(UNITOBJ)/%.o : %.c -- cgit v1.2.3-24-g4f1b From 1f1bc183dd1080e14a2d85010d5c7f6455f023f6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 12:45:12 +0200 Subject: Start implementing data_link --- LICENSE | 2 +- serial_link.mk | 23 ++++++++++++++ serial_link/protocol/data_link.c | 29 ++++++++++++++++++ serial_link/protocol/data_link.h | 25 +++++++++++++++ serial_link/protocol/routing.h | 25 +++++++++++++++ serial_link/tests/Makefile | 61 +++++++++++++++++++++++++++++++++++++ serial_link/tests/data_link_tests.c | 52 +++++++++++++++++++++++++++++++ serial_link_tests.mk | 27 ++++++++++++++-- tests/Makefile | 39 ------------------------ 9 files changed, 240 insertions(+), 43 deletions(-) create mode 100644 serial_link/protocol/data_link.c create mode 100644 serial_link/protocol/data_link.h create mode 100644 serial_link/protocol/routing.h create mode 100644 serial_link/tests/Makefile create mode 100644 serial_link/tests/data_link_tests.c delete mode 100644 tests/Makefile diff --git a/LICENSE b/LICENSE index d66406efd..d7cc3198c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 fredizzimo +Copyright (c) 2016 Fred Sundvik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/serial_link.mk b/serial_link.mk index e69de29bb..de2364108 100644 --- a/serial_link.mk +++ b/serial_link.mk @@ -0,0 +1,23 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Fred Sundvik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +INC += $(SERIAL_DIR) \ No newline at end of file diff --git a/serial_link/protocol/data_link.c b/serial_link/protocol/data_link.c new file mode 100644 index 000000000..71d538470 --- /dev/null +++ b/serial_link/protocol/data_link.c @@ -0,0 +1,29 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "protocol/data_link.h" +#include "protocol/routing.h" + +void recv_byte(uint8_t data) { +} diff --git a/serial_link/protocol/data_link.h b/serial_link/protocol/data_link.h new file mode 100644 index 000000000..3b9f9ea5d --- /dev/null +++ b/serial_link/protocol/data_link.h @@ -0,0 +1,25 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void recv_byte(uint8_t data); diff --git a/serial_link/protocol/routing.h b/serial_link/protocol/routing.h new file mode 100644 index 000000000..ee1f9a78a --- /dev/null +++ b/serial_link/protocol/routing.h @@ -0,0 +1,25 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void recv_frame(uint8_t* data, uint16_t size); diff --git a/serial_link/tests/Makefile b/serial_link/tests/Makefile new file mode 100644 index 000000000..0d8ba4b7b --- /dev/null +++ b/serial_link/tests/Makefile @@ -0,0 +1,61 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Fred Sundvik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +CC = gcc +CFLAGS = +INCLUDES = -I. -I../ +LDFLAGS = -L$(BUILDDIR)/cgreen/build-c/src -shared +LDLIBS = -lcgreen +UNITOBJ = $(BUILDDIR)/serialtest/unitobj +DEPDIR = $(BUILDDIR)/serialtest/unit.d +UNITTESTS = $(BUILDDIR)/serialtest/unittests +DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td +EXT = .so +UNAME := $(shell uname) +ifneq (, $(findstring MINGW, $(UNAME))) + EXT = .dll +endif +ifneq (, $(findstring CYGWIN, $(UNAME))) + EXT = .dll +endif + +SRC = $(wildcard *.c) +TESTFILES = $(patsubst %.c, $(UNITTESTS)/%$(EXT), $(SRC)) +$(shell mkdir -p $(DEPDIR) >/dev/null) + +test: $(TESTFILES) + @$(BUILDDIR)/cgreen/build-c/tools/cgreen-runner --color $(TESTFILES) + +$(UNITTESTS)/%$(EXT): $(UNITOBJ)/%.o + @mkdir -p $(UNITTESTS) + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +$(UNITOBJ)/%.o : %.c +$(UNITOBJ)/%.o: %.c $(DEPDIR)/%.d + @mkdir -p $(UNITOBJ) + $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $< -o $@ + @mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d + +$(DEPDIR)/%.d: ; +.PRECIOUS: $(DEPDIR)/%.d + +-include $(patsubst %,$(DEPDIR)/%.d,$(basename $(SRC))) \ No newline at end of file diff --git a/serial_link/tests/data_link_tests.c b/serial_link/tests/data_link_tests.c new file mode 100644 index 000000000..1b7107e70 --- /dev/null +++ b/serial_link/tests/data_link_tests.c @@ -0,0 +1,52 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include +#include "protocol/data_link.h" +#include "protocol/data_link.c" +#include "protocol/routing.h" + +Describe(DataLink); +BeforeEach(DataLink) {} +AfterEach(DataLink) {} + +void recv_frame(uint8_t* data, uint16_t size) { + mock(data, size); +} + +Ensure(DataLink, receives_no_frame_for_a_single_zero_byte) { + never_expect(recv_frame); + recv_byte(0); +} + +Ensure(DataLink, receives_no_frame_for_a_single_FF_byte) { + never_expect(recv_frame); + recv_byte(0xFF); +} + +Ensure(DataLink, receives_no_frame_for_a_single_random_byte) { + never_expect(recv_frame); + recv_byte(0x4A); +} diff --git a/serial_link_tests.mk b/serial_link_tests.mk index 36d7c09b3..e292f582a 100644 --- a/serial_link_tests.mk +++ b/serial_link_tests.mk @@ -1,3 +1,25 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Fred Sundvik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + CGREEN_LIB = $(BUILDDIR)/cgreen/build-c/src/libcgreen.a CGREEN_DIR = "$(CURDIR)/$(SERIAL_DIR)/cgreen/cgreen" @@ -5,9 +27,8 @@ CGREEN_BUILD_DIR = "$(CURDIR)/$(BUILDDIR)/cgreen" export CGREEN_DIR export CGREEN_BUILD_DIR $(CGREEN_LIB): - make -C $(SERIAL_DIR)/cgreen + @make -C $(SERIAL_DIR)/cgreen .PHONY serialtest: serialtest : $(CGREEN_LIB) - @echo $(CGREEN_LIB) - make -C $(SERIAL_DIR)/tests BUILDDIR=../../$(BUILDDIR) \ No newline at end of file + @make -C $(SERIAL_DIR)/serial_link/tests BUILDDIR=../../../$(BUILDDIR) \ No newline at end of file diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 3f89cba47..000000000 --- a/tests/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -CC = gcc -CFLAGS = -INCLUDES = -I. -LDFLAGS = -L$(BUILDDIR)/cgreen/build-c/src -shared -LDLIBS = -lcgreen -UNITOBJ = $(BUILDDIR)/serialtest/unitobj -DEPDIR = $(BUILDDIR)/serialtest/unit.d -UNITTESTS = $(BUILDDIR)/serialtest/unittests -DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td -EXT = .so -UNAME := $(shell uname) -ifneq (, $(findstring MINGW, $(UNAME))) - EXT = .dll -endif -ifneq (, $(findstring CYGWIN, $(UNAME))) - EXT = .dll -endif - -SRC = $(wildcard *.c) -TESTFILES = $(patsubst %.c, $(UNITTESTS)/%$(EXT), $(SRC)) -$(shell mkdir -p $(DEPDIR) >/dev/null) - -test: $(TESTFILES) - @$(BUILDDIR)/cgreen/build-c/tools/cgreen-runner --color $(TESTFILES) - -$(UNITTESTS)/%$(EXT): $(UNITOBJ)/%.o - mkdir -p $(UNITTESTS) - $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) - -$(UNITOBJ)/%.o : %.c -$(UNITOBJ)/%.o: %.c $(DEPDIR)/%.d - mkdir -p $(UNITOBJ) - $(CC) $(CFLAGS) $(DEPFLAGS) -c $< -o $@ - mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d - -$(DEPDIR)/%.d: ; -.PRECIOUS: $(DEPDIR)/%.d - --include $(patsubst %,$(DEPDIR)/%.d,$(basename $(SRC).c)) \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 8a991a266e7f8f9aff48049dffb17eccfa353ca1 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 13:05:50 +0200 Subject: Rename files to match what they actually do Also add validator before routing. --- serial_link/protocol/byte_stuffer.c | 29 +++++++++++++++++++ serial_link/protocol/byte_stuffer.h | 25 ++++++++++++++++ serial_link/protocol/data_link.c | 29 ------------------- serial_link/protocol/data_link.h | 25 ---------------- serial_link/protocol/frame_validator.h | 25 ++++++++++++++++ serial_link/protocol/routing.h | 25 ---------------- serial_link/tests/byte_stuffer_tests.c | 52 ++++++++++++++++++++++++++++++++++ serial_link/tests/data_link_tests.c | 52 ---------------------------------- 8 files changed, 131 insertions(+), 131 deletions(-) create mode 100644 serial_link/protocol/byte_stuffer.c create mode 100644 serial_link/protocol/byte_stuffer.h delete mode 100644 serial_link/protocol/data_link.c delete mode 100644 serial_link/protocol/data_link.h create mode 100644 serial_link/protocol/frame_validator.h delete mode 100644 serial_link/protocol/routing.h create mode 100644 serial_link/tests/byte_stuffer_tests.c delete mode 100644 serial_link/tests/data_link_tests.c diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c new file mode 100644 index 000000000..95ce86524 --- /dev/null +++ b/serial_link/protocol/byte_stuffer.c @@ -0,0 +1,29 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "protocol/byte_stuffer.h" +#include "protocol/frame_validator.h" + +void recv_byte(uint8_t data) { +} diff --git a/serial_link/protocol/byte_stuffer.h b/serial_link/protocol/byte_stuffer.h new file mode 100644 index 000000000..3b9f9ea5d --- /dev/null +++ b/serial_link/protocol/byte_stuffer.h @@ -0,0 +1,25 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void recv_byte(uint8_t data); diff --git a/serial_link/protocol/data_link.c b/serial_link/protocol/data_link.c deleted file mode 100644 index 71d538470..000000000 --- a/serial_link/protocol/data_link.c +++ /dev/null @@ -1,29 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include "protocol/data_link.h" -#include "protocol/routing.h" - -void recv_byte(uint8_t data) { -} diff --git a/serial_link/protocol/data_link.h b/serial_link/protocol/data_link.h deleted file mode 100644 index 3b9f9ea5d..000000000 --- a/serial_link/protocol/data_link.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -void recv_byte(uint8_t data); diff --git a/serial_link/protocol/frame_validator.h b/serial_link/protocol/frame_validator.h new file mode 100644 index 000000000..ee1f9a78a --- /dev/null +++ b/serial_link/protocol/frame_validator.h @@ -0,0 +1,25 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void recv_frame(uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/routing.h b/serial_link/protocol/routing.h deleted file mode 100644 index ee1f9a78a..000000000 --- a/serial_link/protocol/routing.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -void recv_frame(uint8_t* data, uint16_t size); diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c new file mode 100644 index 000000000..418d48f6a --- /dev/null +++ b/serial_link/tests/byte_stuffer_tests.c @@ -0,0 +1,52 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include +#include "protocol/byte_stuffer.h" +#include "protocol/byte_stuffer.c" +#include "protocol/frame_validator.h" + +Describe(ByteStuffer); +BeforeEach(ByteStuffer) {} +AfterEach(ByteStuffer) {} + +void recv_frame(uint8_t* data, uint16_t size) { + mock(data, size); +} + +Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { + never_expect(recv_frame); + recv_byte(0); +} + +Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { + never_expect(recv_frame); + recv_byte(0xFF); +} + +Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { + never_expect(recv_frame); + recv_byte(0x4A); +} diff --git a/serial_link/tests/data_link_tests.c b/serial_link/tests/data_link_tests.c deleted file mode 100644 index 1b7107e70..000000000 --- a/serial_link/tests/data_link_tests.c +++ /dev/null @@ -1,52 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include -#include -#include "protocol/data_link.h" -#include "protocol/data_link.c" -#include "protocol/routing.h" - -Describe(DataLink); -BeforeEach(DataLink) {} -AfterEach(DataLink) {} - -void recv_frame(uint8_t* data, uint16_t size) { - mock(data, size); -} - -Ensure(DataLink, receives_no_frame_for_a_single_zero_byte) { - never_expect(recv_frame); - recv_byte(0); -} - -Ensure(DataLink, receives_no_frame_for_a_single_FF_byte) { - never_expect(recv_frame); - recv_byte(0xFF); -} - -Ensure(DataLink, receives_no_frame_for_a_single_random_byte) { - never_expect(recv_frame); - recv_byte(0x4A); -} -- cgit v1.2.3-24-g4f1b From ce3a21cbeaa58cfa6b117a8be13be47a69f086ae Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 14:04:51 +0200 Subject: Implement receive of valid small byte stuffed frames --- serial_link/protocol/byte_stuffer.c | 36 +++++++++++++++++++- serial_link/protocol/byte_stuffer.h | 4 ++- serial_link/tests/byte_stuffer_tests.c | 61 +++++++++++++++++++++++++++++++--- 3 files changed, 95 insertions(+), 6 deletions(-) diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index 95ce86524..7ce01a96a 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -25,5 +25,39 @@ SOFTWARE. #include "protocol/byte_stuffer.h" #include "protocol/frame_validator.h" -void recv_byte(uint8_t data) { +// This implements the "Consistent overhead byte stuffing protocol" +// https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing +// http://www.stuartcheshire.org/papers/COBSforToN.pdf + +typedef struct byte_stuffer_state { + uint16_t next_zero; + uint16_t data_pos; + uint8_t data[256]; +}byte_stuffer_state_t; + +void init_byte_stuffer_state(byte_stuffer_state_t* state) { + state->next_zero = 0; + state->data_pos = 0; +} + +void recv_byte(byte_stuffer_state_t* state, uint8_t data) { + if (state->next_zero == 0) { + state->next_zero = data; + state->data_pos = 0; + return; + } + + state->next_zero--; + if (data == 0) { + recv_frame(state->data, state->data_pos); + } + else { + if (state->next_zero == 0) { + state->next_zero = data; + state->data[state->data_pos++] = 0; + } + else { + state->data[state->data_pos++] = data; + } + } } diff --git a/serial_link/protocol/byte_stuffer.h b/serial_link/protocol/byte_stuffer.h index 3b9f9ea5d..9a5551fab 100644 --- a/serial_link/protocol/byte_stuffer.h +++ b/serial_link/protocol/byte_stuffer.h @@ -22,4 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void recv_byte(uint8_t data); +typedef struct byte_stuffer_state byte_stuffer_state_t; +void init_byte_stuffer_state(byte_stuffer_state_t* state); +void recv_byte(byte_stuffer_state_t* state, uint8_t data); diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 418d48f6a..2fc7a0b26 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -28,8 +28,12 @@ SOFTWARE. #include "protocol/byte_stuffer.c" #include "protocol/frame_validator.h" +byte_stuffer_state_t state; + Describe(ByteStuffer); -BeforeEach(ByteStuffer) {} +BeforeEach(ByteStuffer) { + init_byte_stuffer_state(&state); +} AfterEach(ByteStuffer) {} void recv_frame(uint8_t* data, uint16_t size) { @@ -38,15 +42,64 @@ void recv_frame(uint8_t* data, uint16_t size) { Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { never_expect(recv_frame); - recv_byte(0); + recv_byte(&state, 0); } Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { never_expect(recv_frame); - recv_byte(0xFF); + recv_byte(&state, 0xFF); } Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { never_expect(recv_frame); - recv_byte(0x4A); + recv_byte(&state, 0x4A); +} + +Ensure(ByteStuffer, receives_single_byte_valid_frame) { + uint8_t expected[] = {0x37}; + expect(recv_frame, + when(size, is_equal_to(1)), + when(data, is_equal_to_contents_of(expected, 1)) + ); + recv_byte(&state, 2); + recv_byte(&state, 0x37); + recv_byte(&state, 0); +} + +Ensure(ByteStuffer, receives_three_bytes_valid_frame) { + uint8_t expected[] = {0x37, 0x99, 0xFF}; + expect(recv_frame, + when(size, is_equal_to(3)), + when(data, is_equal_to_contents_of(expected, 3)) + ); + recv_byte(&state, 5); + recv_byte(&state, 0x37); + recv_byte(&state, 0x99); + recv_byte(&state, 0xFF); + recv_byte(&state, 0); +} + +Ensure(ByteStuffer, receives_single_zero_valid_frame) { + uint8_t expected[] = {0}; + expect(recv_frame, + when(size, is_equal_to(1)), + when(data, is_equal_to_contents_of(expected, 1)) + ); + recv_byte(&state, 1); + recv_byte(&state, 1); + recv_byte(&state, 0); +} + +Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { + uint8_t expected[] = {5, 0, 3, 0}; + expect(recv_frame, + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(expected, 4)) + ); + recv_byte(&state, 2); + recv_byte(&state, 5); + recv_byte(&state, 2); + recv_byte(&state, 3); + recv_byte(&state, 1); + recv_byte(&state, 0); } -- cgit v1.2.3-24-g4f1b From eefb5b5634e341396fb535f4eeac1323bf716ed0 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 14:25:54 +0200 Subject: Mutiple frame handling for byte stuffer Also handles unexpected data. --- serial_link/protocol/byte_stuffer.c | 12 +++++++- serial_link/tests/byte_stuffer_tests.c | 53 +++++++++++++++++++++++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index 7ce01a96a..e578f88dc 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -41,6 +41,7 @@ void init_byte_stuffer_state(byte_stuffer_state_t* state) { } void recv_byte(byte_stuffer_state_t* state, uint8_t data) { + // Start of a new frame if (state->next_zero == 0) { state->next_zero = data; state->data_pos = 0; @@ -49,10 +50,19 @@ void recv_byte(byte_stuffer_state_t* state, uint8_t data) { state->next_zero--; if (data == 0) { - recv_frame(state->data, state->data_pos); + if (state->next_zero == 0) { + // The frame is completed + recv_frame(state->data, state->data_pos); + } + else { + // The frame is invalid, so reset + state->next_zero = 0; + state->data_pos = 0; + } } else { if (state->next_zero == 0) { + // Special case for zeroes state->next_zero = data; state->data[state->data_pos++] = 0; } diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 2fc7a0b26..74a349b1f 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -72,7 +72,7 @@ Ensure(ByteStuffer, receives_three_bytes_valid_frame) { when(size, is_equal_to(3)), when(data, is_equal_to_contents_of(expected, 3)) ); - recv_byte(&state, 5); + recv_byte(&state, 4); recv_byte(&state, 0x37); recv_byte(&state, 0x99); recv_byte(&state, 0xFF); @@ -103,3 +103,54 @@ Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { recv_byte(&state, 1); recv_byte(&state, 0); } + +Ensure(ByteStuffer, receives_two_valid_frames) { + uint8_t expected1[] = {5, 0}; + uint8_t expected2[] = {3}; + expect(recv_frame, + when(size, is_equal_to(2)), + when(data, is_equal_to_contents_of(expected1, 2)) + ); + expect(recv_frame, + when(size, is_equal_to(1)), + when(data, is_equal_to_contents_of(expected2, 1)) + ); + recv_byte(&state, 2); + recv_byte(&state, 5); + recv_byte(&state, 1); + recv_byte(&state, 0); + recv_byte(&state, 2); + recv_byte(&state, 3); + recv_byte(&state, 0); +} + +Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { + uint8_t expected[] = {5, 7}; + expect(recv_frame, + when(size, is_equal_to(2)), + when(data, is_equal_to_contents_of(expected, 2)) + ); + recv_byte(&state, 3); + recv_byte(&state, 1); + recv_byte(&state, 0); + recv_byte(&state, 3); + recv_byte(&state, 5); + recv_byte(&state, 7); + recv_byte(&state, 0); +} + +Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { + uint8_t expected[] = {5, 7}; + expect(recv_frame, + when(size, is_equal_to(2)), + when(data, is_equal_to_contents_of(expected, 2)) + ); + recv_byte(&state, 2); + recv_byte(&state, 9); + recv_byte(&state, 4); // This should have been zero + recv_byte(&state, 0); + recv_byte(&state, 3); + recv_byte(&state, 5); + recv_byte(&state, 7); + recv_byte(&state, 0); +} -- cgit v1.2.3-24-g4f1b From e8cb6d8023cf2912a08dc1a0a1b108b6dbc429cc Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 15:28:57 +0200 Subject: Bytestuffer recv handling of long frames --- serial_link/protocol/byte_stuffer.c | 26 +++++++--- serial_link/tests/byte_stuffer_tests.c | 92 ++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 6 deletions(-) diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index e578f88dc..cc7afe97a 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -24,26 +24,35 @@ SOFTWARE. #include "protocol/byte_stuffer.h" #include "protocol/frame_validator.h" +#include // This implements the "Consistent overhead byte stuffing protocol" // https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing // http://www.stuartcheshire.org/papers/COBSforToN.pdf +#define MAX_FRAME_SIZE 1024 + typedef struct byte_stuffer_state { uint16_t next_zero; uint16_t data_pos; - uint8_t data[256]; + bool long_frame; + uint8_t data[MAX_FRAME_SIZE]; }byte_stuffer_state_t; void init_byte_stuffer_state(byte_stuffer_state_t* state) { state->next_zero = 0; state->data_pos = 0; + state->long_frame = false; +} + +static void start_frame(byte_stuffer_state_t* state, uint8_t data) { } void recv_byte(byte_stuffer_state_t* state, uint8_t data) { // Start of a new frame if (state->next_zero == 0) { state->next_zero = data; + state->long_frame = data == 0xFF; state->data_pos = 0; return; } @@ -56,15 +65,20 @@ void recv_byte(byte_stuffer_state_t* state, uint8_t data) { } else { // The frame is invalid, so reset - state->next_zero = 0; - state->data_pos = 0; + init_byte_stuffer_state(state); } } else { if (state->next_zero == 0) { - // Special case for zeroes - state->next_zero = data; - state->data[state->data_pos++] = 0; + if (state->long_frame) { + state->next_zero = data; + state->long_frame = data == 0xFF; + } + else { + // Special case for zeroes + state->next_zero = data; + state->data[state->data_pos++] = 0; + } } else { state->data[state->data_pos++] = data; diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 74a349b1f..a28c36193 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -154,3 +154,95 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { recv_byte(&state, 7); recv_byte(&state, 0); } + +Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) { + uint8_t expected[254]; + int i; + for (i=0;i<254;i++) { + expected[i] = i + 1; + } + expect(recv_frame, + when(size, is_equal_to(254)), + when(data, is_equal_to_contents_of(expected, 254)) + ); + recv_byte(&state, 0xFF); + for (i=0;i<254;i++) { + recv_byte(&state, i+1); + } + recv_byte(&state, 0); +} + +Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) { + uint8_t expected[255]; + int i; + for (i=0;i<254;i++) { + expected[i] = i + 1; + } + expected[254] = 7; + expect(recv_frame, + when(size, is_equal_to(255)), + when(data, is_equal_to_contents_of(expected, 255)) + ); + recv_byte(&state, 0xFF); + for (i=0;i<254;i++) { + recv_byte(&state, i+1); + } + recv_byte(&state, 2); + recv_byte(&state, 7); + recv_byte(&state, 0); +} + +Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) { + uint8_t expected[255]; + int i; + for (i=0;i<254;i++) { + expected[i] = i + 1; + } + expected[254] = 0; + expect(recv_frame, + when(size, is_equal_to(255)), + when(data, is_equal_to_contents_of(expected, 255)) + ); + recv_byte(&state, 0xFF); + for (i=0;i<254;i++) { + recv_byte(&state, i+1); + } + recv_byte(&state, 1); + recv_byte(&state, 1); + recv_byte(&state, 0); +} + +Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { + uint8_t expected[515]; + int i; + int j; + for (j=0;j<2;j++) { + for (i=0;i<254;i++) { + expected[i+254*j] = i + 1; + } + } + for (i=0;i<7;i++) { + expected[254*2+i] = i + 1; + } + expect(recv_frame, + when(size, is_equal_to(515)), + when(data, is_equal_to_contents_of(expected, 510)) + ); + recv_byte(&state, 0xFF); + for (i=0;i<254;i++) { + recv_byte(&state, i+1); + } + recv_byte(&state, 0xFF); + for (i=0;i<254;i++) { + recv_byte(&state, i+1); + } + recv_byte(&state, 8); + recv_byte(&state, 1); + recv_byte(&state, 2); + recv_byte(&state, 3); + recv_byte(&state, 4); + recv_byte(&state, 5); + recv_byte(&state, 6); + recv_byte(&state, 7); + recv_byte(&state, 0); +} -- cgit v1.2.3-24-g4f1b From 26537474ae1d65cdf40276299d7e04648474357b Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 15:57:44 +0200 Subject: Add byte stuffer recv handling of too long frames --- .gitignore | 1 + serial_link/protocol/byte_stuffer.c | 17 ++++++++---- serial_link/tests/byte_stuffer_tests.c | 48 ++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..2d68e206e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.stackdump diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index cc7afe97a..f0071b1f7 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -45,9 +45,6 @@ void init_byte_stuffer_state(byte_stuffer_state_t* state) { state->long_frame = false; } -static void start_frame(byte_stuffer_state_t* state, uint8_t data) { -} - void recv_byte(byte_stuffer_state_t* state, uint8_t data) { // Start of a new frame if (state->next_zero == 0) { @@ -61,7 +58,9 @@ void recv_byte(byte_stuffer_state_t* state, uint8_t data) { if (data == 0) { if (state->next_zero == 0) { // The frame is completed - recv_frame(state->data, state->data_pos); + if (state->data_pos > 0) { + recv_frame(state->data, state->data_pos); + } } else { // The frame is invalid, so reset @@ -69,8 +68,16 @@ void recv_byte(byte_stuffer_state_t* state, uint8_t data) { } } else { - if (state->next_zero == 0) { + if (state->data_pos == MAX_FRAME_SIZE) { + // We exceeded our maximum frame size + // therefore there's nothing else to do than reset to a new frame + state->next_zero = data; + state->long_frame = data == 0xFF; + state->data_pos = 0; + } + else if (state->next_zero == 0) { if (state->long_frame) { + // This is part of a long frame, so continue state->next_zero = data; state->long_frame = data == 0xFF; } diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index a28c36193..bfa019386 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -55,6 +55,12 @@ Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { recv_byte(&state, 0x4A); } +Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { + never_expect(recv_frame); + recv_byte(&state, 1); + recv_byte(&state, 0); +} + Ensure(ByteStuffer, receives_single_byte_valid_frame) { uint8_t expected[] = {0x37}; expect(recv_frame, @@ -246,3 +252,45 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { recv_byte(&state, 7); recv_byte(&state, 0); } + +Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { + uint8_t expected[MAX_FRAME_SIZE] = {}; + expect(recv_frame, + when(size, is_equal_to(MAX_FRAME_SIZE)), + when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) + ); + int i; + recv_byte(&state, 1); + for(i=0;i Date: Sun, 14 Feb 2016 17:45:25 +0200 Subject: Add sending of small frames with no zeroes --- serial_link/protocol/byte_stuffer.c | 12 ++++++- serial_link/protocol/byte_stuffer.h | 1 + serial_link/protocol/physical.h | 25 ++++++++++++++ serial_link/tests/byte_stuffer_tests.c | 60 +++++++++++++++++++++++++--------- 4 files changed, 82 insertions(+), 16 deletions(-) create mode 100644 serial_link/protocol/physical.h diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index f0071b1f7..dfd5942eb 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -24,7 +24,7 @@ SOFTWARE. #include "protocol/byte_stuffer.h" #include "protocol/frame_validator.h" -#include +#include "protocol/physical.h" // This implements the "Consistent overhead byte stuffing protocol" // https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing @@ -92,3 +92,13 @@ void recv_byte(byte_stuffer_state_t* state, uint8_t data) { } } } + +void send_frame(uint8_t* data, uint16_t size) { + if (size > 0) { + uint8_t numZeroes = size + 1; + const uint8_t zero = 0; + send_data(&numZeroes, 1); + send_data(data, size); + send_data(&zero, 1); + } +} diff --git a/serial_link/protocol/byte_stuffer.h b/serial_link/protocol/byte_stuffer.h index 9a5551fab..ea6b8451d 100644 --- a/serial_link/protocol/byte_stuffer.h +++ b/serial_link/protocol/byte_stuffer.h @@ -25,3 +25,4 @@ SOFTWARE. typedef struct byte_stuffer_state byte_stuffer_state_t; void init_byte_stuffer_state(byte_stuffer_state_t* state); void recv_byte(byte_stuffer_state_t* state, uint8_t data); +void send_frame(uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/physical.h b/serial_link/protocol/physical.h new file mode 100644 index 000000000..73a7855df --- /dev/null +++ b/serial_link/protocol/physical.h @@ -0,0 +1,25 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void send_data(const uint8_t* data, uint16_t size); diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index bfa019386..6e44c9170 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -27,12 +27,16 @@ SOFTWARE. #include "protocol/byte_stuffer.h" #include "protocol/byte_stuffer.c" #include "protocol/frame_validator.h" +#include "protocol/physical.h" -byte_stuffer_state_t state; +static byte_stuffer_state_t state; +static uint8_t sent_data[MAX_FRAME_SIZE*2]; +static uint16_t sent_data_size; Describe(ByteStuffer); BeforeEach(ByteStuffer) { init_byte_stuffer_state(&state); + sent_data_size = 0; } AfterEach(ByteStuffer) {} @@ -40,6 +44,11 @@ void recv_frame(uint8_t* data, uint16_t size) { mock(data, size); } +void send_data(const uint8_t* data, uint16_t size) { + memcpy(sent_data + sent_data_size, data, size); + sent_data_size += size; +} + Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { never_expect(recv_frame); recv_byte(&state, 0); @@ -66,7 +75,7 @@ Ensure(ByteStuffer, receives_single_byte_valid_frame) { expect(recv_frame, when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) - ); + ); recv_byte(&state, 2); recv_byte(&state, 0x37); recv_byte(&state, 0); @@ -77,7 +86,7 @@ Ensure(ByteStuffer, receives_three_bytes_valid_frame) { expect(recv_frame, when(size, is_equal_to(3)), when(data, is_equal_to_contents_of(expected, 3)) - ); + ); recv_byte(&state, 4); recv_byte(&state, 0x37); recv_byte(&state, 0x99); @@ -90,7 +99,7 @@ Ensure(ByteStuffer, receives_single_zero_valid_frame) { expect(recv_frame, when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) - ); + ); recv_byte(&state, 1); recv_byte(&state, 1); recv_byte(&state, 0); @@ -101,7 +110,7 @@ Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { expect(recv_frame, when(size, is_equal_to(4)), when(data, is_equal_to_contents_of(expected, 4)) - ); + ); recv_byte(&state, 2); recv_byte(&state, 5); recv_byte(&state, 2); @@ -116,11 +125,11 @@ Ensure(ByteStuffer, receives_two_valid_frames) { expect(recv_frame, when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected1, 2)) - ); + ); expect(recv_frame, when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected2, 1)) - ); + ); recv_byte(&state, 2); recv_byte(&state, 5); recv_byte(&state, 1); @@ -135,7 +144,7 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { expect(recv_frame, when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) - ); + ); recv_byte(&state, 3); recv_byte(&state, 1); recv_byte(&state, 0); @@ -150,7 +159,7 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { expect(recv_frame, when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) - ); + ); recv_byte(&state, 2); recv_byte(&state, 9); recv_byte(&state, 4); // This should have been zero @@ -170,7 +179,7 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_ expect(recv_frame, when(size, is_equal_to(254)), when(data, is_equal_to_contents_of(expected, 254)) - ); + ); recv_byte(&state, 0xFF); for (i=0;i<254;i++) { recv_byte(&state, i+1); @@ -188,7 +197,7 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ expect(recv_frame, when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) - ); + ); recv_byte(&state, 0xFF); for (i=0;i<254;i++) { recv_byte(&state, i+1); @@ -208,7 +217,7 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ expect(recv_frame, when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) - ); + ); recv_byte(&state, 0xFF); for (i=0;i<254;i++) { recv_byte(&state, i+1); @@ -233,7 +242,7 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { expect(recv_frame, when(size, is_equal_to(515)), when(data, is_equal_to_contents_of(expected, 510)) - ); + ); recv_byte(&state, 0xFF); for (i=0;i<254;i++) { recv_byte(&state, i+1); @@ -258,7 +267,7 @@ Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { expect(recv_frame, when(size, is_equal_to(MAX_FRAME_SIZE)), when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) - ); + ); int i; recv_byte(&state, 1); for(i=0;i Date: Sun, 14 Feb 2016 18:59:01 +0200 Subject: Hanlde sending of zero bytes for small packets --- serial_link/protocol/byte_stuffer.c | 27 +++++++++++++--- serial_link/tests/byte_stuffer_tests.c | 56 +++++++++++++++++++++++++++++++--- 2 files changed, 75 insertions(+), 8 deletions(-) diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index dfd5942eb..6118557c1 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -93,12 +93,31 @@ void recv_byte(byte_stuffer_state_t* state, uint8_t data) { } } +static void send_block(uint8_t* start, uint8_t* end, uint8_t num_non_zero) { + send_data(&num_non_zero, 1); + if (end > start) { + send_data(start, end-start); + } +} + void send_frame(uint8_t* data, uint16_t size) { + const uint8_t zero = 0; if (size > 0) { - uint8_t numZeroes = size + 1; - const uint8_t zero = 0; - send_data(&numZeroes, 1); - send_data(data, size); + uint8_t num_non_zero = 1; + uint8_t* end = data + size; + uint8_t* start = data; + while (data < end) { + if (*data == 0) { + send_block(start, data, num_non_zero); + start = data + 1; + num_non_zero = 1; + } + else { + num_non_zero++; + } + ++data; + } + send_block(start, data, num_non_zero); send_data(&zero, 1); } } diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 6e44c9170..0c324e9c4 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -312,15 +312,63 @@ Ensure(ByteStuffer, send_zero_size_frame_does_nothing) { Ensure(ByteStuffer, send_one_byte_frame) { uint8_t data[] = {5}; send_frame(data, 1); - assert_that(sent_data_size, is_equal_to(3)); uint8_t expected[] = {2, 5, 0}; - assert_that(sent_data, is_equal_to_contents_of(expected, 3)); + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } Ensure(ByteStuffer, send_two_byte_frame) { uint8_t data[] = {5, 0x77}; send_frame(data, 2); - assert_that(sent_data_size, is_equal_to(4)); uint8_t expected[] = {3, 5, 0x77, 0}; - assert_that(sent_data, is_equal_to_contents_of(expected, 4)); + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} + +Ensure(ByteStuffer, send_one_byte_frame_with_zero) { + uint8_t data[] = {0}; + send_frame(data, 1); + uint8_t expected[] = {1, 1, 0}; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} + +Ensure(ByteStuffer, send_two_byte_frame_starting_with_zero) { + uint8_t data[] = {0, 9}; + send_frame(data, 2); + uint8_t expected[] = {1, 2, 9, 0}; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} + +Ensure(ByteStuffer, send_two_byte_frame_starting_with_non_zero) { + uint8_t data[] = {9, 0}; + send_frame(data, 2); + uint8_t expected[] = {2, 9, 1, 0}; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} + +Ensure(ByteStuffer, send_three_byte_frame_zero_in_the_middle) { + uint8_t data[] = {9, 0, 0x68}; + send_frame(data, 3); + uint8_t expected[] = {2, 9, 2, 0x68, 0}; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} + +Ensure(ByteStuffer, send_three_byte_frame_data_in_the_middle) { + uint8_t data[] = {0, 0x55, 0}; + send_frame(data, 3); + uint8_t expected[] = {1, 2, 0x55, 1, 0}; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} + +Ensure(ByteStuffer, send_three_byte_frame_all_zeroes) { + uint8_t data[] = {0, 0, 0}; + send_frame(data, 3); + uint8_t expected[] = {1, 1, 1, 1, 0}; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } -- cgit v1.2.3-24-g4f1b From 2f3ea76428276b871b454effd1164648f5e49f23 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 19:03:34 +0200 Subject: Fix name of some unit tests --- serial_link/tests/byte_stuffer_tests.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 0c324e9c4..1982421e6 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -304,7 +304,7 @@ Ensure(ByteStuffer, received_frame_is_aborted_when_its_too_long) { recv_byte(&state, 0); } -Ensure(ByteStuffer, send_zero_size_frame_does_nothing) { +Ensure(ByteStuffer, does_nothing_when_sending_zero_size_frame) { assert_that(sent_data_size, is_equal_to(0)); send_frame(NULL, 0); } @@ -317,7 +317,7 @@ Ensure(ByteStuffer, send_one_byte_frame) { assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } -Ensure(ByteStuffer, send_two_byte_frame) { +Ensure(ByteStuffer, sends_two_byte_frame) { uint8_t data[] = {5, 0x77}; send_frame(data, 2); uint8_t expected[] = {3, 5, 0x77, 0}; @@ -325,7 +325,7 @@ Ensure(ByteStuffer, send_two_byte_frame) { assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } -Ensure(ByteStuffer, send_one_byte_frame_with_zero) { +Ensure(ByteStuffer, sends_one_byte_frame_with_zero) { uint8_t data[] = {0}; send_frame(data, 1); uint8_t expected[] = {1, 1, 0}; @@ -333,7 +333,7 @@ Ensure(ByteStuffer, send_one_byte_frame_with_zero) { assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } -Ensure(ByteStuffer, send_two_byte_frame_starting_with_zero) { +Ensure(ByteStuffer, sends_two_byte_frame_starting_with_zero) { uint8_t data[] = {0, 9}; send_frame(data, 2); uint8_t expected[] = {1, 2, 9, 0}; @@ -341,7 +341,7 @@ Ensure(ByteStuffer, send_two_byte_frame_starting_with_zero) { assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } -Ensure(ByteStuffer, send_two_byte_frame_starting_with_non_zero) { +Ensure(ByteStuffer, sends_two_byte_frame_starting_with_non_zero) { uint8_t data[] = {9, 0}; send_frame(data, 2); uint8_t expected[] = {2, 9, 1, 0}; @@ -349,7 +349,7 @@ Ensure(ByteStuffer, send_two_byte_frame_starting_with_non_zero) { assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } -Ensure(ByteStuffer, send_three_byte_frame_zero_in_the_middle) { +Ensure(ByteStuffer, sends_three_byte_frame_zero_in_the_middle) { uint8_t data[] = {9, 0, 0x68}; send_frame(data, 3); uint8_t expected[] = {2, 9, 2, 0x68, 0}; @@ -357,7 +357,7 @@ Ensure(ByteStuffer, send_three_byte_frame_zero_in_the_middle) { assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } -Ensure(ByteStuffer, send_three_byte_frame_data_in_the_middle) { +Ensure(ByteStuffer, sends_three_byte_frame_data_in_the_middle) { uint8_t data[] = {0, 0x55, 0}; send_frame(data, 3); uint8_t expected[] = {1, 2, 0x55, 1, 0}; @@ -365,7 +365,7 @@ Ensure(ByteStuffer, send_three_byte_frame_data_in_the_middle) { assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } -Ensure(ByteStuffer, send_three_byte_frame_all_zeroes) { +Ensure(ByteStuffer, sends_three_byte_frame_with_all_zeroes) { uint8_t data[] = {0, 0, 0}; send_frame(data, 3); uint8_t expected[] = {1, 1, 1, 1, 0}; -- cgit v1.2.3-24-g4f1b From 6956c177da8737f999eef72a21f0fc3caea2ac3e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 19:56:22 +0200 Subject: Add byte stuffing send support for large frames --- serial_link/protocol/byte_stuffer.c | 21 ++++++++++--- serial_link/tests/byte_stuffer_tests.c | 56 ++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 5 deletions(-) diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index 6118557c1..69cfca359 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -25,6 +25,7 @@ SOFTWARE. #include "protocol/byte_stuffer.h" #include "protocol/frame_validator.h" #include "protocol/physical.h" +#include // This implements the "Consistent overhead byte stuffing protocol" // https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing @@ -103,19 +104,29 @@ static void send_block(uint8_t* start, uint8_t* end, uint8_t num_non_zero) { void send_frame(uint8_t* data, uint16_t size) { const uint8_t zero = 0; if (size > 0) { - uint8_t num_non_zero = 1; + uint16_t num_non_zero = 1; uint8_t* end = data + size; uint8_t* start = data; while (data < end) { - if (*data == 0) { + if (num_non_zero == 0xFF) { + // There's more data after big non-zero block + // So send it, and start a new block send_block(start, data, num_non_zero); - start = data + 1; + start = data; num_non_zero = 1; } else { - num_non_zero++; + if (*data == 0) { + // A zero encountered, so send the block + send_block(start, data, num_non_zero); + start = data + 1; + num_non_zero = 1; + } + else { + num_non_zero++; + } + ++data; } - ++data; } send_block(start, data, num_non_zero); send_data(&zero, 1); diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 1982421e6..8598cddd3 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -372,3 +372,59 @@ Ensure(ByteStuffer, sends_three_byte_frame_with_all_zeroes) { assert_that(sent_data_size, is_equal_to(sizeof(expected))); assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } + +Ensure(ByteStuffer, sends_frame_with_254_non_zeroes) { + uint8_t data[254]; + int i; + for(i=0;i<254;i++) { + data[i] = i + 1; + } + send_frame(data, 254); + uint8_t expected[256]; + expected[0] = 0xFF; + for(i=1;i<255;i++) { + expected[i] = i; + } + expected[255] = 0; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} + +Ensure(ByteStuffer, sends_frame_with_255_non_zeroes) { + uint8_t data[255]; + int i; + for(i=0;i<255;i++) { + data[i] = i + 1; + } + send_frame(data, 255); + uint8_t expected[258]; + expected[0] = 0xFF; + for(i=1;i<255;i++) { + expected[i] = i; + } + expected[255] = 2; + expected[256] = 255; + expected[257] = 0; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} + +Ensure(ByteStuffer, sends_frame_with_254_non_zeroes_followed_by_zero) { + uint8_t data[255]; + int i; + for(i=0;i<254;i++) { + data[i] = i + 1; + } + data[255] = 0; + send_frame(data, 255); + uint8_t expected[258]; + expected[0] = 0xFF; + for(i=1;i<255;i++) { + expected[i] = i; + } + expected[255] = 1; + expected[256] = 1; + expected[257] = 0; + assert_that(sent_data_size, is_equal_to(sizeof(expected))); + assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); +} -- cgit v1.2.3-24-g4f1b From 713465fb416785c3a544e8626f85aca7e57dafa1 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 20:07:51 +0200 Subject: Add some full round trip tests Mostly to ensure that the receive and send framing works the same way. Especially for the special case with 254 non-zeros. --- serial_link/tests/byte_stuffer_tests.c | 77 ++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 8598cddd3..fbdf39e1b 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -428,3 +428,80 @@ Ensure(ByteStuffer, sends_frame_with_254_non_zeroes_followed_by_zero) { assert_that(sent_data_size, is_equal_to(sizeof(expected))); assert_that(sent_data, is_equal_to_contents_of(expected, sizeof(expected))); } + +Ensure(ByteStuffer, sends_and_receives_full_roundtrip_small_packet) { + uint8_t original_data[] = { 1, 2, 3}; + send_frame(original_data, sizeof(original_data)); + expect(recv_frame, + when(size, is_equal_to(sizeof(original_data))), + when(data, is_equal_to_contents_of(original_data, sizeof(original_data))) + ); + int i; + for(i=0;i Date: Sun, 14 Feb 2016 20:45:59 +0200 Subject: Start implement frame validator --- serial_link/protocol/frame_router.h | 25 +++++++ serial_link/protocol/frame_validator.c | 105 ++++++++++++++++++++++++++++++ serial_link/tests/frame_validator_tests.c | 44 +++++++++++++ 3 files changed, 174 insertions(+) create mode 100644 serial_link/protocol/frame_router.h create mode 100644 serial_link/protocol/frame_validator.c create mode 100644 serial_link/tests/frame_validator_tests.c diff --git a/serial_link/protocol/frame_router.h b/serial_link/protocol/frame_router.h new file mode 100644 index 000000000..b5beba13c --- /dev/null +++ b/serial_link/protocol/frame_router.h @@ -0,0 +1,25 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void route_frame(uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c new file mode 100644 index 000000000..1ffd3aad8 --- /dev/null +++ b/serial_link/protocol/frame_validator.c @@ -0,0 +1,105 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "protocol/frame_validator.h" + +const uint32_t poly8_lookup[256] = +{ + 0, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D +}; + +static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength) +{ + uint32_t crc = 0xffffffff; + while (bytelength-- !=0) crc = poly8_lookup[((uint8_t) crc ^ *(p++))] ^ (crc >> 8); + // return (~crc); also works + return (crc ^ 0xffffffff); +} + +void recv_frame(uint8_t* data, uint16_t size) { + +} diff --git a/serial_link/tests/frame_validator_tests.c b/serial_link/tests/frame_validator_tests.c new file mode 100644 index 000000000..f6a4fcd84 --- /dev/null +++ b/serial_link/tests/frame_validator_tests.c @@ -0,0 +1,44 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include +#include "protocol/frame_validator.c" + +void route_frame(uint8_t* data, uint16_t size) { + mock(data, size); +} + +Describe(FrameValidator); +BeforeEach(FrameValidator) {} +AfterEach(FrameValidator) {} + +Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { + never_expect(route_frame); + uint8_t data[] = {1, 2}; + recv_frame(0, 1); + recv_frame(data, 2); + recv_frame(data, 3); + recv_frame(data, 4); +} -- cgit v1.2.3-24-g4f1b From 62058329ff9000589ddba6454ff8ef8a551b7243 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 21:13:16 +0200 Subject: Add crc32 validation of received frames --- serial_link/protocol/frame_validator.c | 9 +++++++- serial_link/tests/frame_validator_tests.c | 35 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index 1ffd3aad8..d3337f6e3 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -23,6 +23,7 @@ SOFTWARE. */ #include "protocol/frame_validator.h" +#include "protocol/frame_router.h" const uint32_t poly8_lookup[256] = { @@ -101,5 +102,11 @@ static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength) } void recv_frame(uint8_t* data, uint16_t size) { - + if (size > 4) { + uint32_t frame_crc = *(uint32_t*)(data + size - 4); + uint32_t expected_crc = crc32_byte(data, size - 4); + if (frame_crc == expected_crc) { + route_frame(data, size-4); + } + } } diff --git a/serial_link/tests/frame_validator_tests.c b/serial_link/tests/frame_validator_tests.c index f6a4fcd84..1aca9f95f 100644 --- a/serial_link/tests/frame_validator_tests.c +++ b/serial_link/tests/frame_validator_tests.c @@ -42,3 +42,38 @@ Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { recv_frame(data, 3); recv_frame(data, 4); } + +Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) { + uint8_t data[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; + expect(route_frame, + when(size, is_equal_to(1)), + when(data, is_equal_to_contents_of(data, 1)) + ); + recv_frame(data, 5); +} + +Ensure(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) { + uint8_t data[] = {0x44, 0, 0, 0, 0}; + never_expect(route_frame); + recv_frame(data, 5); +} + +Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { + uint8_t data[] = {0x44, 0x10, 0xFF, 0x00, 0x74, 0x4E, 0x30, 0xBA}; + expect(route_frame, + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(data, 4)) + ); + recv_frame(data, 8); +} + +Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { + //0xBA304E74 + //0x470B99F4 + uint8_t data[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; + expect(route_frame, + when(size, is_equal_to(5)), + when(data, is_equal_to_contents_of(data, 5)) + ); + recv_frame(data, 9); +} -- cgit v1.2.3-24-g4f1b From 2a6696bd3d0837c2e655a99000bcbcc759b40075 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 21:31:01 +0200 Subject: Add validator send frame --- serial_link/protocol/frame_validator.c | 7 +++++++ serial_link/tests/frame_validator_tests.c | 26 ++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index d3337f6e3..fdb3ef51c 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -24,6 +24,7 @@ SOFTWARE. #include "protocol/frame_validator.h" #include "protocol/frame_router.h" +#include "protocol/byte_stuffer.h" const uint32_t poly8_lookup[256] = { @@ -110,3 +111,9 @@ void recv_frame(uint8_t* data, uint16_t size) { } } } + +void validator_send_frame(uint8_t* data, uint16_t size) { + uint32_t* crc = (uint32_t*)(data + size); + *crc = crc32_byte(data, size); + send_frame(data, size + 4); +} diff --git a/serial_link/tests/frame_validator_tests.c b/serial_link/tests/frame_validator_tests.c index 1aca9f95f..816256f6b 100644 --- a/serial_link/tests/frame_validator_tests.c +++ b/serial_link/tests/frame_validator_tests.c @@ -30,6 +30,10 @@ void route_frame(uint8_t* data, uint16_t size) { mock(data, size); } +void send_frame(uint8_t* data, uint16_t size) { + mock(data, size); +} + Describe(FrameValidator); BeforeEach(FrameValidator) {} AfterEach(FrameValidator) {} @@ -68,8 +72,6 @@ Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { } Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { - //0xBA304E74 - //0x470B99F4 uint8_t data[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; expect(route_frame, when(size, is_equal_to(5)), @@ -77,3 +79,23 @@ Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { ); recv_frame(data, 9); } + +Ensure(FrameValidator, sends_one_byte_with_correct_crc) { + uint8_t original[] = {0x44, 0, 0, 0, 0}; + uint8_t expected[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; + expect(send_frame, + when(size, is_equal_to(sizeof(expected))), + when(data, is_equal_to_contents_of(expected, sizeof(expected))) + ); + validator_send_frame(original, 1); +} + +Ensure(FrameValidator, sends_five_bytes_with_correct_crc) { + uint8_t original[] = {1, 2, 3, 4, 5, 0, 0, 0, 0}; + uint8_t expected[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; + expect(send_frame, + when(size, is_equal_to(sizeof(expected))), + when(data, is_equal_to_contents_of(expected, sizeof(expected))) + ); + validator_send_frame(original, 5); +} -- cgit v1.2.3-24-g4f1b From 0eb62c4ce61e19cf7629bb74cf01d812c042ac57 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 21:33:14 +0200 Subject: Rename recv_frame to validator_recv_frame --- serial_link/protocol/byte_stuffer.c | 2 +- serial_link/protocol/frame_validator.c | 2 +- serial_link/protocol/frame_validator.h | 4 ++- serial_link/tests/byte_stuffer_tests.c | 50 +++++++++++++++---------------- serial_link/tests/frame_validator_tests.c | 16 +++++----- 5 files changed, 38 insertions(+), 36 deletions(-) diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index 69cfca359..f9aa02a3f 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -60,7 +60,7 @@ void recv_byte(byte_stuffer_state_t* state, uint8_t data) { if (state->next_zero == 0) { // The frame is completed if (state->data_pos > 0) { - recv_frame(state->data, state->data_pos); + validator_recv_frame(state->data, state->data_pos); } } else { diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index fdb3ef51c..0ffcda047 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -102,7 +102,7 @@ static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength) return (crc ^ 0xffffffff); } -void recv_frame(uint8_t* data, uint16_t size) { +void validator_recv_frame(uint8_t* data, uint16_t size) { if (size > 4) { uint32_t frame_crc = *(uint32_t*)(data + size - 4); uint32_t expected_crc = crc32_byte(data, size - 4); diff --git a/serial_link/protocol/frame_validator.h b/serial_link/protocol/frame_validator.h index ee1f9a78a..2e518894f 100644 --- a/serial_link/protocol/frame_validator.h +++ b/serial_link/protocol/frame_validator.h @@ -22,4 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void recv_frame(uint8_t* data, uint16_t size); +void validator_recv_frame(uint8_t* data, uint16_t size); +// The buffer pointed to by the data needs 4 additional bytes +void validator_send_frame(uint8_t* data, uint16_t size); diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index fbdf39e1b..78bcbb473 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -40,7 +40,7 @@ BeforeEach(ByteStuffer) { } AfterEach(ByteStuffer) {} -void recv_frame(uint8_t* data, uint16_t size) { +void validator_recv_frame(uint8_t* data, uint16_t size) { mock(data, size); } @@ -50,29 +50,29 @@ void send_data(const uint8_t* data, uint16_t size) { } Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { - never_expect(recv_frame); + never_expect(validator_recv_frame); recv_byte(&state, 0); } Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { - never_expect(recv_frame); + never_expect(validator_recv_frame); recv_byte(&state, 0xFF); } Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { - never_expect(recv_frame); + never_expect(validator_recv_frame); recv_byte(&state, 0x4A); } Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { - never_expect(recv_frame); + never_expect(validator_recv_frame); recv_byte(&state, 1); recv_byte(&state, 0); } Ensure(ByteStuffer, receives_single_byte_valid_frame) { uint8_t expected[] = {0x37}; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) ); @@ -83,7 +83,7 @@ Ensure(ByteStuffer, receives_single_byte_valid_frame) { Ensure(ByteStuffer, receives_three_bytes_valid_frame) { uint8_t expected[] = {0x37, 0x99, 0xFF}; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(3)), when(data, is_equal_to_contents_of(expected, 3)) ); @@ -96,7 +96,7 @@ Ensure(ByteStuffer, receives_three_bytes_valid_frame) { Ensure(ByteStuffer, receives_single_zero_valid_frame) { uint8_t expected[] = {0}; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) ); @@ -107,7 +107,7 @@ Ensure(ByteStuffer, receives_single_zero_valid_frame) { Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { uint8_t expected[] = {5, 0, 3, 0}; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(4)), when(data, is_equal_to_contents_of(expected, 4)) ); @@ -122,11 +122,11 @@ Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { Ensure(ByteStuffer, receives_two_valid_frames) { uint8_t expected1[] = {5, 0}; uint8_t expected2[] = {3}; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected1, 2)) ); - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected2, 1)) ); @@ -141,7 +141,7 @@ Ensure(ByteStuffer, receives_two_valid_frames) { Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { uint8_t expected[] = {5, 7}; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) ); @@ -156,7 +156,7 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { uint8_t expected[] = {5, 7}; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) ); @@ -176,7 +176,7 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_ for (i=0;i<254;i++) { expected[i] = i + 1; } - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(254)), when(data, is_equal_to_contents_of(expected, 254)) ); @@ -194,7 +194,7 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ expected[i] = i + 1; } expected[254] = 7; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) ); @@ -214,7 +214,7 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ expected[i] = i + 1; } expected[254] = 0; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) ); @@ -239,7 +239,7 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { for (i=0;i<7;i++) { expected[254*2+i] = i + 1; } - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(515)), when(data, is_equal_to_contents_of(expected, 510)) ); @@ -264,7 +264,7 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { uint8_t expected[MAX_FRAME_SIZE] = {}; - expect(recv_frame, + expect(validator_recv_frame, when(size, is_equal_to(MAX_FRAME_SIZE)), when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) ); @@ -278,7 +278,7 @@ Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { Ensure(ByteStuffer, doesnt_recv_a_frame_thats_too_long_all_zeroes) { uint8_t expected[1] = {0}; - never_expect(recv_frame); + never_expect(validator_recv_frame); int i; recv_byte(&state, 1); for(i=0;i Date: Sun, 14 Feb 2016 21:34:40 +0200 Subject: Rename route_frame to route_incoming_frame --- serial_link/protocol/frame_router.h | 2 +- serial_link/protocol/frame_validator.c | 2 +- serial_link/tests/frame_validator_tests.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/serial_link/protocol/frame_router.h b/serial_link/protocol/frame_router.h index b5beba13c..dd1bfb123 100644 --- a/serial_link/protocol/frame_router.h +++ b/serial_link/protocol/frame_router.h @@ -22,4 +22,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void route_frame(uint8_t* data, uint16_t size); +void route_incoming_frame(uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index 0ffcda047..0a5f05068 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -107,7 +107,7 @@ void validator_recv_frame(uint8_t* data, uint16_t size) { uint32_t frame_crc = *(uint32_t*)(data + size - 4); uint32_t expected_crc = crc32_byte(data, size - 4); if (frame_crc == expected_crc) { - route_frame(data, size-4); + route_incoming_frame(data, size-4); } } } diff --git a/serial_link/tests/frame_validator_tests.c b/serial_link/tests/frame_validator_tests.c index 3938f3eac..6f9b746f6 100644 --- a/serial_link/tests/frame_validator_tests.c +++ b/serial_link/tests/frame_validator_tests.c @@ -26,7 +26,7 @@ SOFTWARE. #include #include "protocol/frame_validator.c" -void route_frame(uint8_t* data, uint16_t size) { +void route_incoming_frame(uint8_t* data, uint16_t size) { mock(data, size); } @@ -39,7 +39,7 @@ BeforeEach(FrameValidator) {} AfterEach(FrameValidator) {} Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { - never_expect(route_frame); + never_expect(route_incoming_frame); uint8_t data[] = {1, 2}; validator_recv_frame(0, 1); validator_recv_frame(data, 2); @@ -49,7 +49,7 @@ Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) { uint8_t data[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; - expect(route_frame, + expect(route_incoming_frame, when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(data, 1)) ); @@ -58,13 +58,13 @@ Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) { Ensure(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) { uint8_t data[] = {0x44, 0, 0, 0, 0}; - never_expect(route_frame); + never_expect(route_incoming_frame); validator_recv_frame(data, 5); } Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { uint8_t data[] = {0x44, 0x10, 0xFF, 0x00, 0x74, 0x4E, 0x30, 0xBA}; - expect(route_frame, + expect(route_incoming_frame, when(size, is_equal_to(4)), when(data, is_equal_to_contents_of(data, 4)) ); @@ -73,7 +73,7 @@ Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { uint8_t data[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; - expect(route_frame, + expect(route_incoming_frame, when(size, is_equal_to(5)), when(data, is_equal_to_contents_of(data, 5)) ); -- cgit v1.2.3-24-g4f1b From 8d50880686dfc2b06958fc3bd6212945ee9029c4 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 14 Feb 2016 21:49:31 +0200 Subject: Use memcpy instead of cast to avoid alignment issues --- serial_link/protocol/frame_validator.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index 0a5f05068..f326097ff 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -104,7 +104,8 @@ static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength) void validator_recv_frame(uint8_t* data, uint16_t size) { if (size > 4) { - uint32_t frame_crc = *(uint32_t*)(data + size - 4); + uint32_t frame_crc; + memcpy(&frame_crc, data + size -4, 4); uint32_t expected_crc = crc32_byte(data, size - 4); if (frame_crc == expected_crc) { route_incoming_frame(data, size-4); @@ -113,7 +114,7 @@ void validator_recv_frame(uint8_t* data, uint16_t size) { } void validator_send_frame(uint8_t* data, uint16_t size) { - uint32_t* crc = (uint32_t*)(data + size); - *crc = crc32_byte(data, size); + uint32_t crc = crc32_byte(data, size); + memcpy(data + size, &crc, 4); send_frame(data, size + 4); } -- cgit v1.2.3-24-g4f1b From 419908e5ef15481bd22dcd4173a25562f6153a5a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 17 Feb 2016 09:07:38 +0200 Subject: Hide the byte stuffer state inside it --- serial_link/protocol/byte_stuffer.c | 52 +++++----- serial_link/protocol/byte_stuffer.h | 5 +- serial_link/tests/byte_stuffer_tests.c | 177 ++++++++++++++++----------------- 3 files changed, 117 insertions(+), 117 deletions(-) diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index f9aa02a3f..e5a26c2c2 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -40,56 +40,58 @@ typedef struct byte_stuffer_state { uint8_t data[MAX_FRAME_SIZE]; }byte_stuffer_state_t; -void init_byte_stuffer_state(byte_stuffer_state_t* state) { - state->next_zero = 0; - state->data_pos = 0; - state->long_frame = false; +static byte_stuffer_state_t state; + +void init_byte_stuffer(void) { + state.next_zero = 0; + state.data_pos = 0; + state.long_frame = false; } -void recv_byte(byte_stuffer_state_t* state, uint8_t data) { +void recv_byte(uint8_t data) { // Start of a new frame - if (state->next_zero == 0) { - state->next_zero = data; - state->long_frame = data == 0xFF; - state->data_pos = 0; + if (state.next_zero == 0) { + state.next_zero = data; + state.long_frame = data == 0xFF; + state.data_pos = 0; return; } - state->next_zero--; + state.next_zero--; if (data == 0) { - if (state->next_zero == 0) { + if (state.next_zero == 0) { // The frame is completed - if (state->data_pos > 0) { - validator_recv_frame(state->data, state->data_pos); + if (state.data_pos > 0) { + validator_recv_frame(state.data, state.data_pos); } } else { // The frame is invalid, so reset - init_byte_stuffer_state(state); + init_byte_stuffer(); } } else { - if (state->data_pos == MAX_FRAME_SIZE) { + if (state.data_pos == MAX_FRAME_SIZE) { // We exceeded our maximum frame size // therefore there's nothing else to do than reset to a new frame - state->next_zero = data; - state->long_frame = data == 0xFF; - state->data_pos = 0; + state.next_zero = data; + state.long_frame = data == 0xFF; + state.data_pos = 0; } - else if (state->next_zero == 0) { - if (state->long_frame) { + else if (state.next_zero == 0) { + if (state.long_frame) { // This is part of a long frame, so continue - state->next_zero = data; - state->long_frame = data == 0xFF; + state.next_zero = data; + state.long_frame = data == 0xFF; } else { // Special case for zeroes - state->next_zero = data; - state->data[state->data_pos++] = 0; + state.next_zero = data; + state.data[state.data_pos++] = 0; } } else { - state->data[state->data_pos++] = data; + state.data[state.data_pos++] = data; } } } diff --git a/serial_link/protocol/byte_stuffer.h b/serial_link/protocol/byte_stuffer.h index ea6b8451d..4dcdd24c1 100644 --- a/serial_link/protocol/byte_stuffer.h +++ b/serial_link/protocol/byte_stuffer.h @@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -typedef struct byte_stuffer_state byte_stuffer_state_t; -void init_byte_stuffer_state(byte_stuffer_state_t* state); -void recv_byte(byte_stuffer_state_t* state, uint8_t data); +void init_byte_stuffer(void); +void recv_byte(uint8_t data); void send_frame(uint8_t* data, uint16_t size); diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 78bcbb473..f29cc1299 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -29,13 +29,12 @@ SOFTWARE. #include "protocol/frame_validator.h" #include "protocol/physical.h" -static byte_stuffer_state_t state; static uint8_t sent_data[MAX_FRAME_SIZE*2]; static uint16_t sent_data_size; Describe(ByteStuffer); BeforeEach(ByteStuffer) { - init_byte_stuffer_state(&state); + init_byte_stuffer(); sent_data_size = 0; } AfterEach(ByteStuffer) {} @@ -51,23 +50,23 @@ void send_data(const uint8_t* data, uint16_t size) { Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { never_expect(validator_recv_frame); - recv_byte(&state, 0); + recv_byte(0); } Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { never_expect(validator_recv_frame); - recv_byte(&state, 0xFF); + recv_byte(0xFF); } Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { never_expect(validator_recv_frame); - recv_byte(&state, 0x4A); + recv_byte(0x4A); } Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { never_expect(validator_recv_frame); - recv_byte(&state, 1); - recv_byte(&state, 0); + recv_byte(1); + recv_byte(0); } Ensure(ByteStuffer, receives_single_byte_valid_frame) { @@ -76,9 +75,9 @@ Ensure(ByteStuffer, receives_single_byte_valid_frame) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) ); - recv_byte(&state, 2); - recv_byte(&state, 0x37); - recv_byte(&state, 0); + recv_byte(2); + recv_byte(0x37); + recv_byte(0); } Ensure(ByteStuffer, receives_three_bytes_valid_frame) { @@ -87,11 +86,11 @@ Ensure(ByteStuffer, receives_three_bytes_valid_frame) { when(size, is_equal_to(3)), when(data, is_equal_to_contents_of(expected, 3)) ); - recv_byte(&state, 4); - recv_byte(&state, 0x37); - recv_byte(&state, 0x99); - recv_byte(&state, 0xFF); - recv_byte(&state, 0); + recv_byte(4); + recv_byte(0x37); + recv_byte(0x99); + recv_byte(0xFF); + recv_byte(0); } Ensure(ByteStuffer, receives_single_zero_valid_frame) { @@ -100,9 +99,9 @@ Ensure(ByteStuffer, receives_single_zero_valid_frame) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) ); - recv_byte(&state, 1); - recv_byte(&state, 1); - recv_byte(&state, 0); + recv_byte(1); + recv_byte(1); + recv_byte(0); } Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { @@ -111,12 +110,12 @@ Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { when(size, is_equal_to(4)), when(data, is_equal_to_contents_of(expected, 4)) ); - recv_byte(&state, 2); - recv_byte(&state, 5); - recv_byte(&state, 2); - recv_byte(&state, 3); - recv_byte(&state, 1); - recv_byte(&state, 0); + recv_byte(2); + recv_byte(5); + recv_byte(2); + recv_byte(3); + recv_byte(1); + recv_byte(0); } Ensure(ByteStuffer, receives_two_valid_frames) { @@ -130,13 +129,13 @@ Ensure(ByteStuffer, receives_two_valid_frames) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected2, 1)) ); - recv_byte(&state, 2); - recv_byte(&state, 5); - recv_byte(&state, 1); - recv_byte(&state, 0); - recv_byte(&state, 2); - recv_byte(&state, 3); - recv_byte(&state, 0); + recv_byte(2); + recv_byte(5); + recv_byte(1); + recv_byte(0); + recv_byte(2); + recv_byte(3); + recv_byte(0); } Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { @@ -145,13 +144,13 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) ); - recv_byte(&state, 3); - recv_byte(&state, 1); - recv_byte(&state, 0); - recv_byte(&state, 3); - recv_byte(&state, 5); - recv_byte(&state, 7); - recv_byte(&state, 0); + recv_byte(3); + recv_byte(1); + recv_byte(0); + recv_byte(3); + recv_byte(5); + recv_byte(7); + recv_byte(0); } Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { @@ -160,14 +159,14 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) ); - recv_byte(&state, 2); - recv_byte(&state, 9); - recv_byte(&state, 4); // This should have been zero - recv_byte(&state, 0); - recv_byte(&state, 3); - recv_byte(&state, 5); - recv_byte(&state, 7); - recv_byte(&state, 0); + recv_byte(2); + recv_byte(9); + recv_byte(4); // This should have been zero + recv_byte(0); + recv_byte(3); + recv_byte(5); + recv_byte(7); + recv_byte(0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) { @@ -180,11 +179,11 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_ when(size, is_equal_to(254)), when(data, is_equal_to_contents_of(expected, 254)) ); - recv_byte(&state, 0xFF); + recv_byte(0xFF); for (i=0;i<254;i++) { - recv_byte(&state, i+1); + recv_byte(i+1); } - recv_byte(&state, 0); + recv_byte(0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) { @@ -198,13 +197,13 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) ); - recv_byte(&state, 0xFF); + recv_byte(0xFF); for (i=0;i<254;i++) { - recv_byte(&state, i+1); + recv_byte(i+1); } - recv_byte(&state, 2); - recv_byte(&state, 7); - recv_byte(&state, 0); + recv_byte(2); + recv_byte(7); + recv_byte(0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) { @@ -218,13 +217,13 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) ); - recv_byte(&state, 0xFF); + recv_byte(0xFF); for (i=0;i<254;i++) { - recv_byte(&state, i+1); + recv_byte(i+1); } - recv_byte(&state, 1); - recv_byte(&state, 1); - recv_byte(&state, 0); + recv_byte(1); + recv_byte(1); + recv_byte(0); } Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { @@ -243,23 +242,23 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { when(size, is_equal_to(515)), when(data, is_equal_to_contents_of(expected, 510)) ); - recv_byte(&state, 0xFF); + recv_byte(0xFF); for (i=0;i<254;i++) { - recv_byte(&state, i+1); + recv_byte(i+1); } - recv_byte(&state, 0xFF); + recv_byte(0xFF); for (i=0;i<254;i++) { - recv_byte(&state, i+1); + recv_byte(i+1); } - recv_byte(&state, 8); - recv_byte(&state, 1); - recv_byte(&state, 2); - recv_byte(&state, 3); - recv_byte(&state, 4); - recv_byte(&state, 5); - recv_byte(&state, 6); - recv_byte(&state, 7); - recv_byte(&state, 0); + recv_byte(8); + recv_byte(1); + recv_byte(2); + recv_byte(3); + recv_byte(4); + recv_byte(5); + recv_byte(6); + recv_byte(7); + recv_byte(0); } Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { @@ -269,23 +268,23 @@ Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) ); int i; - recv_byte(&state, 1); + recv_byte(1); for(i=0;i Date: Sat, 20 Feb 2016 12:06:23 +0200 Subject: Add link parameter --- serial_link/protocol/byte_stuffer.c | 75 ++++++----- serial_link/protocol/byte_stuffer.h | 4 +- serial_link/protocol/frame_router.h | 2 +- serial_link/protocol/frame_validator.c | 8 +- serial_link/protocol/frame_validator.h | 4 +- serial_link/protocol/physical.h | 2 +- serial_link/tests/byte_stuffer_tests.c | 212 +++++++++++++++--------------- serial_link/tests/frame_validator_tests.c | 24 ++-- 8 files changed, 170 insertions(+), 161 deletions(-) diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index e5a26c2c2..05b7aa6f8 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -32,6 +32,7 @@ SOFTWARE. // http://www.stuartcheshire.org/papers/COBSforToN.pdf #define MAX_FRAME_SIZE 1024 +#define NUM_LINKS 2 typedef struct byte_stuffer_state { uint16_t next_zero; @@ -40,70 +41,78 @@ typedef struct byte_stuffer_state { uint8_t data[MAX_FRAME_SIZE]; }byte_stuffer_state_t; -static byte_stuffer_state_t state; +static byte_stuffer_state_t states[NUM_LINKS]; + +void init_byte_stuffer_state(byte_stuffer_state_t* state) { + state->next_zero = 0; + state->data_pos = 0; + state->long_frame = false; +} void init_byte_stuffer(void) { - state.next_zero = 0; - state.data_pos = 0; - state.long_frame = false; + int i; + for (i=0;inext_zero == 0) { + state->next_zero = data; + state->long_frame = data == 0xFF; + state->data_pos = 0; return; } - state.next_zero--; + state->next_zero--; if (data == 0) { - if (state.next_zero == 0) { + if (state->next_zero == 0) { // The frame is completed - if (state.data_pos > 0) { - validator_recv_frame(state.data, state.data_pos); + if (state->data_pos > 0) { + validator_recv_frame(link, state->data, state->data_pos); } } else { // The frame is invalid, so reset - init_byte_stuffer(); + init_byte_stuffer_state(state); } } else { - if (state.data_pos == MAX_FRAME_SIZE) { + if (state->data_pos == MAX_FRAME_SIZE) { // We exceeded our maximum frame size // therefore there's nothing else to do than reset to a new frame - state.next_zero = data; - state.long_frame = data == 0xFF; - state.data_pos = 0; + state->next_zero = data; + state->long_frame = data == 0xFF; + state->data_pos = 0; } - else if (state.next_zero == 0) { - if (state.long_frame) { + else if (state->next_zero == 0) { + if (state->long_frame) { // This is part of a long frame, so continue - state.next_zero = data; - state.long_frame = data == 0xFF; + state->next_zero = data; + state->long_frame = data == 0xFF; } else { // Special case for zeroes - state.next_zero = data; - state.data[state.data_pos++] = 0; + state->next_zero = data; + state->data[state->data_pos++] = 0; } } else { - state.data[state.data_pos++] = data; + state->data[state->data_pos++] = data; } } } -static void send_block(uint8_t* start, uint8_t* end, uint8_t num_non_zero) { - send_data(&num_non_zero, 1); +static void send_block(uint8_t link, uint8_t* start, uint8_t* end, uint8_t num_non_zero) { + send_data(link, &num_non_zero, 1); if (end > start) { - send_data(start, end-start); + send_data(link, start, end-start); } } -void send_frame(uint8_t* data, uint16_t size) { +void send_frame(uint8_t link, uint8_t* data, uint16_t size) { const uint8_t zero = 0; if (size > 0) { uint16_t num_non_zero = 1; @@ -113,14 +122,14 @@ void send_frame(uint8_t* data, uint16_t size) { if (num_non_zero == 0xFF) { // There's more data after big non-zero block // So send it, and start a new block - send_block(start, data, num_non_zero); + send_block(link, start, data, num_non_zero); start = data; num_non_zero = 1; } else { if (*data == 0) { // A zero encountered, so send the block - send_block(start, data, num_non_zero); + send_block(link, start, data, num_non_zero); start = data + 1; num_non_zero = 1; } @@ -130,7 +139,7 @@ void send_frame(uint8_t* data, uint16_t size) { ++data; } } - send_block(start, data, num_non_zero); - send_data(&zero, 1); + send_block(link, start, data, num_non_zero); + send_data(link, &zero, 1); } } diff --git a/serial_link/protocol/byte_stuffer.h b/serial_link/protocol/byte_stuffer.h index 4dcdd24c1..cd94b4582 100644 --- a/serial_link/protocol/byte_stuffer.h +++ b/serial_link/protocol/byte_stuffer.h @@ -23,5 +23,5 @@ SOFTWARE. */ void init_byte_stuffer(void); -void recv_byte(uint8_t data); -void send_frame(uint8_t* data, uint16_t size); +void recv_byte(uint8_t link, uint8_t data); +void send_frame(uint8_t link, uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/frame_router.h b/serial_link/protocol/frame_router.h index dd1bfb123..3906b06c7 100644 --- a/serial_link/protocol/frame_router.h +++ b/serial_link/protocol/frame_router.h @@ -22,4 +22,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void route_incoming_frame(uint8_t* data, uint16_t size); +void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index f326097ff..80e662b2e 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -102,19 +102,19 @@ static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength) return (crc ^ 0xffffffff); } -void validator_recv_frame(uint8_t* data, uint16_t size) { +void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { if (size > 4) { uint32_t frame_crc; memcpy(&frame_crc, data + size -4, 4); uint32_t expected_crc = crc32_byte(data, size - 4); if (frame_crc == expected_crc) { - route_incoming_frame(data, size-4); + route_incoming_frame(link, data, size-4); } } } -void validator_send_frame(uint8_t* data, uint16_t size) { +void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size) { uint32_t crc = crc32_byte(data, size); memcpy(data + size, &crc, 4); - send_frame(data, size + 4); + send_frame(link, data, size + 4); } diff --git a/serial_link/protocol/frame_validator.h b/serial_link/protocol/frame_validator.h index 2e518894f..c35fc2726 100644 --- a/serial_link/protocol/frame_validator.h +++ b/serial_link/protocol/frame_validator.h @@ -22,6 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void validator_recv_frame(uint8_t* data, uint16_t size); +void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size); // The buffer pointed to by the data needs 4 additional bytes -void validator_send_frame(uint8_t* data, uint16_t size); +void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/physical.h b/serial_link/protocol/physical.h index 73a7855df..ee5883d36 100644 --- a/serial_link/protocol/physical.h +++ b/serial_link/protocol/physical.h @@ -22,4 +22,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -void send_data(const uint8_t* data, uint16_t size); +void send_data(uint8_t link, const uint8_t* data, uint16_t size); diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index f29cc1299..0f58479cb 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -39,34 +39,34 @@ BeforeEach(ByteStuffer) { } AfterEach(ByteStuffer) {} -void validator_recv_frame(uint8_t* data, uint16_t size) { +void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { mock(data, size); } -void send_data(const uint8_t* data, uint16_t size) { +void send_data(uint8_t link, const uint8_t* data, uint16_t size) { memcpy(sent_data + sent_data_size, data, size); sent_data_size += size; } Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { never_expect(validator_recv_frame); - recv_byte(0); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { never_expect(validator_recv_frame); - recv_byte(0xFF); + recv_byte(0, 0xFF); } Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { never_expect(validator_recv_frame); - recv_byte(0x4A); + recv_byte(0, 0x4A); } Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { never_expect(validator_recv_frame); - recv_byte(1); - recv_byte(0); + recv_byte(0, 1); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_single_byte_valid_frame) { @@ -75,9 +75,9 @@ Ensure(ByteStuffer, receives_single_byte_valid_frame) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) ); - recv_byte(2); - recv_byte(0x37); - recv_byte(0); + recv_byte(0, 2); + recv_byte(0, 0x37); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_three_bytes_valid_frame) { @@ -86,11 +86,11 @@ Ensure(ByteStuffer, receives_three_bytes_valid_frame) { when(size, is_equal_to(3)), when(data, is_equal_to_contents_of(expected, 3)) ); - recv_byte(4); - recv_byte(0x37); - recv_byte(0x99); - recv_byte(0xFF); - recv_byte(0); + recv_byte(0, 4); + recv_byte(0, 0x37); + recv_byte(0, 0x99); + recv_byte(0, 0xFF); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_single_zero_valid_frame) { @@ -99,9 +99,9 @@ Ensure(ByteStuffer, receives_single_zero_valid_frame) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) ); - recv_byte(1); - recv_byte(1); - recv_byte(0); + recv_byte(0, 1); + recv_byte(0, 1); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { @@ -110,12 +110,12 @@ Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { when(size, is_equal_to(4)), when(data, is_equal_to_contents_of(expected, 4)) ); - recv_byte(2); - recv_byte(5); - recv_byte(2); - recv_byte(3); - recv_byte(1); - recv_byte(0); + recv_byte(0, 2); + recv_byte(0, 5); + recv_byte(0, 2); + recv_byte(0, 3); + recv_byte(0, 1); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_two_valid_frames) { @@ -129,13 +129,13 @@ Ensure(ByteStuffer, receives_two_valid_frames) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected2, 1)) ); - recv_byte(2); - recv_byte(5); - recv_byte(1); - recv_byte(0); - recv_byte(2); - recv_byte(3); - recv_byte(0); + recv_byte(1, 2); + recv_byte(1, 5); + recv_byte(1, 1); + recv_byte(1, 0); + recv_byte(1, 2); + recv_byte(1, 3); + recv_byte(1, 0); } Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { @@ -144,13 +144,13 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) ); - recv_byte(3); - recv_byte(1); - recv_byte(0); - recv_byte(3); - recv_byte(5); - recv_byte(7); - recv_byte(0); + recv_byte(1, 3); + recv_byte(1, 1); + recv_byte(1, 0); + recv_byte(1, 3); + recv_byte(1, 5); + recv_byte(1, 7); + recv_byte(1, 0); } Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { @@ -159,14 +159,14 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) ); - recv_byte(2); - recv_byte(9); - recv_byte(4); // This should have been zero - recv_byte(0); - recv_byte(3); - recv_byte(5); - recv_byte(7); - recv_byte(0); + recv_byte(0, 2); + recv_byte(0, 9); + recv_byte(0, 4); // This should have been zero + recv_byte(0, 0); + recv_byte(0, 3); + recv_byte(0, 5); + recv_byte(0, 7); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) { @@ -179,11 +179,11 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_ when(size, is_equal_to(254)), when(data, is_equal_to_contents_of(expected, 254)) ); - recv_byte(0xFF); + recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(i+1); + recv_byte(0, i+1); } - recv_byte(0); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) { @@ -197,13 +197,13 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) ); - recv_byte(0xFF); + recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(i+1); + recv_byte(0, i+1); } - recv_byte(2); - recv_byte(7); - recv_byte(0); + recv_byte(0, 2); + recv_byte(0, 7); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) { @@ -217,13 +217,13 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) ); - recv_byte(0xFF); + recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(i+1); + recv_byte(0, i+1); } - recv_byte(1); - recv_byte(1); - recv_byte(0); + recv_byte(0, 1); + recv_byte(0, 1); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { @@ -242,23 +242,23 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { when(size, is_equal_to(515)), when(data, is_equal_to_contents_of(expected, 510)) ); - recv_byte(0xFF); + recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(i+1); + recv_byte(0, i+1); } - recv_byte(0xFF); + recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(i+1); + recv_byte(0, i+1); } - recv_byte(8); - recv_byte(1); - recv_byte(2); - recv_byte(3); - recv_byte(4); - recv_byte(5); - recv_byte(6); - recv_byte(7); - recv_byte(0); + recv_byte(0, 8); + recv_byte(0, 1); + recv_byte(0, 2); + recv_byte(0, 3); + recv_byte(0, 4); + recv_byte(0, 5); + recv_byte(0, 6); + recv_byte(0, 7); + recv_byte(0, 0); } Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { @@ -268,23 +268,23 @@ Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) ); int i; - recv_byte(1); + recv_byte(0, 1); for(i=0;i #include "protocol/frame_validator.c" -void route_incoming_frame(uint8_t* data, uint16_t size) { +void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size) { mock(data, size); } -void send_frame(uint8_t* data, uint16_t size) { +void send_frame(uint8_t link, uint8_t* data, uint16_t size) { mock(data, size); } @@ -41,10 +41,10 @@ AfterEach(FrameValidator) {} Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { never_expect(route_incoming_frame); uint8_t data[] = {1, 2}; - validator_recv_frame(0, 1); - validator_recv_frame(data, 2); - validator_recv_frame(data, 3); - validator_recv_frame(data, 4); + validator_recv_frame(0, 0, 1); + validator_recv_frame(0, data, 2); + validator_recv_frame(0, data, 3); + validator_recv_frame(0, data, 4); } Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) { @@ -53,13 +53,13 @@ Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(data, 1)) ); - validator_recv_frame(data, 5); + validator_recv_frame(0, data, 5); } Ensure(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) { uint8_t data[] = {0x44, 0, 0, 0, 0}; never_expect(route_incoming_frame); - validator_recv_frame(data, 5); + validator_recv_frame(1, data, 5); } Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { @@ -68,7 +68,7 @@ Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { when(size, is_equal_to(4)), when(data, is_equal_to_contents_of(data, 4)) ); - validator_recv_frame(data, 8); + validator_recv_frame(1, data, 8); } Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { @@ -77,7 +77,7 @@ Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { when(size, is_equal_to(5)), when(data, is_equal_to_contents_of(data, 5)) ); - validator_recv_frame(data, 9); + validator_recv_frame(0, data, 9); } Ensure(FrameValidator, sends_one_byte_with_correct_crc) { @@ -87,7 +87,7 @@ Ensure(FrameValidator, sends_one_byte_with_correct_crc) { when(size, is_equal_to(sizeof(expected))), when(data, is_equal_to_contents_of(expected, sizeof(expected))) ); - validator_send_frame(original, 1); + validator_send_frame(0, original, 1); } Ensure(FrameValidator, sends_five_bytes_with_correct_crc) { @@ -97,5 +97,5 @@ Ensure(FrameValidator, sends_five_bytes_with_correct_crc) { when(size, is_equal_to(sizeof(expected))), when(data, is_equal_to_contents_of(expected, sizeof(expected))) ); - validator_send_frame(original, 5); + validator_send_frame(0, original, 5); } -- cgit v1.2.3-24-g4f1b From 4b9fccc75633b4ea297de373d5d7f01288d2fb11 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Feb 2016 13:59:48 +0200 Subject: Start implement router --- serial_link/protocol/byte_stuffer.c | 4 +- serial_link/protocol/byte_stuffer.h | 4 +- serial_link/protocol/frame_router.c | 33 +++++ serial_link/protocol/frame_router.h | 4 + serial_link/protocol/frame_validator.c | 2 +- serial_link/tests/byte_stuffer_tests.c | 208 +++++++++++++++--------------- serial_link/tests/frame_router_tests.c | 89 +++++++++++++ serial_link/tests/frame_validator_tests.c | 6 +- 8 files changed, 238 insertions(+), 112 deletions(-) create mode 100644 serial_link/protocol/frame_router.c create mode 100644 serial_link/tests/frame_router_tests.c diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index 05b7aa6f8..8b529667f 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -56,7 +56,7 @@ void init_byte_stuffer(void) { } } -void recv_byte(uint8_t link, uint8_t data) { +void byte_stuffer_recv_byte(uint8_t link, uint8_t data) { byte_stuffer_state_t* state = &states[link]; // Start of a new frame if (state->next_zero == 0) { @@ -112,7 +112,7 @@ static void send_block(uint8_t link, uint8_t* start, uint8_t* end, uint8_t num_n } } -void send_frame(uint8_t link, uint8_t* data, uint16_t size) { +void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size) { const uint8_t zero = 0; if (size > 0) { uint16_t num_non_zero = 1; diff --git a/serial_link/protocol/byte_stuffer.h b/serial_link/protocol/byte_stuffer.h index cd94b4582..839a876fe 100644 --- a/serial_link/protocol/byte_stuffer.h +++ b/serial_link/protocol/byte_stuffer.h @@ -23,5 +23,5 @@ SOFTWARE. */ void init_byte_stuffer(void); -void recv_byte(uint8_t link, uint8_t data); -void send_frame(uint8_t link, uint8_t* data, uint16_t size); +void byte_stuffer_recv_byte(uint8_t link, uint8_t data); +void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/frame_router.c b/serial_link/protocol/frame_router.c new file mode 100644 index 000000000..db6223a8d --- /dev/null +++ b/serial_link/protocol/frame_router.c @@ -0,0 +1,33 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "protocol/frame_router.h" + +void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ + validator_send_frame(DOWN_LINK, data, size); +} + +void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { + validator_send_frame(DOWN_LINK, data, size); +} diff --git a/serial_link/protocol/frame_router.h b/serial_link/protocol/frame_router.h index 3906b06c7..a0238079e 100644 --- a/serial_link/protocol/frame_router.h +++ b/serial_link/protocol/frame_router.h @@ -22,4 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#define UP_LINK 0 +#define DOWN_LINK 1 + void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size); +void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index 80e662b2e..a3face650 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -116,5 +116,5 @@ void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size) { uint32_t crc = crc32_byte(data, size); memcpy(data + size, &crc, 4); - send_frame(link, data, size + 4); + byte_stuffer_send_frame(link, data, size + 4); } diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 0f58479cb..912c4d321 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -50,23 +50,23 @@ void send_data(uint8_t link, const uint8_t* data, uint16_t size) { Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { never_expect(validator_recv_frame); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { never_expect(validator_recv_frame); - recv_byte(0, 0xFF); + byte_stuffer_recv_byte(0, 0xFF); } Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { never_expect(validator_recv_frame); - recv_byte(0, 0x4A); + byte_stuffer_recv_byte(0, 0x4A); } Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { never_expect(validator_recv_frame); - recv_byte(0, 1); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_single_byte_valid_frame) { @@ -75,9 +75,9 @@ Ensure(ByteStuffer, receives_single_byte_valid_frame) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) ); - recv_byte(0, 2); - recv_byte(0, 0x37); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 0x37); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_three_bytes_valid_frame) { @@ -86,11 +86,11 @@ Ensure(ByteStuffer, receives_three_bytes_valid_frame) { when(size, is_equal_to(3)), when(data, is_equal_to_contents_of(expected, 3)) ); - recv_byte(0, 4); - recv_byte(0, 0x37); - recv_byte(0, 0x99); - recv_byte(0, 0xFF); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 4); + byte_stuffer_recv_byte(0, 0x37); + byte_stuffer_recv_byte(0, 0x99); + byte_stuffer_recv_byte(0, 0xFF); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_single_zero_valid_frame) { @@ -99,9 +99,9 @@ Ensure(ByteStuffer, receives_single_zero_valid_frame) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected, 1)) ); - recv_byte(0, 1); - recv_byte(0, 1); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { @@ -110,12 +110,12 @@ Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { when(size, is_equal_to(4)), when(data, is_equal_to_contents_of(expected, 4)) ); - recv_byte(0, 2); - recv_byte(0, 5); - recv_byte(0, 2); - recv_byte(0, 3); - recv_byte(0, 1); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 5); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 3); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_two_valid_frames) { @@ -129,13 +129,13 @@ Ensure(ByteStuffer, receives_two_valid_frames) { when(size, is_equal_to(1)), when(data, is_equal_to_contents_of(expected2, 1)) ); - recv_byte(1, 2); - recv_byte(1, 5); - recv_byte(1, 1); - recv_byte(1, 0); - recv_byte(1, 2); - recv_byte(1, 3); - recv_byte(1, 0); + byte_stuffer_recv_byte(1, 2); + byte_stuffer_recv_byte(1, 5); + byte_stuffer_recv_byte(1, 1); + byte_stuffer_recv_byte(1, 0); + byte_stuffer_recv_byte(1, 2); + byte_stuffer_recv_byte(1, 3); + byte_stuffer_recv_byte(1, 0); } Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { @@ -144,13 +144,13 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) ); - recv_byte(1, 3); - recv_byte(1, 1); - recv_byte(1, 0); - recv_byte(1, 3); - recv_byte(1, 5); - recv_byte(1, 7); - recv_byte(1, 0); + byte_stuffer_recv_byte(1, 3); + byte_stuffer_recv_byte(1, 1); + byte_stuffer_recv_byte(1, 0); + byte_stuffer_recv_byte(1, 3); + byte_stuffer_recv_byte(1, 5); + byte_stuffer_recv_byte(1, 7); + byte_stuffer_recv_byte(1, 0); } Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { @@ -159,14 +159,14 @@ Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { when(size, is_equal_to(2)), when(data, is_equal_to_contents_of(expected, 2)) ); - recv_byte(0, 2); - recv_byte(0, 9); - recv_byte(0, 4); // This should have been zero - recv_byte(0, 0); - recv_byte(0, 3); - recv_byte(0, 5); - recv_byte(0, 7); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 9); + byte_stuffer_recv_byte(0, 4); // This should have been zero + byte_stuffer_recv_byte(0, 0); + byte_stuffer_recv_byte(0, 3); + byte_stuffer_recv_byte(0, 5); + byte_stuffer_recv_byte(0, 7); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) { @@ -179,11 +179,11 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_ when(size, is_equal_to(254)), when(data, is_equal_to_contents_of(expected, 254)) ); - recv_byte(0, 0xFF); + byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(0, i+1); + byte_stuffer_recv_byte(0, i+1); } - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) { @@ -197,13 +197,13 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) ); - recv_byte(0, 0xFF); + byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(0, i+1); + byte_stuffer_recv_byte(0, i+1); } - recv_byte(0, 2); - recv_byte(0, 7); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 7); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) { @@ -217,13 +217,13 @@ Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_ when(size, is_equal_to(255)), when(data, is_equal_to_contents_of(expected, 255)) ); - recv_byte(0, 0xFF); + byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(0, i+1); + byte_stuffer_recv_byte(0, i+1); } - recv_byte(0, 1); - recv_byte(0, 1); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { @@ -242,23 +242,23 @@ Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { when(size, is_equal_to(515)), when(data, is_equal_to_contents_of(expected, 510)) ); - recv_byte(0, 0xFF); + byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(0, i+1); + byte_stuffer_recv_byte(0, i+1); } - recv_byte(0, 0xFF); + byte_stuffer_recv_byte(0, 0xFF); for (i=0;i<254;i++) { - recv_byte(0, i+1); + byte_stuffer_recv_byte(0, i+1); } - recv_byte(0, 8); - recv_byte(0, 1); - recv_byte(0, 2); - recv_byte(0, 3); - recv_byte(0, 4); - recv_byte(0, 5); - recv_byte(0, 6); - recv_byte(0, 7); - recv_byte(0, 0); + byte_stuffer_recv_byte(0, 8); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 3); + byte_stuffer_recv_byte(0, 4); + byte_stuffer_recv_byte(0, 5); + byte_stuffer_recv_byte(0, 6); + byte_stuffer_recv_byte(0, 7); + byte_stuffer_recv_byte(0, 0); } Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { @@ -268,23 +268,23 @@ Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) ); int i; - recv_byte(0, 1); + byte_stuffer_recv_byte(0, 1); for(i=0;i +#include +#include "protocol/byte_stuffer.c" +#include "protocol/frame_validator.c" +#include "protocol/frame_router.c" + +static uint8_t received_data[256]; +static uint16_t received_data_size; + +typedef struct { + uint8_t received_data[256]; + uint16_t sent_data_size; +} receive_buffer_t; + +typedef struct { + receive_buffer_t send_buffers[2]; +} router_buffer_t; + +router_buffer_t router_buffers[8]; + +router_buffer_t* current_router_buffer; + + +Describe(ByteStuffer); +BeforeEach(ByteStuffer) { + init_byte_stuffer(); + memset(router_buffers, 0, sizeof(router_buffers)); + current_router_buffer = 0; +} +AfterEach(ByteStuffer) {} + +typedef struct { + uint32_t data; + uint8_t extra[16]; +} frame_buffer_t; + + +void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + receive_buffer_t* buffer = ¤t_router_buffer->send_buffers[link]; + memcpy(buffer->received_data + buffer->sent_data_size, data, size); + buffer->sent_data_size += size; +} + +static void receive_data(uint8_t link, uint8_t* data, uint16_t size) { + int i; + for(i=0;i Date: Sat, 20 Feb 2016 14:32:26 +0200 Subject: Add complete master broadcast test --- serial_link/protocol/frame_router.c | 8 ++++++ serial_link/protocol/frame_router.h | 1 + serial_link/protocol/transport.h | 25 +++++++++++++++++++ serial_link/tests/frame_router_tests.c | 45 +++++++++++++++++++++++++++++----- 4 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 serial_link/protocol/transport.h diff --git a/serial_link/protocol/frame_router.c b/serial_link/protocol/frame_router.c index db6223a8d..0675cea28 100644 --- a/serial_link/protocol/frame_router.c +++ b/serial_link/protocol/frame_router.c @@ -23,8 +23,16 @@ SOFTWARE. */ #include "protocol/frame_router.h" +#include "protocol/transport.h" + +static bool is_master; + +void router_set_master(bool master) { + is_master = master; +} void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ + transport_recv_frame(0, data, size); validator_send_frame(DOWN_LINK, data, size); } diff --git a/serial_link/protocol/frame_router.h b/serial_link/protocol/frame_router.h index a0238079e..67db3122f 100644 --- a/serial_link/protocol/frame_router.h +++ b/serial_link/protocol/frame_router.h @@ -25,5 +25,6 @@ SOFTWARE. #define UP_LINK 0 #define DOWN_LINK 1 +void router_set_master(bool master); void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size); void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size); diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h new file mode 100644 index 000000000..a40d64d41 --- /dev/null +++ b/serial_link/protocol/transport.h @@ -0,0 +1,25 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); diff --git a/serial_link/tests/frame_router_tests.c b/serial_link/tests/frame_router_tests.c index 5ce6c9c0f..eb0c710ea 100644 --- a/serial_link/tests/frame_router_tests.c +++ b/serial_link/tests/frame_router_tests.c @@ -27,12 +27,13 @@ SOFTWARE. #include "protocol/byte_stuffer.c" #include "protocol/frame_validator.c" #include "protocol/frame_router.c" +#include "protocol/transport.h" static uint8_t received_data[256]; static uint16_t received_data_size; typedef struct { - uint8_t received_data[256]; + uint8_t sent_data[256]; uint16_t sent_data_size; } receive_buffer_t; @@ -61,7 +62,7 @@ typedef struct { void send_data(uint8_t link, const uint8_t* data, uint16_t size) { receive_buffer_t* buffer = ¤t_router_buffer->send_buffers[link]; - memcpy(buffer->received_data + buffer->sent_data_size, data, size); + memcpy(buffer->sent_data + buffer->sent_data_size, data, size); buffer->sent_data_size += size; } @@ -72,18 +73,50 @@ static void receive_data(uint8_t link, uint8_t* data, uint16_t size) { } } +static void activate_router(uint8_t num) { + current_router_buffer = router_buffers + num; + router_set_master(num==0); +} + +static void simulate_transport(uint8_t from, uint8_t to) { + activate_router(to); + if (from > to) { + } + else if(to > from) { + receive_data(UP_LINK, + router_buffers[from].send_buffers[DOWN_LINK].sent_data, + router_buffers[from].send_buffers[DOWN_LINK].sent_data_size); + } +} + +void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { + mock(from, data, size); +} + Ensure(ByteStuffer, master_broadcast_is_received_by_everyone) { frame_buffer_t data; data.data = 0xAB7055BB; - current_router_buffer = router_buffers + 0; + activate_router(0); router_send_frame(0xFF, (uint8_t*)&data, 4); assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - current_router_buffer = router_buffers + 1; - receive_data(UP_LINK, router_buffers[0].send_buffers[DOWN_LINK].received_data, - router_buffers[0].send_buffers[DOWN_LINK].sent_data_size); + expect(transport_recv_frame, + when(from, is_equal_to(0)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(0, 1); assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(0)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(1, 2); + assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); } -- cgit v1.2.3-24-g4f1b From 82b5037b9db628c3f34d8fb38848753ff3e41e2f Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Feb 2016 14:52:17 +0200 Subject: Add master send to specific destinations --- serial_link/protocol/frame_router.c | 8 ++++++-- serial_link/tests/frame_router_tests.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/serial_link/protocol/frame_router.c b/serial_link/protocol/frame_router.c index 0675cea28..861c0d7d2 100644 --- a/serial_link/protocol/frame_router.c +++ b/serial_link/protocol/frame_router.c @@ -32,10 +32,14 @@ void router_set_master(bool master) { } void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ - transport_recv_frame(0, data, size); + if (data[size-1] & 1) { + transport_recv_frame(0, data, size - 1); + } + data[size-1] >>= 1; validator_send_frame(DOWN_LINK, data, size); } void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { - validator_send_frame(DOWN_LINK, data, size); + data[size] = destination; + validator_send_frame(DOWN_LINK, data, size + 1); } diff --git a/serial_link/tests/frame_router_tests.c b/serial_link/tests/frame_router_tests.c index eb0c710ea..7a4ccb0c4 100644 --- a/serial_link/tests/frame_router_tests.c +++ b/serial_link/tests/frame_router_tests.c @@ -120,3 +120,35 @@ Ensure(ByteStuffer, master_broadcast_is_received_by_everyone) { assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); } + +Ensure(ByteStuffer, master_send_is_received_by_targets) { + printf("Here\n"); + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(0); + router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + simulate_transport(0, 1); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(0)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(1, 2); + assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(0)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(2, 3); + assert_that(router_buffers[3].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[3].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); +} -- cgit v1.2.3-24-g4f1b From c28e19c5467e92f532f64db020ad4817b531dbec Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Feb 2016 15:02:53 +0200 Subject: First link sending to master --- serial_link/protocol/frame_router.c | 22 ++++++++++++++++------ serial_link/tests/frame_router_tests.c | 32 ++++++++++++++++++++++++++------ 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/serial_link/protocol/frame_router.c b/serial_link/protocol/frame_router.c index 861c0d7d2..480673f0c 100644 --- a/serial_link/protocol/frame_router.c +++ b/serial_link/protocol/frame_router.c @@ -32,14 +32,24 @@ void router_set_master(bool master) { } void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ - if (data[size-1] & 1) { - transport_recv_frame(0, data, size - 1); + if (is_master) { + transport_recv_frame(1, data, size); + } + else { + if (data[size-1] & 1) { + transport_recv_frame(0, data, size - 1); + } + data[size-1] >>= 1; + validator_send_frame(DOWN_LINK, data, size); } - data[size-1] >>= 1; - validator_send_frame(DOWN_LINK, data, size); } void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { - data[size] = destination; - validator_send_frame(DOWN_LINK, data, size + 1); + if (destination == 0) { + validator_send_frame(UP_LINK, data, size); + } + else { + data[size] = destination; + validator_send_frame(DOWN_LINK, data, size + 1); + } } diff --git a/serial_link/tests/frame_router_tests.c b/serial_link/tests/frame_router_tests.c index 7a4ccb0c4..02e6367d2 100644 --- a/serial_link/tests/frame_router_tests.c +++ b/serial_link/tests/frame_router_tests.c @@ -46,13 +46,13 @@ router_buffer_t router_buffers[8]; router_buffer_t* current_router_buffer; -Describe(ByteStuffer); -BeforeEach(ByteStuffer) { +Describe(FrameRouter); +BeforeEach(FrameRouter) { init_byte_stuffer(); memset(router_buffers, 0, sizeof(router_buffers)); current_router_buffer = 0; } -AfterEach(ByteStuffer) {} +AfterEach(FrameRouter) {} typedef struct { uint32_t data; @@ -81,6 +81,9 @@ static void activate_router(uint8_t num) { static void simulate_transport(uint8_t from, uint8_t to) { activate_router(to); if (from > to) { + receive_data(DOWN_LINK, + router_buffers[from].send_buffers[UP_LINK].sent_data, + router_buffers[from].send_buffers[UP_LINK].sent_data_size); } else if(to > from) { receive_data(UP_LINK, @@ -94,7 +97,7 @@ void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { } -Ensure(ByteStuffer, master_broadcast_is_received_by_everyone) { +Ensure(FrameRouter, master_broadcast_is_received_by_everyone) { frame_buffer_t data; data.data = 0xAB7055BB; activate_router(0); @@ -121,8 +124,7 @@ Ensure(ByteStuffer, master_broadcast_is_received_by_everyone) { assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); } -Ensure(ByteStuffer, master_send_is_received_by_targets) { - printf("Here\n"); +Ensure(FrameRouter, master_send_is_received_by_targets) { frame_buffer_t data; data.data = 0xAB7055BB; activate_router(0); @@ -152,3 +154,21 @@ Ensure(ByteStuffer, master_send_is_received_by_targets) { assert_that(router_buffers[3].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); assert_that(router_buffers[3].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); } + +Ensure(FrameRouter, first_sends_to_master) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(1); + router_send_frame(0, (uint8_t*)&data, 4); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(1)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(1, 0); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); +} -- cgit v1.2.3-24-g4f1b From 532f98eef6a29ae83d7ed61fbc4e25e23ad972d5 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Feb 2016 15:14:40 +0200 Subject: Support for other links sending to master --- serial_link/protocol/frame_router.c | 19 +++++++++++++------ serial_link/tests/frame_router_tests.c | 25 ++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/serial_link/protocol/frame_router.c b/serial_link/protocol/frame_router.c index 480673f0c..c61c50ebd 100644 --- a/serial_link/protocol/frame_router.c +++ b/serial_link/protocol/frame_router.c @@ -33,20 +33,27 @@ void router_set_master(bool master) { void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ if (is_master) { - transport_recv_frame(1, data, size); + transport_recv_frame(data[size-1], data, size - 1); } else { - if (data[size-1] & 1) { - transport_recv_frame(0, data, size - 1); + if (link == UP_LINK) { + if (data[size-1] & 1) { + transport_recv_frame(0, data, size - 1); + } + data[size-1] >>= 1; + validator_send_frame(DOWN_LINK, data, size); + } + else { + data[size-1]++; + validator_send_frame(UP_LINK, data, size); } - data[size-1] >>= 1; - validator_send_frame(DOWN_LINK, data, size); } } void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { if (destination == 0) { - validator_send_frame(UP_LINK, data, size); + data[size] = 1; + validator_send_frame(UP_LINK, data, size + 1); } else { data[size] = destination; diff --git a/serial_link/tests/frame_router_tests.c b/serial_link/tests/frame_router_tests.c index 02e6367d2..6b00aca67 100644 --- a/serial_link/tests/frame_router_tests.c +++ b/serial_link/tests/frame_router_tests.c @@ -155,7 +155,7 @@ Ensure(FrameRouter, master_send_is_received_by_targets) { assert_that(router_buffers[3].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); } -Ensure(FrameRouter, first_sends_to_master) { +Ensure(FrameRouter, first_link_sends_to_master) { frame_buffer_t data; data.data = 0xAB7055BB; activate_router(1); @@ -172,3 +172,26 @@ Ensure(FrameRouter, first_sends_to_master) { assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); } + +Ensure(FrameRouter, second_link_sends_to_master) { + printf("Second to master start\n"); + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(2); + router_send_frame(0, (uint8_t*)&data, 4); + assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + + simulate_transport(2, 1); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(2)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(1, 0); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); +} -- cgit v1.2.3-24-g4f1b From ea346125e8ef0c14e1566070380ec777d4a1a56a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Feb 2016 15:28:42 +0200 Subject: Add some validation for invalid router destinations --- serial_link/protocol/frame_router.c | 16 ++++++++++----- serial_link/tests/frame_router_tests.c | 36 +++++++++++++++++++++++++++++++++- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/serial_link/protocol/frame_router.c b/serial_link/protocol/frame_router.c index c61c50ebd..890ebbe9e 100644 --- a/serial_link/protocol/frame_router.c +++ b/serial_link/protocol/frame_router.c @@ -33,7 +33,9 @@ void router_set_master(bool master) { void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ if (is_master) { - transport_recv_frame(data[size-1], data, size - 1); + if (link == DOWN_LINK) { + transport_recv_frame(data[size-1], data, size - 1); + } } else { if (link == UP_LINK) { @@ -52,11 +54,15 @@ void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { if (destination == 0) { - data[size] = 1; - validator_send_frame(UP_LINK, data, size + 1); + if (!is_master) { + data[size] = 1; + validator_send_frame(UP_LINK, data, size + 1); + } } else { - data[size] = destination; - validator_send_frame(DOWN_LINK, data, size + 1); + if (is_master) { + data[size] = destination; + validator_send_frame(DOWN_LINK, data, size + 1); + } } } diff --git a/serial_link/tests/frame_router_tests.c b/serial_link/tests/frame_router_tests.c index 6b00aca67..0b0ea6e7f 100644 --- a/serial_link/tests/frame_router_tests.c +++ b/serial_link/tests/frame_router_tests.c @@ -174,7 +174,6 @@ Ensure(FrameRouter, first_link_sends_to_master) { } Ensure(FrameRouter, second_link_sends_to_master) { - printf("Second to master start\n"); frame_buffer_t data; data.data = 0xAB7055BB; activate_router(2); @@ -195,3 +194,38 @@ Ensure(FrameRouter, second_link_sends_to_master) { assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); } + +Ensure(FrameRouter, master_sends_to_master_does_nothing) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(0); + router_send_frame(0, (uint8_t*)&data, 4); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); +} + +Ensure(FrameRouter, link_sends_to_other_link_does_nothing) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(1); + router_send_frame(2, (uint8_t*)&data, 4); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); +} + +Ensure(FrameRouter, master_receives_on_uplink_does_nothing) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(1); + router_send_frame(0, (uint8_t*)&data, 4); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + + never_expect(transport_recv_frame); + activate_router(0); + receive_data(UP_LINK, + router_buffers[1].send_buffers[UP_LINK].sent_data, + router_buffers[1].send_buffers[UP_LINK].sent_data_size); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); +} -- cgit v1.2.3-24-g4f1b From c78eefba498ffafc3cb577a72492256849384de6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Feb 2016 15:49:31 +0200 Subject: Add first transport tests --- serial_link/protocol/transport.c | 39 +++++++++++++++++++++++++++++++++++++ serial_link/protocol/transport.h | 2 ++ serial_link/tests/transport_tests.c | 39 +++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 serial_link/protocol/transport.c create mode 100644 serial_link/tests/transport_tests.c diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c new file mode 100644 index 000000000..399894ff9 --- /dev/null +++ b/serial_link/protocol/transport.c @@ -0,0 +1,39 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "protocol/transport.h" + +static uint32_t current_send_frame; + +void init_transport(void) { + current_send_frame = 0; +} + +void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { + +} + +uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size) { + return ++current_send_frame; +} diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index a40d64d41..01119857d 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -22,4 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +void init_transport(void); void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); +uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size); diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c new file mode 100644 index 000000000..a64e7446d --- /dev/null +++ b/serial_link/tests/transport_tests.c @@ -0,0 +1,39 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include "protocol/transport.c" + +Describe(Transport); +BeforeEach(Transport) { + init_transport(); +} +AfterEach(Transport) {} + +Ensure(Transport, packet_number_is_sequential) { + assert_that(transport_send_frame(0, NULL, 0), is_equal_to(1)); + assert_that(transport_send_frame(0, NULL, 0), is_equal_to(2)); + // It doesn't matter if the destination changes + assert_that(transport_send_frame(1, NULL, 0), is_equal_to(3)); +} -- cgit v1.2.3-24-g4f1b From 50edb3d90c0076eb088f79564e38382452a21d03 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Feb 2016 22:22:42 +0200 Subject: Add first version of triple buffered object --- serial_link/protocol/triple_buffered_object.c | 33 ++++++++++++++++++ serial_link/protocol/triple_buffered_object.h | 37 ++++++++++++++++++++ serial_link/tests/triple_buffered_object_tests.c | 44 ++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 serial_link/protocol/triple_buffered_object.c create mode 100644 serial_link/protocol/triple_buffered_object.h create mode 100644 serial_link/tests/triple_buffered_object_tests.c diff --git a/serial_link/protocol/triple_buffered_object.c b/serial_link/protocol/triple_buffered_object.c new file mode 100644 index 000000000..f5600364f --- /dev/null +++ b/serial_link/protocol/triple_buffered_object.c @@ -0,0 +1,33 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "protocol/triple_buffered_object.h" + +void triple_buffer_write(uint16_t object_size, triple_buffer_object_t* object, void* src) { + memcpy(object->buffer, src, object_size); +} + +void triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { + memcpy(dst, object->buffer, object_size); +} diff --git a/serial_link/protocol/triple_buffered_object.h b/serial_link/protocol/triple_buffered_object.h new file mode 100644 index 000000000..ebdbcae79 --- /dev/null +++ b/serial_link/protocol/triple_buffered_object.h @@ -0,0 +1,37 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_TRIPLE_BUFFERED_OBJECT_H +#define SERIAL_LINK_TRIPLE_BUFFERED_OBJECT_H + +typedef struct { + uint8_t state; + uint8_t buffer[]; +}triple_buffer_object_t; + +void triple_buffer_write(uint16_t object_size, triple_buffer_object_t* object, void* src); +void triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst); + + +#endif diff --git a/serial_link/tests/triple_buffered_object_tests.c b/serial_link/tests/triple_buffered_object_tests.c new file mode 100644 index 000000000..66dcefa7f --- /dev/null +++ b/serial_link/tests/triple_buffered_object_tests.c @@ -0,0 +1,44 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include "protocol/triple_buffered_object.c" + +Describe(TripleBufferedObject); +BeforeEach(TripleBufferedObject) {} +AfterEach(TripleBufferedObject) {} + +typedef struct { + uint8_t state; + uint32_t buffer[3]; +}test_object_t; + +Ensure(TripleBufferedObject, writes_and_and_reads_object) { + test_object_t test_object; + uint32_t src = 0x3456ABCC; + uint32_t dst; + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); + assert_that(dst, is_equal_to(src)); +} -- cgit v1.2.3-24-g4f1b From 4bb5733cdca62350c900ce094e1cbbaae59f2246 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Feb 2016 23:40:52 +0200 Subject: Updates to triple buffer --- serial_link/protocol/triple_buffered_object.c | 54 +++++++++++++++++++++++- serial_link/tests/triple_buffered_object_tests.c | 48 ++++++++++++++++++--- 2 files changed, 94 insertions(+), 8 deletions(-) diff --git a/serial_link/protocol/triple_buffered_object.c b/serial_link/protocol/triple_buffered_object.c index f5600364f..a82cef5a6 100644 --- a/serial_link/protocol/triple_buffered_object.c +++ b/serial_link/protocol/triple_buffered_object.c @@ -24,10 +24,60 @@ SOFTWARE. #include "protocol/triple_buffered_object.h" +#define GET_READ_INDEX() object->state & 3 +#define GET_WRITE1_INDEX() (object->state >> 2) & 3 +#define GET_WRITE2_INDEX() (object->state >> 4) & 3 +#define GET_FREE_INDEX() (object->state >> 6) & 3 + +#define SET_READ_INDEX(i) object->state = ((object->state & ~3) | i) +#define SET_WRITE1_INDEX(i) object->state = ((object->state & ~(3 << 2)) | (i << 2)) +#define SET_WRITE2_INDEX(i) object->state = ((object->state & ~(3 << 4)) | (i << 4)) +#define SET_FREE_INDEX(i) object->state = ((object->state & ~(3 << 6)) | (i << 6)) + +void triple_buffer_init(triple_buffer_object_t* object) { + object->state = 0; + SET_WRITE1_INDEX(0); + SET_WRITE2_INDEX(0); + SET_READ_INDEX(1); + SET_FREE_INDEX(2); +} + +static void triple_buffer_begin_read(uint16_t object_size, triple_buffer_object_t* object) { + uint8_t newest = GET_WRITE2_INDEX(); + uint8_t free_index = GET_READ_INDEX(); + SET_READ_INDEX(newest); + SET_FREE_INDEX(free_index); +} + +static void triple_buffer_actual_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { + uint8_t read_index = GET_READ_INDEX(); + memcpy(dst, object->buffer + object_size*read_index, object_size); +} + +static void triple_buffer_end_read(uint16_t object_size, triple_buffer_object_t* object) { +} + void triple_buffer_write(uint16_t object_size, triple_buffer_object_t* object, void* src) { - memcpy(object->buffer, src, object_size); + uint8_t write1_index = GET_WRITE1_INDEX(); + uint8_t write2_index = GET_WRITE2_INDEX(); + uint8_t read_index = GET_READ_INDEX(); + uint8_t free_index = GET_FREE_INDEX(); + + if (write2_index == read_index) { + // We are reading from the other write index + SET_WRITE1_INDEX(free_index); + memcpy(object->buffer + object_size * free_index, src, object_size); + SET_WRITE2_INDEX(free_index); + } + else { + SET_WRITE1_INDEX(write2_index); + memcpy(object->buffer + object_size * write2_index, src, object_size); + SET_WRITE2_INDEX(write2_index); + } } void triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { - memcpy(dst, object->buffer, object_size); + triple_buffer_begin_read(object_size, object); + triple_buffer_actual_read(object_size, object, dst); + triple_buffer_end_read(object_size, object); } diff --git a/serial_link/tests/triple_buffered_object_tests.c b/serial_link/tests/triple_buffered_object_tests.c index 66dcefa7f..bf0e3ca67 100644 --- a/serial_link/tests/triple_buffered_object_tests.c +++ b/serial_link/tests/triple_buffered_object_tests.c @@ -25,20 +25,56 @@ SOFTWARE. #include #include "protocol/triple_buffered_object.c" -Describe(TripleBufferedObject); -BeforeEach(TripleBufferedObject) {} -AfterEach(TripleBufferedObject) {} - typedef struct { uint8_t state; uint32_t buffer[3]; }test_object_t; -Ensure(TripleBufferedObject, writes_and_and_reads_object) { - test_object_t test_object; +test_object_t test_object; + +Describe(TripleBufferedObject); +BeforeEach(TripleBufferedObject) { + triple_buffer_init((triple_buffer_object_t*)&test_object); +} +AfterEach(TripleBufferedObject) {} + + +Ensure(TripleBufferedObject, writes_and_reads_object) { + uint32_t src = 0x3456ABCC; + uint32_t dst; + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); + assert_that(dst, is_equal_to(src)); +} + +Ensure(TripleBufferedObject, writes_and_reads_object_decomposed) { + uint32_t src = 0x3456ABCC; + uint32_t dst; + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + triple_buffer_begin_read(4, (triple_buffer_object_t*)&test_object); + triple_buffer_actual_read(4, (triple_buffer_object_t*)&test_object, &dst); + triple_buffer_end_read(4, (triple_buffer_object_t*)&test_object); + assert_that(dst, is_equal_to(src)); +} + +Ensure(TripleBufferedObject, writes_twice_and_reads_object) { uint32_t src = 0x3456ABCC; uint32_t dst; triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + src = 0x44778899; + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); assert_that(dst, is_equal_to(src)); } + +Ensure(TripleBufferedObject, performs_another_write_in_the_middle_of_read) { + uint32_t src = 1; + uint32_t dst; + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + src = 2; + triple_buffer_begin_read(4, (triple_buffer_object_t*)&test_object); + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + triple_buffer_actual_read(4, (triple_buffer_object_t*)&test_object, &dst); + triple_buffer_end_read(4, (triple_buffer_object_t*)&test_object); + assert_that(dst, is_equal_to(1)); +} -- cgit v1.2.3-24-g4f1b From 8e2d70d11fd852cf6e33b48a027a5fba61c08779 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 00:44:25 +0200 Subject: Simplify the triple buffer implementation --- serial_link/protocol/triple_buffered_object.c | 46 ++++++++++-------------- serial_link/tests/triple_buffered_object_tests.c | 18 ++++++++++ 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/serial_link/protocol/triple_buffered_object.c b/serial_link/protocol/triple_buffered_object.c index a82cef5a6..77e45ec41 100644 --- a/serial_link/protocol/triple_buffered_object.c +++ b/serial_link/protocol/triple_buffered_object.c @@ -25,28 +25,28 @@ SOFTWARE. #include "protocol/triple_buffered_object.h" #define GET_READ_INDEX() object->state & 3 -#define GET_WRITE1_INDEX() (object->state >> 2) & 3 -#define GET_WRITE2_INDEX() (object->state >> 4) & 3 -#define GET_FREE_INDEX() (object->state >> 6) & 3 +#define GET_WRITE_INDEX() (object->state >> 2) & 3 +#define GET_SHARED_INDEX() (object->state >> 4) & 3 +#define GET_DATA_AVAILABLE() (object->state >> 6) & 1 #define SET_READ_INDEX(i) object->state = ((object->state & ~3) | i) -#define SET_WRITE1_INDEX(i) object->state = ((object->state & ~(3 << 2)) | (i << 2)) -#define SET_WRITE2_INDEX(i) object->state = ((object->state & ~(3 << 4)) | (i << 4)) -#define SET_FREE_INDEX(i) object->state = ((object->state & ~(3 << 6)) | (i << 6)) +#define SET_WRITE_INDEX(i) object->state = ((object->state & ~(3 << 2)) | (i << 2)) +#define SET_SHARED_INDEX(i) object->state = ((object->state & ~(3 << 4)) | (i << 4)) +#define SET_DATA_AVAILABLE(i) object->state = ((object->state & ~(1 << 6)) | (i << 6)) void triple_buffer_init(triple_buffer_object_t* object) { object->state = 0; - SET_WRITE1_INDEX(0); - SET_WRITE2_INDEX(0); + SET_WRITE_INDEX(0); SET_READ_INDEX(1); - SET_FREE_INDEX(2); + SET_SHARED_INDEX(2); + SET_DATA_AVAILABLE(0); } static void triple_buffer_begin_read(uint16_t object_size, triple_buffer_object_t* object) { - uint8_t newest = GET_WRITE2_INDEX(); - uint8_t free_index = GET_READ_INDEX(); - SET_READ_INDEX(newest); - SET_FREE_INDEX(free_index); + uint8_t shared_index = GET_SHARED_INDEX(); + uint8_t read_index = GET_READ_INDEX(); + SET_READ_INDEX(shared_index); + SET_SHARED_INDEX(read_index); } static void triple_buffer_actual_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { @@ -58,22 +58,12 @@ static void triple_buffer_end_read(uint16_t object_size, triple_buffer_object_t* } void triple_buffer_write(uint16_t object_size, triple_buffer_object_t* object, void* src) { - uint8_t write1_index = GET_WRITE1_INDEX(); - uint8_t write2_index = GET_WRITE2_INDEX(); - uint8_t read_index = GET_READ_INDEX(); - uint8_t free_index = GET_FREE_INDEX(); - if (write2_index == read_index) { - // We are reading from the other write index - SET_WRITE1_INDEX(free_index); - memcpy(object->buffer + object_size * free_index, src, object_size); - SET_WRITE2_INDEX(free_index); - } - else { - SET_WRITE1_INDEX(write2_index); - memcpy(object->buffer + object_size * write2_index, src, object_size); - SET_WRITE2_INDEX(write2_index); - } + uint8_t write_index = GET_WRITE_INDEX(); + memcpy(object->buffer + object_size * write_index, src, object_size); + uint8_t shared_index = GET_SHARED_INDEX(); + SET_SHARED_INDEX(write_index); + SET_WRITE_INDEX(shared_index); } void triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { diff --git a/serial_link/tests/triple_buffered_object_tests.c b/serial_link/tests/triple_buffered_object_tests.c index bf0e3ca67..5fa1b8b62 100644 --- a/serial_link/tests/triple_buffered_object_tests.c +++ b/serial_link/tests/triple_buffered_object_tests.c @@ -77,4 +77,22 @@ Ensure(TripleBufferedObject, performs_another_write_in_the_middle_of_read) { triple_buffer_actual_read(4, (triple_buffer_object_t*)&test_object, &dst); triple_buffer_end_read(4, (triple_buffer_object_t*)&test_object); assert_that(dst, is_equal_to(1)); + triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); + assert_that(dst, is_equal_to(2)); +} + +Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { + uint32_t src = 1; + uint32_t dst; + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + triple_buffer_begin_read(4, (triple_buffer_object_t*)&test_object); + src = 2; + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + src = 3; + triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); + triple_buffer_actual_read(4, (triple_buffer_object_t*)&test_object, &dst); + triple_buffer_end_read(4, (triple_buffer_object_t*)&test_object); + assert_that(dst, is_equal_to(1)); + triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); + assert_that(dst, is_equal_to(3)); } -- cgit v1.2.3-24-g4f1b From b7059d35f90a7cc8b07944d78984afa832190bdc Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 01:07:44 +0200 Subject: Working triple buffering --- serial_link/protocol/triple_buffered_object.c | 37 ++++++++++++++++++------ serial_link/protocol/triple_buffered_object.h | 3 +- serial_link/system/system.h | 36 +++++++++++++++++++++++ serial_link/tests/triple_buffered_object_tests.c | 8 +++++ 4 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 serial_link/system/system.h diff --git a/serial_link/protocol/triple_buffered_object.c b/serial_link/protocol/triple_buffered_object.c index 77e45ec41..3fabb7d84 100644 --- a/serial_link/protocol/triple_buffered_object.c +++ b/serial_link/protocol/triple_buffered_object.c @@ -23,6 +23,7 @@ SOFTWARE. */ #include "protocol/triple_buffered_object.h" +#include "system/system.h" #define GET_READ_INDEX() object->state & 3 #define GET_WRITE_INDEX() (object->state >> 2) & 3 @@ -42,11 +43,21 @@ void triple_buffer_init(triple_buffer_object_t* object) { SET_DATA_AVAILABLE(0); } -static void triple_buffer_begin_read(uint16_t object_size, triple_buffer_object_t* object) { - uint8_t shared_index = GET_SHARED_INDEX(); - uint8_t read_index = GET_READ_INDEX(); - SET_READ_INDEX(shared_index); - SET_SHARED_INDEX(read_index); +static bool triple_buffer_begin_read(uint16_t object_size, triple_buffer_object_t* object) { + serial_link_lock(); + if (GET_DATA_AVAILABLE()) { + uint8_t shared_index = GET_SHARED_INDEX(); + uint8_t read_index = GET_READ_INDEX(); + SET_READ_INDEX(shared_index); + SET_SHARED_INDEX(read_index); + SET_DATA_AVAILABLE(false); + serial_link_unlock(); + return true; + } + else { + serial_link_unlock(); + return false; + } } static void triple_buffer_actual_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { @@ -61,13 +72,21 @@ void triple_buffer_write(uint16_t object_size, triple_buffer_object_t* object, v uint8_t write_index = GET_WRITE_INDEX(); memcpy(object->buffer + object_size * write_index, src, object_size); + serial_link_lock(); uint8_t shared_index = GET_SHARED_INDEX(); SET_SHARED_INDEX(write_index); SET_WRITE_INDEX(shared_index); + SET_DATA_AVAILABLE(true); + serial_link_unlock(); } -void triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { - triple_buffer_begin_read(object_size, object); - triple_buffer_actual_read(object_size, object, dst); - triple_buffer_end_read(object_size, object); +bool triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { + if (triple_buffer_begin_read(object_size, object)) { + triple_buffer_actual_read(object_size, object, dst); + triple_buffer_end_read(object_size, object); + return true; + } + else { + return false; + } } diff --git a/serial_link/protocol/triple_buffered_object.h b/serial_link/protocol/triple_buffered_object.h index ebdbcae79..705f0c49f 100644 --- a/serial_link/protocol/triple_buffered_object.h +++ b/serial_link/protocol/triple_buffered_object.h @@ -30,8 +30,9 @@ typedef struct { uint8_t buffer[]; }triple_buffer_object_t; +void triple_buffer_init(triple_buffer_object_t* object); void triple_buffer_write(uint16_t object_size, triple_buffer_object_t* object, void* src); -void triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst); +bool triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst); #endif diff --git a/serial_link/system/system.h b/serial_link/system/system.h new file mode 100644 index 000000000..c798e6477 --- /dev/null +++ b/serial_link/system/system.h @@ -0,0 +1,36 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_SYSTEM_H +#define SERIAL_LINK_SYSTEM_H + +void serial_link_lock() { + +} + +void serial_link_unlock() { + +} + +#endif diff --git a/serial_link/tests/triple_buffered_object_tests.c b/serial_link/tests/triple_buffered_object_tests.c index 5fa1b8b62..cd3ecb6a2 100644 --- a/serial_link/tests/triple_buffered_object_tests.c +++ b/serial_link/tests/triple_buffered_object_tests.c @@ -47,6 +47,12 @@ Ensure(TripleBufferedObject, writes_and_reads_object) { assert_that(dst, is_equal_to(src)); } +Ensure(TripleBufferedObject, does_not_read_empty) { + uint32_t dst; + bool res = triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); + assert_that(res, is_equal_to(false)); +} + Ensure(TripleBufferedObject, writes_and_reads_object_decomposed) { uint32_t src = 0x3456ABCC; uint32_t dst; @@ -79,6 +85,7 @@ Ensure(TripleBufferedObject, performs_another_write_in_the_middle_of_read) { assert_that(dst, is_equal_to(1)); triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); assert_that(dst, is_equal_to(2)); + assert_that(triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst), is_equal_to(false)); } Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { @@ -95,4 +102,5 @@ Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { assert_that(dst, is_equal_to(1)); triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); assert_that(dst, is_equal_to(3)); + assert_that(triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst), is_equal_to(false)); } -- cgit v1.2.3-24-g4f1b From 4ee6eadf9e88b89f017c3c06e2d376cf953f6a42 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 12:53:51 +0200 Subject: Local and remote objects WIP --- serial_link/protocol/transport.h | 67 +++++++++++++++++++++++++++ serial_link/protocol/triple_buffered_object.h | 2 +- serial_link/tests/transport_tests.c | 26 +++++++++++ 3 files changed, 94 insertions(+), 1 deletion(-) diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index 01119857d..6f2cf277f 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -22,6 +22,73 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef SERIAL_LINK_TRANSPORT_H +#define SERIAL_LINK_TRANSPORT_H + +#include "protocol/triple_buffered_object.h" + +#define NUM_SLAVES 8 + +typedef struct { + uint16_t element_size; + uint16_t buffer_size; + uint8_t is_master; + uint8_t buffer[] __attribute__((aligned(4))); +} remote_object_t; + +typedef struct { + uint16_t element_size; + uint8_t destination; + uint8_t buffer[] __attribute__((aligned(4))); +} local_object_t; + +#define REMOTE_OBJECT_BUFFER(id, type) \ +typedef struct { \ + triple_buffer_object_t object; \ + type buffer[3]; \ +} remote_object_buffer_##id##_t; + +#define MASTER_REMOTE_OBJECT(id, type) \ +REMOTE_OBJECT_BUFFER(id, type) \ +typedef struct { \ + remote_object_t object; \ + remote_object_buffer_##id##_t buffer; \ +} master_remote_object_##id##_t; \ +master_remote_object_##id##_t remote_object_##id = { \ + .object = { \ + .element_size = sizeof(type), \ + .buffer_size = sizeof(remote_object_buffer_##id##_t), \ + .is_master = true \ + }}; + +#define SLAVE_REMOTE_OBJECT(id, type) \ +REMOTE_OBJECT_BUFFER(id, type) \ +typedef struct { \ + remote_object_t object; \ + remote_object_buffer_##id##_t buffer[NUM_SLAVES];\ +} slave_remote_object_##id##_t; \ +slave_remote_object_##id##_t remote_object_##id = { \ + .object = { \ + .element_size = sizeof(type), \ + .buffer_size = sizeof(remote_object_buffer_##id##_t), \ + .is_master = true \ + }}; + +#define LOCAL_OBJECT(id, type) \ +typedef struct { \ + uint32_t element_size; \ + uint8_t buffer[NUM_SLAVES][sizeof(type) + 16][3]; \ +} remote_object_##id##_t; \ +remote_object_##id##_t remote_object_##id = {.element_size = sizeof(type) + 16}; + +#define REMOTE_OBJECT(id) (remote_object_t*)&remote_object_##id + + void init_transport(void); void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size); + +void transport_register_master_remote_object(uint8_t id, void* ptr, uint16_t size); +void transport_register_slave_remote_object(uint8_t id, void* ptr, uint16_t size); + +#endif diff --git a/serial_link/protocol/triple_buffered_object.h b/serial_link/protocol/triple_buffered_object.h index 705f0c49f..d224f36a2 100644 --- a/serial_link/protocol/triple_buffered_object.h +++ b/serial_link/protocol/triple_buffered_object.h @@ -27,7 +27,7 @@ SOFTWARE. typedef struct { uint8_t state; - uint8_t buffer[]; + uint8_t buffer[] __attribute__((aligned(4))); }triple_buffer_object_t; void triple_buffer_init(triple_buffer_object_t* object); diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index a64e7446d..f9f5b4773 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -25,6 +25,32 @@ SOFTWARE. #include #include "protocol/transport.c" +typedef struct { + uint32_t test; +} test_object1_t; + +typedef struct { + uint32_t test1; + uint32_t test2; +} test_object2_t; + +MASTER_REMOTE_OBJECT(0, test_object1_t); +SLAVE_REMOTE_OBJECT(1, test_object1_t); +MASTER_REMOTE_OBJECT(2, test_object2_t); +SLAVE_REMOTE_OBJECT(3, test_object2_t); + +// We want +// master -> slave = 1 local(target all), 1 remote object +// slave -> master = 1 local(target 0), multiple remote objects +// master -> single slave (multiple local, target id), 1 remote object + +remote_object_t* remote_objects[] = { + REMOTE_OBJECT(0), + REMOTE_OBJECT(1), + REMOTE_OBJECT(2), + REMOTE_OBJECT(3), +}; + Describe(Transport); BeforeEach(Transport) { init_transport(); -- cgit v1.2.3-24-g4f1b From 679bfe7c5452f69a790e648c7661bbbdb12ce4ae Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 17:33:31 +0200 Subject: More transport WIP --- serial_link/protocol/transport.c | 9 ++-- serial_link/protocol/transport.h | 101 +++++++++++++++++++----------------- serial_link/tests/transport_tests.c | 31 ++++------- 3 files changed, 67 insertions(+), 74 deletions(-) diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index 399894ff9..7b2c14950 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -24,10 +24,12 @@ SOFTWARE. #include "protocol/transport.h" -static uint32_t current_send_frame; +static remote_object_t* remote_objects; +static uint32_t num_remote_objects; -void init_transport(void) { - current_send_frame = 0; +void init_transport(remote_object_t* _remote_objects, uint32_t _num_remote_objects) { + remote_objects = _remote_objects; + num_remote_objects = _num_remote_objects; } void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { @@ -35,5 +37,4 @@ void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { } uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size) { - return ++current_send_frame; } diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index 6f2cf277f..86086b8b8 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -28,63 +28,66 @@ SOFTWARE. #include "protocol/triple_buffered_object.h" #define NUM_SLAVES 8 +#define LOCAL_OBJECT_EXTRA 16 -typedef struct { - uint16_t element_size; - uint16_t buffer_size; - uint8_t is_master; - uint8_t buffer[] __attribute__((aligned(4))); -} remote_object_t; +// master -> slave = 1 local(target all), 1 remote object +// slave -> master = 1 local(target 0), multiple remote objects +// master -> single slave (multiple local, target id), 1 remote object +typedef enum { + MASTER_TO_ALL_SLAVES, + MASTER_TO_SINGLE_SLAVE, + SLAVE_TO_MASTER, +} remote_object_type; typedef struct { - uint16_t element_size; - uint8_t destination; + remote_object_type object_type; + uint16_t object_size; uint8_t buffer[] __attribute__((aligned(4))); -} local_object_t; +} remote_object_t; -#define REMOTE_OBJECT_BUFFER(id, type) \ -typedef struct { \ - triple_buffer_object_t object; \ - type buffer[3]; \ -} remote_object_buffer_##id##_t; +#define REMOTE_OBJECT_SIZE(objectsize) \ + (sizeof(triple_buffer_object_t) + objectsize * 3) +#define LOCAL_OBJECT_SIZE(objectsize) \ + (sizeof(triple_buffer_object_t) + (objectsize + LOCAL_OBJECT_EXTRA) * 3) -#define MASTER_REMOTE_OBJECT(id, type) \ -REMOTE_OBJECT_BUFFER(id, type) \ +#define REMOTE_OBJECT_HELPER(name, type, num_local, num_remote) \ typedef struct { \ remote_object_t object; \ - remote_object_buffer_##id##_t buffer; \ -} master_remote_object_##id##_t; \ -master_remote_object_##id##_t remote_object_##id = { \ - .object = { \ - .element_size = sizeof(type), \ - .buffer_size = sizeof(remote_object_buffer_##id##_t), \ - .is_master = true \ - }}; - -#define SLAVE_REMOTE_OBJECT(id, type) \ -REMOTE_OBJECT_BUFFER(id, type) \ -typedef struct { \ - remote_object_t object; \ - remote_object_buffer_##id##_t buffer[NUM_SLAVES];\ -} slave_remote_object_##id##_t; \ -slave_remote_object_##id##_t remote_object_##id = { \ - .object = { \ - .element_size = sizeof(type), \ - .buffer_size = sizeof(remote_object_buffer_##id##_t), \ - .is_master = true \ - }}; - -#define LOCAL_OBJECT(id, type) \ -typedef struct { \ - uint32_t element_size; \ - uint8_t buffer[NUM_SLAVES][sizeof(type) + 16][3]; \ -} remote_object_##id##_t; \ -remote_object_##id##_t remote_object_##id = {.element_size = sizeof(type) + 16}; - -#define REMOTE_OBJECT(id) (remote_object_t*)&remote_object_##id - - -void init_transport(void); + uint8_t buffer[ \ + num_remote * REMOTE_OBJECT_SIZE(sizeof(type)) + \ + num_local * LOCAL_OBJECT_SIZE(sizeof(type))]; \ +} remote_object_##name##_t; + +#define MASTER_TO_ALL_SLAVES_OBJECT(name, type) \ + REMOTE_OBJECT_HELPER(name, type, 1, 1) \ + remote_object_##name##_t remote_object_##name = { \ + .object = { \ + .object_type = MASTER_TO_ALL_SLAVES, \ + .object_size = sizeof(type), \ + } \ + }; + +#define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ + REMOTE_OBJECT_HELPER(name, type, NUM_SLAVES, 1) \ + remote_object_##name##_t remote_object_##name = { \ + .object = { \ + .object_type = MASTER_TO_SINGLE_SLAVE, \ + .object_size = sizeof(type), \ + } \ + }; + +#define SLAVE_TO_MASTER_OBJECT(name, type) \ + REMOTE_OBJECT_HELPER(name, type, 1, NUM_SLAVES) \ + remote_object_##name##_t remote_object_##name = { \ + .object = { \ + .object_type = SLAVE_TO_MASTER, \ + .object_size = sizeof(type), \ + } \ + }; + +#define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name + +void init_transport(remote_object_t* remote_objects, uint32_t num_remote_objects); void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size); diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index f9f5b4773..31e7b2dc7 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -34,32 +34,21 @@ typedef struct { uint32_t test2; } test_object2_t; -MASTER_REMOTE_OBJECT(0, test_object1_t); -SLAVE_REMOTE_OBJECT(1, test_object1_t); -MASTER_REMOTE_OBJECT(2, test_object2_t); -SLAVE_REMOTE_OBJECT(3, test_object2_t); - -// We want -// master -> slave = 1 local(target all), 1 remote object -// slave -> master = 1 local(target 0), multiple remote objects -// master -> single slave (multiple local, target id), 1 remote object - -remote_object_t* remote_objects[] = { - REMOTE_OBJECT(0), - REMOTE_OBJECT(1), - REMOTE_OBJECT(2), - REMOTE_OBJECT(3), +MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1_t); +MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1_t); +SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t); + +remote_object_t* test_remote_objects[] = { + REMOTE_OBJECT(master_to_slave), + REMOTE_OBJECT(master_to_single_slave), + REMOTE_OBJECT(slave_to_master), }; Describe(Transport); BeforeEach(Transport) { - init_transport(); + init_transport(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t)); } AfterEach(Transport) {} -Ensure(Transport, packet_number_is_sequential) { - assert_that(transport_send_frame(0, NULL, 0), is_equal_to(1)); - assert_that(transport_send_frame(0, NULL, 0), is_equal_to(2)); - // It doesn't matter if the destination changes - assert_that(transport_send_frame(1, NULL, 0), is_equal_to(3)); +Ensure(Transport, write_to_local_signals_an_event) { } -- cgit v1.2.3-24-g4f1b From 2710361cd818aae6dd349fa433ebff365908de06 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 18:30:04 +0200 Subject: Change the triple buffer object interface --- serial_link/protocol/triple_buffered_object.c | 32 +++------- serial_link/protocol/triple_buffered_object.h | 15 ++++- serial_link/tests/triple_buffered_object_tests.c | 78 ++++++++---------------- 3 files changed, 48 insertions(+), 77 deletions(-) diff --git a/serial_link/protocol/triple_buffered_object.c b/serial_link/protocol/triple_buffered_object.c index 3fabb7d84..6b3cf75ad 100644 --- a/serial_link/protocol/triple_buffered_object.c +++ b/serial_link/protocol/triple_buffered_object.c @@ -43,7 +43,7 @@ void triple_buffer_init(triple_buffer_object_t* object) { SET_DATA_AVAILABLE(0); } -static bool triple_buffer_begin_read(uint16_t object_size, triple_buffer_object_t* object) { +void* triple_buffer_read_internal(uint16_t object_size, triple_buffer_object_t* object) { serial_link_lock(); if (GET_DATA_AVAILABLE()) { uint8_t shared_index = GET_SHARED_INDEX(); @@ -52,41 +52,25 @@ static bool triple_buffer_begin_read(uint16_t object_size, triple_buffer_object_ SET_SHARED_INDEX(read_index); SET_DATA_AVAILABLE(false); serial_link_unlock(); - return true; + return object->buffer + object_size * shared_index; } else { serial_link_unlock(); - return false; + return NULL; } } -static void triple_buffer_actual_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { - uint8_t read_index = GET_READ_INDEX(); - memcpy(dst, object->buffer + object_size*read_index, object_size); -} - -static void triple_buffer_end_read(uint16_t object_size, triple_buffer_object_t* object) { +void* triple_buffer_begin_write_internal(uint16_t object_size, triple_buffer_object_t* object) { + uint8_t write_index = GET_WRITE_INDEX(); + return object->buffer + object_size * write_index; } -void triple_buffer_write(uint16_t object_size, triple_buffer_object_t* object, void* src) { - - uint8_t write_index = GET_WRITE_INDEX(); - memcpy(object->buffer + object_size * write_index, src, object_size); +void triple_buffer_end_write_internal(triple_buffer_object_t* object) { serial_link_lock(); uint8_t shared_index = GET_SHARED_INDEX(); + uint8_t write_index = GET_WRITE_INDEX(); SET_SHARED_INDEX(write_index); SET_WRITE_INDEX(shared_index); SET_DATA_AVAILABLE(true); serial_link_unlock(); } - -bool triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst) { - if (triple_buffer_begin_read(object_size, object)) { - triple_buffer_actual_read(object_size, object, dst); - triple_buffer_end_read(object_size, object); - return true; - } - else { - return false; - } -} diff --git a/serial_link/protocol/triple_buffered_object.h b/serial_link/protocol/triple_buffered_object.h index d224f36a2..03209709c 100644 --- a/serial_link/protocol/triple_buffered_object.h +++ b/serial_link/protocol/triple_buffered_object.h @@ -31,8 +31,19 @@ typedef struct { }triple_buffer_object_t; void triple_buffer_init(triple_buffer_object_t* object); -void triple_buffer_write(uint16_t object_size, triple_buffer_object_t* object, void* src); -bool triple_buffer_read(uint16_t object_size, triple_buffer_object_t* object, void* dst); + +#define triple_buffer_begin_write(object) \ + (typeof(*object.buffer[0])*)triple_buffer_begin_write_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) + +#define triple_buffer_end_write(object) \ + triple_buffer_end_write_internal((triple_buffer_object_t*)object) + +#define triple_buffer_read(object) \ + (typeof(*object.buffer[0])*)triple_buffer_read_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) + +void* triple_buffer_begin_write_internal(uint16_t object_size, triple_buffer_object_t* object); +void triple_buffer_end_write_internal(triple_buffer_object_t* object); +void* triple_buffer_read_internal(uint16_t object_size, triple_buffer_object_t* object); #endif diff --git a/serial_link/tests/triple_buffered_object_tests.c b/serial_link/tests/triple_buffered_object_tests.c index cd3ecb6a2..1017df8f5 100644 --- a/serial_link/tests/triple_buffered_object_tests.c +++ b/serial_link/tests/triple_buffered_object_tests.c @@ -40,67 +40,43 @@ AfterEach(TripleBufferedObject) {} Ensure(TripleBufferedObject, writes_and_reads_object) { - uint32_t src = 0x3456ABCC; - uint32_t dst; - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); - assert_that(dst, is_equal_to(src)); + *triple_buffer_begin_write(&test_object) = 0x3456ABCC; + triple_buffer_end_write(&test_object); + assert_that(*triple_buffer_read(&test_object), is_equal_to(0x3456ABCC)); } Ensure(TripleBufferedObject, does_not_read_empty) { - uint32_t dst; - bool res = triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); - assert_that(res, is_equal_to(false)); -} - -Ensure(TripleBufferedObject, writes_and_reads_object_decomposed) { - uint32_t src = 0x3456ABCC; - uint32_t dst; - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - triple_buffer_begin_read(4, (triple_buffer_object_t*)&test_object); - triple_buffer_actual_read(4, (triple_buffer_object_t*)&test_object, &dst); - triple_buffer_end_read(4, (triple_buffer_object_t*)&test_object); - assert_that(dst, is_equal_to(src)); + assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); } Ensure(TripleBufferedObject, writes_twice_and_reads_object) { - uint32_t src = 0x3456ABCC; - uint32_t dst; - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - src = 0x44778899; - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); - assert_that(dst, is_equal_to(src)); + *triple_buffer_begin_write(&test_object) = 0x3456ABCC; + triple_buffer_end_write(&test_object); + *triple_buffer_begin_write(&test_object) = 0x44778899; + triple_buffer_end_write(&test_object); + assert_that(*triple_buffer_read(&test_object), is_equal_to(0x44778899)); } Ensure(TripleBufferedObject, performs_another_write_in_the_middle_of_read) { - uint32_t src = 1; - uint32_t dst; - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - src = 2; - triple_buffer_begin_read(4, (triple_buffer_object_t*)&test_object); - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - triple_buffer_actual_read(4, (triple_buffer_object_t*)&test_object, &dst); - triple_buffer_end_read(4, (triple_buffer_object_t*)&test_object); - assert_that(dst, is_equal_to(1)); - triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); - assert_that(dst, is_equal_to(2)); - assert_that(triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst), is_equal_to(false)); + *triple_buffer_begin_write(&test_object) = 1; + triple_buffer_end_write(&test_object); + uint32_t* read = triple_buffer_read(&test_object); + *triple_buffer_begin_write(&test_object) = 2; + triple_buffer_end_write(&test_object); + assert_that(*read, is_equal_to(1)); + assert_that(*triple_buffer_read(&test_object), is_equal_to(2)); + assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); } Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { - uint32_t src = 1; - uint32_t dst; - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - triple_buffer_begin_read(4, (triple_buffer_object_t*)&test_object); - src = 2; - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - src = 3; - triple_buffer_write(4, (triple_buffer_object_t*)&test_object, &src); - triple_buffer_actual_read(4, (triple_buffer_object_t*)&test_object, &dst); - triple_buffer_end_read(4, (triple_buffer_object_t*)&test_object); - assert_that(dst, is_equal_to(1)); - triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst); - assert_that(dst, is_equal_to(3)); - assert_that(triple_buffer_read(4, (triple_buffer_object_t*)&test_object, &dst), is_equal_to(false)); + *triple_buffer_begin_write(&test_object) = 1; + triple_buffer_end_write(&test_object); + uint32_t* read = triple_buffer_read(&test_object); + *triple_buffer_begin_write(&test_object) = 2; + triple_buffer_end_write(&test_object); + *triple_buffer_begin_write(&test_object) = 3; + triple_buffer_end_write(&test_object); + assert_that(*read, is_equal_to(1)); + assert_that(*triple_buffer_read(&test_object), is_equal_to(3)); + assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); } -- cgit v1.2.3-24-g4f1b From fe1db50fc32c13bb1030676b1381125398bce5de Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 18:51:10 +0200 Subject: Writing signals events --- serial_link/protocol/transport.h | 22 +++++++++++++++++++--- serial_link/system/system.h | 4 ++-- serial_link/tests/transport_tests.c | 14 ++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index 86086b8b8..c4c52947b 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -26,6 +26,7 @@ SOFTWARE. #define SERIAL_LINK_TRANSPORT_H #include "protocol/triple_buffered_object.h" +#include "system/system.h" #define NUM_SLAVES 8 #define LOCAL_OBJECT_EXTRA 16 @@ -65,7 +66,12 @@ typedef struct { \ .object_type = MASTER_TO_ALL_SLAVES, \ .object_size = sizeof(type), \ } \ - }; + }; \ + type* begin_write_##name(void) { \ + }\ + void end_write_##name(void) { \ + signal_data_written(); \ + } #define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ REMOTE_OBJECT_HELPER(name, type, NUM_SLAVES, 1) \ @@ -74,7 +80,12 @@ typedef struct { \ .object_type = MASTER_TO_SINGLE_SLAVE, \ .object_size = sizeof(type), \ } \ - }; + }; \ + type* begin_write_##name(uint8_t slave) { \ + }\ + void end_write_##name(uint8_t slave) { \ + signal_data_written(); \ + } #define SLAVE_TO_MASTER_OBJECT(name, type) \ REMOTE_OBJECT_HELPER(name, type, 1, NUM_SLAVES) \ @@ -83,7 +94,12 @@ typedef struct { \ .object_type = SLAVE_TO_MASTER, \ .object_size = sizeof(type), \ } \ - }; + }; \ + type* begin_write_##name(void) { \ + }\ + void end_write_##name(void) { \ + signal_data_written(); \ + } #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name diff --git a/serial_link/system/system.h b/serial_link/system/system.h index c798e6477..163349953 100644 --- a/serial_link/system/system.h +++ b/serial_link/system/system.h @@ -26,11 +26,11 @@ SOFTWARE. #define SERIAL_LINK_SYSTEM_H void serial_link_lock() { - } void serial_link_unlock() { - } +void signal_data_written(void); + #endif diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 31e7b2dc7..61b9a6508 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -23,8 +23,13 @@ SOFTWARE. */ #include +#include #include "protocol/transport.c" +void signal_data_written(void) { + mock(); +} + typedef struct { uint32_t test; } test_object1_t; @@ -51,4 +56,13 @@ BeforeEach(Transport) { AfterEach(Transport) {} Ensure(Transport, write_to_local_signals_an_event) { + begin_write_master_to_slave(); + expect(signal_data_written); + end_write_master_to_slave(); + begin_write_slave_to_master(); + expect(signal_data_written); + end_write_slave_to_master(); + begin_write_master_to_single_slave(1); + expect(signal_data_written); + end_write_master_to_single_slave(1); } -- cgit v1.2.3-24-g4f1b From 415ab91c9d2ed034bbbabf3cbb8502f525b91abb Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 21:04:42 +0200 Subject: Add master to slave transport --- serial_link/protocol/transport.c | 31 ++++++++++++++++++++++++++++--- serial_link/protocol/transport.h | 18 ++++++++++++++---- serial_link/tests/transport_tests.c | 28 +++++++++++++++++++++++++++- 3 files changed, 69 insertions(+), 8 deletions(-) diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index 7b2c14950..55dae9fa2 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -23,18 +23,43 @@ SOFTWARE. */ #include "protocol/transport.h" +#include "protocol/frame_router.h" +#include "protocol/triple_buffered_object.h" -static remote_object_t* remote_objects; +static remote_object_t** remote_objects; static uint32_t num_remote_objects; -void init_transport(remote_object_t* _remote_objects, uint32_t _num_remote_objects) { +void init_transport(remote_object_t** _remote_objects, uint32_t _num_remote_objects) { remote_objects = _remote_objects; num_remote_objects = _num_remote_objects; } void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { - + uint8_t id = data[size-1]; + remote_object_t* obj = remote_objects[id]; + if (obj->object_type == MASTER_TO_ALL_SLAVES) { + uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); + memcpy(ptr, data, size -1); + triple_buffer_end_write_internal(tb); + } } uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size) { } + +void update_transport(void) { + int i; + for(i=0;iobject_type == MASTER_TO_ALL_SLAVES) { + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; + uint8_t* ptr = (uint8_t*)triple_buffer_read_internal(obj->object_size + LOCAL_OBJECT_EXTRA, tb); + if (ptr) { + ptr[obj->object_size] = i; + router_send_frame(0xFF, ptr, obj->object_size + 1); + } + } + } +} diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index c4c52947b..fa2e00d2d 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -68,9 +68,21 @@ typedef struct { \ } \ }; \ type* begin_write_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ + return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ }\ void end_write_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ + triple_buffer_end_write_internal(tb); \ signal_data_written(); \ + }\ + type* read_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + return triple_buffer_read_internal(obj->object_size, tb); \ } #define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ @@ -103,11 +115,9 @@ typedef struct { \ #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name -void init_transport(remote_object_t* remote_objects, uint32_t num_remote_objects); +void init_transport(remote_object_t** remote_objects, uint32_t num_remote_objects); void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size); - -void transport_register_master_remote_object(uint8_t id, void* ptr, uint16_t size); -void transport_register_slave_remote_object(uint8_t id, void* ptr, uint16_t size); +void update_transport(void); #endif diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 61b9a6508..34d451de4 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -25,11 +25,21 @@ SOFTWARE. #include #include #include "protocol/transport.c" +#include "protocol/triple_buffered_object.c" void signal_data_written(void) { mock(); } +static uint8_t sent_data[2048]; +static uint16_t sent_data_size; + +void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { + mock(destination); + memcpy(sent_data + sent_data_size, data, size); + sent_data_size += size; +} + typedef struct { uint32_t test; } test_object1_t; @@ -51,7 +61,8 @@ remote_object_t* test_remote_objects[] = { Describe(Transport); BeforeEach(Transport) { - init_transport(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t)); + init_transport(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*)); + sent_data_size = 0; } AfterEach(Transport) {} @@ -66,3 +77,18 @@ Ensure(Transport, write_to_local_signals_an_event) { expect(signal_data_written); end_write_master_to_single_slave(1); } + +Ensure(Transport, writes_from_master_to_all_slaves) { + update_transport(); + test_object1_t* obj = begin_write_master_to_slave(); + obj->test = 5; + expect(signal_data_written); + end_write_master_to_slave(); + expect(router_send_frame, + when(destination, is_equal_to(0xFF))); + update_transport(); + transport_recv_frame(0, sent_data, sent_data_size); + test_object1_t* obj2 = read_master_to_slave(); + assert_that(obj2, is_not_equal_to(NULL)); + assert_that(obj2->test, is_equal_to(5)); +} -- cgit v1.2.3-24-g4f1b From 64b7efeb72ff67d088641bda798226e619601a43 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 21:15:42 +0200 Subject: Add proper initialization of transport buffers --- serial_link/protocol/transport.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index 55dae9fa2..c4019d7fe 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -32,6 +32,40 @@ static uint32_t num_remote_objects; void init_transport(remote_object_t** _remote_objects, uint32_t _num_remote_objects) { remote_objects = _remote_objects; num_remote_objects = _num_remote_objects; + int i; + for(i=0;iobject_type == MASTER_TO_ALL_SLAVES) { + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; + triple_buffer_init(tb); + uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + tb = (triple_buffer_object_t*)start; + triple_buffer_init(tb); + } + else if(obj->object_type == MASTER_TO_SINGLE_SLAVE) { + uint8_t* start = obj->buffer; + int j; + for (j=0;jobject_size); + } + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + triple_buffer_init(tb); + } + else { + uint8_t* start = obj->buffer; + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + triple_buffer_init(tb); + start += LOCAL_OBJECT_SIZE(obj->object_size); + int j; + for (j=0;jobject_size); + } + } + } } void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { -- cgit v1.2.3-24-g4f1b From 7b88b8b7e1fd50b1fc2a219c734a3069576bcbe2 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 21:32:01 +0200 Subject: Add slave to master transport --- serial_link/protocol/transport.c | 20 +++++++++++++------- serial_link/protocol/transport.h | 13 +++++++++++++ serial_link/tests/transport_tests.c | 16 ++++++++++++++++ 3 files changed, 42 insertions(+), 7 deletions(-) diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index c4019d7fe..e49e9d69d 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -71,13 +71,18 @@ void init_transport(remote_object_t** _remote_objects, uint32_t _num_remote_obje void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { uint8_t id = data[size-1]; remote_object_t* obj = remote_objects[id]; + uint8_t* start; if (obj->object_type == MASTER_TO_ALL_SLAVES) { - uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; - void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); - memcpy(ptr, data, size -1); - triple_buffer_end_write_internal(tb); + start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); } + else if(obj->object_type == SLAVE_TO_MASTER) { + start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); + } + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); + memcpy(ptr, data, size -1); + triple_buffer_end_write_internal(tb); } uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size) { @@ -87,12 +92,13 @@ void update_transport(void) { int i; for(i=0;iobject_type == MASTER_TO_ALL_SLAVES) { + if (obj->object_type == MASTER_TO_ALL_SLAVES || obj->object_type == SLAVE_TO_MASTER) { triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; uint8_t* ptr = (uint8_t*)triple_buffer_read_internal(obj->object_size + LOCAL_OBJECT_EXTRA, tb); if (ptr) { ptr[obj->object_size] = i; - router_send_frame(0xFF, ptr, obj->object_size + 1); + uint8_t dest = obj->object_type == MASTER_TO_ALL_SLAVES ? 0xFF : 0; + router_send_frame(dest, ptr, obj->object_size + 1); } } } diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index fa2e00d2d..94ff85312 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -108,9 +108,22 @@ typedef struct { \ } \ }; \ type* begin_write_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ + return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ }\ void end_write_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ + triple_buffer_end_write_internal(tb); \ signal_data_written(); \ + }\ + type* read_##name(uint8_t slave) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ + start+=slave * REMOTE_OBJECT_SIZE(obj->object_size); \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + return triple_buffer_read_internal(obj->object_size, tb); \ } #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 34d451de4..334827507 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -92,3 +92,19 @@ Ensure(Transport, writes_from_master_to_all_slaves) { assert_that(obj2, is_not_equal_to(NULL)); assert_that(obj2->test, is_equal_to(5)); } + +Ensure(Transport, writes_from_slave_to_master) { + update_transport(); + test_object1_t* obj = begin_write_slave_to_master(); + obj->test = 7; + expect(signal_data_written); + end_write_slave_to_master(); + expect(router_send_frame, + when(destination, is_equal_to(0))); + update_transport(); + transport_recv_frame(3, sent_data, sent_data_size); + test_object1_t* obj2 = read_slave_to_master(2); + assert_that(read_slave_to_master(0), is_equal_to(NULL)); + assert_that(obj2, is_not_equal_to(NULL)); + assert_that(obj2->test, is_equal_to(7)); +} -- cgit v1.2.3-24-g4f1b From 8cbfe79dd9ce2e8113a0f99e15d6ae4d3176b545 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 21:47:40 +0200 Subject: Add master to single slave transport --- serial_link/protocol/transport.c | 17 +++++++++++++++++ serial_link/protocol/transport.h | 16 ++++++++++++++++ serial_link/tests/transport_tests.c | 15 +++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index e49e9d69d..03f83a806 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -79,6 +79,9 @@ void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); } + else { + start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); + } triple_buffer_object_t* tb = (triple_buffer_object_t*)start; void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); memcpy(ptr, data, size -1); @@ -101,5 +104,19 @@ void update_transport(void) { router_send_frame(dest, ptr, obj->object_size + 1); } } + else { + uint8_t* start = obj->buffer; + int j; + for (j=0;jobject_size + LOCAL_OBJECT_EXTRA, tb); + if (ptr) { + ptr[obj->object_size] = i; + uint8_t dest = j + 1; + router_send_frame(dest, ptr, obj->object_size + 1); + } + start += LOCAL_OBJECT_SIZE(obj->object_size); + } + } } } diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index 94ff85312..a1a83b8f7 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -94,9 +94,25 @@ typedef struct { \ } \ }; \ type* begin_write_##name(uint8_t slave) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer;\ + start += slave * LOCAL_OBJECT_SIZE(obj->object_size); \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ }\ void end_write_##name(uint8_t slave) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer;\ + start += slave * LOCAL_OBJECT_SIZE(obj->object_size); \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + triple_buffer_end_write_internal(tb); \ signal_data_written(); \ + }\ + type* read_##name() { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size);\ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + return triple_buffer_read_internal(obj->object_size, tb); \ } #define SLAVE_TO_MASTER_OBJECT(name, type) \ diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 334827507..3fa8eab4a 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -108,3 +108,18 @@ Ensure(Transport, writes_from_slave_to_master) { assert_that(obj2, is_not_equal_to(NULL)); assert_that(obj2->test, is_equal_to(7)); } + +Ensure(Transport, writes_from_master_to_single_slave) { + update_transport(); + test_object1_t* obj = begin_write_master_to_single_slave(3); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_single_slave(3); + expect(router_send_frame, + when(destination, is_equal_to(4))); + update_transport(); + transport_recv_frame(0, sent_data, sent_data_size); + test_object1_t* obj2 = read_master_to_single_slave(); + assert_that(obj2, is_not_equal_to(NULL)); + assert_that(obj2->test, is_equal_to(7)); +} -- cgit v1.2.3-24-g4f1b From 6873b17117a41715c9a8ca63060974b64b4cdcf4 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 23:17:59 +0200 Subject: Support for Chibios compilation Remove some warnings, change the include paths. --- serial_link.mk | 3 ++- serial_link/protocol/byte_stuffer.c | 8 ++++---- serial_link/protocol/byte_stuffer.h | 7 +++++++ serial_link/protocol/frame_router.c | 5 +++-- serial_link/protocol/frame_router.h | 8 ++++++++ serial_link/protocol/frame_validator.c | 7 ++++--- serial_link/protocol/frame_validator.h | 7 +++++++ serial_link/protocol/physical.h | 5 +++++ serial_link/protocol/transport.c | 20 +++++++++----------- serial_link/protocol/transport.h | 5 ++--- serial_link/protocol/triple_buffered_object.c | 6 ++++-- serial_link/protocol/triple_buffered_object.h | 2 ++ serial_link/system/system.h | 12 +++++++++--- serial_link/tests/Makefile | 2 +- serial_link/tests/byte_stuffer_tests.c | 8 ++++---- serial_link/tests/frame_router_tests.c | 8 ++++---- serial_link/tests/frame_validator_tests.c | 2 +- serial_link/tests/transport_tests.c | 4 ++-- serial_link/tests/triple_buffered_object_tests.c | 2 +- 19 files changed, 79 insertions(+), 42 deletions(-) diff --git a/serial_link.mk b/serial_link.mk index de2364108..e8915a33f 100644 --- a/serial_link.mk +++ b/serial_link.mk @@ -20,4 +20,5 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -INC += $(SERIAL_DIR) \ No newline at end of file +INC += $(SERIAL_DIR) +SRC += $(wildcard $(SERIAL_DIR)/serial_link/protocol/*.c) \ No newline at end of file diff --git a/serial_link/protocol/byte_stuffer.c b/serial_link/protocol/byte_stuffer.c index 8b529667f..fb4c45a8d 100644 --- a/serial_link/protocol/byte_stuffer.c +++ b/serial_link/protocol/byte_stuffer.c @@ -22,10 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "protocol/byte_stuffer.h" -#include "protocol/frame_validator.h" -#include "protocol/physical.h" -#include +#include "serial_link/protocol/byte_stuffer.h" +#include "serial_link/protocol/frame_validator.h" +#include "serial_link/protocol/physical.h" +#include // This implements the "Consistent overhead byte stuffing protocol" // https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing diff --git a/serial_link/protocol/byte_stuffer.h b/serial_link/protocol/byte_stuffer.h index 839a876fe..2cc88beb4 100644 --- a/serial_link/protocol/byte_stuffer.h +++ b/serial_link/protocol/byte_stuffer.h @@ -22,6 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef SERIAL_LINK_BYTE_STUFFER_H +#define SERIAL_LINK_BYTE_STUFFER_H + +#include + void init_byte_stuffer(void); void byte_stuffer_recv_byte(uint8_t link, uint8_t data); void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size); + +#endif diff --git a/serial_link/protocol/frame_router.c b/serial_link/protocol/frame_router.c index 890ebbe9e..04b8c2e75 100644 --- a/serial_link/protocol/frame_router.c +++ b/serial_link/protocol/frame_router.c @@ -22,8 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "protocol/frame_router.h" -#include "protocol/transport.h" +#include "serial_link/protocol/frame_router.h" +#include "serial_link/protocol/transport.h" +#include "serial_link/protocol/frame_validator.h" static bool is_master; diff --git a/serial_link/protocol/frame_router.h b/serial_link/protocol/frame_router.h index 67db3122f..712250ff3 100644 --- a/serial_link/protocol/frame_router.h +++ b/serial_link/protocol/frame_router.h @@ -22,9 +22,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef SERIAL_LINK_FRAME_ROUTER_H +#define SERIAL_LINK_FRAME_ROUTER_H + +#include +#include + #define UP_LINK 0 #define DOWN_LINK 1 void router_set_master(bool master); void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size); void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size); + +#endif diff --git a/serial_link/protocol/frame_validator.c b/serial_link/protocol/frame_validator.c index a3face650..474f80ee8 100644 --- a/serial_link/protocol/frame_validator.c +++ b/serial_link/protocol/frame_validator.c @@ -22,9 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "protocol/frame_validator.h" -#include "protocol/frame_router.h" -#include "protocol/byte_stuffer.h" +#include "serial_link/protocol/frame_validator.h" +#include "serial_link/protocol/frame_router.h" +#include "serial_link/protocol/byte_stuffer.h" +#include const uint32_t poly8_lookup[256] = { diff --git a/serial_link/protocol/frame_validator.h b/serial_link/protocol/frame_validator.h index c35fc2726..4a910d510 100644 --- a/serial_link/protocol/frame_validator.h +++ b/serial_link/protocol/frame_validator.h @@ -22,6 +22,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef SERIAL_LINK_FRAME_VALIDATOR_H +#define SERIAL_LINK_FRAME_VALIDATOR_H + +#include + void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size); // The buffer pointed to by the data needs 4 additional bytes void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size); + +#endif diff --git a/serial_link/protocol/physical.h b/serial_link/protocol/physical.h index ee5883d36..425e06cdd 100644 --- a/serial_link/protocol/physical.h +++ b/serial_link/protocol/physical.h @@ -22,4 +22,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef SERIAL_LINK_PHYSICAL_H +#define SERIAL_LINK_PHYSICAL_H + void send_data(uint8_t link, const uint8_t* data, uint16_t size); + +#endif diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index 03f83a806..4542a7a05 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -22,9 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "protocol/transport.h" -#include "protocol/frame_router.h" -#include "protocol/triple_buffered_object.h" +#include "serial_link/protocol/transport.h" +#include "serial_link/protocol/frame_router.h" +#include "serial_link/protocol/triple_buffered_object.h" +#include static remote_object_t** remote_objects; static uint32_t num_remote_objects; @@ -32,7 +33,7 @@ static uint32_t num_remote_objects; void init_transport(remote_object_t** _remote_objects, uint32_t _num_remote_objects) { remote_objects = _remote_objects; num_remote_objects = _num_remote_objects; - int i; + unsigned int i; for(i=0;iobject_type == MASTER_TO_ALL_SLAVES) { @@ -44,7 +45,7 @@ void init_transport(remote_object_t** _remote_objects, uint32_t _num_remote_obje } else if(obj->object_type == MASTER_TO_SINGLE_SLAVE) { uint8_t* start = obj->buffer; - int j; + unsigned int j; for (j=0;jobject_size); - int j; + unsigned int j; for (j=0;jobject_type == MASTER_TO_ALL_SLAVES || obj->object_type == SLAVE_TO_MASTER) { @@ -106,7 +104,7 @@ void update_transport(void) { } else { uint8_t* start = obj->buffer; - int j; + unsigned int j; for (j=0;jobject_size + LOCAL_OBJECT_EXTRA, tb); diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index a1a83b8f7..9e9e22462 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -25,8 +25,8 @@ SOFTWARE. #ifndef SERIAL_LINK_TRANSPORT_H #define SERIAL_LINK_TRANSPORT_H -#include "protocol/triple_buffered_object.h" -#include "system/system.h" +#include "serial_link/protocol/triple_buffered_object.h" +#include "serial_link/system/system.h" #define NUM_SLAVES 8 #define LOCAL_OBJECT_EXTRA 16 @@ -146,7 +146,6 @@ typedef struct { \ void init_transport(remote_object_t** remote_objects, uint32_t num_remote_objects); void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); -uint32_t transport_send_frame(uint8_t to, uint8_t* data, uint16_t size); void update_transport(void); #endif diff --git a/serial_link/protocol/triple_buffered_object.c b/serial_link/protocol/triple_buffered_object.c index 6b3cf75ad..c6bf28af0 100644 --- a/serial_link/protocol/triple_buffered_object.c +++ b/serial_link/protocol/triple_buffered_object.c @@ -22,8 +22,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "protocol/triple_buffered_object.h" -#include "system/system.h" +#include "serial_link/protocol/triple_buffered_object.h" +#include "serial_link/system/system.h" +#include +#include #define GET_READ_INDEX() object->state & 3 #define GET_WRITE_INDEX() (object->state >> 2) & 3 diff --git a/serial_link/protocol/triple_buffered_object.h b/serial_link/protocol/triple_buffered_object.h index 03209709c..2e57db3f5 100644 --- a/serial_link/protocol/triple_buffered_object.h +++ b/serial_link/protocol/triple_buffered_object.h @@ -25,6 +25,8 @@ SOFTWARE. #ifndef SERIAL_LINK_TRIPLE_BUFFERED_OBJECT_H #define SERIAL_LINK_TRIPLE_BUFFERED_OBJECT_H +#include + typedef struct { uint8_t state; uint8_t buffer[] __attribute__((aligned(4))); diff --git a/serial_link/system/system.h b/serial_link/system/system.h index 163349953..1e4c610b1 100644 --- a/serial_link/system/system.h +++ b/serial_link/system/system.h @@ -25,12 +25,18 @@ SOFTWARE. #ifndef SERIAL_LINK_SYSTEM_H #define SERIAL_LINK_SYSTEM_H -void serial_link_lock() { +inline void serial_link_lock(void) { } -void serial_link_unlock() { +inline void serial_link_unlock(void) { } -void signal_data_written(void); +void singal_data_written(void); + +#if defined(PROTOCOL_CHIBIOS) + +inline void signal_data_written(void) { +} +#endif #endif diff --git a/serial_link/tests/Makefile b/serial_link/tests/Makefile index 0d8ba4b7b..1b072c6f1 100644 --- a/serial_link/tests/Makefile +++ b/serial_link/tests/Makefile @@ -22,7 +22,7 @@ CC = gcc CFLAGS = -INCLUDES = -I. -I../ +INCLUDES = -I. -I../../ LDFLAGS = -L$(BUILDDIR)/cgreen/build-c/src -shared LDLIBS = -lcgreen UNITOBJ = $(BUILDDIR)/serialtest/unitobj diff --git a/serial_link/tests/byte_stuffer_tests.c b/serial_link/tests/byte_stuffer_tests.c index 912c4d321..64b170e8c 100644 --- a/serial_link/tests/byte_stuffer_tests.c +++ b/serial_link/tests/byte_stuffer_tests.c @@ -24,10 +24,10 @@ SOFTWARE. #include #include -#include "protocol/byte_stuffer.h" -#include "protocol/byte_stuffer.c" -#include "protocol/frame_validator.h" -#include "protocol/physical.h" +#include "serial_link/protocol/byte_stuffer.h" +#include "serial_link/protocol/byte_stuffer.c" +#include "serial_link/protocol/frame_validator.h" +#include "serial_link/protocol/physical.h" static uint8_t sent_data[MAX_FRAME_SIZE*2]; static uint16_t sent_data_size; diff --git a/serial_link/tests/frame_router_tests.c b/serial_link/tests/frame_router_tests.c index 0b0ea6e7f..6c806fa93 100644 --- a/serial_link/tests/frame_router_tests.c +++ b/serial_link/tests/frame_router_tests.c @@ -24,10 +24,10 @@ SOFTWARE. #include #include -#include "protocol/byte_stuffer.c" -#include "protocol/frame_validator.c" -#include "protocol/frame_router.c" -#include "protocol/transport.h" +#include "serial_link/protocol/byte_stuffer.c" +#include "serial_link/protocol/frame_validator.c" +#include "serial_link/protocol/frame_router.c" +#include "serial_link/protocol/transport.h" static uint8_t received_data[256]; static uint16_t received_data_size; diff --git a/serial_link/tests/frame_validator_tests.c b/serial_link/tests/frame_validator_tests.c index f4abd14d1..d20947e2c 100644 --- a/serial_link/tests/frame_validator_tests.c +++ b/serial_link/tests/frame_validator_tests.c @@ -24,7 +24,7 @@ SOFTWARE. #include #include -#include "protocol/frame_validator.c" +#include "serial_link/protocol/frame_validator.c" void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size) { mock(data, size); diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 3fa8eab4a..3e9bffdfa 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -24,8 +24,8 @@ SOFTWARE. #include #include -#include "protocol/transport.c" -#include "protocol/triple_buffered_object.c" +#include "serial_link/protocol/transport.c" +#include "serial_link/protocol/triple_buffered_object.c" void signal_data_written(void) { mock(); diff --git a/serial_link/tests/triple_buffered_object_tests.c b/serial_link/tests/triple_buffered_object_tests.c index 1017df8f5..6f7c82b46 100644 --- a/serial_link/tests/triple_buffered_object_tests.c +++ b/serial_link/tests/triple_buffered_object_tests.c @@ -23,7 +23,7 @@ SOFTWARE. */ #include -#include "protocol/triple_buffered_object.c" +#include "serial_link/protocol/triple_buffered_object.c" typedef struct { uint8_t state; -- cgit v1.2.3-24-g4f1b From 36e4869531b19b19eb4301af2016875b9f4f6e82 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 21 Feb 2016 23:52:00 +0200 Subject: Create a thread for the serial link --- serial_link.mk | 3 ++- serial_link/system/system.c | 40 ++++++++++++++++++++++++++++++++++++++++ serial_link/system/system.h | 24 +++++++++++++++++++----- 3 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 serial_link/system/system.c diff --git a/serial_link.mk b/serial_link.mk index e8915a33f..434966a22 100644 --- a/serial_link.mk +++ b/serial_link.mk @@ -21,4 +21,5 @@ # SOFTWARE. INC += $(SERIAL_DIR) -SRC += $(wildcard $(SERIAL_DIR)/serial_link/protocol/*.c) \ No newline at end of file +SRC += $(wildcard $(SERIAL_DIR)/serial_link/protocol/*.c) +SRC += $(wildcard $(SERIAL_DIR)/serial_link/system/*.c) \ No newline at end of file diff --git a/serial_link/system/system.c b/serial_link/system/system.c new file mode 100644 index 000000000..2001f4d5c --- /dev/null +++ b/serial_link/system/system.c @@ -0,0 +1,40 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ +#include "serial_link/system/system.h" + +// TODO: Optimize the stack size, this is probably way too big +static THD_WORKING_AREA(serialThreadStack, 1024); +static THD_FUNCTION(serialThread, arg) { + (void)arg; +} + + +void init_serial_link(void) { + (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), + LOWPRIO, serialThread, NULL); +} + +void signal_data_written(void) { + +} diff --git a/serial_link/system/system.h b/serial_link/system/system.h index 1e4c610b1..e8c1caec0 100644 --- a/serial_link/system/system.h +++ b/serial_link/system/system.h @@ -25,18 +25,32 @@ SOFTWARE. #ifndef SERIAL_LINK_SYSTEM_H #define SERIAL_LINK_SYSTEM_H -inline void serial_link_lock(void) { + +void init_serial_link(void); + +#if defined(PROTOCOL_CHIBIOS) +#include "ch.h" + +static inline void serial_link_lock(void) { + chSysLock(); } -inline void serial_link_unlock(void) { +static inline void serial_link_unlock(void) { + chSysUnlock(); } -void singal_data_written(void); +void signal_data_written(void); -#if defined(PROTOCOL_CHIBIOS) +#else -inline void signal_data_written(void) { +inline void serial_link_lock(void) { +} + +inline void serial_link_unlock(void) { } + +void signal_data_written(void); + #endif #endif -- cgit v1.2.3-24-g4f1b From 725929ec8bb5d57b6c4f53fa7d15e04df15f2535 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 23 Feb 2016 09:37:24 +0200 Subject: Fix include paths for new tmk_core update --- visualizer.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/visualizer.mk b/visualizer.mk index eef2d5cc8..13c5d3158 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -23,16 +23,16 @@ GFXLIB = $(VISUALIZER_DIR)/ugfx ifdef LCD_ENABLE include $(GFXLIB)/gfx.mk -OPT_DEFS += -DLCD_ENABLE -OPT_LIBS += -lm +UDEFS += -DLCD_ENABLE +ULIBS += -lm endif SRC += $(GFXSRC) $(VISUALIZER_DIR)/visualizer.c -INC += $(GFXINC) $(VISUALIZER_DIR) +UINCDIR += $(GFXINC) $(VISUALIZER_DIR) ifdef LCD_BACKLIGHT_ENABLE SRC += $(VISUALIZER_DIR)/lcd_backlight.c SRC += lcd_backlight_hal.c -OPT_DEFS += -DLCD_BACKLIGHT_ENABLE +UDEFS += -DLCD_BACKLIGHT_ENABLE endif ifndef VISUALIZER_USER -- cgit v1.2.3-24-g4f1b From 17a1102a2a73e619d1a2573764fdfbb0dec9c9a9 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 24 Feb 2016 22:31:01 +0200 Subject: Fix include dir to use uincir instead of just inc --- serial_link.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serial_link.mk b/serial_link.mk index 434966a22..f0cd60b04 100644 --- a/serial_link.mk +++ b/serial_link.mk @@ -20,6 +20,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -INC += $(SERIAL_DIR) +UINCDIR += $(SERIAL_DIR) SRC += $(wildcard $(SERIAL_DIR)/serial_link/protocol/*.c) SRC += $(wildcard $(SERIAL_DIR)/serial_link/system/*.c) \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 9cb139adc4e08ff393b1cb8bf16203d670996e71 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 27 Feb 2016 22:28:35 +0200 Subject: Add simple loop for updating the serial link --- serial_link/system/system.c | 66 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index 2001f4d5c..2dbd9a4c1 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -22,19 +22,83 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "serial_link/system/system.h" +#include "hal.h" +#include "serial_link/protocol/byte_stuffer.h" +#include "serial_link/protocol/transport.h" +#include "serial_link/protocol/frame_router.h" +#include + +static event_source_t new_data_event; + + +// Slow speed for testing +static SerialConfig config = { + .sc_speed = 38400 +}; + +static uint32_t read_from_serial(SerialDriver* driver) { + const uint32_t buffer_size = 16; + uint8_t buffer[buffer_size]; + uint32_t bytes_read = sdAsynchronousRead(driver, buffer, buffer_size); + uint8_t* current = buffer; + uint8_t* end = current + bytes_read; + while(current < end) { + byte_stuffer_recv_byte(0, *current); + current++; + } + return bytes_read; +} // TODO: Optimize the stack size, this is probably way too big static THD_WORKING_AREA(serialThreadStack, 1024); static THD_FUNCTION(serialThread, arg) { (void)arg; + event_listener_t new_data_listener; + event_listener_t sd1_listener; + event_listener_t sd2_listener; + chEvtRegister(&new_data_event, &new_data_listener, 0); + chEvtRegisterMaskWithFlags(chnGetEventSource(&SD1), + &sd1_listener, + EVENT_MASK(1), + CHN_INPUT_AVAILABLE); + chEvtRegisterMaskWithFlags(chnGetEventSource(&SD2), + &sd2_listener, + EVENT_MASK(2), + CHN_INPUT_AVAILABLE); + bool need_wait = false; + while(true) { + if (need_wait) { + chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000)); + } + bool is_master = usbGetDriverStateI(&USBD1) == USB_ACTIVE; + router_set_master(is_master); + + need_wait = true; + need_wait &= read_from_serial(&SD1) == 0; + need_wait &= read_from_serial(&SD2) == 0; + update_transport(); + } +} + +void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + if (link == 0) { + sdWrite(&SD1, data, size); + } + else { + sdWrite(&SD2, data, size); + } } void init_serial_link(void) { + init_byte_stuffer(); + sdStart(&SD1, &config); + sdStart(&SD2, &config); + chEvtObjectInit(&new_data_event); (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), LOWPRIO, serialThread, NULL); } void signal_data_written(void) { - + chEvtBroadcast(&new_data_event); } -- cgit v1.2.3-24-g4f1b From 46482460fa5ba7e1606656f651117cc30f643952 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 28 Feb 2016 15:52:03 +0200 Subject: Some small fixes for the serial update loop --- serial_link/system/system.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index 2dbd9a4c1..e40a18cec 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -36,14 +36,14 @@ static SerialConfig config = { .sc_speed = 38400 }; -static uint32_t read_from_serial(SerialDriver* driver) { +static uint32_t read_from_serial(SerialDriver* driver, uint8_t link) { const uint32_t buffer_size = 16; uint8_t buffer[buffer_size]; uint32_t bytes_read = sdAsynchronousRead(driver, buffer, buffer_size); uint8_t* current = buffer; uint8_t* end = current + bytes_read; while(current < end) { - byte_stuffer_recv_byte(0, *current); + byte_stuffer_recv_byte(link, *current); current++; } return bytes_read; @@ -74,14 +74,14 @@ static THD_FUNCTION(serialThread, arg) { router_set_master(is_master); need_wait = true; - need_wait &= read_from_serial(&SD1) == 0; - need_wait &= read_from_serial(&SD2) == 0; + need_wait &= read_from_serial(&SD2, UP_LINK) == 0; + need_wait &= read_from_serial(&SD1, DOWN_LINK) == 0; update_transport(); } } void send_data(uint8_t link, const uint8_t* data, uint16_t size) { - if (link == 0) { + if (link == DOWN_LINK) { sdWrite(&SD1, data, size); } else { -- cgit v1.2.3-24-g4f1b From d8d4622802c1a50779830eade0f79a0680def34a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 28 Feb 2016 21:46:29 +0200 Subject: Improve serial link initialization, and add driver --- serial_link.mk | 4 +- serial_link/system/driver.h | 36 ++++++++++++++++++ serial_link/system/system.c | 90 +++++++++++++++++++++++++++++++++++++++++++++ serial_link/system/system.h | 1 - 4 files changed, 129 insertions(+), 2 deletions(-) create mode 100644 serial_link/system/driver.h diff --git a/serial_link.mk b/serial_link.mk index f0cd60b04..e164cc5ff 100644 --- a/serial_link.mk +++ b/serial_link.mk @@ -22,4 +22,6 @@ UINCDIR += $(SERIAL_DIR) SRC += $(wildcard $(SERIAL_DIR)/serial_link/protocol/*.c) -SRC += $(wildcard $(SERIAL_DIR)/serial_link/system/*.c) \ No newline at end of file +SRC += $(wildcard $(SERIAL_DIR)/serial_link/system/*.c) +SRC += serial_link_hal.c +OPT_DEFS += -DUSE_SERIAL_LINK diff --git a/serial_link/system/driver.h b/serial_link/system/driver.h new file mode 100644 index 000000000..76e2d682c --- /dev/null +++ b/serial_link/system/driver.h @@ -0,0 +1,36 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_DRIVER_H +#define SERIAL_LINK_DRIVER_H + +#include "host_driver.h" + +void init_serial_link(void); +void init_serial_link_hal(void); +bool is_serial_link_connected(void); +host_driver_t* get_serial_link_driver(void); +void serial_link_update(void); + +#endif diff --git a/serial_link/system/system.c b/serial_link/system/system.c index e40a18cec..c38bcd87d 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -21,14 +21,33 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "report.h" +#include "host_driver.h" #include "serial_link/system/system.h" +#include "serial_link/system/driver.h" #include "hal.h" #include "serial_link/protocol/byte_stuffer.h" #include "serial_link/protocol/transport.h" #include "serial_link/protocol/frame_router.h" #include +#include "print.h" static event_source_t new_data_event; +static bool serial_link_connected; + +static uint8_t keyboard_leds(void); +static void send_keyboard(report_keyboard_t *report); +static void send_mouse(report_mouse_t *report); +static void send_system(uint16_t data); +static void send_consumer(uint16_t data); + +host_driver_t serial_driver = { + keyboard_leds, + send_keyboard, + send_mouse, + send_system, + send_consumer +}; // Slow speed for testing @@ -89,8 +108,25 @@ void send_data(uint8_t link, const uint8_t* data, uint16_t size) { } } +static systime_t last_update = 0; + +typedef struct { + uint32_t test; +} test_object1_t; + + +SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t); +MASTER_TO_ALL_SLAVES_OBJECT(serial_link_connected, bool); + +remote_object_t* test_remote_objects[] = { + REMOTE_OBJECT(serial_link_connected), + REMOTE_OBJECT(slave_to_master), +}; void init_serial_link(void) { + serial_link_connected = false; + init_serial_link_hal(); + init_transport(test_remote_objects, sizeof(test_remote_objects)/sizeof(remote_object_t*)); init_byte_stuffer(); sdStart(&SD1, &config); sdStart(&SD2, &config); @@ -99,6 +135,60 @@ void init_serial_link(void) { LOWPRIO, serialThread, NULL); } +void serial_link_update(void) { + systime_t current_time = chVTGetSystemTimeX(); + if (current_time - last_update > 1000) { + *begin_write_serial_link_connected() = true; + end_write_serial_link_connected(); + test_object1_t* obj = begin_write_slave_to_master(); + obj->test = current_time; + end_write_slave_to_master(); + xprintf("writing %d\n", current_time); + last_update = current_time; + } + test_object1_t* obj = read_slave_to_master(0); + if (obj) { + xprintf("%d\n", obj->test); + } + obj = read_slave_to_master(1); + if (obj) { + xprintf("%d\n", obj->test); + } + + if (read_serial_link_connected()) { + serial_link_connected = true; + } +} + void signal_data_written(void) { chEvtBroadcast(&new_data_event); } + +bool is_serial_link_connected(void) { + return serial_link_connected; +} + +host_driver_t* get_serial_link_driver(void) { + return &serial_driver; +} + +uint8_t keyboard_leds(void) { + return 0; +} + +void send_keyboard(report_keyboard_t *report) { + (void)report; +} + +void send_mouse(report_mouse_t *report) { + (void)report; +} + +void send_system(uint16_t data) { + (void)data; +} + +void send_consumer(uint16_t data) { + (void)data; +} + diff --git a/serial_link/system/system.h b/serial_link/system/system.h index e8c1caec0..fcc27425e 100644 --- a/serial_link/system/system.h +++ b/serial_link/system/system.h @@ -26,7 +26,6 @@ SOFTWARE. #define SERIAL_LINK_SYSTEM_H -void init_serial_link(void); #if defined(PROTOCOL_CHIBIOS) #include "ch.h" -- cgit v1.2.3-24-g4f1b From 6fe6d111bf563962e0d3cc2e4812b6d7959836a3 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 28 Feb 2016 22:52:30 +0200 Subject: Send the keyboard matrix over the serial link --- serial_link/system/system.c | 53 +++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index c38bcd87d..68ccbdb45 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -29,6 +29,7 @@ SOFTWARE. #include "serial_link/protocol/byte_stuffer.h" #include "serial_link/protocol/transport.h" #include "serial_link/protocol/frame_router.h" +#include "matrix.h" #include #include "print.h" @@ -111,16 +112,17 @@ void send_data(uint8_t link, const uint8_t* data, uint16_t size) { static systime_t last_update = 0; typedef struct { - uint32_t test; -} test_object1_t; + matrix_row_t rows[MATRIX_ROWS]; +} matrix_object_t; +static matrix_object_t last_matrix = {}; -SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t); +SLAVE_TO_MASTER_OBJECT(keyboard_matrix, matrix_object_t); MASTER_TO_ALL_SLAVES_OBJECT(serial_link_connected, bool); remote_object_t* test_remote_objects[] = { REMOTE_OBJECT(serial_link_connected), - REMOTE_OBJECT(slave_to_master), + REMOTE_OBJECT(keyboard_matrix), }; void init_serial_link(void) { @@ -140,24 +142,42 @@ void serial_link_update(void) { if (current_time - last_update > 1000) { *begin_write_serial_link_connected() = true; end_write_serial_link_connected(); - test_object1_t* obj = begin_write_slave_to_master(); - obj->test = current_time; - end_write_slave_to_master(); - xprintf("writing %d\n", current_time); last_update = current_time; } - test_object1_t* obj = read_slave_to_master(0); - if (obj) { - xprintf("%d\n", obj->test); - } - obj = read_slave_to_master(1); - if (obj) { - xprintf("%d\n", obj->test); - } if (read_serial_link_connected()) { serial_link_connected = true; } + + matrix_object_t matrix; + bool changed = false; + for(uint8_t i=0;irows[i] = matrix.rows[i]; + } + end_write_keyboard_matrix(); + } + + matrix_object_t* m = read_keyboard_matrix(0); + if (m) { + xprintf("\nr/c 01234567\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + xprintf("%X0: ", row); + for (int col = 0; col < MATRIX_COLS; col++) { + if (m->rows[row] & (1< Date: Sun, 28 Feb 2016 23:58:47 +0200 Subject: Call remote matrix update, when the matrix changes --- serial_link/system/system.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index 68ccbdb45..9cf695a30 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -137,6 +137,8 @@ void init_serial_link(void) { LOWPRIO, serialThread, NULL); } +void matrix_set_remote(matrix_row_t* rows, uint8_t index); + void serial_link_update(void) { systime_t current_time = chVTGetSystemTimeX(); if (current_time - last_update > 1000) { @@ -166,17 +168,7 @@ void serial_link_update(void) { matrix_object_t* m = read_keyboard_matrix(0); if (m) { - xprintf("\nr/c 01234567\n"); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - xprintf("%X0: ", row); - for (int col = 0; col < MATRIX_COLS; col++) { - if (m->rows[row] & (1<rows, 0); } } -- cgit v1.2.3-24-g4f1b From 11bd4ba0dd39654318bd0a3ae495656c2b2187bb Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 12 Mar 2016 19:35:09 +0200 Subject: Remote object callable from many places Change init_transport to add_remote_objects, so that it can be called many times from different places. --- serial_link/protocol/transport.c | 14 +++++++------- serial_link/protocol/transport.h | 2 +- serial_link/system/system.c | 4 ++-- serial_link/tests/transport_tests.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index 4542a7a05..fbcb040bf 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -27,15 +27,15 @@ SOFTWARE. #include "serial_link/protocol/triple_buffered_object.h" #include -static remote_object_t** remote_objects; -static uint32_t num_remote_objects; +#define MAX_REMOTE_OBJECTS 16 +static remote_object_t* remote_objects[MAX_REMOTE_OBJECTS]; +static uint32_t num_remote_objects = 0; -void init_transport(remote_object_t** _remote_objects, uint32_t _num_remote_objects) { - remote_objects = _remote_objects; - num_remote_objects = _num_remote_objects; +void add_remote_objects(remote_object_t** _remote_objects, uint32_t _num_remote_objects) { unsigned int i; - for(i=0;iobject_type == MASTER_TO_ALL_SLAVES) { triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; triple_buffer_init(tb); diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index 9e9e22462..e518aaa6e 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -144,7 +144,7 @@ typedef struct { \ #define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name -void init_transport(remote_object_t** remote_objects, uint32_t num_remote_objects); +void add_remote_objects(remote_object_t** remote_objects, uint32_t num_remote_objects); void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); void update_transport(void); diff --git a/serial_link/system/system.c b/serial_link/system/system.c index 9cf695a30..9e4ee5d95 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -120,7 +120,7 @@ static matrix_object_t last_matrix = {}; SLAVE_TO_MASTER_OBJECT(keyboard_matrix, matrix_object_t); MASTER_TO_ALL_SLAVES_OBJECT(serial_link_connected, bool); -remote_object_t* test_remote_objects[] = { +static remote_object_t* remote_objects[] = { REMOTE_OBJECT(serial_link_connected), REMOTE_OBJECT(keyboard_matrix), }; @@ -128,7 +128,7 @@ remote_object_t* test_remote_objects[] = { void init_serial_link(void) { serial_link_connected = false; init_serial_link_hal(); - init_transport(test_remote_objects, sizeof(test_remote_objects)/sizeof(remote_object_t*)); + add_remote_objects(remote_objects, sizeof(remote_objects)/sizeof(remote_object_t*)); init_byte_stuffer(); sdStart(&SD1, &config); sdStart(&SD2, &config); diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 3e9bffdfa..02a7a1042 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -53,7 +53,7 @@ MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1_t); MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1_t); SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t); -remote_object_t* test_remote_objects[] = { +static remote_object_t* test_remote_objects[] = { REMOTE_OBJECT(master_to_slave), REMOTE_OBJECT(master_to_single_slave), REMOTE_OBJECT(slave_to_master), @@ -61,7 +61,7 @@ remote_object_t* test_remote_objects[] = { Describe(Transport); BeforeEach(Transport) { - init_transport(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*)); + add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*)); sent_data_size = 0; } AfterEach(Transport) {} -- cgit v1.2.3-24-g4f1b From 32f0171d393211cc29f57a0ed29327b45e9d3747 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 12 Mar 2016 19:41:34 +0200 Subject: Fix crash when receiving unregistered remotes --- serial_link/protocol/transport.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index fbcb040bf..efc00e79e 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -71,22 +71,24 @@ void add_remote_objects(remote_object_t** _remote_objects, uint32_t _num_remote_ void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { uint8_t id = data[size-1]; - remote_object_t* obj = remote_objects[id]; - uint8_t* start; - if (obj->object_type == MASTER_TO_ALL_SLAVES) { - start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - } - else if(obj->object_type == SLAVE_TO_MASTER) { - start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); - } - else { - start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); + if (id < num_remote_objects) { + remote_object_t* obj = remote_objects[id]; + uint8_t* start; + if (obj->object_type == MASTER_TO_ALL_SLAVES) { + start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + } + else if(obj->object_type == SLAVE_TO_MASTER) { + start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); + } + else { + start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); + } + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); + memcpy(ptr, data, size -1); + triple_buffer_end_write_internal(tb); } - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; - void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); - memcpy(ptr, data, size -1); - triple_buffer_end_write_internal(tb); } void update_transport(void) { -- cgit v1.2.3-24-g4f1b From 315edb48265e6baedd07f34c9e6e323d28814b4e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 12 Mar 2016 19:42:57 +0200 Subject: Add serial link support for visualizer --- visualizer.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/visualizer.c b/visualizer.c index 402bbd151..ca7bcb776 100644 --- a/visualizer.c +++ b/visualizer.c @@ -42,6 +42,11 @@ SOFTWARE. #include "nodebug.h" #endif +#ifdef USE_SERIAL_LINK +#include "serial_link/protocol/transport.h" +#include "serial_link/system/driver.h" +#endif + static visualizer_keyboard_status_t current_status = { .layer = 0xFFFFFFFF, @@ -59,6 +64,16 @@ static bool visualizer_enabled = false; #define MAX_SIMULTANEOUS_ANIMATIONS 4 static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {}; +#ifdef USE_SERIAL_LINK +MASTER_TO_ALL_SLAVES_OBJECT(current_status, visualizer_keyboard_status_t); + +static remote_object_t* remote_objects[] = { + REMOTE_OBJECT(current_status), +}; + +#endif + + void start_keyframe_animation(keyframe_animation_t* animation) { animation->current_frame = -1; animation->time_left_in_frame = 0; @@ -328,6 +343,10 @@ void visualizer_init(void) { #ifdef LCD_BACKLIGHT_ENABLE lcd_backlight_init(); #endif + +#ifdef USE_SERIAL_LINK + add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); +#endif // We are using a low priority thread, the idea is to have it run only // when the main thread is sleeping during the matrix scanning chEvtObjectInit(&layer_changed_event); @@ -340,17 +359,45 @@ void visualizer_set_state(uint32_t default_state, uint32_t state, uint32_t leds) // a state where one of these are set but not the other. But this should // not really matter as it will be fixed during the next loop step. // Alternatively a mutex could be used instead of the volatile variables + bool changed = false; - visualizer_keyboard_status_t new_status = { - .layer = state, - .default_layer = default_state, - .leds = leds, - }; - if (!same_status(¤t_status, &new_status)) { - changed = true; +#ifdef USE_SERIAL_LINK + if (is_serial_link_connected ()) { + visualizer_keyboard_status_t* new_status = read_current_status(); + if (new_status) { + if (!same_status(¤t_status, new_status)) { + changed = true; + current_status = *new_status; + } + } + } + else { +#else + { +#endif + visualizer_keyboard_status_t new_status = { + .layer = state, + .default_layer = default_state, + .leds = leds, + }; + if (!same_status(¤t_status, &new_status)) { + changed = true; + current_status = new_status; + } } - current_status = new_status; if (changed) { chEvtBroadcast(&layer_changed_event); + } +#ifdef USE_SERIAL_LINK + static systime_t last_update = 0; + systime_t current_update = chVTGetSystemTimeX(); + systime_t delta = current_update - last_update; + if (changed || delta > MS2ST(10)) { + last_update = current_update; + visualizer_keyboard_status_t* r = begin_write_current_status(); + *r = current_status; + end_write_current_status(); + } +#endif } -- cgit v1.2.3-24-g4f1b From d835ad91a35afd4aa01a07a6907b846d5a32323d Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 12 Mar 2016 20:08:08 +0200 Subject: Resend the keyboard state every ms In case there's some errors on the link, and the packet gets lost --- serial_link/system/system.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index 9e4ee5d95..efd0991e9 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -140,13 +140,6 @@ void init_serial_link(void) { void matrix_set_remote(matrix_row_t* rows, uint8_t index); void serial_link_update(void) { - systime_t current_time = chVTGetSystemTimeX(); - if (current_time - last_update > 1000) { - *begin_write_serial_link_connected() = true; - end_write_serial_link_connected(); - last_update = current_time; - } - if (read_serial_link_connected()) { serial_link_connected = true; } @@ -157,13 +150,19 @@ void serial_link_update(void) { matrix.rows[i] = matrix_get_row(i); changed |= matrix.rows[i] != last_matrix.rows[i]; } - if (changed) { + + systime_t current_time = chVTGetSystemTimeX(); + systime_t delta = current_time - last_update; + if (changed || delta > US2ST(1000)) { + last_update = current_time; last_matrix = matrix; matrix_object_t* m = begin_write_keyboard_matrix(); for(uint8_t i=0;irows[i] = matrix.rows[i]; } end_write_keyboard_matrix(); + *begin_write_serial_link_connected() = true; + end_write_serial_link_connected(); } matrix_object_t* m = read_keyboard_matrix(0); -- cgit v1.2.3-24-g4f1b From f7275f0edea61aa0b52160f5dbdeeddb1f0e7176 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 12 Mar 2016 22:37:04 +0200 Subject: Configurable baud setting --- serial_link/system/system.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index efd0991e9..5406db3f4 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -50,10 +50,12 @@ host_driver_t serial_driver = { send_consumer }; +#ifndef SERIAL_LINK_BAUD +#error "Serial link baud is not set" +#endif -// Slow speed for testing static SerialConfig config = { - .sc_speed = 38400 + .sc_speed = SERIAL_LINK_BAUD }; static uint32_t read_from_serial(SerialDriver* driver, uint8_t link) { -- cgit v1.2.3-24-g4f1b From b93d07198a18063594a59dd193d0961622087868 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 13 Mar 2016 17:54:45 +0200 Subject: Suspend support for the visualizer --- example_integration/visualizer_user.c | 2 +- visualizer.c | 114 ++++++++++++++++++++++++++-------- visualizer.h | 17 ++++- 3 files changed, 103 insertions(+), 30 deletions(-) diff --git a/example_integration/visualizer_user.c b/example_integration/visualizer_user.c index 6c4619d95..fc09fe2ea 100644 --- a/example_integration/visualizer_user.c +++ b/example_integration/visualizer_user.c @@ -65,7 +65,7 @@ static keyframe_animation_t startup_animation = { .num_frames = 4, .loop = false, .frame_lengths = {0, MS2ST(1000), MS2ST(5000), 0}, - .frame_functions = {display_welcome, keyframe_animate_backlight_color, keyframe_no_operation, user_visualizer_inited}, + .frame_functions = {display_welcome, keyframe_animate_backlight_color, keyframe_no_operation, enable_visualization}, }; // The color animation animates the LCD color when you change layers diff --git a/visualizer.c b/visualizer.c index ca7bcb776..5b0d560ed 100644 --- a/visualizer.c +++ b/visualizer.c @@ -52,10 +52,14 @@ static visualizer_keyboard_status_t current_status = { .layer = 0xFFFFFFFF, .default_layer = 0xFFFFFFFF, .leds = 0xFFFFFFFF, + .suspended = false, }; static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboard_status_t* status2) { - return memcmp(status1, status2, sizeof(visualizer_keyboard_status_t)) == 0; + return status1->layer == status2->layer && + status1->default_layer == status2->default_layer && + status1->leds == status2->leds && + status1->suspended == status2->suspended; } static event_source_t layer_changed_event; @@ -104,6 +108,17 @@ void stop_keyframe_animation(keyframe_animation_t* animation) { } } +void stop_all_keyframe_animations(void) { + for (int i=0;icurrent_frame = animations[i]->num_frames; + animations[i]->time_left_in_frame = 0; + animations[i]->need_update = true; + animations[i] = NULL; + } + } +} + static bool update_keyframe_animation(keyframe_animation_t* animation, visualizer_state_t* state, systime_t delta, systime_t* sleep_time) { dprintf("Animation frame%d, left %d, delta %d\n", animation->current_frame, animation->time_left_in_frame, delta); @@ -252,7 +267,19 @@ bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_s } #endif // LCD_ENABLE -bool user_visualizer_inited(keyframe_animation_t* animation, visualizer_state_t* state) { +bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + (void)state; + return false; +} + +bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + (void)state; + return false; +} + +bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state) { (void)animation; (void)state; dprint("User visualizer inited\n"); @@ -268,13 +295,15 @@ static THD_FUNCTION(visualizerThread, arg) { event_listener_t event_listener; chEvtRegister(&layer_changed_event, &event_listener, 0); - visualizer_state_t state = { - .status = { - .default_layer = 0xFFFFFFFF, - .layer = 0xFFFFFFFF, - .leds = 0xFFFFFFFF, - }, + visualizer_keyboard_status_t initial_status = { + .default_layer = 0xFFFFFFFF, + .layer = 0xFFFFFFFF, + .leds = 0xFFFFFFFF, + .suspended = false, + }; + visualizer_state_t state = { + .status = initial_status, .current_lcd_color = 0, #ifdef LCD_ENABLE .font_fixed5x8 = gdispOpenFont("fixed_5x8"), @@ -301,17 +330,36 @@ static THD_FUNCTION(visualizerThread, arg) { bool enabled = visualizer_enabled; if (!same_status(&state.status, ¤t_status)) { if (visualizer_enabled) { - state.status = current_status; - update_user_visualizer_state(&state); - state.prev_lcd_color = state.current_lcd_color; + if (current_status.suspended) { + stop_all_keyframe_animations(); + visualizer_enabled = false; + state.status = current_status; + user_visualizer_suspend(&state); + } + else { + state.status = current_status; + update_user_visualizer_state(&state); + state.prev_lcd_color = state.current_lcd_color; + } } } + if (!enabled && state.status.suspended && current_status.suspended == false) { + // Setting the status to the initial status will force an update + // when the visualizer is enabled again + state.status = initial_status; + state.status.suspended = false; + stop_all_keyframe_animations(); + user_visualizer_resume(&state); + } sleep_time = TIME_INFINITE; for (int i=0;i MS2ST(10)) { + last_update = current_update; + visualizer_keyboard_status_t* r = begin_write_current_status(); + *r = current_status; + end_write_current_status(); + } +#endif +} + +void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds) { // Note that there's a small race condition here, the thread could read // a state where one of these are set but not the other. But this should // not really matter as it will be fixed during the next loop step. @@ -379,25 +444,22 @@ void visualizer_set_state(uint32_t default_state, uint32_t state, uint32_t leds) .layer = state, .default_layer = default_state, .leds = leds, + .suspended = current_status.suspended, }; if (!same_status(¤t_status, &new_status)) { changed = true; current_status = new_status; } } - if (changed) { - chEvtBroadcast(&layer_changed_event); + update_status(changed); +} - } -#ifdef USE_SERIAL_LINK - static systime_t last_update = 0; - systime_t current_update = chVTGetSystemTimeX(); - systime_t delta = current_update - last_update; - if (changed || delta > MS2ST(10)) { - last_update = current_update; - visualizer_keyboard_status_t* r = begin_write_current_status(); - *r = current_status; - end_write_current_status(); - } -#endif +void visualizer_suspend(void) { + current_status.suspended = true; + update_status(true); +} + +void visualizer_resume(void) { + current_status.suspended = false; + update_status(true); } diff --git a/visualizer.h b/visualizer.h index b7b0a3a7d..22798cda6 100644 --- a/visualizer.h +++ b/visualizer.h @@ -38,8 +38,12 @@ SOFTWARE. // This need to be called once at the start void visualizer_init(void); -// This should be called before every matrix scan -void visualizer_set_state(uint32_t default_state, uint32_t state, uint32_t leds); +// This should be called at every matrix scan +void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds); +// This should be called when the keyboard goes to suspend state +void visualizer_suspend(void); +// This should be called when the keyboard wakes up from suspend state +void visualizer_resume(void); // If you need support for more than 8 keyframes per animation, you can change this #define MAX_VISUALIZER_KEY_FRAMES 8 @@ -50,6 +54,7 @@ typedef struct { uint32_t layer; uint32_t default_layer; uint32_t leds; // See led.h for available statuses + bool suspended; } visualizer_keyboard_status_t; // The state struct is used by the various keyframe functions @@ -108,13 +113,19 @@ bool keyframe_set_backlight_color(keyframe_animation_t* animation, visualizer_st bool keyframe_display_layer_text(keyframe_animation_t* animation, visualizer_state_t* state); // Displays a bitmap (0/1) of all the currently active layers bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_state_t* state); + +bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); +bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state); + // Call this once, when the initial animation has finished, alternatively you can call it // directly from the initalize_user_visualizer function (the animation can be null) -bool user_visualizer_inited(keyframe_animation_t* animation, visualizer_state_t* state); +bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); // These two functions have to be implemented by the user void initialize_user_visualizer(visualizer_state_t* state); void update_user_visualizer_state(visualizer_state_t* state); +void user_visualizer_suspend(visualizer_state_t* state); +void user_visualizer_resume(visualizer_state_t* state); #endif /* VISUALIZER_H */ -- cgit v1.2.3-24-g4f1b From f4c11740f7bac033194ab1d5f5a52721b1d7c6d2 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 13 Mar 2016 21:35:42 +0200 Subject: Suspend power off, fix backlight animation The backlight color animation was using the wrong frame number, so it didn't work properly. --- visualizer.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/visualizer.c b/visualizer.c index 5b0d560ed..867a1d334 100644 --- a/visualizer.c +++ b/visualizer.c @@ -174,7 +174,7 @@ bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* #ifdef LCD_BACKLIGHT_ENABLE bool keyframe_animate_backlight_color(keyframe_animation_t* animation, visualizer_state_t* state) { - int frame_length = animation->frame_lengths[1]; + int frame_length = animation->frame_lengths[animation->current_frame]; int current_pos = frame_length - animation->time_left_in_frame; uint8_t t_h = LCD_HUE(state->target_lcd_color); uint8_t t_s = LCD_SAT(state->target_lcd_color); @@ -270,12 +270,21 @@ bool keyframe_display_layer_bitmap(keyframe_animation_t* animation, visualizer_s bool keyframe_disable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { (void)animation; (void)state; +#ifdef LCD_ENABLE + gdispSetPowerMode(powerOff); +#endif +#ifdef LCD_BACKLIGHT_ENABLE + lcd_backlight_hal_color(0, 0, 0); +#endif return false; } bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualizer_state_t* state) { (void)animation; (void)state; +#ifdef LCD_ENABLE + gdispSetPowerMode(powerOn); +#endif return false; } @@ -339,8 +348,8 @@ static THD_FUNCTION(visualizerThread, arg) { else { state.status = current_status; update_user_visualizer_state(&state); - state.prev_lcd_color = state.current_lcd_color; } + state.prev_lcd_color = state.current_lcd_color; } } if (!enabled && state.status.suspended && current_status.suspended == false) { @@ -350,6 +359,7 @@ static THD_FUNCTION(visualizerThread, arg) { state.status.suspended = false; stop_all_keyframe_animations(); user_visualizer_resume(&state); + state.prev_lcd_color = state.current_lcd_color; } sleep_time = TIME_INFINITE; for (int i=0;i Date: Sun, 13 Mar 2016 21:38:51 +0200 Subject: Master mode remains active It remains active even if the USB link is suspended or otherwise temporarilly goes down. --- serial_link/system/system.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index 5406db3f4..f74d8c9e9 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -88,11 +88,13 @@ static THD_FUNCTION(serialThread, arg) { EVENT_MASK(2), CHN_INPUT_AVAILABLE); bool need_wait = false; + bool is_master = false; while(true) { if (need_wait) { chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000)); } - bool is_master = usbGetDriverStateI(&USBD1) == USB_ACTIVE; + // Always stay as master, even if the USB goes into sleep mode + is_master |= usbGetDriverStateI(&USBD1) == USB_ACTIVE; router_set_master(is_master); need_wait = true; -- cgit v1.2.3-24-g4f1b From 61f7761c034d46eb0856fb115260de2679abc419 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 9 Apr 2016 19:49:52 +0300 Subject: Update ugfx with ChibiOS 4 support. Also change the URL to fredizzimo bitbucket --- .gitmodules | 2 +- ugfx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 2ab25f688..b320458c0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "ugfx"] path = ugfx - url = https://bitbucket.org/Tectu/ugfx.git + url = https://bitbucket.org/fredizzimo/ugfx.git diff --git a/ugfx b/ugfx index 2b66ac524..e221a6906 160000 --- a/ugfx +++ b/ugfx @@ -1 +1 @@ -Subproject commit 2b66ac524bd56853ba97b917683971f3ebc0104c +Subproject commit e221a690616e20f87e0b0088baffdbd5427be862 -- cgit v1.2.3-24-g4f1b From c95b17b536b4437f001d5f5e8a54753969e36bb2 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 24 Apr 2016 13:46:19 +0300 Subject: Add simple led support Also the first version of a led testing animation --- led_test.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ led_test.h | 35 +++++++++++++++++++++++++++++++++++ visualizer.c | 8 ++++++++ visualizer.h | 3 +++ visualizer.mk | 10 ++++++++-- 5 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 led_test.c create mode 100644 led_test.h diff --git a/led_test.c b/led_test.c new file mode 100644 index 000000000..1aadd5541 --- /dev/null +++ b/led_test.c @@ -0,0 +1,45 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ +#include "led_test.h" +#include "gfx.h" + +keyframe_animation_t led_test_animation = { + .num_frames = 1, + .loop = true, + .frame_lengths = {MS2ST(1000)}, + .frame_functions = { + keyframe_fade_in_all_leds, + }, +}; + +bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)state; + int frame_length = animation->frame_lengths[animation->current_frame]; + int current_pos = frame_length - animation->time_left_in_frame; + uint8_t luma = 0x255 * current_pos / frame_length; + color_t color = LUMA2COLOR(luma); + gdispGClear(LED_DISPLAY, color); + gdispGFlush(LED_DISPLAY); + return true; +} diff --git a/led_test.h b/led_test.h new file mode 100644 index 000000000..521e05216 --- /dev/null +++ b/led_test.h @@ -0,0 +1,35 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef TMK_VISUALIZER_LED_TEST_H_ +#define TMK_VISUALIZER_LED_TEST_H_ + +#include "visualizer.h" + +bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); + +extern keyframe_animation_t led_test_animation; + + +#endif /* TMK_VISUALIZER_LED_TEST_H_ */ diff --git a/visualizer.c b/visualizer.c index 867a1d334..ed5c9fa2c 100644 --- a/visualizer.c +++ b/visualizer.c @@ -77,6 +77,9 @@ static remote_object_t* remote_objects[] = { #endif +GDisplay* LCDDisplay; +GDisplay* LEDDisplay; + void start_keyframe_animation(keyframe_animation_t* animation) { animation->current_frame = -1; @@ -405,6 +408,11 @@ void visualizer_init(void) { #ifdef USE_SERIAL_LINK add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); #endif + // TODO: Make sure these works when either of these are disabled + LCDDisplay = gdispGetDisplay(0); + LEDDisplay = gdispGetDisplay(1); + + // We are using a low priority thread, the idea is to have it run only // when the main thread is sleeping during the matrix scanning chEvtObjectInit(&layer_changed_event); diff --git a/visualizer.h b/visualizer.h index 22798cda6..6a72fde1f 100644 --- a/visualizer.h +++ b/visualizer.h @@ -99,6 +99,9 @@ typedef struct keyframe_animation_t { } keyframe_animation_t; +extern GDisplay* LCD_DISPLAY; +extern GDisplay* LED_DISPLAY; + void start_keyframe_animation(keyframe_animation_t* animation); void stop_keyframe_animation(keyframe_animation_t* animation); diff --git a/visualizer.mk b/visualizer.mk index 13c5d3158..96ca468e8 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -21,13 +21,14 @@ # SOFTWARE. GFXLIB = $(VISUALIZER_DIR)/ugfx +SRC += $(GFXSRC) $(VISUALIZER_DIR)/visualizer.c +UINCDIR += $(GFXINC) $(VISUALIZER_DIR) + ifdef LCD_ENABLE include $(GFXLIB)/gfx.mk UDEFS += -DLCD_ENABLE ULIBS += -lm endif -SRC += $(GFXSRC) $(VISUALIZER_DIR)/visualizer.c -UINCDIR += $(GFXINC) $(VISUALIZER_DIR) ifdef LCD_BACKLIGHT_ENABLE SRC += $(VISUALIZER_DIR)/lcd_backlight.c @@ -35,6 +36,11 @@ SRC += lcd_backlight_hal.c UDEFS += -DLCD_BACKLIGHT_ENABLE endif +ifdef LED_ENABLE +SRC += $(VISUALIZER_DIR)/led_test.c +UDEFS += -DLED_ENABLE +endif + ifndef VISUALIZER_USER VISUALIZER_USER = visualizer_user.c endif -- cgit v1.2.3-24-g4f1b From a960a1b0066b84bbf279fbebe2d62dfee6ea3812 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 24 Apr 2016 14:10:01 +0300 Subject: Add fade out for the led test --- led_test.c | 24 +++++++++++++++++++----- led_test.h | 1 + 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/led_test.c b/led_test.c index 1aadd5541..1fba32fa0 100644 --- a/led_test.c +++ b/led_test.c @@ -25,21 +25,35 @@ SOFTWARE. #include "gfx.h" keyframe_animation_t led_test_animation = { - .num_frames = 1, + .num_frames = 3, .loop = true, - .frame_lengths = {MS2ST(1000)}, + .frame_lengths = {MS2ST(1000), MS2ST(1000), MS2ST(1000)}, .frame_functions = { keyframe_fade_in_all_leds, + keyframe_no_operation, + keyframe_fade_out_all_leds, }, }; -bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { - (void)state; +static void keyframe_fade_all_leds_from_to(keyframe_animation_t* animation, uint8_t from, uint8_t to) { int frame_length = animation->frame_lengths[animation->current_frame]; int current_pos = frame_length - animation->time_left_in_frame; - uint8_t luma = 0x255 * current_pos / frame_length; + int delta = to - from; + int luma = (delta * current_pos) / frame_length; + luma += from; color_t color = LUMA2COLOR(luma); gdispGClear(LED_DISPLAY, color); gdispGFlush(LED_DISPLAY); +} + +bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)state; + keyframe_fade_all_leds_from_to(animation, 0, 255); + return true; +} + +bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)state; + keyframe_fade_all_leds_from_to(animation, 255, 0); return true; } diff --git a/led_test.h b/led_test.h index 521e05216..a722cd9fe 100644 --- a/led_test.h +++ b/led_test.h @@ -28,6 +28,7 @@ SOFTWARE. #include "visualizer.h" bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); +bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); extern keyframe_animation_t led_test_animation; -- cgit v1.2.3-24-g4f1b From 0e0488623e8d8820a909a48a6c847866a65bf845 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 24 Apr 2016 14:54:40 +0300 Subject: Add left to right gradient keyframe for leds --- led_test.c | 34 ++++++++++++++++++++++++++++++++-- led_test.h | 1 + 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/led_test.c b/led_test.c index 1fba32fa0..197550fdd 100644 --- a/led_test.c +++ b/led_test.c @@ -23,15 +23,21 @@ SOFTWARE. */ #include "led_test.h" #include "gfx.h" +#include "math.h" keyframe_animation_t led_test_animation = { - .num_frames = 3, + .num_frames = 4, .loop = true, - .frame_lengths = {MS2ST(1000), MS2ST(1000), MS2ST(1000)}, + .frame_lengths = { + MS2ST(1000), + MS2ST(1000), + MS2ST(1000), + MS2ST(3000)}, .frame_functions = { keyframe_fade_in_all_leds, keyframe_no_operation, keyframe_fade_out_all_leds, + keyframe_led_left_to_right_gradient, }, }; @@ -46,6 +52,18 @@ static void keyframe_fade_all_leds_from_to(keyframe_animation_t* animation, uint gdispGFlush(LED_DISPLAY); } +// TODO: Should be customizable per keyboard +#define NUM_ROWS 7 +#define NUM_COLS 7 + +static uint8_t compute_gradient_color(float t, float index, float num) { + float d = fabs(index - t); + if (d > num / 2.0f) { + d = num - d; + } + return (uint8_t)(255.0f * d); +} + bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { (void)state; keyframe_fade_all_leds_from_to(animation, 0, 255); @@ -57,3 +75,15 @@ bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_stat keyframe_fade_all_leds_from_to(animation, 255, 0); return true; } + +bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)state; + int frame_length = animation->frame_lengths[animation->current_frame]; + int current_pos = frame_length - animation->time_left_in_frame; + float t = current_pos / frame_length; + for (int i=0; i< NUM_COLS; i++) { + uint8_t color = compute_gradient_color(t, i, NUM_COLS); + gdispGDrawLine(LED_DISPLAY, i, 0, i, NUM_ROWS - 1, LUMA2COLOR(color)); + } + return true; +} diff --git a/led_test.h b/led_test.h index a722cd9fe..03737a717 100644 --- a/led_test.h +++ b/led_test.h @@ -29,6 +29,7 @@ SOFTWARE. bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_state_t* state); +bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state); extern keyframe_animation_t led_test_animation; -- cgit v1.2.3-24-g4f1b From 444132edd056cd52a60e3551d1f6c1a07909c040 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 24 Apr 2016 15:45:52 +0300 Subject: Add last and first update of frame for anims --- visualizer.c | 9 +++++++++ visualizer.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/visualizer.c b/visualizer.c index ed5c9fa2c..219d44cd3 100644 --- a/visualizer.c +++ b/visualizer.c @@ -103,6 +103,8 @@ void stop_keyframe_animation(keyframe_animation_t* animation) { animation->current_frame = animation->num_frames; animation->time_left_in_frame = 0; animation->need_update = true; + animation->first_update_of_frame = false; + animation->last_update_of_frame = false; for (int i=0;icurrent_frame = animations[i]->num_frames; animations[i]->time_left_in_frame = 0; animations[i]->need_update = true; + animations[i]->first_update_of_frame = false; + animations[i]->last_update_of_frame = false; animations[i] = NULL; } } @@ -133,16 +137,20 @@ static bool update_keyframe_animation(keyframe_animation_t* animation, visualize animation->current_frame = 0; animation->time_left_in_frame = animation->frame_lengths[0]; animation->need_update = true; + animation->first_update_of_frame = true; } else { animation->time_left_in_frame -= delta; while (animation->time_left_in_frame <= 0) { int left = animation->time_left_in_frame; if (animation->need_update) { animation->time_left_in_frame = 0; + animation->last_update_of_frame = true; (*animation->frame_functions[animation->current_frame])(animation, state); + animation->last_update_of_frame = false; } animation->current_frame++; animation->need_update = true; + animation->first_update_of_frame = true; if (animation->current_frame == animation->num_frames) { if (animation->loop) { animation->current_frame = 0; @@ -159,6 +167,7 @@ static bool update_keyframe_animation(keyframe_animation_t* animation, visualize } if (animation->need_update) { animation->need_update = (*animation->frame_functions[animation->current_frame])(animation, state); + animation->first_update_of_frame = false; } int wanted_sleep = animation->need_update ? 10 : animation->time_left_in_frame; diff --git a/visualizer.h b/visualizer.h index 6a72fde1f..82d7a71d3 100644 --- a/visualizer.h +++ b/visualizer.h @@ -95,6 +95,8 @@ typedef struct keyframe_animation_t { // keyframe update functions int current_frame; int time_left_in_frame; + bool first_update_of_frame; + bool last_update_of_frame; bool need_update; } keyframe_animation_t; -- cgit v1.2.3-24-g4f1b From 891edbd533acdffec66416c59f4b6066e5e18aaa Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 24 Apr 2016 16:19:31 +0300 Subject: Add function for running the next keyframe --- visualizer.c | 15 +++++++++++++++ visualizer.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/visualizer.c b/visualizer.c index 219d44cd3..2ec6e34f5 100644 --- a/visualizer.c +++ b/visualizer.c @@ -178,6 +178,21 @@ static bool update_keyframe_animation(keyframe_animation_t* animation, visualize return true; } +void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state) { + int next_frame = animation->current_frame + 1; + if (next_frame == animation->num_frames) { + next_frame = 0; + } + keyframe_animation_t temp_animation = *animation; + temp_animation.current_frame = next_frame; + temp_animation.time_left_in_frame = animation->frame_lengths[next_frame]; + temp_animation.first_update_of_frame = true; + temp_animation.last_update_of_frame = false; + temp_animation.need_update = false; + visualizer_state_t temp_state = *state; + (*temp_animation.frame_functions[next_frame])(&temp_animation, &temp_state); +} + bool keyframe_no_operation(keyframe_animation_t* animation, visualizer_state_t* state) { (void)animation; (void)state; diff --git a/visualizer.h b/visualizer.h index 82d7a71d3..5375e0130 100644 --- a/visualizer.h +++ b/visualizer.h @@ -106,6 +106,9 @@ extern GDisplay* LED_DISPLAY; void start_keyframe_animation(keyframe_animation_t* animation); void stop_keyframe_animation(keyframe_animation_t* animation); +// This runs the next keyframe, but does not update the animation state +// Useful for crossfades for example +void run_next_keyframe(keyframe_animation_t* animation, visualizer_state_t* state); // Some predefined keyframe functions that can be used by the user code // Does nothing, useful for adding delays -- cgit v1.2.3-24-g4f1b From 0530ebb77d6961a7edc14f3a5b943165a8b52497 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 24 Apr 2016 16:20:00 +0300 Subject: Add led crossfading --- led_test.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ led_test.h | 2 ++ 2 files changed, 64 insertions(+), 6 deletions(-) diff --git a/led_test.c b/led_test.c index 197550fdd..8c0de604a 100644 --- a/led_test.c +++ b/led_test.c @@ -26,27 +26,41 @@ SOFTWARE. #include "math.h" keyframe_animation_t led_test_animation = { - .num_frames = 4, + .num_frames = 8, .loop = true, .frame_lengths = { - MS2ST(1000), - MS2ST(1000), - MS2ST(1000), - MS2ST(3000)}, + MS2ST(1000), // fade in + MS2ST(1000), // no op (leds on) + MS2ST(1000), // fade out + MS2ST(1000), // crossfade + MS2ST(3000), // left to rigt + MS2ST(1000), // crossfade + MS2ST(3000), // top_to_bottom + MS2ST(1000), // crossfade + }, .frame_functions = { keyframe_fade_in_all_leds, keyframe_no_operation, keyframe_fade_out_all_leds, + keyframe_led_crossfade, keyframe_led_left_to_right_gradient, + keyframe_led_crossfade, + keyframe_led_top_to_bottom_gradient, + keyframe_led_crossfade }, }; -static void keyframe_fade_all_leds_from_to(keyframe_animation_t* animation, uint8_t from, uint8_t to) { +static uint8_t fade_led_color(keyframe_animation_t* animation, uint8_t from, uint8_t to) { int frame_length = animation->frame_lengths[animation->current_frame]; int current_pos = frame_length - animation->time_left_in_frame; int delta = to - from; int luma = (delta * current_pos) / frame_length; luma += from; + return luma; +} + +static void keyframe_fade_all_leds_from_to(keyframe_animation_t* animation, uint8_t from, uint8_t to) { + uint8_t luma = fade_led_color(animation, from, to); color_t color = LUMA2COLOR(luma); gdispGClear(LED_DISPLAY, color); gdispGFlush(LED_DISPLAY); @@ -56,6 +70,9 @@ static void keyframe_fade_all_leds_from_to(keyframe_animation_t* animation, uint #define NUM_ROWS 7 #define NUM_COLS 7 +static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; +static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; + static uint8_t compute_gradient_color(float t, float index, float num) { float d = fabs(index - t); if (d > num / 2.0f) { @@ -85,5 +102,44 @@ bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visual uint8_t color = compute_gradient_color(t, i, NUM_COLS); gdispGDrawLine(LED_DISPLAY, i, 0, i, NUM_ROWS - 1, LUMA2COLOR(color)); } + gdispGFlush(LED_DISPLAY); + return true; +} + +bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)state; + int frame_length = animation->frame_lengths[animation->current_frame]; + int current_pos = frame_length - animation->time_left_in_frame; + float t = current_pos / frame_length; + for (int i=0; i< NUM_ROWS; i++) { + uint8_t color = compute_gradient_color(t, i, NUM_ROWS); + gdispGDrawLine(LED_DISPLAY, 0, i, NUM_COLS - 1, i, LUMA2COLOR(color)); + } + gdispGFlush(LED_DISPLAY); + return true; +} + +static void copy_current_led_state(uint8_t* dest) { + for (int i=0;ifirst_update_of_frame) { + copy_current_led_state(&crossfade_start_frame[0][0]); + run_next_keyframe(animation, state); + copy_current_led_state(&crossfade_end_frame[0][0]); + } + for (int i=0;i Date: Sun, 24 Apr 2016 16:26:53 +0300 Subject: LEDS are flushed automatically After running the animation, instead of having to do it manually. This avoids duplicate flushing, and better support for cross-fades. --- led_test.c | 4 ---- visualizer.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/led_test.c b/led_test.c index 8c0de604a..c987eca38 100644 --- a/led_test.c +++ b/led_test.c @@ -63,7 +63,6 @@ static void keyframe_fade_all_leds_from_to(keyframe_animation_t* animation, uint uint8_t luma = fade_led_color(animation, from, to); color_t color = LUMA2COLOR(luma); gdispGClear(LED_DISPLAY, color); - gdispGFlush(LED_DISPLAY); } // TODO: Should be customizable per keyboard @@ -102,7 +101,6 @@ bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visual uint8_t color = compute_gradient_color(t, i, NUM_COLS); gdispGDrawLine(LED_DISPLAY, i, 0, i, NUM_ROWS - 1, LUMA2COLOR(color)); } - gdispGFlush(LED_DISPLAY); return true; } @@ -115,7 +113,6 @@ bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visual uint8_t color = compute_gradient_color(t, i, NUM_ROWS); gdispGDrawLine(LED_DISPLAY, 0, i, NUM_COLS - 1, i, LUMA2COLOR(color)); } - gdispGFlush(LED_DISPLAY); return true; } @@ -140,6 +137,5 @@ bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* gdispGDrawPixel(LED_DISPLAY, j, i, color); } } - gdispGFlush(LED_DISPLAY); return true; } diff --git a/visualizer.c b/visualizer.c index 2ec6e34f5..81ec8298f 100644 --- a/visualizer.c +++ b/visualizer.c @@ -127,6 +127,7 @@ void stop_all_keyframe_animations(void) { } static bool update_keyframe_animation(keyframe_animation_t* animation, visualizer_state_t* state, systime_t delta, systime_t* sleep_time) { + // TODO: Clean up this messy code dprintf("Animation frame%d, left %d, delta %d\n", animation->current_frame, animation->time_left_in_frame, delta); if (animation->current_frame == animation->num_frames) { @@ -394,6 +395,9 @@ static THD_FUNCTION(visualizerThread, arg) { update_keyframe_animation(animations[i], &state, delta, &sleep_time); } } +#ifdef LED_ENABLE + gdispGFlush(LED_DISPLAY); +#endif // The animation can enable the visualizer // And we might need to update the state when that happens // so don't sleep -- cgit v1.2.3-24-g4f1b From 74baa4895c8efd409eb10eaf1e6cfc0e2677b45c Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 24 Apr 2016 16:40:41 +0300 Subject: Run mirrored keyframes for led tests as well --- led_test.c | 34 ++++++++++++++++++++++++++++++---- led_test.h | 2 ++ visualizer.h | 4 ++-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/led_test.c b/led_test.c index c987eca38..ce6c2e68e 100644 --- a/led_test.c +++ b/led_test.c @@ -26,17 +26,24 @@ SOFTWARE. #include "math.h" keyframe_animation_t led_test_animation = { - .num_frames = 8, + .num_frames = 14, .loop = true, .frame_lengths = { MS2ST(1000), // fade in MS2ST(1000), // no op (leds on) MS2ST(1000), // fade out MS2ST(1000), // crossfade - MS2ST(3000), // left to rigt + MS2ST(3000), // left to rigt (outside in) MS2ST(1000), // crossfade MS2ST(3000), // top_to_bottom + 0, // mirror leds MS2ST(1000), // crossfade + MS2ST(3000), // left_to_right (mirrored, so inside out) + MS2ST(1000), // crossfade + MS2ST(3000), // top_to_bottom + 0, // normal leds + MS2ST(1000), // crossfade + }, .frame_functions = { keyframe_fade_in_all_leds, @@ -46,7 +53,13 @@ keyframe_animation_t led_test_animation = { keyframe_led_left_to_right_gradient, keyframe_led_crossfade, keyframe_led_top_to_bottom_gradient, - keyframe_led_crossfade + keyframe_mirror_led_orientation, + keyframe_led_crossfade, + keyframe_led_left_to_right_gradient, + keyframe_led_crossfade, + keyframe_led_top_to_bottom_gradient, + keyframe_normal_led_orientation, + keyframe_led_crossfade, }, }; @@ -123,7 +136,6 @@ static void copy_current_led_state(uint8_t* dest) { } } } - bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state) { (void)state; if (animation->first_update_of_frame) { @@ -139,3 +151,17 @@ bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* } return true; } + +bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)state; + (void)animation; + gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180); + return true; +} + +bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)state; + (void)animation; + gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0); + return true; +} diff --git a/led_test.h b/led_test.h index e14b25e79..5e2325753 100644 --- a/led_test.h +++ b/led_test.h @@ -32,6 +32,8 @@ bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_stat bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state); bool keyframe_led_crossfade(keyframe_animation_t* animation, visualizer_state_t* state); +bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state); +bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state); extern keyframe_animation_t led_test_animation; diff --git a/visualizer.h b/visualizer.h index 5375e0130..8a2772c6d 100644 --- a/visualizer.h +++ b/visualizer.h @@ -45,8 +45,8 @@ void visualizer_suspend(void); // This should be called when the keyboard wakes up from suspend state void visualizer_resume(void); -// If you need support for more than 8 keyframes per animation, you can change this -#define MAX_VISUALIZER_KEY_FRAMES 8 +// If you need support for more than 16 keyframes per animation, you can change this +#define MAX_VISUALIZER_KEY_FRAMES 16 struct keyframe_animation_t; -- cgit v1.2.3-24-g4f1b From 6313cfd5597ffce0c70a472aa87ed68b6daa4419 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 24 Apr 2016 17:44:11 +0300 Subject: Fix some makefile issues, and symbol issues --- visualizer.c | 8 ++++---- visualizer.mk | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/visualizer.c b/visualizer.c index 81ec8298f..0684a26d8 100644 --- a/visualizer.c +++ b/visualizer.c @@ -77,8 +77,8 @@ static remote_object_t* remote_objects[] = { #endif -GDisplay* LCDDisplay; -GDisplay* LEDDisplay; +GDisplay* LCD_DISPLAY = 0; +GDisplay* LED_DISPLAY = 0; void start_keyframe_animation(keyframe_animation_t* animation) { @@ -437,8 +437,8 @@ void visualizer_init(void) { add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); #endif // TODO: Make sure these works when either of these are disabled - LCDDisplay = gdispGetDisplay(0); - LEDDisplay = gdispGetDisplay(1); + LCD_DISPLAY = gdispGetDisplay(0); + LED_DISPLAY = gdispGetDisplay(1); // We are using a low priority thread, the idea is to have it run only diff --git a/visualizer.mk b/visualizer.mk index 96ca468e8..5cc199cf4 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -21,13 +21,13 @@ # SOFTWARE. GFXLIB = $(VISUALIZER_DIR)/ugfx -SRC += $(GFXSRC) $(VISUALIZER_DIR)/visualizer.c +SRC += $(VISUALIZER_DIR)/visualizer.c UINCDIR += $(GFXINC) $(VISUALIZER_DIR) ifdef LCD_ENABLE -include $(GFXLIB)/gfx.mk UDEFS += -DLCD_ENABLE ULIBS += -lm +USE_UGFX = yes endif ifdef LCD_BACKLIGHT_ENABLE @@ -39,6 +39,12 @@ endif ifdef LED_ENABLE SRC += $(VISUALIZER_DIR)/led_test.c UDEFS += -DLED_ENABLE +USE_UGFX = yes +endif + +ifdef USE_UGFX +include $(GFXLIB)/gfx.mk +SRC += $(GFXSRC) endif ifndef VISUALIZER_USER -- cgit v1.2.3-24-g4f1b From f0c8e7c495af2aad476f4c428b700ed26188a8e5 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 30 Apr 2016 22:45:41 +0300 Subject: Fix a few led test animation issues --- led_test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/led_test.c b/led_test.c index ce6c2e68e..ed65a0baa 100644 --- a/led_test.c +++ b/led_test.c @@ -63,7 +63,7 @@ keyframe_animation_t led_test_animation = { }, }; -static uint8_t fade_led_color(keyframe_animation_t* animation, uint8_t from, uint8_t to) { +static uint8_t fade_led_color(keyframe_animation_t* animation, int from, int to) { int frame_length = animation->frame_lengths[animation->current_frame]; int current_pos = frame_length - animation->time_left_in_frame; int delta = to - from; @@ -107,8 +107,8 @@ bool keyframe_fade_out_all_leds(keyframe_animation_t* animation, visualizer_stat bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { (void)state; - int frame_length = animation->frame_lengths[animation->current_frame]; - int current_pos = frame_length - animation->time_left_in_frame; + float frame_length = animation->frame_lengths[animation->current_frame]; + float current_pos = frame_length - animation->time_left_in_frame; float t = current_pos / frame_length; for (int i=0; i< NUM_COLS; i++) { uint8_t color = compute_gradient_color(t, i, NUM_COLS); @@ -119,8 +119,8 @@ bool keyframe_led_left_to_right_gradient(keyframe_animation_t* animation, visual bool keyframe_led_top_to_bottom_gradient(keyframe_animation_t* animation, visualizer_state_t* state) { (void)state; - int frame_length = animation->frame_lengths[animation->current_frame]; - int current_pos = frame_length - animation->time_left_in_frame; + float frame_length = animation->frame_lengths[animation->current_frame]; + float current_pos = frame_length - animation->time_left_in_frame; float t = current_pos / frame_length; for (int i=0; i< NUM_ROWS; i++) { uint8_t color = compute_gradient_color(t, i, NUM_ROWS); @@ -156,12 +156,12 @@ bool keyframe_mirror_led_orientation(keyframe_animation_t* animation, visualizer (void)state; (void)animation; gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_180); - return true; + return false; } bool keyframe_normal_led_orientation(keyframe_animation_t* animation, visualizer_state_t* state) { (void)state; (void)animation; gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0); - return true; + return false; } -- cgit v1.2.3-24-g4f1b From 25382cb6f21b6136b0f490a618ce8d494ca5cd38 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 11 May 2016 22:06:26 +0300 Subject: Fix compute_gradient_color --- led_test.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/led_test.c b/led_test.c index ed65a0baa..d358ef81e 100644 --- a/led_test.c +++ b/led_test.c @@ -86,10 +86,13 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; static uint8_t compute_gradient_color(float t, float index, float num) { - float d = fabs(index - t); - if (d > num / 2.0f) { + const float target = t * (num - 1.0f); + const float half_num = num / 2.0f; + float d = fabs(index - target); + if (d > half_num) { d = num - d; } + d = 1.0f - (d / half_num); return (uint8_t)(255.0f * d); } -- cgit v1.2.3-24-g4f1b From 3b422d2ac4340ecea6b2fc2f3a855581c737faf8 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 15 May 2016 11:36:39 +0300 Subject: Add debug print for serial link errors This is disabled by default --- serial_link/system/system.c | 52 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index f74d8c9e9..5a47d8b83 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -58,6 +58,8 @@ static SerialConfig config = { .sc_speed = SERIAL_LINK_BAUD }; +//#define DEBUG_LINK_ERRORS + static uint32_t read_from_serial(SerialDriver* driver, uint8_t link) { const uint32_t buffer_size = 16; uint8_t buffer[buffer_size]; @@ -71,6 +73,37 @@ static uint32_t read_from_serial(SerialDriver* driver, uint8_t link) { return bytes_read; } +static void print_error(char* str, eventflags_t flags, SerialDriver* driver) { +#ifdef DEBUG_LINK_ERRORS + if (flags & SD_PARITY_ERROR) { + print(str); + print(" Parity error\n"); + } + if (flags & SD_FRAMING_ERROR) { + print(str); + print(" Framing error\n"); + } + if (flags & SD_OVERRUN_ERROR) { + print(str); + uint32_t size = qSpaceI(&(driver->iqueue)); + xprintf(" Overrun error, queue size %d\n", size); + + } + if (flags & SD_NOISE_ERROR) { + print(str); + print(" Noise error\n"); + } + if (flags & SD_BREAK_DETECTED) { + print(str); + print(" Break detected\n"); + } +#else + (void)str; + (void)flags; + (void)driver; +#endif +} + // TODO: Optimize the stack size, this is probably way too big static THD_WORKING_AREA(serialThreadStack, 1024); static THD_FUNCTION(serialThread, arg) { @@ -79,20 +112,33 @@ static THD_FUNCTION(serialThread, arg) { event_listener_t sd1_listener; event_listener_t sd2_listener; chEvtRegister(&new_data_event, &new_data_listener, 0); + eventflags_t events = CHN_INPUT_AVAILABLE + | SD_PARITY_ERROR | SD_FRAMING_ERROR | SD_OVERRUN_ERROR | SD_NOISE_ERROR | SD_BREAK_DETECTED; chEvtRegisterMaskWithFlags(chnGetEventSource(&SD1), &sd1_listener, EVENT_MASK(1), - CHN_INPUT_AVAILABLE); + events); chEvtRegisterMaskWithFlags(chnGetEventSource(&SD2), &sd2_listener, EVENT_MASK(2), - CHN_INPUT_AVAILABLE); + events); bool need_wait = false; bool is_master = false; while(true) { + eventflags_t flags1 = 0; + eventflags_t flags2 = 0; if (need_wait) { - chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000)); + eventmask_t mask = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000)); + if (mask & EVENT_MASK(1)) { + flags1 = chEvtGetAndClearFlags(&sd1_listener); + print_error("DOWNLINK", flags1, &SD1); + } + if (mask & EVENT_MASK(2)) { + flags2 = chEvtGetAndClearFlags(&sd2_listener); + print_error("UPLINK", flags2, &SD2); + } } + // Always stay as master, even if the USB goes into sleep mode is_master |= usbGetDriverStateI(&USBD1) == USB_ACTIVE; router_set_master(is_master); -- cgit v1.2.3-24-g4f1b From a08bcea9983cc97fb2f567c303622495f19a5a1e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 15 May 2016 11:58:20 +0300 Subject: Don't accept remote objects with the wrong size Fixes memory corruption when the crc happens to match, but the size doesn't. --- serial_link/protocol/transport.c | 30 ++++++++++++++------------ serial_link/tests/transport_tests.c | 43 +++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 14 deletions(-) diff --git a/serial_link/protocol/transport.c b/serial_link/protocol/transport.c index efc00e79e..f418d11ce 100644 --- a/serial_link/protocol/transport.c +++ b/serial_link/protocol/transport.c @@ -73,21 +73,23 @@ void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { uint8_t id = data[size-1]; if (id < num_remote_objects) { remote_object_t* obj = remote_objects[id]; - uint8_t* start; - if (obj->object_type == MASTER_TO_ALL_SLAVES) { - start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - } - else if(obj->object_type == SLAVE_TO_MASTER) { - start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); - } - else { - start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); + if (obj->object_size == size - 1) { + uint8_t* start; + if (obj->object_type == MASTER_TO_ALL_SLAVES) { + start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + } + else if(obj->object_type == SLAVE_TO_MASTER) { + start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); + } + else { + start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); + } + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); + memcpy(ptr, data, size - 1); + triple_buffer_end_write_internal(tb); } - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; - void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); - memcpy(ptr, data, size -1); - triple_buffer_end_write_internal(tb); } } diff --git a/serial_link/tests/transport_tests.c b/serial_link/tests/transport_tests.c index 02a7a1042..358e1b9fd 100644 --- a/serial_link/tests/transport_tests.c +++ b/serial_link/tests/transport_tests.c @@ -123,3 +123,46 @@ Ensure(Transport, writes_from_master_to_single_slave) { assert_that(obj2, is_not_equal_to(NULL)); assert_that(obj2->test, is_equal_to(7)); } + +Ensure(Transport, ignores_object_with_invalid_id) { + update_transport(); + test_object1_t* obj = begin_write_master_to_single_slave(3); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_single_slave(3); + expect(router_send_frame, + when(destination, is_equal_to(4))); + update_transport(); + sent_data[sent_data_size - 1] = 44; + transport_recv_frame(0, sent_data, sent_data_size); + test_object1_t* obj2 = read_master_to_single_slave(); + assert_that(obj2, is_equal_to(NULL)); +} + +Ensure(Transport, ignores_object_with_size_too_small) { + update_transport(); + test_object1_t* obj = begin_write_master_to_slave(); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_slave(); + expect(router_send_frame); + update_transport(); + sent_data[sent_data_size - 2] = 0; + transport_recv_frame(0, sent_data, sent_data_size - 1); + test_object1_t* obj2 = read_master_to_slave(); + assert_that(obj2, is_equal_to(NULL)); +} + +Ensure(Transport, ignores_object_with_size_too_big) { + update_transport(); + test_object1_t* obj = begin_write_master_to_slave(); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_slave(); + expect(router_send_frame); + update_transport(); + sent_data[sent_data_size + 21] = 0; + transport_recv_frame(0, sent_data, sent_data_size + 22); + test_object1_t* obj2 = read_master_to_slave(); + assert_that(obj2, is_equal_to(NULL)); +} -- cgit v1.2.3-24-g4f1b From b4ab61171e83eeca82fbc1930fcaab175b45c656 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 15 May 2016 12:59:50 +0300 Subject: Configurable serializer thread priority --- serial_link/system/system.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/serial_link/system/system.c b/serial_link/system/system.c index 5a47d8b83..f5af9baa7 100644 --- a/serial_link/system/system.c +++ b/serial_link/system/system.c @@ -32,6 +32,7 @@ SOFTWARE. #include "matrix.h" #include #include "print.h" +#include "config.h" static event_source_t new_data_event; static bool serial_link_connected; @@ -50,10 +51,15 @@ host_driver_t serial_driver = { send_consumer }; +// Define these in your Config.h file #ifndef SERIAL_LINK_BAUD #error "Serial link baud is not set" #endif +#ifndef SERIAL_LINK_THREAD_PRIORITY +#error "Serial link thread priority not set" +#endif + static SerialConfig config = { .sc_speed = SERIAL_LINK_BAUD }; @@ -184,7 +190,7 @@ void init_serial_link(void) { sdStart(&SD2, &config); chEvtObjectInit(&new_data_event); (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), - LOWPRIO, serialThread, NULL); + SERIAL_LINK_THREAD_PRIORITY, serialThread, NULL); } void matrix_set_remote(matrix_row_t* rows, uint8_t index); -- cgit v1.2.3-24-g4f1b From a0297a892ee1fc571cd9bdc447d2c2726a210629 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 15 May 2016 13:38:59 +0300 Subject: Rename system to serial_link Also combined driver.h with serial_link.h --- serial_link/protocol/transport.h | 2 +- serial_link/protocol/triple_buffered_object.c | 2 +- serial_link/system/driver.h | 36 ---- serial_link/system/serial_link.c | 261 +++++++++++++++++++++++++ serial_link/system/serial_link.h | 62 ++++++ serial_link/system/system.c | 262 -------------------------- serial_link/system/system.h | 55 ------ 7 files changed, 325 insertions(+), 355 deletions(-) delete mode 100644 serial_link/system/driver.h create mode 100644 serial_link/system/serial_link.c create mode 100644 serial_link/system/serial_link.h delete mode 100644 serial_link/system/system.c delete mode 100644 serial_link/system/system.h diff --git a/serial_link/protocol/transport.h b/serial_link/protocol/transport.h index e518aaa6e..9a052d880 100644 --- a/serial_link/protocol/transport.h +++ b/serial_link/protocol/transport.h @@ -26,7 +26,7 @@ SOFTWARE. #define SERIAL_LINK_TRANSPORT_H #include "serial_link/protocol/triple_buffered_object.h" -#include "serial_link/system/system.h" +#include "serial_link/system/serial_link.h" #define NUM_SLAVES 8 #define LOCAL_OBJECT_EXTRA 16 diff --git a/serial_link/protocol/triple_buffered_object.c b/serial_link/protocol/triple_buffered_object.c index c6bf28af0..e3e8989d3 100644 --- a/serial_link/protocol/triple_buffered_object.c +++ b/serial_link/protocol/triple_buffered_object.c @@ -23,7 +23,7 @@ SOFTWARE. */ #include "serial_link/protocol/triple_buffered_object.h" -#include "serial_link/system/system.h" +#include "serial_link/system/serial_link.h" #include #include diff --git a/serial_link/system/driver.h b/serial_link/system/driver.h deleted file mode 100644 index 76e2d682c..000000000 --- a/serial_link/system/driver.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_DRIVER_H -#define SERIAL_LINK_DRIVER_H - -#include "host_driver.h" - -void init_serial_link(void); -void init_serial_link_hal(void); -bool is_serial_link_connected(void); -host_driver_t* get_serial_link_driver(void); -void serial_link_update(void); - -#endif diff --git a/serial_link/system/serial_link.c b/serial_link/system/serial_link.c new file mode 100644 index 000000000..27e61a9e9 --- /dev/null +++ b/serial_link/system/serial_link.c @@ -0,0 +1,261 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ +#include "report.h" +#include "host_driver.h" +#include "serial_link/system/serial_link.h" +#include "hal.h" +#include "serial_link/protocol/byte_stuffer.h" +#include "serial_link/protocol/transport.h" +#include "serial_link/protocol/frame_router.h" +#include "matrix.h" +#include +#include "print.h" +#include "config.h" + +static event_source_t new_data_event; +static bool serial_link_connected; + +static uint8_t keyboard_leds(void); +static void send_keyboard(report_keyboard_t *report); +static void send_mouse(report_mouse_t *report); +static void send_system(uint16_t data); +static void send_consumer(uint16_t data); + +host_driver_t serial_driver = { + keyboard_leds, + send_keyboard, + send_mouse, + send_system, + send_consumer +}; + +// Define these in your Config.h file +#ifndef SERIAL_LINK_BAUD +#error "Serial link baud is not set" +#endif + +#ifndef SERIAL_LINK_THREAD_PRIORITY +#error "Serial link thread priority not set" +#endif + +static SerialConfig config = { + .sc_speed = SERIAL_LINK_BAUD +}; + +//#define DEBUG_LINK_ERRORS + +static uint32_t read_from_serial(SerialDriver* driver, uint8_t link) { + const uint32_t buffer_size = 16; + uint8_t buffer[buffer_size]; + uint32_t bytes_read = sdAsynchronousRead(driver, buffer, buffer_size); + uint8_t* current = buffer; + uint8_t* end = current + bytes_read; + while(current < end) { + byte_stuffer_recv_byte(link, *current); + current++; + } + return bytes_read; +} + +static void print_error(char* str, eventflags_t flags, SerialDriver* driver) { +#ifdef DEBUG_LINK_ERRORS + if (flags & SD_PARITY_ERROR) { + print(str); + print(" Parity error\n"); + } + if (flags & SD_FRAMING_ERROR) { + print(str); + print(" Framing error\n"); + } + if (flags & SD_OVERRUN_ERROR) { + print(str); + uint32_t size = qSpaceI(&(driver->iqueue)); + xprintf(" Overrun error, queue size %d\n", size); + + } + if (flags & SD_NOISE_ERROR) { + print(str); + print(" Noise error\n"); + } + if (flags & SD_BREAK_DETECTED) { + print(str); + print(" Break detected\n"); + } +#else + (void)str; + (void)flags; + (void)driver; +#endif +} + +// TODO: Optimize the stack size, this is probably way too big +static THD_WORKING_AREA(serialThreadStack, 1024); +static THD_FUNCTION(serialThread, arg) { + (void)arg; + event_listener_t new_data_listener; + event_listener_t sd1_listener; + event_listener_t sd2_listener; + chEvtRegister(&new_data_event, &new_data_listener, 0); + eventflags_t events = CHN_INPUT_AVAILABLE + | SD_PARITY_ERROR | SD_FRAMING_ERROR | SD_OVERRUN_ERROR | SD_NOISE_ERROR | SD_BREAK_DETECTED; + chEvtRegisterMaskWithFlags(chnGetEventSource(&SD1), + &sd1_listener, + EVENT_MASK(1), + events); + chEvtRegisterMaskWithFlags(chnGetEventSource(&SD2), + &sd2_listener, + EVENT_MASK(2), + events); + bool need_wait = false; + bool is_master = false; + while(true) { + eventflags_t flags1 = 0; + eventflags_t flags2 = 0; + if (need_wait) { + eventmask_t mask = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000)); + if (mask & EVENT_MASK(1)) { + flags1 = chEvtGetAndClearFlags(&sd1_listener); + print_error("DOWNLINK", flags1, &SD1); + } + if (mask & EVENT_MASK(2)) { + flags2 = chEvtGetAndClearFlags(&sd2_listener); + print_error("UPLINK", flags2, &SD2); + } + } + + // Always stay as master, even if the USB goes into sleep mode + is_master |= usbGetDriverStateI(&USBD1) == USB_ACTIVE; + router_set_master(is_master); + + need_wait = true; + need_wait &= read_from_serial(&SD2, UP_LINK) == 0; + need_wait &= read_from_serial(&SD1, DOWN_LINK) == 0; + update_transport(); + } +} + +void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + if (link == DOWN_LINK) { + sdWrite(&SD1, data, size); + } + else { + sdWrite(&SD2, data, size); + } +} + +static systime_t last_update = 0; + +typedef struct { + matrix_row_t rows[MATRIX_ROWS]; +} matrix_object_t; + +static matrix_object_t last_matrix = {}; + +SLAVE_TO_MASTER_OBJECT(keyboard_matrix, matrix_object_t); +MASTER_TO_ALL_SLAVES_OBJECT(serial_link_connected, bool); + +static remote_object_t* remote_objects[] = { + REMOTE_OBJECT(serial_link_connected), + REMOTE_OBJECT(keyboard_matrix), +}; + +void init_serial_link(void) { + serial_link_connected = false; + init_serial_link_hal(); + add_remote_objects(remote_objects, sizeof(remote_objects)/sizeof(remote_object_t*)); + init_byte_stuffer(); + sdStart(&SD1, &config); + sdStart(&SD2, &config); + chEvtObjectInit(&new_data_event); + (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), + SERIAL_LINK_THREAD_PRIORITY, serialThread, NULL); +} + +void matrix_set_remote(matrix_row_t* rows, uint8_t index); + +void serial_link_update(void) { + if (read_serial_link_connected()) { + serial_link_connected = true; + } + + matrix_object_t matrix; + bool changed = false; + for(uint8_t i=0;i US2ST(1000)) { + last_update = current_time; + last_matrix = matrix; + matrix_object_t* m = begin_write_keyboard_matrix(); + for(uint8_t i=0;irows[i] = matrix.rows[i]; + } + end_write_keyboard_matrix(); + *begin_write_serial_link_connected() = true; + end_write_serial_link_connected(); + } + + matrix_object_t* m = read_keyboard_matrix(0); + if (m) { + matrix_set_remote(m->rows, 0); + } +} + +void signal_data_written(void) { + chEvtBroadcast(&new_data_event); +} + +bool is_serial_link_connected(void) { + return serial_link_connected; +} + +host_driver_t* get_serial_link_driver(void) { + return &serial_driver; +} + +// NOTE: The driver does nothing, because the master handles everything +uint8_t keyboard_leds(void) { + return 0; +} + +void send_keyboard(report_keyboard_t *report) { + (void)report; +} + +void send_mouse(report_mouse_t *report) { + (void)report; +} + +void send_system(uint16_t data) { + (void)data; +} + +void send_consumer(uint16_t data) { + (void)data; +} + diff --git a/serial_link/system/serial_link.h b/serial_link/system/serial_link.h new file mode 100644 index 000000000..132cb657f --- /dev/null +++ b/serial_link/system/serial_link.h @@ -0,0 +1,62 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_H +#define SERIAL_LINK_H + +#include "host_driver.h" +#include + +void init_serial_link(void); +void init_serial_link_hal(void); +bool is_serial_link_connected(void); +host_driver_t* get_serial_link_driver(void); +void serial_link_update(void); + +#if defined(PROTOCOL_CHIBIOS) +#include "ch.h" + +static inline void serial_link_lock(void) { + chSysLock(); +} + +static inline void serial_link_unlock(void) { + chSysUnlock(); +} + +void signal_data_written(void); + +#else + +inline void serial_link_lock(void) { +} + +inline void serial_link_unlock(void) { +} + +void signal_data_written(void); + +#endif + +#endif diff --git a/serial_link/system/system.c b/serial_link/system/system.c deleted file mode 100644 index f5af9baa7..000000000 --- a/serial_link/system/system.c +++ /dev/null @@ -1,262 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ -#include "report.h" -#include "host_driver.h" -#include "serial_link/system/system.h" -#include "serial_link/system/driver.h" -#include "hal.h" -#include "serial_link/protocol/byte_stuffer.h" -#include "serial_link/protocol/transport.h" -#include "serial_link/protocol/frame_router.h" -#include "matrix.h" -#include -#include "print.h" -#include "config.h" - -static event_source_t new_data_event; -static bool serial_link_connected; - -static uint8_t keyboard_leds(void); -static void send_keyboard(report_keyboard_t *report); -static void send_mouse(report_mouse_t *report); -static void send_system(uint16_t data); -static void send_consumer(uint16_t data); - -host_driver_t serial_driver = { - keyboard_leds, - send_keyboard, - send_mouse, - send_system, - send_consumer -}; - -// Define these in your Config.h file -#ifndef SERIAL_LINK_BAUD -#error "Serial link baud is not set" -#endif - -#ifndef SERIAL_LINK_THREAD_PRIORITY -#error "Serial link thread priority not set" -#endif - -static SerialConfig config = { - .sc_speed = SERIAL_LINK_BAUD -}; - -//#define DEBUG_LINK_ERRORS - -static uint32_t read_from_serial(SerialDriver* driver, uint8_t link) { - const uint32_t buffer_size = 16; - uint8_t buffer[buffer_size]; - uint32_t bytes_read = sdAsynchronousRead(driver, buffer, buffer_size); - uint8_t* current = buffer; - uint8_t* end = current + bytes_read; - while(current < end) { - byte_stuffer_recv_byte(link, *current); - current++; - } - return bytes_read; -} - -static void print_error(char* str, eventflags_t flags, SerialDriver* driver) { -#ifdef DEBUG_LINK_ERRORS - if (flags & SD_PARITY_ERROR) { - print(str); - print(" Parity error\n"); - } - if (flags & SD_FRAMING_ERROR) { - print(str); - print(" Framing error\n"); - } - if (flags & SD_OVERRUN_ERROR) { - print(str); - uint32_t size = qSpaceI(&(driver->iqueue)); - xprintf(" Overrun error, queue size %d\n", size); - - } - if (flags & SD_NOISE_ERROR) { - print(str); - print(" Noise error\n"); - } - if (flags & SD_BREAK_DETECTED) { - print(str); - print(" Break detected\n"); - } -#else - (void)str; - (void)flags; - (void)driver; -#endif -} - -// TODO: Optimize the stack size, this is probably way too big -static THD_WORKING_AREA(serialThreadStack, 1024); -static THD_FUNCTION(serialThread, arg) { - (void)arg; - event_listener_t new_data_listener; - event_listener_t sd1_listener; - event_listener_t sd2_listener; - chEvtRegister(&new_data_event, &new_data_listener, 0); - eventflags_t events = CHN_INPUT_AVAILABLE - | SD_PARITY_ERROR | SD_FRAMING_ERROR | SD_OVERRUN_ERROR | SD_NOISE_ERROR | SD_BREAK_DETECTED; - chEvtRegisterMaskWithFlags(chnGetEventSource(&SD1), - &sd1_listener, - EVENT_MASK(1), - events); - chEvtRegisterMaskWithFlags(chnGetEventSource(&SD2), - &sd2_listener, - EVENT_MASK(2), - events); - bool need_wait = false; - bool is_master = false; - while(true) { - eventflags_t flags1 = 0; - eventflags_t flags2 = 0; - if (need_wait) { - eventmask_t mask = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000)); - if (mask & EVENT_MASK(1)) { - flags1 = chEvtGetAndClearFlags(&sd1_listener); - print_error("DOWNLINK", flags1, &SD1); - } - if (mask & EVENT_MASK(2)) { - flags2 = chEvtGetAndClearFlags(&sd2_listener); - print_error("UPLINK", flags2, &SD2); - } - } - - // Always stay as master, even if the USB goes into sleep mode - is_master |= usbGetDriverStateI(&USBD1) == USB_ACTIVE; - router_set_master(is_master); - - need_wait = true; - need_wait &= read_from_serial(&SD2, UP_LINK) == 0; - need_wait &= read_from_serial(&SD1, DOWN_LINK) == 0; - update_transport(); - } -} - -void send_data(uint8_t link, const uint8_t* data, uint16_t size) { - if (link == DOWN_LINK) { - sdWrite(&SD1, data, size); - } - else { - sdWrite(&SD2, data, size); - } -} - -static systime_t last_update = 0; - -typedef struct { - matrix_row_t rows[MATRIX_ROWS]; -} matrix_object_t; - -static matrix_object_t last_matrix = {}; - -SLAVE_TO_MASTER_OBJECT(keyboard_matrix, matrix_object_t); -MASTER_TO_ALL_SLAVES_OBJECT(serial_link_connected, bool); - -static remote_object_t* remote_objects[] = { - REMOTE_OBJECT(serial_link_connected), - REMOTE_OBJECT(keyboard_matrix), -}; - -void init_serial_link(void) { - serial_link_connected = false; - init_serial_link_hal(); - add_remote_objects(remote_objects, sizeof(remote_objects)/sizeof(remote_object_t*)); - init_byte_stuffer(); - sdStart(&SD1, &config); - sdStart(&SD2, &config); - chEvtObjectInit(&new_data_event); - (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), - SERIAL_LINK_THREAD_PRIORITY, serialThread, NULL); -} - -void matrix_set_remote(matrix_row_t* rows, uint8_t index); - -void serial_link_update(void) { - if (read_serial_link_connected()) { - serial_link_connected = true; - } - - matrix_object_t matrix; - bool changed = false; - for(uint8_t i=0;i US2ST(1000)) { - last_update = current_time; - last_matrix = matrix; - matrix_object_t* m = begin_write_keyboard_matrix(); - for(uint8_t i=0;irows[i] = matrix.rows[i]; - } - end_write_keyboard_matrix(); - *begin_write_serial_link_connected() = true; - end_write_serial_link_connected(); - } - - matrix_object_t* m = read_keyboard_matrix(0); - if (m) { - matrix_set_remote(m->rows, 0); - } -} - -void signal_data_written(void) { - chEvtBroadcast(&new_data_event); -} - -bool is_serial_link_connected(void) { - return serial_link_connected; -} - -host_driver_t* get_serial_link_driver(void) { - return &serial_driver; -} - -// NOTE: The driver does nothing, because the master handles everything -uint8_t keyboard_leds(void) { - return 0; -} - -void send_keyboard(report_keyboard_t *report) { - (void)report; -} - -void send_mouse(report_mouse_t *report) { - (void)report; -} - -void send_system(uint16_t data) { - (void)data; -} - -void send_consumer(uint16_t data) { - (void)data; -} - diff --git a/serial_link/system/system.h b/serial_link/system/system.h deleted file mode 100644 index fcc27425e..000000000 --- a/serial_link/system/system.h +++ /dev/null @@ -1,55 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_SYSTEM_H -#define SERIAL_LINK_SYSTEM_H - - - -#if defined(PROTOCOL_CHIBIOS) -#include "ch.h" - -static inline void serial_link_lock(void) { - chSysLock(); -} - -static inline void serial_link_unlock(void) { - chSysUnlock(); -} - -void signal_data_written(void); - -#else - -inline void serial_link_lock(void) { -} - -inline void serial_link_unlock(void) { -} - -void signal_data_written(void); - -#endif - -#endif -- cgit v1.2.3-24-g4f1b From 5651be7a2f50857b1ddd120a4b0184a28cdca4aa Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 15 May 2016 13:00:27 +0300 Subject: Configurable visualizer thread priority --- visualizer.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/visualizer.c b/visualizer.c index 867a1d334..4c4711499 100644 --- a/visualizer.c +++ b/visualizer.c @@ -24,6 +24,7 @@ SOFTWARE. #include "visualizer.h" #include "ch.h" +#include "config.h" #include #ifdef LCD_ENABLE @@ -47,6 +48,11 @@ SOFTWARE. #include "serial_link/system/driver.h" #endif +// Define this in config.h +#ifndef VISUALIZER_THREAD_PRIORITY +#define "Visualizer thread priority not defined" +#endif + static visualizer_keyboard_status_t current_status = { .layer = 0xFFFFFFFF, @@ -409,7 +415,7 @@ void visualizer_init(void) { // when the main thread is sleeping during the matrix scanning chEvtObjectInit(&layer_changed_event); (void)chThdCreateStatic(visualizerThreadStack, sizeof(visualizerThreadStack), - LOWPRIO, visualizerThread, NULL); + VISUALIZER_THREAD_PRIORITY, visualizerThread, NULL); } void update_status(bool changed) { -- cgit v1.2.3-24-g4f1b From 81f89cc6725d4e513f85ed1c841d25d0ac64bfe3 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 15 May 2016 13:39:58 +0300 Subject: Update include dir for new serial_link include --- visualizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visualizer.c b/visualizer.c index 4c4711499..605be3059 100644 --- a/visualizer.c +++ b/visualizer.c @@ -45,7 +45,7 @@ SOFTWARE. #ifdef USE_SERIAL_LINK #include "serial_link/protocol/transport.h" -#include "serial_link/system/driver.h" +#include "serial_link/system/serial_link.h" #endif // Define this in config.h -- cgit v1.2.3-24-g4f1b From a20d513e3cdacbf6e0e70a80402497ad10166434 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 15 May 2016 19:28:15 +0300 Subject: Add function to check if the keyboard is a master --- serial_link/system/serial_link.c | 6 +++++- serial_link/system/serial_link.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/serial_link/system/serial_link.c b/serial_link/system/serial_link.c index 27e61a9e9..75c7e77a7 100644 --- a/serial_link/system/serial_link.c +++ b/serial_link/system/serial_link.c @@ -35,6 +35,7 @@ SOFTWARE. static event_source_t new_data_event; static bool serial_link_connected; +static bool is_master = false; static uint8_t keyboard_leds(void); static void send_keyboard(report_keyboard_t *report); @@ -109,6 +110,10 @@ static void print_error(char* str, eventflags_t flags, SerialDriver* driver) { #endif } +bool is_serial_link_master(void) { + return is_master; +} + // TODO: Optimize the stack size, this is probably way too big static THD_WORKING_AREA(serialThreadStack, 1024); static THD_FUNCTION(serialThread, arg) { @@ -128,7 +133,6 @@ static THD_FUNCTION(serialThread, arg) { EVENT_MASK(2), events); bool need_wait = false; - bool is_master = false; while(true) { eventflags_t flags1 = 0; eventflags_t flags2 = 0; diff --git a/serial_link/system/serial_link.h b/serial_link/system/serial_link.h index 132cb657f..351e03877 100644 --- a/serial_link/system/serial_link.h +++ b/serial_link/system/serial_link.h @@ -31,6 +31,7 @@ SOFTWARE. void init_serial_link(void); void init_serial_link_hal(void); bool is_serial_link_connected(void); +bool is_serial_link_master(void); host_driver_t* get_serial_link_driver(void); void serial_link_update(void); -- cgit v1.2.3-24-g4f1b From 15bdef3ee92e6809ec5d0f25901f4a490cd91b58 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 16 May 2016 09:45:39 +0300 Subject: Makefile changes to support emulator build --- ugfx | 2 +- visualizer.mk | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ugfx b/ugfx index e221a6906..314a066d1 160000 --- a/ugfx +++ b/ugfx @@ -1 +1 @@ -Subproject commit e221a690616e20f87e0b0088baffdbd5427be862 +Subproject commit 314a066d11f09d295d42054a0b53fa1a95c0ba0a diff --git a/visualizer.mk b/visualizer.mk index 5cc199cf4..c51f8ba5d 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -21,7 +21,9 @@ # SOFTWARE. GFXLIB = $(VISUALIZER_DIR)/ugfx +ifndef EMULATOR SRC += $(VISUALIZER_DIR)/visualizer.c +endif UINCDIR += $(GFXINC) $(VISUALIZER_DIR) ifdef LCD_ENABLE @@ -45,9 +47,13 @@ endif ifdef USE_UGFX include $(GFXLIB)/gfx.mk SRC += $(GFXSRC) +UDEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) +ULIBS += $(patsubst %,-l%,$(patsubst -l%,%,$(GFXLIBS))) endif ifndef VISUALIZER_USER +ifndef EMULATOR VISUALIZER_USER = visualizer_user.c endif +endif SRC += $(VISUALIZER_USER) \ No newline at end of file -- cgit v1.2.3-24-g4f1b From d79e94adb1182ae867df0cc7621ef3d44d213bbc Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 17 May 2016 09:35:02 +0300 Subject: Use ugfx API instead of chibios --- ugfx | 2 +- visualizer.c | 34 ++++++++++++++++++---------------- visualizer.mk | 12 +++++++++--- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/ugfx b/ugfx index 314a066d1..7d7eeef0a 160000 --- a/ugfx +++ b/ugfx @@ -1 +1 @@ -Subproject commit 314a066d11f09d295d42054a0b53fa1a95c0ba0a +Subproject commit 7d7eeef0ad0f1b28f4fb86ad931cb6774c7b9e81 diff --git a/visualizer.c b/visualizer.c index 579837edc..ea84546fb 100644 --- a/visualizer.c +++ b/visualizer.c @@ -23,7 +23,6 @@ SOFTWARE. */ #include "visualizer.h" -#include "ch.h" #include "config.h" #include @@ -68,7 +67,7 @@ static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboa status1->suspended == status2->suspended; } -static event_source_t layer_changed_event; +static GSourceHandle layer_changed_event; static bool visualizer_enabled = false; #define MAX_SIMULTANEOUS_ANIMATIONS 4 @@ -132,7 +131,7 @@ void stop_all_keyframe_animations(void) { } } -static bool update_keyframe_animation(keyframe_animation_t* animation, visualizer_state_t* state, systime_t delta, systime_t* sleep_time) { +static bool update_keyframe_animation(keyframe_animation_t* animation, visualizer_state_t* state, systemticks_t delta, systemticks_t* sleep_time) { // TODO: Clean up this messy code dprintf("Animation frame%d, left %d, delta %d\n", animation->current_frame, animation->time_left_in_frame, delta); @@ -331,12 +330,13 @@ bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* s } // TODO: Optimize the stack size, this is probably way too big -static THD_WORKING_AREA(visualizerThreadStack, 1024); -static THD_FUNCTION(visualizerThread, arg) { +static DECLARE_THREAD_STACK(visualizerThreadStack, 1024); +static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { (void)arg; - event_listener_t event_listener; - chEvtRegister(&layer_changed_event, &event_listener, 0); + GListener event_listener; + geventListenerInit(&event_listener); + geventAttachSource(&event_listener, layer_changed_event, 0); visualizer_keyboard_status_t initial_status = { .default_layer = 0xFFFFFFFF, @@ -363,12 +363,12 @@ static THD_FUNCTION(visualizerThread, arg) { LCD_INT(state.current_lcd_color)); #endif - systime_t sleep_time = TIME_INFINITE; - systime_t current_time = chVTGetSystemTimeX(); + systemticks_t sleep_time = TIME_INFINITE; + systemticks_t current_time = gfxSystemTicks(); while(true) { - systime_t new_time = chVTGetSystemTimeX(); - systime_t delta = new_time - current_time; + systemticks_t new_time = gfxSystemTicks(); + systemticks_t delta = new_time - current_time; current_time = new_time; bool enabled = visualizer_enabled; if (!same_status(&state.status, ¤t_status)) { @@ -411,7 +411,7 @@ static THD_FUNCTION(visualizerThread, arg) { sleep_time = 0; } - systime_t after_update = chVTGetSystemTimeX(); + systemticks_t after_update = gfxSystemTicks(); unsigned update_delta = after_update - current_time; if (sleep_time != TIME_INFINITE) { if (sleep_time > update_delta) { @@ -422,12 +422,14 @@ static THD_FUNCTION(visualizerThread, arg) { } } dprintf("Update took %d, last delta %d, sleep_time %d\n", update_delta, delta, sleep_time); - chEvtWaitOneTimeout(EVENT_MASK(0), sleep_time); + geventEventWait(&event_listener, sleep_time); } #ifdef LCD_ENABLE gdispCloseFont(state.font_fixed5x8); gdispCloseFont(state.font_dejavusansbold12); #endif + + return 0; } void visualizer_init(void) { @@ -449,14 +451,14 @@ void visualizer_init(void) { // We are using a low priority thread, the idea is to have it run only // when the main thread is sleeping during the matrix scanning - chEvtObjectInit(&layer_changed_event); - (void)chThdCreateStatic(visualizerThreadStack, sizeof(visualizerThreadStack), + gfxThreadCreate(visualizerThreadStack, sizeof(visualizerThreadStack), VISUALIZER_THREAD_PRIORITY, visualizerThread, NULL); } void update_status(bool changed) { if (changed) { - chEvtBroadcast(&layer_changed_event); + GSourceListener* listener = geventGetSourceListener(layer_changed_event, NULL); + geventSendEvent(listener); } #ifdef USE_SERIAL_LINK static systime_t last_update = 0; diff --git a/visualizer.mk b/visualizer.mk index c51f8ba5d..678829329 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -21,9 +21,7 @@ # SOFTWARE. GFXLIB = $(VISUALIZER_DIR)/ugfx -ifndef EMULATOR SRC += $(VISUALIZER_DIR)/visualizer.c -endif UINCDIR += $(GFXINC) $(VISUALIZER_DIR) ifdef LCD_ENABLE @@ -33,13 +31,17 @@ USE_UGFX = yes endif ifdef LCD_BACKLIGHT_ENABLE +ifndef EMULATOR SRC += $(VISUALIZER_DIR)/lcd_backlight.c SRC += lcd_backlight_hal.c +endif UDEFS += -DLCD_BACKLIGHT_ENABLE endif ifdef LED_ENABLE +ifndef EMULATOR SRC += $(VISUALIZER_DIR)/led_test.c +endif UDEFS += -DLED_ENABLE USE_UGFX = yes endif @@ -56,4 +58,8 @@ ifndef EMULATOR VISUALIZER_USER = visualizer_user.c endif endif -SRC += $(VISUALIZER_USER) \ No newline at end of file +SRC += $(VISUALIZER_USER) + +ifdef EMULATOR +UINCDIR += $(TMK_DIR)/common +endif \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 4e89732617454a600189242d417f5e2ba0855683 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 17 May 2016 09:45:05 +0300 Subject: Enable and fix compilation of more files --- led_test.c | 24 ++++++++++++------------ visualizer.mk | 6 +----- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/led_test.c b/led_test.c index d358ef81e..6d3f3b2ed 100644 --- a/led_test.c +++ b/led_test.c @@ -29,20 +29,20 @@ keyframe_animation_t led_test_animation = { .num_frames = 14, .loop = true, .frame_lengths = { - MS2ST(1000), // fade in - MS2ST(1000), // no op (leds on) - MS2ST(1000), // fade out - MS2ST(1000), // crossfade - MS2ST(3000), // left to rigt (outside in) - MS2ST(1000), // crossfade - MS2ST(3000), // top_to_bottom + gfxMillisecondsToTicks(1000), // fade in + gfxMillisecondsToTicks(1000), // no op (leds on) + gfxMillisecondsToTicks(1000), // fade out + gfxMillisecondsToTicks(1000), // crossfade + gfxMillisecondsToTicks(3000), // left to rigt (outside in) + gfxMillisecondsToTicks(1000), // crossfade + gfxMillisecondsToTicks(3000), // top_to_bottom 0, // mirror leds - MS2ST(1000), // crossfade - MS2ST(3000), // left_to_right (mirrored, so inside out) - MS2ST(1000), // crossfade - MS2ST(3000), // top_to_bottom + gfxMillisecondsToTicks(1000), // crossfade + gfxMillisecondsToTicks(3000), // left_to_right (mirrored, so inside out) + gfxMillisecondsToTicks(1000), // crossfade + gfxMillisecondsToTicks(3000), // top_to_bottom 0, // normal leds - MS2ST(1000), // crossfade + gfxMillisecondsToTicks(1000), // crossfade }, .frame_functions = { diff --git a/visualizer.mk b/visualizer.mk index 678829329..56525ffd9 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -31,17 +31,15 @@ USE_UGFX = yes endif ifdef LCD_BACKLIGHT_ENABLE -ifndef EMULATOR SRC += $(VISUALIZER_DIR)/lcd_backlight.c +ifndef EMULATOR SRC += lcd_backlight_hal.c endif UDEFS += -DLCD_BACKLIGHT_ENABLE endif ifdef LED_ENABLE -ifndef EMULATOR SRC += $(VISUALIZER_DIR)/led_test.c -endif UDEFS += -DLED_ENABLE USE_UGFX = yes endif @@ -54,10 +52,8 @@ ULIBS += $(patsubst %,-l%,$(patsubst -l%,%,$(GFXLIBS))) endif ifndef VISUALIZER_USER -ifndef EMULATOR VISUALIZER_USER = visualizer_user.c endif -endif SRC += $(VISUALIZER_USER) ifdef EMULATOR -- cgit v1.2.3-24-g4f1b From 15300cb681f74672547aa5e53d165ac748d43a17 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 17 May 2016 09:51:27 +0300 Subject: Build lcd_backlight_hal_emulator.c When the emulator is set, instead of the lcd_backlight_hal.c file. --- visualizer.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/visualizer.mk b/visualizer.mk index 56525ffd9..3e361491c 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -34,6 +34,8 @@ ifdef LCD_BACKLIGHT_ENABLE SRC += $(VISUALIZER_DIR)/lcd_backlight.c ifndef EMULATOR SRC += lcd_backlight_hal.c +else +SRC += lcd_backlight_hal_emulator.c endif UDEFS += -DLCD_BACKLIGHT_ENABLE endif -- cgit v1.2.3-24-g4f1b From 07e412c53829c66e948eb147873a04cd27b0771b Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 17 May 2016 11:21:38 +0300 Subject: Fix crash when event listener not created --- visualizer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/visualizer.c b/visualizer.c index ea84546fb..ff99e960f 100644 --- a/visualizer.c +++ b/visualizer.c @@ -458,7 +458,9 @@ void visualizer_init(void) { void update_status(bool changed) { if (changed) { GSourceListener* listener = geventGetSourceListener(layer_changed_event, NULL); - geventSendEvent(listener); + if (listener) { + geventSendEvent(listener); + } } #ifdef USE_SERIAL_LINK static systime_t last_update = 0; -- cgit v1.2.3-24-g4f1b From fa8feb21a4709dba552df4a96205c50a319f5e3b Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 18 May 2016 08:40:36 +0300 Subject: Add custom led and lcd display support --- visualizer.c | 18 +++++++++++++++--- visualizer.h | 5 +++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/visualizer.c b/visualizer.c index ff99e960f..bbb00debc 100644 --- a/visualizer.c +++ b/visualizer.c @@ -85,6 +85,15 @@ static remote_object_t* remote_objects[] = { GDisplay* LCD_DISPLAY = 0; GDisplay* LED_DISPLAY = 0; +__attribute__((weak)) +GDisplay* get_lcd_display(void) { + return gdispGetDisplay(0); +} + +__attribute__((weak)) +GDisplay* get_led_display(void) { + return gdispGetDisplay(1); +} void start_keyframe_animation(keyframe_animation_t* animation) { animation->current_frame = -1; @@ -444,10 +453,13 @@ void visualizer_init(void) { #ifdef USE_SERIAL_LINK add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); #endif - // TODO: Make sure these works when either of these are disabled - LCD_DISPLAY = gdispGetDisplay(0); - LED_DISPLAY = gdispGetDisplay(1); +#ifdef LCD_ENABLE + LCD_DISPLAY = get_lcd_display(); +#endif +#ifdef LED_ENABLE + LED_DISPLAY = get_led_display(); +#endif // We are using a low priority thread, the idea is to have it run only // when the main thread is sleeping during the matrix scanning diff --git a/visualizer.h b/visualizer.h index 8a2772c6d..4d6a61dda 100644 --- a/visualizer.h +++ b/visualizer.h @@ -45,6 +45,11 @@ void visualizer_suspend(void); // This should be called when the keyboard wakes up from suspend state void visualizer_resume(void); +// These functions are week, so they can be overridden by the keyboard +// if needed +GDisplay* get_lcd_display(void); +GDisplay* get_led_display(void); + // If you need support for more than 16 keyframes per animation, you can change this #define MAX_VISUALIZER_KEY_FRAMES 16 -- cgit v1.2.3-24-g4f1b From 94519e387a85e3b4ab72bd7d837ff590cc690eb9 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 18 May 2016 09:03:42 +0300 Subject: Add callback function for emulator drawing --- visualizer.c | 4 ++++ visualizer.h | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/visualizer.c b/visualizer.c index bbb00debc..607a64566 100644 --- a/visualizer.c +++ b/visualizer.c @@ -413,6 +413,10 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { #ifdef LED_ENABLE gdispGFlush(LED_DISPLAY); #endif + +#if EMULATOR + draw_emulator(); +#endif // The animation can enable the visualizer // And we might need to update the state when that happens // so don't sleep diff --git a/visualizer.h b/visualizer.h index 4d6a61dda..a3828e35f 100644 --- a/visualizer.h +++ b/visualizer.h @@ -50,6 +50,11 @@ void visualizer_resume(void); GDisplay* get_lcd_display(void); GDisplay* get_led_display(void); +// For emulator builds, this function need to be implemented +#if EMULATOR +void draw_emulator(void); +#endif + // If you need support for more than 16 keyframes per animation, you can change this #define MAX_VISUALIZER_KEY_FRAMES 16 @@ -134,7 +139,7 @@ bool keyframe_enable_lcd_and_backlight(keyframe_animation_t* animation, visualiz // directly from the initalize_user_visualizer function (the animation can be null) bool enable_visualization(keyframe_animation_t* animation, visualizer_state_t* state); -// These two functions have to be implemented by the user +// These functions have to be implemented by the user void initialize_user_visualizer(visualizer_state_t* state); void update_user_visualizer_state(visualizer_state_t* state); void user_visualizer_suspend(visualizer_state_t* state); -- cgit v1.2.3-24-g4f1b From 8090fb82ff532308c8446cc85fe0417b94cd5042 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Tue, 24 May 2016 02:26:16 -0500 Subject: Initial commit of keymaps/maz with default config --- keyboard/ergodox_ez/keymaps/maz/default.png | Bin 0 -> 193672 bytes .../ergodox_ez/keymaps/maz/default_highres.png | Bin 0 -> 1459389 bytes keyboard/ergodox_ez/keymaps/maz/keymap.c | 184 +++++++++++++++++++++ keyboard/ergodox_ez/keymaps/maz/readme.md | 10 ++ 4 files changed, 194 insertions(+) create mode 100644 keyboard/ergodox_ez/keymaps/maz/default.png create mode 100644 keyboard/ergodox_ez/keymaps/maz/default_highres.png create mode 100644 keyboard/ergodox_ez/keymaps/maz/keymap.c create mode 100644 keyboard/ergodox_ez/keymaps/maz/readme.md diff --git a/keyboard/ergodox_ez/keymaps/maz/default.png b/keyboard/ergodox_ez/keymaps/maz/default.png new file mode 100644 index 000000000..6575f7b5e Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/maz/default.png differ diff --git a/keyboard/ergodox_ez/keymaps/maz/default_highres.png b/keyboard/ergodox_ez/keymaps/maz/default_highres.png new file mode 100644 index 000000000..7d9f045f4 Binary files /dev/null and b/keyboard/ergodox_ez/keymaps/maz/default_highres.png differ diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c new file mode 100644 index 000000000..1c3bb5171 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md new file mode 100644 index 000000000..8f6dba45e --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -0,0 +1,10 @@ +# ErgoDox EZ Default Configuration + +## Changelog + +* Feb 2, 2016 (V1.1): + * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). + +This is what we ship with out of the factory. :) The image says it all: + +![Default](default_highres.png) -- cgit v1.2.3-24-g4f1b From f5e486b50dba14dcd33f82f0159e917bb5c61b03 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 00:22:20 -0500 Subject: Change r2c1 from Del to Tab --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 1c3bb5171..1b66b278b 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = KEYMAP( // layer 0 : default // left hand KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, -- cgit v1.2.3-24-g4f1b From 3b0fd160df04f4d93f8d8442c8c61d21f0ce3740 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 00:38:25 -0500 Subject: Change r3c1 from backspace to esc/control --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 1b66b278b..97256c7b3 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -32,10 +32,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, ALT_T(KC_APP), KC_LGUI, KC_HOME, -- cgit v1.2.3-24-g4f1b From 0b68db4e4347e041bea8e32b7eedd1827288fb0a Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 00:42:58 -0500 Subject: Change rr3c1 from quotes/gui to quotes/ctl --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 97256c7b3..f9f38de8b 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -36,14 +36,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, ALT_T(KC_APP), KC_LGUI, KC_HOME, KC_SPC,KC_BSPC,KC_END, // right hand KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, KC_LALT, CTL_T(KC_ESC), -- cgit v1.2.3-24-g4f1b From 514a7038b1aa984014bad89c2a44f2a8cf9c15b4 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 00:46:38 -0500 Subject: Add ctrl macro to spc and ent on thumb cluster (outter-most keys_) --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index f9f38de8b..1e6c28de9 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, ALT_T(KC_APP), KC_LGUI, KC_HOME, - KC_SPC,KC_BSPC,KC_END, + CTL_T(KC_SPC),KC_BSPC,KC_END, // right hand KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, KC_LALT, CTL_T(KC_ESC), KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT + KC_PGDN,KC_TAB, CTL_T(KC_ENT) ), /* Keymap 1: Symbol Layer * -- cgit v1.2.3-24-g4f1b From fbbfb3cbad165a2d800befc3bbbebef4f8ff200d Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 00:51:16 -0500 Subject: Add todo: override holding macro functionlity --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 1e6c28de9..c926d32c1 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -28,6 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |ace | End | | PgDn | | | * `--------------------' `----------------------' */ + // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default -- cgit v1.2.3-24-g4f1b From 5486b9e80e928133eeaebf628c32ec7e375e3fd4 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 00:58:08 -0500 Subject: Add todo: windows and nix layers --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index c926d32c1..f0c611555 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -29,6 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `----------------------' */ // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) + // TODO: maybe make almost identical layers but for wintdows and mac // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default -- cgit v1.2.3-24-g4f1b From fd44d1cb39e2090070bf6532d8fb8bd6a9ae5fca Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 01:09:18 -0500 Subject: Update layout viz --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index f0c611555..fc504ad72 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -12,9 +12,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |esc/ctrl| A | S | D | F | G |------| |------| H | J | K | L |; / L2|'/ ctrl | * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -24,8 +24,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | App | LGui | | Alt |Ctrl/Esc| * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | + * | Space| Bksp |------| |------| Tab |Enter | + * | ctrl | gui | End | | PgDn | gui | ctrl | * `--------------------' `----------------------' */ // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) -- cgit v1.2.3-24-g4f1b From 03aeb405167d80fb1b303725e2766cee0b855467 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 01:19:30 -0500 Subject: Change mouse clicks to j and k --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index fc504ad72..19da84494 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -30,6 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) // TODO: maybe make almost identical layers but for wintdows and mac + // TODO: find a do nothing key, so you aren't tempted by useless keys // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default @@ -101,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | | MsUp | | | | | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | | Prev | Next | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -121,14 +122,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -- cgit v1.2.3-24-g4f1b From 09e172f56a024a6618140df73cd0d05d22632eb1 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 01:21:29 -0500 Subject: Tap then hold built-in functionality actually overrides the ctrl/alt/etc. macros --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 19da84494..69a43b136 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | ctrl | gui | End | | PgDn | gui | ctrl | * `--------------------' `----------------------' */ - // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) + // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) ~~~~~~ this might be taken care of.... you can just tap once, then hold, and it does this shit :::))) ... not sure if this is desirable for most use-cases / situations // TODO: maybe make almost identical layers but for wintdows and mac // TODO: find a do nothing key, so you aren't tempted by useless keys // If it accepts an argument (i.e, is a function), it doesn't need KC_. -- cgit v1.2.3-24-g4f1b From fbbd32376b8d1a818b62dbbf0f2d9946221ffc56 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 01:25:09 -0500 Subject: Add gui macro to bksp and tab (second outter-most keys) on both thumb clusters --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 69a43b136..8adabf9a7 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, ALT_T(KC_APP), KC_LGUI, KC_HOME, - CTL_T(KC_SPC),KC_BSPC,KC_END, + CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_END, // right hand KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, KC_LALT, CTL_T(KC_ESC), KC_PGUP, - KC_PGDN,KC_TAB, CTL_T(KC_ENT) + KC_PGDN,GUI_T(KC_TAB), CTL_T(KC_ENT) ), /* Keymap 1: Symbol Layer * -- cgit v1.2.3-24-g4f1b From 59dc19940a3c5f29860de7b7d7e7a96ea27692c2 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 01:31:57 -0500 Subject: Add notes --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 8adabf9a7..986cbb52d 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -31,6 +31,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) ~~~~~~ this might be taken care of.... you can just tap once, then hold, and it does this shit :::))) ... not sure if this is desirable for most use-cases / situations // TODO: maybe make almost identical layers but for wintdows and mac // TODO: find a do nothing key, so you aren't tempted by useless keys + // TODO: add vi layer for arrow keys and shit on hjkl? + // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default -- cgit v1.2.3-24-g4f1b From 66f9cdd041eb6a97658f32fe79cf70e250660c50 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 25 May 2016 01:43:06 -0500 Subject: Change bottom keycluster keys to be alt temporarily until a more permanent solution is though up... although you just now lost your arrow keys, so idk what to do about that tomorrow lol --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 986cbb52d..33878d8b7 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -25,13 +25,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | * | Space| Bksp |------| |------| Tab |Enter | - * | ctrl | gui | End | | PgDn | gui | ctrl | + * | ctrl | gui | Alt | | Alt | gui | ctrl | * `--------------------' `----------------------' */ // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) ~~~~~~ this might be taken care of.... you can just tap once, then hold, and it does this shit :::))) ... not sure if this is desirable for most use-cases / situations // TODO: maybe make almost identical layers but for wintdows and mac // TODO: find a do nothing key, so you aren't tempted by useless keys // TODO: add vi layer for arrow keys and shit on hjkl? + // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* @@ -44,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, ALT_T(KC_APP), KC_LGUI, KC_HOME, - CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_END, + CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, // right hand KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -53,7 +54,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, KC_LALT, CTL_T(KC_ESC), KC_PGUP, - KC_PGDN,GUI_T(KC_TAB), CTL_T(KC_ENT) + KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) ), /* Keymap 1: Symbol Layer * -- cgit v1.2.3-24-g4f1b From 733596d800cbeccf43ede053d3695421cc538b04 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Thu, 26 May 2016 02:12:57 -0500 Subject: Fix formatting --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 33878d8b7..20df19070 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | * | Space| Bksp |------| |------| Tab |Enter | - * | ctrl | gui | Alt | | Alt | gui | ctrl | + * | ctrl | gui | Alt | | Alt | gui | ctrl | * `--------------------' `----------------------' */ // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) ~~~~~~ this might be taken care of.... you can just tap once, then hold, and it does this shit :::))) ... not sure if this is desirable for most use-cases / situations -- cgit v1.2.3-24-g4f1b From ac02b0f397a77e6c99f90be11b4589914e9079a7 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Thu, 26 May 2016 02:17:07 -0500 Subject: Fix formatting --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 20df19070..54427a2f4 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -109,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | | Prev | Next | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * | | | | | | |VolUp |VolDn | Mute | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | -- cgit v1.2.3-24-g4f1b From 861f0f78e168e4f1649cf2a168e0a4e17d06f5cb Mon Sep 17 00:00:00 2001 From: Nathan Sharfi Date: Thu, 26 May 2016 15:08:01 -0700 Subject: zweihander-osx: Bump ALFRED_LEAD_TIME to 250ms --- keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c | 4 ++-- keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c index 3444152bc..dbf2fad78 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c @@ -11,7 +11,7 @@ #define BBED 2 // BBEdit #define TMNL 3 // Terminal #define SAFA 4 // Safari -#define ALFRED_LEAD_TIME 100 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input +#define ALFRED_LEAD_TIME 250 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -82,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [SYMB] = KEYMAP( // left hand KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQUO,KC_TRNS, + KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQT ,KC_TRNS, KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex b/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex index 599d581fe..d505d617f 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex @@ -15,12 +15,12 @@ :1000E0001C141C141C141C141C141C141C141C1490 :1000F0001C141C141C141C141C141C141C141C1480 :100100002E143B14421449145314750A01E2012CB5 -:10011000022C02E2746401160216010402040109B1 +:10011000022C02E274FA011602160104020401091B :1001200002090104020401150215010C020C012848 -:10013000022800750A01E2012C022C02E27464011B +:10013000022800750A01E2012C022C02E274FA0185 :10014000170217010802080115021501100210011B :100150000C020C0111021101040204010F020F0133 -:1001600028022800750A01E2012C022C02E27464C4 +:1001600028022800750A01E2012C022C02E274FA2E :100170000105020501050205010802080107020741 :10018000010C020C011702170128022800750A0150 :10019000E30116021602E301E3012B022B02E30145 -- cgit v1.2.3-24-g4f1b From e7e83b1f1868b4b3c95536e401091d394ee2112e Mon Sep 17 00:00:00 2001 From: Nathan Sharfi Date: Fri, 27 May 2016 18:41:16 -0700 Subject: zweihander-osx: Add =, :, juggle Home/End --- keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c index dbf2fad78..0dfc1f68c 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c @@ -66,16 +66,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | & | 1 | 2 | 3 | = | | + * | | | | | | = | | | | : | 1 | 2 | 3 | = | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | 0 | . | ↠| → | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | Home | | | + * | | | | | | | | * | | |------| |------| | | - * | | | | | End | | | + * | | | | | | | | * `--------------------' `--------------------' */ // SYMBOLS @@ -84,7 +84,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQT ,KC_TRNS, KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_EQL ,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, @@ -93,11 +93,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, + KC_TRNS, KC_COLN, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, KC_0, KC_DOT, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HOME, - KC_END , KC_TRNS, KC_TRNS + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS ), /* Keymap 2: Media keys * @@ -137,7 +137,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, + KC_END , LGUI(KC_X), LGUI(KC_C), LGUI(KC_V) ), }; -- cgit v1.2.3-24-g4f1b From 4d7e4a4780bc779a3960497a9084ef6c9d6ef87e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 28 May 2016 11:13:08 +0300 Subject: Don't include lcd_backlight_hal for emulator --- visualizer.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/visualizer.mk b/visualizer.mk index 3e361491c..56525ffd9 100644 --- a/visualizer.mk +++ b/visualizer.mk @@ -34,8 +34,6 @@ ifdef LCD_BACKLIGHT_ENABLE SRC += $(VISUALIZER_DIR)/lcd_backlight.c ifndef EMULATOR SRC += lcd_backlight_hal.c -else -SRC += lcd_backlight_hal_emulator.c endif UDEFS += -DLCD_BACKLIGHT_ENABLE endif -- cgit v1.2.3-24-g4f1b From 9c955145f50abebcbe5ad5e203a91ca83249fee6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 29 May 2016 02:08:46 +0300 Subject: Fix emulator #ifdef check --- visualizer.c | 2 +- visualizer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/visualizer.c b/visualizer.c index 607a64566..0e587221f 100644 --- a/visualizer.c +++ b/visualizer.c @@ -414,7 +414,7 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { gdispGFlush(LED_DISPLAY); #endif -#if EMULATOR +#ifdef EMULATOR draw_emulator(); #endif // The animation can enable the visualizer diff --git a/visualizer.h b/visualizer.h index a3828e35f..45cfa9aa9 100644 --- a/visualizer.h +++ b/visualizer.h @@ -51,7 +51,7 @@ GDisplay* get_lcd_display(void); GDisplay* get_led_display(void); // For emulator builds, this function need to be implemented -#if EMULATOR +#ifdef EMULATOR void draw_emulator(void); #endif -- cgit v1.2.3-24-g4f1b From 0c3189055f049e6023471e75139d488b288aead9 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 29 May 2016 17:42:32 +0300 Subject: Make LED visualization times configurable --- led_test.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/led_test.c b/led_test.c index 6d3f3b2ed..d53f0b7fb 100644 --- a/led_test.c +++ b/led_test.c @@ -25,6 +25,9 @@ SOFTWARE. #include "gfx.h" #include "math.h" +#define CROSSFADE_TIME 1000 +#define GRADIENT_TIME 3000 + keyframe_animation_t led_test_animation = { .num_frames = 14, .loop = true, @@ -32,17 +35,17 @@ keyframe_animation_t led_test_animation = { gfxMillisecondsToTicks(1000), // fade in gfxMillisecondsToTicks(1000), // no op (leds on) gfxMillisecondsToTicks(1000), // fade out - gfxMillisecondsToTicks(1000), // crossfade - gfxMillisecondsToTicks(3000), // left to rigt (outside in) - gfxMillisecondsToTicks(1000), // crossfade - gfxMillisecondsToTicks(3000), // top_to_bottom + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in) + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom 0, // mirror leds - gfxMillisecondsToTicks(1000), // crossfade - gfxMillisecondsToTicks(3000), // left_to_right (mirrored, so inside out) - gfxMillisecondsToTicks(1000), // crossfade - gfxMillisecondsToTicks(3000), // top_to_bottom + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out) + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade + gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom 0, // normal leds - gfxMillisecondsToTicks(1000), // crossfade + gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade }, .frame_functions = { -- cgit v1.2.3-24-g4f1b From 489288f67462e0c6fae8e54644af2fa4593e4406 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 29 May 2016 18:27:32 +0300 Subject: Add a nicer sine based gradient for the LEDs --- led_test.c | 13 +++++-------- ugfx | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/led_test.c b/led_test.c index d53f0b7fb..c2ea30b55 100644 --- a/led_test.c +++ b/led_test.c @@ -89,14 +89,11 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; static uint8_t compute_gradient_color(float t, float index, float num) { - const float target = t * (num - 1.0f); - const float half_num = num / 2.0f; - float d = fabs(index - target); - if (d > half_num) { - d = num - d; - } - d = 1.0f - (d / half_num); - return (uint8_t)(255.0f * d); + const float two_pi = 2.0f * PI; + float normalized_index = (1.0f - index / (num - 1)) * two_pi; + float x = t * two_pi + normalized_index; + float v = 0.5 * (cosf(x) + 1.0f); + return (uint8_t)(255.0f * v); } bool keyframe_fade_in_all_leds(keyframe_animation_t* animation, visualizer_state_t* state) { diff --git a/ugfx b/ugfx index 7d7eeef0a..dc5786acc 160000 --- a/ugfx +++ b/ugfx @@ -1 +1 @@ -Subproject commit 7d7eeef0ad0f1b28f4fb86ad931cb6774c7b9e81 +Subproject commit dc5786acc246fb23503517647c386e43f1bfb247 -- cgit v1.2.3-24-g4f1b From 13810e4822d57553caa5aea537af7e80ad701589 Mon Sep 17 00:00:00 2001 From: Nathan Sharfi Date: Mon, 30 May 2016 15:44:59 -0700 Subject: zweihander: Add :, disable sleep LED waves --- keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk | 2 ++ keyboard/ergodox_ez/keymaps/zweihander-osx/readme.markdown | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk b/keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk new file mode 100644 index 000000000..6e3d088a4 --- /dev/null +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk @@ -0,0 +1,2 @@ +# Don’t do a tricolor wave when the computer is shut down in Windows +SLEEP_LED_ENABLE = no diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/readme.markdown b/keyboard/ergodox_ez/keymaps/zweihander-osx/readme.markdown index 7bce7c690..3b7f52941 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/readme.markdown +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/readme.markdown @@ -42,4 +42,4 @@ I press C-a, C-e, and C-k all the time. It’s difficult to press these key comb ## use spreadsheets -All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. +All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. There’s also a colon there for entering times and maybe IPv6 addresses. Not that I expect people to type IPv6 addresses into a spreadsheet, but, y’know. -- cgit v1.2.3-24-g4f1b From 7b8857a368f53a102e402f27fce55ef214539bfd Mon Sep 17 00:00:00 2001 From: Nathan Sharfi Date: Tue, 31 May 2016 16:15:35 -0700 Subject: zweihander-osx: use eject instead of power MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://support.apple.com/en-us/HT201236 says that ⌃⌘â will quit all apps and then restart your Mac; ⌃⌘-power will shut things down in an…ungraceful fashion. I reboot into Windows fairly frequently; I'd rather have the nice behavior at my fingertips, not the rude one. --- .../ergodox_ez/keymaps/zweihander-osx/keymap.c | 4 +- .../keymaps/zweihander-osx/zweihander-osx.hex | 2203 ++++++++++---------- 2 files changed, 1097 insertions(+), 1110 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c index 0dfc1f68c..f1a2956b5 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c @@ -102,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 2: Media keys * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | Power | + * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | â | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | | PgUp |⌘S⌘⇥⌘R| Term | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -131,7 +131,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, // right hand - LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR, + LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_EJCT, KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY, KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex b/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex index d505d617f..44e4ab0f3 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex @@ -1,20 +1,20 @@ -:100000000C94D3020C9417030C9417030C9417034D -:100010000C9417030C9417030C9417030C941703F8 -:100020000C9417030C9417030C94CF0D0C94A10E91 -:100030000C9417030C9417030C9417030C941703D8 -:100040000C9417030C94AB220C9417030C94170315 -:100050000C9417030C943E1C0C9417030C94170378 -:100060000C9417030C9417030C9417030C941703A8 -:100070000C9417030C9417030C9417030C94170398 -:100080000C9417030C9417030C9417030C94170388 -:100090000C9417030C9417030C9417030C94170378 -:1000A0000C9417030C9417030C9417030E0F300FC6 -:1000B0001E10300F1E10750F980F1E10ED0F001040 -:1000C000CF12CF12FE12FE1234135413851485146E -:1000D0005F1385140F140F147614851485147F1480 -:1000E0001C141C141C141C141C141C141C141C1490 -:1000F0001C141C141C141C141C141C141C141C1480 -:100100002E143B14421449145314750A01E2012CB5 +:100000000C94B3020C94F7020C94F7020C94F702D0 +:100010000C94F7020C94F7020C94F7020C94F7027C +:100020000C94F7020C94F7020C94B00D0C94820E11 +:100030000C94E01B0C94F7020C94F7020C94F7025A +:100040000C94F7020C94F7020C94F7020C94F7024C +:100050000C94F7020C94481C0C94F7020C94F702D1 +:100060000C94F7020C94F7020C94F7020C94F7022C +:100070000C94F7020C94F7020C94F7020C94F7021C +:100080000C94F7020C94F7020C94F7020C94F7020C +:100090000C94F7020C94F7020C94F7020C94F702FC +:1000A0000C94F7020C94F7020C94F702EF0E110F68 +:1000B000FF0F110FFF0F560F790FFF0FCE0FE10F3C +:1000C000B012B012DF12DF12151335136614661466 +:1000D00040136614F013F01357146614661460147A +:1000E000FD13FD13FD13FD13FD13FD13FD13FD1390 +:1000F000FD13FD13FD13FD13FD13FD13FD13FD1380 +:100100000F141C1423142A143414750A01E2012C50 :10011000022C02E274FA011602160104020401091B :1001200002090104020401150215010C020C012848 :10013000022800750A01E2012C022C02E274FA0185 @@ -40,13 +40,13 @@ :100270000000003A002F0036020100010001003B9F :1002800000300037020100010001003C002F02266F :10029000020100010001003D0030022702010001BF -:1002A0000001003E003402340001000000010001A2 +:1002A0000001003E00340234002E00000001000175 :1002B0000001000000010000000100010001000039 -:1002C000000100000001003F0038002D0024020062 -:1002D0000001004000240021001E0027004A0041C8 +:1002C000000100000001003F0038002D0033020053 +:1002D0000001004000240021001E00270001004111 :1002E00000250022001F00370001004200260023E5 :1002F00000200050000100430025022E022E004F76 -:10030000004D004400450001000100010000000113 +:10030000000100440045000100010001000000015F :10031000000100010001000100000069000100016E :10032000000100010001006A000100043001000129 :1003300000010001004B004E00010001000100011E @@ -54,9 +54,9 @@ :100350000002300000010001000100000001000067 :100360000001001408010000000100000001001A53 :100370000830082F082C0200000100350A520C50EA -:10038000002C00A9000100350852005100AC00AA61 +:10038000002C00A9004D00350852005100AC00AA15 :100390000019080100510C4F00AB00A8000608012D -:1003A0000001000100010001001B08A5000100AED2 +:1003A0000001000100010001001B08B0000100AEC7 :1003B0000001000100000016034500720067006F95 :1003C0000044006F007800200045005A000000162D :1003D000034500720067006F0044006F0078002042 @@ -84,1089 +84,1076 @@ :1005300029E71500250195087501810295017508C7 :10054000810105081901290595057501910295019B :10055000750391010507190029FF150025FF950670 -:1005600075088100C00000000000000000000000CD -:10057000010204060A0F17202C3A4A5D71879DB3C9 -:10058000C7DAE9F5FCFFFCF5E9DAC7B39D87715DD1 -:100590004A3A2C20170F0A0604020100000000004E -:1005A00000000000000011241FBECFEFDAE0DEBF24 -:1005B000CDBF04B603FE24C08091FB019091FC01E5 -:1005C000A091FD01B091FE018730904BA740B04B48 -:1005D000B9F41092FB011092FC011092FD011092EF -:1005E000FE0114BE84B7877F84BF88E10FB6F894FC -:1005F00080936000109260000FBEE0E0FFE3099579 -:1006000011E0A0E0B1E0E4EEF8E402C005900D9244 -:10061000A433B107D9F711E0A4E3B1E001C01D9202 -:10062000AB3FB107E1F70E94130B0C9470240C94BC -:100630000000FC016230B9F028F4662341F061301B -:1006400061F023C06330A9F06430C9F01EC082811C -:100650008823D9F088EA91E0089582818823A9F05F -:100660008DE891E008958281882379F084E691E015 -:1006700008958281882349F083E391E0089582817F -:10068000882319F08AE091E0089580E090E00895D1 -:1006900008956091BD017091BE018091BF0190915C -:1006A000C0010E94701B56985E9825982D98269838 -:1006B0002E9827982F98813019F0823021F00895D4 -:1006C000259A2D9A0895269A2E9A08950C944903F6 -:1006D00056985E9825982D9826982E9827982F98AA -:1006E0008FEF90E0909389008093880090938B0027 -:1006F00080938A0090938D0080938C00259A2D9A88 -:100700002FEF80E792E0215080409040E1F700C059 -:100710000000269A2E9A2FEF80E792E02150804029 -:100720009040E1F700C00000279A2F9A2FEF80E752 -:1007300092E0215080409040E1F700C000002598F1 -:100740002D982FEF80E792E0215080409040E1F714 -:1007500000C0000026982E982FEF80E792E02150ED -:1007600080409040E1F700C0000027982F985698ED -:100770005E9825982D9826982E9827982F9808955A -:1007800089EA8093800089E08093810024982C98E6 -:100790003F988AB18F748AB96E98479A8BB1806BF3 -:1007A0008BB9769A0E9468030C94480380E2809388 -:1007B00000018091340181110EC00E94250481E066 -:1007C000809334012FEF83ED90E3215080409040DF -:1007D000E1F700C0000080E40E942B048093000138 -:1007E00081112EC00E94550480930001811128C000 -:1007F0000E94550480930001811122C08FE30E9462 -:1008000055048093000181111BC00E944D0480E4B7 -:100810000E942B0480930001811112C08CE00E9481 -:1008200055048093000181110BC00E9455048093F0 -:100830000001811105C08FE30E94550480930001DF -:100840000E944D048091000108951092B9008AE041 -:100850008093B800089594EA9093BC009091BC00F6 -:1008600097FFFCCF9091B900987F983021F090319C -:1008700011F081E008958093BB0084E88093BC0070 -:100880008091BC0087FFFCCF8091B900887F8831C0 -:1008900011F0803471F780E0089584E98093BC0002 -:1008A0008091BC0084FDFCCF08958093BB0084E858 -:1008B0008093BC008091BC0087FFFCCF9091B90071 -:1008C000987F81E0983209F480E0089584E880936D -:1008D000BC008091BC0087FFFCCF8091BB000895D5 -:1008E00080910001811115C080E40E942B04809347 -:1008F000000181110CC082E10E9455048093000127 -:10090000811105C08FEF0E945504809300010E9461 -:100910004D0484B1807F84B985B1807F85B98AB167 -:10092000837F8AB98BB1837F8BB93E9846980895AF -:100930000E94D603809300010E94700480B38C70E3 -:1009400080BB81B3836F81BBA6E3B1E0E4E4F1E057 -:100950008EE08E0F11921D928E13FCCF0C94C0036B -:10096000BF92CF92DF92EF92FF920F931F93CF939C -:10097000DF9380910001882379F0809135018F5FAA -:1009800080933501811108C00E94D6038093000135 -:10099000811102C00E94680306E311E0C0E0D0E0CC -:1009A000DD24D39482E0C82EEE24E394F12CC730EA -:1009B000D10500F580910001811164C080E40E949E -:1009C0002B0480930001811112C082E10E94550422 -:1009D0008093000181110BC0C7010C2E01C0880F4C -:1009E0000A94EAF780950E945504809300010E94C2 -:1009F0004D0448C0CA30A1F028F4C83059F0C930BD -:100A000061F005C0CC3089F070F0CD3089F0209ACB -:100A1000289810C0219A29980DC0229A2A980AC0B5 -:100A2000239A2B9807C0529A01C0539A5B9802C030 -:100A30003E9A469890EA9A95F1F79FB1799902C04B -:100A400082E001C080E091709D25982B7C9902C0C6 -:100A500084E001C080E0892B7D9902C038E001C0AC -:100A600030E0832B7E9902C020E101C020E0822B80 -:100A70009FB19095991F9927991F9295990F907EF4 -:100A8000892B0FC080910001811149C080E40E9430 -:100A90002B0480930001882379F1B12C0E944D042E -:100AA0008B2DF8019081981719F08083C092010175 -:100AB0000E94700421960F5F1F4FCE30D10509F0C0 -:100AC00076CF80910101882361F1815080930101EB -:100AD000882339F08FE99FE00197F1F700C000000B -:100AE00020C0A4E4B1E0E6E3F1E0CF01825F9191A0 -:100AF0009D938E13FCCF15C083E10E945504809313 -:100B000000018111CACF81E40E942B04809300016F -:100B10008111C3CF0E946604B82EB094BFCF80E08D -:100B2000C0CF0E94660381E0DF91CF911F910F91AA -:100B3000FF90EF90DF90CF90BF900895E82FF0E006 -:100B4000EC5BFE4F8081089508950F931F93CF9320 -:100B5000DF93C4E4D1E010E00C2F025F899190E0B4 -:100B60000E94641B180F0C13F9CF812FDF91CF91D6 -:100B70001F910F91089581E0089508950F931F9399 -:100B8000CF93DF938C01FC01C081D181CE010E9403 -:100B9000E919BE010E946106EC01F80182818823F7 -:100BA00009F44AC080915D0181111FC0C431F0E594 -:100BB000DF0709F051C00E94BD0581E080935D010F -:100BC0000E94081C90935C0180935B011092540179 -:100BD000109256011092550110925801109257012F -:100BE00010925A011092590165C080915B01909159 -:100BF0005C010E94141C883C910570F480915401A2 -:100C0000E82FF0E0EE0FFF1FEB5AFE4FD183C083B9 -:100C10008F5F809354014EC0C43880E5D80721F01F -:100C2000C538D04501F13AC0F8018281882341F0EE -:100C30001092520182E01EC0C438E0E5DE0759F58B -:100C400080915201811106C086E20E94731186E2F2 -:100C50000E943B1282E01CC0C438F0E5DF0741F37C -:100C6000C538D045D9F4F8018281882331F010923B -:100C7000530180E20E948A121DC0809153018111AC -:100C800006C087E20E94731187E20E943B1280E255 -:100C90000E9491120FC0C538D04529F381E080939E -:100CA000520180935301C801DF91CF911F910F91A1 -:100CB0000C94BB0580E0DF91CF911F910F910895B7 -:100CC000089596E0799FF001112494E5899FE00D45 -:100CD000F11D1124E60FF11DEE0FFF1FE154FE4F31 -:100CE000859194910895880F991FFC01E55CFF4F51 -:100CF000859194910895880F991FFC01E554FE4F4A -:100D00008591949108950F931F93CF93DF93EC01F6 -:100D10008115904350F5C11580E2D80708F0C3C093 -:100D2000CB3BD10590F4C83AD10508F06AC0C53A6A -:100D3000D10508F05BC0C430D10508F0D0C12197BF -:100D400009F0CAC101E010E00AC2CF3FD10511F09D -:100D500008F0C5C1C03FD10508F0A2C0CE01805E39 -:100D60009109089708F4BBC1B7C1C13090E5D90714 -:100D700009F4A2C020F5C0318FE4D80770F4C11582 -:100D800090E4D90708F094C0C11521E3D20708F018 -:100D9000A3C1DD278E01106CE2C1C115D04509F059 -:100DA0009BC10E94F0148FEF94E32CE0815090409F -:100DB0002040E1F700C000000E94631CD0C1C115B3 -:100DC00097E5D90758F4C03121E5D20708F01CC1D6 -:100DD000C43180E5D80708F475C07EC1CE019057B4 -:100DE0008115904108F078C1DF7073C1C53AD10513 -:100DF00009F477C1C63AD10509F076C102E810E4DA -:100E0000AEC1C83AD10509F472C1C93AD10509F495 -:100E100071C1CA3AD10509F470C1CB3AD10509F4C0 -:100E20006FC1CC3AD10509F46EC1CD3AD10509F4B0 -:100E30006DC1C03BD10509F46CC1CE3AD10509F4AE -:100E40006BC1CF3AD10509F46AC1C13BD10509F4A0 -:100E500069C1C23BD10509F468C1C33BD10509F49E -:100E600067C1C43BD10509F466C1C53BD10509F48E -:100E700065C1C63BD10509F464C1C73BD10509F47E -:100E800063C1C83BD10509F462C1C93BD10509F46E -:100E900061C1CA3BD10509F460C100E014E45FC13F -:100EA0008E0110655CC1CE019F700E947B0658C107 -:100EB000DF708E01106A53C18091DA0181608093E6 -:100EC000DA014DC10E94081E811102C00E94EE1D70 -:100ED0000E94251E90E09093FB018093FA01C2309E -:100EE00080E5D80721F48091FA01816086C0C43082 -:100EF00090E5D90721F48091FA0182607EC0C63066 -:100F000020E5D20721F48091FA01846076C0C830D0 -:100F100080E5D80719F48091FA0127C0CA3090E51E -:100F2000D90721F48091FA01806167C0CC3020E5B7 -:100F3000D20721F48091FA0180625FC0CE3080E553 -:100F4000D80721F48091FA01806457C0C03190E540 -:100F5000D90721F48091FA0180684FC0C23120E5A1 -:100F6000D20729F48091FA018460886046C0C330BA -:100F700080E5D80721F48091FA018E7F3EC0C5300C -:100F800090E5D90721F48091FA018D7F36C0C730F2 -:100F900020E5D20721F48091FA018B7F2EC0C93061 -:100FA00080E5D80719F48091FA0126C0CB3090E58E -:100FB000D90721F48091FA018F7E1FC0CD3020E542 -:100FC000D20721F48091FA018F7D17C0CF3080E5E0 -:100FD000D80721F48091FA018F7B0FC0C13190E5D1 -:100FE000D90721F48091FA018F7707C0C331D0452A -:100FF00031F48091FA018B7F877F8093FA01809191 -:10100000FA010E94291EABC08D2F99278F70992756 -:1010100081309105D9F49E012370332702C0880FD7 -:10102000991F2A95E2F79C688E0144E0000F111F7A -:101030004A95E1F700271370802B912B53E0CC0FDA -:10104000DD1F5A95E1F7C076DD272FC0823091056C -:1010500031F4DC2FCC278E01016F106A80C0833001 -:10106000910569F4CE018370992701E010E002C078 -:10107000000F111F8A95E2F7C8019C680FC08430E9 -:101080009105B9F4CE018370992701E010E002C008 -:10109000000F111F8A95E2F7C8019A6823E0CC0F70 -:1010A000DD1F2A95E1F7C07ED7708C010C2B1D2B1C -:1010B00056C08530910531F4DC2FCC278E01046FAA -:1010C000106A4DC0069709F04AC0CF71DD27DC2FAA -:1010D000CC278E01106243C000E010E040C08E01BA -:1010E0003EC001E810E43BC003E810E438C002EE63 -:1010F00014E435C009EE14E432C00AEE14E42FC043 -:1011000005EB14E42CC006EB14E429C007EB14E44F -:1011100026C00CEC14E423C00DEC14E420C003E85A -:1011200015E41DC00AE815E41AC002E915E417C069 -:1011300004E915E414C001E216E411C003E216E468 -:101140000EC004E216E40BC005E216E408C006E295 -:1011500016E405C007E216E402C00AE216E4C8017C -:10116000DF91CF911F910F91089596E0799FF00143 -:10117000112494E5899FE00DF11D1124E60FF11D66 -:10118000EE0FFF1FE154FE4F85919491803E910533 -:10119000E0F4803C910558F58133910509F46FC066 -:1011A00048F48932910509F463C08A32910509F443 -:1011B0006DC072C089339105E9F082389105D1F094 -:1011C0008533910509F44DC067C0833E910581F1D7 -:1011D00038F4803E9105B9F0823E9105D9F05CC0AB -:1011E000863E910561F1873E9105A1F155C00E94AF -:1011F000730608952091FA0120FD02C021FF4CC022 -:1012000080EE90E049C08091FA0180FFF9CF89E338 -:1012100090E042C08091FA0182FF0EC08091FA01F5 -:1012200084FF03C080E090E037C083EE90E034C0DC -:101230008091FA0182FFF2CF82EE90E02DC0809182 -:10124000FA0183FF0BC08091FA0184FDEBCF87EE9A -:1012500090E022C08091FA0183FFF5CF86EE90E006 -:101260001BC08091FA0185FF07C089E290E014C09D -:101270008091FA0185FFF9CF85E390E00DC0809160 -:10128000FA0186FF07C08AE290E006C08091FA0169 -:1012900086FFF9CF81E390E00E94830608950895C8 -:1012A0000C944F0980916E010895CF93DF9300D085 -:1012B0001F92CDB7DEB79C018091F101843019F502 -:1012C00093E099833B832A839093E9008FEF909179 -:1012D000E800815095FD06C095ED9A95F1F7000064 -:1012E0008111F5CF8091E80085FF0DC040E050E00E -:1012F00063E070E0CE0101960E94BF0B8091E80090 -:101300008E778093E8000F900F900F90DF91CF9130 -:101310000895CF93DF9300D01F92CDB7DEB7209111 -:10132000F101243021F522E029839B838A8383E025 -:101330008093E9008FEF9091E800815095FD06C001 -:1013400095ED9A95F1F700008111F5CF8091E800B5 -:1013500085FF0DC040E050E063E070E0CE010196F3 -:101360000E94BF0B8091E8008E778093E8000F9079 -:101370000F900F90DF91CF9108952091F1012430CB -:10138000F1F422E02093E9002FEF3091E8002150A2 -:1013900035FD06C035ED3A95F1F700002111F5CF86 -:1013A0002091E80025FF0BC040E050E065E070E0D0 -:1013B0000E94BF0B8091E8008E778093E80008952B -:1013C000CF93DF93EC019091F101943009F046C086 -:1013D00080910C018823D9F080910D018823B9F008 -:1013E0009093E9008FEF9091E800815095FD06C041 -:1013F00095E19A95F1F700008111F5CF8091E80011 -:1014000085FF2CC040E050E060E170E017C081E053 -:101410008093E9008FEF9091E800815095FD06C020 -:1014200095ED9A95F1F700008111F5CF8091E800D4 -:1014300085FF14C040E050E068E070E0CE010E94FB -:10144000BF0B8091E8008E778093E80080E1FE0179 -:10145000AEE5B1E001900D928A95E1F7DF91CF9171 -:1014600008958091F001811109C00E94540D0E94DD -:10147000B10D8091E20084608093E20008951092A3 -:10148000F001089508950C9498220E94F91B0E947F -:101490009E220E9457100C94500942E061EC81E0BA -:1014A0000E94CE0C42E061EC82E00E94CE0C42E051 -:1014B00061EC83E00E94CE0C42E161EC84E00C948C -:1014C000CE0C8091F301833009F455C030F48130A3 -:1014D00071F0823009F48EC008958A3009F47AC020 -:1014E0008B3009F460C0893009F09CC020C0809125 -:1014F000F201813A09F096C08091E800877F8093DD -:10150000E8008091F6019091F701892B21F460E1C8 -:101510008EE591E003C060E080E090E070E00E9422 -:101520000A0C8091E8008B778093E8000895809101 -:10153000F201813209F076C08091F6019091F701B5 -:10154000009719F0039709F06DC08091E800877F3C -:101550008093E8008091E80082FD05C08091F10150 -:101560008111F8CF5FC08091F10080936E0180916E -:10157000E8008B7753C08091F201813A09F052C0A4 -:101580008091F6019091F701892B09F04BC0809171 -:10159000E800877F8093E8008091E80080FFFCCF1F -:1015A00080910C0136C08091F2018132D9F5809191 -:1015B000F6019091F701892BA9F58091E800877FCA -:1015C0008093E8000E94030D8091F40180930C0148 -:1015D0000C94F0148091F201813221F58091E800A1 -:1015E000877F8093E8000E94030D8091F50180932E -:1015F0006F0108958091F201813AA1F48091E80091 -:10160000877F8093E8008091E80080FFFCCF809185 -:101610006F018093F1008091E8008E778093E8005D -:101620000C94030D089584B7877F84BF88E10FB6BB -:10163000F89480936000109260000FBE90E080E804 -:101640000FB6F89480936100909361000FBE0E94E2 -:10165000A6100E94540D0E94B10D8091E20084609A -:101660008093E20078940E9437100E94A81082E0D4 -:1016700091E00E9452100E9486228091F1018530F3 -:1016800069F40E94C01B8091EF018823B1F30E948E -:10169000EB1B882391F30E94A90BEFCF0E94AE10A1 -:1016A000ECCF292F332723303105C9F064F42130E2 -:1016B000310581F02230310509F043C08DE690E01C -:1016C0002BEE33E042C021323105F1F022323105F8 -:1016D00041F137C082E190E028E534E036C0992737 -:1016E0008130910541F08230910541F0892B49F517 -:1016F000E7EEF3E005C0EFECF3E002C0E7EBF3E068 -:10170000849190E09F0121C06430D8F4E62FF0E08E -:10171000EE0FFF1FEE5DFE4F2081318189E090E0EA -:1017200014C0643070F470E0FB01EE0FFF1FE65E42 -:10173000FE4F20813181FB01EA5EFE4F808190E007 -:1017400004C080E090E020E030E0FA0131832083A3 -:10175000089580E189BD82E189BD09B400FEFDCF15 -:101760008091D8008F7D8093D8008091E0008260C6 -:101770008093E0008091E00081FDFCCF0895CF923E -:10178000DF92EF92FF920F931F93CF93DF93EC01C1 -:101790008B016A010E94220D811133C0C114D10452 -:1017A00039F0F60180819181081B190BC80FD91FF0 -:1017B000E12CF12C0115110519F18091E80085FD4E -:1017C00016C08091E8008E778093E800C114D104A0 -:1017D00049F0F60180819181E80EF91EF182E082E4 -:1017E00085E00FC00E94220D882321F30AC0899151 -:1017F0008093F10001501109FFEFEF1AFF0ADACFD1 -:1018000080E0DF91CF911F910F91FF90EF90DF90DB -:10181000CF9008952091F8013091F90126173707EC -:1018200048F06115710539F42091E8002E77209376 -:10183000E80001C0B90140E061157105A9F12091EE -:10184000F101222309F443C0253009F442C020915C -:10185000E80023FD40C02091E80022FD32C0209125 -:10186000E80020FFE9CF4091F3002091F20030E042 -:10187000342BFC01CF016115710559F02830310579 -:1018800040F481918093F100615071092F5F3F4FC7 -:10189000F1CF41E02830310509F040E02091E80027 -:1018A0002E772093E800C8CF4111C9CF0AC080919C -:1018B000F101882361F0853061F08091E80083FDBB -:1018C0000AC08091E80082FFF2CF80E0089582E0B4 -:1018D000089583E0089581E008952091F801309102 -:1018E000F9012617370748F06115710539F4209181 -:1018F000E8002E772093E80001C0B901FC0120E048 -:101900006115710591F18091F101882309F440C0BE -:10191000853009F43FC08091E80083FD3DC080918F -:10192000E80082FD2FC08091E80080FFE9CF209180 -:10193000F3008091F20090E0922B6115710559F04F -:101940008830910540F424912093F1003196615044 -:1019500071090196F2CF21E0089709F020E080910B -:10196000E8008E778093E800CBCF2111CCCF0AC05E -:101970008091F101882361F0853061F08091E80069 -:1019800083FD0AC08091E80082FFF2CF80E00895D5 -:1019900082E0089583E0089581E00895982F9730BC -:1019A00058F59093E900981739F07091EC00209168 -:1019B000ED005091F00003C0242F762F50E021FF5E -:1019C00019C03091EB003E7F3093EB003091ED0079 -:1019D0003D7F3093ED003091EB0031603093EB00B0 -:1019E0007093EC002093ED005093F0002091EE00F6 -:1019F00027FF07C09F5FD3CF8F708093E90081E0FE -:101A0000089580E008958091F20187FF11C08091D0 -:101A1000E80082FD05C08091F1018111F8CF11C06D -:101A20008091E8008B770BC08091F101882349F009 -:101A30008091E80080FFF8CF8091E8008E77809356 -:101A4000E80008952091E4003091E50095E640918A -:101A5000EC00842F817040FF22C08091E80080FD5F -:101A60001CC08091F101882391F0853091F0809124 -:101A7000EB0085FD10C04091E4005091E500421755 -:101A8000530729F39A01915011F784E0089582E0F9 -:101A9000089583E0089581E0089580E008954091DD -:101AA000E80042FFDECF08950E94C20D0E94CA0DD9 -:101AB000E0EEF0E0808181608083E8EDF0E08081FD -:101AC0008F77808319BCA7EDB0E08C918E7F8C93CB -:101AD00080818F7E80831092F00108950F931F9371 -:101AE000CF93DF930E94C20D0E94CA0DC8EDD0E0D3 -:101AF00088818F77888388818068888388818F7DBB -:101B0000888319BC1092F1011092ED011092EF013F -:101B10001092EE0100EE10E0F80180818B7F80834F -:101B200088818160888342E060E080E00E94CE0C82 -:101B3000E1EEF0E080818E7F8083E2EEF0E0808154 -:101B400081608083808188608083F80180818E7FBE -:101B50008083888180618883DF91CF911F910F916D -:101B60000895E8EDF0E080818F7E8083E7EDF0E07E -:101B700080818160808384E082BF81E08093F00176 -:101B80000C946E0DE8EDF0E080818E7F80831092E2 -:101B9000E20008951092DA001092E10008951F9279 -:101BA0000F920FB60F9211242F933F934F935F9391 -:101BB0006F937F938F939F93AF93BF93EF93FF9315 -:101BC0008091E10082FF0BC08091E20082FF07C09C -:101BD0008091E1008B7F8093E1000E94361080911C -:101BE000DA0080FF1FC08091D80080FF1BC0809169 -:101BF000DA008E7F8093DA008091D90080FF0DC0DB -:101C000080E189BD82E189BD09B400FEFDCF81E09C -:101C10008093F1010E94310A05C019BC1092F101B4 -:101C20000E943F0A8091E10080FF19C08091E2008C -:101C300080FF15C08091E2008E7F8093E20080914A -:101C4000E20080618093E2008091D80080628093FE -:101C5000D80019BC85E08093F1010E94430A80916D -:101C6000E10084FF30C08091E20084FF2CC080E15D -:101C700089BD82E189BD09B400FEFDCF8091D80005 -:101C80008F7D8093D8008091E1008F7E8093E1006A -:101C90008091E2008F7E8093E2008091E20081607B -:101CA0008093E2008091ED01882311F084E007C069 -:101CB0008091E30087FD02C081E001C083E0809352 -:101CC000F1010E94450A8091E10083FF29C08091C3 -:101CD000E20083FF25C08091E100877F8093E100CF -:101CE00082E08093F1011092ED018091E1008E7FFE -:101CF0008093E1008091E2008E7F8093E2008091EA -:101D0000E20080618093E20042E060E080E00E94B7 -:101D1000CE0C8091F00088608093F0000E94420A0F -:101D2000FF91EF91BF91AF919F918F917F916F91B3 -:101D30005F914F913F912F910F900FBE0F901F9089 -:101D400018951F920F920FB60F9211242F933F9365 -:101D50004F935F936F937F938F939F93AF93BF93B3 -:101D6000CF93DF93EF93FF93C091E900CF70809101 -:101D7000EC00D82FD17080FDD0E81092E90080915E -:101D8000F000877F8093F00078940E94E50E109217 -:101D9000E9008091F00088608093F000CD2BCF7037 -:101DA000C093E900FF91EF91DF91CF91BF91AF9187 -:101DB0009F918F917F916F915F914F913F912F9163 -:101DC0000F900FBE0F901F9018951F93CF93DF9326 -:101DD000CDB7DEB7AA970FB6F894DEBF0FBECDBF62 -:101DE000E2EFF1E088E08E0F9091F10091938E1375 -:101DF000FBCF0E94610A8091E80083FF1FC18091A0 -:101E0000F2019091F301492F50E04A30510508F05A -:101E100015C1FA01EA5AFF4F0C942024803881F052 -:101E2000823809F00BC18091F6018F708093E90030 -:101E30008091EB0085FB882780F91092E90006C0AD -:101E40008091EE019091EF01911182609091E800F4 -:101E5000977F9093E8008093F1001092F100C8C042 -:101E6000282F2D7F09F0EAC0882319F0823061F015 -:101E7000E5C08091F401813009F0E0C0933009F0B1 -:101E800080E08093EF012BC08091F401811127C085 -:101E90008091F6018F7009F4D1C08093E900209100 -:101EA000EB0020FF1CC0933021F48091EB00806296 -:101EB00014C09091EB0090619093EB0021E030E032 -:101EC000A90102C0440F551F8A95E2F74093EA002A -:101ED0001092EA008091EB0088608093EB001092F2 -:101EE000E9008091E800877F86C08111A7C010912A -:101EF000F4011F778091E3008078812B8093E300C9 -:101F00008091E800877F8093E8000E94030D809114 -:101F1000E80080FFFCCF8091E30080688093E300BD -:101F2000111102C082E001C083E08093F10186C0FC -:101F30008058823008F082C08091F4019091F501C0 -:101F40008C3D53E0950779F583E08A838AE28983A3 -:101F50004FB7F894DE01139620E03EE051E2E32F04 -:101F6000F0E050935700E49120FF03C0E295EF703A -:101F70003F5FEF708E2F90E0EA3010F0C79601C0FF -:101F8000C0968D939D932F5F243149F74FBF809169 -:101F9000E800877F8093E8006AE270E0CE01019656 -:101FA0000E940A0C14C0AE014F5F5F4F6091F601B2 -:101FB0000E94510BBC01892B09F440C09091E800AC -:101FC000977F9093E80089819A810E946D0C80919F -:101FD000E8008B778093E80031C0803879F58091F4 -:101FE000E800877F8093E8008091ED018093F10005 -:101FF0008091E8008E778093E8000E94030D1EC058 -:1020000081111CC09091F4019230C0F48091E800DD -:10201000877F8093E8009093ED010E94030D8091EB -:10202000ED01811106C08091E30087FD02C081E0CF -:1020300001C084E08093F1010E944D0A8091E80084 -:1020400083FF0AC08091E800877F8093E800809139 -:10205000EB0080628093EB00AA960FB6F894DEBF87 -:102060000FBECDBFDF91CF911F9108950895CF93FB -:102070008091F1018823A1F0C091E900CF70909187 -:10208000EC00892F817090FD80E8C82B1092E90048 -:102090008091E80083FD0E94E50ECF70C093E900B7 -:1020A000CF91089590937501809374010895E09104 -:1020B0007401F0917501309721F00190F081E02DCD -:1020C000099480E00895E0917401F09175013097D2 -:1020D00021F00280F381E02D09940895E0917401CC -:1020E000F0917501309721F00480F581E02D09947D -:1020F000089520917201309173018217930771F056 -:102100009093730180937201E0917401F0917501D5 -:10211000309721F00680F781E02D099408952091F1 -:102120007001309171018217930771F090937101E2 -:1021300080937001E0917401F0917501309721F066 -:102140000084F185E02D0994089508950C94A5105C -:102150000E94FF1B0E9498040C94C11C9F92AF9296 -:10216000BF92CF92DF92EF92FF920F931F93CF9384 -:10217000DF9300D000D000D0CDB7DEB70E94B0040E -:102180000DE010E0AA24A394B12C902E802F0E9481 -:102190009E05980129583E4F6901F901F080F82603 -:1021A000A1F40150110988F78FEF89838A831B827C -:1021B0000E94081C8160782F9D838C8349815A81FD -:1021C0006B818D810E9445112FC09091DA0191FFA2 -:1021D00004C08E830E94A4058E8125E030E0A50115 -:1021E000022E01C0440F0A94EAF7E42E4F21C1F0F9 -:1021F00029839A828E2191E009F490E09B830E94CA -:10220000081C8160782F9D838C8349815A816B8162 -:102210008D810E944511F6018081E826E08204C08C -:1022200021503109E0F6BDCF0E94A81F1091760120 -:102230000E9457101817B9F00E945710809376012A -:1022400026960FB6F894DEBF0FBECDBFDF91CF91BB -:102250001F910F91FF90EF90DF90CF90BF90AF90C4 -:102260009F900C94500926960FB6F894DEBF0FBECF -:10227000CDBFDF91CF911F910F91FF90EF90DF9035 -:10228000CF90BF90AF909F900895CF93DF93CDB73D -:10229000DEB72B970FB6F894DEBF0FBECDBF4F83CE -:1022A000588769877A878B87DE01119686E0FD0162 -:1022B00011928A95E9F785E0FE01379601900D921B -:1022C0008A95E1F749815A816B817C818D819E815C -:1022D0000E948E172B960FB6F894DEBF0FBECDBFAF -:1022E000DF91CF910895CF93882309F4C2C0C82FFE -:1022F000823859F40E94571081FDBBC089E30E94C7 -:10230000681A0E94351B89E30CC0833879F40E9457 -:10231000571080FDAEC083E50E94681A0E94351BED -:1023200083E50E94AA1ACF910C94351B843859F486 -:102330000E94571082FD9DC087E40E94681A0E9487 -:10234000351B87E4EECF8CEF8C0F813A48F48C2F4D -:102350000E94EB2181118DC08C2F0E94681AE3CF5F -:1023600080E28C0F883048F4C77081E001C0880F8C -:10237000CA95EAF70E94EE1AD6CF8BE58C0F833010 -:1023800078F4C53A29F0C63A31F083E890E005C008 -:1023900081E890E002C082E890E0CF910C9479103F -:1023A00088E58C0F833108F064C0C83A39F1C93A26 -:1023B00041F1CA3A49F1CB3A51F1CC3A59F1CD3A0F -:1023C00061F1C03B69F1CE3A71F1CF3A79F1C13B8D -:1023D00081F1C23B89F1C33B91F1C43B99F1C53B0B -:1023E000A1F1C63BA9F1C73BB1F1C83BB9F1C93B6B -:1023F000C1F1CA3BC9F180E090E038C082EE90E0C4 -:1024000035C089EE90E032C08AEE90E02FC085EBB7 -:1024100090E02CC086EB90E029C087EB90E026C0CE -:102420008CEC90E023C08DEC90E020C083E891E03C -:102430001DC08AE891E01AC082E991E017C084E9E2 -:1024400091E014C081E292E011C083E292E00EC0FC -:1024500084E292E00BC085E292E008C086E292E05E -:1024600005C087E292E002C08AE292E0CF910C942C -:102470008F10CF910895882309F44BC0823859F406 -:102480000E94571081FF45C089E30E94681A0E948C -:10249000351B89E30CC0833871F40E94571080FF0C -:1024A00038C083E50E94681A0E94351B83E50E94AC -:1024B000AA1A0C94351B843859F40E94571082FFD5 -:1024C00028C087E40E94681A0E94351B87E4EFCF7A -:1024D0009CEF980F913A58F390E2980F983050F48F -:1024E000877091E001C0990F8A95EAF7892F0E94C1 -:1024F000F41ADFCF9BE5980F933020F480E090E052 -:102500000C947910885A833120F480E090E00C9488 -:102510008F100895882321F00E94EE1A0C94351B29 -:102520000895882321F00E94F41A0C94351B089515 -:102530007F928F929F92AF92BF92CF92DF92EF9253 -:10254000FF920F931F93CF93DF931F92CDB7DEB708 -:102550007C01C62E772EFC01058102950F70128139 -:1025600011110E940B1B0E94611A882379F011231C -:1025700069F080E28C0D883048F082E00E944A1AAF -:102580000E94611A91E0D82ED92601C0D12CE72DE6 -:10259000E295EF70F0E0E05AFF4F0C942024872D75 -:1025A000807F072D0F70882311F00295007F112383 -:1025B00089F0002309F490C180E28C0D883020F46A -:1025C000802F0E94EE1A03C0802F0E94FE1A0E94E4 -:1025D000351B82C18C2D0E943B12002309F495C14A -:1025E00080E28C0D883020F4802F0E94F41A03C002 -:1025F000802F0E94041B0E94351B87C1972D907F5E -:10260000872D8F70903211F08295807FCC2021F041 -:10261000F1E0CF16B1F01EC0112349F0002309F4F8 -:1026200014C1013009F011C10E941E1B6EC10023AC -:1026300019F0013009F469C189830E94211B898145 -:102640000AC1112321F0023008F05FC1FEC0011160 -:102650005CC101C1112321F0002309F4F6C03CC183 -:10266000002309F4F8C03EC1872D869586958370B6 -:1026700090E0009719F0019761F047C1112321F014 -:102680008C2D972D937002C080E090E00E9479100D -:102690003CC1112321F08C2D972D937002C080E056 -:1026A00090E00E948F1031C18C2D112319F00E94EF -:1026B000B01E02C00E94181F0E949D1F26C1872DB8 -:1026C000837009F052C0111120C18C2D829586951E -:1026D0008770880F880F9C2D9F70892E912CA12CBC -:1026E000B12C082E04C0880C991CAA1CBB1C0A948F -:1026F000D2F7C4FE14C00FE010E020E030E0B901D2 -:10270000A80104C0440F551F661F771F8A95D2F792 -:10271000CB01BA01609570958095909503C060E0FB -:1027200070E0CB01272D26952695237030E02230CE -:10273000310569F02330310589F0682979298A2922 -:102740009B292130310571F00E94D618DEC068291E -:1027500079298A299B290E94F218D7C00E94D6188D -:10276000C501B4010E94BA18D0C0112319F0872DF9 -:10277000817001C08695882309F4C7C08C2D82958D -:1027800086958770880F880F9C2D9F70892E912CBD -:10279000A12CB12C082E04C0880C991CAA1CBB1CAF -:1027A0000A94D2F7C4FE14C00FE010E020E030E03D -:1027B000B901A80104C0440F551F661F771F8A95F1 -:1027C000D2F7CB01BA01609570958095909503C0C2 -:1027D00060E070E0CB01272D269526952370422FCF -:1027E00050E04230510569F04330510589F06829C5 -:1027F00079298A299B294130510571F00E94B0192D -:1028000084C0682979298A299B290E94CC197DC016 -:102810000E94B019C501B4010E94941976C08C2D94 -:1028200090E0FC01E05EF109E531F10508F050C0EF -:10283000E059FF4F0C9420240C2D0F70872D8F71C1 -:10284000112331F00E942D19802F0E948A125DC041 -:102850000E944E19802F0E94911257C0112339F007 -:10286000011153C0872D8F710E9473194EC0023021 -:1028700008F04BC0F7CF112339F0872D8F710E94DC -:102880002D1943C01123C9F3872D8F710E944E1952 -:102890003CC0112329F0872D8F710E94181935C073 -:1028A0000E940E1932C0112351F0172D1F71812F74 -:1028B0000E942D1963E0812F0E94411A26C081E0F9 -:1028C0000E944A1A023008F182E00E944A1A1DC092 -:1028D000112331F0002389F28C2D0E94731115C051 -:1028E000002391F28C2D0E943B120FC0472D4F7098 -:1028F0006C2DC7010E9419030E94321806C0472D93 -:102900004F706C2DC7010E946006DD20F9F00E9417 -:102910003D1A80FD1BC0F70112820E94371A0E94E7 -:102920002D19C7010E94B5140E94371A0F90DF912C -:10293000CF911F910F91FF90EF90DF90CF90BF90BC -:10294000AF909F908F907F900C944E190F90DF91D5 -:10295000CF911F910F91FF90EF90DF90CF90BF909C -:10296000AF909F908F907F9008950F931F93CF9378 -:10297000DF93EC01888199812B813C81232BB9F075 -:102980009F3F11F48F3F99F0CE010E94BE0588232E -:1029900071F0688179818A810E94331A8C010E94CA -:1029A000E8190E94AF18B801CE010E949812DF9179 -:1029B000CF911F910F9108950E940B1B0E941B1B2A -:1029C0000E94E01A0E94351B0E944E200E949D1F0B -:1029D00080E090E00E94791080E090E00C948F10ED -:1029E0000E94FB1A0C94DC140E94281A292F2295AD -:1029F0002F7030E02C3031054CF42A3031056CF466 -:102A00002250310922303105A8F407C02C3031059D -:102A100069F02F30310551F00DC0803F69F018F496 -:102A2000803E40F409C0843F29F406C093FB882708 -:102A300080F9089580E0089581E00895CF93DF93B1 -:102A400000D000D01F92CDB7DEB70F900F900F903F -:102A50000F900F90DF91CF910895CF93DF9300D027 -:102A600000D000D0CDB7DEB726960FB6F894DEBF03 -:102A70000FBECDBFDF91CF9108951F93CF93DF930A -:102A8000C091850116E080918601C81799F0D0E0C9 -:102A90001C9FF0011D9FF00D1124E957FE4F40814E -:102AA000518162817381848195810E942D152196C7 -:102AB000C770E9CFDF91CF911F9108954091B70181 -:102AC0005091B8016091B9017091BA018091BB0138 -:102AD0009091BC010C942D158091BC0182958F7052 -:102AE00009F054C08091B901882309F44FC0809146 -:102AF0008501A09186016091B7017091B801409164 -:102B0000BA015091BB01B6E08A1709F43FC090E0CA -:102B100041155105C1F17F3F11F46F3FA1F1B89FFD -:102B2000F001B99FF00D1124E957FE4F2181721376 -:102B30002AC02081621327C02281211124C0238151 -:102B400034812417350710F421503109241B350B2B -:102B5000283C3105C0F42091BC012F7020612093E6 -:102B6000BC0126E0289FF001299FF00D1124E457B5 -:102B7000FE4F80818F708061808387EB91E00E949F -:102B8000B5140C943D1501968770BECF0895CF9271 -:102B9000DF92EF92FF920F931F93CF93DF93CDB706 -:102BA000DEB762970FB6F894DEBF0FBECDBF8C01C3 -:102BB00085E0F801DE011D9601900D928A95E1F7FE -:102BC000D8014C9111965C91119712966C911297C5 -:102BD0001396CD90DC9014973091B7017091B801A5 -:102BE0008091BA019091BB01009709F46BC17F3FBE -:102BF00019F43F3F09F466C1E090B901EE2009F4F1 -:102C0000C0C02091BC01C816D90628F0F601E81B07 -:102C1000F90BCF0104C0809590958C0D9D1DFF246C -:102C2000F394883C910578F0F12C207F09F0C6C020 -:102C30007C2DD98AC88A89890E941E1587EB91E06C -:102C40000E94B514B1C0822F807F09F046C0751371 -:102C500014C0341312C0611110C02F702061209372 -:102C6000BC010E945E1587EB91E00E94B514809133 -:102C7000BC01D80115968C932EC0CD2819F15F3F69 -:102C800011F44F3FF9F0F62E61111CC080918501BF -:102C90002091860136E0821709F45AC090E0389FEF -:102CA000F001399FF00D1124E957FE4F7181571340 -:102CB00006C07081471303C07281711103C0019671 -:102CC0008770E9CFF62E662309F418C18091BC0104 -:102CD00081608093BC01F12C11C1751308C03413BD -:102CE00006C0611104C08091BC01D801C3C04D87EA -:102CF0005E878D859E856A8B0E94F4146A8988237D -:102D0000E1F16623D1F12091BC01822F82958F7071 -:102D100090E0029774F08091B7019091B801988784 -:102D20008F831986DB86CA862C87CE0107960E9480 -:102D3000B51486E0F801A7EBB1E001900D928A95F9 -:102D4000E1F70E946C150E945E15FF24F394D6C033 -:102D50004D875E878D859E850E94281A292F229592 -:102D60002F7030E0223031050CF0BCC09F7009F0AC -:102D7000B6C0805E883008F4C1C0C8010E94B51496 -:102D8000E4CFC816D90608F453C0F601E81BF90BC6 -:102D9000CF01883C910508F450C0F12C7C2DD98AD4 -:102DA000C88A89890E941E15E7EBF1E086E0DF0101 -:102DB0001D928A95E9F70E945E15A0C0751314C094 -:102DC000341312C0611110C08091BC01F8018583D9 -:102DD000C8010E94B51486E0E7EBF1E0DF011D9227 -:102DE0008A95E9F7FE2C8AC04D875E878D859E8582 -:102DF0006A8B0E94F4146A89882309F4BECF662383 -:102E000009F4BBCF2091BC01822F82958F7090E096 -:102E100002970CF48ECF8091B7019091B8019A83FC -:102E200089831B82DD82CC822E83CE0101967FCFE7 -:102E3000809590958C0D9D1DACCFF62E662309F4E0 -:102E40009CCF75132EC034132CC02091BC0120FDE3 -:102E50001FC0822F82958F70D9F0D80115962C93C0 -:102E600015978F3049F08F5F982F9295907F822F22 -:102E70008F70892B15968C93C8010E94B51486E03B -:102E8000F801A7EBB1E001900D928A95E1F793CF9D -:102E900086E0F801A7EBB1E001900D928A95E1F789 -:102EA0002DC04D875E878D859E850E94F41481110B -:102EB00040CF8091BC0181608093BC01C8010E9419 -:102EC000B5141CC0662309F458CF4D875E878D85E5 -:102ED0009E850E94F414882309F44FCF2ACF8111D4 -:102EE00048CF0CC0243031050CF047CF9F7009F457 -:102EF00040CFF8019581907F09F03BCF8F2D6296EE -:102F00000FB6F894DEBF0FBECDBFDF91CF911F91FA -:102F10000F91FF90EF90DF90CF9008951F93CF9384 -:102F2000DF93CDB7DEB72C970FB6F894DEBF0FBE98 -:102F3000CDBF4F83588769877A878B879C87CE015F -:102F400007960E94C715882369F08F8198852A8586 -:102F50003B85232BF1F19F3F09F063C08F3F09F0C0 -:102F600060C037C086E0FE013796DE011196019001 -:102F70000D928A95E1F76F817885EA85FB85309718 -:102F800041F17F3F11F46F3F21F12091860130E044 -:102F9000C9010196877099274091850150E08417F7 -:102FA000950709F447C069837A83FD83EC8396E033 -:102FB000929FD001939FB00D1124A957BE4FFE01DF -:102FC000319601900D929A95E1F7809386010E94C7 -:102FD0003D1516E080918501909186018917C1F118 -:102FE000189FC001112489579E4F0E94C71588233E -:102FF00079F1E09185011E9FF0011124E957FE4F00 -:103000004081518162817381848195810E942D1557 -:103010008091850190E001968770992780938501C2 -:10302000D9CF4F81588569857A858B859C850E948B -:103030002D15CFCF0E94F0141092860110928501B9 -:10304000E7EBF1E086E0DF011D928A95E9F7C1CF59 -:103050002C960FB6F894DEBF0FBECDBFDF91CF9197 -:103060001F910895EF92FF920F931F93CF93DF93D9 -:103070008C01892B09F46CC0F12CEE24E394E80157 -:103080002196F8018491843740F4843008F051C0CF -:10309000813081F0823019F15BC0853709F444C07A -:1030A000A8F19CE7980F903708F052C08F770E94E4 -:1030B0003B1241C00E5F1F4FFE01C49180E28C0F96 -:1030C000883048F4C7708E2D01C0880FCA95EAF782 -:1030D0000E940E1B14C08C2F0E9473112DC00E5F16 -:1030E0001F4FFE01C49180E28C0F883058F4C770E6 -:1030F0008E2D01C0880FCA95EAF70E94141B0E940A -:10310000351B1AC08C2F0E943B1216C00E5F1F4F3A -:10311000FE01C491CC2381F08FE99FE00197F1F784 -:1031200000C00000C150F6CF0E5F1F4FFE01F490AB -:1031300003C00E9473118E018F2D882309F49FCF45 -:10314000EFE9FFE03197F1F700C000008150F5CFC3 -:10315000DF91CF911F910F91FF90EF900895089507 -:103160006093C1017093C2018093C3019093C40125 -:103170000C94DC140F931F930091C1011091C201B4 -:103180002091C3013091C401DC01CB01802B912B34 -:10319000A22BB32B8093C1019093C201A093C301D2 -:1031A000B093C4011F910F910C94DC140F931F93E3 -:1031B0000091C1011091C2012091C3013091C4015D -:1031C000DC01CB0180239123A223B3238093C1018F -:1031D0009093C201A093C301B093C4011F910F91BA -:1031E0000C94DC140F931F930091C1011091C20144 -:1031F0002091C3013091C401DC01CB0180279127CC -:10320000A227B3278093C1019093C201A093C30169 -:10321000B093C4011F910F910C94DC141092BD0166 -:103220001092BE011092BF011092C0010C94DC14E8 -:1032300041E050E060E070E004C0440F551F661F9D -:10324000771F8A95D2F74093BD015093BE016093DA -:10325000BF017093C0010C94DC1441E050E060E0C9 -:1032600070E004C0440F551F661F771F8A95D2F780 -:103270008091BD019091BE01A091BF01B091C001AC -:10328000482B592B6A2B7B2B4093BD015093BE01D9 -:103290006093BF017093C0010C94DC1441E050E0D6 -:1032A00060E070E004C0440F551F661F771F8A95C9 -:1032B000D2F740955095609570958091BD019091A1 -:1032C000BE01A091BF01B091C001482359236A23D8 -:1032D0007B234093BD015093BE016093BF01709367 -:1032E000C0010C94DC1441E050E060E070E004C0E8 -:1032F000440F551F661F771F8A95D2F78091BD0135 -:103300009091BE01A091BF01B091C00148275927FB -:103310006A277B274093BD015093BE016093BF0194 -:103320007093C0010C94DC140F931F930091BD01A6 -:103330001091BE012091BF013091C001DC01CB0191 -:10334000802B912BA22BB32B8093BD019093BE01B8 -:10335000A093BF01B093C0011F910F910C94DC1496 -:103360000F931F930091BD011091BE012091BF01E9 -:103370003091C001DC01CB0180239123A223B32330 -:103380008093BD019093BE01A093BF01B093C00193 -:103390001F910F910C94DC140F931F930091BD01AA -:1033A0001091BE012091BF013091C001DC01CB0121 -:1033B00080279127A227B3278093BD019093BE0158 -:1033C000A093BF01B093C0011F910F910C94DC1426 -:1033D0000895CF92DF92EF92FF920F931F93CF93B6 -:1033E000DF938C01C090C101D090C201E090C30175 -:1033F000F090C4018091BD019091BE01A091BF01E8 -:10340000B091C001C82AD92AEA2AFB2ACFE1D0E02C -:10341000D701C6010C2E04C0B695A7959795879540 -:103420000A94D2F780FF06C0B8018C2F0E94B5081D -:10343000019721F4219760F780E001C08C2FDF9184 -:10344000CF911F910F91FF90EF90DF90CF90089553 -:10345000CF93DF93EC010E94E919BE010E94B508E9 -:10346000DF91CF910895CB010E94281A0895809191 -:10347000C50185958595859508958091C5018770CD -:10348000089598E0899F90011124262B2093C5016F -:103490000C942D192091C501809582238093C5013C -:1034A000982F977069F430E0482F552747FD5095C5 -:1034B0002417350729F08595859585950C944E1927 -:1034C00008959091C501977081E009F480E0089516 -:1034D00090910C01992321F090910D01911109C057 -:1034E00020910E0130910F01F90132969FEF40E0DB -:1034F0001FC0982F9695969596959F3050F5E09120 -:103500000E01F0910F01E90FF11D877021E030E00D -:10351000A90102C0440F551F8A95E2F7CA019181A3 -:10352000892B818308959F3F39F04F5F4E3041F0E2 -:1035300051915813F8CF0DC05111F7CF942FF5CFFB -:103540009F3F39F0F901E90FF11D97FDFA9582834C -:103550000895089590910C01992321F090910D0107 -:10356000911109C020910E0130910F01F90132969D -:10357000205F3F4F1FC0982F9695969596959F3048 -:10358000F0F4E0910E01F0910F01E90FF11D877049 -:1035900021E030E0A90102C0440F551F8A95E2F7EF -:1035A000CA01809591818923818308953196E2171C -:1035B000F30729F090819813F9CF1082F7CF08957F -:1035C00081E090E0E0910E01F0910F01E80FF91F0A -:1035D0001082019680319105A9F708959091D90143 -:1035E000892B8093D901089580959091D9018923E1 -:1035F0008093D90108951092D90108959091D8012E -:10360000892B8093D801089580959091D8018923C2 -:103610008093D80108951092D80108959091D70110 -:10362000892B8093D701089580959091D7018923A4 -:103630008093D70108951092D70108958093C60111 -:1036400008951092C601089580910E0190910F0186 -:10365000FC0131969C01205F3F4F80E091919111D8 -:103660008F5FE217F307D1F70895E0910E01F09113 -:103670000F018091D9018083E0910E01F0910F013B -:1036800090818091D801892B8083E0910E01F09187 -:103690000F0190818091D701892B80838091C60191 -:1036A000882361F0E0910E01F0910F019081892B48 -:1036B00080830E94241B81111092C60180910E010B -:1036C00090910F010C94631020E0009739F0AC0149 -:1036D00041505109842395232F5FF7CF822F0895FE -:1036E000CF92DF92EF92FF926C01EE24FF24C1147F -:1036F000D104E104F10421F0C701B60120E101C0C9 -:1037000020E0C72ED82EE92EFF24C114D104E104F5 -:10371000F10419F0285FC701B6016B017C0154E088 -:10372000F694E794D794C7945A95D1F7C114D1046D -:10373000E104F10419F02C5FC701B6016B017C01B3 -:1037400042E0F694E794D794C7944A95D1F7C11410 -:10375000D104E104F10419F02E5FC701B601DC01C8 -:10376000CB01B695A79597958795892B8A2B8B2B9F -:1037700009F02F5F822FFF90EF90DF90CF90089598 -:103780008091F101843021F11092DB0120E488E185 -:1037900090E00FB6F894A895809360000FBE209338 -:1037A000600080E00E94500983B7817F846083BFFE -:1037B00083B7816083BF7894889583B78E7F83BFFA -:1037C00088E10FB6F89480936000109260000FBEFD -:1037D0000895089508950E94E91B0E94B0040E9474 -:1037E000EA1B0E94A50591E0811101C090E0892F9C -:1037F00008950E94F0140E9457100C94500982E022 -:1038000084BD93E095BD9AEF97BD80936E000895B7 -:103810002FB7F8948091DC019091DD01A091DE0139 -:10382000B091DF012FBF0895CF92DF92EF92FF9208 -:103830000F931F932FB7F8944091DC015091DD0155 -:103840006091DE017091DF012FBF6A017B01EE24E0 -:10385000FF248C0120E030E0C016D106E206F3061A -:1038600010F4415051099A01281B390BC9011F91CD -:103870000F91FF90EF90DF90CF9008951F920F92DD -:103880000FB60F9211248F939F93AF93BF938091A4 -:10389000DC019091DD01A091DE01B091DF01019684 -:1038A000A11DB11D8093DC019093DD01A093DE0189 -:1038B000B093DF01BF91AF919F918F910F900FBE99 -:1038C0000F901F9018950E94540DF8942FEF87EADF -:1038D00091E6215080409040E1F700C0000087E071 -:1038E00090EBDC018093FB019093FC01A093FD0120 -:1038F000B093FE019CE088E10FB6F894A895809300 -:1039000060000FBE90936000FFCFEF92FF920F9385 -:103910001F93CF93DF93D82FCDE08C2F0E949E056D -:1039200005E010E0E82EF12CC701002E02C09595AD -:1039300087950A94E2F780FF09C0602F7C2F80E012 -:103940000E946106D81302C081E006C0015011092F -:1039500058F7C15010F780E0DF91CF911F910F9180 -:10396000FF90EF900895CF93C82F8CE20E94851CA2 -:10397000882321F08C2FCF910C94851C80E0CF916F -:103980000895CF930E94081E811102C00E94EE1D6F -:10399000C5E6C15049F00E94B0048FE39CE901974D -:1039A000F1F700C00000F5CF89E20E94B31C81113D -:1039B00013C18AE20E94B31C81110E94EE1D85E0B2 -:1039C0000E94B31C81110E94631C0E94131E8093ED -:1039D000DA0187E00E94B31C8823A9F18BE10E94E1 -:1039E000B31C882351F08091DA0181FB222720F952 -:1039F00091E0922790FB81F90EC08EE00E94B31CEB -:103A0000882361F08091DA0182FB222720F991E07E -:103A1000922790FB82F98093DA0115C080E10E9421 -:103A2000B31C9091DA01882341F093FB222720F9FF -:103A300081E0822780FB93F904C0892F809580FB69 -:103A400090F99093DA018091DA010E94171E0E948A -:103A5000251E8093FA0180EE0E94B31C882341F05A -:103A60008091FA01982F909590FB80F98093FA014C -:103A700089E30E94B31C882359F08091FA0181FBED -:103A8000222720F991E0922790FB81F98093FA0197 -:103A900082EE0E94B31C882359F08091FA0182FBC8 -:103AA000222720F991E0922790FB82F98093FA0176 -:103AB00086EE0E94B31C882359F08091FA0183FBA3 -:103AC000222720F991E0922790FB83F98093FA0155 -:103AD00083EE0E94B31C882359F08091FA0184FB85 -:103AE000222720F991E0922790FB84F98093FA0134 -:103AF00085E30E94B31C882359F08091FA0185FB6D -:103B0000222720F991E0922790FB85F98093FA0112 -:103B100081E30E94B31C882359F08091FA0186FB4F -:103B2000222720F991E0922790FB86F98093FA01F1 -:103B300081E10E94B31C882359F08091FA0187FB30 -:103B4000222720F991E0922790FB87F98093FA01D0 -:103B50008091FA010E94291E8091FA0187FB882733 -:103B600080F980930D0187E20E94B31CC82F8EE17B -:103B70000E94B31C8111C2608FE10E94B31C8111AD -:103B8000C46080E20E94B31C8111C86081E20E947F -:103B9000B31C8111C06182E20E94B31C8111C0621A -:103BA00083E20E94B31C8111C06484E20E94B31CB2 -:103BB000882311F0C06802C0CC2329F08C2F0E940A -:103BC000201E6C2F03C00E941C1E682F70E080E036 -:103BD00090E0CF910C94B018CF9108956DEE7EEFE8 -:103BE00080E090E00E945A2460E082E090E00E9431 -:103BF000482460E083E090E00E94482460E084E094 -:103C000090E00E94482460E085E090E00C94482415 -:103C100080E090E00E94422421E08D3E9E4F09F01A -:103C200020E0822F089582E090E00C943A24682FDF -:103C300082E090E00C94482483E090E00C943A24D5 -:103C4000682F83E090E00C94482484E090E00C948A -:103C50003A24682F84E090E00C9448248091E2019B -:103C600080FF0BC06091130185E0689FB0011124B3 -:103C700075956795759567952BC081FF09C0609113 -:103C8000130185E0689FB00111247595679520C0E8 -:103C900082FF07C06091130185E0689FB001112485 -:103CA00017C09091E3019923D1F06091120196170A -:103CB00088F72091130185E0289F90011124929F9D -:103CC000A001939F500D112470E0CA010E940C24A2 -:103CD0006038710540F46115710539F002C065E086 -:103CE00070E0862F08958FE7089581E00895809110 -:103CF000E20180FF08C06091110170E07595679541 -:103D00007595679521C081FF06C06091110170E033 -:103D10007595679519C082FF04C06091110170E02C -:103D200010C09091E3019923C1F0609110019617A2 -:103D3000A0F780911101899FC001112470E00E94B9 -:103D40000C246038710528F46115710521F0862F67 -:103D500008958FE7089581E0089561E070E0F4CF61 -:103D6000803F21F40E942E1E819504C0813F29F4DA -:103D70000E942E1E8093E6010895823F21F40E9446 -:103D80002E1E819504C0833F29F40E942E1E80932D -:103D9000E5010895893F19F40E94771E05C08A3F06 -:103DA00031F40E94771E81958093E70108958B3F3F -:103DB00021F40E94771E819504C08C3F29F40E9453 -:103DC000771E8093E8010895843F21F48091E401F7 -:103DD000816017C0853F21F48091E401826011C0A9 -:103DE000863F21F48091E40184600BC0873F21F479 -:103DF0008091E401886005C0883F31F48091E4013E -:103E000080618093E40108958D3F21F48091E20167 -:103E100081600BC08E3F21F48091E201826005C079 -:103E20008F3F29F48091E20184608093E20108953C -:103E3000803F39F48091E60187FF6CC01092E60163 -:103E400069C0813F29F48091E6011816BCF362C075 -:103E50009091E501823F29F497FF5CC01092E50143 -:103E600059C0833F19F41916CCF354C0893F41F46B -:103E70008091E70118160CF04DC01092E7014AC07E -:103E80008A3F29F48091E70187FF44C0F6CF8B3F3A -:103E900039F48091E80187FF3DC01092E8013AC0F3 -:103EA0008C3F29F48091E8011816BCF333C0843F9D -:103EB00021F48091E4018E7F17C0853F21F4809129 -:103EC000E4018D7F11C0863F21F48091E4018B7F56 -:103ED0000BC0873F21F48091E401877F05C0883FB4 -:103EE00031F48091E4018F7E8093E40113C08D3F13 -:103EF00021F48091E2018E7F0BC08E3F21F48091EE -:103F0000E2018D7F05C08F3F29F48091E2018B7F14 -:103F10008093E2018091E50181110EC08091E6015C -:103F200081110AC08091E701811106C08091E801EA -:103F3000811102C01092E301089584EE91E00E9485 -:103F40006E100E94081C9093E1018093E001089597 -:103F50001F93CF93DF938091E0019091E1010E9444 -:103F6000141CAC019091E301992321F020911401DC -:103F700030E006C0209115018AE0289F90011124AD -:103F80004217530708F486C08091E501C091E6010D -:103F9000D091E7011091E801811107C0C11176C0ED -:103FA000D11174C0111172C075C09F3F19F09F5F8D -:103FB0009093E301181624F40E942E1E8093E501CD -:103FC0008091E50187FF05C00E942E1E8195809398 -:103FD000E5011C1624F40E942E1E8093E6018091B8 -:103FE000E60187FF05C00E942E1E81958093E601A1 -:103FF0006091E501662339F1C091E601CC2319F106 -:10400000772767FD7095872F972F0E941D2323E345 -:1040100033E343E35FE30E9481230E94EA2260933B -:10402000E5016C2F772767FD7095872F972F0E94EA -:104030001D2323E333E343E35FE30E9481230E94D4 -:10404000EA226093E6011D1624F40E94771E8093F5 -:10405000E7018091E70187FF05C00E94771E8195E7 -:104060008093E701111624F40E94771E8093E801E3 -:104070008091E80187FF05C00E94771E819580939B -:10408000E801DF91CF911F910C949D1F9F3F09F094 -:104090008ECF96CFDF91CF911F910895E4EEF1E09E -:1040A00085E0DF011D928A95E9F71092E3011092F5 -:1040B000E2010895833081F128F4813059F0823093 -:1040C000D1F00895853009F449C0B8F1863009F47B -:1040D00056C0089580911501262F30E0280F311D1C -:1040E0002F3F310524F4680F6093150108958FEF79 -:1040F00080931501089580911401262F30E0280F38 -:10410000311D2F3F310524F4680F60931401089589 -:104110008FEF80931401089580911301262F30E0D2 -:10412000280F311D2F3F310524F4680F60931301D0 -:1041300008958FEF80931301089580911201262F27 -:1041400030E0280F311D2F3F310524F4680F6093B4 -:10415000120108958FEF809312010895809111014B -:10416000262F30E0280F311D2F3F310524F4680F32 -:104170006093110108958FEF80931101089580914C -:104180001001262F30E0280F311D2F3F310524F478 -:10419000680F6093100108958FEF809310010895C8 -:1041A000833011F128F4813049F0823091F0089584 -:1041B000853081F120F18630C1F10895809115019B -:1041C000681720F4861B809315010895109215013D -:1041D000089580911401681720F4861B80931401C0 -:1041E000089510921401089580911301681720F426 -:1041F000861B8093130108951092130108958091F6 -:104200001201681720F4861B809312010895109202 -:104210001201089580911101681720F4861B809384 -:1042200011010895109211010895809110016817ED -:1042300020F4861B809310010895109210010895B8 -:104240000F931F938D3109F46BC008F03FC08E307F -:1042500009F47FC0C0F4873009F469C068F486307F -:1042600009F0B1C08091DA01817F8E7F8093DA01FD -:1042700081E08093EA01A8C0883009F4A2C08B30A5 -:1042800009F49FC0A0C0863109F49BC078F4803146 -:1042900009F472C0813109F096C00E94F014909127 -:1042A0000D0181E0892780930D018BC0893109F4CC -:1042B00088C08B3109F087C08091DA0181FB222709 -:1042C00020F991E0922790FB81F94CC0853309F4E5 -:1042D00070C048F4873209F46CC008F459C08932C0 -:1042E00009F467C070C0833438F48A3308F04EC0D4 -:1042F000883309F466C067C0833409F45AC088342F -:1043000009F061C00E94F0140FEF13ED20E301509B -:1043100010402040E1F700C000000E94631C51C023 -:104320000E94A4220E9457100E9450094AC09091F6 -:10433000DA01892F8095817080FB90F929F09660D1 -:1043400098609093DA0140C0997F977F9093DA014B -:1043500038C08091DA0182FB222720F991E0922770 -:1043600090FB82F98093DA01992359F18091DA0167 -:1043700081608093DA0125C08091DA0183FB2227D6 -:1043800020F991E0922790FB83F9ECCF895301C08B -:104390008D5141E050E060E070E08A019B0104C073 -:1043A000000F111F221F331F8A95D2F7C901B801D0 -:1043B00004C061E070E080E090E00E94B0180E94CC -:1043C000F01481E001C080E01F910F91089580E01A -:1043D000089580E00895CF93C82F8091EA0181303D -:1043E00079F018F08230E9F187C0E0910E01F09188 -:1043F0000F018081813169F0823209F07FC009C0EC -:10440000E0910E01F0910F018081813111F0823233 -:1044100061F48C2F0E94E721811104C08C2F0E942F -:1044200020211DC081E090E01AC08C2F0E94E9215C -:10443000811114C0C43179F048F4CB3079F0C03127 -:1044400009F060C082E08093EA0108C0C93219F027 -:10445000C83321F057C01092EA0154C081E0817046 -:1044600053C0C93289F118F5C43171F1A8F4C730CD -:1044700009F046C08AE08093150194E190931401FD -:1044800093E0909313018093120188E080931101CF -:1044900088E28093100134C0CE51C63088F5EC2FED -:1044A000F0E0E65DFE4F80818093E90129C0CE34C3 -:1044B000E9F020F4CB3421F56AE013C0C13579F07E -:1044C000C235F1F461E00DC08091E901882319F053 -:1044D0001092E90115C081E08093EA0115C061E006 -:1044E00006C08091E9010E945A200AC06AE08091CA -:1044F000E9010E94D02004C01092EA0180E004C0CB -:1045000081E002C080E0ABCFCF910895E1E8F0E018 -:104510008081886080838081816080838FB7F894F8 -:1045200093E09093890090ED909388008FBF089559 -:10453000EFE6F0E08081826080830895EFE6F0E0AE -:1045400080818D7F80830895EFE6F0E0908182E0A6 -:104550008927808308951F920F920FB60F9211241E -:104560002F933F934F935F936F937F938F939F937B -:10457000AF93BF93EF93FF938091EB019091EC0188 -:1045800001969093EC018093EB01811103C082E0CE -:104590000E945009E091EC01E695E695F0E0EB59B8 -:1045A000FA4FE4918091EB018E1303C080E00E94EA -:1045B0005009FF91EF91BF91AF919F918F917F91A2 -:1045C0006F915F914F913F912F910F900FBE0F9080 -:1045D0001F90189504D06894B1118DC0089570D0C3 -:1045E00088F09F5790F0B92F9927B751A0F0D1F0DC -:1045F000660F771F881F991F1AF0BA95C9F712C066 -:10460000B13081F077D0B1E0089574C0672F782F72 -:104610008827B85F39F0B93FCCF3869577956795D1 -:10462000B395D9F73EF490958095709561957F4F3D -:104630008F4F9F4F0895E89409C097FB3EF49095E3 -:104640008095709561957F4F8F4F9F4F9923A9F06B -:10465000F92F96E9BB279395F695879577956795FA -:10466000B795F111F8CFFAF4BB0F11F460FF1BC03E -:104670006F5F7F4F8F4F9F4F16C0882311F096E9D1 -:1046800011C0772321F09EE8872F762F05C066237F -:1046900071F096E8862F70E060E02AF09A95660F38 -:1046A000771F881FDAF7880F9695879597F90895F1 -:1046B00057FD9058440F551F59F05F3F71F04795D3 -:1046C000880F97FB991F61F09F3F79F087950895B8 -:1046D000121613061406551FF2CF4695F1DF08C0D7 -:1046E000161617061806991FF1CF869571056105F4 -:1046F00008940895E894BB2766277727CB0197F99C -:1047000008950BD078C069D028F06ED018F09523AA -:1047100009F05AC05FC01124EECFCADFA0F3959F05 -:10472000D1F3950F50E0551F629FF001729FBB2798 -:10473000F00DB11D639FAA27F00DB11DAA1F649F44 -:104740006627B00DA11D661F829F2227B00DA11DF7 -:10475000621F739FB00DA11D621F839FA00D611D7D -:10476000221F749F3327A00D611D231F849F600D9E -:10477000211D822F762F6A2F11249F5750408AF0D7 -:10478000E1F088234AF0EE0FFF1FBB1F661F771F63 -:10479000881F91505040A9F79E3F510570F014C0FA -:1047A000AACF5F3FECF3983EDCF38695779567954B -:1047B000B795F795E7959F5FC1F7FE2B880F911D81 -:1047C0009695879597F9089597F99F6780E870E027 -:1047D00060E008959FEF80EC089500240A94161677 -:1047E000170618060906089500240A9412161306DF -:1047F000140605060895092E0394000C11F488236D -:1048000052F0BB0F40F4BF2B11F460FF04C06F5F88 -:104810007F4F8F4F9F4F089597FB072E16F40094FC -:1048200007D077FD09D00E94262407FC05D03EF46E -:10483000909581959F4F0895709561957F4F08954C -:10484000EE0FFF1F0590F491E02D0994AA1BBB1BEE -:1048500051E107C0AA1FBB1FA617B70710F0A61B80 -:10486000B70B881F991F5A95A9F780959095BC01A1 -:10487000CD010895F999FECF92BD81BDF89A99278F -:1048800080B50895A8E1B0E042E050E00C946224C5 -:10489000262FF999FECF92BD81BDF89A019700B4F9 -:1048A000021639F01FBA20BD0FB6F894FA9AF99A99 -:1048B0000FBE08950196272F0E9449240C94482486 -:1048C000DC01CB01FC01F999FECF06C0F2BDE1BDD0 -:1048D000F89A319600B40D9241505040B8F70895BF -:0448E000F894FFCF7A -:1048E40020025209E009BD09890955090101C701DE -:1048F40028080A03140A3F4D36392605D904A304AF -:104904006A04FD0316042F04480401020304050687 -:044914000708090087 +:1005600075088100C00011241FBECFEFDAE0DEBFA6 +:10057000CDBF04B603FE24C08091F9019091FA0129 +:10058000A091FB01B091FC018730904BA740B04B8C +:10059000B9F41092F9011092FA011092FB01109235 +:1005A000FC0114BE84B7877F84BF88E10FB6F8943E +:1005B00080936000109260000FBEE0E0FFE30995B9 +:1005C00011E0A0E0B1E0E0E2F8E402C005900D9295 +:1005D000A433B107D9F711E0A4E3B1E001C01D9243 +:1005E000A93FB107E1F70E94F60A0C940E240C947F +:1005F0000000FC016230B9F028F4662341F061305C +:1006000061F023C06330A9F06430C9F01EC082815C +:100610008823D9F088EA91E0089582818823A9F09F +:100620008DE891E008958281882379F084E691E055 +:1006300008958281882349F083E391E008958281BF +:10064000882319F08AE091E0089580E090E0089511 +:1006500008956091BD017091BE018091BF0190919C +:10066000C0010E94511B56985E9825982D98269897 +:100670002E9827982F98813019F0823021F0089514 +:10068000259A2D9A0895269A2E9A08950C94290356 +:1006900056985E9825982D9826982E9827982F98EA +:1006A0008FEF90E0909389008093880090938B0067 +:1006B00080938A0090938D0080938C00259A2D9AC8 +:1006C0002FEF80E792E0215080409040E1F700C09A +:1006D0000000269A2E9A2FEF80E792E0215080406A +:1006E0009040E1F700C00000279A2F9A2FEF80E793 +:1006F00092E0215080409040E1F700C00000259832 +:100700002D982FEF80E792E0215080409040E1F754 +:1007100000C0000026982E982FEF80E792E021502D +:1007200080409040E1F700C0000027982F9856982D +:100730005E9825982D9826982E9827982F9808959A +:1007400089EA8093800089E08093810024982C9826 +:100750003F988AB18F748AB96E98479A8BB1806B33 +:100760008BB9769A0E9448030C94280380E2809308 +:1007700000018091340181110EC00E94050481E0C6 +:10078000809334012FEF83ED90E32150804090401F +:10079000E1F700C0000080E40E940B048093000198 +:1007A00081112EC00E94350480930001811128C060 +:1007B0000E94350480930001811122C08FE30E94C2 +:1007C00035048093000181111BC00E942D0480E438 +:1007D0000E940B0480930001811112C08CE00E94E2 +:1007E00035048093000181110BC00E943504809371 +:1007F0000001811105C08FE30E9435048093000140 +:100800000E942D048091000108951092B9008AE0A1 +:100810008093B800089594EA9093BC009091BC0036 +:1008200097FFFCCF9091B900987F983021F09031DC +:1008300011F081E008958093BB0084E88093BC00B0 +:100840008091BC0087FFFCCF8091B900887F883100 +:1008500011F0803471F780E0089584E98093BC0042 +:100860008091BC0084FDFCCF08958093BB0084E898 +:100870008093BC008091BC0087FFFCCF9091B900B1 +:10088000987F81E0983209F480E0089584E88093AD +:10089000BC008091BC0087FFFCCF8091BB00089515 +:1008A00080910001811115C080E40E940B048093A7 +:1008B000000181110CC082E10E9435048093000187 +:1008C000811105C08FEF0E943504809300010E94C2 +:1008D0002D0484B1807F84B985B1807F85B98AB1C8 +:1008E000837F8AB98BB1837F8BB93E9846980895F0 +:1008F0000E94B603809300010E94500480B38C7064 +:1009000080BB81B3836F81BBA6E3B1E0E4E4F1E097 +:100910008EE08E0F11921D928E13FCCF0C94A003CB +:10092000BF92CF92DF92EF92FF920F931F93CF93DC +:10093000DF9380910001882379F0809135018F5FEA +:1009400080933501811108C00E94B6038093000195 +:10095000811102C00E94480306E311E0C0E0D0E02C +:10096000DD24D39482E0C82EEE24E394F12CC7302A +:10097000D10500F580910001811164C080E40E94DE +:100980000B0480930001811112C082E10E943504A2 +:100990008093000181110BC0C7010C2E01C0880F8C +:1009A0000A94EAF780950E943504809300010E9422 +:1009B0002D0448C0CA30A1F028F4C83059F0C9301D +:1009C00061F005C0CC3089F070F0CD3089F0209A0C +:1009D000289810C0219A29980DC0229A2A980AC0F6 +:1009E000239A2B9807C0529A01C0539A5B9802C071 +:1009F0003E9A469890EA9A95F1F79FB1799902C08C +:100A000082E001C080E091709D25982B7C9902C006 +:100A100084E001C080E0892B7D9902C038E001C0EC +:100A200030E0832B7E9902C020E101C020E0822BC0 +:100A30009FB19095991F9927991F9295990F907E34 +:100A4000892B0FC080910001811149C080E40E9470 +:100A50000B0480930001882379F1B12C0E942D04AE +:100A60008B2DF8019081981719F08083C0920101B5 +:100A70000E94500421960F5F1F4FCE30D10509F020 +:100A800076CF80910101882361F18150809301012B +:100A9000882339F08FE99FE00197F1F700C000004B +:100AA00020C0A4E4B1E0E6E3F1E0CF01825F9191E0 +:100AB0009D938E13FCCF15C083E10E943504809373 +:100AC00000018111CACF81E40E940B0480930001D0 +:100AD0008111C3CF0E944604B82EB094BFCF80E0EE +:100AE000C0CF0E94460381E0DF91CF911F910F910B +:100AF000FF90EF90DF90CF90BF900895E82FF0E047 +:100B0000EC5BFE4F8081089508950F931F93CF9360 +:100B1000DF93C4E4D1E010E00C2F025F899190E0F4 +:100B20000E94451B180F0C13F9CF812FDF91CF9135 +:100B30001F910F91089581E0089581E008950C942C +:100B40009D0508950F931F93CF93DF938C01FC01B4 +:100B5000C081D181CE010E94CA19BE010E944B06FC +:100B6000EC01B8010E949F05882309F48DC0F801AB +:100B70008281882309F44AC080915D0181111FC0E0 +:100B8000C431F0E5DF0709F051C00E94A10581E002 +:100B900080935D010E94121C90935C0180935B0125 +:100BA0001092540110925601109255011092580162 +:100BB0001092570110925A011092590165C080910C +:100BC0005B0190915C010E941E1C883C910570F4B1 +:100BD00080915401E82FF0E0EE0FFF1FEB5AFE4F1B +:100BE000D183C0838F5F809354014EC0C43880E5A9 +:100BF000D80721F0C538D04501F13AC0F80182810B +:100C0000882341F01092520182E01EC0C438E0E512 +:100C1000DE0759F580915201811106C086E20E94DB +:100C2000541186E20E941C1282E01CC0C438F0E518 +:100C3000DF0741F3C538D045D9F4F8018281882314 +:100C400031F01092530180E20E946B121DC080911E +:100C50005301811106C087E20E94541187E20E946D +:100C60001C1280E20E9472120FC0C538D04529F3D1 +:100C700081E08093520180935301C801DF91CF91AD +:100C80001F910F910C949B0580E0DF91CF911F91F4 +:100C90000F910895089596E0799FF001112494E54D +:100CA000899FE00DF11D1124E60FF11DEE0FFF1FCE +:100CB000E154FE4F859194910895880F991FFC018E +:100CC000E55CFF4F859194910895880F991FFC0171 +:100CD000E554FE4F8591949108950F931F93CF9300 +:100CE000DF93EC018115904350F5C11580E2D807E0 +:100CF00008F0C3C0CB3BD10590F4C83AD10508F049 +:100D00006AC0C53AD10508F05BC0C430D10508F00F +:100D1000D0C1219709F0CAC101E010E00AC2CF3F5B +:100D2000D10511F008F0C5C1C03FD10508F0A2C03F +:100D3000CE01805E9109089708F4BBC1B7C1C130EC +:100D400090E5D90709F4A2C020F5C0318FE4D80797 +:100D500070F4C11590E4D90708F094C0C11521E3DF +:100D6000D20708F0A3C1DD278E01106CE2C1C115C6 +:100D7000D04509F09BC10E94D1148FEF94E32CE081 +:100D8000815090402040E1F700C000000E946D1C9F +:100D9000D0C1C11597E5D90758F4C03121E5D20774 +:100DA00008F01CC1C43180E5D80708F475C07EC1C5 +:100DB000CE0190578115904108F078C1DF7073C162 +:100DC000C53AD10509F477C1C63AD10509F076C113 +:100DD00002E810E4AEC1C83AD10509F472C1C93ABB +:100DE000D10509F471C1CA3AD10509F470C1CB3AF1 +:100DF000D10509F46FC1CC3AD10509F46EC1CD3AE1 +:100E0000D10509F46DC1C03BD10509F46CC1CE3ADE +:100E1000D10509F46BC1CF3AD10509F46AC1C13BD0 +:100E2000D10509F469C1C23BD10509F468C1C33BCE +:100E3000D10509F467C1C43BD10509F466C1C53BBE +:100E4000D10509F465C1C63BD10509F464C1C73BAE +:100E5000D10509F463C1C83BD10509F462C1C93B9E +:100E6000D10509F461C1CA3BD10509F460C100E0B4 +:100E700014E45FC18E0110655CC1CE019F700E94B9 +:100E8000650658C1DF708E01106A53C18091DA0186 +:100E900081608093DA014DC10E94121E811102C04F +:100EA0000E94F81D0E942F1E90E09093F9018093FC +:100EB000F801C23080E5D80721F48091F801816003 +:100EC00086C0C43090E5D90721F48091F801826092 +:100ED0007EC0C63020E5D20721F48091F8018460FD +:100EE00076C0C83080E5D80719F48091F80127C092 +:100EF000CA3090E5D90721F48091F801806167C07C +:100F0000CC3020E5D20721F48091F80180625FC0E7 +:100F1000CE3080E5D80721F48091F801806457C075 +:100F2000C03190E5D90721F48091F80180684FC065 +:100F3000C23120E5D20729F48091F80184608860ED +:100F400046C0C33080E5D80721F48091F8018E7F38 +:100F50003EC0C53090E5D90721F48091F8018D7F1E +:100F600036C0C73020E5D20721F48091F8018B7F8D +:100F70002EC0C93080E5D80719F48091F80126C049 +:100F8000CB3090E5D90721F48091F8018F7E1FC006 +:100F9000CD3020E5D20721F48091F8018F7D17C074 +:100FA000CF3080E5D80721F48091F8018F7B0FC006 +:100FB000C13190E5D90721F48091F8018F7707C0FE +:100FC000C331D04531F48091F8018B7F877F8093C6 +:100FD000F8018091F8010E94331EABC08D2F992734 +:100FE0008F70992781309105D9F49E0123703327A2 +:100FF00002C0880F991F2A95E2F79C688E0144E091 +:10100000000F111F4A95E1F700271370802B912BD9 +:1010100053E0CC0FDD1F5A95E1F7C076DD272FC0D6 +:101020008230910531F4DC2FCC278E01016F106ADC +:1010300080C08330910569F4CE018370992701E067 +:1010400010E002C0000F111F8A95E2F7C8019C68EA +:101050000FC084309105B9F4CE018370992701E067 +:1010600010E002C0000F111F8A95E2F7C8019A68CC +:1010700023E0CC0FDD1F2A95E1F7C07ED7708C01ED +:101080000C2B1D2B56C08530910531F4DC2FCC275D +:101090008E01046F106A4DC0069709F04AC0CF71E7 +:1010A000DD27DC2FCC278E01106243C000E010E06A +:1010B00040C08E013EC001E810E43BC003E810E4EC +:1010C00038C002EE14E435C009EE14E432C00AEE72 +:1010D00014E42FC005EB14E42CC006EB14E429C083 +:1010E00007EB14E426C00CEC14E423C00DEC14E46C +:1010F00020C003E815E41DC00AE815E41AC002E99F +:1011000015E417C004E915E414C001E216E411C0A7 +:1011100003E216E40EC004E216E40BC005E216E496 +:1011200008C006E216E405C007E216E402C00AE2BF +:1011300016E4C801DF91CF911F910F91089596E0B9 +:10114000799FF001112494E5899FE00DF11D112490 +:10115000E60FF11DEE0FFF1FE154FE4F85919491B4 +:10116000803E9105E0F4803C910558F5813391056E +:1011700009F46FC048F48932910509F463C08A32DA +:10118000910509F46DC072C089339105E9F0823888 +:101190009105D1F08533910509F44DC067C0833EB8 +:1011A000910581F138F4803E9105B9F0823E9105B8 +:1011B000D9F05CC0863E910561F1873E9105A1F1B1 +:1011C00055C00E945D0608952091F80120FD02C0DF +:1011D00021FF4CC080EE90E049C08091F80180FF73 +:1011E000F9CF89E390E042C08091F80182FF0EC000 +:1011F0008091F80184FF03C080E090E037C083EE67 +:1012000090E034C08091F80182FFF2CF82EE90E04E +:101210002DC08091F80183FF0BC08091F80184FDFF +:10122000EBCF87EE90E022C08091F80183FFF5CFED +:1012300086EE90E01BC08091F80185FF07C089E22F +:1012400090E014C08091F80185FFF9CF85E390E02C +:101250000DC08091F80186FF07C08AE290E006C0C9 +:101260008091F80186FFF9CF81E390E00E946D063E +:10127000089508950C94390980916E010895CF93D3 +:10128000DF9300D01F92CDB7DEB79C018091EF01B4 +:10129000843019F593E099833B832A839093E90086 +:1012A0008FEF9091E800815095FD06C095ED9A95DD +:1012B000F1F700008111F5CF8091E80085FF0DC0A6 +:1012C00040E050E063E070E0CE0101960E94A00B88 +:1012D0008091E8008E778093E8000F900F900F9038 +:1012E000DF91CF910895CF93DF9300D01F92CDB7B8 +:1012F000DEB72091EF01243021F522E029839B8382 +:101300008A8383E08093E9008FEF9091E800815019 +:1013100095FD06C095ED9A95F1F700008111F5CF86 +:101320008091E80085FF0DC040E050E063E070E090 +:10133000CE0101960E94A00B8091E8008E778093E9 +:10134000E8000F900F900F90DF91CF9108952091BA +:10135000EF012430F1F422E02093E9002FEF3091E7 +:10136000E800215035FD06C035ED3A95F1F7000053 +:101370002111F5CF2091E80025FF0BC040E050E09F +:1013800065E070E00E94A00B8091E8008E7780936A +:10139000E8000895CF93DF93EC019091EF01943032 +:1013A00009F046C080910C018823D9F080910D018D +:1013B0008823B9F09093E9008FEF9091E800815075 +:1013C00095FD06C095E19A95F1F700008111F5CFE2 +:1013D0008091E80085FF2CC040E050E060E170E0C3 +:1013E00017C081E08093E9008FEF9091E800815071 +:1013F00095FD06C095ED9A95F1F700008111F5CFA6 +:101400008091E80085FF14C040E050E068E070E0A3 +:10141000CE010E94A00B8091E8008E778093E800B7 +:1014200080E1FE01AEE5B1E001900D928A95E1F711 +:10143000DF91CF9108958091EE01811109C00E9442 +:10144000350D0E94920D8091E20084608093E2004D +:1014500008951092EE010895089508950C94DA1BF2 +:1014600042E061EC81E00E94AF0C42E061EC82E07E +:101470000E94AF0C42E061EC83E00E94AF0C42E1BD +:1014800061EC84E00C94AF0C8091F101833009F49D +:1014900055C030F4813071F0823009F48EC0089567 +:1014A0008A3009F47AC08B3009F460C0893009F0C1 +:1014B0009CC020C08091F001813A09F096C08091D3 +:1014C000E800877F8093E8008091F4019091F50116 +:1014D000892B21F460E18EE591E003C060E080E0BB +:1014E00090E070E00E94EB0B8091E8008B77809396 +:1014F000E80008958091F001813209F076C0809172 +:10150000F4019091F501009719F0039709F06DC06F +:101510008091E800877F8093E8008091E80082FD59 +:1015200005C08091EF018111F8CF5FC08091F1007B +:1015300080936E018091E8008B7753C08091F00119 +:10154000813A09F052C08091F4019091F501892B04 +:1015500009F04BC08091E800877F8093E80080917C +:10156000E80080FFFCCF80910C0136C08091F00133 +:101570008132D9F58091F4019091F501892BA9F57B +:101580008091E800877F8093E8000E94E40C8091BE +:10159000F20180930C010C94D1148091F0018132FE +:1015A00021F58091E800877F8093E8000E94E40C99 +:1015B0008091F30180936F0108958091F001813A49 +:1015C000A1F48091E800877F8093E8008091E80093 +:1015D00080FFFCCF80916F018093F1008091E80043 +:1015E0008E778093E8000C94E40C089584B7877F8D +:1015F00084BF88E10FB6F894809360001092600079 +:101600000FBE90E080E80FB6F8948093610090934D +:1016100061000FBE0E9487100E94350D0E94920D3E +:101620008091E20084608093E20078940E94181018 +:101630000E94891082E091E00E9433108091EF01B6 +:10164000853069F40E94A11B8091ED018823B1F3DC +:101650000E94CC1B882391F30E948A0BEFCF0E943B +:101660008F10ECCF292F332723303105C9F064F4D4 +:101670002130310581F02230310509F043C08DE67B +:1016800090E02BEE33E042C021323105F1F02232FE +:10169000310541F137C082E190E028E534E036C001 +:1016A00099278130910541F08230910541F0892BD5 +:1016B00049F5E7EEF3E005C0EFECF3E002C0E7EB3D +:1016C000F3E0849190E09F0121C06430D8F4E62FCC +:1016D000F0E0EE0FFF1FEE5DFE4F2081318189E0CB +:1016E00090E014C0643070F470E0FB01EE0FFF1F57 +:1016F000E65EFE4F20813181FB01EA5EFE4F808174 +:1017000090E004C080E090E020E030E0FA01318316 +:101710002083089580E189BD82E189BD09B400FE7E +:10172000FDCF8091D8008F7D8093D8008091E0001C +:1017300082608093E0008091E00081FDFCCF0895FD +:10174000CF92DF92EF92FF920F931F93CF93DF938D +:10175000EC018B016A010E94030D811133C0C11499 +:10176000D10439F0F60180819181081B190BC80F53 +:10177000D91FE12CF12C0115110519F18091E80018 +:1017800085FD16C08091E8008E778093E800C11433 +:10179000D10449F0F60180819181E80EF91EF182B1 +:1017A000E08285E00FC00E94030D882321F30AC068 +:1017B00089918093F10001501109FFEFEF1AFF0AA0 +:1017C000DACF80E0DF91CF911F910F91FF90EF90E2 +:1017D000DF90CF9008952091F6013091F701261700 +:1017E000370748F06115710539F42091E8002E772C +:1017F0002093E80001C0B90140E061157105A9F12D +:101800002091EF01222309F443C0253009F442C09E +:101810002091E80023FD40C02091E80022FD32C065 +:101820002091E80020FFE9CF4091F3002091F200E1 +:1018300030E0342BFC01CF016115710559F02830DF +:10184000310540F481918093F100615071092F5F5F +:101850003F4FF1CF41E02830310509F040E02091C1 +:10186000E8002E772093E800C8CF4111C9CF0AC005 +:101870008091EF01882361F0853061F08091E8006C +:1018800083FD0AC08091E80082FFF2CF80E00895D6 +:1018900082E0089583E0089581E008952091F601A3 +:1018A0003091F7012617370748F06115710539F4B3 +:1018B0002091E8002E772093E80001C0B901FC01D7 +:1018C00020E06115710591F18091EF01882309F401 +:1018D00040C0853009F43FC08091E80083FD3DC0E1 +:1018E0008091E80082FD2FC08091E80080FFE9CF61 +:1018F0002091F3008091F20090E0922B6115710528 +:1019000059F08830910540F424912093F1003196EC +:10191000615071090196F2CF21E0089709F020E0AB +:101920008091E8008E778093E800CBCF2111CCCF57 +:101930000AC08091EF01882361F0853061F08091C9 +:10194000E80083FD0AC08091E80082FFF2CF80E0CA +:10195000089582E0089583E0089581E00895982F26 +:10196000973058F59093E900981739F07091EC0092 +:101970002091ED005091F00003C0242F762F50E00D +:1019800021FF19C03091EB003E7F3093EB00309186 +:10199000ED003D7F3093ED003091EB0031603093EE +:1019A000EB007093EC002093ED005093F000209139 +:1019B000EE0027FF07C09F5FD3CF8F708093E900B1 +:1019C00081E0089580E008958091F00187FF11C0C3 +:1019D0008091E80082FD05C08091EF018111F8CF70 +:1019E00011C08091E8008B770BC08091EF018823B4 +:1019F00049F08091E80080FFF8CF8091E8008E7771 +:101A00008093E80008952091E4003091E50095E688 +:101A10004091EC00842F817040FF22C08091E8004B +:101A200080FD1CC08091EF01882391F0853091F0FA +:101A30008091EB0085FD10C04091E4005091E500DD +:101A40004217530729F39A01915011F784E0089542 +:101A500082E0089583E0089581E0089580E008958C +:101A60004091E80042FFDECF08950E94A30D0E943E +:101A7000AB0DE0EEF0E0808181608083E8EDF0E086 +:101A800080818F77808319BCA7EDB0E08C918E7F29 +:101A90008C9380818F7E80831092EE0108950F9346 +:101AA0001F93CF93DF930E94A30D0E94AB0DC8ED4F +:101AB000D0E088818F778883888180688883888157 +:101AC0008F7D888319BC1092EF011092EB01109268 +:101AD000ED011092EC0100EE10E0F80180818B7FA7 +:101AE000808388818160888342E060E080E00E949A +:101AF000AF0CE1EEF0E080818E7F8083E2EEF0E0DB +:101B0000808181608083808188608083F80180810A +:101B10008E7F8083888180618883DF91CF911F9140 +:101B20000F910895E8EDF0E080818F7E8083E7EDEE +:101B3000F0E080818160808384E082BF81E08093D7 +:101B4000EE010C944F0DE8EDF0E080818E7F8083F4 +:101B50001092E20008951092DA001092E1000895C8 +:101B60001F920F920FB60F9211242F933F934F9312 +:101B70005F936F937F938F939F93AF93BF93EF93F5 +:101B8000FF938091E10082FF0BC08091E20082FF11 +:101B900007C08091E1008B7F8093E1000E941710C5 +:101BA0008091DA0080FF1FC08091D80080FF1BC0A9 +:101BB0008091DA008E7F8093DA008091D90080FFD7 +:101BC0000DC080E189BD82E189BD09B400FEFDCF71 +:101BD00081E08093EF010E941B0A05C019BC10929E +:101BE000EF010E94290A8091E10080FF19C08091D5 +:101BF000E20080FF15C08091E2008E7F8093E200BA +:101C00008091E20080618093E2008091D800806240 +:101C10008093D80019BC85E08093EF010E942D0AC3 +:101C20008091E10084FF30C08091E20084FF2CC0ED +:101C300080E189BD82E189BD09B400FEFDCF8091BC +:101C4000D8008F7D8093D8008091E1008F7E8093B3 +:101C5000E1008091E2008F7E8093E2008091E200BB +:101C600081608093E2008091EB01882311F084E091 +:101C700007C08091E30087FD02C081E001C083E0DE +:101C80008093EF010E942E0A8091E10083FF29C01A +:101C90008091E20083FF25C08091E100877F8093DF +:101CA000E10082E08093EF011092EB018091E1006E +:101CB0008E7F8093E1008091E2008E7F8093E2002E +:101CC0008091E20080618093E20042E060E080E089 +:101CD0000E94AF0C8091F00088608093F0000E9419 +:101CE0002C0AFF91EF91BF91AF919F918F917F91BE +:101CF0006F915F914F913F912F910F900FBE0F9079 +:101D00001F9018951F920F920FB60F9211242F93C8 +:101D10003F934F935F936F937F938F939F93AF9373 +:101D2000BF93CF93DF93EF93FF93C091E900CF7000 +:101D30008091EC00D82FD17080FDD0E81092E9009E +:101D40008091F000877F8093F00078940E94C60E07 +:101D50001092E9008091F00088608093F000CD2B14 +:101D6000CF70C093E900FF91EF91DF91CF91BF91C8 +:101D7000AF919F918F917F916F915F914F913F9123 +:101D80002F910F900FBE0F901F9018951F93CF9318 +:101D9000DF93CDB7DEB7AA970FB6F894DEBF0FBEBC +:101DA000CDBFE0EFF1E088E08E0F9091F1009193CC +:101DB0008E13FBCF0E94440A8091E80083FF1FC16D +:101DC0008091F0019091F101492F50E04A30510586 +:101DD00008F015C1FA01EA5AFF4F0C94BE2380386F +:101DE00081F0823809F00BC18091F4018F708093EB +:101DF000E9008091EB0085FB882780F91092E900CB +:101E000006C08091EC019091ED019111826090915A +:101E1000E800977F9093E8008093F1001092F10022 +:101E2000C8C0282F2D7F09F0EAC0882319F082301E +:101E300061F0E5C08091F201813009F0E0C093309B +:101E400009F080E08093ED012BC08091F2018111B7 +:101E500027C08091F4018F7009F4D1C08093E9000C +:101E60002091EB0020FF1CC0933021F48091EB0007 +:101E7000806214C09091EB0090619093EB0021E0A0 +:101E800030E0A90102C0440F551F8A95E2F7409344 +:101E9000EA001092EA008091EB0088608093EB00EA +:101EA0001092E9008091E800877F86C08111A7C069 +:101EB0001091F2011F778091E3008078812B80934D +:101EC000E3008091E800877F8093E8000E94E40CA3 +:101ED0008091E80080FFFCCF8091E30080688093D0 +:101EE000E300111102C082E001C083E08093EF01A2 +:101EF00086C08058823008F082C08091F2019091B3 +:101F0000F3018C3D53E0950779F583E08A838AE2FB +:101F100089834FB7F894DE01139620E03EE051E24A +:101F2000E32FF0E050935700E49120FF03C0E295C7 +:101F3000EF703F5FEF708E2F90E0EA3010F0C796A1 +:101F400001C0C0968D939D932F5F243149F74FBFF9 +:101F50008091E800877F8093E8006AE270E0CE011C +:101F600001960E94EB0B14C0AE014F5F5F4F609172 +:101F7000F4010E94320BBC01892B09F440C09091FE +:101F8000E800977F9093E80089819A810E944E0C27 +:101F90008091E8008B778093E80031C0803879F534 +:101FA0008091E800877F8093E8008091EB01809327 +:101FB000F1008091E8008E778093E8000E94E40CA5 +:101FC0001EC081111CC09091F2019230C0F480912A +:101FD000E800877F8093E8009093EB010E94E40C77 +:101FE0008091EB01811106C08091E30087FD02C062 +:101FF00081E001C084E08093EF010E94300A80916B +:10200000E80083FF0AC08091E800877F8093E800A2 +:102010008091EB0080628093EB00AA960FB6F89453 +:10202000DEBF0FBECDBFDF91CF911F910895089500 +:10203000CF938091EF018823A1F0C091E900CF7088 +:102040009091EC00892F817090FD80E8C82B109250 +:10205000E9008091E80083FD0E94C60ECF70C09316 +:10206000E900CF91089590937501809374010895CC +:10207000E0917401F0917501309721F00190F081A9 +:10208000E02D099480E00895E0917401F0917501CC +:10209000309721F00280F381E02D09940895E091BA +:1020A0007401F0917501309721F00480F581E02DE5 +:1020B000099408952091720130917301821793075A +:1020C00071F09093730180937201E0917401F0912B +:1020D0007501309721F00680F781E02D099408956D +:1020E00020917001309171018217930771F09093E4 +:1020F000710180937001E0917401F0917501309746 +:1021000021F00084F185E02D0994089508950C9440 +:1021100086100E94091C0E9478040C94CB1C9F928C +:10212000AF92BF92CF92DF92EF92FF920F931F93E5 +:10213000CF93DF9300D000D000D0CDB7DEB70E94A0 +:1021400090040DE010E0AA24A394B12C902E802FCF +:102150000E947E05980129583E4F6901F901F080DF +:10216000F826A1F40150110988F78FEF89838A833B +:102170001B820E94121C8160782F9D838C83498171 +:102180005A816B818D810E9426112FC09091DA01B6 +:1021900091FF04C08E830E9484058E8125E030E08B +:1021A000A501022E01C0440F0A94EAF7E42E4F2144 +:1021B000C1F029839A828E2191E009F490E09B83FB +:1021C0000E94121C8160782F9D838C8349815A81E3 +:1021D0006B818D810E942611F6018081E826E082C4 +:1021E00004C021503109E0F6BDCF0E94B21F10910A +:1021F00076010E9438101817B9F00E9438108093A9 +:10220000760126960FB6F894DEBF0FBECDBFDF91E4 +:10221000CF911F910F91FF90EF90DF90CF90BF90E3 +:10222000AF909F900C943A0926960FB6F894DEBFB3 +:102230000FBECDBFDF91CF911F910F91FF90EF9017 +:10224000DF90CF90BF90AF909F900895CF93DF9392 +:10225000CDB7DEB72B970FB6F894DEBF0FBECDBF5C +:102260004F83588769877A878B87DE01119686E0CE +:10227000FD0111928A95E9F785E0FE0137960190FC +:102280000D928A95E1F749815A816B817C818D811C +:102290009E810E946F172B960FB6F894DEBF0FBE7B +:1022A000CDBFDF91CF910895CF93882309F4C2C0A9 +:1022B000C82F823859F40E94381081FDBBC089E3D1 +:1022C0000E94491A0E94161B89E30CC0833879F4D6 +:1022D0000E94381080FDAEC083E50E94491A0E941A +:1022E000161B83E50E948B1ACF910C94161B843821 +:1022F00059F40E94381082FD9DC087E40E94491A5B +:102300000E94161B87E4EECF8CEF8C0F813A48F4C5 +:102310008C2F0E94ED2181118DC08C2F0E94491AB3 +:10232000E3CF80E28C0F883048F4C77081E001C0B1 +:10233000880FCA95EAF70E94CF1AD6CF8BE58C0F8B +:10234000833078F4C53A29F0C63A31F083E890E05A +:1023500005C081E890E002C082E890E0CF910C9443 +:102360005A1088E58C0F833108F064C0C83A39F1FF +:10237000C93A41F1CA3A49F1CB3A51F1CC3A59F153 +:10238000CD3A61F1C03B69F1CE3A71F1CF3A79F1C2 +:10239000C13B81F1C23B89F1C33B91F1C43B99F14F +:1023A000C53BA1F1C63BA9F1C73BB1F1C83BB9F1AF +:1023B000C93BC1F1CA3BC9F180E090E038C082EE70 +:1023C00090E035C089EE90E032C08AEE90E02FC0F8 +:1023D00085EB90E02CC086EB90E029C087EB90E085 +:1023E00026C08CEC90E023C08DEC90E020C083E808 +:1023F00091E01DC08AE891E01AC082E991E017C01F +:1024000084E991E014C081E292E011C083E292E09D +:102410000EC084E292E00BC085E292E008C086E242 +:1024200092E005C087E292E002C08AE292E0CF919A +:102430000C947010CF910895882309F44BC0823812 +:1024400059F40E94381081FF45C089E30E94491A5F +:102450000E94161B89E30CC0833871F40E94381067 +:1024600080FF38C083E50E94491A0E94161B83E54D +:102470000E948B1A0C94161B843859F40E94381051 +:1024800082FF28C087E40E94491A0E94161B87E435 +:10249000EFCF9CEF980F913A58F390E2980F983055 +:1024A00050F4877091E001C0990F8A95EAF7892F5F +:1024B0000E94D51ADFCF9BE5980F933020F480E07F +:1024C00090E00C945A10885A833120F480E090E018 +:1024D0000C9470100895882321F00E94CF1A0C9458 +:1024E000161B0895882321F00E94D51A0C94161B00 +:1024F00008957F928F929F92AF92BF92CF92DF9278 +:10250000EF92FF920F931F93CF93DF931F92CDB75C +:10251000DEB77C01C62E772EFC01058102950F7077 +:10252000128111110E94EC1A0E94421A882379F03C +:10253000112369F080E28C0D883048F082E00E941F +:102540002B1A0E94421A91E0D82ED92601C0D12C14 +:10255000E72DE295EF70F0E0E05AFF4F0C94BE23B8 +:10256000872D807F072D0F70882311F00295007F43 +:10257000112389F0002309F490C180E28C0D88308A +:1025800020F4802F0E94CF1A03C0802F0E94DF1AF0 +:102590000E94161B82C18C2D0E941C12002309F47C +:1025A00095C180E28C0D883020F4802F0E94D51ACE +:1025B00003C0802F0E94E51A0E94161B87C1972D29 +:1025C000907F872D8F70903211F08295807FCC2084 +:1025D00021F0F1E0CF16B1F01EC0112349F0002325 +:1025E00009F414C1013009F011C10E94FF1A6EC133 +:1025F000002319F0013009F469C189830E94021B8C +:1026000089810AC1112321F0023008F05FC1FEC0A8 +:1026100001115CC101C1112321F0002309F4F6C0AE +:102620003CC1002309F4F8C03EC1872D86958695EC +:10263000837090E0009719F0019761F047C1112372 +:1026400021F08C2D972D937002C080E090E00E94C5 +:102650005A103CC1112321F08C2D972D937002C08C +:1026600080E090E00E94701031C18C2D112319F090 +:102670000E94BA1E02C00E94221F0E94A71F26C1EC +:10268000872D837009F052C0111120C18C2D8295C5 +:1026900086958770880F880F9C2D9F70892E912CAE +:1026A000A12CB12C082E04C0880C991CAA1CBB1CA0 +:1026B0000A94D2F7C4FE14C00FE010E020E030E02E +:1026C000B901A80104C0440F551F661F771F8A95E2 +:1026D000D2F7CB01BA01609570958095909503C0B3 +:1026E00060E070E0CB01272D26952695237030E021 +:1026F0002230310569F02330310589F068297929C4 +:102700008A299B292130310571F00E94B718DEC05B +:10271000682979298A299B290E94D318D7C00E9449 +:10272000B718C501B4010E949B18D0C0112319F03D +:10273000872D817001C08695882309F4C7C08C2D30 +:10274000829586958770880F880F9C2D9F70892EA3 +:10275000912CA12CB12C082E04C0880C991CAA1C09 +:10276000BB1C0A94D2F7C4FE14C00FE010E020E0B6 +:1027700030E0B901A80104C0440F551F661F771F40 +:102780008A95D2F7CB01BA016095709580959095A6 +:1027900003C060E070E0CB01272D269526952370BD +:1027A000422F50E04230510569F04330510589F025 +:1027B000682979298A299B294130510571F00E94A5 +:1027C000911984C0682979298A299B290E94AD1909 +:1027D0007DC00E949119C501B4010E94751976C08F +:1027E0008C2D90E0FC01E05EF109E531F10508F087 +:1027F00050C0E059FF4F0C94BE230C2D0F70872D55 +:102800008F71112331F00E940E19802F0E946B12DC +:102810005DC00E942F19802F0E94721257C0112391 +:1028200039F0011153C0872D8F710E9454194EC089 +:10283000023008F04BC0F7CF112339F0872D8F718C +:102840000E940E1943C01123C9F3872D8F710E9476 +:102850002F193CC0112329F0872D8F710E94F91880 +:1028600035C00E94EF1832C0112351F0172D1F718F +:10287000812F0E940E1963E0812F0E94221A26C028 +:1028800081E00E942B1A023008F182E00E942B1A8C +:102890001DC0112331F0002389F28C2D0E945411A8 +:1028A00015C0002391F28C2D0E941C120FC0472DE1 +:1028B0004F706C2DC7010E94F9020E94131806C0C8 +:1028C000472D4F706C2DC7010E944A06DD20F9F09C +:1028D0000E941E1A80FD1BC0F70112820E94181A66 +:1028E0000E940E19C7010E9496140E94181A0F9098 +:1028F000DF91CF911F910F91FF90EF90DF90CF90DC +:10290000BF90AF909F908F907F900C942F190F9055 +:10291000DF91CF911F910F91FF90EF90DF90CF90BB +:10292000BF90AF909F908F907F9008950F931F93CB +:10293000CF93DF93EC01888199812B813C81232BFC +:10294000B9F09F3F11F48F3F99F0CE010E94A2058C +:10295000882371F0688179818A810E94141A8C0120 +:102960000E94C9190E949018B801CE010E947912E4 +:10297000DF91CF911F910F9108950E94EC1A0E9450 +:10298000FC1A0E94C11A0E94161B0E9458200E9425 +:10299000A71F80E090E00E945A1080E090E00C9425 +:1029A00070100E94DC1A0C94BD140E94091A292F81 +:1029B00022952F7030E02C3031054CF42A3031054F +:1029C0006CF42250310922303105A8F407C02C30B4 +:1029D000310569F02F30310551F00DC0803F69F0AD +:1029E00018F4803E40F409C0843F29F406C093FBEC +:1029F000882780F9089580E0089581E00895CF93B5 +:102A0000DF9300D000D01F92CDB7DEB70F900F90AC +:102A10000F900F900F90DF91CF910895CF93DF9398 +:102A200000D000D000D0CDB7DEB726960FB6F89410 +:102A3000DEBF0FBECDBFDF91CF9108951F93CF931F +:102A4000DF93C091850116E080918601C81799F047 +:102A5000D0E01C9FF0011D9FF00D1124E957FE4F9F +:102A60004081518162817381848195810E940E151C +:102A70002196C770E9CFDF91CF911F9108954091C2 +:102A8000B7015091B8016091B9017091BA0180917C +:102A9000BB019091BC010C940E158091BC018295F4 +:102AA0008F7009F054C08091B901882309F44FC098 +:102AB00080918501A09186016091B7017091B80164 +:102AC0004091BA015091BB01B6E08A1709F43FC0AA +:102AD00090E041155105C1F17F3F11F46F3FA1F125 +:102AE000B89FF001B99FF00D1124E957FE4F2181E5 +:102AF00072132AC02081621327C02281211124C0B1 +:102B0000238134812417350710F421503109241B07 +:102B1000350B283C3105C0F42091BC012F70206199 +:102B20002093BC0126E0289FF001299FF00D11247D +:102B3000E457FE4F80818F708061808387EB91E046 +:102B40000E9496140C941E1501968770BECF0895AE +:102B5000CF92DF92EF92FF920F931F93CF93DF9369 +:102B6000CDB7DEB762970FB6F894DEBF0FBECDBF0C +:102B70008C0185E0F801DE011D9601900D928A9589 +:102B8000E1F7D8014C9111965C91119712966C91D6 +:102B900012971396CD90DC9014973091B7017091F5 +:102BA000B8018091BA019091BB01009709F46BC103 +:102BB0007F3F19F43F3F09F466C1E090B901EE2070 +:102BC00009F4C0C02091BC01C816D90628F0F6014E +:102BD000E81BF90BCF0104C0809590958C0D9D1DCD +:102BE000FF24F394883C910578F0F12C207F09F0C4 +:102BF000C6C07C2DD98AC88A89890E94FF1487EBB8 +:102C000091E00E949614B1C0822F807F09F046C0E7 +:102C1000751314C0341312C0611110C02F702061DD +:102C20002093BC010E943F1587EB91E00E9496140F +:102C30008091BC01D80115968C932EC0CD2819F136 +:102C40005F3F11F44F3FF9F0F62E61111CC08091E7 +:102C500085012091860136E0821709F45AC090E080 +:102C6000389FF001399FF00D1124E957FE4F718113 +:102C7000571306C07081471303C07281711103C0DE +:102C800001968770E9CFF62E662309F418C180916A +:102C9000BC0181608093BC01F12C11C1751308C087 +:102CA000341306C0611104C08091BC01D801C3C0B7 +:102CB0004D875E878D859E856A8B0E94D5146A89B3 +:102CC0008823E1F16623D1F12091BC01822F829506 +:102CD0008F7090E0029774F08091B7019091B801E5 +:102CE00098878F831986DB86CA862C87CE01079644 +:102CF0000E94961486E0F801A7EBB1E001900D92D6 +:102D00008A95E1F70E944D150E943F15FF24F39428 +:102D1000D6C04D875E878D859E850E94091A292F12 +:102D200022952F7030E0223031050CF0BCC09F702E +:102D300009F0B6C0805E883008F4C1C0C8010E94A6 +:102D40009614E4CFC816D90608F453C0F601E81B60 +:102D5000F90BCF01883C910508F450C0F12C7C2D73 +:102D6000D98AC88A89890E94FF14E7EBF1E086E0DE +:102D7000DF011D928A95E9F70E943F15A0C07513E7 +:102D800014C0341312C0611110C08091BC01F8014D +:102D90008583C8010E94961486E0E7EBF1E0DF012D +:102DA0001D928A95E9F7FE2C8AC04D875E878D8536 +:102DB0009E856A8B0E94D5146A89882309F4BECF48 +:102DC000662309F4BBCF2091BC01822F82958F70BE +:102DD00090E002970CF48ECF8091B7019091B801EA +:102DE0009A8389831B82DD82CC822E83CE01019659 +:102DF0007FCF809590958C0D9D1DACCFF62E6623D0 +:102E000009F49CCF75132EC034132CC02091BC0143 +:102E100020FD1FC0822F82958F70D9F0D8011596A2 +:102E20002C9315978F3049F08F5F982F9295907F54 +:102E3000822F8F70892B15968C93C8010E9496144F +:102E400086E0F801A7EBB1E001900D928A95E1F7D9 +:102E500093CF86E0F801A7EBB1E001900D928A953F +:102E6000E1F72DC04D875E878D859E850E94D51424 +:102E7000811140CF8091BC0181608093BC01C80169 +:102E80000E9496141CC0662309F458CF4D875E87B4 +:102E90008D859E850E94D514882309F44FCF2ACFB3 +:102EA000811148CF0CC0243031050CF047CF9F7002 +:102EB00009F440CFF8019581907F09F03BCF8F2D29 +:102EC00062960FB6F894DEBF0FBECDBFDF91CF91F3 +:102ED0001F910F91FF90EF90DF90CF9008951F9377 +:102EE000CF93DF93CDB7DEB72C970FB6F894DEBF44 +:102EF0000FBECDBF4F83588769877A878B879C87A2 +:102F0000CE0107960E94A815882369F08F819885C5 +:102F10002A853B85232BF1F19F3F09F063C08F3F4A +:102F200009F060C037C086E0FE013796DE011196D9 +:102F300001900D928A95E1F76F817885EA85FB858E +:102F4000309741F17F3F11F46F3F21F120918601CD +:102F500030E0C9010196877099274091850150E0C2 +:102F60008417950709F447C069837A83FD83EC834E +:102F700096E0929FD001939FB00D1124A957BE4FA8 +:102F8000FE01319601900D929A95E1F780938601AA +:102F90000E941E1516E08091850190918601891787 +:102FA000C1F1189FC001112489579E4F0E94A81596 +:102FB000882379F1E09185011E9FF0011124E957E2 +:102FC000FE4F4081518162817381848195810E948D +:102FD0000E158091850190E0019687709927809366 +:102FE0008501D9CF4F81588569857A858B859C85E8 +:102FF0000E940E15CFCF0E94D1141092860110921C +:103000008501E7EBF1E086E0DF011D928A95E9F7A3 +:10301000C1CF2C960FB6F894DEBF0FBECDBFDF91A7 +:10302000CF911F910895EF92FF920F931F93CF932B +:10303000DF938C01892B09F46CC0F12CEE24E3940E +:10304000E8012196F8018491843740F4843008F037 +:1030500051C0813081F0823019F15BC0853709F4AD +:1030600044C0A8F19CE7980F903708F052C08F77C2 +:103070000E941C1241C00E5F1F4FFE01C49180E2EE +:103080008C0F883048F4C7708E2D01C0880FCA9508 +:10309000EAF70E94EF1A14C08C2F0E9454112DC021 +:1030A0000E5F1F4FFE01C49180E28C0F883058F4F0 +:1030B000C7708E2D01C0880FCA95EAF70E94F51AD5 +:1030C0000E94161B1AC08C2F0E941C1216C00E5F85 +:1030D0001F4FFE01C491CC2381F08FE99FE001973F +:1030E000F1F700C00000C150F6CF0E5F1F4FFE0188 +:1030F000F49003C00E9454118E018F2D882309F48F +:103100009FCFEFE9FFE03197F1F700C00000815059 +:10311000F5CFDF91CF911F910F91FF90EF90089520 +:1031200008956093C1017093C2018093C30190938D +:10313000C4010C94BD140F931F930091C101109111 +:10314000C2012091C3013091C401DC01CB01802B6D +:10315000912BA22BB32B8093C1019093C201A0931A +:10316000C301B093C4011F910F910C94BD140F9330 +:103170001F930091C1011091C2012091C3013091B0 +:10318000C401DC01CB0180239123A223B3238093CC +:10319000C1019093C201A093C301B093C4011F91D8 +:1031A0000F910C94BD140F931F930091C1011091C6 +:1031B000C2012091C3013091C401DC01CB01802701 +:1031C0009127A227B3278093C1019093C201A093B6 +:1031D000C301B093C4011F910F910C94BD141092C0 +:1031E000BD011092BE011092BF011092C0010C945B +:1031F000BD1441E050E060E070E004C0440F551F92 +:10320000661F771F8A95D2F74093BD015093BE0188 +:103210006093BF017093C0010C94BD1441E050E075 +:1032200060E070E004C0440F551F661F771F8A9549 +:10323000D2F78091BD019091BE01A091BF01B091E4 +:10324000C001482B592B6A2B7B2B4093BD01509317 +:10325000BE016093BF017093C0010C94BD1441E0A6 +:1032600050E060E070E004C0440F551F661F771FF8 +:103270008A95D2F740955095609570958091BD01E3 +:103280009091BE01A091BF01B091C0014823592384 +:103290006A237B234093BD015093BE016093BF011D +:1032A0007093C0010C94BD1441E050E060E070E008 +:1032B00004C0440F551F661F771F8A95D2F780916F +:1032C000BD019091BE01A091BF01B091C0014827FE +:1032D00059276A277B274093BD015093BE01609315 +:1032E000BF017093C0010C94BD140F931F93009104 +:1032F000BD011091BE012091BF013091C001DC01E0 +:10330000CB01802B912BA22BB32B8093BD019093EB +:10331000BE01A093BF01B093C0011F910F910C9407 +:10332000BD140F931F930091BD011091BE01209118 +:10333000BF013091C001DC01CB0180239123A22386 +:10334000B3238093BD019093BE01A093BF01B093BE +:10335000C0011F910F910C94BD140F931F93009106 +:10336000BD011091BE012091BF013091C001DC016F +:10337000CB0180279127A227B3278093BD0190938B +:10338000BE01A093BF01B093C0011F910F910C9497 +:10339000BD140895CF92DF92EF92FF920F931F9387 +:1033A000CF93DF938C01C090C101D090C201E09017 +:1033B000C301F090C4018091BD019091BE01A09124 +:1033C000BF01B091C001C82AD92AEA2AFB2ACFE15D +:1033D000D0E0D701C6010C2E04C0B695A7959795ED +:1033E00087950A94D2F780FF06C0B8018C2F0E94FF +:1033F0009F08019721F4219760F780E001C08C2F8E +:10340000DF91CF911F910F91FF90EF90DF90CF90C0 +:103410000895CF93DF93EC010E94CA19BE010E9468 +:103420009F08DF91CF910895CB010E94091A08955A +:103430008091C50185958595859508958091C501F3 +:103440008770089598E0899F90011124262B20937E +:10345000C5010C940E192091C5018095822380939B +:10346000C501982F977069F430E0482F552747FD24 +:1034700050952417350729F08595859585950C94E9 +:103480002F1908959091C501977081E009F480E0AB +:10349000089590910C01992321F090910D019111C3 +:1034A00009C020910E0130910F01F90132969FEF72 +:1034B00040E01FC0982F9695969596959F3050F5B1 +:1034C000E0910E01F0910F01E90FF11D877021E0ED +:1034D00030E0A90102C0440F551F8A95E2F7CA01E6 +:1034E0009181892B818308959F3F39F04F5F4E3042 +:1034F00041F051915813F8CF0DC05111F7CF942FCF +:10350000F5CF9F3F39F0F901E90FF11D97FDFA95CD +:1035100082830895089590910C01992321F0909150 +:103520000D01911109C020910E0130910F01F90197 +:103530003296205F3F4F1FC0982F9695969596958F +:103540009F30F0F4E0910E01F0910F01E90FF11DB1 +:10355000877021E030E0A90102C0440F551F8A9511 +:10356000E2F7CA018095918189238183089531967C +:10357000E217F30729F090819813F9CF1082F7CF63 +:10358000089581E090E0E0910E01F0910F01E80FC5 +:10359000F91F1082019680319105A9F70895909145 +:1035A000D901892B8093D901089580959091D901F3 +:1035B00089238093D90108951092D901089590919B +:1035C000D801892B8093D801089580959091D801D6 +:1035D00089238093D80108951092D801089590917D +:1035E000D701892B8093D701089580959091D701B9 +:1035F00089238093D70108951092D701089580936D +:10360000C60108951092C601089580910E0190910F +:103610000F01FC0131969C01205F3F4F80E09191AA +:1036200091118F5FE217F307D1F70895E0910E0132 +:10363000F0910F018091D9018083E0910E01F0910A +:103640000F0190818091D801892B8083E0910E0138 +:10365000F0910F0190818091D701892B8083809117 +:10366000C601882361F0E0910E01F0910F01908175 +:10367000892B80830E94051B81111092C6018091C5 +:103680000E0190910F010C94441020E0009739F046 +:10369000AC0141505109842395232F5FF7CF822F2E +:1036A0000895CF92DF92EF92FF926C01EE24FF24F7 +:1036B000C114D104E104F10421F0C701B60120E1F5 +:1036C00001C020E0C72ED82EE92EFF24C114D1045A +:1036D000E104F10419F0285FC701B6016B017C0118 +:1036E00054E0F694E794D794C7945A95D1F7C1144F +:1036F000D104E104F10419F02C5FC701B6016B019C +:103700007C0142E0F694E794D794C7944A95D1F7A8 +:10371000C114D104E104F10419F02E5FC701B60110 +:10372000DC01CB01B695A79597958795892B8A2BB8 +:103730008B2B09F02F5F822FFF90EF90DF90CF90BF +:1037400008958091EF01843021F11092DB0120E493 +:1037500088E190E00FB6F894A895809360000FBEC2 +:103760002093600080E00E943A0983B7817F8460E3 +:1037700083BF83B7816083BF7894889583B78E7F3A +:1037800083BF88E10FB6F8948093600010926000C8 +:103790000FBE0895089508950E94CA1B0E949004C8 +:1037A0000E94CB1B0E94850591E0811101C090E031 +:1037B000892F08950E94D1140E9438100C943A0960 +:1037C0001F920F920FB60F9211248F939F93AF9376 +:1037D000BF938091DB01811113C08091DC01909136 +:1037E000DD01A091DE01B091DF014196A11DB11D67 +:1037F0008093DC019093DD01A093DE01B093DF01A3 +:10380000BF91AF919F918F910F900FBE0F901F901E +:10381000189582E084BD93E095BD9AEF97BD8093A3 +:103820006E0008952FB7F8948091DC019091DD012E +:10383000A091DE01B091DF012FBF0895CF92DF92FA +:10384000EF92FF920F931F932FB7F8944091DC01F2 +:103850005091DD016091DE017091DF012FBF6A019F +:103860007B01EE24FF248C0120E030E0C016D1065D +:10387000E206F30610F4415051099A01281B390B56 +:10388000C9011F910F91FF90EF90DF90CF900895A5 +:103890001F920F920FB60F9211248F939F93AF93A5 +:1038A000BF938091DC019091DD01A091DE01B09188 +:1038B000DF010196A11DB11D8093DC019093DD0114 +:1038C000A093DE01B093DF01BF91AF919F918F91E3 +:1038D0000F900FBE0F901F9018950E94350DF89411 +:1038E0002FEF87EA91E6215080409040E1F700C039 +:1038F000000087E090EBDC018093F9019093FA01DE +:10390000A093FB01B093FC019CE088E10FB6F89412 +:10391000A895809360000FBE90936000FFCFEF9258 +:10392000FF920F931F93CF93DF93D82FCDE08C2F6F +:103930000E947E0505E010E0E82EF12CC701002E64 +:1039400002C0959587950A94E2F780FF09C0602F21 +:103950007C2F80E00E944B06D81302C081E006C095 +:103960000150110958F7C15010F780E0DF91CF9155 +:103970001F910F91FF90EF900895CF93C82F8CE285 +:103980000E948F1C882321F08C2FCF910C948F1CC8 +:1039900080E0CF910895CF930E94121E811102C042 +:1039A0000E94F81DC5E6C15049F00E9490048FE3C3 +:1039B0009CE90197F1F700C00000F5CF89E20E9471 +:1039C000BD1C811113C18AE20E94BD1C81110E949D +:1039D000F81D85E00E94BD1C81110E946D1C0E9493 +:1039E0001D1E8093DA0187E00E94BD1C8823A9F187 +:1039F0008BE10E94BD1C882351F08091DA0181FB8C +:103A0000222720F991E0922790FB81F90EC08EE0E9 +:103A10000E94BD1C882361F08091DA0182FB22277D +:103A200020F991E0922790FB82F98093DA0115C08A +:103A300080E10E94BD1C9091DA01882341F093FB44 +:103A4000222720F981E0822780FB93F904C0892F87 +:103A5000809580FB90F99093DA018091DA010E94C1 +:103A6000211E0E942F1E8093F80180EE0E94BD1C33 +:103A7000882341F08091F801982F909590FB80F970 +:103A80008093F80189E30E94BD1C882359F080913E +:103A9000F80181FB222720F991E0922790FB81F920 +:103AA0008093F80182EE0E94BD1C882359F080911A +:103AB000F80182FB222720F991E0922790FB82F9FE +:103AC0008093F80186EE0E94BD1C882359F08091F6 +:103AD000F80183FB222720F991E0922790FB83F9DC +:103AE0008093F80183EE0E94BD1C882359F08091D9 +:103AF000F80184FB222720F991E0922790FB84F9BA +:103B00008093F80185E30E94BD1C882359F08091C1 +:103B1000F80185FB222720F991E0922790FB85F997 +:103B20008093F80181E30E94BD1C882359F08091A5 +:103B3000F80186FB222720F991E0922790FB86F975 +:103B40008093F80181E10E94BD1C882359F0809187 +:103B5000F80187FB222720F991E0922790FB87F953 +:103B60008093F8018091F8010E94331E8091F80142 +:103B700087FB882780F980930D0187E20E94BD1C96 +:103B8000C82F8EE10E94BD1C8111C2608FE10E948E +:103B9000BD1C8111C46080E20E94BD1C8111C860FF +:103BA00081E20E94BD1C8111C06182E20E94BD1CA5 +:103BB0008111C06283E20E94BD1C8111C06484E255 +:103BC0000E94BD1C882311F0C06802C0CC2329F0DC +:103BD0008C2F0E942A1E6C2F03C00E94261E682F65 +:103BE00070E080E090E0CF910C949118CF9108950F +:103BF0006DEE7EEF80E090E00E94F82360E082E0CE +:103C000090E00E94E62360E083E090E00E94E623DB +:103C100060E084E090E00E94E62360E085E090E0D0 +:103C20000C94E62380E090E00E94E02321E08D3EAA +:103C30009E4F09F020E0822F089582E090E00C94DE +:103C4000D823682F82E090E00C94E62383E090E094 +:103C50000C94D823682F83E090E00C94E62384E052 +:103C600090E00C94D823682F84E090E00C94E62335 +:103C70008091E20180FF0BC06091130185E0689F95 +:103C8000B001112475956795759567952BC081FFD7 +:103C900009C06091130185E0689FB00111247595FA +:103CA000679520C082FF07C06091130185E0689F7F +:103CB000B001112417C09091E3019923D1F06091D4 +:103CC0001201961788F72091130185E0289F900133 +:103CD0001124929FA001939F500D112470E0CA01FE +:103CE0000E94AA236038710540F46115710539F00E +:103CF00002C065E070E0862F08958FE7089581E0A7 +:103D000008958091E20180FF08C06091110170E088 +:103D1000759567957595679521C081FF06C060917F +:103D2000110170E07595679519C082FF04C060911C +:103D3000110170E010C09091E3019923C1F06091EE +:103D400010019617A0F780911101899FC0011124DD +:103D500070E00E94AA236038710528F4611571058E +:103D600021F0862F08958FE7089581E0089561E09E +:103D700070E0F4CF803F21F40E94381E819504C08A +:103D8000813F29F40E94381E8093E6010895823F06 +:103D900021F40E94381E819504C0833F29F40E94BB +:103DA000381E8093E5010895893F19F40E94811E11 +:103DB00005C08A3F31F40E94811E81958093E701FE +:103DC00008958B3F21F40E94811E819504C08C3F91 +:103DD00029F40E94811E8093E8010895843F21F414 +:103DE0008091E401816017C0853F21F48091E40156 +:103DF000826011C0863F21F48091E40184600BC091 +:103E0000873F21F48091E401886005C0883F31F448 +:103E10008091E40180618093E40108958D3F21F455 +:103E20008091E20181600BC08E3F21F48091E2011C +:103E3000826005C08F3F29F48091E2018460809305 +:103E4000E2010895803F39F48091E60187FF6CC05C +:103E50001092E60169C0813F29F48091E6011816AD +:103E6000BCF362C09091E501823F29F497FF5CC0EA +:103E70001092E50159C0833F19F41916CCF354C0D0 +:103E8000893F41F48091E70118160CF04DC0109263 +:103E9000E7014AC08A3F29F48091E70187FF44C0C7 +:103EA000F6CF8B3F39F48091E80187FF3DC0109237 +:103EB000E8013AC08C3F29F48091E8011816BCF360 +:103EC00033C0843F21F48091E4018E7F17C0853F89 +:103ED00021F48091E4018D7F11C0863F21F480910F +:103EE000E4018B7F0BC0873F21F48091E401877F41 +:103EF00005C0883F31F48091E4018F7E8093E40116 +:103F000013C08D3F21F48091E2018E7F0BC08E3F64 +:103F100021F48091E2018D7F05C08F3F29F48091CB +:103F2000E2018B7F8093E2018091E50181110EC057 +:103F30008091E60181110AC08091E701811106C0DC +:103F40008091E801811102C01092E301089584EE8E +:103F500091E00E944F100E94121C9093E101809307 +:103F6000E00108951F93CF93DF938091E00190913A +:103F7000E1010E941E1CAC019091E301992321F004 +:103F80002091140130E006C0209115018AE0289F9D +:103F9000900111244217530708F486C08091E5016F +:103FA000C091E601D091E7011091E801811107C0AD +:103FB000C11176C0D11174C0111172C075C09F3F7C +:103FC00019F09F5F9093E301181624F40E94381EA5 +:103FD0008093E5018091E50187FF05C00E94381EAE +:103FE00081958093E5011C1624F40E94381E80936D +:103FF000E6018091E60187FF05C00E94381E819589 +:104000008093E6016091E501662339F1C091E601F4 +:10401000CC2319F1772767FD7095872F972F0E9482 +:10402000BB2223E333E343E35FE30E941F230E94A9 +:1040300088226093E5016C2F772767FD7095872FA5 +:10404000972F0E94BB2223E333E343E35FE30E9405 +:104050001F230E9488226093E6011D1624F40E940B +:10406000811E8093E7018091E70187FF05C00E94D0 +:10407000811E81958093E701111624F40E94811E10 +:104080008093E8018091E80187FF05C00E94811EAE +:1040900081958093E801DF91CF911F910C94A71F28 +:1040A0009F3F09F08ECF96CFDF91CF911F9108955A +:1040B000E4EEF1E085E0DF011D928A95E9F71092C8 +:1040C000E3011092E2010895833081F128F48130F8 +:1040D00059F08230D1F00895853009F449C0B8F123 +:1040E000863009F456C0089580911501262F30E0DE +:1040F000280F311D2F3F310524F4680F60931501FF +:1041000008958FEF80931501089580911401262F53 +:1041100030E0280F311D2F3F310524F4680F6093E4 +:10412000140108958FEF8093140108958091130175 +:10413000262F30E0280F311D2F3F310524F4680F62 +:104140006093130108958FEF809313010895809178 +:104150001201262F30E0280F311D2F3F310524F4A6 +:10416000680F6093120108958FEF809312010895F4 +:1041700080911101262F30E0280F311D2F3F31058E +:1041800024F4680F6093110108958FEF809311015B +:10419000089580911001262F30E0280F311D2F3F08 +:1041A000310524F4680F6093100108958FEF809318 +:1041B00010010895833011F128F4813049F08230E4 +:1041C00091F00895853081F120F18630C1F1089594 +:1041D00080911501681720F4861B809315010895BE +:1041E00010921501089580911401681720F4861B20 +:1041F0008093140108951092140108958091130181 +:10420000681720F4861B8093130108951092130100 +:10421000089580911201681720F4861B8093120183 +:10422000089510921201089580911101681720F4E9 +:10423000861B8093110108951092110108958091B9 +:104240001001681720F4861B8093100108951092C6 +:10425000100108950F931F938B3109F475C0A0F5D9 +:104260008E3009F484C0C0F4873009F45BC068F470 +:10427000863009F0AAC08091DA01817F8E7F809319 +:10428000DA0181E08093EA01A1C0883009F496C088 +:104290008B3009F493C099C0813109F472C068F47D +:1042A000803109F092C08091DA0183FB222720F946 +:1042B00091E0922790FB83F950C0863109F47EC0CB +:1042C000893109F47BC081C0853309F479C068F471 +:1042D000873209F475C028F48E3108F476C08D5108 +:1042E0005AC0893209F46CC070C0833438F48A3300 +:1042F00008F050C0883309F461C067C0833409F402 +:104300005FC0883409F061C00E94D1140FEF13ED33 +:1043100020E3015010402040E1F700C000000E945F +:104320006D1C4CC09091DA01892F8095817080FBC3 +:1043300090F929F0966098609093DA0147C0997FD0 +:10434000977F9093DA013AC08091DA0181FB2227AE +:1043500020F991E0922790FB81F98093DA0199236B +:1043600069F18091DA0181608093DA0127C0809140 +:10437000DA0182FB222720F991E0922790FB82F953 +:10438000ECCF0E94D11490910D0181E08927809398 +:104390000D0114C0895341E050E060E070E08A01F3 +:1043A0009B0104C0000F111F221F331F8A95D2F7F3 +:1043B000C901B8010E9491180E94D11481E006C081 +:1043C00061E070E080E090E0F5CF80E01F910F9118 +:1043D000089580E0089580E00895CF93C82F8091DC +:1043E000EA01813079F018F08230E9F187C0E0917C +:1043F0000E01F0910F018081813169F0823209F064 +:104400007FC009C0E0910E01F0910F0180818131E0 +:1044100011F0823261F48C2F0E94E921811104C0D5 +:104420008C2F0E942A211DC081E090E01AC08C2FA1 +:104430000E94EB21811114C0C43179F048F4CB30D3 +:1044400079F0C03109F060C082E08093EA0108C0D1 +:10445000C93219F0C83321F057C01092EA0154C094 +:1044600081E0817053C0C93289F118F5C43171F10E +:10447000A8F4C73009F046C08AE08093150194E1A2 +:104480009093140193E0909313018093120188E0BC +:104490008093110188E28093100134C0CE51C63060 +:1044A00088F5EC2FF0E0E65DFE4F80818093E90116 +:1044B00029C0CE34E9F020F4CB3421F56AE013C0F2 +:1044C000C13579F0C235F1F461E00DC08091E901A8 +:1044D000882319F01092E90115C081E08093EA0168 +:1044E00015C061E006C08091E9010E9464200AC005 +:1044F0006AE08091E9010E94DA2004C01092EA018A +:1045000080E004C081E002C080E0ABCFCF9108958D +:1045100004D06894B1118DC0089570D088F09F5771 +:1045200090F0B92F9927B751A0F0D1F0660F771FFF +:10453000881F991F1AF0BA95C9F712C0B13081F0DF +:1045400077D0B1E0089574C0672F782F8827B85FBF +:1045500039F0B93FCCF3869577956795B395D9F740 +:104560003EF490958095709561957F4F8F4F9F4F4A +:104570000895E89409C097FB3EF490958095709556 +:1045800061957F4F8F4F9F4F9923A9F0F92F96E99F +:10459000BB279395F695879577956795B795F11114 +:1045A000F8CFFAF4BB0F11F460FF1BC06F5F7F4FB1 +:1045B0008F4F9F4F16C0882311F096E911C07723C3 +:1045C00021F09EE8872F762F05C0662371F096E8CC +:1045D000862F70E060E02AF09A95660F771F881F9B +:1045E000DAF7880F9695879597F9089557FD9058B3 +:1045F000440F551F59F05F3F71F04795880F97FBA7 +:10460000991F61F09F3F79F0879508951216130660 +:104610001406551FF2CF4695F1DF08C0161617068F +:104620001806991FF1CF86957105610508940895C4 +:10463000E894BB2766277727CB0197F908950BD01D +:1046400078C069D028F06ED018F0952309F05AC0D0 +:104650005FC01124EECFCADFA0F3959FD1F3950F71 +:1046600050E0551F629FF001729FBB27F00DB11DF6 +:10467000639FAA27F00DB11DAA1F649F6627B00D86 +:10468000A11D661F829F2227B00DA11D621F739F6F +:10469000B00DA11D621F839FA00D611D221F749F7D +:1046A0003327A00D611D231F849F600D211D822FC4 +:1046B000762F6A2F11249F5750408AF0E1F088230B +:1046C0004AF0EE0FFF1FBB1F661F771F881F915018 +:1046D0005040A9F79E3F510570F014C0AACF5F3F2C +:1046E000ECF3983EDCF3869577956795B795F7954B +:1046F000E7959F5FC1F7FE2B880F911D96958795D3 +:1047000097F9089597F99F6780E870E060E0089551 +:104710009FEF80EC089500240A94161617061806D9 +:104720000906089500240A941216130614060506B5 +:104730000895092E0394000C11F4882352F0BB0F46 +:1047400040F4BF2B11F460FF04C06F5F7F4F8F4FA9 +:104750009F4F089597FB072E16F4009407D077FD1E +:1047600009D00E94C42307FC05D03EF490958195A2 +:104770009F4F0895709561957F4F0895EE0FFF1F2D +:104780000590F491E02D0994AA1BBB1B51E107C0D1 +:10479000AA1FBB1FA617B70710F0A61BB70B881FD1 +:1047A000991F5A95A9F780959095BC01CD01089560 +:1047B000F999FECF92BD81BDF89A992780B50895E9 +:1047C000A8E1B0E042E050E00C940024262FF999D3 +:1047D000FECF92BD81BDF89A019700B4021639F060 +:1047E0001FBA20BD0FB6F894FA9AF99A0FBE089531 +:1047F0000196272F0E94E7230C94E623DC01CB01CE +:10480000FC01F999FECF06C0F2BDE1BDF89A3196E0 +:1048100000B40D9241505040B8F70895F894FFCF7E +:1048200020023C09CA09A70973093F090101C70110 +:1048300028080A03140A3F4D36392605D904A30473 +:104840006A04FD0316042F0448040102030405064C +:04485000070809004C :00000001FF -- cgit v1.2.3-24-g4f1b From 6428069eb70f5cc47ac1f3f9acf3daea14fb9097 Mon Sep 17 00:00:00 2001 From: Nathan Sharfi Date: Tue, 31 May 2016 16:45:22 -0700 Subject: zweihander-osx: Use power instead of eject KC_EJCT isn't the OS X Eject key and won't restart your computer. --- keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c | 4 ++-- keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c index f1a2956b5..69d08d0e1 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c @@ -102,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 2: Media keys * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | â | + * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | Power | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | | PgUp |⌘S⌘⇥⌘R| Term | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -131,7 +131,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, // right hand - LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_EJCT, + LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR , KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY, KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex b/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex index 44e4ab0f3..270a197af 100644 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex +++ b/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex @@ -56,7 +56,7 @@ :100370000830082F082C0200000100350A520C50EA :10038000002C00A9004D00350852005100AC00AA15 :100390000019080100510C4F00AB00A8000608012D -:1003A0000001000100010001001B08B0000100AEC7 +:1003A0000001000100010001001B08A5000100AED2 :1003B0000001000100000016034500720067006F95 :1003C0000044006F007800200045005A000000162D :1003D000034500720067006F0044006F0078002042 -- cgit v1.2.3-24-g4f1b From 73d890a2c9c34b905cd5e74e7146fdd4578dcb96 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 1 Jun 2016 09:22:47 +0300 Subject: Fix visualizer sleeping too long The documentation for ugfx gEventWait wait is wrong and the function takes the time in milliseconds, instead of system ticks. This caused the the thread to sleep way too long. It also caused somewhat random sleeping behaviour as the MS2ST function overflows at around 43 seconds sleep. The event source is also now initialized correctly, so that the thread actually can be woken up by events. --- visualizer.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/visualizer.c b/visualizer.c index 0e587221f..c24073405 100644 --- a/visualizer.c +++ b/visualizer.c @@ -25,6 +25,9 @@ SOFTWARE. #include "visualizer.h" #include "config.h" #include +#ifdef PROTOCOL_CHIBIOS +#include "ch.h" +#endif #ifdef LCD_ENABLE #include "gfx.h" @@ -67,7 +70,6 @@ static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboa status1->suspended == status2->suspended; } -static GSourceHandle layer_changed_event; static bool visualizer_enabled = false; #define MAX_SIMULTANEOUS_ANIMATIONS 4 @@ -185,8 +187,8 @@ static bool update_keyframe_animation(keyframe_animation_t* animation, visualize animation->first_update_of_frame = false; } - int wanted_sleep = animation->need_update ? 10 : animation->time_left_in_frame; - if ((unsigned)wanted_sleep < *sleep_time) { + systemticks_t wanted_sleep = animation->need_update ? gfxMillisecondsToTicks(10) : (unsigned)animation->time_left_in_frame; + if (wanted_sleep < *sleep_time) { *sleep_time = wanted_sleep; } @@ -345,7 +347,7 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { GListener event_listener; geventListenerInit(&event_listener); - geventAttachSource(&event_listener, layer_changed_event, 0); + geventAttachSource(&event_listener, (GSourceHandle)¤t_status, 0); visualizer_keyboard_status_t initial_status = { .default_layer = 0xFFFFFFFF, @@ -435,6 +437,16 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { } } dprintf("Update took %d, last delta %d, sleep_time %d\n", update_delta, delta, sleep_time); +#ifdef PROTOCOL_CHIBIOS + // The gEventWait function really takes milliseconds, even if the documentation says ticks. + // Unfortunately there's no generic ugfx conversion from system time to milliseconds, + // so let's do it in a platform dependent way. + + // On windows the system ticks is the same as milliseconds anyway + if (sleep_time != TIME_INFINITE) { + sleep_time = ST2MS(sleep_time); + } +#endif geventEventWait(&event_listener, sleep_time); } #ifdef LCD_ENABLE @@ -473,7 +485,7 @@ void visualizer_init(void) { void update_status(bool changed) { if (changed) { - GSourceListener* listener = geventGetSourceListener(layer_changed_event, NULL); + GSourceListener* listener = geventGetSourceListener((GSourceHandle)¤t_status, NULL); if (listener) { geventSendEvent(listener); } -- cgit v1.2.3-24-g4f1b From 5988820c99e18e705ddc38dfa3e3487cf0645c26 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 22 Jun 2016 21:03:01 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index 8f6dba45e..c556d3599 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -1,3 +1,73 @@ + +* Keymap + +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |esc/ctrl| A | S | D | F | G |------| |------| H | J | K | L |; / L2|'/ ctrl | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space| Bksp |------| |------| Tab |Enter | + * |[ctrl]| [gui]|[Alt] | |[Alt] | [gui] |[ctrl]| + * `--------------------' `----------------------' + */ + +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ + + # ErgoDox EZ Default Configuration ## Changelog -- cgit v1.2.3-24-g4f1b From 521a56f5eb0985debc4729a44006a35f868a6014 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 22 Jun 2016 21:05:59 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index c556d3599..da50731ae 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -1,28 +1,28 @@ -* Keymap +# Keymap -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |esc/ctrl| A | S | D | F | G |------| |------| H | J | K | L |; / L2|'/ ctrl | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space| Bksp |------| |------| Tab |Enter | - * |[ctrl]| [gui]|[Alt] | |[Alt] | [gui] |[ctrl]| - * `--------------------' `----------------------' - */ +## Keymap 0: Basic layer +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + |esc/ctrl| A | S | D | F | G |------| |------| H | J | K | L |; / L2|'/ ctrl | + |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | App | LGui | | Alt |Ctrl/Esc| + ,------|------|------| |------+--------+------. + | | | Home | | PgUp | | | + | Space| Bksp |------| |------| Tab |Enter | + |[ctrl]| [gui]|[Alt] | |[Alt] | [gui] |[ctrl]| + `--------------------' `----------------------' +``` /* Keymap 1: Symbol Layer * * ,--------------------------------------------------. ,--------------------------------------------------. -- cgit v1.2.3-24-g4f1b From b43b8bdd17af88231793460006a14f6312635af3 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 22 Jun 2016 21:20:19 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index da50731ae..b382e8916 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -1,6 +1,19 @@ +# Introduction -# Keymap +## Motivation +I created this keymap in an attempt to optimize my typing experience in text editors and the command-line. + +More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. + +## Changes +The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. +## Caveats +I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard][https://github.com/adereth/dactyl-keyboard], which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: +* I use DCS keycaps with SA Row 3 keycaps where the Alt keys are +* I have relatively large hands (I guarantee you there's no problem; I guarantee you) + +# Keymap ## Keymap 0: Basic layer ``` ,--------------------------------------------------. ,--------------------------------------------------. -- cgit v1.2.3-24-g4f1b From c72c9a7375a96e767071209c5bece652afd3788c Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 22 Jun 2016 21:21:27 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index b382e8916..fb7aeb64a 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -9,7 +9,7 @@ More specifically, I wanted to have each modifier key controlled by the thumbs, The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. ## Caveats -I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard][https://github.com/adereth/dactyl-keyboard], which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: +I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: * I use DCS keycaps with SA Row 3 keycaps where the Alt keys are * I have relatively large hands (I guarantee you there's no problem; I guarantee you) -- cgit v1.2.3-24-g4f1b From ce5e41d362a0f55b0206d505f752aff782cb1c21 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 22 Jun 2016 21:31:37 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 99 +++++++++++++++---------------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index fb7aeb64a..e23c67df1 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -6,12 +6,16 @@ I created this keymap in an attempt to optimize my typing experience in text edi More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. ## Changes -The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. +The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. You must hold each key down for a certain amount of time (forgot where this is specified) in order for the modifier key to activate. ## Caveats +### Thumb Cluster Range I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: * I use DCS keycaps with SA Row 3 keycaps where the Alt keys are -* I have relatively large hands (I guarantee you there's no problem; I guarantee you) +* I have relatively large hands (I guarantee you there's no problem - I guarantee you) + +### Dangerous positioning +I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtation in which disaster could occur with one fell swoop of a keypress. # Keymap ## Keymap 0: Basic layer @@ -36,58 +40,53 @@ I've heard many complaints about the thumb clusters. I agree that the three outt `--------------------' `----------------------' ``` -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ +## Keymap 1: Symbol Layer +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | . | 0 | = | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` +## Keymap 2: Media and mouse keys +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | | | | | | | | | | | | | | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | | MsUp | | | | | | | | | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | | | | | | | Prev | Next | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | |VolUp |VolDn | Mute | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | |Brwser| + | | |------| |------| |Back | + | | | | | | | | + `--------------------' `--------------------' +``` # ErgoDox EZ Default Configuration -## Changelog - -* Feb 2, 2016 (V1.1): - * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). - -This is what we ship with out of the factory. :) The image says it all: +As of Feb 2, 2016, the default ErgoDox EZ keymap is: ![Default](default_highres.png) -- cgit v1.2.3-24-g4f1b From aea8d4371605600c9cbb224e7aac8a3f2bc7622c Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Wed, 22 Jun 2016 21:32:51 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index e23c67df1..0de7d3646 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -15,7 +15,7 @@ I've heard many complaints about the thumb clusters. I agree that the three outt * I have relatively large hands (I guarantee you there's no problem - I guarantee you) ### Dangerous positioning -I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtation in which disaster could occur with one fell swoop of a keypress. +I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtations in which disaster could occur with one fell swoop of a keypress. # Keymap ## Keymap 0: Basic layer -- cgit v1.2.3-24-g4f1b From 132c04746910f7230b63ed33717c4ed65599ed1b Mon Sep 17 00:00:00 2001 From: Rubén Díaz-Jorge Date: Sat, 2 Jul 2016 10:26:04 +0200 Subject: Fix for '~' in spanish layout --- quantum/keymap_extras/keymap_spanish.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/keymap_extras/keymap_spanish.h b/quantum/keymap_extras/keymap_spanish.h index 512d8a374..af76e39fc 100644 --- a/quantum/keymap_extras/keymap_spanish.h +++ b/quantum/keymap_extras/keymap_spanish.h @@ -49,7 +49,7 @@ #define ES_PIPE ALGR(KC_1) #define ES_AT ALGR(KC_2) #define ES_HASH ALGR(KC_3) -#define ES_TILD ALGR(KC_4) +#define ES_TILD ALGR(ES_NTIL) #define ES_EURO ALGR(KC_5) #define ES_NOT ALGR(KC_6) @@ -59,4 +59,4 @@ #define ES_LCBR ALGR(ES_ACUT) #define ES_RCRB ALGR(ES_CCED) -#endif \ No newline at end of file +#endif -- cgit v1.2.3-24-g4f1b From 8149924399cf3d31d80444a10477a29f53a4990e Mon Sep 17 00:00:00 2001 From: Joshua Colbeck Date: Sun, 3 Jul 2016 12:24:44 -0500 Subject: Changed layout of left hand main layer --- keyboards/ergodox_ez/keymaps/default/keymap.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index b48a54a43..cbf80c408 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -10,18 +10,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * | LCTL | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * | LShift | Z | X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * | WIN |AltShf| \ | LALT | LCTL | | Up | Down | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| + * | App | LALT | | Alt |Ctrl/Esc| * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | * | Space|Backsp|------| |------| Tab |Enter | @@ -32,12 +32,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + ALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(SYMB), + KC_LGUI, LALT(KC_LSFT),KC_BSLS,KC_LALT,KC_LCTL, + CTL_T(KC_APP), KC_LALT, KC_HOME, KC_SPC,KC_BSPC,KC_END, // right hand -- cgit v1.2.3-24-g4f1b From 62a92a71d05da1473a6cdf23904fc8b377d76317 Mon Sep 17 00:00:00 2001 From: Josh Colbeck Date: Sun, 3 Jul 2016 21:50:04 -0500 Subject: Revert "Changed layout of left hand main layer" This reverts commit 8149924399cf3d31d80444a10477a29f53a4990e. --- keyboards/ergodox_ez/keymaps/default/keymap.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index cbf80c408..b48a54a43 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -10,18 +10,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | ESC | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCTL | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | WIN |AltShf| \ | LALT | LCTL | | Up | Down | [ | ] | ~L1 | + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | App | LALT | | Alt |Ctrl/Esc| + * | App | LGui | | Alt |Ctrl/Esc| * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | * | Space|Backsp|------| |------| Tab |Enter | @@ -32,12 +32,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - ALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(SYMB), - KC_LGUI, LALT(KC_LSFT),KC_BSLS,KC_LALT,KC_LCTL, - CTL_T(KC_APP), KC_LALT, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, KC_HOME, KC_SPC,KC_BSPC,KC_END, // right hand -- cgit v1.2.3-24-g4f1b From 8e88d55bfd7c88cb15845e0c6415e4e892532861 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 4 Jul 2016 11:45:58 -0400 Subject: reverts #343 for the most part (#474) --- quantum/matrix.c | 292 +++++++++++++++++++++++------------------- tmk_core/common/avr/suspend.c | 6 +- tmk_core/common/bootmagic.c | 16 ++- tmk_core/common/keyboard.c | 107 +++++++++------- tmk_core/common/matrix.h | 57 ++++----- 5 files changed, 261 insertions(+), 217 deletions(-) diff --git a/quantum/matrix.c b/quantum/matrix.c index a38c13f15..094917025 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -26,32 +26,46 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" -#ifdef MATRIX_HAS_GHOST -# error "The universal matrix.c file cannot be used for this keyboard." -#endif +/* Set 0 if debouncing isn't needed */ +/* + * This constant define not debouncing time in msecs, but amount of matrix + * scan loops which should be made to get stable debounced results. + * + * On Ergodox matrix scan rate is relatively low, because of slow I2C. + * Now it's only 317 scans/second, or about 3.15 msec/scan. + * According to Cherry specs, debouncing time is 5 msec. + * + * And so, there is no sense to have DEBOUNCE higher than 2. + */ #ifndef DEBOUNCING_DELAY # define DEBOUNCING_DELAY 5 #endif +static uint8_t debouncing = DEBOUNCING_DELAY; static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; -/* matrix state */ -#if DIODE_DIRECTION == COL2ROW + +/* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -#else -static matrix_col_t matrix[MATRIX_COLS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#if DIODE_DIRECTION == ROW2COL + static matrix_row_t matrix_reversed[MATRIX_COLS]; + static matrix_row_t matrix_reversed_debouncing[MATRIX_COLS]; #endif -static int8_t debouncing_delay = -1; -#if DIODE_DIRECTION == COL2ROW -static void toggle_row(uint8_t row); -static matrix_row_t read_cols(void); +#if MATRIX_COLS > 16 + #define SHIFTER 1UL #else -static void toggle_col(uint8_t col); -static matrix_col_t read_rows(void); + #define SHIFTER 1 #endif +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + __attribute__ ((weak)) void matrix_init_quantum(void) { matrix_init_kb(); @@ -80,10 +94,12 @@ __attribute__ ((weak)) void matrix_scan_user(void) { } +inline uint8_t matrix_rows(void) { return MATRIX_ROWS; } +inline uint8_t matrix_cols(void) { return MATRIX_COLS; } @@ -113,161 +129,179 @@ uint8_t matrix_cols(void) { // } void matrix_init(void) { - /* frees PORTF by setting the JTD bit twice within four cycles */ + // To use PORTF disable JTAG with writing JTD bit twice within four cycles. #ifdef __AVR_ATmega32U4__ MCUCR |= _BV(JTD); MCUCR |= _BV(JTD); #endif - /* initializes the I/O pins */ -#if DIODE_DIRECTION == COL2ROW - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { - /* DDRxn */ - _SFR_IO8((row_pins[r] >> 4) + 1) |= _BV(row_pins[r] & 0xF); - toggle_row(r); - } - for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { - /* PORTxn */ - _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF); - } -#else - for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { - /* DDRxn */ - _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF); - toggle_col(c); - } - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { - /* PORTxn */ - _SFR_IO8((row_pins[r] >> 4) + 2) |= _BV(row_pins[r] & 0xF); + + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; } -#endif + matrix_init_quantum(); } +uint8_t matrix_scan(void) +{ + #if DIODE_DIRECTION == COL2ROW -uint8_t matrix_scan(void) { - static matrix_row_t debouncing_matrix[MATRIX_ROWS]; - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { - toggle_row(r); - matrix_row_t state = read_cols(); - if (debouncing_matrix[r] != state) { - debouncing_matrix[r] = state; - debouncing_delay = DEBOUNCING_DELAY; - } - toggle_row(r); - } - if (debouncing_delay >= 0) { - dprintf("Debouncing delay remaining: %X\n", debouncing_delay); - --debouncing_delay; - if (debouncing_delay >= 0) { - wait_ms(1); - } - else { - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { - matrix[r] = debouncing_matrix[r]; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); } + debouncing = DEBOUNCING_DELAY; } + unselect_rows(); } - matrix_scan_quantum(); - return 1; -} - -static void toggle_row(uint8_t row) { - /* PINxn */ - _SFR_IO8((row_pins[row] >> 4)) = _BV(row_pins[row] & 0xF); -} -static matrix_row_t read_cols(void) { - matrix_row_t state = 0; - for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { - /* PINxn */ - if (!(_SFR_IO8((col_pins[c] >> 4)) & _BV(col_pins[c] & 0xF))) { - state |= (matrix_row_t)1 << c; + if (debouncing) { + if (--debouncing) { + wait_us(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } } } - return state; -} - -matrix_row_t matrix_get_row(uint8_t row) { - return matrix[row]; -} - #else -uint8_t matrix_scan(void) { - static matrix_col_t debouncing_matrix[MATRIX_COLS]; - for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { - toggle_col(c); - matrix_col_t state = read_rows(); - if (debouncing_matrix[c] != state) { - debouncing_matrix[c] = state; - debouncing_delay = DEBOUNCING_DELAY; + for (uint8_t i = 0; i < MATRIX_COLS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t rows = read_cols(); + if (matrix_reversed_debouncing[i] != rows) { + matrix_reversed_debouncing[i] = rows; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCING_DELAY; } - toggle_col(c); + unselect_rows(); } - if (debouncing_delay >= 0) { - dprintf("Debouncing delay remaining: %X\n", debouncing_delay); - --debouncing_delay; - if (debouncing_delay >= 0) { - wait_ms(1); - } - else { - for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { - matrix[c] = debouncing_matrix[c]; + + if (debouncing) { + if (--debouncing) { + wait_us(1); + } else { + for (uint8_t i = 0; i < MATRIX_COLS; i++) { + matrix_reversed[i] = matrix_reversed_debouncing[i]; } } } + for (uint8_t y = 0; y < MATRIX_ROWS; y++) { + matrix_row_t row = 0; + for (uint8_t x = 0; x < MATRIX_COLS; x++) { + row |= ((matrix_reversed[x] & (1<> y) << x; + } + matrix[y] = row; + } +#endif + matrix_scan_quantum(); + return 1; } -static void toggle_col(uint8_t col) { - /* PINxn */ - _SFR_IO8((col_pins[col] >> 4)) = _BV(col_pins[col] & 0xF); +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; } -static matrix_col_t read_rows(void) { - matrix_col_t state = 0; - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { - /* PINxn */ - if (!(_SFR_IO8((row_pins[r] >> 4)) & _BV(row_pins[r] & 0xF))) { - state |= (matrix_col_t)1 << r; - } +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1= 0; --c) { - if (matrix[c] & mask) { - state |= (matrix_row_t)1 << c; - } +uint8_t matrix_key_count(void) +{ + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + count += bitpop16(matrix[i]); } - return state; + return count; } +static void init_cols(void) +{ +#if DIODE_DIRECTION == COL2ROW + for(int x = 0; x < MATRIX_COLS; x++) { + int pin = col_pins[x]; +#else + for(int x = 0; x < MATRIX_ROWS; x++) { + int pin = row_pins[x]; #endif - -bool matrix_is_modified(void) { - if (debouncing_delay >= 0) return false; - return true; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); + } } -bool matrix_is_on(uint8_t row, uint8_t col) { - return matrix_get_row(row) & (matrix_row_t)1 << col; -} +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; -void matrix_print(void) { - dprintln("Human-readable matrix state:"); - for (uint8_t r = 0; r < MATRIX_ROWS; r++) { - dprintf("State of row %X: %016b\n", r, bitrev16(matrix_get_row(r))); +#if DIODE_DIRECTION == COL2ROW + for(int x = 0; x < MATRIX_COLS; x++) { + int pin = col_pins[x]; +#else + for(int x = 0; x < MATRIX_ROWS; x++) { + int pin = row_pins[x]; +#endif + result |= (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)) ? 0 : (SHIFTER << x); } + return result; } -uint8_t matrix_key_count(void) { - uint8_t count = 0; - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { - count += bitpop16(matrix_get_row(r)); +static void unselect_rows(void) +{ +#if DIODE_DIRECTION == COL2ROW + for(int x = 0; x < MATRIX_ROWS; x++) { + int pin = row_pins[x]; +#else + for(int x = 0; x < MATRIX_COLS; x++) { + int pin = col_pins[x]; +#endif + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); } - return count; +} + +static void select_row(uint8_t row) +{ + +#if DIODE_DIRECTION == COL2ROW + int pin = row_pins[row]; +#else + int pin = col_pins[row]; +#endif + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); } diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index a6f3c6441..8a7272bbc 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -114,8 +114,10 @@ bool suspend_wakeup_condition(void) matrix_power_up(); matrix_scan(); matrix_power_down(); - if (matrix_key_count()) return true; - return false; + for (uint8_t r = 0; r < MATRIX_ROWS; r++) { + if (matrix_get_row(r)) return true; + } + return false; } // run immediately after wakeup diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c index 90275a18b..6730a2a4a 100644 --- a/tmk_core/common/bootmagic.c +++ b/tmk_core/common/bootmagic.c @@ -106,13 +106,15 @@ void bootmagic(void) } } -static bool scan_keycode(uint8_t keycode) { - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { +static bool scan_keycode(uint8_t keycode) +{ + for (uint8_t r = 0; r < MATRIX_ROWS; r++) { matrix_row_t matrix_row = matrix_get_row(r); - for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { - if (matrix_row & (matrix_row_t)1 << c) { - keypos_t key = (keypos_t){ .row = r, .col = c }; - if (keycode == keymap_key_to_keycode(0, key)) return true; + for (uint8_t c = 0; c < MATRIX_COLS; c++) { + if (matrix_row & ((matrix_row_t)1<. #endif #ifdef MATRIX_HAS_GHOST -static bool is_row_ghosting(uint8_t row){ - matrix_row_t state = matrix_get_row(row); - /* no ghosting happens when only one key in the row is pressed */ - if (!(state - 1 & state)) return false; - /* ghosting occurs when two keys in the same column are pressed */ - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { - if (r != row && matrix_get_row(r) & state) return true; +static bool has_ghost_in_row(uint8_t row) +{ + matrix_row_t matrix_row = matrix_get_row(row); + // No ghost exists when less than 2 keys are down on the row + if (((matrix_row - 1) & matrix_row) == 0) + return false; + + // Ghost occurs when the row shares column line with other row + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + if (i != row && (matrix_get_row(i) & matrix_row)) + return true; } return false; } - #endif __attribute__ ((weak)) @@ -100,72 +103,86 @@ void keyboard_init(void) { #endif } -/* does routine keyboard jobs */ -void keyboard_task(void) { - static uint8_t led_status; +/* + * Do keyboard routine jobs: scan mantrix, light LEDs, ... + * This is repeatedly called as fast as possible. + */ +void keyboard_task(void) +{ + static matrix_row_t matrix_prev[MATRIX_ROWS]; +#ifdef MATRIX_HAS_GHOST + static matrix_row_t matrix_ghost[MATRIX_ROWS]; +#endif + static uint8_t led_status = 0; + matrix_row_t matrix_row = 0; + matrix_row_t matrix_change = 0; + matrix_scan(); - for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) { - static matrix_row_t previous_matrix[MATRIX_ROWS]; - matrix_row_t state = matrix_get_row(r); - matrix_row_t changes = state ^ previous_matrix[r]; - if (changes) { + for (uint8_t r = 0; r < MATRIX_ROWS; r++) { + matrix_row = matrix_get_row(r); + matrix_change = matrix_row ^ matrix_prev[r]; + if (matrix_change) { #ifdef MATRIX_HAS_GHOST - static matrix_row_t deghosting_matrix[MATRIX_ROWS]; - if (is_row_ghosting(r)) { - /* debugs the deghosting mechanism */ - /* doesn't update previous_matrix until the ghosting has stopped - * in order to prevent the last key from being lost + if (has_ghost_in_row(r)) { + /* Keep track of whether ghosted status has changed for + * debugging. But don't update matrix_prev until un-ghosted, or + * the last key would be lost. */ - if (debug_matrix && deghosting_matrix[r] != state) { + if (debug_matrix && matrix_ghost[r] != matrix_row) { matrix_print(); } - deghosting_matrix[r] = state; + matrix_ghost[r] = matrix_row; continue; } - deghosting_matrix[r] = state; + matrix_ghost[r] = matrix_row; #endif if (debug_matrix) matrix_print(); - for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { - matrix_row_t mask = (matrix_row_t)1 << c; - if (changes & mask) { - keyevent_t event; - event.key = (keypos_t){ .row = r, .col = c }; - event.pressed = state & mask; - /* the time should not be 0 */ - event.time = timer_read() | 1; - action_exec(event); - /* records the processed key event */ - previous_matrix[r] ^= mask; - /* processes one key event per call */ - goto event_processed; + for (uint8_t c = 0; c < MATRIX_COLS; c++) { + if (matrix_change & ((matrix_row_t)1<. #include #include -#if MATRIX_COLS <= 8 -typedef uint8_t matrix_row_t; -#elif MATRIX_COLS <= 16 -typedef uint16_t matrix_row_t; -#elif MATRIX_COLS <= 32 -typedef uint32_t matrix_row_t; + +#if (MATRIX_COLS <= 8) +typedef uint8_t matrix_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t matrix_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t matrix_row_t; #else -# error "There are too many columns." +#error "MATRIX_COLS: invalid value" #endif -#if DIODE_DIRECTION == ROW2COL -# if MATRIX_ROWS <= 8 -typedef uint8_t matrix_col_t; -# elif MATRIX_ROWS <= 16 -typedef uint16_t matrix_col_t; -# elif MATRIX_ROWS <= 32 -typedef uint32_t matrix_col_t; -# else -# error "There are too many rows." -# endif -#endif +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< Date: Mon, 4 Jul 2016 17:55:32 +0200 Subject: fix typos --- doc/keycode.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/keycode.txt b/doc/keycode.txt index 44d7e27cd..c1134f9bf 100644 --- a/doc/keycode.txt +++ b/doc/keycode.txt @@ -62,7 +62,7 @@ KC_NONUS_HASH KC_NUHS 32 Keyboard Non-US # and ~ KC_SCOLON KC_SCLN 33 Keyboard ; and : KC_QUOTE KC_QUOT 34 Keyboard ‘ and “ KC_GRAVE KC_GRV 35 Keyboard Grave Accent and Tilde -KC_COMMA KC_COMM 36 Keyboard, and < +KC_COMMA KC_COMM 36 Keyboard , and < KC_DOT 37 Keyboard . and > KC_SLASH KC_SLSH 38 Keyboard / and ? KC_CAPSLOCK KC_CAPS 39 Keyboard Caps Lock @@ -92,7 +92,7 @@ KC_LEFT 50 Keyboard LeftArrow1 KC_DOWN 51 Keyboard DownArrow1 KC_UP 52 Keyboard UpArrow1 KC_NUMLOCK KC_NLCK 53 Keypad Num Lock and Clear11 -KC_KP_SLASH KC_PSLS 54 Keypad /1 +KC_KP_SLASH KC_PSLS 54 Keypad / KC_KP_ASTERISK KC_PAST 55 Keypad * KC_KP_MINUS KC_PMNS 56 Keypad - KC_KP_PLUS KC_PPLS 57 Keypad + -- cgit v1.2.3-24-g4f1b From eafaba6b532a2f013955599fc7aa5c599e638fd3 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 4 Jul 2016 12:01:10 -0400 Subject: Improves debounce --- keyboards/ergodox_ez/config.h | 10 ++-------- keyboards/ergodox_ez/matrix.c | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index 6a391ffb5..2bb56731b 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h @@ -27,7 +27,7 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER ErgoDox EZ #define PRODUCT ErgoDox EZ -#define DESCRIPTION t.m.k. keyboard firmware for Ergodox +#define DESCRIPTION QMK keyboard firmware for Ergodox EZ /* key matrix size */ #define MATRIX_ROWS 14 @@ -40,12 +40,6 @@ along with this program. If not, see . #define TAPPING_TOGGLE 1 -#define COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } -#define ROWS (int []){ D0, D5, B5, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -53,7 +47,7 @@ along with this program. If not, see . #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ -#define DEBOUNCE 2 +#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.) diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index b87fddbad..1bacff2a5 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -179,7 +179,7 @@ uint8_t matrix_scan(void) if (debouncing) { if (--debouncing) { - _delay_ms(1); + _delay_ms(2); } else { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; -- cgit v1.2.3-24-g4f1b From 86a7b060efb6f94115f5b1f6d9e3703aa3d6b392 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 4 Jul 2016 12:13:41 -0400 Subject: Adds wait to i2c (debounce) --- keyboards/ergodox_ez/matrix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 1bacff2a5..9c1efa1d0 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -27,7 +27,7 @@ along with this program. If not, see . #include #include #include -#include +#include "wait.h" #include "action_layer.h" #include "print.h" #include "debug.h" @@ -166,6 +166,7 @@ uint8_t matrix_scan(void) for (uint8_t i = 0; i < MATRIX_ROWS; i++) { select_row(i); + wait_us(30); // without this wait read unstable value. matrix_row_t cols = read_cols(i); if (matrix_debouncing[i] != cols) { matrix_debouncing[i] = cols; @@ -179,7 +180,7 @@ uint8_t matrix_scan(void) if (debouncing) { if (--debouncing) { - _delay_ms(2); + wait_us(1); } else { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; @@ -267,7 +268,6 @@ static matrix_row_t read_cols(uint8_t row) return data; } } else { - _delay_us(30); // without this wait read unstable value. // read from teensy return (PINF&(1<<0) ? 0 : (1<<0)) | -- cgit v1.2.3-24-g4f1b From 1650adf29ab678ccc331e9f1dd48ccd32bd5cc8c Mon Sep 17 00:00:00 2001 From: Josh Colbeck Date: Mon, 4 Jul 2016 12:00:06 -0500 Subject: Added new keymap --- keyboards/ergodox_ez/keymaps/josh/keymap.c | 191 +++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/josh/keymap.c diff --git a/keyboards/ergodox_ez/keymaps/josh/keymap.c b/keyboards/ergodox_ez/keymaps/josh/keymap.c new file mode 100644 index 000000000..4233f7f69 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/josh/keymap.c @@ -0,0 +1,191 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +//macros +#define CRT_SFT_T 100 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | Q | W | E | R | T | Meh | | Meh | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LCTL | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / CTL | + * |--------+------+------+------+------+------| ~L1 | | ~L1 |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | WIN | ` | LALT | LCTL |AltShf| |AltShf| Left | Down | Up | Right | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LALT | | Alt | CAPS | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Delete |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + ALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_FN1, + KC_LGUI, KC_GRV, KC_LALT,KC_LCTL,LALT(KC_LSFT), + CTL_T(KC_APP), KC_LALT, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + M(CRT_SFT_T), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + MEH_T(KC_NO),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), + KC_FN1, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + LALT(KC_LSFT),KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, + KC_LALT, KC_CAPS, + KC_PGUP, + KC_PGDN,KC_DEL, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | CALC | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Left | Down | Up | Right| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_CALC, + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN,KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + case CRT_SFT_T: + if (record->event.pressed) { + return MACRO(D(LCTL), D(LSFT), T(T), END); + } + return MACRO(U(LCTL), U(LSFT), END); + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; -- cgit v1.2.3-24-g4f1b From 497b92c3bd3ee480e59d08f2a6fb1b780172681c Mon Sep 17 00:00:00 2001 From: Josh Colbeck Date: Mon, 4 Jul 2016 15:22:13 -0500 Subject: Added macro and readme macros to for often used eclipse shortcuts --- keyboards/ergodox_ez/keymaps/josh/keymap.c | 50 ++++++++++++++++++----------- keyboards/ergodox_ez/keymaps/josh/readme.md | 8 +++++ 2 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 keyboards/ergodox_ez/keymaps/josh/readme.md diff --git a/keyboards/ergodox_ez/keymaps/josh/keymap.c b/keyboards/ergodox_ez/keymaps/josh/keymap.c index 4233f7f69..4ad229182 100644 --- a/keyboards/ergodox_ez/keymaps/josh/keymap.c +++ b/keyboards/ergodox_ez/keymaps/josh/keymap.c @@ -7,21 +7,23 @@ #define MDIA 2 // media keys //macros -#define CRT_SFT_T 100 +#define CTL_SFT_T 100 +#define CTL_SFT_G 101 +#define CTL_ALT_T 102 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | ESC | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | M 100| 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | Meh | | Meh | Y | U | I | O | P | \ | + * |TAB /Alt| Q | W | E | R | T | Meh | | Meh | Y | U | I | O | P |\ / ALT | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | LCTL | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / CTL | * |--------+------+------+------+------+------| ~L1 | | ~L1 |------+------+------+------+------+--------| * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | WIN | ` | LALT | LCTL |AltShf| |AltShf| Left | Down | Up | Right | + * | WIN | ` | M 102| M 101|AltShf| |AltShf| Left | Down | Up | Right | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | App | LALT | | Alt | CAPS | @@ -39,12 +41,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_FN1, - KC_LGUI, KC_GRV, KC_LALT,KC_LCTL,LALT(KC_LSFT), + KC_LGUI, KC_GRV, M(CTL_ALT_T),M(CTL_SFT_G),LALT(KC_LSFT), CTL_T(KC_APP), KC_LALT, KC_HOME, KC_SPC,KC_BSPC,KC_END, // right hand - M(CRT_SFT_T), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + M(CTL_SFT_T),KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, MEH_T(KC_NO),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), KC_FN1, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, @@ -145,19 +147,31 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function - switch(id) { + switch(id) { case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case CRT_SFT_T: - if (record->event.pressed) { - return MACRO(D(LCTL), D(LSFT), T(T), END); - } - return MACRO(U(LCTL), U(LSFT), END); - break; - } + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + case CTL_SFT_T: + if (record->event.pressed) { + return MACRO(D(LCTL), D(LSFT), T(T), END); + } + return MACRO(U(LCTL), U(LSFT), END); + break; + case CTL_SFT_G: + if (record->event.pressed) { + return MACRO(D(LCTL), D(LSFT), T(G), END); + } + return MACRO(U(LCTL), U(LSFT), END); + break; + case CTL_ALT_T: + if (record->event.pressed) { + return MACRO(D(LCTL), D(LALT), T(T), END); + } + return MACRO(U(LCTL), U(LALT), END); + break; + } return MACRO_NONE; }; diff --git a/keyboards/ergodox_ez/keymaps/josh/readme.md b/keyboards/ergodox_ez/keymaps/josh/readme.md new file mode 100644 index 000000000..cee19d47e --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/josh/readme.md @@ -0,0 +1,8 @@ +Layout is based on the default layout that comes on the ergodox infinity. Focused mostly on making ctl and alt easy to reach. I spend most my day working in Eclipse which has just so many 3 key shortcuts. + +* Removed numpad keys from symbol layer (I don't use them) +* Added arrow keys under h, j, k, l on symbol layer. vi movement keys! +* Added a few macros for eclipse hotkeys that I used all the time +* Added calc button on symbol layer +* tap vs hold on tab and \. Gives alt, ctl and shift on both sides of the keyboard + -- cgit v1.2.3-24-g4f1b From 94d3159d9dbdf711b830c6d7c5a53324097be0a5 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 4 Jul 2016 22:06:22 -0400 Subject: correct break/return order for planck and preonic defaults --- keyboards/planck/keymaps/default/keymap.c | 16 ++++++++-------- keyboards/preonic/keymaps/default/keymap.c | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index 9b4b33f82..5f71ae7d1 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c @@ -197,8 +197,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif persistant_default_layer_set(1UL<<_QWERTY); } - break; return false; + break; case COLEMAK: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -206,8 +206,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif persistant_default_layer_set(1UL<<_COLEMAK); } - break; return false; + break; case DVORAK: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -215,8 +215,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif persistant_default_layer_set(1UL<<_DVORAK); } - break; return false; + break; case LOWER: if (record->event.pressed) { layer_on(_LOWER); @@ -225,8 +225,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); } - break; return false; + break; case RAISE: if (record->event.pressed) { layer_on(_RAISE); @@ -235,8 +235,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_RAISE); update_tri_layer(_LOWER, _RAISE, _ADJUST); } - break; return false; + break; case BACKLIT: if (record->event.pressed) { register_code(KC_RSFT); @@ -246,8 +246,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { unregister_code(KC_RSFT); } - break; return false; + break; case PLOVER: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -265,8 +265,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { keymap_config.nkro = 1; eeconfig_update_keymap(keymap_config.raw); } - break; return false; + break; case EXT_PLV: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -274,8 +274,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif layer_off(_PLOVER); } - break; return false; + break; } return true; } diff --git a/keyboards/preonic/keymaps/default/keymap.c b/keyboards/preonic/keymaps/default/keymap.c index 6d8ef634d..9a957f7ee 100644 --- a/keyboards/preonic/keymaps/default/keymap.c +++ b/keyboards/preonic/keymaps/default/keymap.c @@ -191,8 +191,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif persistant_default_layer_set(1UL<<_QWERTY); } - break; return false; + break; case COLEMAK: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -200,8 +200,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif persistant_default_layer_set(1UL<<_COLEMAK); } - break; return false; + break; case DVORAK: if (record->event.pressed) { #ifdef AUDIO_ENABLE @@ -209,8 +209,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif persistant_default_layer_set(1UL<<_DVORAK); } - break; return false; + break; case LOWER: if (record->event.pressed) { layer_on(_LOWER); @@ -219,8 +219,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); } - break; return false; + break; case RAISE: if (record->event.pressed) { layer_on(_RAISE); @@ -229,8 +229,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_RAISE); update_tri_layer(_LOWER, _RAISE, _ADJUST); } - break; return false; + break; case BACKLIT: if (record->event.pressed) { register_code(KC_RSFT); @@ -240,8 +240,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { unregister_code(KC_RSFT); } - break; return false; + break; } return true; }; -- cgit v1.2.3-24-g4f1b From 1412076df68ac00f9a00173977d2826603c12ddf Mon Sep 17 00:00:00 2001 From: Smilliam Date: Mon, 4 Jul 2016 19:56:08 -0700 Subject: Allow Space Cadet state to be canceled by alternate Shift key Allows you to press RSHIFT to cancel the insertion of a "(" when holding down LSHIFT. Alternatively, allows you to press LSHIFT to cancel the insertion of a ")" when holding down RSHIFT. This change enables you to renege from outputting a character should you press a shift key erroneously. --- quantum/quantum.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/quantum/quantum.c b/quantum/quantum.c index d59bd5a3f..65290338d 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -162,6 +162,10 @@ bool process_record_quantum(keyrecord_t *record) { register_mods(MOD_BIT(KC_LSFT)); } else { + if (get_mods() & MOD_BIT(KC_RSFT)) { + shift_interrupted[0] = true; + shift_interrupted[1] = true; + } if (!shift_interrupted[0]) { register_code(LSPO_KEY); unregister_code(LSPO_KEY); @@ -178,6 +182,10 @@ bool process_record_quantum(keyrecord_t *record) { register_mods(MOD_BIT(KC_RSFT)); } else { + if (get_mods() & MOD_BIT(KC_LSFT)) { + shift_interrupted[0] = true; + shift_interrupted[1] = true; + } if (!shift_interrupted[1]) { register_code(RSPC_KEY); unregister_code(RSPC_KEY); -- cgit v1.2.3-24-g4f1b From 6b0c9cc905c0985f96a80306cf5fe0d6724b28fc Mon Sep 17 00:00:00 2001 From: Smilliam Date: Mon, 4 Jul 2016 19:58:26 -0700 Subject: fixed indentation. --- quantum/quantum.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 65290338d..71c3c723b 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -162,10 +162,10 @@ bool process_record_quantum(keyrecord_t *record) { register_mods(MOD_BIT(KC_LSFT)); } else { - if (get_mods() & MOD_BIT(KC_RSFT)) { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - } + if (get_mods() & MOD_BIT(KC_RSFT)) { + shift_interrupted[0] = true; + shift_interrupted[1] = true; + } if (!shift_interrupted[0]) { register_code(LSPO_KEY); unregister_code(LSPO_KEY); @@ -182,10 +182,10 @@ bool process_record_quantum(keyrecord_t *record) { register_mods(MOD_BIT(KC_RSFT)); } else { - if (get_mods() & MOD_BIT(KC_LSFT)) { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - } + if (get_mods() & MOD_BIT(KC_LSFT)) { + shift_interrupted[0] = true; + shift_interrupted[1] = true; + } if (!shift_interrupted[1]) { register_code(RSPC_KEY); unregister_code(RSPC_KEY); -- cgit v1.2.3-24-g4f1b From b11657d1c8a3360779b6b412806d89ca3175fc5f Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 5 Jul 2016 13:48:12 +0300 Subject: Suprojects for ChibiOS testing --- keyboards/chibios_test/Makefile | 14 + keyboards/chibios_test/chibios_test.c | 1 + keyboards/chibios_test/chibios_test.h | 6 + keyboards/chibios_test/config.h | 76 +++ keyboards/chibios_test/keymaps/default/keymap.c | 25 + keyboards/chibios_test/stm32_f072_onekey/Makefile | 41 ++ .../stm32_f072_onekey/bootloader_defs.h | 7 + keyboards/chibios_test/stm32_f072_onekey/chconf.h | 524 +++++++++++++++++++++ keyboards/chibios_test/stm32_f072_onekey/config.h | 7 + keyboards/chibios_test/stm32_f072_onekey/halconf.h | 353 ++++++++++++++ keyboards/chibios_test/stm32_f072_onekey/led.c | 34 ++ keyboards/chibios_test/stm32_f072_onekey/matrix.c | 163 +++++++ keyboards/chibios_test/stm32_f072_onekey/mcuconf.h | 171 +++++++ .../stm32_f072_onekey/stm32_f072_onekey.c | 1 + .../stm32_f072_onekey/stm32_f072_onekey.h | 5 + keyboards/chibios_test/stm32_f103_onekey/Makefile | 52 ++ .../boards/GENERIC_STM32_F103/board.c | 49 ++ .../boards/GENERIC_STM32_F103/board.h | 166 +++++++ .../boards/GENERIC_STM32_F103/board.mk | 5 + .../GENERIC_STM32_F103/mini_stm32_mapping.png | Bin 0 -> 162908 bytes .../boards/maple_mini_mapping.png | Bin 0 -> 237977 bytes .../stm32_f103_onekey/bootloader_defs.h | 10 + keyboards/chibios_test/stm32_f103_onekey/chconf.h | 524 +++++++++++++++++++++ keyboards/chibios_test/stm32_f103_onekey/config.h | 6 + keyboards/chibios_test/stm32_f103_onekey/flash.sh | 2 + keyboards/chibios_test/stm32_f103_onekey/halconf.h | 353 ++++++++++++++ .../ld/STM32F103x8_stm32duino_bootloader.ld | 88 ++++ keyboards/chibios_test/stm32_f103_onekey/led.c | 43 ++ keyboards/chibios_test/stm32_f103_onekey/matrix.c | 177 +++++++ keyboards/chibios_test/stm32_f103_onekey/mcuconf.h | 209 ++++++++ .../stm32_f103_onekey/stm32_f103_onekey.c | 1 + .../stm32_f103_onekey/stm32_f103_onekey.h | 4 + keyboards/chibios_test/teensy_lc_onekey/Makefile | 49 ++ .../chibios_test/teensy_lc_onekey/Makefile.3.0 | 77 +++ .../chibios_test/teensy_lc_onekey/Makefile.3.2 | 77 +++ keyboards/chibios_test/teensy_lc_onekey/chconf.h | 524 +++++++++++++++++++++ keyboards/chibios_test/teensy_lc_onekey/config.h | 6 + keyboards/chibios_test/teensy_lc_onekey/halconf.h | 187 ++++++++ .../chibios_test/teensy_lc_onekey/instructions.md | 82 ++++ .../chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld | 105 +++++ keyboards/chibios_test/teensy_lc_onekey/led.c | 32 ++ keyboards/chibios_test/teensy_lc_onekey/matrix.c | 163 +++++++ keyboards/chibios_test/teensy_lc_onekey/mcuconf.h | 55 +++ .../teensy_lc_onekey/teensy_lc_onekey.c | 1 + .../teensy_lc_onekey/teensy_lc_onekey.h | 4 + keyboards/stm32_f072_onekey/Makefile | 50 -- keyboards/stm32_f072_onekey/bootloader_defs.h | 7 - keyboards/stm32_f072_onekey/chconf.h | 524 --------------------- keyboards/stm32_f072_onekey/config.h | 76 --- keyboards/stm32_f072_onekey/halconf.h | 353 -------------- .../stm32_f072_onekey/keymaps/default/keymap.c | 25 - keyboards/stm32_f072_onekey/led.c | 34 -- keyboards/stm32_f072_onekey/matrix.c | 163 ------- keyboards/stm32_f072_onekey/mcuconf.h | 171 ------- keyboards/stm32_f072_onekey/stm32_f072_onekey.c | 1 - keyboards/stm32_f072_onekey/stm32_f072_onekey.h | 5 - keyboards/stm32_f103_onekey/Makefile | 64 --- .../boards/GENERIC_STM32_F103/board.c | 49 -- .../boards/GENERIC_STM32_F103/board.h | 166 ------- .../boards/GENERIC_STM32_F103/board.mk | 5 - .../GENERIC_STM32_F103/mini_stm32_mapping.png | Bin 162908 -> 0 bytes .../boards/maple_mini_mapping.png | Bin 237977 -> 0 bytes keyboards/stm32_f103_onekey/bootloader_defs.h | 10 - keyboards/stm32_f103_onekey/chconf.h | 524 --------------------- keyboards/stm32_f103_onekey/config.h | 75 --- keyboards/stm32_f103_onekey/flash.sh | 2 - keyboards/stm32_f103_onekey/halconf.h | 353 -------------- .../stm32_f103_onekey/keymaps/default/keymap.c | 25 - .../ld/STM32F103x8_stm32duino_bootloader.ld | 88 ---- keyboards/stm32_f103_onekey/led.c | 43 -- keyboards/stm32_f103_onekey/matrix.c | 177 ------- keyboards/stm32_f103_onekey/mcuconf.h | 209 -------- keyboards/stm32_f103_onekey/stm32_f103_onekey.c | 1 - keyboards/stm32_f103_onekey/stm32_f103_onekey.h | 4 - keyboards/teensy_lc_onekey/Makefile | 62 --- keyboards/teensy_lc_onekey/Makefile.3.0 | 77 --- keyboards/teensy_lc_onekey/Makefile.3.2 | 77 --- keyboards/teensy_lc_onekey/chconf.h | 524 --------------------- keyboards/teensy_lc_onekey/config.h | 75 --- keyboards/teensy_lc_onekey/halconf.h | 187 -------- keyboards/teensy_lc_onekey/instructions.md | 82 ---- .../teensy_lc_onekey/keymaps/default/keymap.c | 32 -- keyboards/teensy_lc_onekey/ld/MKL26Z64.ld | 105 ----- keyboards/teensy_lc_onekey/led.c | 32 -- keyboards/teensy_lc_onekey/matrix.c | 163 ------- keyboards/teensy_lc_onekey/mcuconf.h | 55 --- keyboards/teensy_lc_onekey/teensy_lc_onekey.c | 1 - keyboards/teensy_lc_onekey/teensy_lc_onekey.h | 4 - 88 files changed, 4479 insertions(+), 4680 deletions(-) create mode 100644 keyboards/chibios_test/Makefile create mode 100644 keyboards/chibios_test/chibios_test.c create mode 100644 keyboards/chibios_test/chibios_test.h create mode 100644 keyboards/chibios_test/config.h create mode 100644 keyboards/chibios_test/keymaps/default/keymap.c create mode 100644 keyboards/chibios_test/stm32_f072_onekey/Makefile create mode 100644 keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h create mode 100644 keyboards/chibios_test/stm32_f072_onekey/chconf.h create mode 100644 keyboards/chibios_test/stm32_f072_onekey/config.h create mode 100644 keyboards/chibios_test/stm32_f072_onekey/halconf.h create mode 100644 keyboards/chibios_test/stm32_f072_onekey/led.c create mode 100644 keyboards/chibios_test/stm32_f072_onekey/matrix.c create mode 100644 keyboards/chibios_test/stm32_f072_onekey/mcuconf.h create mode 100644 keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c create mode 100644 keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h create mode 100644 keyboards/chibios_test/stm32_f103_onekey/Makefile create mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c create mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h create mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk create mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png create mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/maple_mini_mapping.png create mode 100644 keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h create mode 100644 keyboards/chibios_test/stm32_f103_onekey/chconf.h create mode 100644 keyboards/chibios_test/stm32_f103_onekey/config.h create mode 100755 keyboards/chibios_test/stm32_f103_onekey/flash.sh create mode 100644 keyboards/chibios_test/stm32_f103_onekey/halconf.h create mode 100644 keyboards/chibios_test/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld create mode 100644 keyboards/chibios_test/stm32_f103_onekey/led.c create mode 100644 keyboards/chibios_test/stm32_f103_onekey/matrix.c create mode 100644 keyboards/chibios_test/stm32_f103_onekey/mcuconf.h create mode 100644 keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c create mode 100644 keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h create mode 100644 keyboards/chibios_test/teensy_lc_onekey/Makefile create mode 100644 keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 create mode 100644 keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 create mode 100644 keyboards/chibios_test/teensy_lc_onekey/chconf.h create mode 100644 keyboards/chibios_test/teensy_lc_onekey/config.h create mode 100644 keyboards/chibios_test/teensy_lc_onekey/halconf.h create mode 100644 keyboards/chibios_test/teensy_lc_onekey/instructions.md create mode 100644 keyboards/chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld create mode 100644 keyboards/chibios_test/teensy_lc_onekey/led.c create mode 100644 keyboards/chibios_test/teensy_lc_onekey/matrix.c create mode 100644 keyboards/chibios_test/teensy_lc_onekey/mcuconf.h create mode 100644 keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c create mode 100644 keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h delete mode 100644 keyboards/stm32_f072_onekey/Makefile delete mode 100644 keyboards/stm32_f072_onekey/bootloader_defs.h delete mode 100644 keyboards/stm32_f072_onekey/chconf.h delete mode 100644 keyboards/stm32_f072_onekey/config.h delete mode 100644 keyboards/stm32_f072_onekey/halconf.h delete mode 100644 keyboards/stm32_f072_onekey/keymaps/default/keymap.c delete mode 100644 keyboards/stm32_f072_onekey/led.c delete mode 100644 keyboards/stm32_f072_onekey/matrix.c delete mode 100644 keyboards/stm32_f072_onekey/mcuconf.h delete mode 100644 keyboards/stm32_f072_onekey/stm32_f072_onekey.c delete mode 100644 keyboards/stm32_f072_onekey/stm32_f072_onekey.h delete mode 100644 keyboards/stm32_f103_onekey/Makefile delete mode 100644 keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c delete mode 100644 keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h delete mode 100644 keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk delete mode 100644 keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png delete mode 100644 keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png delete mode 100644 keyboards/stm32_f103_onekey/bootloader_defs.h delete mode 100644 keyboards/stm32_f103_onekey/chconf.h delete mode 100644 keyboards/stm32_f103_onekey/config.h delete mode 100755 keyboards/stm32_f103_onekey/flash.sh delete mode 100644 keyboards/stm32_f103_onekey/halconf.h delete mode 100644 keyboards/stm32_f103_onekey/keymaps/default/keymap.c delete mode 100644 keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld delete mode 100644 keyboards/stm32_f103_onekey/led.c delete mode 100644 keyboards/stm32_f103_onekey/matrix.c delete mode 100644 keyboards/stm32_f103_onekey/mcuconf.h delete mode 100644 keyboards/stm32_f103_onekey/stm32_f103_onekey.c delete mode 100644 keyboards/stm32_f103_onekey/stm32_f103_onekey.h delete mode 100644 keyboards/teensy_lc_onekey/Makefile delete mode 100644 keyboards/teensy_lc_onekey/Makefile.3.0 delete mode 100644 keyboards/teensy_lc_onekey/Makefile.3.2 delete mode 100644 keyboards/teensy_lc_onekey/chconf.h delete mode 100644 keyboards/teensy_lc_onekey/config.h delete mode 100644 keyboards/teensy_lc_onekey/halconf.h delete mode 100644 keyboards/teensy_lc_onekey/instructions.md delete mode 100644 keyboards/teensy_lc_onekey/keymaps/default/keymap.c delete mode 100644 keyboards/teensy_lc_onekey/ld/MKL26Z64.ld delete mode 100644 keyboards/teensy_lc_onekey/led.c delete mode 100644 keyboards/teensy_lc_onekey/matrix.c delete mode 100644 keyboards/teensy_lc_onekey/mcuconf.h delete mode 100644 keyboards/teensy_lc_onekey/teensy_lc_onekey.c delete mode 100644 keyboards/teensy_lc_onekey/teensy_lc_onekey.h diff --git a/keyboards/chibios_test/Makefile b/keyboards/chibios_test/Makefile new file mode 100644 index 000000000..d9f2b8b83 --- /dev/null +++ b/keyboards/chibios_test/Makefile @@ -0,0 +1,14 @@ +SUBPROJECT_DEFAULT = stm32_f072_onekey + +#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 + +ifndef QUANTUM_DIR + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/chibios_test/chibios_test.c b/keyboards/chibios_test/chibios_test.c new file mode 100644 index 000000000..efe2d4a5d --- /dev/null +++ b/keyboards/chibios_test/chibios_test.c @@ -0,0 +1 @@ +#include "chibios_test.h" diff --git a/keyboards/chibios_test/chibios_test.h b/keyboards/chibios_test/chibios_test.h new file mode 100644 index 000000000..25b031771 --- /dev/null +++ b/keyboards/chibios_test/chibios_test.h @@ -0,0 +1,6 @@ +#ifndef KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_ +#define KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_ + +#include "quantum.h" + +#endif /* KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_ */ diff --git a/keyboards/chibios_test/config.h b/keyboards/chibios_test/config.h new file mode 100644 index 000000000..210f15067 --- /dev/null +++ b/keyboards/chibios_test/config.h @@ -0,0 +1,76 @@ +/* +Copyright 2015 Jun Wako + +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 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER "QMK" +#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' +#define PRODUCT "ChibiOS QMK test" +#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00' +#define DESCRIPTION "QMK keyboard firmware test for ChibiOS" + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 1 +#define DIODE_DIRECTION COL2ROW + +/* 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)) \ +) + + + +/* + * 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 + +#endif diff --git a/keyboards/chibios_test/keymaps/default/keymap.c b/keyboards/chibios_test/keymaps/default/keymap.c new file mode 100644 index 000000000..239d70007 --- /dev/null +++ b/keyboards/chibios_test/keymaps/default/keymap.c @@ -0,0 +1,25 @@ +/* +Copyright 2012,2013 Jun Wako + +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 . +*/ + +#include "chibios_test.h" + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD +}; + +const uint16_t fn_actions[] = { +}; diff --git a/keyboards/chibios_test/stm32_f072_onekey/Makefile b/keyboards/chibios_test/stm32_f072_onekey/Makefile new file mode 100644 index 000000000..eae38c4b2 --- /dev/null +++ b/keyboards/chibios_test/stm32_f072_onekey/Makefile @@ -0,0 +1,41 @@ +# project specific files +SRC = matrix.c \ + led.c + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F072xB +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx +# it should exist either in /os/hal/boards/ +# or /boards +BOARD = ST_STM32F072B_DISCOVERY +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m0 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + +# Build Options +# comment out to disable the options. +# +ifndef QUANTUM_DIR + include ../../../Makefile +endif diff --git a/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h b/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h new file mode 100644 index 000000000..02c48c4e6 --- /dev/null +++ b/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/chibios_test/stm32_f072_onekey/chconf.h b/keyboards/chibios_test/stm32_f072_onekey/chconf.h new file mode 100644 index 000000000..99fa8ce39 --- /dev/null +++ b/keyboards/chibios_test/stm32_f072_onekey/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE FALSE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP FALSE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/chibios_test/stm32_f072_onekey/config.h b/keyboards/chibios_test/stm32_f072_onekey/config.h new file mode 100644 index 000000000..bbaf0dc4b --- /dev/null +++ b/keyboards/chibios_test/stm32_f072_onekey/config.h @@ -0,0 +1,7 @@ +#ifndef KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_ +#define KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_ + +#include "../config.h" + + +#endif /* KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_ */ diff --git a/keyboards/chibios_test/stm32_f072_onekey/halconf.h b/keyboards/chibios_test/stm32_f072_onekey/halconf.h new file mode 100644 index 000000000..1a450d632 --- /dev/null +++ b/keyboards/chibios_test/stm32_f072_onekey/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 256 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/chibios_test/stm32_f072_onekey/led.c b/keyboards/chibios_test/stm32_f072_onekey/led.c new file mode 100644 index 000000000..18edb8ba8 --- /dev/null +++ b/keyboards/chibios_test/stm32_f072_onekey/led.c @@ -0,0 +1,34 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include "hal.h" + +#include "led.h" + + +void led_set(uint8_t usb_led) +{ + (void)usb_led; + if (usb_led & (1< + +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 . +*/ + +#include "ch.h" +#include "hal.h" + +/* + * scan matrix + */ +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "wait.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +#define LED_ON() do { palSetPad(GPIOC, GPIOC_LED_BLUE) ;} while (0) +#define LED_OFF() do { palClearPad(GPIOC, GPIOC_LED_BLUE); } while (0) +#define LED_TGL() do { palTogglePad(GPIOC, GPIOC_LED_BLUE); } while (0) + +void matrix_init(void) +{ + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + //debug + debug_matrix = true; + LED_ON(); + wait_ms(500); + LED_OFF(); +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + wait_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +ifndef QUANTUM_DIR + include ../../../Makefile +endif diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 000000000..31319ef57 --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,49 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { +} diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 000000000..7253e7782 --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOC_LED 13 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 000000000..d692c0ee4 --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png new file mode 100644 index 000000000..c44a7d9eb Binary files /dev/null and b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png differ diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/maple_mini_mapping.png b/keyboards/chibios_test/stm32_f103_onekey/boards/maple_mini_mapping.png new file mode 100644 index 000000000..12cfa81db Binary files /dev/null and b/keyboards/chibios_test/stm32_f103_onekey/boards/maple_mini_mapping.png differ diff --git a/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h b/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h new file mode 100644 index 000000000..0f45203cb --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/chibios_test/stm32_f103_onekey/chconf.h b/keyboards/chibios_test/stm32_f103_onekey/chconf.h new file mode 100644 index 000000000..dfb1f9dfb --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 16 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 2000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/chibios_test/stm32_f103_onekey/config.h b/keyboards/chibios_test/stm32_f103_onekey/config.h new file mode 100644 index 000000000..de0b906f3 --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/config.h @@ -0,0 +1,6 @@ +#ifndef KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_ +#define KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_ + +#include "../config.h" + +#endif /* KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_ */ diff --git a/keyboards/chibios_test/stm32_f103_onekey/flash.sh b/keyboards/chibios_test/stm32_f103_onekey/flash.sh new file mode 100755 index 000000000..15501dfa5 --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/flash.sh @@ -0,0 +1,2 @@ +#!/bin/bash +Arduino_STM32_usb_hid/tools/linux/maple_upload ttyACM0 2 1EAF:0003 build/ch.bin diff --git a/keyboards/chibios_test/stm32_f103_onekey/halconf.h b/keyboards/chibios_test/stm32_f103_onekey/halconf.h new file mode 100644 index 000000000..1a450d632 --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 256 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/chibios_test/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/chibios_test/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 000000000..00613328e --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 128k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/chibios_test/stm32_f103_onekey/led.c b/keyboards/chibios_test/stm32_f103_onekey/led.c new file mode 100644 index 000000000..f5c55f7d9 --- /dev/null +++ b/keyboards/chibios_test/stm32_f103_onekey/led.c @@ -0,0 +1,43 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include "hal.h" +#include "led.h" + + +void led_set(uint8_t usb_led) +{ + if (usb_led & (1< + +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 . +*/ + +#include "ch.h" +#include "hal.h" + +/* + * scan matrix + */ +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "wait.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +/* generic STM32F103C8T6 board */ +#ifdef BOARD_GENERIC_STM32_F103 +#define LED_ON() do { palClearPad(GPIOC, GPIOC_LED) ;} while (0) +#define LED_OFF() do { palSetPad(GPIOC, GPIOC_LED); } while (0) +#define LED_TGL() do { palTogglePad(GPIOC, GPIOC_LED); } while (0) +#endif + +/* Maple Mini */ +#ifdef BOARD_MAPLEMINI_STM32_F103 +#define LED_ON() do { palSetPad(GPIOB, 1) ;} while (0) +#define LED_OFF() do { palClearPad(GPIOB, 1); } while (0) +#define LED_TGL() do { palTogglePad(GPIOB, 1); } while (0) +#endif + +void matrix_init(void) +{ + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + //debug + debug_matrix = true; + LED_ON(); + wait_ms(500); + LED_OFF(); +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + wait_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +MCU_FAMILY = KINETIS +MCU_SERIES = KL2x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +MCU_LDSCRIPT = MKL26Z64 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 +# - k20x7 for Teensy 3.1 and 3.2 +MCU_STARTUP = kl2x + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +BOARD = PJRC_TEENSY_LC + +# Cortex version +# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4 +MCU = cortex-m0plus + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +ARMV = 6 + +ifndef QUANTUM_DIR + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 new file mode 100644 index 000000000..dbf12c363 --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 @@ -0,0 +1,77 @@ +# Target file name (without extension). +PROJECT = ch + +# Directory common source files exist +TMK_DIR = ../../tmk_core + +# Directory keyboard dependent files exist +TARGET_DIR = . + +# project specific files +SRC = matrix.c \ + led.c + +ifdef KEYMAP + SRC := keymap_$(KEYMAP).c $(SRC) +else + SRC := keymap_plain.c $(SRC) +endif + +CONFIG_H = config.h + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +MCU_FAMILY = KINETIS +MCU_SERIES = K20x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +MCU_LDSCRIPT = MK20DX128 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 +# - k20x7 for Teensy 3.1 and 3.2 +MCU_STARTUP = k20x5 + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +BOARD = PJRC_TEENSY_3 + +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +ARMV = 7 + +# 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 + +include $(TMK_DIR)/tool/chibios/common.mk +include $(TMK_DIR)/tool/chibios/chibios.mk diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 new file mode 100644 index 000000000..41bfa41a0 --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 @@ -0,0 +1,77 @@ +# Target file name (without extension). +PROJECT = ch + +# Directory common source files exist +TMK_DIR = ../../tmk_core + +# Directory keyboard dependent files exist +TARGET_DIR = . + +# project specific files +SRC = matrix.c \ + led.c + +ifdef KEYMAP + SRC := keymap_$(KEYMAP).c $(SRC) +else + SRC := keymap_plain.c $(SRC) +endif + +CONFIG_H = config.h + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +MCU_FAMILY = KINETIS +MCU_SERIES = K20x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +MCU_LDSCRIPT = MK20DX256 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 +# - k20x7 for Teensy 3.1 and 3.2 +MCU_STARTUP = k20x7 + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +BOARD = PJRC_TEENSY_3_1 + +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +ARMV = 7 + +# 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 + +include $(TMK_DIR)/tool/chibios/common.mk +include $(TMK_DIR)/tool/chibios/chibios.mk diff --git a/keyboards/chibios_test/teensy_lc_onekey/chconf.h b/keyboards/chibios_test/teensy_lc_onekey/chconf.h new file mode 100644 index 000000000..cb36996c3 --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 1000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 20 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK TRUE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS TRUE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS TRUE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS TRUE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/chibios_test/teensy_lc_onekey/config.h b/keyboards/chibios_test/teensy_lc_onekey/config.h new file mode 100644 index 000000000..d9eb05d2a --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/config.h @@ -0,0 +1,6 @@ +#ifndef KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_ +#define KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_ + +#include "../config.h" + +#endif /* KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_ */ diff --git a/keyboards/chibios_test/teensy_lc_onekey/halconf.h b/keyboards/chibios_test/teensy_lc_onekey/halconf.h new file mode 100644 index 000000000..b1d2cd550 --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/halconf.h @@ -0,0 +1,187 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/chibios_test/teensy_lc_onekey/instructions.md b/keyboards/chibios_test/teensy_lc_onekey/instructions.md new file mode 100644 index 000000000..16886a015 --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/instructions.md @@ -0,0 +1,82 @@ +# Teensy LC, 3.0, 3.1, 3.2 support + +These ARM Teensies are now supported through [ChibiOS](http://chibios.org). + +You'll need to install an ARM toolchain, for instance from [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output. This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting. + +Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS). If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-`) to `tmk_core/tool/chibios/chibios` (so that the file `tmk_core/tool/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-` to `tmk_core/tool/chibios/chibios-contrib`. + +(If you're using git, you can just clone the two repos: [chibios](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS-Contrib). However - be warned that things may be somewhat out-of-sync (updates at different rates), so you may need to hunt a bit for the right commits.) + +(Why do we need chibios-contrib? Well, the main repo focuses on STM32 chips, and Freescale/NXP Kinetis chips are supported via the Contrib repository.) + +This should be it. Running `make` in `keyboard/teensy_lc_onekey` should create a working firmware in `build/`, called `ch.hex`. + +For more notes about the ChibiOS backend in TMK, see `tmk_core/protocol/chibios/README.md`. + +## About this onekey example + +It's set up for Teensy LC. To use 3.x, you'll need to edit the `Makefile` (and comment out one line in `mcuconf.h`). A sample makefile for Teensy 3.0 is provided as `Makefile.3.0`, can be used without renaming with `make -f Makefile.3.0`. Similarly for Teensy 3.2, there's `Makefile.3.2`. + +## Credits + +TMK itself is written by hasu, original sources [here](https://github.com/tmk/tmk_keyboard). + +The USB support for Kinetis MCUs is due to RedoX. His ChibiOS fork is also [on github](https://github.com/RedoXyde/ChibiOS); but it doesn't include Teensy LC definitions. + +## Features that are not implemented yet + +Currently only the more fancy suspend features are not there (power saving during suspend). The rest should work fine (reports either way are welcome). + +# Matrix programming notes + +The notes below explain what commands can be used to examine and set the status of Teensy pins. + +## ChibiOS pin manipulation basics + +### Pins + +Each pin sits on a "port", each of which comprises at most 32 individual pins. +So for instance "PTC5" from Kinetis manual/datasheet refers to port C (or GPIOA), pin 5. Most functions dealing with pins take 2 parameters which specify the pin -- the first being the port, the second being the pin number. + +Within ChibiOS, there are definitions which simplify this a bit for the Teensies. `TEENSY_PINn_IOPORT` represents the port of the MCU's pin connected Teensy's PIN `n`, and `TEENSY_PINn` represents its MCU's pin number. + +### Mode + +A MCU pin can be in several modes. The basic command to set a pin mode is + + palSetPadMode(TEENSY_PINn_IOPORT, TEENSY_PINn, PAL_MODE_INPUT_PULLUP); + +The last parameter is the mode. For keyboards, the usual ones that are used are `PAL_MODE_INPUT_PULLUP` (input with a pullup), `PAL_MODE_INPUT_PULLDOWN` (input with a pulldown), `PAL_MODE_INPUT` (input floating, a.k.a. Hi-Z), `PAL_MODE_OUTPUT_PUSHPULL` (output in the Arduino sense -- can be then set HIGH or LOW). + +### Setting + +Pins are set HIGH (after they've been put into `OUTPUT_PUSHPULL` mode) by + + palSetPad(TEENSY_PINn_IOPORT, TEENSY_PINn); + +or set LOW by + + palClearPad(TEENSY_PINn_IOPORT, TEENSY_PINn); + +Toggling can be done with + + palTogglePad(TEENSY_PINn_IOPORT, TEENSY_PINn); + +Alternatively, you can use + + palWritePad(TEENSY_PINn_IOPORT, TEENSY_PINn, bit); + +where `bit` is either `PAL_LOW` or `PAL_HIGH` (i.e. `0` or `1`). + +### Reading + +Reading pin status is done with + + palReadPad(TEENSY_PINn_IOPORT, TEENSY_PINn); + +The function returns either `PAL_HIGH` (actually `1`) or `PAL_LOW` (actually `0`). + +### Further docs + +All the commands that are available for pin manipulation through ChibiOS HAL are documented in [ChibiOS PAL driver docs](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html). diff --git a/keyboards/chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld b/keyboards/chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld new file mode 100644 index 000000000..fb141f888 --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/chibios_test/teensy_lc_onekey/led.c b/keyboards/chibios_test/teensy_lc_onekey/led.c new file mode 100644 index 000000000..dfa60c107 --- /dev/null +++ b/keyboards/chibios_test/teensy_lc_onekey/led.c @@ -0,0 +1,32 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include "hal.h" + +#include "led.h" + + +void led_set(uint8_t usb_led) { + if (usb_led & (1< + +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 . +*/ + +#include "ch.h" +#include "hal.h" + +/* + * scan matrix + */ +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "wait.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +#define LED_ON() do { palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13) ;} while (0) +#define LED_OFF() do { palClearPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0) +#define LED_TGL() do { palTogglePad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0) + +void matrix_init(void) +{ + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + //debug + debug_matrix = true; + LED_ON(); + wait_ms(500); + LED_OFF(); +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + wait_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F0xx -# linker script to use -# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -MCU_LDSCRIPT = STM32F072xB -# startup code to use -# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f0xx -# it should exist either in /os/hal/boards/ -# or /boards -BOARD = ST_STM32F072B_DISCOVERY -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m0 -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -ARMV = 6 -# If you want to be able to jump to bootloader from firmware on STM32 MCUs, -# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in -# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have -# a custom board definition that you plan to reuse). -# If you're not setting it here, leave it commented out. -# It is chip dependent, the correct number can be looked up here (page 175): -# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf -# This also requires a patch to chibios: -# /tmk_core/tool/chibios/ch-bootloader-jump.patch -#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 - -# 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 - -ifndef QUANTUM_DIR - include ../../Makefile -endif diff --git a/keyboards/stm32_f072_onekey/bootloader_defs.h b/keyboards/stm32_f072_onekey/bootloader_defs.h deleted file mode 100644 index 02c48c4e6..000000000 --- a/keyboards/stm32_f072_onekey/bootloader_defs.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here (page 175): - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ -#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/stm32_f072_onekey/chconf.h b/keyboards/stm32_f072_onekey/chconf.h deleted file mode 100644 index 99fa8ce39..000000000 --- a/keyboards/stm32_f072_onekey/chconf.h +++ /dev/null @@ -1,524 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 10000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/* Use __WFI in the idle thread for waiting. Does lower the power - * consumption. */ -#define CORTEX_ENABLE_WFI_IDLE TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM FALSE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE FALSE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP FALSE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS FALSE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief Trace buffer entries. - * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - * different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE 128 - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK FALSE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ - /* Idle-enter code here.*/ \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ - /* Idle-leave code here.*/ \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* CHCONF_H */ - -/** @} */ diff --git a/keyboards/stm32_f072_onekey/config.h b/keyboards/stm32_f072_onekey/config.h deleted file mode 100644 index bb5251e1d..000000000 --- a/keyboards/stm32_f072_onekey/config.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright 2015 Jun Wako - -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 0x6464 -#define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "TMK" -#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' -#define PRODUCT "ChibiOS TMK test" -#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00' -#define DESCRIPTION "TMK keyboard firmware over ChibiOS" - -/* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 1 -#define DIODE_DIRECTION COL2ROW - -/* 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)) \ -) - - - -/* - * 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 - -#endif diff --git a/keyboards/stm32_f072_onekey/halconf.h b/keyboards/stm32_f072_onekey/halconf.h deleted file mode 100644 index 1a450d632..000000000 --- a/keyboards/stm32_f072_onekey/halconf.h +++ /dev/null @@ -1,353 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/keyboards/stm32_f072_onekey/keymaps/default/keymap.c b/keyboards/stm32_f072_onekey/keymaps/default/keymap.c deleted file mode 100644 index 6c48149f8..000000000 --- a/keyboards/stm32_f072_onekey/keymaps/default/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 . -*/ - -#include "stm32_f072_onekey.h" - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD -}; - -const uint16_t fn_actions[] = { -}; diff --git a/keyboards/stm32_f072_onekey/led.c b/keyboards/stm32_f072_onekey/led.c deleted file mode 100644 index 18edb8ba8..000000000 --- a/keyboards/stm32_f072_onekey/led.c +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#include "hal.h" - -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - (void)usb_led; - if (usb_led & (1< - -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 . -*/ - -#include "ch.h" -#include "hal.h" - -/* - * scan matrix - */ -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "wait.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -#define LED_ON() do { palSetPad(GPIOC, GPIOC_LED_BLUE) ;} while (0) -#define LED_OFF() do { palClearPad(GPIOC, GPIOC_LED_BLUE); } while (0) -#define LED_TGL() do { palTogglePad(GPIOC, GPIOC_LED_BLUE); } while (0) - -void matrix_init(void) -{ - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - //debug - debug_matrix = true; - LED_ON(); - wait_ms(500); - LED_OFF(); -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - wait_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - wait_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -MCU_FAMILY = STM32 -MCU_SERIES = STM32F1xx -# linker script to use -# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# startup code to use -# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -MCU_STARTUP = stm32f1xx -# it should exist either in /os/hal/boards/ -# or /boards -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m3 -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -ARMV = 7 -# If you want to be able to jump to bootloader from firmware on STM32 MCUs, -# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in -# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have -# a custom board definition that you plan to reuse). -# If you're not setting it here, leave it commented out. -# It is chip dependent, the correct number can be looked up here (page 175): -# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf -# This also requires a patch to chibios: -# /tmk_core/tool/chibios/ch-bootloader-jump.patch -#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration -## BOOTMAGIC is not supported on STM32 chips yet. -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 ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover -CUSTOM_MATRIX ?= yes # Custom matrix file - -ifndef QUANTUM_DIR - include ../../Makefile -endif diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c b/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c deleted file mode 100644 index 31319ef57..000000000 --- a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -#if HAL_USE_PAL || defined(__DOXYGEN__) -const PALConfig pal_default_config = -{ - {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, - {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, - {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, - {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, - {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, -}; -#endif - -/* - * Early initialization code. - * This initialization must be performed just after stack setup and before - * any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -/* - * Board-specific initialization code. - */ -void boardInit(void) { -} diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h b/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h deleted file mode 100644 index 7253e7782..000000000 --- a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for a Generic STM32F103 board. - */ - -/* - * Board identifier. - */ -#define BOARD_GENERIC_STM32_F103 -#define BOARD_NAME "Generic STM32F103x board" - -/* - * Board frequencies. - */ -#define STM32_LSECLK 32768 -#define STM32_HSECLK 8000000 - -/* - * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. - */ -#define STM32F103xB - -/* - * IO pins assignments - */ - -/* on-board */ - -#define GPIOC_LED 13 -#define GPIOD_OSC_IN 0 -#define GPIOD_OSC_OUT 1 - -/* In case your board has a "USB enable" hardware - controlled by a pin, define it here. (It could be just - a 1.5k resistor connected to D+ line.) -*/ -/* -#define GPIOB_USB_DISC 10 -*/ - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * - * The digits have the following meaning: - * 0 - Analog input. - * 1 - Push Pull output 10MHz. - * 2 - Push Pull output 2MHz. - * 3 - Push Pull output 50MHz. - * 4 - Digital input. - * 5 - Open Drain output 10MHz. - * 6 - Open Drain output 2MHz. - * 7 - Open Drain output 50MHz. - * 8 - Digital input with PullUp or PullDown resistor depending on ODR. - * 9 - Alternate Push Pull output 10MHz. - * A - Alternate Push Pull output 2MHz. - * B - Alternate Push Pull output 50MHz. - * C - Reserved. - * D - Alternate Open Drain output 10MHz. - * E - Alternate Open Drain output 2MHz. - * F - Alternate Open Drain output 50MHz. - * Please refer to the STM32 Reference Manual for details. - */ - -/* - * Port A setup. - * Everything input with pull-up except: - * PA2 - Alternate output (USART2 TX). - * PA3 - Normal input (USART2 RX). - * PA9 - Alternate output (USART1 TX). - * PA10 - Normal input (USART1 RX). - */ -#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ -#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ -#define VAL_GPIOAODR 0xFFFFFFFF - -/* - * Port B setup. - * Everything input with pull-up except: - * PB10 - Push Pull output (USB switch). - */ -#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ -#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ -#define VAL_GPIOBODR 0xFFFFFFFF - -/* - * Port C setup. - * Everything input with pull-up except: - * PC13 - Push Pull output (LED). - */ -#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ -#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ -#define VAL_GPIOCODR 0xFFFFFFFF - -/* - * Port D setup. - * Everything input with pull-up except: - * PD0 - Normal input (XTAL). - * PD1 - Normal input (XTAL). - */ -#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ -#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ -#define VAL_GPIODODR 0xFFFFFFFF - -/* - * Port E setup. - * Everything input with pull-up except: - */ -#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ -#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ -#define VAL_GPIOEODR 0xFFFFFFFF - -/* - * USB bus activation macro, required by the USB driver. - */ -/* The point is that most of the generic STM32F103* boards - have a 1.5k resistor connected on one end to the D+ line - and on the other end to some pin. Or even a slightly more - complicated "USB enable" circuit, controlled by a pin. - That should go here. - - However on some boards (e.g. one that I have), there's no - such hardware. In which case it's better to not do anything. -*/ -/* -#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) -*/ -#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); - -/* - * USB bus de-activation macro, required by the USB driver. - */ -/* -#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) -*/ -#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk b/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk deleted file mode 100644 index d692c0ee4..000000000 --- a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List of all the board related files. -BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c - -# Required include directories -BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png deleted file mode 100644 index c44a7d9eb..000000000 Binary files a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png and /dev/null differ diff --git a/keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png b/keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png deleted file mode 100644 index 12cfa81db..000000000 Binary files a/keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png and /dev/null differ diff --git a/keyboards/stm32_f103_onekey/bootloader_defs.h b/keyboards/stm32_f103_onekey/bootloader_defs.h deleted file mode 100644 index 0f45203cb..000000000 --- a/keyboards/stm32_f103_onekey/bootloader_defs.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Address for jumping to bootloader on STM32 chips. */ -/* It is chip dependent, the correct number can be looked up here (page 175): - * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf - * This also requires a patch to chibios: - * /tmk_core/tool/chibios/ch-bootloader-jump.patch - */ - -// STM32F103* does NOT have an USB bootloader in ROM (only serial), -// so setting anything here does not make much sense -// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/stm32_f103_onekey/chconf.h b/keyboards/stm32_f103_onekey/chconf.h deleted file mode 100644 index dfb1f9dfb..000000000 --- a/keyboards/stm32_f103_onekey/chconf.h +++ /dev/null @@ -1,524 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 16 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 2000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/* Use __WFI in the idle thread for waiting. Does lower the power - * consumption. */ -#define CORTEX_ENABLE_WFI_IDLE TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM FALSE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS FALSE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief Trace buffer entries. - * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - * different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE 128 - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK FALSE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ - /* Idle-enter code here.*/ \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ - /* Idle-leave code here.*/ \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* CHCONF_H */ - -/** @} */ diff --git a/keyboards/stm32_f103_onekey/config.h b/keyboards/stm32_f103_onekey/config.h deleted file mode 100644 index 19b14fe61..000000000 --- a/keyboards/stm32_f103_onekey/config.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2015 Jun Wako - -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 - - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6464 -#define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "TMK" -#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' -#define PRODUCT "ChibiOS TMK test" -#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00' -#define DESCRIPTION "TMK keyboard firmware over ChibiOS" - -/* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 1 -#define DIODE_DIRECTION COL2ROW - -/* 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)) \ -) - - - -/* - * 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 - -#endif diff --git a/keyboards/stm32_f103_onekey/flash.sh b/keyboards/stm32_f103_onekey/flash.sh deleted file mode 100755 index 15501dfa5..000000000 --- a/keyboards/stm32_f103_onekey/flash.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -Arduino_STM32_usb_hid/tools/linux/maple_upload ttyACM0 2 1EAF:0003 build/ch.bin diff --git a/keyboards/stm32_f103_onekey/halconf.h b/keyboards/stm32_f103_onekey/halconf.h deleted file mode 100644 index 1a450d632..000000000 --- a/keyboards/stm32_f103_onekey/halconf.h +++ /dev/null @@ -1,353 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/keyboards/stm32_f103_onekey/keymaps/default/keymap.c b/keyboards/stm32_f103_onekey/keymaps/default/keymap.c deleted file mode 100644 index c3b0f0840..000000000 --- a/keyboards/stm32_f103_onekey/keymaps/default/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 . -*/ - -#include "stm32_f103_onekey.h" - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD -}; - -const uint16_t fn_actions[] = { -}; diff --git a/keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld deleted file mode 100644 index 00613328e..000000000 --- a/keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld +++ /dev/null @@ -1,88 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - * ST32F103xB memory setup for use with the maplemini bootloader. - * You will have to - * #define CORTEX_VTOR_INIT 0x5000 - * in your projects chconf.h - */ -MEMORY -{ - flash0 : org = 0x08002000, len = 128k - 0x2000 - flash1 : org = 0x00000000, len = 0 - flash2 : org = 0x00000000, len = 0 - flash3 : org = 0x00000000, len = 0 - flash4 : org = 0x00000000, len = 0 - flash5 : org = 0x00000000, len = 0 - flash6 : org = 0x00000000, len = 0 - flash7 : org = 0x00000000, len = 0 - ram0 : org = 0x20000000, len = 20k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 -} - -/* For each data/text section two region are defined, a virtual region - and a load region (_LMA suffix).*/ - -/* Flash region to be used for exception vectors.*/ -REGION_ALIAS("VECTORS_FLASH", flash0); -REGION_ALIAS("VECTORS_FLASH_LMA", flash0); - -/* Flash region to be used for constructors and destructors.*/ -REGION_ALIAS("XTORS_FLASH", flash0); -REGION_ALIAS("XTORS_FLASH_LMA", flash0); - -/* Flash region to be used for code text.*/ -REGION_ALIAS("TEXT_FLASH", flash0); -REGION_ALIAS("TEXT_FLASH_LMA", flash0); - -/* Flash region to be used for read only data.*/ -REGION_ALIAS("RODATA_FLASH", flash0); -REGION_ALIAS("RODATA_FLASH_LMA", flash0); - -/* Flash region to be used for various.*/ -REGION_ALIAS("VARIOUS_FLASH", flash0); -REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); - -/* Flash region to be used for RAM(n) initialization data.*/ -REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); - -/* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts.*/ -REGION_ALIAS("MAIN_STACK_RAM", ram0); - -/* RAM region to be used for the process stack. This is the stack used by - the main() function.*/ -REGION_ALIAS("PROCESS_STACK_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); -REGION_ALIAS("DATA_RAM_LMA", flash0); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -/* RAM region to be used for the default heap.*/ -REGION_ALIAS("HEAP_RAM", ram0); - -/* Generic rules inclusion.*/ -INCLUDE rules.ld diff --git a/keyboards/stm32_f103_onekey/led.c b/keyboards/stm32_f103_onekey/led.c deleted file mode 100644 index f5c55f7d9..000000000 --- a/keyboards/stm32_f103_onekey/led.c +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#include "hal.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - if (usb_led & (1< - -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 . -*/ - -#include "ch.h" -#include "hal.h" - -/* - * scan matrix - */ -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "wait.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -/* generic STM32F103C8T6 board */ -#ifdef BOARD_GENERIC_STM32_F103 -#define LED_ON() do { palClearPad(GPIOC, GPIOC_LED) ;} while (0) -#define LED_OFF() do { palSetPad(GPIOC, GPIOC_LED); } while (0) -#define LED_TGL() do { palTogglePad(GPIOC, GPIOC_LED); } while (0) -#endif - -/* Maple Mini */ -#ifdef BOARD_MAPLEMINI_STM32_F103 -#define LED_ON() do { palSetPad(GPIOB, 1) ;} while (0) -#define LED_OFF() do { palClearPad(GPIOB, 1); } while (0) -#define LED_TGL() do { palTogglePad(GPIOB, 1); } while (0) -#endif - -void matrix_init(void) -{ - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - //debug - debug_matrix = true; - LED_ON(); - wait_ms(500); - LED_OFF(); -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - wait_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - wait_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -# - For Teensies, FAMILY = KINETIS and SERIES is either -# KL2x (LC) or K20x (3.0,3.1,3.2). -MCU_FAMILY = KINETIS -MCU_SERIES = KL2x - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# - NOTE: a custom ld script is needed for EEPROM on Teensy LC -# - LDSCRIPT = -# - MKL26Z64 for Teensy LC -# - MK20DX128 for Teensy 3.0 -# - MK20DX256 for Teensy 3.1 and 3.2 -MCU_LDSCRIPT = MKL26Z64 - -# Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -# - STARTUP = -# - kl2x for Teensy LC -# - k20x5 for Teensy 3.0 -# - k20x7 for Teensy 3.1 and 3.2 -MCU_STARTUP = kl2x - -# Board: it should exist either in /os/hal/boards/ -# or /boards -# - BOARD = -# - PJRC_TEENSY_LC for Teensy LC -# - PJRC_TEENSY_3 for Teensy 3.0 -# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 -BOARD = PJRC_TEENSY_LC - -# Cortex version -# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4 -MCU = cortex-m0plus - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -# I.e. 6 for Teensy LC; 7 for Teensy 3.x -ARMV = 6 - -# 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 - -ifndef QUANTUM_DIR - include ../../Makefile -endif diff --git a/keyboards/teensy_lc_onekey/Makefile.3.0 b/keyboards/teensy_lc_onekey/Makefile.3.0 deleted file mode 100644 index dbf12c363..000000000 --- a/keyboards/teensy_lc_onekey/Makefile.3.0 +++ /dev/null @@ -1,77 +0,0 @@ -# Target file name (without extension). -PROJECT = ch - -# Directory common source files exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config.h - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -# - For Teensies, FAMILY = KINETIS and SERIES is either -# KL2x (LC) or K20x (3.0,3.1,3.2). -MCU_FAMILY = KINETIS -MCU_SERIES = K20x - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# - NOTE: a custom ld script is needed for EEPROM on Teensy LC -# - LDSCRIPT = -# - MKL26Z64 for Teensy LC -# - MK20DX128 for Teensy 3.0 -# - MK20DX256 for Teensy 3.1 and 3.2 -MCU_LDSCRIPT = MK20DX128 - -# Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -# - STARTUP = -# - kl2x for Teensy LC -# - k20x5 for Teensy 3.0 -# - k20x7 for Teensy 3.1 and 3.2 -MCU_STARTUP = k20x5 - -# Board: it should exist either in /os/hal/boards/ -# or /boards -# - BOARD = -# - PJRC_TEENSY_LC for Teensy LC -# - PJRC_TEENSY_3 for Teensy 3.0 -# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 -BOARD = PJRC_TEENSY_3 - -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -# I.e. 6 for Teensy LC; 7 for Teensy 3.x -ARMV = 7 - -# 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 - -include $(TMK_DIR)/tool/chibios/common.mk -include $(TMK_DIR)/tool/chibios/chibios.mk diff --git a/keyboards/teensy_lc_onekey/Makefile.3.2 b/keyboards/teensy_lc_onekey/Makefile.3.2 deleted file mode 100644 index 41bfa41a0..000000000 --- a/keyboards/teensy_lc_onekey/Makefile.3.2 +++ /dev/null @@ -1,77 +0,0 @@ -# Target file name (without extension). -PROJECT = ch - -# Directory common source files exist -TMK_DIR = ../../tmk_core - -# Directory keyboard dependent files exist -TARGET_DIR = . - -# project specific files -SRC = matrix.c \ - led.c - -ifdef KEYMAP - SRC := keymap_$(KEYMAP).c $(SRC) -else - SRC := keymap_plain.c $(SRC) -endif - -CONFIG_H = config.h - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -# - For Teensies, FAMILY = KINETIS and SERIES is either -# KL2x (LC) or K20x (3.0,3.1,3.2). -MCU_FAMILY = KINETIS -MCU_SERIES = K20x - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# - NOTE: a custom ld script is needed for EEPROM on Teensy LC -# - LDSCRIPT = -# - MKL26Z64 for Teensy LC -# - MK20DX128 for Teensy 3.0 -# - MK20DX256 for Teensy 3.1 and 3.2 -MCU_LDSCRIPT = MK20DX256 - -# Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -# - STARTUP = -# - kl2x for Teensy LC -# - k20x5 for Teensy 3.0 -# - k20x7 for Teensy 3.1 and 3.2 -MCU_STARTUP = k20x7 - -# Board: it should exist either in /os/hal/boards/ -# or /boards -# - BOARD = -# - PJRC_TEENSY_LC for Teensy LC -# - PJRC_TEENSY_3 for Teensy 3.0 -# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 -BOARD = PJRC_TEENSY_3_1 - -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -# I.e. 6 for Teensy LC; 7 for Teensy 3.x -ARMV = 7 - -# 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 - -include $(TMK_DIR)/tool/chibios/common.mk -include $(TMK_DIR)/tool/chibios/chibios.mk diff --git a/keyboards/teensy_lc_onekey/chconf.h b/keyboards/teensy_lc_onekey/chconf.h deleted file mode 100644 index cb36996c3..000000000 --- a/keyboards/teensy_lc_onekey/chconf.h +++ /dev/null @@ -1,524 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef CHCONF_H -#define CHCONF_H - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 1000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 0 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 20 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/* Use __WFI in the idle thread for waiting. Does lower the power - * consumption. */ -#define CORTEX_ENABLE_WFI_IDLE TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM FALSE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK TRUE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS TRUE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS TRUE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the trace buffer is activated. - * - * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED - -/** - * @brief Trace buffer entries. - * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is - * different from @p CH_DBG_TRACE_MASK_DISABLED. - */ -#define CH_DBG_TRACE_BUFFER_SIZE 128 - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK TRUE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS TRUE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ - /* Idle-enter code here.*/ \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ - /* Idle-leave code here.*/ \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* CHCONF_H */ - -/** @} */ diff --git a/keyboards/teensy_lc_onekey/config.h b/keyboards/teensy_lc_onekey/config.h deleted file mode 100644 index 19b14fe61..000000000 --- a/keyboards/teensy_lc_onekey/config.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright 2015 Jun Wako - -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 - - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6464 -#define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "TMK" -#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' -#define PRODUCT "ChibiOS TMK test" -#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00' -#define DESCRIPTION "TMK keyboard firmware over ChibiOS" - -/* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 1 -#define DIODE_DIRECTION COL2ROW - -/* 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)) \ -) - - - -/* - * 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 - -#endif diff --git a/keyboards/teensy_lc_onekey/halconf.h b/keyboards/teensy_lc_onekey/halconf.h deleted file mode 100644 index b1d2cd550..000000000 --- a/keyboards/teensy_lc_onekey/halconf.h +++ /dev/null @@ -1,187 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL FALSE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB FALSE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/keyboards/teensy_lc_onekey/instructions.md b/keyboards/teensy_lc_onekey/instructions.md deleted file mode 100644 index 16886a015..000000000 --- a/keyboards/teensy_lc_onekey/instructions.md +++ /dev/null @@ -1,82 +0,0 @@ -# Teensy LC, 3.0, 3.1, 3.2 support - -These ARM Teensies are now supported through [ChibiOS](http://chibios.org). - -You'll need to install an ARM toolchain, for instance from [gcc ARM embedded](https://launchpad.net/gcc-arm-embedded) website, or using your favourite package manager. After installing, you should be able to run `arm-none-eabi-gcc -v` in the command prompt and get sensible output. This toolchain is used instead of `avr-gcc`, which is only for AVR chips. Naturally you'll also need the usual development tools (e.g. `make`), just as in the AVR setting. - -Next, you'll need ChibiOS. For Teensies, you'll need code from two repositories: [chibios-main](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS). If you're not using git, you can just download a [zip of chibios from here](https://github.com/ChibiOS/ChibiOS/archive/a7df9a891067621e8e1a5c2a2c0ceada82403afe.zip), unpack the zip, and rename/move the unpacked directory (named `ChibiOS-`) to `tmk_core/tool/chibios/chibios` (so that the file `tmk_core/tool/chibios/chibios/license.txt` exists). Now the same procedure with a [zip of chibios-contrib from here](https://github.com/ChibiOS/ChibiOS-Contrib/archive/e1311c4db6cd366cf760673f769e925741ac0ad3.zip): unpack and move `ChibiOS-Contrib-` to `tmk_core/tool/chibios/chibios-contrib`. - -(If you're using git, you can just clone the two repos: [chibios](https://github.com/ChibiOS/ChibiOS) and [chibios-contrib](https://github.com/ChibiOS/ChibiOS-Contrib). However - be warned that things may be somewhat out-of-sync (updates at different rates), so you may need to hunt a bit for the right commits.) - -(Why do we need chibios-contrib? Well, the main repo focuses on STM32 chips, and Freescale/NXP Kinetis chips are supported via the Contrib repository.) - -This should be it. Running `make` in `keyboard/teensy_lc_onekey` should create a working firmware in `build/`, called `ch.hex`. - -For more notes about the ChibiOS backend in TMK, see `tmk_core/protocol/chibios/README.md`. - -## About this onekey example - -It's set up for Teensy LC. To use 3.x, you'll need to edit the `Makefile` (and comment out one line in `mcuconf.h`). A sample makefile for Teensy 3.0 is provided as `Makefile.3.0`, can be used without renaming with `make -f Makefile.3.0`. Similarly for Teensy 3.2, there's `Makefile.3.2`. - -## Credits - -TMK itself is written by hasu, original sources [here](https://github.com/tmk/tmk_keyboard). - -The USB support for Kinetis MCUs is due to RedoX. His ChibiOS fork is also [on github](https://github.com/RedoXyde/ChibiOS); but it doesn't include Teensy LC definitions. - -## Features that are not implemented yet - -Currently only the more fancy suspend features are not there (power saving during suspend). The rest should work fine (reports either way are welcome). - -# Matrix programming notes - -The notes below explain what commands can be used to examine and set the status of Teensy pins. - -## ChibiOS pin manipulation basics - -### Pins - -Each pin sits on a "port", each of which comprises at most 32 individual pins. -So for instance "PTC5" from Kinetis manual/datasheet refers to port C (or GPIOA), pin 5. Most functions dealing with pins take 2 parameters which specify the pin -- the first being the port, the second being the pin number. - -Within ChibiOS, there are definitions which simplify this a bit for the Teensies. `TEENSY_PINn_IOPORT` represents the port of the MCU's pin connected Teensy's PIN `n`, and `TEENSY_PINn` represents its MCU's pin number. - -### Mode - -A MCU pin can be in several modes. The basic command to set a pin mode is - - palSetPadMode(TEENSY_PINn_IOPORT, TEENSY_PINn, PAL_MODE_INPUT_PULLUP); - -The last parameter is the mode. For keyboards, the usual ones that are used are `PAL_MODE_INPUT_PULLUP` (input with a pullup), `PAL_MODE_INPUT_PULLDOWN` (input with a pulldown), `PAL_MODE_INPUT` (input floating, a.k.a. Hi-Z), `PAL_MODE_OUTPUT_PUSHPULL` (output in the Arduino sense -- can be then set HIGH or LOW). - -### Setting - -Pins are set HIGH (after they've been put into `OUTPUT_PUSHPULL` mode) by - - palSetPad(TEENSY_PINn_IOPORT, TEENSY_PINn); - -or set LOW by - - palClearPad(TEENSY_PINn_IOPORT, TEENSY_PINn); - -Toggling can be done with - - palTogglePad(TEENSY_PINn_IOPORT, TEENSY_PINn); - -Alternatively, you can use - - palWritePad(TEENSY_PINn_IOPORT, TEENSY_PINn, bit); - -where `bit` is either `PAL_LOW` or `PAL_HIGH` (i.e. `0` or `1`). - -### Reading - -Reading pin status is done with - - palReadPad(TEENSY_PINn_IOPORT, TEENSY_PINn); - -The function returns either `PAL_HIGH` (actually `1`) or `PAL_LOW` (actually `0`). - -### Further docs - -All the commands that are available for pin manipulation through ChibiOS HAL are documented in [ChibiOS PAL driver docs](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html). diff --git a/keyboards/teensy_lc_onekey/keymaps/default/keymap.c b/keyboards/teensy_lc_onekey/keymaps/default/keymap.c deleted file mode 100644 index a109b4960..000000000 --- a/keyboards/teensy_lc_onekey/keymaps/default/keymap.c +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 . -*/ - -#include "keycode.h" -#include "action.h" -#include "action_macro.h" -#include "report.h" -#include "host.h" -#include "print.h" -#include "debug.h" -#include "keymap.h" - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - {{KC_A}}, -}; // to test: KC_CAPS, KT_BTLD, KC_A - -const uint16_t fn_actions[] = { -}; diff --git a/keyboards/teensy_lc_onekey/ld/MKL26Z64.ld b/keyboards/teensy_lc_onekey/ld/MKL26Z64.ld deleted file mode 100644 index fb141f888..000000000 --- a/keyboards/teensy_lc_onekey/ld/MKL26Z64.ld +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com - * (C) 2016 flabbergast - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * KL26Z64 memory setup. - */ -MEMORY -{ - flash0 : org = 0x00000000, len = 0x100 - flash1 : org = 0x00000400, len = 0x10 - flash2 : org = 0x00000410, len = 62k - 0x410 - flash3 : org = 0x0000F800, len = 2k - flash4 : org = 0x00000000, len = 0 - flash5 : org = 0x00000000, len = 0 - flash6 : org = 0x00000000, len = 0 - flash7 : org = 0x00000000, len = 0 - ram0 : org = 0x1FFFF800, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 -} - -/* Flash region for the configuration bytes.*/ -SECTIONS -{ - .cfmprotect : ALIGN(4) SUBALIGN(4) - { - KEEP(*(.cfmconfig)) - } > flash1 -} - -/* For each data/text section two region are defined, a virtual region - and a load region (_LMA suffix).*/ - -/* Flash region to be used for exception vectors.*/ -REGION_ALIAS("VECTORS_FLASH", flash0); -REGION_ALIAS("VECTORS_FLASH_LMA", flash0); - -/* Flash region to be used for constructors and destructors.*/ -REGION_ALIAS("XTORS_FLASH", flash2); -REGION_ALIAS("XTORS_FLASH_LMA", flash2); - -/* Flash region to be used for code text.*/ -REGION_ALIAS("TEXT_FLASH", flash2); -REGION_ALIAS("TEXT_FLASH_LMA", flash2); - -/* Flash region to be used for read only data.*/ -REGION_ALIAS("RODATA_FLASH", flash2); -REGION_ALIAS("RODATA_FLASH_LMA", flash2); - -/* Flash region to be used for various.*/ -REGION_ALIAS("VARIOUS_FLASH", flash2); -REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); - -/* Flash region to be used for RAM(n) initialization data.*/ -REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); - -/* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts.*/ -REGION_ALIAS("MAIN_STACK_RAM", ram0); - -/* RAM region to be used for the process stack. This is the stack used by - the main() function.*/ -REGION_ALIAS("PROCESS_STACK_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); -REGION_ALIAS("DATA_RAM_LMA", flash2); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -/* RAM region to be used for the default heap.*/ -REGION_ALIAS("HEAP_RAM", ram0); - -__eeprom_workarea_start__ = ORIGIN(flash3); -__eeprom_workarea_size__ = LENGTH(flash3); -__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; - -/* Generic rules inclusion.*/ -INCLUDE rules.ld diff --git a/keyboards/teensy_lc_onekey/led.c b/keyboards/teensy_lc_onekey/led.c deleted file mode 100644 index dfa60c107..000000000 --- a/keyboards/teensy_lc_onekey/led.c +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#include "hal.h" - -#include "led.h" - - -void led_set(uint8_t usb_led) { - if (usb_led & (1< - -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 . -*/ - -#include "ch.h" -#include "hal.h" - -/* - * scan matrix - */ -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "wait.h" - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -#define LED_ON() do { palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13) ;} while (0) -#define LED_OFF() do { palClearPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0) -#define LED_TGL() do { palTogglePad(TEENSY_PIN13_IOPORT, TEENSY_PIN13); } while (0) - -void matrix_init(void) -{ - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - //debug - debug_matrix = true; - LED_ON(); - wait_ms(500); - LED_OFF(); -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - wait_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - wait_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1< Date: Tue, 5 Jul 2016 15:34:35 +0300 Subject: Move ChibiOS test board and ld Move the ChibiOS test subproject board and ld files to the kebyoard folder, so that the build system can find them --- .../chibios_test/boards/GENERIC_STM32_F103/board.c | 49 ++++++ .../chibios_test/boards/GENERIC_STM32_F103/board.h | 166 +++++++++++++++++++++ .../boards/GENERIC_STM32_F103/board.mk | 5 + .../GENERIC_STM32_F103/mini_stm32_mapping.png | Bin 0 -> 162908 bytes .../chibios_test/boards/maple_mini_mapping.png | Bin 0 -> 237977 bytes keyboards/chibios_test/ld/MKL26Z64.ld | 105 +++++++++++++ .../ld/STM32F103x8_stm32duino_bootloader.ld | 88 +++++++++++ .../boards/GENERIC_STM32_F103/board.c | 49 ------ .../boards/GENERIC_STM32_F103/board.h | 166 --------------------- .../boards/GENERIC_STM32_F103/board.mk | 5 - .../GENERIC_STM32_F103/mini_stm32_mapping.png | Bin 162908 -> 0 bytes .../boards/maple_mini_mapping.png | Bin 237977 -> 0 bytes .../ld/STM32F103x8_stm32duino_bootloader.ld | 88 ----------- .../chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld | 105 ------------- 14 files changed, 413 insertions(+), 413 deletions(-) create mode 100644 keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c create mode 100644 keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h create mode 100644 keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk create mode 100644 keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png create mode 100644 keyboards/chibios_test/boards/maple_mini_mapping.png create mode 100644 keyboards/chibios_test/ld/MKL26Z64.ld create mode 100644 keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld delete mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c delete mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h delete mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk delete mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png delete mode 100644 keyboards/chibios_test/stm32_f103_onekey/boards/maple_mini_mapping.png delete mode 100644 keyboards/chibios_test/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld delete mode 100644 keyboards/chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 000000000..31319ef57 --- /dev/null +++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,49 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { +} diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 000000000..7253e7782 --- /dev/null +++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOC_LED 13 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 000000000..d692c0ee4 --- /dev/null +++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png new file mode 100644 index 000000000..c44a7d9eb Binary files /dev/null and b/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png differ diff --git a/keyboards/chibios_test/boards/maple_mini_mapping.png b/keyboards/chibios_test/boards/maple_mini_mapping.png new file mode 100644 index 000000000..12cfa81db Binary files /dev/null and b/keyboards/chibios_test/boards/maple_mini_mapping.png differ diff --git a/keyboards/chibios_test/ld/MKL26Z64.ld b/keyboards/chibios_test/ld/MKL26Z64.ld new file mode 100644 index 000000000..fb141f888 --- /dev/null +++ b/keyboards/chibios_test/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 000000000..00613328e --- /dev/null +++ b/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 128k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c deleted file mode 100644 index 31319ef57..000000000 --- a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#include "hal.h" - -/** - * @brief PAL setup. - * @details Digital I/O ports static configuration as defined in @p board.h. - * This variable is used by the HAL when initializing the PAL driver. - */ -#if HAL_USE_PAL || defined(__DOXYGEN__) -const PALConfig pal_default_config = -{ - {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, - {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, - {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, - {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, - {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, -}; -#endif - -/* - * Early initialization code. - * This initialization must be performed just after stack setup and before - * any other initialization. - */ -void __early_init(void) { - - stm32_clock_init(); -} - -/* - * Board-specific initialization code. - */ -void boardInit(void) { -} diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h deleted file mode 100644 index 7253e7782..000000000 --- a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -#ifndef _BOARD_H_ -#define _BOARD_H_ - -/* - * Setup for a Generic STM32F103 board. - */ - -/* - * Board identifier. - */ -#define BOARD_GENERIC_STM32_F103 -#define BOARD_NAME "Generic STM32F103x board" - -/* - * Board frequencies. - */ -#define STM32_LSECLK 32768 -#define STM32_HSECLK 8000000 - -/* - * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. - */ -#define STM32F103xB - -/* - * IO pins assignments - */ - -/* on-board */ - -#define GPIOC_LED 13 -#define GPIOD_OSC_IN 0 -#define GPIOD_OSC_OUT 1 - -/* In case your board has a "USB enable" hardware - controlled by a pin, define it here. (It could be just - a 1.5k resistor connected to D+ line.) -*/ -/* -#define GPIOB_USB_DISC 10 -*/ - -/* - * I/O ports initial setup, this configuration is established soon after reset - * in the initialization code. - * - * The digits have the following meaning: - * 0 - Analog input. - * 1 - Push Pull output 10MHz. - * 2 - Push Pull output 2MHz. - * 3 - Push Pull output 50MHz. - * 4 - Digital input. - * 5 - Open Drain output 10MHz. - * 6 - Open Drain output 2MHz. - * 7 - Open Drain output 50MHz. - * 8 - Digital input with PullUp or PullDown resistor depending on ODR. - * 9 - Alternate Push Pull output 10MHz. - * A - Alternate Push Pull output 2MHz. - * B - Alternate Push Pull output 50MHz. - * C - Reserved. - * D - Alternate Open Drain output 10MHz. - * E - Alternate Open Drain output 2MHz. - * F - Alternate Open Drain output 50MHz. - * Please refer to the STM32 Reference Manual for details. - */ - -/* - * Port A setup. - * Everything input with pull-up except: - * PA2 - Alternate output (USART2 TX). - * PA3 - Normal input (USART2 RX). - * PA9 - Alternate output (USART1 TX). - * PA10 - Normal input (USART1 RX). - */ -#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ -#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ -#define VAL_GPIOAODR 0xFFFFFFFF - -/* - * Port B setup. - * Everything input with pull-up except: - * PB10 - Push Pull output (USB switch). - */ -#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ -#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ -#define VAL_GPIOBODR 0xFFFFFFFF - -/* - * Port C setup. - * Everything input with pull-up except: - * PC13 - Push Pull output (LED). - */ -#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ -#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ -#define VAL_GPIOCODR 0xFFFFFFFF - -/* - * Port D setup. - * Everything input with pull-up except: - * PD0 - Normal input (XTAL). - * PD1 - Normal input (XTAL). - */ -#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ -#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ -#define VAL_GPIODODR 0xFFFFFFFF - -/* - * Port E setup. - * Everything input with pull-up except: - */ -#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ -#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ -#define VAL_GPIOEODR 0xFFFFFFFF - -/* - * USB bus activation macro, required by the USB driver. - */ -/* The point is that most of the generic STM32F103* boards - have a 1.5k resistor connected on one end to the D+ line - and on the other end to some pin. Or even a slightly more - complicated "USB enable" circuit, controlled by a pin. - That should go here. - - However on some boards (e.g. one that I have), there's no - such hardware. In which case it's better to not do anything. -*/ -/* -#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) -*/ -#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); - -/* - * USB bus de-activation macro, required by the USB driver. - */ -/* -#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) -*/ -#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); - -#if !defined(_FROM_ASM_) -#ifdef __cplusplus -extern "C" { -#endif - void boardInit(void); -#ifdef __cplusplus -} -#endif -#endif /* _FROM_ASM_ */ - -#endif /* _BOARD_H_ */ diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk deleted file mode 100644 index d692c0ee4..000000000 --- a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk +++ /dev/null @@ -1,5 +0,0 @@ -# List of all the board related files. -BOARDSRC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103/board.c - -# Required include directories -BOARDINC = $(KEYBOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png deleted file mode 100644 index c44a7d9eb..000000000 Binary files a/keyboards/chibios_test/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png and /dev/null differ diff --git a/keyboards/chibios_test/stm32_f103_onekey/boards/maple_mini_mapping.png b/keyboards/chibios_test/stm32_f103_onekey/boards/maple_mini_mapping.png deleted file mode 100644 index 12cfa81db..000000000 Binary files a/keyboards/chibios_test/stm32_f103_onekey/boards/maple_mini_mapping.png and /dev/null differ diff --git a/keyboards/chibios_test/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/chibios_test/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld deleted file mode 100644 index 00613328e..000000000 --- a/keyboards/chibios_test/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld +++ /dev/null @@ -1,88 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - * ST32F103xB memory setup for use with the maplemini bootloader. - * You will have to - * #define CORTEX_VTOR_INIT 0x5000 - * in your projects chconf.h - */ -MEMORY -{ - flash0 : org = 0x08002000, len = 128k - 0x2000 - flash1 : org = 0x00000000, len = 0 - flash2 : org = 0x00000000, len = 0 - flash3 : org = 0x00000000, len = 0 - flash4 : org = 0x00000000, len = 0 - flash5 : org = 0x00000000, len = 0 - flash6 : org = 0x00000000, len = 0 - flash7 : org = 0x00000000, len = 0 - ram0 : org = 0x20000000, len = 20k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 -} - -/* For each data/text section two region are defined, a virtual region - and a load region (_LMA suffix).*/ - -/* Flash region to be used for exception vectors.*/ -REGION_ALIAS("VECTORS_FLASH", flash0); -REGION_ALIAS("VECTORS_FLASH_LMA", flash0); - -/* Flash region to be used for constructors and destructors.*/ -REGION_ALIAS("XTORS_FLASH", flash0); -REGION_ALIAS("XTORS_FLASH_LMA", flash0); - -/* Flash region to be used for code text.*/ -REGION_ALIAS("TEXT_FLASH", flash0); -REGION_ALIAS("TEXT_FLASH_LMA", flash0); - -/* Flash region to be used for read only data.*/ -REGION_ALIAS("RODATA_FLASH", flash0); -REGION_ALIAS("RODATA_FLASH_LMA", flash0); - -/* Flash region to be used for various.*/ -REGION_ALIAS("VARIOUS_FLASH", flash0); -REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); - -/* Flash region to be used for RAM(n) initialization data.*/ -REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); - -/* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts.*/ -REGION_ALIAS("MAIN_STACK_RAM", ram0); - -/* RAM region to be used for the process stack. This is the stack used by - the main() function.*/ -REGION_ALIAS("PROCESS_STACK_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); -REGION_ALIAS("DATA_RAM_LMA", flash0); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -/* RAM region to be used for the default heap.*/ -REGION_ALIAS("HEAP_RAM", ram0); - -/* Generic rules inclusion.*/ -INCLUDE rules.ld diff --git a/keyboards/chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld b/keyboards/chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld deleted file mode 100644 index fb141f888..000000000 --- a/keyboards/chibios_test/teensy_lc_onekey/ld/MKL26Z64.ld +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com - * (C) 2016 flabbergast - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -/* - * KL26Z64 memory setup. - */ -MEMORY -{ - flash0 : org = 0x00000000, len = 0x100 - flash1 : org = 0x00000400, len = 0x10 - flash2 : org = 0x00000410, len = 62k - 0x410 - flash3 : org = 0x0000F800, len = 2k - flash4 : org = 0x00000000, len = 0 - flash5 : org = 0x00000000, len = 0 - flash6 : org = 0x00000000, len = 0 - flash7 : org = 0x00000000, len = 0 - ram0 : org = 0x1FFFF800, len = 8k - ram1 : org = 0x00000000, len = 0 - ram2 : org = 0x00000000, len = 0 - ram3 : org = 0x00000000, len = 0 - ram4 : org = 0x00000000, len = 0 - ram5 : org = 0x00000000, len = 0 - ram6 : org = 0x00000000, len = 0 - ram7 : org = 0x00000000, len = 0 -} - -/* Flash region for the configuration bytes.*/ -SECTIONS -{ - .cfmprotect : ALIGN(4) SUBALIGN(4) - { - KEEP(*(.cfmconfig)) - } > flash1 -} - -/* For each data/text section two region are defined, a virtual region - and a load region (_LMA suffix).*/ - -/* Flash region to be used for exception vectors.*/ -REGION_ALIAS("VECTORS_FLASH", flash0); -REGION_ALIAS("VECTORS_FLASH_LMA", flash0); - -/* Flash region to be used for constructors and destructors.*/ -REGION_ALIAS("XTORS_FLASH", flash2); -REGION_ALIAS("XTORS_FLASH_LMA", flash2); - -/* Flash region to be used for code text.*/ -REGION_ALIAS("TEXT_FLASH", flash2); -REGION_ALIAS("TEXT_FLASH_LMA", flash2); - -/* Flash region to be used for read only data.*/ -REGION_ALIAS("RODATA_FLASH", flash2); -REGION_ALIAS("RODATA_FLASH_LMA", flash2); - -/* Flash region to be used for various.*/ -REGION_ALIAS("VARIOUS_FLASH", flash2); -REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); - -/* Flash region to be used for RAM(n) initialization data.*/ -REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); - -/* RAM region to be used for Main stack. This stack accommodates the processing - of all exceptions and interrupts.*/ -REGION_ALIAS("MAIN_STACK_RAM", ram0); - -/* RAM region to be used for the process stack. This is the stack used by - the main() function.*/ -REGION_ALIAS("PROCESS_STACK_RAM", ram0); - -/* RAM region to be used for data segment.*/ -REGION_ALIAS("DATA_RAM", ram0); -REGION_ALIAS("DATA_RAM_LMA", flash2); - -/* RAM region to be used for BSS segment.*/ -REGION_ALIAS("BSS_RAM", ram0); - -/* RAM region to be used for the default heap.*/ -REGION_ALIAS("HEAP_RAM", ram0); - -__eeprom_workarea_start__ = ORIGIN(flash3); -__eeprom_workarea_size__ = LENGTH(flash3); -__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; - -/* Generic rules inclusion.*/ -INCLUDE rules.ld -- cgit v1.2.3-24-g4f1b From 6e4f2e18e6cd0abffa52e6481d9761064698ec64 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 5 Jul 2016 15:53:40 +0300 Subject: Don't include common_config.h for ChibiOS test --- keyboards/chibios_test/config.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/keyboards/chibios_test/config.h b/keyboards/chibios_test/config.h index 210f15067..c32a77b37 100644 --- a/keyboards/chibios_test/config.h +++ b/keyboards/chibios_test/config.h @@ -18,8 +18,6 @@ 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 0x6464 -- cgit v1.2.3-24-g4f1b From cf6cd15920522b139ba0f6c7e2b52e3d656a45d7 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 5 Jul 2016 15:54:59 +0300 Subject: Fix typo in teensy_lc_onkey.h --- keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h index 747e830a7..ea1c84e2f 100644 --- a/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h +++ b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h @@ -1,4 +1,4 @@ #ifndef TEENSY_LC_ONEKEY_H #define TEENSY_LC_ONEKEY_H -#include "chbibios_test.h" +#include "chibios_test.h" #endif -- cgit v1.2.3-24-g4f1b From 74847a84f8c90c8065f50cee9768f7768b5f856b Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 5 Jul 2016 16:45:29 +0300 Subject: First version of Infinity Ergodox Mostly just adding the files from the fredizzimo repository. Still needs some fixing until it works --- keyboards/infinity_ergodox/MEMO.txt | 385 +++++++++++++++ keyboards/infinity_ergodox/Makefile | 68 +++ keyboards/infinity_ergodox/bootloader_defs.h | 1 + keyboards/infinity_ergodox/chconf.h | 524 +++++++++++++++++++++ keyboards/infinity_ergodox/config.h | 80 ++++ keyboards/infinity_ergodox/halconf.h | 353 ++++++++++++++ keyboards/infinity_ergodox/infinity_ergodox.c | 1 + keyboards/infinity_ergodox/infinity_ergodox.h | 44 ++ .../infinity_ergodox/keymaps/default/keymap.c | 111 +++++ keyboards/infinity_ergodox/led.c | 49 ++ keyboards/infinity_ergodox/matrix.c | 170 +++++++ keyboards/infinity_ergodox/mcuconf.h | 74 +++ 12 files changed, 1860 insertions(+) create mode 100644 keyboards/infinity_ergodox/MEMO.txt create mode 100644 keyboards/infinity_ergodox/Makefile create mode 100644 keyboards/infinity_ergodox/bootloader_defs.h create mode 100644 keyboards/infinity_ergodox/chconf.h create mode 100644 keyboards/infinity_ergodox/config.h create mode 100644 keyboards/infinity_ergodox/halconf.h create mode 100644 keyboards/infinity_ergodox/infinity_ergodox.c create mode 100644 keyboards/infinity_ergodox/infinity_ergodox.h create mode 100644 keyboards/infinity_ergodox/keymaps/default/keymap.c create mode 100644 keyboards/infinity_ergodox/led.c create mode 100644 keyboards/infinity_ergodox/matrix.c create mode 100644 keyboards/infinity_ergodox/mcuconf.h diff --git a/keyboards/infinity_ergodox/MEMO.txt b/keyboards/infinity_ergodox/MEMO.txt new file mode 100644 index 000000000..e2886aa00 --- /dev/null +++ b/keyboards/infinity_ergodox/MEMO.txt @@ -0,0 +1,385 @@ +flabbergast's TMK/ChibiOS port +============================== +2015/10/16 + + +Build +----- +$ git clone -b chibios https://github.com/flabbergast/tmk_keyboard.git + +$ cd tmk_keyboard +$ git submodule add -f -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios +or +$ cd tmk_keyboard/tmk_core/tool/chibios +$ git clone -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios + +$ cd tmk_keyboard/keyboard/infinity_chibios +$ make + + + + +Chibios Configuration +--------------------- +halconf.h: for HAL configuration + placed in project directory + read in chibios/os/hal/hal.mk + included in chibios/os/hal/include/hal.h +mcuconf.h: for MCU configuration + placed in project directory + included in halconf.h + + +Chibios Term +------------ +PAL = Port Abstraction Layer + palWritePad + palReadPad + palSetPad + chibios/os/hal/include/pal.h + +LLD = Low Level Driver + + +Makefile +-------- + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = KINETIS + MCU_SERIES = KL2x + + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT = MKL26Z64 + + # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP = kl2x + + # Board: it should exist either in /os/hal/boards/ + # or /boards + BOARD = PJRC_TEENSY_LC + + MCU = cortex-m0 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 6 + + +halconf.h +--------- + + +mcuconf.h +--------- + + +chconf.h +-------- + + +ld script +--------- +--- ../../tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/ld/MKL26Z64.ld 2015-10-15 09:08:58.732904304 +0900 ++++ ld/MKL26Z64.ld 2015-10-15 08:48:06.430215496 +0900 +@@ -27,7 +27,8 @@ + { + flash0 : org = 0x00000000, len = 0xc0 + flashcfg : org = 0x00000400, len = 0x10 +- flash : org = 0x00000410, len = 64k - 0x410 ++ flash : org = 0x00000410, len = 62k - 0x410 ++ eeprom_emu : org = 0x0000F800, len = 2k + ram : org = 0x1FFFF800, len = 8k + } + +@@ -35,6 +36,10 @@ + __ram_size__ = LENGTH(ram); + __ram_end__ = __ram_start__ + __ram_size__; + ++__eeprom_workarea_start__ = ORIGIN(eeprom_emu); ++__eeprom_workarea_size__ = LENGTH(eeprom_emu); ++__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; ++ + SECTIONS + { + . = 0; + + + +Configuration/Startup for Infinity 60% +-------------------------------------- +Configuration: + + +Clock: +Inifinity + FEI(FLL Engaged Internal) mode with core clock:48MHz, bus clock:48MHz, flash clock:24MHz + Clock dividor: + SIM_CLKDIV1[OUTDIV1] = 0 divide-by-1 for core clock + SIM_CLKDIV1[OUTDIV2] = 0 divide-by-1 for bus clock + SIM_CLKDIV1[OUTDIV4] = 1 divide-by-2 for flash clock + Internal reference clock: + MCG_C1[IREFS] = 1 Internal Reference Select for clock source for FLL + MCG_C1[IRCLKEN] = 1 Internal Reference Clock Enable + FLL multipilication: + MCG_C4[DMX32] = 1 + MCG_C4[DRST_DRS] = 01 FLL factor 1464 * 32.768kHz = 48MHz + +chibios/os/hal/ports/KINETIS/K20x/hal_lld.c + k20x_clock_init(): called in __early_init() defined in board.c + disable watchdog and configure clock + + configurable macros: + KINETIS_NO_INIT: whether init or not + KINETIS_MCG_MODE: clock mode + KINETIS_MCG_MODE_FEI + KINETIS_MCG_MODE_PEE + hal/ports/KINETIS/K20x/hal_lld.h + + +chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.h + PALConfig pal_default_config + boardInit() + __early_init() + macro definitions for board infos, freq and mcu type + +chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.c + +USB + + +Startup +------- + common/ports/ARMCMx/GCC/crt0_v[67]m.s + Reset_Handler: startup code + common/ports/ARMCMx/GCC/crt1.c + __core_init(): weak + __early_init(): weak + __late_init(): weak + __default_exit(): weak + called from Reset_Handler of crt0 + common/ports/ARMCMx/GCC/vector.c + common/ports/ARMCMx/GCC/ld/*.ld + +chibios/os/common/ports/ARMCMx/compilers/GCC/ +├── crt0_v6m.s +├── crt0_v7m.s +├── crt1.c +├── ld +│   ├── MK20DX128BLDR3.ld +│   ├── MK20DX128BLDR4.ld +│   ├── MK20DX128.ld +│   ├── MK20DX256.ld +│   ├── MKL25Z128.ld +│   ├── MKL26Z128.ld +│   ├── MKL26Z64.ld +│   └── STM32L476xG.ld +├── mk +│   ├── startup_k20x5.mk +│   ├── startup_k20x7.mk +│   ├── startup_k20x.mk +│   ├── startup_kl2x.mk +│   └── startup_stm32l4xx.mk +├── rules.ld +├── rules.mk +└── vectors.c + +chibios/os/hal/ +├── boards +│   ├── FREESCALE_FREEDOM_K20D50M +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── MCHCK_K20 +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── PJRC_TEENSY_3 +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── PJRC_TEENSY_3_1 +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── PJRC_TEENSY_LC +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── readme.txt +│   ├── simulator +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── ST_NUCLEO_F030R8 +│   │   ├── board.c +│   │   ├── board.h +│   │   ├── board.mk +│   │   └── cfg +│   │   └── board.chcfg +├── hal.mk +├── include +│   ├── adc.h +│   ├── can.h +│   ├── dac.h +│   ├── ext.h +│   ├── gpt.h +│   ├── hal_channels.h +│   ├── hal_files.h +│   ├── hal.h +│   ├── hal_ioblock.h +│   ├── hal_mmcsd.h +│   ├── hal_queues.h +│   ├── hal_streams.h +│   ├── i2c.h +│   ├── i2s.h +│   ├── icu.h +│   ├── mac.h +│   ├── mii.h +│   ├── mmc_spi.h +│   ├── pal.h +│   ├── pwm.h +│   ├── rtc.h +│   ├── sdc.h +│   ├── serial.h +│   ├── serial_usb.h +│   ├── spi.h +│   ├── st.h +│   ├── uart.h +│   └── usb.h +├── lib +│   └── streams +│   ├── chprintf.c +│   ├── chprintf.h +│   ├── memstreams.c +│   ├── memstreams.h +│   ├── nullstreams.c +│   └── nullstreams.h +├── osal +│   ├── nil +│   │   ├── osal.c +│   │   ├── osal.h +│   │   └── osal.mk +│   ├── os-less +│   │   └── ARMCMx +│   │   ├── osal.c +│   │   ├── osal.h +│   │   └── osal.mk +│   └── rt +│   ├── osal.c +│   ├── osal.h +│   └── osal.mk +├── ports +│   ├── AVR +│   ├── common +│   │   └── ARMCMx +│   │   ├── mpu.h +│   │   ├── nvic.c +│   │   └── nvic.h +│   ├── KINETIS +│   │   ├── K20x +│   │   │   ├── hal_lld.c +│   │   │   ├── hal_lld.h +│   │   │   ├── kinetis_registry.h +│   │   │   ├── platform.dox +│   │   │   ├── platform.mk +│   │   │   ├── pwm_lld.c +│   │   │   ├── pwm_lld.h +│   │   │   ├── spi_lld.c +│   │   │   └── spi_lld.h +│   │   ├── KL2x +│   │   │   ├── hal_lld.c +│   │   │   ├── hal_lld.h +│   │   │   ├── kinetis_registry.h +│   │   │   ├── platform.mk +│   │   │   ├── pwm_lld.c +│   │   │   └── pwm_lld.h +│   │   ├── LLD +│   │   │   ├── adc_lld.c +│   │   │   ├── adc_lld.h +│   │   │   ├── ext_lld.c +│   │   │   ├── ext_lld.h +│   │   │   ├── gpt_lld.c +│   │   │   ├── gpt_lld.h +│   │   │   ├── i2c_lld.c +│   │   │   ├── i2c_lld.h +│   │   │   ├── pal_lld.c +│   │   │   ├── pal_lld.h +│   │   │   ├── serial_lld.c +│   │   │   ├── serial_lld.h +│   │   │   ├── st_lld.c +│   │   │   ├── st_lld.h +│   │   │   ├── usb_lld.c +│   │   │   └── usb_lld.h +│   │   └── README.md +│   ├── LPC +│   ├── simulator +│   └── STM32 +├── src +│   ├── adc.c +│   ├── can.c +│   ├── dac.c +│   ├── ext.c +│   ├── gpt.c +│   ├── hal.c +│   ├── hal_mmcsd.c +│   ├── hal_queues.c +│   ├── i2c.c +│   ├── i2s.c +│   ├── icu.c +│   ├── mac.c +│   ├── mmc_spi.c +│   ├── pal.c +│   ├── pwm.c +│   ├── rtc.c +│   ├── sdc.c +│   ├── serial.c +│   ├── serial_usb.c +│   ├── spi.c +│   ├── st.c +│   ├── uart.c +│   └── usb.c +└── templates + ├── adc_lld.c + ├── adc_lld.h + ├── can_lld.c + ├── can_lld.h + ├── dac_lld.c + ├── dac_lld.h + ├── ext_lld.c + ├── ext_lld.h + ├── gpt_lld.c + ├── gpt_lld.h + ├── halconf.h + ├── hal_lld.c + ├── hal_lld.h + ├── i2c_lld.c + ├── i2c_lld.h + ├── i2s_lld.c + ├── i2s_lld.h + ├── icu_lld.c + ├── icu_lld.h + ├── mac_lld.c + ├── mac_lld.h + ├── mcuconf.h + ├── osal + │   ├── osal.c + │   ├── osal.h + │   └── osal.mk + ├── pal_lld.c + ├── pal_lld.h + ├── platform.mk + ├── pwm_lld.c + ├── pwm_lld.h + ├── rtc_lld.c + ├── rtc_lld.h + ├── sdc_lld.c + ├── sdc_lld.h + ├── serial_lld.c + ├── serial_lld.h + ├── spi_lld.c + ├── spi_lld.h + ├── st_lld.c + ├── st_lld.h + ├── uart_lld.c + ├── uart_lld.h + ├── usb_lld.c + └── usb_lld.h diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile new file mode 100644 index 000000000..6ea3bd691 --- /dev/null +++ b/keyboards/infinity_ergodox/Makefile @@ -0,0 +1,68 @@ +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +# - For Infinity KB, SERIES = K20x +MCU_FAMILY = KINETIS +MCU_SERIES = K20x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader +# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader +MCU_LDSCRIPT = MK20DX256BLDR8 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 and Infinity 60% +# - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox +MCU_STARTUP = k20x7 + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +# - MCHCK_K20 for Infinity KB +#BOARD = MCHCK_K20 +BOARD = PJRC_TEENSY_3_1 + +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +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 + +# 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 + +ifndef QUANTUM_DIR + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/infinity_ergodox/bootloader_defs.h b/keyboards/infinity_ergodox/bootloader_defs.h new file mode 100644 index 000000000..c67153be6 --- /dev/null +++ b/keyboards/infinity_ergodox/bootloader_defs.h @@ -0,0 +1 @@ +#define KIIBOHD_BOOTLOADER diff --git a/keyboards/infinity_ergodox/chconf.h b/keyboards/infinity_ergodox/chconf.h new file mode 100644 index 000000000..d59c35eb6 --- /dev/null +++ b/keyboards/infinity_ergodox/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 20 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_QUEUES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_TRACE FALSE + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/keyboards/infinity_ergodox/config.h b/keyboards/infinity_ergodox/config.h new file mode 100644 index 000000000..d24ee0f05 --- /dev/null +++ b/keyboards/infinity_ergodox/config.h @@ -0,0 +1,80 @@ +/* +Copyright 2015 Jun Wako + +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 + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER "TMK" +#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00' +#define PRODUCT "Infinity keyboard/TMK" +#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00' + +/* key matrix size */ +#define MATRIX_ROWS 18 +#define MATRIX_COLS 5 +#define LOCAL_MATRIX_ROWS 9 + +/* 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 +#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2) + +/* + * 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 + +#endif diff --git a/keyboards/infinity_ergodox/halconf.h b/keyboards/infinity_ergodox/halconf.h new file mode 100644 index 000000000..55dd5e88d --- /dev/null +++ b/keyboards/infinity_ergodox/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 128 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 256 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/infinity_ergodox/infinity_ergodox.c b/keyboards/infinity_ergodox/infinity_ergodox.c new file mode 100644 index 000000000..34aded1a7 --- /dev/null +++ b/keyboards/infinity_ergodox/infinity_ergodox.c @@ -0,0 +1 @@ +#include "infinity_ergodox.h" diff --git a/keyboards/infinity_ergodox/infinity_ergodox.h b/keyboards/infinity_ergodox/infinity_ergodox.h new file mode 100644 index 000000000..de7267594 --- /dev/null +++ b/keyboards/infinity_ergodox/infinity_ergodox.h @@ -0,0 +1,44 @@ +#ifndef KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ +#define KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ + +#include "quantum.h" + +#define KEYMAP( \ + A80, A70, A60, A50, A40, A30, A20, \ + A81, A71, A61, A51, A41, A31, A21, \ + A82, A72, A62, A52, A42, A32, \ + A83, A73, A63, A53, A43, A33, A23, \ + A84, A74, A64, A54, A44, \ + A13, A03, \ + A04, \ + A34, A24, A14, \ + B20, B30, B40, B50, B60, B70, B80, \ + B21, B31, B41, B51, B61, B71, B81, \ + B32, B42, B52, B62, B72, B82, \ + B23, B33, B43, B53, B63, B73, B83, \ + B44, B54, B64, B74, B84, \ + B03, B13, \ + 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 } \ +} + +#endif /* KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ */ diff --git a/keyboards/infinity_ergodox/keymaps/default/keymap.c b/keyboards/infinity_ergodox/keymaps/default/keymap.c new file mode 100644 index 000000000..c33fb7b92 --- /dev/null +++ b/keyboards/infinity_ergodox/keymaps/default/keymap.c @@ -0,0 +1,111 @@ +/* +Copyright 2016 Fred Sundvik +Jun Wako + +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 . +*/ + +#include "infinity_ergodox.h" + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + KEYMAP( // layer 0 : default + // left hand + EQL, 1, 2, 3, 4, 5, ESC, + BSLS,Q, W, E, R, T, FN1, + TAB, A, S, D, F, G, + LSFT,Z, X, C, V, B, FN0, + LGUI,GRV, BSLS,LEFT,RGHT, + LCTL,LALT, + HOME, + BSPC,DEL, END, + // right hand + FN2, 6, 7, 8, 9, 0, MINS, + LBRC,Y, U, I, O, P, RBRC, + H, J, K, L, SCLN,QUOT, + FN0, N, M, COMM,DOT, SLSH,RSFT, + LEFT,DOWN,UP, RGHT,RGUI, + RALT,RCTL, + PGUP, + PGDN,ENT, SPC + ), + + KEYMAP( // layer 1 : function and symbol keys + // left hand + TRNS,F1, F2, F3, F4, F5, F11, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS, + // right hand + F12, F6, F7, F8, F9, F10, TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS + ), + + KEYMAP( // layer 2 : keyboard functions + // left hand + BTLD,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS, + // right hand + TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS + ), + + KEYMAP( // layer 3: numpad + // left hand + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS, + // right hand + TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC, + TRNS,NO, P7, P8, P9, PMNS,BSPC, + NO, P4, P5, P6, PPLS,PENT, + TRNS,NO, P1, P2, P3, PPLS,PENT, + P0, PDOT,SLSH,PENT,PENT, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS + ), +}; +const uint16_t fn_actions[] = { + ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1 + ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2 + ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer + ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0 +}; diff --git a/keyboards/infinity_ergodox/led.c b/keyboards/infinity_ergodox/led.c new file mode 100644 index 000000000..77195bb35 --- /dev/null +++ b/keyboards/infinity_ergodox/led.c @@ -0,0 +1,49 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include "hal.h" + +#include "led.h" + + +void led_set(uint8_t usb_led) { +// The LCD backlight functionality conflicts with this simple +// red backlight +#if !defined(LCD_BACKLIGHT_ENABLE) && defined(STATUS_LED_ENABLE) + // PTC1: LCD Backlight Red(0:on/1:off) + GPIOC->PDDR |= (1<<1); + PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); + if (usb_led & (1<PCOR |= (1<<1); + } else { + GPIOC->PSOR |= (1<<1); + } +#elif !defined(LCD_BACKLIGHT_ENABLE) + (void)usb_led; + GPIOC->PDDR |= (1<<1); + PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); + GPIOC->PSOR |= (1<<1); + GPIOC->PDDR |= (1<<2); + PORTC->PCR[2] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); + GPIOC->PSOR |= (1<<2); + GPIOC->PDDR |= (1<<3); + PORTC->PCR[3] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); + GPIOC->PSOR |= (1<<3); +#else + (void)usb_led; +#endif +} diff --git a/keyboards/infinity_ergodox/matrix.c b/keyboards/infinity_ergodox/matrix.c new file mode 100644 index 000000000..fd93967a8 --- /dev/null +++ b/keyboards/infinity_ergodox/matrix.c @@ -0,0 +1,170 @@ +/* +Copyright 2016 Fred Sundvik +Jun Wako + +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 . +*/ +#include +#include +#include +#include "hal.h" +#include "timer.h" +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "matrix.h" +#include "serial_link/system/serial_link.h" + + +/* + * Infinity ErgoDox Pinusage: + * Column pins are input with internal pull-down. Row pins are output and strobe with high. + * Key is high or 1 when it turns on. + * + * col: { PTD1, PTD4, PTD5, PTD6, PTD7 } + * row: { PTB2, PTB3, PTB18, PTB19, PTC0, PTC9, PTC10, PTC11, PTD0 } + */ +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[LOCAL_MATRIX_ROWS]; +static bool debouncing = false; +static uint16_t debouncing_time = 0; + + +void matrix_init(void) +{ + /* Column(sense) */ + palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN); + + /* Row(strobe) */ + palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 19, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 9, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); + + memset(matrix, 0, MATRIX_ROWS); + memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS); +} + +uint8_t matrix_scan(void) +{ + for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { + matrix_row_t data = 0; + + // strobe row + switch (row) { + case 0: palSetPad(GPIOB, 2); break; + case 1: palSetPad(GPIOB, 3); break; + case 2: palSetPad(GPIOB, 18); break; + case 3: palSetPad(GPIOB, 19); break; + case 4: palSetPad(GPIOC, 0); break; + case 5: palSetPad(GPIOC, 9); break; + case 6: palSetPad(GPIOC, 10); break; + case 7: palSetPad(GPIOC, 11); break; + case 8: palSetPad(GPIOD, 0); break; + } + + // need wait to settle pin state + // if you wait too short, or have a too high update rate + // the keyboard might freeze, or there might not be enough + // processing power to update the LCD screen properly. + // 20us, or two ticks at 100000Hz seems to be OK + wait_us(20); + + // read col data: { PTD1, PTD4, PTD5, PTD6, PTD7 } + data = ((palReadPort(GPIOD) & 0xF0) >> 3) | + ((palReadPort(GPIOD) & 0x02) >> 1); + + // un-strobe row + switch (row) { + case 0: palClearPad(GPIOB, 2); break; + case 1: palClearPad(GPIOB, 3); break; + case 2: palClearPad(GPIOB, 18); break; + case 3: palClearPad(GPIOB, 19); break; + case 4: palClearPad(GPIOC, 0); break; + case 5: palClearPad(GPIOC, 9); break; + case 6: palClearPad(GPIOC, 10); break; + case 7: palClearPad(GPIOC, 11); break; + case 8: palClearPad(GPIOD, 0); break; + } + + if (matrix_debouncing[row] != data) { + matrix_debouncing[row] = data; + debouncing = true; + debouncing_time = timer_read(); + } + } + + uint8_t offset = 0; +#ifdef MASTER_IS_ON_RIGHT + if (is_serial_link_master()) { + offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS; + } +#endif + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { + matrix[offset + row] = matrix_debouncing[row]; + } + debouncing = false; + } + return 1; +} + +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & (1< Date: Tue, 5 Jul 2016 16:50:30 +0300 Subject: Infinity Ergodox - Add matrix.c and led.c --- keyboards/infinity_ergodox/Makefile | 4 ++++ keyboards/infinity_ergodox/matrix.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile index 6ea3bd691..fb21aae5e 100644 --- a/keyboards/infinity_ergodox/Makefile +++ b/keyboards/infinity_ergodox/Makefile @@ -1,3 +1,7 @@ +# project specific files +SRC = matrix.c \ + led.c + ## chip/board settings # - the next two should match the directories in # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) diff --git a/keyboards/infinity_ergodox/matrix.c b/keyboards/infinity_ergodox/matrix.c index fd93967a8..2b806cd64 100644 --- a/keyboards/infinity_ergodox/matrix.c +++ b/keyboards/infinity_ergodox/matrix.c @@ -24,7 +24,6 @@ along with this program. If not, see . #include "print.h" #include "debug.h" #include "matrix.h" -#include "serial_link/system/serial_link.h" /* -- cgit v1.2.3-24-g4f1b From f9a6e34c28f6de0f6ec505144acc287b90326436 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 5 Jul 2016 19:28:17 +0300 Subject: Add dfu-util command for programming Also add .bin generation, which is needed for dfu-util. --- tmk_core/avr.mk | 1 + tmk_core/chibios.mk | 6 +++++- tmk_core/rules.mk | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 72be5e6da..3bf2b34f8 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -10,6 +10,7 @@ AR = avr-ar rcs NM = avr-nm HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) +BIN = diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 0abb933a8..cb67ac6f2 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -113,6 +113,7 @@ AR = arm-none-eabi-ar NM = arm-none-eabi-nm HEX = $(OBJCOPY) -O $(FORMAT) EEP = +BIN = $(OBJCOPY) -O binary THUMBFLAGS = -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -mthumb -DTHUMB @@ -151,4 +152,7 @@ else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","") endif # List any extra directories to look for libraries here. -EXTRALIBDIRS = $(RULESPATH)/ld \ No newline at end of file +EXTRALIBDIRS = $(RULESPATH)/ld + +dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter + dfu-util -D $(BUILD_DIR)/$(TARGET).bin \ No newline at end of file diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 7d3d8f9a6..352e9314b 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -234,6 +234,7 @@ MSG_COFF = Converting to AVR COFF: MSG_EXTENDED_COFF = Converting to AVR Extended COFF: MSG_FLASH = Creating load file for Flash: MSG_EEPROM = Creating load file for EEPROM: +MSG_BIN = Creating binary load file for Flash: MSG_EXTENDED_LISTING = Creating Extended Listing: MSG_SYMBOL_TABLE = Creating Symbol Table: MSG_LINKING = Linking: @@ -369,6 +370,11 @@ gccversion : $(eval CMD=$(NM) -n $< > $@ ) @$(BUILD_CMD) +%.bin: %.elf + @$(SILENT) || printf "$(MSG_BIN) $@" | $(AWK_CMD) + $(eval CMD=$(BIN) $< $@ || exit 0) + @$(BUILD_CMD) + # Create library from object files. .SECONDARY : $(BUILD_DIR)/$(TARGET).a .PRECIOUS : $(OBJ) -- cgit v1.2.3-24-g4f1b From 96f44e120295e677d21d3dbb9dc4bf642ba2af09 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 5 Jul 2016 18:36:02 -0400 Subject: one half working --- keyboards/lets-split/Makefile | 73 ++++++++++++++++++++++ keyboards/lets-split/config.h | 87 +++++++++++++++++++++++++++ keyboards/lets-split/keymaps/default/keymap.c | 42 +++++++++++++ keyboards/lets-split/lets-split.c | 48 +++++++++++++++ keyboards/lets-split/lets-split.h | 4 ++ keyboards/lets-split/readme.md | 0 6 files changed, 254 insertions(+) create mode 100644 keyboards/lets-split/Makefile create mode 100644 keyboards/lets-split/config.h create mode 100644 keyboards/lets-split/keymaps/default/keymap.c create mode 100644 keyboards/lets-split/lets-split.c create mode 100644 keyboards/lets-split/lets-split.h create mode 100644 keyboards/lets-split/readme.md diff --git a/keyboards/lets-split/Makefile b/keyboards/lets-split/Makefile new file mode 100644 index 000000000..247f978f0 --- /dev/null +++ b/keyboards/lets-split/Makefile @@ -0,0 +1,73 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= yes # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/lets-split/config.h b/keyboards/lets-split/config.h new file mode 100644 index 000000000..5b464147d --- /dev/null +++ b/keyboards/lets-split/config.h @@ -0,0 +1,87 @@ +/* +Copyright 2012 Jun Wako + +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 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Wootpatoot +#define PRODUCT Lets Split +#define DESCRIPTION A split keyboard for the cheap makers + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 6 + +#define MATRIX_ROW_PINS { B5, B4, E6, D7, } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* 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 DEBOUNCING_DELAY 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)) \ +) + +/* ws2812 RGB LED */ +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD +#define ws2812_pin PD1 +#define RGBLED_NUM 28 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * 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 + +#endif \ No newline at end of file diff --git a/keyboards/lets-split/keymaps/default/keymap.c b/keyboards/lets-split/keymaps/default/keymap.c new file mode 100644 index 000000000..00602394f --- /dev/null +++ b/keyboards/lets-split/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +#include "lets-split.h" +#include "action_layer.h" + +#define BASE 0 + +enum preonic_keycodes { + KC_IDK = SAFE_RANGE, + PM_RESET +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[BASE] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T }, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B }, + {KC_IDK, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, PM_RESET } +} + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_IDK: + if (record->event.pressed) { + SEND_STRING("IDK. "); + } + return false; + break; + case PM_RESET: + if (record->event.pressed) { + promicro_bootloader_jmp(true); + } + return false; + break; + } + return true; +}; \ No newline at end of file diff --git a/keyboards/lets-split/lets-split.c b/keyboards/lets-split/lets-split.c new file mode 100644 index 000000000..ee9872303 --- /dev/null +++ b/keyboards/lets-split/lets-split.c @@ -0,0 +1,48 @@ +#include "lets-split.h" + +#ifdef AUDIO_ENABLE + float tone_startup[][2] = SONG(STARTUP_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void matrix_init_kb(void) { + + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); + #endif + + // green led on + DDRD |= (1<<5); + PORTD &= ~(1<<5); + + // orange led on + DDRB |= (1<<0); + PORTB &= ~(1<<0); + + matrix_init_user(); +}; + +void promicro_bootloader_jmp(bool program) { + + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); + #endif + + uint16_t *const bootKeyPtr = (uint16_t *)0x0800; + + // Value used by Caterina bootloader use to determine whether to run the + // sketch or the bootloader programmer. + uint16_t bootKey = program ? 0x7777 : 0; + + *bootKeyPtr = bootKey; + + // setup watchdog timeout + wdt_enable(WDTO_60MS); + + while(1) {} // wait for watchdog timer to trigger +} + + diff --git a/keyboards/lets-split/lets-split.h b/keyboards/lets-split/lets-split.h new file mode 100644 index 000000000..c82b95a37 --- /dev/null +++ b/keyboards/lets-split/lets-split.h @@ -0,0 +1,4 @@ +#include "quantum.h" +#include + +void promicro_bootloader_jmp(bool program); \ No newline at end of file diff --git a/keyboards/lets-split/readme.md b/keyboards/lets-split/readme.md new file mode 100644 index 000000000..e69de29bb -- cgit v1.2.3-24-g4f1b From d707738616c140f8d9c8eded7b64e5fc806f4b24 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 5 Jul 2016 23:27:10 -0400 Subject: i2c working --- keyboards/lets-split/Makefile | 73 ---- keyboards/lets-split/config.h | 87 ----- keyboards/lets-split/keymaps/default/keymap.c | 42 --- keyboards/lets-split/lets-split.c | 48 --- keyboards/lets-split/lets-split.h | 4 - keyboards/lets-split/readme.md | 0 keyboards/lets_split/Makefile | 77 +++++ keyboards/lets_split/config.h | 93 +++++ keyboards/lets_split/i2c.c | 159 +++++++++ keyboards/lets_split/i2c.h | 31 ++ keyboards/lets_split/keymaps/default/keymap.c | 42 +++ keyboards/lets_split/lets_split.c | 48 +++ keyboards/lets_split/lets_split.h | 21 ++ keyboards/lets_split/matrix.c | 310 +++++++++++++++++ keyboards/lets_split/pro_micro.h | 362 ++++++++++++++++++++ keyboards/lets_split/readme.md | 0 keyboards/lets_split/split_util.c | 67 ++++ keyboards/lets_split/split_util.h | 20 ++ keyboards/lets_split/uno-slave/Makefile | 226 ++++++++++++ .../lets_split/uno-slave/keyboard-i2c-slave.c | 42 +++ keyboards/lets_split/uno-slave/readme.md | 1 + keyboards/lets_split/uno-slave/uno-matrix.c | 160 +++++++++ keyboards/lets_split/uno-slave/uno-matrix.h | 19 ++ keyboards/lets_split/usbconfig.h | 377 +++++++++++++++++++++ tmk_core/common/matrix.h | 5 + 25 files changed, 2060 insertions(+), 254 deletions(-) delete mode 100644 keyboards/lets-split/Makefile delete mode 100644 keyboards/lets-split/config.h delete mode 100644 keyboards/lets-split/keymaps/default/keymap.c delete mode 100644 keyboards/lets-split/lets-split.c delete mode 100644 keyboards/lets-split/lets-split.h delete mode 100644 keyboards/lets-split/readme.md create mode 100644 keyboards/lets_split/Makefile create mode 100644 keyboards/lets_split/config.h create mode 100644 keyboards/lets_split/i2c.c create mode 100644 keyboards/lets_split/i2c.h create mode 100644 keyboards/lets_split/keymaps/default/keymap.c create mode 100644 keyboards/lets_split/lets_split.c create mode 100644 keyboards/lets_split/lets_split.h create mode 100644 keyboards/lets_split/matrix.c create mode 100644 keyboards/lets_split/pro_micro.h create mode 100644 keyboards/lets_split/readme.md create mode 100644 keyboards/lets_split/split_util.c create mode 100644 keyboards/lets_split/split_util.h create mode 100644 keyboards/lets_split/uno-slave/Makefile create mode 100644 keyboards/lets_split/uno-slave/keyboard-i2c-slave.c create mode 100644 keyboards/lets_split/uno-slave/readme.md create mode 100644 keyboards/lets_split/uno-slave/uno-matrix.c create mode 100644 keyboards/lets_split/uno-slave/uno-matrix.h create mode 100644 keyboards/lets_split/usbconfig.h diff --git a/keyboards/lets-split/Makefile b/keyboards/lets-split/Makefile deleted file mode 100644 index 247f978f0..000000000 --- a/keyboards/lets-split/Makefile +++ /dev/null @@ -1,73 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -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 -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= yes # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../Makefile -endif \ No newline at end of file diff --git a/keyboards/lets-split/config.h b/keyboards/lets-split/config.h deleted file mode 100644 index 5b464147d..000000000 --- a/keyboards/lets-split/config.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 0x3060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Wootpatoot -#define PRODUCT Lets Split -#define DESCRIPTION A split keyboard for the cheap makers - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 6 - -#define MATRIX_ROW_PINS { B5, B4, E6, D7, } -#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* 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 DEBOUNCING_DELAY 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)) \ -) - -/* ws2812 RGB LED */ -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD -#define ws2812_pin PD1 -#define RGBLED_NUM 28 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - -/* - * 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 - -#endif \ No newline at end of file diff --git a/keyboards/lets-split/keymaps/default/keymap.c b/keyboards/lets-split/keymaps/default/keymap.c deleted file mode 100644 index 00602394f..000000000 --- a/keyboards/lets-split/keymaps/default/keymap.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "lets-split.h" -#include "action_layer.h" - -#define BASE 0 - -enum preonic_keycodes { - KC_IDK = SAFE_RANGE, - PM_RESET -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[BASE] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T }, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G }, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B }, - {KC_IDK, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, PM_RESET } -} - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_IDK: - if (record->event.pressed) { - SEND_STRING("IDK. "); - } - return false; - break; - case PM_RESET: - if (record->event.pressed) { - promicro_bootloader_jmp(true); - } - return false; - break; - } - return true; -}; \ No newline at end of file diff --git a/keyboards/lets-split/lets-split.c b/keyboards/lets-split/lets-split.c deleted file mode 100644 index ee9872303..000000000 --- a/keyboards/lets-split/lets-split.c +++ /dev/null @@ -1,48 +0,0 @@ -#include "lets-split.h" - -#ifdef AUDIO_ENABLE - float tone_startup[][2] = SONG(STARTUP_SOUND); - float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -void matrix_init_kb(void) { - - #ifdef AUDIO_ENABLE - _delay_ms(20); // gets rid of tick - PLAY_NOTE_ARRAY(tone_startup, false, 0); - #endif - - // green led on - DDRD |= (1<<5); - PORTD &= ~(1<<5); - - // orange led on - DDRB |= (1<<0); - PORTB &= ~(1<<0); - - matrix_init_user(); -}; - -void promicro_bootloader_jmp(bool program) { - - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_goodbye, false, 0); - _delay_ms(150); - stop_all_notes(); - #endif - - uint16_t *const bootKeyPtr = (uint16_t *)0x0800; - - // Value used by Caterina bootloader use to determine whether to run the - // sketch or the bootloader programmer. - uint16_t bootKey = program ? 0x7777 : 0; - - *bootKeyPtr = bootKey; - - // setup watchdog timeout - wdt_enable(WDTO_60MS); - - while(1) {} // wait for watchdog timer to trigger -} - - diff --git a/keyboards/lets-split/lets-split.h b/keyboards/lets-split/lets-split.h deleted file mode 100644 index c82b95a37..000000000 --- a/keyboards/lets-split/lets-split.h +++ /dev/null @@ -1,4 +0,0 @@ -#include "quantum.h" -#include - -void promicro_bootloader_jmp(bool program); \ No newline at end of file diff --git a/keyboards/lets-split/readme.md b/keyboards/lets-split/readme.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/keyboards/lets_split/Makefile b/keyboards/lets_split/Makefile new file mode 100644 index 000000000..d8e283896 --- /dev/null +++ b/keyboards/lets_split/Makefile @@ -0,0 +1,77 @@ +SRC += matrix.c \ + i2c.c \ + split_util.c + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= yes # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +ifndef QUANTUM_DIR + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h new file mode 100644 index 000000000..e68787e0b --- /dev/null +++ b/keyboards/lets_split/config.h @@ -0,0 +1,93 @@ +/* +Copyright 2012 Jun Wako + +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 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Wootpatoot +#define PRODUCT Lets Split +#define DESCRIPTION A split keyboard for the cheap makers + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { B5, B4, E6, D7 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } + +#define USE_I2C + +// #define I2C_MASTER_LEFT +#define I2C_MASTER_RIGHT + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* 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 DEBOUNCING_DELAY 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)) \ +) + +/* ws2812 RGB LED */ +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD +#define ws2812_pin PD1 +#define RGBLED_NUM 28 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * 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 + +#endif \ No newline at end of file diff --git a/keyboards/lets_split/i2c.c b/keyboards/lets_split/i2c.c new file mode 100644 index 000000000..c72789403 --- /dev/null +++ b/keyboards/lets_split/i2c.c @@ -0,0 +1,159 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency +#define SCL_CLOCK 100000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + +#endif diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c new file mode 100644 index 000000000..01e3593c2 --- /dev/null +++ b/keyboards/lets_split/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +#include "lets_split.h" +#include "action_layer.h" + +#define BASE 0 + +enum preonic_keycodes { + KC_IDK = SAFE_RANGE, + PM_RESET +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[BASE] = KEYMAP( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_IDK, KC_LCTL, KC_LALT, KC_LGUI, PM_RESET,KC_SPC, KC_SPC, PM_RESET,KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_IDK: + if (record->event.pressed) { + SEND_STRING("IDK. "); + } + return false; + break; + case PM_RESET: + if (record->event.pressed) { + promicro_bootloader_jmp(true); + } + return false; + break; + } + return true; +}; \ No newline at end of file diff --git a/keyboards/lets_split/lets_split.c b/keyboards/lets_split/lets_split.c new file mode 100644 index 000000000..1859dc20a --- /dev/null +++ b/keyboards/lets_split/lets_split.c @@ -0,0 +1,48 @@ +#include "lets_split.h" + +#ifdef AUDIO_ENABLE + float tone_startup[][2] = SONG(STARTUP_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void matrix_init_kb(void) { + + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); + #endif + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + +void promicro_bootloader_jmp(bool program) { + + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); + #endif + + uint16_t *const bootKeyPtr = (uint16_t *)0x0800; + + // Value used by Caterina bootloader use to determine whether to run the + // sketch or the bootloader programmer. + uint16_t bootKey = program ? 0x7777 : 0; + + *bootKeyPtr = bootKey; + + // setup watchdog timeout + wdt_enable(WDTO_60MS); + + while(1) {} // wait for watchdog timer to trigger +} + + diff --git a/keyboards/lets_split/lets_split.h b/keyboards/lets_split/lets_split.h new file mode 100644 index 000000000..e59aed592 --- /dev/null +++ b/keyboards/lets_split/lets_split.h @@ -0,0 +1,21 @@ +#include "quantum.h" +#include + +void promicro_bootloader_jmp(bool program); + +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ + k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ + k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ + k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k40, k41, k42, k43, k44, k45 }, \ + { k50, k51, k52, k53, k54, k55 }, \ + { k60, k61, k62, k63, k64, k65 }, \ + { k70, k71, k72, k73, k74, k75 } \ + } \ No newline at end of file diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c new file mode 100644 index 000000000..16c2ba0ba --- /dev/null +++ b/keyboards/lets_split/matrix.c @@ -0,0 +1,310 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "i2c.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#ifndef USE_I2C +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + if (serial_update_buffers()) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + int ret = _matrix_scan(); + + + +#ifdef USE_I2C + if( i2c_transaction() ) { +#else + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + + matrix_scan_quantum(); + + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2); + +#ifdef USE_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/lets_split/pro_micro.h b/keyboards/lets_split/pro_micro.h new file mode 100644 index 000000000..09e219b7b --- /dev/null +++ b/keyboards/lets_split/pro_micro.h @@ -0,0 +1,362 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +// Workaround for wrong definitions in "iom32u4.h". +// This should be fixed in the AVR toolchain. +#undef UHCON +#undef UHINT +#undef UHIEN +#undef UHADDR +#undef UHFNUM +#undef UHFNUML +#undef UHFNUMH +#undef UHFLEN +#undef UPINRQX +#undef UPINTX +#undef UPNUM +#undef UPRST +#undef UPCONX +#undef UPCFG0X +#undef UPCFG1X +#undef UPSTAX +#undef UPCFG2X +#undef UPIENX +#undef UPDATX +#undef TCCR2A +#undef WGM20 +#undef WGM21 +#undef COM2B0 +#undef COM2B1 +#undef COM2A0 +#undef COM2A1 +#undef TCCR2B +#undef CS20 +#undef CS21 +#undef CS22 +#undef WGM22 +#undef FOC2B +#undef FOC2A +#undef TCNT2 +#undef TCNT2_0 +#undef TCNT2_1 +#undef TCNT2_2 +#undef TCNT2_3 +#undef TCNT2_4 +#undef TCNT2_5 +#undef TCNT2_6 +#undef TCNT2_7 +#undef OCR2A +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 +#undef OCR2B +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 + +#define NUM_DIGITAL_PINS 30 +#define NUM_ANALOG_INPUTS 12 + +#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) +#define TXLED0 PORTD |= (1<<5) +#define TXLED1 PORTD &= ~(1<<5) +#define RXLED0 PORTB |= (1<<0) +#define RXLED1 PORTB &= ~(1<<0) + +static const uint8_t SDA = 2; +static const uint8_t SCL = 3; +#define LED_BUILTIN 13 + +// Map SPI port to 'new' pins D14..D17 +static const uint8_t SS = 17; +static const uint8_t MOSI = 16; +static const uint8_t MISO = 14; +static const uint8_t SCK = 15; + +// Mapping of analog pins as digital I/O +// A6-A11 share with digital pins +static const uint8_t A0 = 18; +static const uint8_t A1 = 19; +static const uint8_t A2 = 20; +static const uint8_t A3 = 21; +static const uint8_t A4 = 22; +static const uint8_t A5 = 23; +static const uint8_t A6 = 24; // D4 +static const uint8_t A7 = 25; // D6 +static const uint8_t A8 = 26; // D8 +static const uint8_t A9 = 27; // D9 +static const uint8_t A10 = 28; // D10 +static const uint8_t A11 = 29; // D12 + +#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) 0 +#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) +#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) + +// __AVR_ATmega32U4__ has an unusual mapping of pins to channels +extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; +#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) + +#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) + +#ifdef ARDUINO_MAIN + +// On the Arduino board, digital pins are also used +// for the analog output (software PWM). Analog input +// pins are a separate set. + +// ATMEL ATMEGA32U4 / ARDUINO LEONARDO +// +// D0 PD2 RXD1/INT2 +// D1 PD3 TXD1/INT3 +// D2 PD1 SDA SDA/INT1 +// D3# PD0 PWM8/SCL OC0B/SCL/INT0 +// D4 A6 PD4 ADC8 +// D5# PC6 ??? OC3A/#OC4A +// D6# A7 PD7 FastPWM #OC4D/ADC10 +// D7 PE6 INT6/AIN0 +// +// D8 A8 PB4 ADC11/PCINT4 +// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 +// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 +// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 +// D12 A11 PD6 T1/#OC4D/ADC9 +// D13# PC7 PWM10 CLK0/OC4A +// +// A0 D18 PF7 ADC7 +// A1 D19 PF6 ADC6 +// A2 D20 PF5 ADC5 +// A3 D21 PF4 ADC4 +// A4 D22 PF1 ADC1 +// A5 D23 PF0 ADC0 +// +// New pins D14..D17 to map SPI port to digital pins +// +// MISO D14 PB3 MISO,PCINT3 +// SCK D15 PB1 SCK,PCINT1 +// MOSI D16 PB2 MOSI,PCINT2 +// SS D17 PB0 RXLED,SS/PCINT0 +// +// Connected LEDs on board for TX and RX +// TXLED D24 PD5 XCK1 +// RXLED D17 PB0 +// HWB PE2 HWB + +// these arrays map port names (e.g. port B) to the +// appropriate addresses for various functions (e.g. reading +// and writing) +const uint16_t PROGMEM port_to_mode_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &DDRB, + (uint16_t) &DDRC, + (uint16_t) &DDRD, + (uint16_t) &DDRE, + (uint16_t) &DDRF, +}; + +const uint16_t PROGMEM port_to_output_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PORTB, + (uint16_t) &PORTC, + (uint16_t) &PORTD, + (uint16_t) &PORTE, + (uint16_t) &PORTF, +}; + +const uint16_t PROGMEM port_to_input_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PINB, + (uint16_t) &PINC, + (uint16_t) &PIND, + (uint16_t) &PINE, + (uint16_t) &PINF, +}; + +const uint8_t PROGMEM digital_pin_to_port_PGM[] = { + PD, // D0 - PD2 + PD, // D1 - PD3 + PD, // D2 - PD1 + PD, // D3 - PD0 + PD, // D4 - PD4 + PC, // D5 - PC6 + PD, // D6 - PD7 + PE, // D7 - PE6 + + PB, // D8 - PB4 + PB, // D9 - PB5 + PB, // D10 - PB6 + PB, // D11 - PB7 + PD, // D12 - PD6 + PC, // D13 - PC7 + + PB, // D14 - MISO - PB3 + PB, // D15 - SCK - PB1 + PB, // D16 - MOSI - PB2 + PB, // D17 - SS - PB0 + + PF, // D18 - A0 - PF7 + PF, // D19 - A1 - PF6 + PF, // D20 - A2 - PF5 + PF, // D21 - A3 - PF4 + PF, // D22 - A4 - PF1 + PF, // D23 - A5 - PF0 + + PD, // D24 - PD5 + PD, // D25 / D6 - A7 - PD7 + PB, // D26 / D8 - A8 - PB4 + PB, // D27 / D9 - A9 - PB5 + PB, // D28 / D10 - A10 - PB6 + PD, // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { + _BV(2), // D0 - PD2 + _BV(3), // D1 - PD3 + _BV(1), // D2 - PD1 + _BV(0), // D3 - PD0 + _BV(4), // D4 - PD4 + _BV(6), // D5 - PC6 + _BV(7), // D6 - PD7 + _BV(6), // D7 - PE6 + + _BV(4), // D8 - PB4 + _BV(5), // D9 - PB5 + _BV(6), // D10 - PB6 + _BV(7), // D11 - PB7 + _BV(6), // D12 - PD6 + _BV(7), // D13 - PC7 + + _BV(3), // D14 - MISO - PB3 + _BV(1), // D15 - SCK - PB1 + _BV(2), // D16 - MOSI - PB2 + _BV(0), // D17 - SS - PB0 + + _BV(7), // D18 - A0 - PF7 + _BV(6), // D19 - A1 - PF6 + _BV(5), // D20 - A2 - PF5 + _BV(4), // D21 - A3 - PF4 + _BV(1), // D22 - A4 - PF1 + _BV(0), // D23 - A5 - PF0 + + _BV(5), // D24 - PD5 + _BV(7), // D25 / D6 - A7 - PD7 + _BV(4), // D26 / D8 - A8 - PB4 + _BV(5), // D27 / D9 - A9 - PB5 + _BV(6), // D28 / D10 - A10 - PB6 + _BV(6), // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + TIMER0B, /* 3 */ + NOT_ON_TIMER, + TIMER3A, /* 5 */ + TIMER4D, /* 6 */ + NOT_ON_TIMER, + + NOT_ON_TIMER, + TIMER1A, /* 9 */ + TIMER1B, /* 10 */ + TIMER0A, /* 11 */ + + NOT_ON_TIMER, + TIMER4A, /* 13 */ + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, +}; + +const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { + 7, // A0 PF7 ADC7 + 6, // A1 PF6 ADC6 + 5, // A2 PF5 ADC5 + 4, // A3 PF4 ADC4 + 1, // A4 PF1 ADC1 + 0, // A5 PF0 ADC0 + 8, // A6 D4 PD4 ADC8 + 10, // A7 D6 PD7 ADC10 + 11, // A8 D8 PB4 ADC11 + 12, // A9 D9 PB5 ADC12 + 13, // A10 D10 PB6 ADC13 + 9 // A11 D12 PD6 ADC9 +}; + +#endif /* ARDUINO_MAIN */ + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_USBVIRTUAL Serial +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* Pins_Arduino_h */ diff --git a/keyboards/lets_split/readme.md b/keyboards/lets_split/readme.md new file mode 100644 index 000000000..e69de29bb diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c new file mode 100644 index 000000000..c394596e0 --- /dev/null +++ b/keyboards/lets_split/split_util.c @@ -0,0 +1,67 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "i2c.h" +#include "keyboard.h" +#include "config.h" + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); +} + +static void keyboard_master_setup(void) { +#ifdef USE_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { +#ifdef USE_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< + +#define EECONFIG_BOOTMAGIC_END (uint8_t *)10 +#define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); +void keyboard_slave_loop(void); + +#endif diff --git a/keyboards/lets_split/uno-slave/Makefile b/keyboards/lets_split/uno-slave/Makefile new file mode 100644 index 000000000..84e67de11 --- /dev/null +++ b/keyboards/lets_split/uno-slave/Makefile @@ -0,0 +1,226 @@ +# Hey Emacs, this is a -*- makefile -*- + +# AVR-GCC Makefile template, derived from the WinAVR template (which +# is public domain), believed to be neutral to any flavor of "make" +# (GNU make, BSD make, SysV make) + + +MCU = atmega328p +FORMAT = ihex +TARGET = keyboard-i2c-slave +SRC = \ + $(TARGET).c \ + uno-matrix.c \ + ../serial.c \ + ../i2c-slave.c + +ASRC = +OPT = s + +# Programming support using avrdude. Settings and variables. + +AVRDUDE_PROGRAMMER = arduino +AVRDUDE_PORT = /dev/ttyACM0 + +# Name of this Makefile (used for "make depend"). +MAKEFILE = Makefile + +# Debugging format. +# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. +# AVR (extended) COFF requires stabs, plus an avr-objcopy run. +DEBUG = stabs + +# Compiler flag to set the C Standard level. +# c89 - "ANSI" C +# gnu89 - c89 plus GCC extensions +# c99 - ISO C99 standard (not yet fully implemented) +# gnu99 - c99 plus GCC extensions +CSTANDARD = -std=gnu99 + +# Place -D or -U options here +CDEFS = + +# Place -I options here +CINCS = + + +CDEBUG = -g$(DEBUG) +CWARN = -Wall -Wstrict-prototypes +CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums +#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) +CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) \ + -fno-aggressive-loop-optimizations + +#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs + + +#Additional libraries. + +# Minimalistic printf version +PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min + +# Floating point printf version (requires MATH_LIB = -lm below) +PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt + +PRINTF_LIB = + +# Minimalistic scanf version +SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min + +# Floating point + %[ scanf version (requires MATH_LIB = -lm below) +SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt + +SCANF_LIB = + +MATH_LIB = -lm + +# External memory options + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# used for variables (.data/.bss) and heap (malloc()). +#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# only used for heap (malloc()). +#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff + +EXTMEMOPTS = + +#LDMAP = $(LDFLAGS) -Wl,-Map=$(TARGET).map,--cref +LDFLAGS = $(EXTMEMOPTS) $(LDMAP) $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) + + +AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex +#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep + + +# Uncomment the following if you want avrdude's erase cycle counter. +# Note that this counter needs to be initialized first using -Yn, +# see avrdude manual. +#AVRDUDE_ERASE_COUNTER = -y + +# Uncomment the following if you do /not/ wish a verification to be +# performed after programming the device. +#AVRDUDE_NO_VERIFY = -V + +# Increase verbosity level. Please use this when submitting bug +# reports about avrdude. See +# to submit bug reports. +#AVRDUDE_VERBOSE = -v -v + +AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_FLAGS = $(AVRDUDE_BASIC) $(AVRDUDE_NO_VERIFY) $(AVRDUDE_VERBOSE) $(AVRDUDE_ERASE_COUNTER) + + +CC = avr-gcc +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump +SIZE = avr-size +NM = avr-nm +AVRDUDE = avrdude +REMOVE = rm -f +MV = mv -f + +# Define all object files. +OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) + +# Define all listing files. +LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) +ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + +# Default target. +all: build + +build: elf hex eep + +elf: $(TARGET).elf +hex: $(TARGET).hex +eep: $(TARGET).eep +lss: $(TARGET).lss +sym: $(TARGET).sym + + +# Program the device. +program: $(TARGET).hex $(TARGET).eep + $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) + + +# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +COFFCONVERT=$(OBJCOPY) --debugging \ +--change-section-address .data-0x800000 \ +--change-section-address .bss-0x800000 \ +--change-section-address .noinit-0x800000 \ +--change-section-address .eeprom-0x810000 + + +coff: $(TARGET).elf + $(COFFCONVERT) -O coff-avr $(TARGET).elf $(TARGET).cof + + +extcoff: $(TARGET).elf + $(COFFCONVERT) -O coff-ext-avr $(TARGET).elf $(TARGET).cof + + +.SUFFIXES: .elf .hex .eep .lss .sym + +.elf.hex: + $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ + +.elf.eep: + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ + --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ + +# Create extended listing file from ELF output file. +.elf.lss: + $(OBJDUMP) -h -S $< > $@ + +# Create a symbol table from ELF output file. +.elf.sym: + $(NM) -n $< > $@ + + + +# Link: create ELF output file from object files. +$(TARGET).elf: $(OBJ) + $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +.c.o: + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +.c.s: + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +.S.o: + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + + +# Target: clean project. +clean: + $(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).cof $(TARGET).elf \ + $(TARGET).map $(TARGET).sym $(TARGET).lss \ + $(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) + +depend: + if grep '^# DO NOT DELETE' $(MAKEFILE) >/dev/null; \ + then \ + sed -e '/^# DO NOT DELETE/,$$d' $(MAKEFILE) > \ + $(MAKEFILE).$$$$ && \ + $(MV) $(MAKEFILE).$$$$ $(MAKEFILE); \ + fi + echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' \ + >> $(MAKEFILE); \ + $(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE) + +.PHONY: all build elf hex eep lss sym program coff extcoff clean depend diff --git a/keyboards/lets_split/uno-slave/keyboard-i2c-slave.c b/keyboards/lets_split/uno-slave/keyboard-i2c-slave.c new file mode 100644 index 000000000..2043e7b94 --- /dev/null +++ b/keyboards/lets_split/uno-slave/keyboard-i2c-slave.c @@ -0,0 +1,42 @@ +#include "../i2c-slave.h" +#include "../serial.h" +#include "uno-matrix.h" + +#include +#include +#include + +void setup(void) { + // give some time for noise to clear + _delay_us(1000); + + // turn off arduino uno's led on pin 13 + DDRB |= (1 << 5); + PORTB &= ~(1 << 5); + + matrix_init(); + /* i2c_slave_init(0x32); */ + serial_slave_init(); + + /* serial_slave_buffer[0] = 0xa1; */ + /* serial_slave_buffer[1] = 0x52; */ + /* serial_slave_buffer[2] = 0xa2; */ + /* serial_slave_buffer[3] = 0x67; */ + + // need interrupts for i2c slave code to work + sei(); +} + +void loop(void) { + matrix_scan(); + for(int i=0; i +#include +#include + +#include "uno-matrix.h" + +#define debug(X) NULL +#define debug_hex(X) NULL + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + //debug_enable = true; + //debug_matrix = true; + //debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + //Serial.println(cols, BIN); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< + +typedef uint8_t matrix_row_t; + +uint8_t matrix_rows(void); +uint8_t matrix_cols(void); +void matrix_init(void); +uint8_t matrix_scan(void); +bool matrix_is_modified(void); +bool matrix_is_on(uint8_t row, uint8_t col); +matrix_row_t matrix_get_row(uint8_t row); + +#endif diff --git a/keyboards/lets_split/usbconfig.h b/keyboards/lets_split/usbconfig.h new file mode 100644 index 000000000..d0ca4c717 --- /dev/null +++ b/keyboards/lets_split/usbconfig.h @@ -0,0 +1,377 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 10 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 100 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 0 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x01 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 't', '.', 'm', '.', 'k', '.' +#define USB_CFG_VENDOR_NAME_LEN 6 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'P', 'S', '/', '2', ' ', 'k', 'e', 'y', 'b', 'o', 'a', 'r', 'd', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 't', 'e', 'r' +#define USB_CFG_DEVICE_NAME_LEN 23 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +//#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +#endif /* __usbconfig_h_included__ */ diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h index 71153a5f5..cee3593ee 100644 --- a/tmk_core/common/matrix.h +++ b/tmk_core/common/matrix.h @@ -72,6 +72,11 @@ void matrix_scan_kb(void); void matrix_init_user(void); void matrix_scan_user(void); +#ifdef I2C_SPLIT + void slave_matrix_init(void); + uint8_t slave_matrix_scan(void); +#endif + #ifdef __cplusplus } #endif -- cgit v1.2.3-24-g4f1b From ce01f88c43adef9344727998f53bb1cf74913f65 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 5 Jul 2016 23:40:54 -0400 Subject: images, docks, clean-up [skip ci] --- .../imgs/split-keyboard-i2c-schematic.png | Bin 0 -> 26565 bytes .../imgs/split-keyboard-serial-schematic.png | Bin 0 -> 19487 bytes keyboards/lets_split/matrix.c | 1 + keyboards/lets_split/readme.md | 102 ++++++++++ keyboards/lets_split/serial.c | 225 ++++++++++++++++++++ keyboards/lets_split/serial.h | 26 +++ keyboards/lets_split/split_util.c | 9 + keyboards/lets_split/split_util.h | 6 +- keyboards/lets_split/uno-slave/Makefile | 226 --------------------- .../lets_split/uno-slave/keyboard-i2c-slave.c | 42 ---- keyboards/lets_split/uno-slave/readme.md | 1 - keyboards/lets_split/uno-slave/uno-matrix.c | 160 --------------- keyboards/lets_split/uno-slave/uno-matrix.h | 19 -- keyboards/lets_split/uno_slave/Makefile | 226 +++++++++++++++++++++ .../lets_split/uno_slave/keyboard-i2c-slave.c | 42 ++++ keyboards/lets_split/uno_slave/readme.md | 1 + keyboards/lets_split/uno_slave/uno-matrix.c | 160 +++++++++++++++ keyboards/lets_split/uno_slave/uno-matrix.h | 19 ++ 18 files changed, 815 insertions(+), 450 deletions(-) create mode 100644 keyboards/lets_split/imgs/split-keyboard-i2c-schematic.png create mode 100644 keyboards/lets_split/imgs/split-keyboard-serial-schematic.png create mode 100644 keyboards/lets_split/serial.c create mode 100644 keyboards/lets_split/serial.h delete mode 100644 keyboards/lets_split/uno-slave/Makefile delete mode 100644 keyboards/lets_split/uno-slave/keyboard-i2c-slave.c delete mode 100644 keyboards/lets_split/uno-slave/readme.md delete mode 100644 keyboards/lets_split/uno-slave/uno-matrix.c delete mode 100644 keyboards/lets_split/uno-slave/uno-matrix.h create mode 100644 keyboards/lets_split/uno_slave/Makefile create mode 100644 keyboards/lets_split/uno_slave/keyboard-i2c-slave.c create mode 100644 keyboards/lets_split/uno_slave/readme.md create mode 100644 keyboards/lets_split/uno_slave/uno-matrix.c create mode 100644 keyboards/lets_split/uno_slave/uno-matrix.h diff --git a/keyboards/lets_split/imgs/split-keyboard-i2c-schematic.png b/keyboards/lets_split/imgs/split-keyboard-i2c-schematic.png new file mode 100644 index 000000000..888294718 Binary files /dev/null and b/keyboards/lets_split/imgs/split-keyboard-i2c-schematic.png differ diff --git a/keyboards/lets_split/imgs/split-keyboard-serial-schematic.png b/keyboards/lets_split/imgs/split-keyboard-serial-schematic.png new file mode 100644 index 000000000..7621d38ed Binary files /dev/null and b/keyboards/lets_split/imgs/split-keyboard-serial-schematic.png differ diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c index 16c2ba0ba..1d768c59b 100644 --- a/keyboards/lets_split/matrix.c +++ b/keyboards/lets_split/matrix.c @@ -29,6 +29,7 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "i2c.h" +#include "serial.h" #include "split_util.h" #include "pro_micro.h" #include "config.h" diff --git a/keyboards/lets_split/readme.md b/keyboards/lets_split/readme.md index e69de29bb..73fdb0f78 100644 --- a/keyboards/lets_split/readme.md +++ b/keyboards/lets_split/readme.md @@ -0,0 +1,102 @@ +Let's Split +====== + +This readme and most of the code are from https://github.com/ahtn/tmk_keyboard/ + +Split keyboard firmware for Arduino Pro Micro or other ATmega32u4 +based boards. + +Features +-------- + +Some features supported by the firmware: + +* Either half can connect to the computer via USB, or both halves can be used + independently. +* You only need 3 wires to connect the two halves. Two for VCC and GND and one + for serial communication. +* Optional support for I2C connection between the two halves if for some + reason you require a faster connection between the two halves. Note this + requires an extra wire between halves and pull-up resistors on the data lines. + +Required Hardware +----------------- + +Apart from diodes and key switches for the keyboard matrix in each half, you +will need: + +* 2 Arduino Pro Micro's. You can find theses on aliexpress for ≈3.50USD each. +* 2 TRS sockets +* 1 TRS cable. + +Alternatively, you can use any sort of cable and socket that has at least 3 +wires. If you want to use I2C to communicate between halves, you will need a +cable with at least 4 wires and 2x 4.7kΩ pull-up resistors + +Optional Hardware +----------------- + +A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. + +Wiring +------ + +The 3 wires of the TRS cable need to connect GND, VCC, and digital pin 3 (i.e. +PD0 on the ATmega32u4) between the two Pro Micros. + +Then wire your key matrix to any of the remaining 17 IO pins of the pro micro +and modify the `matrix.c` accordingly. + +The wiring for serial: + +![serial wiring](imgs/split-keyboard-serial-schematic.png) + +The wiring for i2c: + +![i2c wiring](imgs/split-keyboard-i2c-schematic.png) + +The pull-up resistors may be placed on either half. It is also possible +to use 4 resistors and have the pull-ups in both halves, but this is +unnecessary in simple use cases. + +Notes on Software Configuration +------------------------------- + +Configuring the firmware is similar to any other TMK project. One thing +to note is that `MATIX_ROWS` in `config.h` is the total number of rows between +the two halves, i.e. if your split keyboard has 4 rows in each half, then +`MATRIX_ROWS=8`. + +Also the current implementation assumes a maximum of 8 columns, but it would +not be very difficult to adapt it to support more if required. + + +Flashing +-------- + +If you define `EE_HANDS` in your `config.h`, you will need to set the +EEPROM for the left and right halves. The EEPROM is used to store whether the +half is left handed or right handed. This makes it so that the same firmware +file will run on both hands instead of having to flash left and right handed +versions of the firmware to each half. To flash the EEPROM file for the left +half run: +``` +make eeprom-left +``` +and similarly for right half +``` +make eeprom-right +``` + +After you have flashed the EEPROM for the first time, you then need to program +the flash memory: +``` +make program +``` +Note that you need to program both halves, but you have the option of using +different keymaps for each half. You could program the left half with a QWERTY +layout and the right half with a Colemak layout. Then if you connect the left +half to a computer by USB the keyboard will use QWERTY and Colemak when the +right half is connected. + + diff --git a/keyboards/lets_split/serial.c b/keyboards/lets_split/serial.c new file mode 100644 index 000000000..f439c2f20 --- /dev/null +++ b/keyboards/lets_split/serial.c @@ -0,0 +1,225 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include + +#include "serial.h" + +// Serial pulse period in microseconds. Its probably a bad idea to lower this +// value. +#define SERIAL_DELAY 24 + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input(); + + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +} + +// Used by the master to synchronize timing with the slave. +static +void sync_recv(void) { + serial_input(); + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); + serial_delay(); +} + +// Used by the slave to send a synchronization signal to the master. +static +void sync_send(void) { + serial_output(); + + serial_low(); + serial_delay(); + + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + serial_input(); + for ( uint8_t i = 0; i < 8; ++i) { + byte = (byte << 1) | serial_read_pin(); + serial_delay(); + _delay_us(1); + } + + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 8; + serial_output(); + while( b-- ) { + if(data & (1 << b)) { + serial_high(); + } else { + serial_low(); + } + serial_delay(); + } +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + sync_send(); + + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_slave_buffer[i]); + sync_send(); + checksum += serial_slave_buffer[i]; + } + serial_write_byte(checksum); + sync_send(); + + // wait for the sync to finish sending + serial_delay(); + + // read the middle of pulses + _delay_us(SERIAL_DELAY/2); + + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_master_buffer[i] = serial_read_byte(); + sync_send(); + checksum_computed += serial_master_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_send(); + + serial_input(); // end transaction + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(1); + + // wait for the slaves response + serial_input(); + serial_high(); + _delay_us(SERIAL_DELAY); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + sei(); + return 1; + } + + // if the slave is present syncronize with it + sync_recv(); + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_slave_buffer[i] = serial_read_byte(); + sync_recv(); + checksum_computed += serial_slave_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_recv(); + + if (checksum_computed != checksum_received) { + sei(); + return 1; + } + + uint8_t checksum = 0; + // send data to the slave + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_master_buffer[i]); + sync_recv(); + checksum += serial_master_buffer[i]; + } + serial_write_byte(checksum); + sync_recv(); + + // always, release the line when not in use + serial_output(); + serial_high(); + + sei(); + return 0; +} diff --git a/keyboards/lets_split/serial.h b/keyboards/lets_split/serial.h new file mode 100644 index 000000000..15fe4db7b --- /dev/null +++ b/keyboards/lets_split/serial.h @@ -0,0 +1,26 @@ +#ifndef MY_SERIAL_H +#define MY_SERIAL_H + +#include "config.h" +#include + +/* TODO: some defines for interrupt setup */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD0) +#define SERIAL_PIN_INTERRUPT INT0_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH 1 + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); + +#endif diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c index c394596e0..65003a71a 100644 --- a/keyboards/lets_split/split_util.c +++ b/keyboards/lets_split/split_util.c @@ -7,13 +7,22 @@ #include "split_util.h" #include "matrix.h" #include "i2c.h" +#include "serial.h" #include "keyboard.h" #include "config.h" volatile bool isLeftHand = true; static void setup_handedness(void) { + #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + #ifdef I2C_MASTER_RIGHT + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif } static void keyboard_master_setup(void) { diff --git a/keyboards/lets_split/split_util.h b/keyboards/lets_split/split_util.h index cf6890d37..6b896679c 100644 --- a/keyboards/lets_split/split_util.h +++ b/keyboards/lets_split/split_util.h @@ -3,8 +3,10 @@ #include -#define EECONFIG_BOOTMAGIC_END (uint8_t *)10 -#define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END +#ifdef EE_HANDS + #define EECONFIG_BOOTMAGIC_END (uint8_t *)10 + #define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END +#endif #define SLAVE_I2C_ADDRESS 0x32 diff --git a/keyboards/lets_split/uno-slave/Makefile b/keyboards/lets_split/uno-slave/Makefile deleted file mode 100644 index 84e67de11..000000000 --- a/keyboards/lets_split/uno-slave/Makefile +++ /dev/null @@ -1,226 +0,0 @@ -# Hey Emacs, this is a -*- makefile -*- - -# AVR-GCC Makefile template, derived from the WinAVR template (which -# is public domain), believed to be neutral to any flavor of "make" -# (GNU make, BSD make, SysV make) - - -MCU = atmega328p -FORMAT = ihex -TARGET = keyboard-i2c-slave -SRC = \ - $(TARGET).c \ - uno-matrix.c \ - ../serial.c \ - ../i2c-slave.c - -ASRC = -OPT = s - -# Programming support using avrdude. Settings and variables. - -AVRDUDE_PROGRAMMER = arduino -AVRDUDE_PORT = /dev/ttyACM0 - -# Name of this Makefile (used for "make depend"). -MAKEFILE = Makefile - -# Debugging format. -# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. -# AVR (extended) COFF requires stabs, plus an avr-objcopy run. -DEBUG = stabs - -# Compiler flag to set the C Standard level. -# c89 - "ANSI" C -# gnu89 - c89 plus GCC extensions -# c99 - ISO C99 standard (not yet fully implemented) -# gnu99 - c99 plus GCC extensions -CSTANDARD = -std=gnu99 - -# Place -D or -U options here -CDEFS = - -# Place -I options here -CINCS = - - -CDEBUG = -g$(DEBUG) -CWARN = -Wall -Wstrict-prototypes -CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) -CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) \ - -fno-aggressive-loop-optimizations - -#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs - - -#Additional libraries. - -# Minimalistic printf version -PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min - -# Floating point printf version (requires MATH_LIB = -lm below) -PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt - -PRINTF_LIB = - -# Minimalistic scanf version -SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min - -# Floating point + %[ scanf version (requires MATH_LIB = -lm below) -SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt - -SCANF_LIB = - -MATH_LIB = -lm - -# External memory options - -# 64 KB of external RAM, starting after internal RAM (ATmega128!), -# used for variables (.data/.bss) and heap (malloc()). -#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff - -# 64 KB of external RAM, starting after internal RAM (ATmega128!), -# only used for heap (malloc()). -#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff - -EXTMEMOPTS = - -#LDMAP = $(LDFLAGS) -Wl,-Map=$(TARGET).map,--cref -LDFLAGS = $(EXTMEMOPTS) $(LDMAP) $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) - - -AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep - - -# Uncomment the following if you want avrdude's erase cycle counter. -# Note that this counter needs to be initialized first using -Yn, -# see avrdude manual. -#AVRDUDE_ERASE_COUNTER = -y - -# Uncomment the following if you do /not/ wish a verification to be -# performed after programming the device. -#AVRDUDE_NO_VERIFY = -V - -# Increase verbosity level. Please use this when submitting bug -# reports about avrdude. See -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS = $(AVRDUDE_BASIC) $(AVRDUDE_NO_VERIFY) $(AVRDUDE_VERBOSE) $(AVRDUDE_ERASE_COUNTER) - - -CC = avr-gcc -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size -NM = avr-nm -AVRDUDE = avrdude -REMOVE = rm -f -MV = mv -f - -# Define all object files. -OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) - -# Define all listing files. -LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) - -# Combine all necessary flags and optional flags. -# Add target processor to flags. -ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) -ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) - - -# Default target. -all: build - -build: elf hex eep - -elf: $(TARGET).elf -hex: $(TARGET).hex -eep: $(TARGET).eep -lss: $(TARGET).lss -sym: $(TARGET).sym - - -# Program the device. -program: $(TARGET).hex $(TARGET).eep - $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) - - -# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. -COFFCONVERT=$(OBJCOPY) --debugging \ ---change-section-address .data-0x800000 \ ---change-section-address .bss-0x800000 \ ---change-section-address .noinit-0x800000 \ ---change-section-address .eeprom-0x810000 - - -coff: $(TARGET).elf - $(COFFCONVERT) -O coff-avr $(TARGET).elf $(TARGET).cof - - -extcoff: $(TARGET).elf - $(COFFCONVERT) -O coff-ext-avr $(TARGET).elf $(TARGET).cof - - -.SUFFIXES: .elf .hex .eep .lss .sym - -.elf.hex: - $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ - -.elf.eep: - -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ - --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ - -# Create extended listing file from ELF output file. -.elf.lss: - $(OBJDUMP) -h -S $< > $@ - -# Create a symbol table from ELF output file. -.elf.sym: - $(NM) -n $< > $@ - - - -# Link: create ELF output file from object files. -$(TARGET).elf: $(OBJ) - $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) - - -# Compile: create object files from C source files. -.c.o: - $(CC) -c $(ALL_CFLAGS) $< -o $@ - - -# Compile: create assembler files from C source files. -.c.s: - $(CC) -S $(ALL_CFLAGS) $< -o $@ - - -# Assemble: create object files from assembler source files. -.S.o: - $(CC) -c $(ALL_ASFLAGS) $< -o $@ - - - -# Target: clean project. -clean: - $(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).cof $(TARGET).elf \ - $(TARGET).map $(TARGET).sym $(TARGET).lss \ - $(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) - -depend: - if grep '^# DO NOT DELETE' $(MAKEFILE) >/dev/null; \ - then \ - sed -e '/^# DO NOT DELETE/,$$d' $(MAKEFILE) > \ - $(MAKEFILE).$$$$ && \ - $(MV) $(MAKEFILE).$$$$ $(MAKEFILE); \ - fi - echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' \ - >> $(MAKEFILE); \ - $(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE) - -.PHONY: all build elf hex eep lss sym program coff extcoff clean depend diff --git a/keyboards/lets_split/uno-slave/keyboard-i2c-slave.c b/keyboards/lets_split/uno-slave/keyboard-i2c-slave.c deleted file mode 100644 index 2043e7b94..000000000 --- a/keyboards/lets_split/uno-slave/keyboard-i2c-slave.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "../i2c-slave.h" -#include "../serial.h" -#include "uno-matrix.h" - -#include -#include -#include - -void setup(void) { - // give some time for noise to clear - _delay_us(1000); - - // turn off arduino uno's led on pin 13 - DDRB |= (1 << 5); - PORTB &= ~(1 << 5); - - matrix_init(); - /* i2c_slave_init(0x32); */ - serial_slave_init(); - - /* serial_slave_buffer[0] = 0xa1; */ - /* serial_slave_buffer[1] = 0x52; */ - /* serial_slave_buffer[2] = 0xa2; */ - /* serial_slave_buffer[3] = 0x67; */ - - // need interrupts for i2c slave code to work - sei(); -} - -void loop(void) { - matrix_scan(); - for(int i=0; i -#include -#include - -#include "uno-matrix.h" - -#define debug(X) NULL -#define debug_hex(X) NULL - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - //debug_enable = true; - //debug_matrix = true; - //debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - //Serial.println(cols, BIN); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1< - -typedef uint8_t matrix_row_t; - -uint8_t matrix_rows(void); -uint8_t matrix_cols(void); -void matrix_init(void); -uint8_t matrix_scan(void); -bool matrix_is_modified(void); -bool matrix_is_on(uint8_t row, uint8_t col); -matrix_row_t matrix_get_row(uint8_t row); - -#endif diff --git a/keyboards/lets_split/uno_slave/Makefile b/keyboards/lets_split/uno_slave/Makefile new file mode 100644 index 000000000..84e67de11 --- /dev/null +++ b/keyboards/lets_split/uno_slave/Makefile @@ -0,0 +1,226 @@ +# Hey Emacs, this is a -*- makefile -*- + +# AVR-GCC Makefile template, derived from the WinAVR template (which +# is public domain), believed to be neutral to any flavor of "make" +# (GNU make, BSD make, SysV make) + + +MCU = atmega328p +FORMAT = ihex +TARGET = keyboard-i2c-slave +SRC = \ + $(TARGET).c \ + uno-matrix.c \ + ../serial.c \ + ../i2c-slave.c + +ASRC = +OPT = s + +# Programming support using avrdude. Settings and variables. + +AVRDUDE_PROGRAMMER = arduino +AVRDUDE_PORT = /dev/ttyACM0 + +# Name of this Makefile (used for "make depend"). +MAKEFILE = Makefile + +# Debugging format. +# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. +# AVR (extended) COFF requires stabs, plus an avr-objcopy run. +DEBUG = stabs + +# Compiler flag to set the C Standard level. +# c89 - "ANSI" C +# gnu89 - c89 plus GCC extensions +# c99 - ISO C99 standard (not yet fully implemented) +# gnu99 - c99 plus GCC extensions +CSTANDARD = -std=gnu99 + +# Place -D or -U options here +CDEFS = + +# Place -I options here +CINCS = + + +CDEBUG = -g$(DEBUG) +CWARN = -Wall -Wstrict-prototypes +CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums +#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) +CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) \ + -fno-aggressive-loop-optimizations + +#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs + + +#Additional libraries. + +# Minimalistic printf version +PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min + +# Floating point printf version (requires MATH_LIB = -lm below) +PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt + +PRINTF_LIB = + +# Minimalistic scanf version +SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min + +# Floating point + %[ scanf version (requires MATH_LIB = -lm below) +SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt + +SCANF_LIB = + +MATH_LIB = -lm + +# External memory options + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# used for variables (.data/.bss) and heap (malloc()). +#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff + +# 64 KB of external RAM, starting after internal RAM (ATmega128!), +# only used for heap (malloc()). +#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff + +EXTMEMOPTS = + +#LDMAP = $(LDFLAGS) -Wl,-Map=$(TARGET).map,--cref +LDFLAGS = $(EXTMEMOPTS) $(LDMAP) $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) + + +AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex +#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep + + +# Uncomment the following if you want avrdude's erase cycle counter. +# Note that this counter needs to be initialized first using -Yn, +# see avrdude manual. +#AVRDUDE_ERASE_COUNTER = -y + +# Uncomment the following if you do /not/ wish a verification to be +# performed after programming the device. +#AVRDUDE_NO_VERIFY = -V + +# Increase verbosity level. Please use this when submitting bug +# reports about avrdude. See +# to submit bug reports. +#AVRDUDE_VERBOSE = -v -v + +AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) +AVRDUDE_FLAGS = $(AVRDUDE_BASIC) $(AVRDUDE_NO_VERIFY) $(AVRDUDE_VERBOSE) $(AVRDUDE_ERASE_COUNTER) + + +CC = avr-gcc +OBJCOPY = avr-objcopy +OBJDUMP = avr-objdump +SIZE = avr-size +NM = avr-nm +AVRDUDE = avrdude +REMOVE = rm -f +MV = mv -f + +# Define all object files. +OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) + +# Define all listing files. +LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) + +# Combine all necessary flags and optional flags. +# Add target processor to flags. +ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) +ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) + + +# Default target. +all: build + +build: elf hex eep + +elf: $(TARGET).elf +hex: $(TARGET).hex +eep: $(TARGET).eep +lss: $(TARGET).lss +sym: $(TARGET).sym + + +# Program the device. +program: $(TARGET).hex $(TARGET).eep + $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) + + +# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. +COFFCONVERT=$(OBJCOPY) --debugging \ +--change-section-address .data-0x800000 \ +--change-section-address .bss-0x800000 \ +--change-section-address .noinit-0x800000 \ +--change-section-address .eeprom-0x810000 + + +coff: $(TARGET).elf + $(COFFCONVERT) -O coff-avr $(TARGET).elf $(TARGET).cof + + +extcoff: $(TARGET).elf + $(COFFCONVERT) -O coff-ext-avr $(TARGET).elf $(TARGET).cof + + +.SUFFIXES: .elf .hex .eep .lss .sym + +.elf.hex: + $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ + +.elf.eep: + -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ + --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ + +# Create extended listing file from ELF output file. +.elf.lss: + $(OBJDUMP) -h -S $< > $@ + +# Create a symbol table from ELF output file. +.elf.sym: + $(NM) -n $< > $@ + + + +# Link: create ELF output file from object files. +$(TARGET).elf: $(OBJ) + $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) + + +# Compile: create object files from C source files. +.c.o: + $(CC) -c $(ALL_CFLAGS) $< -o $@ + + +# Compile: create assembler files from C source files. +.c.s: + $(CC) -S $(ALL_CFLAGS) $< -o $@ + + +# Assemble: create object files from assembler source files. +.S.o: + $(CC) -c $(ALL_ASFLAGS) $< -o $@ + + + +# Target: clean project. +clean: + $(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).cof $(TARGET).elf \ + $(TARGET).map $(TARGET).sym $(TARGET).lss \ + $(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) + +depend: + if grep '^# DO NOT DELETE' $(MAKEFILE) >/dev/null; \ + then \ + sed -e '/^# DO NOT DELETE/,$$d' $(MAKEFILE) > \ + $(MAKEFILE).$$$$ && \ + $(MV) $(MAKEFILE).$$$$ $(MAKEFILE); \ + fi + echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' \ + >> $(MAKEFILE); \ + $(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE) + +.PHONY: all build elf hex eep lss sym program coff extcoff clean depend diff --git a/keyboards/lets_split/uno_slave/keyboard-i2c-slave.c b/keyboards/lets_split/uno_slave/keyboard-i2c-slave.c new file mode 100644 index 000000000..2043e7b94 --- /dev/null +++ b/keyboards/lets_split/uno_slave/keyboard-i2c-slave.c @@ -0,0 +1,42 @@ +#include "../i2c-slave.h" +#include "../serial.h" +#include "uno-matrix.h" + +#include +#include +#include + +void setup(void) { + // give some time for noise to clear + _delay_us(1000); + + // turn off arduino uno's led on pin 13 + DDRB |= (1 << 5); + PORTB &= ~(1 << 5); + + matrix_init(); + /* i2c_slave_init(0x32); */ + serial_slave_init(); + + /* serial_slave_buffer[0] = 0xa1; */ + /* serial_slave_buffer[1] = 0x52; */ + /* serial_slave_buffer[2] = 0xa2; */ + /* serial_slave_buffer[3] = 0x67; */ + + // need interrupts for i2c slave code to work + sei(); +} + +void loop(void) { + matrix_scan(); + for(int i=0; i +#include +#include + +#include "uno-matrix.h" + +#define debug(X) NULL +#define debug_hex(X) NULL + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + //debug_enable = true; + //debug_matrix = true; + //debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + //Serial.println(cols, BIN); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< + +typedef uint8_t matrix_row_t; + +uint8_t matrix_rows(void); +uint8_t matrix_cols(void); +void matrix_init(void); +uint8_t matrix_scan(void); +bool matrix_is_modified(void); +bool matrix_is_on(uint8_t row, uint8_t col); +matrix_row_t matrix_get_row(uint8_t row); + +#endif -- cgit v1.2.3-24-g4f1b From dd2522ba8b4acbf4bcd882d5e81df6410d9b69fb Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 5 Jul 2016 23:52:18 -0400 Subject: add options to config.h --- keyboards/lets_split/config.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index e68787e0b..5937ca44e 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h @@ -29,6 +29,7 @@ along with this program. If not, see . #define DESCRIPTION A split keyboard for the cheap makers /* key matrix size */ +// Rows are doubled-up #define MATRIX_ROWS 8 #define MATRIX_COLS 6 @@ -38,8 +39,10 @@ along with this program. If not, see . #define USE_I2C -// #define I2C_MASTER_LEFT -#define I2C_MASTER_RIGHT +// #define EE_HANDS + +#define I2C_MASTER_LEFT +// #define I2C_MASTER_RIGHT /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW -- cgit v1.2.3-24-g4f1b From cb410729e631af9f962726c394956401b7c18079 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 5 Jul 2016 23:56:42 -0400 Subject: remove uno_slave for now, even though it's freakin cool --- keyboards/lets_split/uno_slave/Makefile | 226 --------------------- .../lets_split/uno_slave/keyboard-i2c-slave.c | 42 ---- keyboards/lets_split/uno_slave/readme.md | 1 - keyboards/lets_split/uno_slave/uno-matrix.c | 160 --------------- keyboards/lets_split/uno_slave/uno-matrix.h | 19 -- 5 files changed, 448 deletions(-) delete mode 100644 keyboards/lets_split/uno_slave/Makefile delete mode 100644 keyboards/lets_split/uno_slave/keyboard-i2c-slave.c delete mode 100644 keyboards/lets_split/uno_slave/readme.md delete mode 100644 keyboards/lets_split/uno_slave/uno-matrix.c delete mode 100644 keyboards/lets_split/uno_slave/uno-matrix.h diff --git a/keyboards/lets_split/uno_slave/Makefile b/keyboards/lets_split/uno_slave/Makefile deleted file mode 100644 index 84e67de11..000000000 --- a/keyboards/lets_split/uno_slave/Makefile +++ /dev/null @@ -1,226 +0,0 @@ -# Hey Emacs, this is a -*- makefile -*- - -# AVR-GCC Makefile template, derived from the WinAVR template (which -# is public domain), believed to be neutral to any flavor of "make" -# (GNU make, BSD make, SysV make) - - -MCU = atmega328p -FORMAT = ihex -TARGET = keyboard-i2c-slave -SRC = \ - $(TARGET).c \ - uno-matrix.c \ - ../serial.c \ - ../i2c-slave.c - -ASRC = -OPT = s - -# Programming support using avrdude. Settings and variables. - -AVRDUDE_PROGRAMMER = arduino -AVRDUDE_PORT = /dev/ttyACM0 - -# Name of this Makefile (used for "make depend"). -MAKEFILE = Makefile - -# Debugging format. -# Native formats for AVR-GCC's -g are stabs [default], or dwarf-2. -# AVR (extended) COFF requires stabs, plus an avr-objcopy run. -DEBUG = stabs - -# Compiler flag to set the C Standard level. -# c89 - "ANSI" C -# gnu89 - c89 plus GCC extensions -# c99 - ISO C99 standard (not yet fully implemented) -# gnu99 - c99 plus GCC extensions -CSTANDARD = -std=gnu99 - -# Place -D or -U options here -CDEFS = - -# Place -I options here -CINCS = - - -CDEBUG = -g$(DEBUG) -CWARN = -Wall -Wstrict-prototypes -CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -#CEXTRA = -Wa,-adhlns=$(<:.c=.lst) -CFLAGS = $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) \ - -fno-aggressive-loop-optimizations - -#ASFLAGS = -Wa,-adhlns=$(<:.S=.lst),-gstabs - - -#Additional libraries. - -# Minimalistic printf version -PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min - -# Floating point printf version (requires MATH_LIB = -lm below) -PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt - -PRINTF_LIB = - -# Minimalistic scanf version -SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min - -# Floating point + %[ scanf version (requires MATH_LIB = -lm below) -SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt - -SCANF_LIB = - -MATH_LIB = -lm - -# External memory options - -# 64 KB of external RAM, starting after internal RAM (ATmega128!), -# used for variables (.data/.bss) and heap (malloc()). -#EXTMEMOPTS = -Wl,--section-start,.data=0x801100,--defsym=__heap_end=0x80ffff - -# 64 KB of external RAM, starting after internal RAM (ATmega128!), -# only used for heap (malloc()). -#EXTMEMOPTS = -Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x80ffff - -EXTMEMOPTS = - -#LDMAP = $(LDFLAGS) -Wl,-Map=$(TARGET).map,--cref -LDFLAGS = $(EXTMEMOPTS) $(LDMAP) $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB) - - -AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex -#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep - - -# Uncomment the following if you want avrdude's erase cycle counter. -# Note that this counter needs to be initialized first using -Yn, -# see avrdude manual. -#AVRDUDE_ERASE_COUNTER = -y - -# Uncomment the following if you do /not/ wish a verification to be -# performed after programming the device. -#AVRDUDE_NO_VERIFY = -V - -# Increase verbosity level. Please use this when submitting bug -# reports about avrdude. See -# to submit bug reports. -#AVRDUDE_VERBOSE = -v -v - -AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) -AVRDUDE_FLAGS = $(AVRDUDE_BASIC) $(AVRDUDE_NO_VERIFY) $(AVRDUDE_VERBOSE) $(AVRDUDE_ERASE_COUNTER) - - -CC = avr-gcc -OBJCOPY = avr-objcopy -OBJDUMP = avr-objdump -SIZE = avr-size -NM = avr-nm -AVRDUDE = avrdude -REMOVE = rm -f -MV = mv -f - -# Define all object files. -OBJ = $(SRC:.c=.o) $(ASRC:.S=.o) - -# Define all listing files. -LST = $(ASRC:.S=.lst) $(SRC:.c=.lst) - -# Combine all necessary flags and optional flags. -# Add target processor to flags. -ALL_CFLAGS = -mmcu=$(MCU) -I. $(CFLAGS) -ALL_ASFLAGS = -mmcu=$(MCU) -I. -x assembler-with-cpp $(ASFLAGS) - - -# Default target. -all: build - -build: elf hex eep - -elf: $(TARGET).elf -hex: $(TARGET).hex -eep: $(TARGET).eep -lss: $(TARGET).lss -sym: $(TARGET).sym - - -# Program the device. -program: $(TARGET).hex $(TARGET).eep - $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) - - -# Convert ELF to COFF for use in debugging / simulating in AVR Studio or VMLAB. -COFFCONVERT=$(OBJCOPY) --debugging \ ---change-section-address .data-0x800000 \ ---change-section-address .bss-0x800000 \ ---change-section-address .noinit-0x800000 \ ---change-section-address .eeprom-0x810000 - - -coff: $(TARGET).elf - $(COFFCONVERT) -O coff-avr $(TARGET).elf $(TARGET).cof - - -extcoff: $(TARGET).elf - $(COFFCONVERT) -O coff-ext-avr $(TARGET).elf $(TARGET).cof - - -.SUFFIXES: .elf .hex .eep .lss .sym - -.elf.hex: - $(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@ - -.elf.eep: - -$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" \ - --change-section-lma .eeprom=0 -O $(FORMAT) $< $@ - -# Create extended listing file from ELF output file. -.elf.lss: - $(OBJDUMP) -h -S $< > $@ - -# Create a symbol table from ELF output file. -.elf.sym: - $(NM) -n $< > $@ - - - -# Link: create ELF output file from object files. -$(TARGET).elf: $(OBJ) - $(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS) - - -# Compile: create object files from C source files. -.c.o: - $(CC) -c $(ALL_CFLAGS) $< -o $@ - - -# Compile: create assembler files from C source files. -.c.s: - $(CC) -S $(ALL_CFLAGS) $< -o $@ - - -# Assemble: create object files from assembler source files. -.S.o: - $(CC) -c $(ALL_ASFLAGS) $< -o $@ - - - -# Target: clean project. -clean: - $(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).cof $(TARGET).elf \ - $(TARGET).map $(TARGET).sym $(TARGET).lss \ - $(OBJ) $(LST) $(SRC:.c=.s) $(SRC:.c=.d) - -depend: - if grep '^# DO NOT DELETE' $(MAKEFILE) >/dev/null; \ - then \ - sed -e '/^# DO NOT DELETE/,$$d' $(MAKEFILE) > \ - $(MAKEFILE).$$$$ && \ - $(MV) $(MAKEFILE).$$$$ $(MAKEFILE); \ - fi - echo '# DO NOT DELETE THIS LINE -- make depend depends on it.' \ - >> $(MAKEFILE); \ - $(CC) -M -mmcu=$(MCU) $(CDEFS) $(CINCS) $(SRC) $(ASRC) >> $(MAKEFILE) - -.PHONY: all build elf hex eep lss sym program coff extcoff clean depend diff --git a/keyboards/lets_split/uno_slave/keyboard-i2c-slave.c b/keyboards/lets_split/uno_slave/keyboard-i2c-slave.c deleted file mode 100644 index 2043e7b94..000000000 --- a/keyboards/lets_split/uno_slave/keyboard-i2c-slave.c +++ /dev/null @@ -1,42 +0,0 @@ -#include "../i2c-slave.h" -#include "../serial.h" -#include "uno-matrix.h" - -#include -#include -#include - -void setup(void) { - // give some time for noise to clear - _delay_us(1000); - - // turn off arduino uno's led on pin 13 - DDRB |= (1 << 5); - PORTB &= ~(1 << 5); - - matrix_init(); - /* i2c_slave_init(0x32); */ - serial_slave_init(); - - /* serial_slave_buffer[0] = 0xa1; */ - /* serial_slave_buffer[1] = 0x52; */ - /* serial_slave_buffer[2] = 0xa2; */ - /* serial_slave_buffer[3] = 0x67; */ - - // need interrupts for i2c slave code to work - sei(); -} - -void loop(void) { - matrix_scan(); - for(int i=0; i -#include -#include - -#include "uno-matrix.h" - -#define debug(X) NULL -#define debug_hex(X) NULL - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif - -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - //debug_enable = true; - //debug_matrix = true; - //debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - //Serial.println(cols, BIN); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1< - -typedef uint8_t matrix_row_t; - -uint8_t matrix_rows(void); -uint8_t matrix_cols(void); -void matrix_init(void); -uint8_t matrix_scan(void); -bool matrix_is_modified(void); -bool matrix_is_on(uint8_t row, uint8_t col); -matrix_row_t matrix_get_row(uint8_t row); - -#endif -- cgit v1.2.3-24-g4f1b From 3577e26fd9916ceab58779ec6323d43da54eb3b5 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 6 Jul 2016 00:24:31 -0400 Subject: fix/annotate wait_us lines --- keyboards/ergodox_ez/matrix.c | 12 ++++++++++++ quantum/matrix.c | 14 ++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 9c1efa1d0..dc29cf5cd 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -39,6 +39,17 @@ along with this program. If not, see . #include "timer.h" #endif +/* + * This constant define not debouncing time in msecs, but amount of matrix + * scan loops which should be made to get stable debounced results. + * + * On Ergodox matrix scan rate is relatively low, because of slow I2C. + * Now it's only 317 scans/second, or about 3.15 msec/scan. + * According to Cherry specs, debouncing time is 5 msec. + * + * And so, there is no sense to have DEBOUNCE higher than 2. + */ + #ifndef DEBOUNCE # define DEBOUNCE 5 #endif @@ -181,6 +192,7 @@ uint8_t matrix_scan(void) if (debouncing) { if (--debouncing) { wait_us(1); + // this should be wait_ms(1) but has been left as-is at EZ's request } else { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; diff --git a/quantum/matrix.c b/quantum/matrix.c index 094917025..3174e0739 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -27,16 +27,6 @@ along with this program. If not, see . #include "matrix.h" /* Set 0 if debouncing isn't needed */ -/* - * This constant define not debouncing time in msecs, but amount of matrix - * scan loops which should be made to get stable debounced results. - * - * On Ergodox matrix scan rate is relatively low, because of slow I2C. - * Now it's only 317 scans/second, or about 3.15 msec/scan. - * According to Cherry specs, debouncing time is 5 msec. - * - * And so, there is no sense to have DEBOUNCE higher than 2. - */ #ifndef DEBOUNCING_DELAY # define DEBOUNCING_DELAY 5 @@ -168,7 +158,7 @@ uint8_t matrix_scan(void) if (debouncing) { if (--debouncing) { - wait_us(1); + wait_ms(1); } else { for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = matrix_debouncing[i]; @@ -192,7 +182,7 @@ uint8_t matrix_scan(void) if (debouncing) { if (--debouncing) { - wait_us(1); + wait_ms(1); } else { for (uint8_t i = 0; i < MATRIX_COLS; i++) { matrix_reversed[i] = matrix_reversed_debouncing[i]; -- cgit v1.2.3-24-g4f1b From 3ac52b2e7623152f177670549b780492a0447c12 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 6 Jul 2016 13:09:51 +0300 Subject: Remove serial_link .gitignore and .gitmodules --- quantum/serial_link/.gitignore | 1 - quantum/serial_link/.gitmodules | 3 --- 2 files changed, 4 deletions(-) delete mode 100644 quantum/serial_link/.gitignore delete mode 100644 quantum/serial_link/.gitmodules diff --git a/quantum/serial_link/.gitignore b/quantum/serial_link/.gitignore deleted file mode 100644 index 2d68e206e..000000000 --- a/quantum/serial_link/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.stackdump diff --git a/quantum/serial_link/.gitmodules b/quantum/serial_link/.gitmodules deleted file mode 100644 index 991cfe96d..000000000 --- a/quantum/serial_link/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "cgreen/cgreen"] - path = cgreen/cgreen - url = http://github.com/cgreen-devs/cgreen -- cgit v1.2.3-24-g4f1b From c5bf090d16cf1fc4d8186f1e8fbbd62457e72da6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 6 Jul 2016 13:10:30 +0300 Subject: Remove CGreen make files --- quantum/serial_link/cgreen/Makefile | 38 ------------------------------- quantum/serial_link/cgreen/Makefile.build | 33 --------------------------- quantum/serial_link/cgreen/cgreen | 1 - 3 files changed, 72 deletions(-) delete mode 100644 quantum/serial_link/cgreen/Makefile delete mode 100644 quantum/serial_link/cgreen/Makefile.build delete mode 160000 quantum/serial_link/cgreen/cgreen diff --git a/quantum/serial_link/cgreen/Makefile b/quantum/serial_link/cgreen/Makefile deleted file mode 100644 index 6b31a3f92..000000000 --- a/quantum/serial_link/cgreen/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# This Makefile ensures that the build is made out of source in a subdirectory called 'build' -# If it doesn't exist, it is created and a Makefile created there (from Makefile.build) -# -# This Makefile also contains delegation of the most common make commands -# -# If you have cmake installed you should be able to do: -# -# make -# make test -# make install -# make package -# -# That should build cgreen for C and C++, run some tests, install it locally and -# generate two distributable packages. - -all: build - cd $(CGREEN_BUILD_DIR); make all - -test: build - cd $(CGREEN_BUILD_DIR); make test - -clean: build - cd $(CGREEN_BUILD_DIR); make clean - -package: build - cd $(CGREEN_BUILD_DIR); make package - -install: - cd $(CGREEN_BUILD_DIR); make install - -############# Internal - -build: - mkdir -p $(CGREEN_BUILD_DIR) - cp Makefile.build $(CGREEN_BUILD_DIR)/Makefile - - -.SILENT: diff --git a/quantum/serial_link/cgreen/Makefile.build b/quantum/serial_link/cgreen/Makefile.build deleted file mode 100644 index f76165244..000000000 --- a/quantum/serial_link/cgreen/Makefile.build +++ /dev/null @@ -1,33 +0,0 @@ -# This Makefile is copied from the cgreen top directory (where it is -# named Makefile.build) and put in a subdirectory called 'build' where -# builds are made This Makefile then automatically creates -# subdirectories for C and C++ builds configuring them using the cmake -# command. Once created you can always tweak the cmake setup as with -# any cmake build directory - -all: build-c build-c++ - for d in build-* ; do cd $$d; make ; cd .. ; done - -clean: - for d in build-* ; do cd $$d; make clean ; cd .. ; done - -check test: - for d in build-* ; do cd $$d; make check ; cd .. ; done - -package: - for d in build-* ; do cd $$d; make package ; cd .. ; done - -install: - for d in build-* ; do cd $$d; make install ; cd .. ; done - -############ Internal - -build-c: - mkdir build-c - cd build-c; cmake -G "Unix Makefiles" $(CGREEN_DIR) - -build-c++: - mkdir build-c++ - cd build-c++; cmake -G "Unix Makefiles" -DWITH_CXX:bool=ON $(CGREEN_DIR) - -.SILENT: diff --git a/quantum/serial_link/cgreen/cgreen b/quantum/serial_link/cgreen/cgreen deleted file mode 160000 index d4d438dda..000000000 --- a/quantum/serial_link/cgreen/cgreen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d4d438dda1b7131f0bd0530b2c258e9dea6a2a9f -- cgit v1.2.3-24-g4f1b From d5e7603d551a31836bf0c59db259ddc3593a1aa7 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 6 Jul 2016 13:26:20 +0300 Subject: Remove extra serial_link subdirectory --- quantum/serial_link/README.md | 2 +- quantum/serial_link/protocol/byte_stuffer.c | 145 ++++++ quantum/serial_link/protocol/byte_stuffer.h | 34 ++ quantum/serial_link/protocol/frame_router.c | 69 +++ quantum/serial_link/protocol/frame_router.h | 38 ++ quantum/serial_link/protocol/frame_validator.c | 121 +++++ quantum/serial_link/protocol/frame_validator.h | 34 ++ quantum/serial_link/protocol/physical.h | 30 ++ quantum/serial_link/protocol/transport.c | 124 +++++ quantum/serial_link/protocol/transport.h | 151 ++++++ .../serial_link/protocol/triple_buffered_object.c | 78 ++++ .../serial_link/protocol/triple_buffered_object.h | 51 +++ quantum/serial_link/serial_link.mk | 27 -- .../serial_link/protocol/byte_stuffer.c | 145 ------ .../serial_link/protocol/byte_stuffer.h | 34 -- .../serial_link/protocol/frame_router.c | 69 --- .../serial_link/protocol/frame_router.h | 38 -- .../serial_link/protocol/frame_validator.c | 121 ----- .../serial_link/protocol/frame_validator.h | 34 -- .../serial_link/serial_link/protocol/physical.h | 30 -- .../serial_link/serial_link/protocol/transport.c | 124 ----- .../serial_link/serial_link/protocol/transport.h | 151 ------ .../serial_link/protocol/triple_buffered_object.c | 78 ---- .../serial_link/protocol/triple_buffered_object.h | 51 --- .../serial_link/serial_link/system/serial_link.c | 265 ----------- .../serial_link/serial_link/system/serial_link.h | 63 --- quantum/serial_link/serial_link/tests/Makefile | 61 --- .../serial_link/tests/byte_stuffer_tests.c | 506 --------------------- .../serial_link/tests/frame_router_tests.c | 231 ---------- .../serial_link/tests/frame_validator_tests.c | 101 ---- .../serial_link/tests/transport_tests.c | 168 ------- .../tests/triple_buffered_object_tests.c | 82 ---- quantum/serial_link/serial_link_tests.mk | 34 -- quantum/serial_link/system/serial_link.c | 265 +++++++++++ quantum/serial_link/system/serial_link.h | 63 +++ quantum/serial_link/tests/Makefile | 61 +++ quantum/serial_link/tests/byte_stuffer_tests.c | 506 +++++++++++++++++++++ quantum/serial_link/tests/frame_router_tests.c | 231 ++++++++++ quantum/serial_link/tests/frame_validator_tests.c | 101 ++++ quantum/serial_link/tests/transport_tests.c | 168 +++++++ .../tests/triple_buffered_object_tests.c | 82 ++++ 41 files changed, 2353 insertions(+), 2414 deletions(-) create mode 100644 quantum/serial_link/protocol/byte_stuffer.c create mode 100644 quantum/serial_link/protocol/byte_stuffer.h create mode 100644 quantum/serial_link/protocol/frame_router.c create mode 100644 quantum/serial_link/protocol/frame_router.h create mode 100644 quantum/serial_link/protocol/frame_validator.c create mode 100644 quantum/serial_link/protocol/frame_validator.h create mode 100644 quantum/serial_link/protocol/physical.h create mode 100644 quantum/serial_link/protocol/transport.c create mode 100644 quantum/serial_link/protocol/transport.h create mode 100644 quantum/serial_link/protocol/triple_buffered_object.c create mode 100644 quantum/serial_link/protocol/triple_buffered_object.h delete mode 100644 quantum/serial_link/serial_link.mk delete mode 100644 quantum/serial_link/serial_link/protocol/byte_stuffer.c delete mode 100644 quantum/serial_link/serial_link/protocol/byte_stuffer.h delete mode 100644 quantum/serial_link/serial_link/protocol/frame_router.c delete mode 100644 quantum/serial_link/serial_link/protocol/frame_router.h delete mode 100644 quantum/serial_link/serial_link/protocol/frame_validator.c delete mode 100644 quantum/serial_link/serial_link/protocol/frame_validator.h delete mode 100644 quantum/serial_link/serial_link/protocol/physical.h delete mode 100644 quantum/serial_link/serial_link/protocol/transport.c delete mode 100644 quantum/serial_link/serial_link/protocol/transport.h delete mode 100644 quantum/serial_link/serial_link/protocol/triple_buffered_object.c delete mode 100644 quantum/serial_link/serial_link/protocol/triple_buffered_object.h delete mode 100644 quantum/serial_link/serial_link/system/serial_link.c delete mode 100644 quantum/serial_link/serial_link/system/serial_link.h delete mode 100644 quantum/serial_link/serial_link/tests/Makefile delete mode 100644 quantum/serial_link/serial_link/tests/byte_stuffer_tests.c delete mode 100644 quantum/serial_link/serial_link/tests/frame_router_tests.c delete mode 100644 quantum/serial_link/serial_link/tests/frame_validator_tests.c delete mode 100644 quantum/serial_link/serial_link/tests/transport_tests.c delete mode 100644 quantum/serial_link/serial_link/tests/triple_buffered_object_tests.c delete mode 100644 quantum/serial_link/serial_link_tests.mk create mode 100644 quantum/serial_link/system/serial_link.c create mode 100644 quantum/serial_link/system/serial_link.h create mode 100644 quantum/serial_link/tests/Makefile create mode 100644 quantum/serial_link/tests/byte_stuffer_tests.c create mode 100644 quantum/serial_link/tests/frame_router_tests.c create mode 100644 quantum/serial_link/tests/frame_validator_tests.c create mode 100644 quantum/serial_link/tests/transport_tests.c create mode 100644 quantum/serial_link/tests/triple_buffered_object_tests.c diff --git a/quantum/serial_link/README.md b/quantum/serial_link/README.md index 94af9125c..e8490e290 100644 --- a/quantum/serial_link/README.md +++ b/quantum/serial_link/README.md @@ -1 +1 @@ -# tmk_serial_link \ No newline at end of file +# qmk_serial_link \ No newline at end of file diff --git a/quantum/serial_link/protocol/byte_stuffer.c b/quantum/serial_link/protocol/byte_stuffer.c new file mode 100644 index 000000000..fb4c45a8d --- /dev/null +++ b/quantum/serial_link/protocol/byte_stuffer.c @@ -0,0 +1,145 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "serial_link/protocol/byte_stuffer.h" +#include "serial_link/protocol/frame_validator.h" +#include "serial_link/protocol/physical.h" +#include + +// This implements the "Consistent overhead byte stuffing protocol" +// https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing +// http://www.stuartcheshire.org/papers/COBSforToN.pdf + +#define MAX_FRAME_SIZE 1024 +#define NUM_LINKS 2 + +typedef struct byte_stuffer_state { + uint16_t next_zero; + uint16_t data_pos; + bool long_frame; + uint8_t data[MAX_FRAME_SIZE]; +}byte_stuffer_state_t; + +static byte_stuffer_state_t states[NUM_LINKS]; + +void init_byte_stuffer_state(byte_stuffer_state_t* state) { + state->next_zero = 0; + state->data_pos = 0; + state->long_frame = false; +} + +void init_byte_stuffer(void) { + int i; + for (i=0;inext_zero == 0) { + state->next_zero = data; + state->long_frame = data == 0xFF; + state->data_pos = 0; + return; + } + + state->next_zero--; + if (data == 0) { + if (state->next_zero == 0) { + // The frame is completed + if (state->data_pos > 0) { + validator_recv_frame(link, state->data, state->data_pos); + } + } + else { + // The frame is invalid, so reset + init_byte_stuffer_state(state); + } + } + else { + if (state->data_pos == MAX_FRAME_SIZE) { + // We exceeded our maximum frame size + // therefore there's nothing else to do than reset to a new frame + state->next_zero = data; + state->long_frame = data == 0xFF; + state->data_pos = 0; + } + else if (state->next_zero == 0) { + if (state->long_frame) { + // This is part of a long frame, so continue + state->next_zero = data; + state->long_frame = data == 0xFF; + } + else { + // Special case for zeroes + state->next_zero = data; + state->data[state->data_pos++] = 0; + } + } + else { + state->data[state->data_pos++] = data; + } + } +} + +static void send_block(uint8_t link, uint8_t* start, uint8_t* end, uint8_t num_non_zero) { + send_data(link, &num_non_zero, 1); + if (end > start) { + send_data(link, start, end-start); + } +} + +void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size) { + const uint8_t zero = 0; + if (size > 0) { + uint16_t num_non_zero = 1; + uint8_t* end = data + size; + uint8_t* start = data; + while (data < end) { + if (num_non_zero == 0xFF) { + // There's more data after big non-zero block + // So send it, and start a new block + send_block(link, start, data, num_non_zero); + start = data; + num_non_zero = 1; + } + else { + if (*data == 0) { + // A zero encountered, so send the block + send_block(link, start, data, num_non_zero); + start = data + 1; + num_non_zero = 1; + } + else { + num_non_zero++; + } + ++data; + } + } + send_block(link, start, data, num_non_zero); + send_data(link, &zero, 1); + } +} diff --git a/quantum/serial_link/protocol/byte_stuffer.h b/quantum/serial_link/protocol/byte_stuffer.h new file mode 100644 index 000000000..2cc88beb4 --- /dev/null +++ b/quantum/serial_link/protocol/byte_stuffer.h @@ -0,0 +1,34 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_BYTE_STUFFER_H +#define SERIAL_LINK_BYTE_STUFFER_H + +#include + +void init_byte_stuffer(void); +void byte_stuffer_recv_byte(uint8_t link, uint8_t data); +void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size); + +#endif diff --git a/quantum/serial_link/protocol/frame_router.c b/quantum/serial_link/protocol/frame_router.c new file mode 100644 index 000000000..04b8c2e75 --- /dev/null +++ b/quantum/serial_link/protocol/frame_router.c @@ -0,0 +1,69 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "serial_link/protocol/frame_router.h" +#include "serial_link/protocol/transport.h" +#include "serial_link/protocol/frame_validator.h" + +static bool is_master; + +void router_set_master(bool master) { + is_master = master; +} + +void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ + if (is_master) { + if (link == DOWN_LINK) { + transport_recv_frame(data[size-1], data, size - 1); + } + } + else { + if (link == UP_LINK) { + if (data[size-1] & 1) { + transport_recv_frame(0, data, size - 1); + } + data[size-1] >>= 1; + validator_send_frame(DOWN_LINK, data, size); + } + else { + data[size-1]++; + validator_send_frame(UP_LINK, data, size); + } + } +} + +void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { + if (destination == 0) { + if (!is_master) { + data[size] = 1; + validator_send_frame(UP_LINK, data, size + 1); + } + } + else { + if (is_master) { + data[size] = destination; + validator_send_frame(DOWN_LINK, data, size + 1); + } + } +} diff --git a/quantum/serial_link/protocol/frame_router.h b/quantum/serial_link/protocol/frame_router.h new file mode 100644 index 000000000..712250ff3 --- /dev/null +++ b/quantum/serial_link/protocol/frame_router.h @@ -0,0 +1,38 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_FRAME_ROUTER_H +#define SERIAL_LINK_FRAME_ROUTER_H + +#include +#include + +#define UP_LINK 0 +#define DOWN_LINK 1 + +void router_set_master(bool master); +void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size); +void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size); + +#endif diff --git a/quantum/serial_link/protocol/frame_validator.c b/quantum/serial_link/protocol/frame_validator.c new file mode 100644 index 000000000..474f80ee8 --- /dev/null +++ b/quantum/serial_link/protocol/frame_validator.c @@ -0,0 +1,121 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "serial_link/protocol/frame_validator.h" +#include "serial_link/protocol/frame_router.h" +#include "serial_link/protocol/byte_stuffer.h" +#include + +const uint32_t poly8_lookup[256] = +{ + 0, 0x77073096, 0xEE0E612C, 0x990951BA, + 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, + 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, + 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, + 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, + 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, + 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, + 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, + 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, + 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, + 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, + 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, + 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, + 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, + 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, + 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, + 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, + 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, + 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, + 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, + 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, + 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, + 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, + 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, + 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, + 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, + 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, + 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, + 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, + 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, + 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, + 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, + 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, + 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, + 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, + 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, + 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, + 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, + 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, + 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, + 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, + 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, + 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, + 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D +}; + +static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength) +{ + uint32_t crc = 0xffffffff; + while (bytelength-- !=0) crc = poly8_lookup[((uint8_t) crc ^ *(p++))] ^ (crc >> 8); + // return (~crc); also works + return (crc ^ 0xffffffff); +} + +void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { + if (size > 4) { + uint32_t frame_crc; + memcpy(&frame_crc, data + size -4, 4); + uint32_t expected_crc = crc32_byte(data, size - 4); + if (frame_crc == expected_crc) { + route_incoming_frame(link, data, size-4); + } + } +} + +void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size) { + uint32_t crc = crc32_byte(data, size); + memcpy(data + size, &crc, 4); + byte_stuffer_send_frame(link, data, size + 4); +} diff --git a/quantum/serial_link/protocol/frame_validator.h b/quantum/serial_link/protocol/frame_validator.h new file mode 100644 index 000000000..4a910d510 --- /dev/null +++ b/quantum/serial_link/protocol/frame_validator.h @@ -0,0 +1,34 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_FRAME_VALIDATOR_H +#define SERIAL_LINK_FRAME_VALIDATOR_H + +#include + +void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size); +// The buffer pointed to by the data needs 4 additional bytes +void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size); + +#endif diff --git a/quantum/serial_link/protocol/physical.h b/quantum/serial_link/protocol/physical.h new file mode 100644 index 000000000..425e06cdd --- /dev/null +++ b/quantum/serial_link/protocol/physical.h @@ -0,0 +1,30 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_PHYSICAL_H +#define SERIAL_LINK_PHYSICAL_H + +void send_data(uint8_t link, const uint8_t* data, uint16_t size); + +#endif diff --git a/quantum/serial_link/protocol/transport.c b/quantum/serial_link/protocol/transport.c new file mode 100644 index 000000000..f418d11ce --- /dev/null +++ b/quantum/serial_link/protocol/transport.c @@ -0,0 +1,124 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "serial_link/protocol/transport.h" +#include "serial_link/protocol/frame_router.h" +#include "serial_link/protocol/triple_buffered_object.h" +#include + +#define MAX_REMOTE_OBJECTS 16 +static remote_object_t* remote_objects[MAX_REMOTE_OBJECTS]; +static uint32_t num_remote_objects = 0; + +void add_remote_objects(remote_object_t** _remote_objects, uint32_t _num_remote_objects) { + unsigned int i; + for(i=0;i<_num_remote_objects;i++) { + remote_object_t* obj = _remote_objects[i]; + remote_objects[num_remote_objects++] = obj; + if (obj->object_type == MASTER_TO_ALL_SLAVES) { + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; + triple_buffer_init(tb); + uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + tb = (triple_buffer_object_t*)start; + triple_buffer_init(tb); + } + else if(obj->object_type == MASTER_TO_SINGLE_SLAVE) { + uint8_t* start = obj->buffer; + unsigned int j; + for (j=0;jobject_size); + } + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + triple_buffer_init(tb); + } + else { + uint8_t* start = obj->buffer; + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + triple_buffer_init(tb); + start += LOCAL_OBJECT_SIZE(obj->object_size); + unsigned int j; + for (j=0;jobject_size); + } + } + } +} + +void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { + uint8_t id = data[size-1]; + if (id < num_remote_objects) { + remote_object_t* obj = remote_objects[id]; + if (obj->object_size == size - 1) { + uint8_t* start; + if (obj->object_type == MASTER_TO_ALL_SLAVES) { + start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + } + else if(obj->object_type == SLAVE_TO_MASTER) { + start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); + start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); + } + else { + start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); + } + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; + void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); + memcpy(ptr, data, size - 1); + triple_buffer_end_write_internal(tb); + } + } +} + +void update_transport(void) { + unsigned int i; + for(i=0;iobject_type == MASTER_TO_ALL_SLAVES || obj->object_type == SLAVE_TO_MASTER) { + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; + uint8_t* ptr = (uint8_t*)triple_buffer_read_internal(obj->object_size + LOCAL_OBJECT_EXTRA, tb); + if (ptr) { + ptr[obj->object_size] = i; + uint8_t dest = obj->object_type == MASTER_TO_ALL_SLAVES ? 0xFF : 0; + router_send_frame(dest, ptr, obj->object_size + 1); + } + } + else { + uint8_t* start = obj->buffer; + unsigned int j; + for (j=0;jobject_size + LOCAL_OBJECT_EXTRA, tb); + if (ptr) { + ptr[obj->object_size] = i; + uint8_t dest = j + 1; + router_send_frame(dest, ptr, obj->object_size + 1); + } + start += LOCAL_OBJECT_SIZE(obj->object_size); + } + } + } +} diff --git a/quantum/serial_link/protocol/transport.h b/quantum/serial_link/protocol/transport.h new file mode 100644 index 000000000..9a052d880 --- /dev/null +++ b/quantum/serial_link/protocol/transport.h @@ -0,0 +1,151 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_TRANSPORT_H +#define SERIAL_LINK_TRANSPORT_H + +#include "serial_link/protocol/triple_buffered_object.h" +#include "serial_link/system/serial_link.h" + +#define NUM_SLAVES 8 +#define LOCAL_OBJECT_EXTRA 16 + +// master -> slave = 1 local(target all), 1 remote object +// slave -> master = 1 local(target 0), multiple remote objects +// master -> single slave (multiple local, target id), 1 remote object +typedef enum { + MASTER_TO_ALL_SLAVES, + MASTER_TO_SINGLE_SLAVE, + SLAVE_TO_MASTER, +} remote_object_type; + +typedef struct { + remote_object_type object_type; + uint16_t object_size; + uint8_t buffer[] __attribute__((aligned(4))); +} remote_object_t; + +#define REMOTE_OBJECT_SIZE(objectsize) \ + (sizeof(triple_buffer_object_t) + objectsize * 3) +#define LOCAL_OBJECT_SIZE(objectsize) \ + (sizeof(triple_buffer_object_t) + (objectsize + LOCAL_OBJECT_EXTRA) * 3) + +#define REMOTE_OBJECT_HELPER(name, type, num_local, num_remote) \ +typedef struct { \ + remote_object_t object; \ + uint8_t buffer[ \ + num_remote * REMOTE_OBJECT_SIZE(sizeof(type)) + \ + num_local * LOCAL_OBJECT_SIZE(sizeof(type))]; \ +} remote_object_##name##_t; + +#define MASTER_TO_ALL_SLAVES_OBJECT(name, type) \ + REMOTE_OBJECT_HELPER(name, type, 1, 1) \ + remote_object_##name##_t remote_object_##name = { \ + .object = { \ + .object_type = MASTER_TO_ALL_SLAVES, \ + .object_size = sizeof(type), \ + } \ + }; \ + type* begin_write_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ + return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ + }\ + void end_write_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ + triple_buffer_end_write_internal(tb); \ + signal_data_written(); \ + }\ + type* read_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + return triple_buffer_read_internal(obj->object_size, tb); \ + } + +#define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ + REMOTE_OBJECT_HELPER(name, type, NUM_SLAVES, 1) \ + remote_object_##name##_t remote_object_##name = { \ + .object = { \ + .object_type = MASTER_TO_SINGLE_SLAVE, \ + .object_size = sizeof(type), \ + } \ + }; \ + type* begin_write_##name(uint8_t slave) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer;\ + start += slave * LOCAL_OBJECT_SIZE(obj->object_size); \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ + }\ + void end_write_##name(uint8_t slave) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer;\ + start += slave * LOCAL_OBJECT_SIZE(obj->object_size); \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + triple_buffer_end_write_internal(tb); \ + signal_data_written(); \ + }\ + type* read_##name() { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size);\ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + return triple_buffer_read_internal(obj->object_size, tb); \ + } + +#define SLAVE_TO_MASTER_OBJECT(name, type) \ + REMOTE_OBJECT_HELPER(name, type, 1, NUM_SLAVES) \ + remote_object_##name##_t remote_object_##name = { \ + .object = { \ + .object_type = SLAVE_TO_MASTER, \ + .object_size = sizeof(type), \ + } \ + }; \ + type* begin_write_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ + return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ + }\ + void end_write_##name(void) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ + triple_buffer_end_write_internal(tb); \ + signal_data_written(); \ + }\ + type* read_##name(uint8_t slave) { \ + remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ + uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ + start+=slave * REMOTE_OBJECT_SIZE(obj->object_size); \ + triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ + return triple_buffer_read_internal(obj->object_size, tb); \ + } + +#define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name + +void add_remote_objects(remote_object_t** remote_objects, uint32_t num_remote_objects); +void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); +void update_transport(void); + +#endif diff --git a/quantum/serial_link/protocol/triple_buffered_object.c b/quantum/serial_link/protocol/triple_buffered_object.c new file mode 100644 index 000000000..e3e8989d3 --- /dev/null +++ b/quantum/serial_link/protocol/triple_buffered_object.c @@ -0,0 +1,78 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include "serial_link/protocol/triple_buffered_object.h" +#include "serial_link/system/serial_link.h" +#include +#include + +#define GET_READ_INDEX() object->state & 3 +#define GET_WRITE_INDEX() (object->state >> 2) & 3 +#define GET_SHARED_INDEX() (object->state >> 4) & 3 +#define GET_DATA_AVAILABLE() (object->state >> 6) & 1 + +#define SET_READ_INDEX(i) object->state = ((object->state & ~3) | i) +#define SET_WRITE_INDEX(i) object->state = ((object->state & ~(3 << 2)) | (i << 2)) +#define SET_SHARED_INDEX(i) object->state = ((object->state & ~(3 << 4)) | (i << 4)) +#define SET_DATA_AVAILABLE(i) object->state = ((object->state & ~(1 << 6)) | (i << 6)) + +void triple_buffer_init(triple_buffer_object_t* object) { + object->state = 0; + SET_WRITE_INDEX(0); + SET_READ_INDEX(1); + SET_SHARED_INDEX(2); + SET_DATA_AVAILABLE(0); +} + +void* triple_buffer_read_internal(uint16_t object_size, triple_buffer_object_t* object) { + serial_link_lock(); + if (GET_DATA_AVAILABLE()) { + uint8_t shared_index = GET_SHARED_INDEX(); + uint8_t read_index = GET_READ_INDEX(); + SET_READ_INDEX(shared_index); + SET_SHARED_INDEX(read_index); + SET_DATA_AVAILABLE(false); + serial_link_unlock(); + return object->buffer + object_size * shared_index; + } + else { + serial_link_unlock(); + return NULL; + } +} + +void* triple_buffer_begin_write_internal(uint16_t object_size, triple_buffer_object_t* object) { + uint8_t write_index = GET_WRITE_INDEX(); + return object->buffer + object_size * write_index; +} + +void triple_buffer_end_write_internal(triple_buffer_object_t* object) { + serial_link_lock(); + uint8_t shared_index = GET_SHARED_INDEX(); + uint8_t write_index = GET_WRITE_INDEX(); + SET_SHARED_INDEX(write_index); + SET_WRITE_INDEX(shared_index); + SET_DATA_AVAILABLE(true); + serial_link_unlock(); +} diff --git a/quantum/serial_link/protocol/triple_buffered_object.h b/quantum/serial_link/protocol/triple_buffered_object.h new file mode 100644 index 000000000..2e57db3f5 --- /dev/null +++ b/quantum/serial_link/protocol/triple_buffered_object.h @@ -0,0 +1,51 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_TRIPLE_BUFFERED_OBJECT_H +#define SERIAL_LINK_TRIPLE_BUFFERED_OBJECT_H + +#include + +typedef struct { + uint8_t state; + uint8_t buffer[] __attribute__((aligned(4))); +}triple_buffer_object_t; + +void triple_buffer_init(triple_buffer_object_t* object); + +#define triple_buffer_begin_write(object) \ + (typeof(*object.buffer[0])*)triple_buffer_begin_write_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) + +#define triple_buffer_end_write(object) \ + triple_buffer_end_write_internal((triple_buffer_object_t*)object) + +#define triple_buffer_read(object) \ + (typeof(*object.buffer[0])*)triple_buffer_read_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) + +void* triple_buffer_begin_write_internal(uint16_t object_size, triple_buffer_object_t* object); +void triple_buffer_end_write_internal(triple_buffer_object_t* object); +void* triple_buffer_read_internal(uint16_t object_size, triple_buffer_object_t* object); + + +#endif diff --git a/quantum/serial_link/serial_link.mk b/quantum/serial_link/serial_link.mk deleted file mode 100644 index e164cc5ff..000000000 --- a/quantum/serial_link/serial_link.mk +++ /dev/null @@ -1,27 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Fred Sundvik -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -UINCDIR += $(SERIAL_DIR) -SRC += $(wildcard $(SERIAL_DIR)/serial_link/protocol/*.c) -SRC += $(wildcard $(SERIAL_DIR)/serial_link/system/*.c) -SRC += serial_link_hal.c -OPT_DEFS += -DUSE_SERIAL_LINK diff --git a/quantum/serial_link/serial_link/protocol/byte_stuffer.c b/quantum/serial_link/serial_link/protocol/byte_stuffer.c deleted file mode 100644 index fb4c45a8d..000000000 --- a/quantum/serial_link/serial_link/protocol/byte_stuffer.c +++ /dev/null @@ -1,145 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include "serial_link/protocol/byte_stuffer.h" -#include "serial_link/protocol/frame_validator.h" -#include "serial_link/protocol/physical.h" -#include - -// This implements the "Consistent overhead byte stuffing protocol" -// https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing -// http://www.stuartcheshire.org/papers/COBSforToN.pdf - -#define MAX_FRAME_SIZE 1024 -#define NUM_LINKS 2 - -typedef struct byte_stuffer_state { - uint16_t next_zero; - uint16_t data_pos; - bool long_frame; - uint8_t data[MAX_FRAME_SIZE]; -}byte_stuffer_state_t; - -static byte_stuffer_state_t states[NUM_LINKS]; - -void init_byte_stuffer_state(byte_stuffer_state_t* state) { - state->next_zero = 0; - state->data_pos = 0; - state->long_frame = false; -} - -void init_byte_stuffer(void) { - int i; - for (i=0;inext_zero == 0) { - state->next_zero = data; - state->long_frame = data == 0xFF; - state->data_pos = 0; - return; - } - - state->next_zero--; - if (data == 0) { - if (state->next_zero == 0) { - // The frame is completed - if (state->data_pos > 0) { - validator_recv_frame(link, state->data, state->data_pos); - } - } - else { - // The frame is invalid, so reset - init_byte_stuffer_state(state); - } - } - else { - if (state->data_pos == MAX_FRAME_SIZE) { - // We exceeded our maximum frame size - // therefore there's nothing else to do than reset to a new frame - state->next_zero = data; - state->long_frame = data == 0xFF; - state->data_pos = 0; - } - else if (state->next_zero == 0) { - if (state->long_frame) { - // This is part of a long frame, so continue - state->next_zero = data; - state->long_frame = data == 0xFF; - } - else { - // Special case for zeroes - state->next_zero = data; - state->data[state->data_pos++] = 0; - } - } - else { - state->data[state->data_pos++] = data; - } - } -} - -static void send_block(uint8_t link, uint8_t* start, uint8_t* end, uint8_t num_non_zero) { - send_data(link, &num_non_zero, 1); - if (end > start) { - send_data(link, start, end-start); - } -} - -void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size) { - const uint8_t zero = 0; - if (size > 0) { - uint16_t num_non_zero = 1; - uint8_t* end = data + size; - uint8_t* start = data; - while (data < end) { - if (num_non_zero == 0xFF) { - // There's more data after big non-zero block - // So send it, and start a new block - send_block(link, start, data, num_non_zero); - start = data; - num_non_zero = 1; - } - else { - if (*data == 0) { - // A zero encountered, so send the block - send_block(link, start, data, num_non_zero); - start = data + 1; - num_non_zero = 1; - } - else { - num_non_zero++; - } - ++data; - } - } - send_block(link, start, data, num_non_zero); - send_data(link, &zero, 1); - } -} diff --git a/quantum/serial_link/serial_link/protocol/byte_stuffer.h b/quantum/serial_link/serial_link/protocol/byte_stuffer.h deleted file mode 100644 index 2cc88beb4..000000000 --- a/quantum/serial_link/serial_link/protocol/byte_stuffer.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_BYTE_STUFFER_H -#define SERIAL_LINK_BYTE_STUFFER_H - -#include - -void init_byte_stuffer(void); -void byte_stuffer_recv_byte(uint8_t link, uint8_t data); -void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size); - -#endif diff --git a/quantum/serial_link/serial_link/protocol/frame_router.c b/quantum/serial_link/serial_link/protocol/frame_router.c deleted file mode 100644 index 04b8c2e75..000000000 --- a/quantum/serial_link/serial_link/protocol/frame_router.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include "serial_link/protocol/frame_router.h" -#include "serial_link/protocol/transport.h" -#include "serial_link/protocol/frame_validator.h" - -static bool is_master; - -void router_set_master(bool master) { - is_master = master; -} - -void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size){ - if (is_master) { - if (link == DOWN_LINK) { - transport_recv_frame(data[size-1], data, size - 1); - } - } - else { - if (link == UP_LINK) { - if (data[size-1] & 1) { - transport_recv_frame(0, data, size - 1); - } - data[size-1] >>= 1; - validator_send_frame(DOWN_LINK, data, size); - } - else { - data[size-1]++; - validator_send_frame(UP_LINK, data, size); - } - } -} - -void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { - if (destination == 0) { - if (!is_master) { - data[size] = 1; - validator_send_frame(UP_LINK, data, size + 1); - } - } - else { - if (is_master) { - data[size] = destination; - validator_send_frame(DOWN_LINK, data, size + 1); - } - } -} diff --git a/quantum/serial_link/serial_link/protocol/frame_router.h b/quantum/serial_link/serial_link/protocol/frame_router.h deleted file mode 100644 index 712250ff3..000000000 --- a/quantum/serial_link/serial_link/protocol/frame_router.h +++ /dev/null @@ -1,38 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_FRAME_ROUTER_H -#define SERIAL_LINK_FRAME_ROUTER_H - -#include -#include - -#define UP_LINK 0 -#define DOWN_LINK 1 - -void router_set_master(bool master); -void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size); -void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size); - -#endif diff --git a/quantum/serial_link/serial_link/protocol/frame_validator.c b/quantum/serial_link/serial_link/protocol/frame_validator.c deleted file mode 100644 index 474f80ee8..000000000 --- a/quantum/serial_link/serial_link/protocol/frame_validator.c +++ /dev/null @@ -1,121 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include "serial_link/protocol/frame_validator.h" -#include "serial_link/protocol/frame_router.h" -#include "serial_link/protocol/byte_stuffer.h" -#include - -const uint32_t poly8_lookup[256] = -{ - 0, 0x77073096, 0xEE0E612C, 0x990951BA, - 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, - 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, - 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, - 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, - 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, - 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, - 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, - 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, - 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, - 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, - 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, - 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, - 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, - 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, - 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, - 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, - 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, - 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, - 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, - 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, - 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, - 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, - 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, - 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, - 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, - 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, - 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, - 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, - 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, - 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, - 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, - 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, - 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, - 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, - 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, - 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, - 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, - 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, - 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, - 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, - 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, - 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, - 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, - 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, - 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, - 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, - 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, - 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, - 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D -}; - -static uint32_t crc32_byte(uint8_t *p, uint32_t bytelength) -{ - uint32_t crc = 0xffffffff; - while (bytelength-- !=0) crc = poly8_lookup[((uint8_t) crc ^ *(p++))] ^ (crc >> 8); - // return (~crc); also works - return (crc ^ 0xffffffff); -} - -void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { - if (size > 4) { - uint32_t frame_crc; - memcpy(&frame_crc, data + size -4, 4); - uint32_t expected_crc = crc32_byte(data, size - 4); - if (frame_crc == expected_crc) { - route_incoming_frame(link, data, size-4); - } - } -} - -void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size) { - uint32_t crc = crc32_byte(data, size); - memcpy(data + size, &crc, 4); - byte_stuffer_send_frame(link, data, size + 4); -} diff --git a/quantum/serial_link/serial_link/protocol/frame_validator.h b/quantum/serial_link/serial_link/protocol/frame_validator.h deleted file mode 100644 index 4a910d510..000000000 --- a/quantum/serial_link/serial_link/protocol/frame_validator.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_FRAME_VALIDATOR_H -#define SERIAL_LINK_FRAME_VALIDATOR_H - -#include - -void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size); -// The buffer pointed to by the data needs 4 additional bytes -void validator_send_frame(uint8_t link, uint8_t* data, uint16_t size); - -#endif diff --git a/quantum/serial_link/serial_link/protocol/physical.h b/quantum/serial_link/serial_link/protocol/physical.h deleted file mode 100644 index 425e06cdd..000000000 --- a/quantum/serial_link/serial_link/protocol/physical.h +++ /dev/null @@ -1,30 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_PHYSICAL_H -#define SERIAL_LINK_PHYSICAL_H - -void send_data(uint8_t link, const uint8_t* data, uint16_t size); - -#endif diff --git a/quantum/serial_link/serial_link/protocol/transport.c b/quantum/serial_link/serial_link/protocol/transport.c deleted file mode 100644 index f418d11ce..000000000 --- a/quantum/serial_link/serial_link/protocol/transport.c +++ /dev/null @@ -1,124 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include "serial_link/protocol/transport.h" -#include "serial_link/protocol/frame_router.h" -#include "serial_link/protocol/triple_buffered_object.h" -#include - -#define MAX_REMOTE_OBJECTS 16 -static remote_object_t* remote_objects[MAX_REMOTE_OBJECTS]; -static uint32_t num_remote_objects = 0; - -void add_remote_objects(remote_object_t** _remote_objects, uint32_t _num_remote_objects) { - unsigned int i; - for(i=0;i<_num_remote_objects;i++) { - remote_object_t* obj = _remote_objects[i]; - remote_objects[num_remote_objects++] = obj; - if (obj->object_type == MASTER_TO_ALL_SLAVES) { - triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; - triple_buffer_init(tb); - uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - tb = (triple_buffer_object_t*)start; - triple_buffer_init(tb); - } - else if(obj->object_type == MASTER_TO_SINGLE_SLAVE) { - uint8_t* start = obj->buffer; - unsigned int j; - for (j=0;jobject_size); - } - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; - triple_buffer_init(tb); - } - else { - uint8_t* start = obj->buffer; - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; - triple_buffer_init(tb); - start += LOCAL_OBJECT_SIZE(obj->object_size); - unsigned int j; - for (j=0;jobject_size); - } - } - } -} - -void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { - uint8_t id = data[size-1]; - if (id < num_remote_objects) { - remote_object_t* obj = remote_objects[id]; - if (obj->object_size == size - 1) { - uint8_t* start; - if (obj->object_type == MASTER_TO_ALL_SLAVES) { - start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - } - else if(obj->object_type == SLAVE_TO_MASTER) { - start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size); - start += (from - 1) * REMOTE_OBJECT_SIZE(obj->object_size); - } - else { - start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size); - } - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; - void* ptr = triple_buffer_begin_write_internal(obj->object_size, tb); - memcpy(ptr, data, size - 1); - triple_buffer_end_write_internal(tb); - } - } -} - -void update_transport(void) { - unsigned int i; - for(i=0;iobject_type == MASTER_TO_ALL_SLAVES || obj->object_type == SLAVE_TO_MASTER) { - triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; - uint8_t* ptr = (uint8_t*)triple_buffer_read_internal(obj->object_size + LOCAL_OBJECT_EXTRA, tb); - if (ptr) { - ptr[obj->object_size] = i; - uint8_t dest = obj->object_type == MASTER_TO_ALL_SLAVES ? 0xFF : 0; - router_send_frame(dest, ptr, obj->object_size + 1); - } - } - else { - uint8_t* start = obj->buffer; - unsigned int j; - for (j=0;jobject_size + LOCAL_OBJECT_EXTRA, tb); - if (ptr) { - ptr[obj->object_size] = i; - uint8_t dest = j + 1; - router_send_frame(dest, ptr, obj->object_size + 1); - } - start += LOCAL_OBJECT_SIZE(obj->object_size); - } - } - } -} diff --git a/quantum/serial_link/serial_link/protocol/transport.h b/quantum/serial_link/serial_link/protocol/transport.h deleted file mode 100644 index 9a052d880..000000000 --- a/quantum/serial_link/serial_link/protocol/transport.h +++ /dev/null @@ -1,151 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_TRANSPORT_H -#define SERIAL_LINK_TRANSPORT_H - -#include "serial_link/protocol/triple_buffered_object.h" -#include "serial_link/system/serial_link.h" - -#define NUM_SLAVES 8 -#define LOCAL_OBJECT_EXTRA 16 - -// master -> slave = 1 local(target all), 1 remote object -// slave -> master = 1 local(target 0), multiple remote objects -// master -> single slave (multiple local, target id), 1 remote object -typedef enum { - MASTER_TO_ALL_SLAVES, - MASTER_TO_SINGLE_SLAVE, - SLAVE_TO_MASTER, -} remote_object_type; - -typedef struct { - remote_object_type object_type; - uint16_t object_size; - uint8_t buffer[] __attribute__((aligned(4))); -} remote_object_t; - -#define REMOTE_OBJECT_SIZE(objectsize) \ - (sizeof(triple_buffer_object_t) + objectsize * 3) -#define LOCAL_OBJECT_SIZE(objectsize) \ - (sizeof(triple_buffer_object_t) + (objectsize + LOCAL_OBJECT_EXTRA) * 3) - -#define REMOTE_OBJECT_HELPER(name, type, num_local, num_remote) \ -typedef struct { \ - remote_object_t object; \ - uint8_t buffer[ \ - num_remote * REMOTE_OBJECT_SIZE(sizeof(type)) + \ - num_local * LOCAL_OBJECT_SIZE(sizeof(type))]; \ -} remote_object_##name##_t; - -#define MASTER_TO_ALL_SLAVES_OBJECT(name, type) \ - REMOTE_OBJECT_HELPER(name, type, 1, 1) \ - remote_object_##name##_t remote_object_##name = { \ - .object = { \ - .object_type = MASTER_TO_ALL_SLAVES, \ - .object_size = sizeof(type), \ - } \ - }; \ - type* begin_write_##name(void) { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ - return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ - }\ - void end_write_##name(void) { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ - triple_buffer_end_write_internal(tb); \ - signal_data_written(); \ - }\ - type* read_##name(void) { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ - } - -#define MASTER_TO_SINGLE_SLAVE_OBJECT(name, type) \ - REMOTE_OBJECT_HELPER(name, type, NUM_SLAVES, 1) \ - remote_object_##name##_t remote_object_##name = { \ - .object = { \ - .object_type = MASTER_TO_SINGLE_SLAVE, \ - .object_size = sizeof(type), \ - } \ - }; \ - type* begin_write_##name(uint8_t slave) { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - uint8_t* start = obj->buffer;\ - start += slave * LOCAL_OBJECT_SIZE(obj->object_size); \ - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ - }\ - void end_write_##name(uint8_t slave) { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - uint8_t* start = obj->buffer;\ - start += slave * LOCAL_OBJECT_SIZE(obj->object_size); \ - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - triple_buffer_end_write_internal(tb); \ - signal_data_written(); \ - }\ - type* read_##name() { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - uint8_t* start = obj->buffer + NUM_SLAVES * LOCAL_OBJECT_SIZE(obj->object_size);\ - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ - } - -#define SLAVE_TO_MASTER_OBJECT(name, type) \ - REMOTE_OBJECT_HELPER(name, type, 1, NUM_SLAVES) \ - remote_object_##name##_t remote_object_##name = { \ - .object = { \ - .object_type = SLAVE_TO_MASTER, \ - .object_size = sizeof(type), \ - } \ - }; \ - type* begin_write_##name(void) { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ - return (type*)triple_buffer_begin_write_internal(sizeof(type) + LOCAL_OBJECT_EXTRA, tb); \ - }\ - void end_write_##name(void) { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - triple_buffer_object_t* tb = (triple_buffer_object_t*)obj->buffer; \ - triple_buffer_end_write_internal(tb); \ - signal_data_written(); \ - }\ - type* read_##name(uint8_t slave) { \ - remote_object_t* obj = (remote_object_t*)&remote_object_##name; \ - uint8_t* start = obj->buffer + LOCAL_OBJECT_SIZE(obj->object_size);\ - start+=slave * REMOTE_OBJECT_SIZE(obj->object_size); \ - triple_buffer_object_t* tb = (triple_buffer_object_t*)start; \ - return triple_buffer_read_internal(obj->object_size, tb); \ - } - -#define REMOTE_OBJECT(name) (remote_object_t*)&remote_object_##name - -void add_remote_objects(remote_object_t** remote_objects, uint32_t num_remote_objects); -void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size); -void update_transport(void); - -#endif diff --git a/quantum/serial_link/serial_link/protocol/triple_buffered_object.c b/quantum/serial_link/serial_link/protocol/triple_buffered_object.c deleted file mode 100644 index e3e8989d3..000000000 --- a/quantum/serial_link/serial_link/protocol/triple_buffered_object.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include "serial_link/protocol/triple_buffered_object.h" -#include "serial_link/system/serial_link.h" -#include -#include - -#define GET_READ_INDEX() object->state & 3 -#define GET_WRITE_INDEX() (object->state >> 2) & 3 -#define GET_SHARED_INDEX() (object->state >> 4) & 3 -#define GET_DATA_AVAILABLE() (object->state >> 6) & 1 - -#define SET_READ_INDEX(i) object->state = ((object->state & ~3) | i) -#define SET_WRITE_INDEX(i) object->state = ((object->state & ~(3 << 2)) | (i << 2)) -#define SET_SHARED_INDEX(i) object->state = ((object->state & ~(3 << 4)) | (i << 4)) -#define SET_DATA_AVAILABLE(i) object->state = ((object->state & ~(1 << 6)) | (i << 6)) - -void triple_buffer_init(triple_buffer_object_t* object) { - object->state = 0; - SET_WRITE_INDEX(0); - SET_READ_INDEX(1); - SET_SHARED_INDEX(2); - SET_DATA_AVAILABLE(0); -} - -void* triple_buffer_read_internal(uint16_t object_size, triple_buffer_object_t* object) { - serial_link_lock(); - if (GET_DATA_AVAILABLE()) { - uint8_t shared_index = GET_SHARED_INDEX(); - uint8_t read_index = GET_READ_INDEX(); - SET_READ_INDEX(shared_index); - SET_SHARED_INDEX(read_index); - SET_DATA_AVAILABLE(false); - serial_link_unlock(); - return object->buffer + object_size * shared_index; - } - else { - serial_link_unlock(); - return NULL; - } -} - -void* triple_buffer_begin_write_internal(uint16_t object_size, triple_buffer_object_t* object) { - uint8_t write_index = GET_WRITE_INDEX(); - return object->buffer + object_size * write_index; -} - -void triple_buffer_end_write_internal(triple_buffer_object_t* object) { - serial_link_lock(); - uint8_t shared_index = GET_SHARED_INDEX(); - uint8_t write_index = GET_WRITE_INDEX(); - SET_SHARED_INDEX(write_index); - SET_WRITE_INDEX(shared_index); - SET_DATA_AVAILABLE(true); - serial_link_unlock(); -} diff --git a/quantum/serial_link/serial_link/protocol/triple_buffered_object.h b/quantum/serial_link/serial_link/protocol/triple_buffered_object.h deleted file mode 100644 index 2e57db3f5..000000000 --- a/quantum/serial_link/serial_link/protocol/triple_buffered_object.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_TRIPLE_BUFFERED_OBJECT_H -#define SERIAL_LINK_TRIPLE_BUFFERED_OBJECT_H - -#include - -typedef struct { - uint8_t state; - uint8_t buffer[] __attribute__((aligned(4))); -}triple_buffer_object_t; - -void triple_buffer_init(triple_buffer_object_t* object); - -#define triple_buffer_begin_write(object) \ - (typeof(*object.buffer[0])*)triple_buffer_begin_write_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) - -#define triple_buffer_end_write(object) \ - triple_buffer_end_write_internal((triple_buffer_object_t*)object) - -#define triple_buffer_read(object) \ - (typeof(*object.buffer[0])*)triple_buffer_read_internal(sizeof(*object.buffer[0]), (triple_buffer_object_t*)object) - -void* triple_buffer_begin_write_internal(uint16_t object_size, triple_buffer_object_t* object); -void triple_buffer_end_write_internal(triple_buffer_object_t* object); -void* triple_buffer_read_internal(uint16_t object_size, triple_buffer_object_t* object); - - -#endif diff --git a/quantum/serial_link/serial_link/system/serial_link.c b/quantum/serial_link/serial_link/system/serial_link.c deleted file mode 100644 index 75c7e77a7..000000000 --- a/quantum/serial_link/serial_link/system/serial_link.c +++ /dev/null @@ -1,265 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ -#include "report.h" -#include "host_driver.h" -#include "serial_link/system/serial_link.h" -#include "hal.h" -#include "serial_link/protocol/byte_stuffer.h" -#include "serial_link/protocol/transport.h" -#include "serial_link/protocol/frame_router.h" -#include "matrix.h" -#include -#include "print.h" -#include "config.h" - -static event_source_t new_data_event; -static bool serial_link_connected; -static bool is_master = false; - -static uint8_t keyboard_leds(void); -static void send_keyboard(report_keyboard_t *report); -static void send_mouse(report_mouse_t *report); -static void send_system(uint16_t data); -static void send_consumer(uint16_t data); - -host_driver_t serial_driver = { - keyboard_leds, - send_keyboard, - send_mouse, - send_system, - send_consumer -}; - -// Define these in your Config.h file -#ifndef SERIAL_LINK_BAUD -#error "Serial link baud is not set" -#endif - -#ifndef SERIAL_LINK_THREAD_PRIORITY -#error "Serial link thread priority not set" -#endif - -static SerialConfig config = { - .sc_speed = SERIAL_LINK_BAUD -}; - -//#define DEBUG_LINK_ERRORS - -static uint32_t read_from_serial(SerialDriver* driver, uint8_t link) { - const uint32_t buffer_size = 16; - uint8_t buffer[buffer_size]; - uint32_t bytes_read = sdAsynchronousRead(driver, buffer, buffer_size); - uint8_t* current = buffer; - uint8_t* end = current + bytes_read; - while(current < end) { - byte_stuffer_recv_byte(link, *current); - current++; - } - return bytes_read; -} - -static void print_error(char* str, eventflags_t flags, SerialDriver* driver) { -#ifdef DEBUG_LINK_ERRORS - if (flags & SD_PARITY_ERROR) { - print(str); - print(" Parity error\n"); - } - if (flags & SD_FRAMING_ERROR) { - print(str); - print(" Framing error\n"); - } - if (flags & SD_OVERRUN_ERROR) { - print(str); - uint32_t size = qSpaceI(&(driver->iqueue)); - xprintf(" Overrun error, queue size %d\n", size); - - } - if (flags & SD_NOISE_ERROR) { - print(str); - print(" Noise error\n"); - } - if (flags & SD_BREAK_DETECTED) { - print(str); - print(" Break detected\n"); - } -#else - (void)str; - (void)flags; - (void)driver; -#endif -} - -bool is_serial_link_master(void) { - return is_master; -} - -// TODO: Optimize the stack size, this is probably way too big -static THD_WORKING_AREA(serialThreadStack, 1024); -static THD_FUNCTION(serialThread, arg) { - (void)arg; - event_listener_t new_data_listener; - event_listener_t sd1_listener; - event_listener_t sd2_listener; - chEvtRegister(&new_data_event, &new_data_listener, 0); - eventflags_t events = CHN_INPUT_AVAILABLE - | SD_PARITY_ERROR | SD_FRAMING_ERROR | SD_OVERRUN_ERROR | SD_NOISE_ERROR | SD_BREAK_DETECTED; - chEvtRegisterMaskWithFlags(chnGetEventSource(&SD1), - &sd1_listener, - EVENT_MASK(1), - events); - chEvtRegisterMaskWithFlags(chnGetEventSource(&SD2), - &sd2_listener, - EVENT_MASK(2), - events); - bool need_wait = false; - while(true) { - eventflags_t flags1 = 0; - eventflags_t flags2 = 0; - if (need_wait) { - eventmask_t mask = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000)); - if (mask & EVENT_MASK(1)) { - flags1 = chEvtGetAndClearFlags(&sd1_listener); - print_error("DOWNLINK", flags1, &SD1); - } - if (mask & EVENT_MASK(2)) { - flags2 = chEvtGetAndClearFlags(&sd2_listener); - print_error("UPLINK", flags2, &SD2); - } - } - - // Always stay as master, even if the USB goes into sleep mode - is_master |= usbGetDriverStateI(&USBD1) == USB_ACTIVE; - router_set_master(is_master); - - need_wait = true; - need_wait &= read_from_serial(&SD2, UP_LINK) == 0; - need_wait &= read_from_serial(&SD1, DOWN_LINK) == 0; - update_transport(); - } -} - -void send_data(uint8_t link, const uint8_t* data, uint16_t size) { - if (link == DOWN_LINK) { - sdWrite(&SD1, data, size); - } - else { - sdWrite(&SD2, data, size); - } -} - -static systime_t last_update = 0; - -typedef struct { - matrix_row_t rows[MATRIX_ROWS]; -} matrix_object_t; - -static matrix_object_t last_matrix = {}; - -SLAVE_TO_MASTER_OBJECT(keyboard_matrix, matrix_object_t); -MASTER_TO_ALL_SLAVES_OBJECT(serial_link_connected, bool); - -static remote_object_t* remote_objects[] = { - REMOTE_OBJECT(serial_link_connected), - REMOTE_OBJECT(keyboard_matrix), -}; - -void init_serial_link(void) { - serial_link_connected = false; - init_serial_link_hal(); - add_remote_objects(remote_objects, sizeof(remote_objects)/sizeof(remote_object_t*)); - init_byte_stuffer(); - sdStart(&SD1, &config); - sdStart(&SD2, &config); - chEvtObjectInit(&new_data_event); - (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), - SERIAL_LINK_THREAD_PRIORITY, serialThread, NULL); -} - -void matrix_set_remote(matrix_row_t* rows, uint8_t index); - -void serial_link_update(void) { - if (read_serial_link_connected()) { - serial_link_connected = true; - } - - matrix_object_t matrix; - bool changed = false; - for(uint8_t i=0;i US2ST(1000)) { - last_update = current_time; - last_matrix = matrix; - matrix_object_t* m = begin_write_keyboard_matrix(); - for(uint8_t i=0;irows[i] = matrix.rows[i]; - } - end_write_keyboard_matrix(); - *begin_write_serial_link_connected() = true; - end_write_serial_link_connected(); - } - - matrix_object_t* m = read_keyboard_matrix(0); - if (m) { - matrix_set_remote(m->rows, 0); - } -} - -void signal_data_written(void) { - chEvtBroadcast(&new_data_event); -} - -bool is_serial_link_connected(void) { - return serial_link_connected; -} - -host_driver_t* get_serial_link_driver(void) { - return &serial_driver; -} - -// NOTE: The driver does nothing, because the master handles everything -uint8_t keyboard_leds(void) { - return 0; -} - -void send_keyboard(report_keyboard_t *report) { - (void)report; -} - -void send_mouse(report_mouse_t *report) { - (void)report; -} - -void send_system(uint16_t data) { - (void)data; -} - -void send_consumer(uint16_t data) { - (void)data; -} - diff --git a/quantum/serial_link/serial_link/system/serial_link.h b/quantum/serial_link/serial_link/system/serial_link.h deleted file mode 100644 index 351e03877..000000000 --- a/quantum/serial_link/serial_link/system/serial_link.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#ifndef SERIAL_LINK_H -#define SERIAL_LINK_H - -#include "host_driver.h" -#include - -void init_serial_link(void); -void init_serial_link_hal(void); -bool is_serial_link_connected(void); -bool is_serial_link_master(void); -host_driver_t* get_serial_link_driver(void); -void serial_link_update(void); - -#if defined(PROTOCOL_CHIBIOS) -#include "ch.h" - -static inline void serial_link_lock(void) { - chSysLock(); -} - -static inline void serial_link_unlock(void) { - chSysUnlock(); -} - -void signal_data_written(void); - -#else - -inline void serial_link_lock(void) { -} - -inline void serial_link_unlock(void) { -} - -void signal_data_written(void); - -#endif - -#endif diff --git a/quantum/serial_link/serial_link/tests/Makefile b/quantum/serial_link/serial_link/tests/Makefile deleted file mode 100644 index 1b072c6f1..000000000 --- a/quantum/serial_link/serial_link/tests/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Fred Sundvik -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -CC = gcc -CFLAGS = -INCLUDES = -I. -I../../ -LDFLAGS = -L$(BUILDDIR)/cgreen/build-c/src -shared -LDLIBS = -lcgreen -UNITOBJ = $(BUILDDIR)/serialtest/unitobj -DEPDIR = $(BUILDDIR)/serialtest/unit.d -UNITTESTS = $(BUILDDIR)/serialtest/unittests -DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td -EXT = .so -UNAME := $(shell uname) -ifneq (, $(findstring MINGW, $(UNAME))) - EXT = .dll -endif -ifneq (, $(findstring CYGWIN, $(UNAME))) - EXT = .dll -endif - -SRC = $(wildcard *.c) -TESTFILES = $(patsubst %.c, $(UNITTESTS)/%$(EXT), $(SRC)) -$(shell mkdir -p $(DEPDIR) >/dev/null) - -test: $(TESTFILES) - @$(BUILDDIR)/cgreen/build-c/tools/cgreen-runner --color $(TESTFILES) - -$(UNITTESTS)/%$(EXT): $(UNITOBJ)/%.o - @mkdir -p $(UNITTESTS) - $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) - -$(UNITOBJ)/%.o : %.c -$(UNITOBJ)/%.o: %.c $(DEPDIR)/%.d - @mkdir -p $(UNITOBJ) - $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $< -o $@ - @mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d - -$(DEPDIR)/%.d: ; -.PRECIOUS: $(DEPDIR)/%.d - --include $(patsubst %,$(DEPDIR)/%.d,$(basename $(SRC))) \ No newline at end of file diff --git a/quantum/serial_link/serial_link/tests/byte_stuffer_tests.c b/quantum/serial_link/serial_link/tests/byte_stuffer_tests.c deleted file mode 100644 index 64b170e8c..000000000 --- a/quantum/serial_link/serial_link/tests/byte_stuffer_tests.c +++ /dev/null @@ -1,506 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include -#include -#include "serial_link/protocol/byte_stuffer.h" -#include "serial_link/protocol/byte_stuffer.c" -#include "serial_link/protocol/frame_validator.h" -#include "serial_link/protocol/physical.h" - -static uint8_t sent_data[MAX_FRAME_SIZE*2]; -static uint16_t sent_data_size; - -Describe(ByteStuffer); -BeforeEach(ByteStuffer) { - init_byte_stuffer(); - sent_data_size = 0; -} -AfterEach(ByteStuffer) {} - -void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { - mock(data, size); -} - -void send_data(uint8_t link, const uint8_t* data, uint16_t size) { - memcpy(sent_data + sent_data_size, data, size); - sent_data_size += size; -} - -Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { - never_expect(validator_recv_frame); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { - never_expect(validator_recv_frame); - byte_stuffer_recv_byte(0, 0xFF); -} - -Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { - never_expect(validator_recv_frame); - byte_stuffer_recv_byte(0, 0x4A); -} - -Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { - never_expect(validator_recv_frame); - byte_stuffer_recv_byte(0, 1); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_single_byte_valid_frame) { - uint8_t expected[] = {0x37}; - expect(validator_recv_frame, - when(size, is_equal_to(1)), - when(data, is_equal_to_contents_of(expected, 1)) - ); - byte_stuffer_recv_byte(0, 2); - byte_stuffer_recv_byte(0, 0x37); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_three_bytes_valid_frame) { - uint8_t expected[] = {0x37, 0x99, 0xFF}; - expect(validator_recv_frame, - when(size, is_equal_to(3)), - when(data, is_equal_to_contents_of(expected, 3)) - ); - byte_stuffer_recv_byte(0, 4); - byte_stuffer_recv_byte(0, 0x37); - byte_stuffer_recv_byte(0, 0x99); - byte_stuffer_recv_byte(0, 0xFF); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_single_zero_valid_frame) { - uint8_t expected[] = {0}; - expect(validator_recv_frame, - when(size, is_equal_to(1)), - when(data, is_equal_to_contents_of(expected, 1)) - ); - byte_stuffer_recv_byte(0, 1); - byte_stuffer_recv_byte(0, 1); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { - uint8_t expected[] = {5, 0, 3, 0}; - expect(validator_recv_frame, - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(expected, 4)) - ); - byte_stuffer_recv_byte(0, 2); - byte_stuffer_recv_byte(0, 5); - byte_stuffer_recv_byte(0, 2); - byte_stuffer_recv_byte(0, 3); - byte_stuffer_recv_byte(0, 1); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_two_valid_frames) { - uint8_t expected1[] = {5, 0}; - uint8_t expected2[] = {3}; - expect(validator_recv_frame, - when(size, is_equal_to(2)), - when(data, is_equal_to_contents_of(expected1, 2)) - ); - expect(validator_recv_frame, - when(size, is_equal_to(1)), - when(data, is_equal_to_contents_of(expected2, 1)) - ); - byte_stuffer_recv_byte(1, 2); - byte_stuffer_recv_byte(1, 5); - byte_stuffer_recv_byte(1, 1); - byte_stuffer_recv_byte(1, 0); - byte_stuffer_recv_byte(1, 2); - byte_stuffer_recv_byte(1, 3); - byte_stuffer_recv_byte(1, 0); -} - -Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { - uint8_t expected[] = {5, 7}; - expect(validator_recv_frame, - when(size, is_equal_to(2)), - when(data, is_equal_to_contents_of(expected, 2)) - ); - byte_stuffer_recv_byte(1, 3); - byte_stuffer_recv_byte(1, 1); - byte_stuffer_recv_byte(1, 0); - byte_stuffer_recv_byte(1, 3); - byte_stuffer_recv_byte(1, 5); - byte_stuffer_recv_byte(1, 7); - byte_stuffer_recv_byte(1, 0); -} - -Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { - uint8_t expected[] = {5, 7}; - expect(validator_recv_frame, - when(size, is_equal_to(2)), - when(data, is_equal_to_contents_of(expected, 2)) - ); - byte_stuffer_recv_byte(0, 2); - byte_stuffer_recv_byte(0, 9); - byte_stuffer_recv_byte(0, 4); // This should have been zero - byte_stuffer_recv_byte(0, 0); - byte_stuffer_recv_byte(0, 3); - byte_stuffer_recv_byte(0, 5); - byte_stuffer_recv_byte(0, 7); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) { - uint8_t expected[254]; - int i; - for (i=0;i<254;i++) { - expected[i] = i + 1; - } - expect(validator_recv_frame, - when(size, is_equal_to(254)), - when(data, is_equal_to_contents_of(expected, 254)) - ); - byte_stuffer_recv_byte(0, 0xFF); - for (i=0;i<254;i++) { - byte_stuffer_recv_byte(0, i+1); - } - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) { - uint8_t expected[255]; - int i; - for (i=0;i<254;i++) { - expected[i] = i + 1; - } - expected[254] = 7; - expect(validator_recv_frame, - when(size, is_equal_to(255)), - when(data, is_equal_to_contents_of(expected, 255)) - ); - byte_stuffer_recv_byte(0, 0xFF); - for (i=0;i<254;i++) { - byte_stuffer_recv_byte(0, i+1); - } - byte_stuffer_recv_byte(0, 2); - byte_stuffer_recv_byte(0, 7); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) { - uint8_t expected[255]; - int i; - for (i=0;i<254;i++) { - expected[i] = i + 1; - } - expected[254] = 0; - expect(validator_recv_frame, - when(size, is_equal_to(255)), - when(data, is_equal_to_contents_of(expected, 255)) - ); - byte_stuffer_recv_byte(0, 0xFF); - for (i=0;i<254;i++) { - byte_stuffer_recv_byte(0, i+1); - } - byte_stuffer_recv_byte(0, 1); - byte_stuffer_recv_byte(0, 1); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { - uint8_t expected[515]; - int i; - int j; - for (j=0;j<2;j++) { - for (i=0;i<254;i++) { - expected[i+254*j] = i + 1; - } - } - for (i=0;i<7;i++) { - expected[254*2+i] = i + 1; - } - expect(validator_recv_frame, - when(size, is_equal_to(515)), - when(data, is_equal_to_contents_of(expected, 510)) - ); - byte_stuffer_recv_byte(0, 0xFF); - for (i=0;i<254;i++) { - byte_stuffer_recv_byte(0, i+1); - } - byte_stuffer_recv_byte(0, 0xFF); - for (i=0;i<254;i++) { - byte_stuffer_recv_byte(0, i+1); - } - byte_stuffer_recv_byte(0, 8); - byte_stuffer_recv_byte(0, 1); - byte_stuffer_recv_byte(0, 2); - byte_stuffer_recv_byte(0, 3); - byte_stuffer_recv_byte(0, 4); - byte_stuffer_recv_byte(0, 5); - byte_stuffer_recv_byte(0, 6); - byte_stuffer_recv_byte(0, 7); - byte_stuffer_recv_byte(0, 0); -} - -Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { - uint8_t expected[MAX_FRAME_SIZE] = {}; - expect(validator_recv_frame, - when(size, is_equal_to(MAX_FRAME_SIZE)), - when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) - ); - int i; - byte_stuffer_recv_byte(0, 1); - for(i=0;i -#include -#include "serial_link/protocol/byte_stuffer.c" -#include "serial_link/protocol/frame_validator.c" -#include "serial_link/protocol/frame_router.c" -#include "serial_link/protocol/transport.h" - -static uint8_t received_data[256]; -static uint16_t received_data_size; - -typedef struct { - uint8_t sent_data[256]; - uint16_t sent_data_size; -} receive_buffer_t; - -typedef struct { - receive_buffer_t send_buffers[2]; -} router_buffer_t; - -router_buffer_t router_buffers[8]; - -router_buffer_t* current_router_buffer; - - -Describe(FrameRouter); -BeforeEach(FrameRouter) { - init_byte_stuffer(); - memset(router_buffers, 0, sizeof(router_buffers)); - current_router_buffer = 0; -} -AfterEach(FrameRouter) {} - -typedef struct { - uint32_t data; - uint8_t extra[16]; -} frame_buffer_t; - - -void send_data(uint8_t link, const uint8_t* data, uint16_t size) { - receive_buffer_t* buffer = ¤t_router_buffer->send_buffers[link]; - memcpy(buffer->sent_data + buffer->sent_data_size, data, size); - buffer->sent_data_size += size; -} - -static void receive_data(uint8_t link, uint8_t* data, uint16_t size) { - int i; - for(i=0;i to) { - receive_data(DOWN_LINK, - router_buffers[from].send_buffers[UP_LINK].sent_data, - router_buffers[from].send_buffers[UP_LINK].sent_data_size); - } - else if(to > from) { - receive_data(UP_LINK, - router_buffers[from].send_buffers[DOWN_LINK].sent_data, - router_buffers[from].send_buffers[DOWN_LINK].sent_data_size); - } -} - -void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { - mock(from, data, size); -} - - -Ensure(FrameRouter, master_broadcast_is_received_by_everyone) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(0); - router_send_frame(0xFF, (uint8_t*)&data, 4); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(0)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(0, 1); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(0)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(1, 2); - assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, master_send_is_received_by_targets) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(0); - router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - simulate_transport(0, 1); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(0)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(1, 2); - assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(0)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(2, 3); - assert_that(router_buffers[3].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[3].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, first_link_sends_to_master) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(1); - router_send_frame(0, (uint8_t*)&data, 4); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(1)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(1, 0); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, second_link_sends_to_master) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(2); - router_send_frame(0, (uint8_t*)&data, 4); - assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - - simulate_transport(2, 1); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - - expect(transport_recv_frame, - when(from, is_equal_to(2)), - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(&data.data, 4)) - ); - simulate_transport(1, 0); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, master_sends_to_master_does_nothing) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(0); - router_send_frame(0, (uint8_t*)&data, 4); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, link_sends_to_other_link_does_nothing) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(1); - router_send_frame(2, (uint8_t*)&data, 4); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); -} - -Ensure(FrameRouter, master_receives_on_uplink_does_nothing) { - frame_buffer_t data; - data.data = 0xAB7055BB; - activate_router(1); - router_send_frame(0, (uint8_t*)&data, 4); - assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); - assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); - - never_expect(transport_recv_frame); - activate_router(0); - receive_data(UP_LINK, - router_buffers[1].send_buffers[UP_LINK].sent_data, - router_buffers[1].send_buffers[UP_LINK].sent_data_size); - assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); - assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); -} diff --git a/quantum/serial_link/serial_link/tests/frame_validator_tests.c b/quantum/serial_link/serial_link/tests/frame_validator_tests.c deleted file mode 100644 index d20947e2c..000000000 --- a/quantum/serial_link/serial_link/tests/frame_validator_tests.c +++ /dev/null @@ -1,101 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include -#include -#include "serial_link/protocol/frame_validator.c" - -void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size) { - mock(data, size); -} - -void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size) { - mock(data, size); -} - -Describe(FrameValidator); -BeforeEach(FrameValidator) {} -AfterEach(FrameValidator) {} - -Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { - never_expect(route_incoming_frame); - uint8_t data[] = {1, 2}; - validator_recv_frame(0, 0, 1); - validator_recv_frame(0, data, 2); - validator_recv_frame(0, data, 3); - validator_recv_frame(0, data, 4); -} - -Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) { - uint8_t data[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; - expect(route_incoming_frame, - when(size, is_equal_to(1)), - when(data, is_equal_to_contents_of(data, 1)) - ); - validator_recv_frame(0, data, 5); -} - -Ensure(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) { - uint8_t data[] = {0x44, 0, 0, 0, 0}; - never_expect(route_incoming_frame); - validator_recv_frame(1, data, 5); -} - -Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { - uint8_t data[] = {0x44, 0x10, 0xFF, 0x00, 0x74, 0x4E, 0x30, 0xBA}; - expect(route_incoming_frame, - when(size, is_equal_to(4)), - when(data, is_equal_to_contents_of(data, 4)) - ); - validator_recv_frame(1, data, 8); -} - -Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { - uint8_t data[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; - expect(route_incoming_frame, - when(size, is_equal_to(5)), - when(data, is_equal_to_contents_of(data, 5)) - ); - validator_recv_frame(0, data, 9); -} - -Ensure(FrameValidator, sends_one_byte_with_correct_crc) { - uint8_t original[] = {0x44, 0, 0, 0, 0}; - uint8_t expected[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; - expect(byte_stuffer_send_frame, - when(size, is_equal_to(sizeof(expected))), - when(data, is_equal_to_contents_of(expected, sizeof(expected))) - ); - validator_send_frame(0, original, 1); -} - -Ensure(FrameValidator, sends_five_bytes_with_correct_crc) { - uint8_t original[] = {1, 2, 3, 4, 5, 0, 0, 0, 0}; - uint8_t expected[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; - expect(byte_stuffer_send_frame, - when(size, is_equal_to(sizeof(expected))), - when(data, is_equal_to_contents_of(expected, sizeof(expected))) - ); - validator_send_frame(0, original, 5); -} diff --git a/quantum/serial_link/serial_link/tests/transport_tests.c b/quantum/serial_link/serial_link/tests/transport_tests.c deleted file mode 100644 index 358e1b9fd..000000000 --- a/quantum/serial_link/serial_link/tests/transport_tests.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include -#include -#include "serial_link/protocol/transport.c" -#include "serial_link/protocol/triple_buffered_object.c" - -void signal_data_written(void) { - mock(); -} - -static uint8_t sent_data[2048]; -static uint16_t sent_data_size; - -void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { - mock(destination); - memcpy(sent_data + sent_data_size, data, size); - sent_data_size += size; -} - -typedef struct { - uint32_t test; -} test_object1_t; - -typedef struct { - uint32_t test1; - uint32_t test2; -} test_object2_t; - -MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1_t); -MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1_t); -SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t); - -static remote_object_t* test_remote_objects[] = { - REMOTE_OBJECT(master_to_slave), - REMOTE_OBJECT(master_to_single_slave), - REMOTE_OBJECT(slave_to_master), -}; - -Describe(Transport); -BeforeEach(Transport) { - add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*)); - sent_data_size = 0; -} -AfterEach(Transport) {} - -Ensure(Transport, write_to_local_signals_an_event) { - begin_write_master_to_slave(); - expect(signal_data_written); - end_write_master_to_slave(); - begin_write_slave_to_master(); - expect(signal_data_written); - end_write_slave_to_master(); - begin_write_master_to_single_slave(1); - expect(signal_data_written); - end_write_master_to_single_slave(1); -} - -Ensure(Transport, writes_from_master_to_all_slaves) { - update_transport(); - test_object1_t* obj = begin_write_master_to_slave(); - obj->test = 5; - expect(signal_data_written); - end_write_master_to_slave(); - expect(router_send_frame, - when(destination, is_equal_to(0xFF))); - update_transport(); - transport_recv_frame(0, sent_data, sent_data_size); - test_object1_t* obj2 = read_master_to_slave(); - assert_that(obj2, is_not_equal_to(NULL)); - assert_that(obj2->test, is_equal_to(5)); -} - -Ensure(Transport, writes_from_slave_to_master) { - update_transport(); - test_object1_t* obj = begin_write_slave_to_master(); - obj->test = 7; - expect(signal_data_written); - end_write_slave_to_master(); - expect(router_send_frame, - when(destination, is_equal_to(0))); - update_transport(); - transport_recv_frame(3, sent_data, sent_data_size); - test_object1_t* obj2 = read_slave_to_master(2); - assert_that(read_slave_to_master(0), is_equal_to(NULL)); - assert_that(obj2, is_not_equal_to(NULL)); - assert_that(obj2->test, is_equal_to(7)); -} - -Ensure(Transport, writes_from_master_to_single_slave) { - update_transport(); - test_object1_t* obj = begin_write_master_to_single_slave(3); - obj->test = 7; - expect(signal_data_written); - end_write_master_to_single_slave(3); - expect(router_send_frame, - when(destination, is_equal_to(4))); - update_transport(); - transport_recv_frame(0, sent_data, sent_data_size); - test_object1_t* obj2 = read_master_to_single_slave(); - assert_that(obj2, is_not_equal_to(NULL)); - assert_that(obj2->test, is_equal_to(7)); -} - -Ensure(Transport, ignores_object_with_invalid_id) { - update_transport(); - test_object1_t* obj = begin_write_master_to_single_slave(3); - obj->test = 7; - expect(signal_data_written); - end_write_master_to_single_slave(3); - expect(router_send_frame, - when(destination, is_equal_to(4))); - update_transport(); - sent_data[sent_data_size - 1] = 44; - transport_recv_frame(0, sent_data, sent_data_size); - test_object1_t* obj2 = read_master_to_single_slave(); - assert_that(obj2, is_equal_to(NULL)); -} - -Ensure(Transport, ignores_object_with_size_too_small) { - update_transport(); - test_object1_t* obj = begin_write_master_to_slave(); - obj->test = 7; - expect(signal_data_written); - end_write_master_to_slave(); - expect(router_send_frame); - update_transport(); - sent_data[sent_data_size - 2] = 0; - transport_recv_frame(0, sent_data, sent_data_size - 1); - test_object1_t* obj2 = read_master_to_slave(); - assert_that(obj2, is_equal_to(NULL)); -} - -Ensure(Transport, ignores_object_with_size_too_big) { - update_transport(); - test_object1_t* obj = begin_write_master_to_slave(); - obj->test = 7; - expect(signal_data_written); - end_write_master_to_slave(); - expect(router_send_frame); - update_transport(); - sent_data[sent_data_size + 21] = 0; - transport_recv_frame(0, sent_data, sent_data_size + 22); - test_object1_t* obj2 = read_master_to_slave(); - assert_that(obj2, is_equal_to(NULL)); -} diff --git a/quantum/serial_link/serial_link/tests/triple_buffered_object_tests.c b/quantum/serial_link/serial_link/tests/triple_buffered_object_tests.c deleted file mode 100644 index 6f7c82b46..000000000 --- a/quantum/serial_link/serial_link/tests/triple_buffered_object_tests.c +++ /dev/null @@ -1,82 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2016 Fred Sundvik - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. -*/ - -#include -#include "serial_link/protocol/triple_buffered_object.c" - -typedef struct { - uint8_t state; - uint32_t buffer[3]; -}test_object_t; - -test_object_t test_object; - -Describe(TripleBufferedObject); -BeforeEach(TripleBufferedObject) { - triple_buffer_init((triple_buffer_object_t*)&test_object); -} -AfterEach(TripleBufferedObject) {} - - -Ensure(TripleBufferedObject, writes_and_reads_object) { - *triple_buffer_begin_write(&test_object) = 0x3456ABCC; - triple_buffer_end_write(&test_object); - assert_that(*triple_buffer_read(&test_object), is_equal_to(0x3456ABCC)); -} - -Ensure(TripleBufferedObject, does_not_read_empty) { - assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); -} - -Ensure(TripleBufferedObject, writes_twice_and_reads_object) { - *triple_buffer_begin_write(&test_object) = 0x3456ABCC; - triple_buffer_end_write(&test_object); - *triple_buffer_begin_write(&test_object) = 0x44778899; - triple_buffer_end_write(&test_object); - assert_that(*triple_buffer_read(&test_object), is_equal_to(0x44778899)); -} - -Ensure(TripleBufferedObject, performs_another_write_in_the_middle_of_read) { - *triple_buffer_begin_write(&test_object) = 1; - triple_buffer_end_write(&test_object); - uint32_t* read = triple_buffer_read(&test_object); - *triple_buffer_begin_write(&test_object) = 2; - triple_buffer_end_write(&test_object); - assert_that(*read, is_equal_to(1)); - assert_that(*triple_buffer_read(&test_object), is_equal_to(2)); - assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); -} - -Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { - *triple_buffer_begin_write(&test_object) = 1; - triple_buffer_end_write(&test_object); - uint32_t* read = triple_buffer_read(&test_object); - *triple_buffer_begin_write(&test_object) = 2; - triple_buffer_end_write(&test_object); - *triple_buffer_begin_write(&test_object) = 3; - triple_buffer_end_write(&test_object); - assert_that(*read, is_equal_to(1)); - assert_that(*triple_buffer_read(&test_object), is_equal_to(3)); - assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); -} diff --git a/quantum/serial_link/serial_link_tests.mk b/quantum/serial_link/serial_link_tests.mk deleted file mode 100644 index e292f582a..000000000 --- a/quantum/serial_link/serial_link_tests.mk +++ /dev/null @@ -1,34 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016 Fred Sundvik -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -CGREEN_LIB = $(BUILDDIR)/cgreen/build-c/src/libcgreen.a - -CGREEN_DIR = "$(CURDIR)/$(SERIAL_DIR)/cgreen/cgreen" -CGREEN_BUILD_DIR = "$(CURDIR)/$(BUILDDIR)/cgreen" -export CGREEN_DIR -export CGREEN_BUILD_DIR -$(CGREEN_LIB): - @make -C $(SERIAL_DIR)/cgreen - -.PHONY serialtest: -serialtest : $(CGREEN_LIB) - @make -C $(SERIAL_DIR)/serial_link/tests BUILDDIR=../../../$(BUILDDIR) \ No newline at end of file diff --git a/quantum/serial_link/system/serial_link.c b/quantum/serial_link/system/serial_link.c new file mode 100644 index 000000000..75c7e77a7 --- /dev/null +++ b/quantum/serial_link/system/serial_link.c @@ -0,0 +1,265 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ +#include "report.h" +#include "host_driver.h" +#include "serial_link/system/serial_link.h" +#include "hal.h" +#include "serial_link/protocol/byte_stuffer.h" +#include "serial_link/protocol/transport.h" +#include "serial_link/protocol/frame_router.h" +#include "matrix.h" +#include +#include "print.h" +#include "config.h" + +static event_source_t new_data_event; +static bool serial_link_connected; +static bool is_master = false; + +static uint8_t keyboard_leds(void); +static void send_keyboard(report_keyboard_t *report); +static void send_mouse(report_mouse_t *report); +static void send_system(uint16_t data); +static void send_consumer(uint16_t data); + +host_driver_t serial_driver = { + keyboard_leds, + send_keyboard, + send_mouse, + send_system, + send_consumer +}; + +// Define these in your Config.h file +#ifndef SERIAL_LINK_BAUD +#error "Serial link baud is not set" +#endif + +#ifndef SERIAL_LINK_THREAD_PRIORITY +#error "Serial link thread priority not set" +#endif + +static SerialConfig config = { + .sc_speed = SERIAL_LINK_BAUD +}; + +//#define DEBUG_LINK_ERRORS + +static uint32_t read_from_serial(SerialDriver* driver, uint8_t link) { + const uint32_t buffer_size = 16; + uint8_t buffer[buffer_size]; + uint32_t bytes_read = sdAsynchronousRead(driver, buffer, buffer_size); + uint8_t* current = buffer; + uint8_t* end = current + bytes_read; + while(current < end) { + byte_stuffer_recv_byte(link, *current); + current++; + } + return bytes_read; +} + +static void print_error(char* str, eventflags_t flags, SerialDriver* driver) { +#ifdef DEBUG_LINK_ERRORS + if (flags & SD_PARITY_ERROR) { + print(str); + print(" Parity error\n"); + } + if (flags & SD_FRAMING_ERROR) { + print(str); + print(" Framing error\n"); + } + if (flags & SD_OVERRUN_ERROR) { + print(str); + uint32_t size = qSpaceI(&(driver->iqueue)); + xprintf(" Overrun error, queue size %d\n", size); + + } + if (flags & SD_NOISE_ERROR) { + print(str); + print(" Noise error\n"); + } + if (flags & SD_BREAK_DETECTED) { + print(str); + print(" Break detected\n"); + } +#else + (void)str; + (void)flags; + (void)driver; +#endif +} + +bool is_serial_link_master(void) { + return is_master; +} + +// TODO: Optimize the stack size, this is probably way too big +static THD_WORKING_AREA(serialThreadStack, 1024); +static THD_FUNCTION(serialThread, arg) { + (void)arg; + event_listener_t new_data_listener; + event_listener_t sd1_listener; + event_listener_t sd2_listener; + chEvtRegister(&new_data_event, &new_data_listener, 0); + eventflags_t events = CHN_INPUT_AVAILABLE + | SD_PARITY_ERROR | SD_FRAMING_ERROR | SD_OVERRUN_ERROR | SD_NOISE_ERROR | SD_BREAK_DETECTED; + chEvtRegisterMaskWithFlags(chnGetEventSource(&SD1), + &sd1_listener, + EVENT_MASK(1), + events); + chEvtRegisterMaskWithFlags(chnGetEventSource(&SD2), + &sd2_listener, + EVENT_MASK(2), + events); + bool need_wait = false; + while(true) { + eventflags_t flags1 = 0; + eventflags_t flags2 = 0; + if (need_wait) { + eventmask_t mask = chEvtWaitAnyTimeout(ALL_EVENTS, MS2ST(1000)); + if (mask & EVENT_MASK(1)) { + flags1 = chEvtGetAndClearFlags(&sd1_listener); + print_error("DOWNLINK", flags1, &SD1); + } + if (mask & EVENT_MASK(2)) { + flags2 = chEvtGetAndClearFlags(&sd2_listener); + print_error("UPLINK", flags2, &SD2); + } + } + + // Always stay as master, even if the USB goes into sleep mode + is_master |= usbGetDriverStateI(&USBD1) == USB_ACTIVE; + router_set_master(is_master); + + need_wait = true; + need_wait &= read_from_serial(&SD2, UP_LINK) == 0; + need_wait &= read_from_serial(&SD1, DOWN_LINK) == 0; + update_transport(); + } +} + +void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + if (link == DOWN_LINK) { + sdWrite(&SD1, data, size); + } + else { + sdWrite(&SD2, data, size); + } +} + +static systime_t last_update = 0; + +typedef struct { + matrix_row_t rows[MATRIX_ROWS]; +} matrix_object_t; + +static matrix_object_t last_matrix = {}; + +SLAVE_TO_MASTER_OBJECT(keyboard_matrix, matrix_object_t); +MASTER_TO_ALL_SLAVES_OBJECT(serial_link_connected, bool); + +static remote_object_t* remote_objects[] = { + REMOTE_OBJECT(serial_link_connected), + REMOTE_OBJECT(keyboard_matrix), +}; + +void init_serial_link(void) { + serial_link_connected = false; + init_serial_link_hal(); + add_remote_objects(remote_objects, sizeof(remote_objects)/sizeof(remote_object_t*)); + init_byte_stuffer(); + sdStart(&SD1, &config); + sdStart(&SD2, &config); + chEvtObjectInit(&new_data_event); + (void)chThdCreateStatic(serialThreadStack, sizeof(serialThreadStack), + SERIAL_LINK_THREAD_PRIORITY, serialThread, NULL); +} + +void matrix_set_remote(matrix_row_t* rows, uint8_t index); + +void serial_link_update(void) { + if (read_serial_link_connected()) { + serial_link_connected = true; + } + + matrix_object_t matrix; + bool changed = false; + for(uint8_t i=0;i US2ST(1000)) { + last_update = current_time; + last_matrix = matrix; + matrix_object_t* m = begin_write_keyboard_matrix(); + for(uint8_t i=0;irows[i] = matrix.rows[i]; + } + end_write_keyboard_matrix(); + *begin_write_serial_link_connected() = true; + end_write_serial_link_connected(); + } + + matrix_object_t* m = read_keyboard_matrix(0); + if (m) { + matrix_set_remote(m->rows, 0); + } +} + +void signal_data_written(void) { + chEvtBroadcast(&new_data_event); +} + +bool is_serial_link_connected(void) { + return serial_link_connected; +} + +host_driver_t* get_serial_link_driver(void) { + return &serial_driver; +} + +// NOTE: The driver does nothing, because the master handles everything +uint8_t keyboard_leds(void) { + return 0; +} + +void send_keyboard(report_keyboard_t *report) { + (void)report; +} + +void send_mouse(report_mouse_t *report) { + (void)report; +} + +void send_system(uint16_t data) { + (void)data; +} + +void send_consumer(uint16_t data) { + (void)data; +} + diff --git a/quantum/serial_link/system/serial_link.h b/quantum/serial_link/system/serial_link.h new file mode 100644 index 000000000..351e03877 --- /dev/null +++ b/quantum/serial_link/system/serial_link.h @@ -0,0 +1,63 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef SERIAL_LINK_H +#define SERIAL_LINK_H + +#include "host_driver.h" +#include + +void init_serial_link(void); +void init_serial_link_hal(void); +bool is_serial_link_connected(void); +bool is_serial_link_master(void); +host_driver_t* get_serial_link_driver(void); +void serial_link_update(void); + +#if defined(PROTOCOL_CHIBIOS) +#include "ch.h" + +static inline void serial_link_lock(void) { + chSysLock(); +} + +static inline void serial_link_unlock(void) { + chSysUnlock(); +} + +void signal_data_written(void); + +#else + +inline void serial_link_lock(void) { +} + +inline void serial_link_unlock(void) { +} + +void signal_data_written(void); + +#endif + +#endif diff --git a/quantum/serial_link/tests/Makefile b/quantum/serial_link/tests/Makefile new file mode 100644 index 000000000..1b072c6f1 --- /dev/null +++ b/quantum/serial_link/tests/Makefile @@ -0,0 +1,61 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Fred Sundvik +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +CC = gcc +CFLAGS = +INCLUDES = -I. -I../../ +LDFLAGS = -L$(BUILDDIR)/cgreen/build-c/src -shared +LDLIBS = -lcgreen +UNITOBJ = $(BUILDDIR)/serialtest/unitobj +DEPDIR = $(BUILDDIR)/serialtest/unit.d +UNITTESTS = $(BUILDDIR)/serialtest/unittests +DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.Td +EXT = .so +UNAME := $(shell uname) +ifneq (, $(findstring MINGW, $(UNAME))) + EXT = .dll +endif +ifneq (, $(findstring CYGWIN, $(UNAME))) + EXT = .dll +endif + +SRC = $(wildcard *.c) +TESTFILES = $(patsubst %.c, $(UNITTESTS)/%$(EXT), $(SRC)) +$(shell mkdir -p $(DEPDIR) >/dev/null) + +test: $(TESTFILES) + @$(BUILDDIR)/cgreen/build-c/tools/cgreen-runner --color $(TESTFILES) + +$(UNITTESTS)/%$(EXT): $(UNITOBJ)/%.o + @mkdir -p $(UNITTESTS) + $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) + +$(UNITOBJ)/%.o : %.c +$(UNITOBJ)/%.o: %.c $(DEPDIR)/%.d + @mkdir -p $(UNITOBJ) + $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $< -o $@ + @mv -f $(DEPDIR)/$*.Td $(DEPDIR)/$*.d + +$(DEPDIR)/%.d: ; +.PRECIOUS: $(DEPDIR)/%.d + +-include $(patsubst %,$(DEPDIR)/%.d,$(basename $(SRC))) \ No newline at end of file diff --git a/quantum/serial_link/tests/byte_stuffer_tests.c b/quantum/serial_link/tests/byte_stuffer_tests.c new file mode 100644 index 000000000..64b170e8c --- /dev/null +++ b/quantum/serial_link/tests/byte_stuffer_tests.c @@ -0,0 +1,506 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include +#include "serial_link/protocol/byte_stuffer.h" +#include "serial_link/protocol/byte_stuffer.c" +#include "serial_link/protocol/frame_validator.h" +#include "serial_link/protocol/physical.h" + +static uint8_t sent_data[MAX_FRAME_SIZE*2]; +static uint16_t sent_data_size; + +Describe(ByteStuffer); +BeforeEach(ByteStuffer) { + init_byte_stuffer(); + sent_data_size = 0; +} +AfterEach(ByteStuffer) {} + +void validator_recv_frame(uint8_t link, uint8_t* data, uint16_t size) { + mock(data, size); +} + +void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + memcpy(sent_data + sent_data_size, data, size); + sent_data_size += size; +} + +Ensure(ByteStuffer, receives_no_frame_for_a_single_zero_byte) { + never_expect(validator_recv_frame); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_no_frame_for_a_single_FF_byte) { + never_expect(validator_recv_frame); + byte_stuffer_recv_byte(0, 0xFF); +} + +Ensure(ByteStuffer, receives_no_frame_for_a_single_random_byte) { + never_expect(validator_recv_frame); + byte_stuffer_recv_byte(0, 0x4A); +} + +Ensure(ByteStuffer, receives_no_frame_for_a_zero_length_frame) { + never_expect(validator_recv_frame); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_single_byte_valid_frame) { + uint8_t expected[] = {0x37}; + expect(validator_recv_frame, + when(size, is_equal_to(1)), + when(data, is_equal_to_contents_of(expected, 1)) + ); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 0x37); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_three_bytes_valid_frame) { + uint8_t expected[] = {0x37, 0x99, 0xFF}; + expect(validator_recv_frame, + when(size, is_equal_to(3)), + when(data, is_equal_to_contents_of(expected, 3)) + ); + byte_stuffer_recv_byte(0, 4); + byte_stuffer_recv_byte(0, 0x37); + byte_stuffer_recv_byte(0, 0x99); + byte_stuffer_recv_byte(0, 0xFF); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_single_zero_valid_frame) { + uint8_t expected[] = {0}; + expect(validator_recv_frame, + when(size, is_equal_to(1)), + when(data, is_equal_to_contents_of(expected, 1)) + ); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_valid_frame_with_zeroes) { + uint8_t expected[] = {5, 0, 3, 0}; + expect(validator_recv_frame, + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(expected, 4)) + ); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 5); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 3); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_two_valid_frames) { + uint8_t expected1[] = {5, 0}; + uint8_t expected2[] = {3}; + expect(validator_recv_frame, + when(size, is_equal_to(2)), + when(data, is_equal_to_contents_of(expected1, 2)) + ); + expect(validator_recv_frame, + when(size, is_equal_to(1)), + when(data, is_equal_to_contents_of(expected2, 1)) + ); + byte_stuffer_recv_byte(1, 2); + byte_stuffer_recv_byte(1, 5); + byte_stuffer_recv_byte(1, 1); + byte_stuffer_recv_byte(1, 0); + byte_stuffer_recv_byte(1, 2); + byte_stuffer_recv_byte(1, 3); + byte_stuffer_recv_byte(1, 0); +} + +Ensure(ByteStuffer, receives_valid_frame_after_unexpected_zero) { + uint8_t expected[] = {5, 7}; + expect(validator_recv_frame, + when(size, is_equal_to(2)), + when(data, is_equal_to_contents_of(expected, 2)) + ); + byte_stuffer_recv_byte(1, 3); + byte_stuffer_recv_byte(1, 1); + byte_stuffer_recv_byte(1, 0); + byte_stuffer_recv_byte(1, 3); + byte_stuffer_recv_byte(1, 5); + byte_stuffer_recv_byte(1, 7); + byte_stuffer_recv_byte(1, 0); +} + +Ensure(ByteStuffer, receives_valid_frame_after_unexpected_non_zero) { + uint8_t expected[] = {5, 7}; + expect(validator_recv_frame, + when(size, is_equal_to(2)), + when(data, is_equal_to_contents_of(expected, 2)) + ); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 9); + byte_stuffer_recv_byte(0, 4); // This should have been zero + byte_stuffer_recv_byte(0, 0); + byte_stuffer_recv_byte(0, 3); + byte_stuffer_recv_byte(0, 5); + byte_stuffer_recv_byte(0, 7); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_and_then_end_of_frame) { + uint8_t expected[254]; + int i; + for (i=0;i<254;i++) { + expected[i] = i + 1; + } + expect(validator_recv_frame, + when(size, is_equal_to(254)), + when(data, is_equal_to_contents_of(expected, 254)) + ); + byte_stuffer_recv_byte(0, 0xFF); + for (i=0;i<254;i++) { + byte_stuffer_recv_byte(0, i+1); + } + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_non_zero) { + uint8_t expected[255]; + int i; + for (i=0;i<254;i++) { + expected[i] = i + 1; + } + expected[254] = 7; + expect(validator_recv_frame, + when(size, is_equal_to(255)), + when(data, is_equal_to_contents_of(expected, 255)) + ); + byte_stuffer_recv_byte(0, 0xFF); + for (i=0;i<254;i++) { + byte_stuffer_recv_byte(0, i+1); + } + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 7); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_a_valid_frame_with_over254_non_zeroes_next_byte_is_zero) { + uint8_t expected[255]; + int i; + for (i=0;i<254;i++) { + expected[i] = i + 1; + } + expected[254] = 0; + expect(validator_recv_frame, + when(size, is_equal_to(255)), + when(data, is_equal_to_contents_of(expected, 255)) + ); + byte_stuffer_recv_byte(0, 0xFF); + for (i=0;i<254;i++) { + byte_stuffer_recv_byte(0, i+1); + } + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_two_long_frames_and_some_more) { + uint8_t expected[515]; + int i; + int j; + for (j=0;j<2;j++) { + for (i=0;i<254;i++) { + expected[i+254*j] = i + 1; + } + } + for (i=0;i<7;i++) { + expected[254*2+i] = i + 1; + } + expect(validator_recv_frame, + when(size, is_equal_to(515)), + when(data, is_equal_to_contents_of(expected, 510)) + ); + byte_stuffer_recv_byte(0, 0xFF); + for (i=0;i<254;i++) { + byte_stuffer_recv_byte(0, i+1); + } + byte_stuffer_recv_byte(0, 0xFF); + for (i=0;i<254;i++) { + byte_stuffer_recv_byte(0, i+1); + } + byte_stuffer_recv_byte(0, 8); + byte_stuffer_recv_byte(0, 1); + byte_stuffer_recv_byte(0, 2); + byte_stuffer_recv_byte(0, 3); + byte_stuffer_recv_byte(0, 4); + byte_stuffer_recv_byte(0, 5); + byte_stuffer_recv_byte(0, 6); + byte_stuffer_recv_byte(0, 7); + byte_stuffer_recv_byte(0, 0); +} + +Ensure(ByteStuffer, receives_an_all_zeros_frame_that_is_maximum_size) { + uint8_t expected[MAX_FRAME_SIZE] = {}; + expect(validator_recv_frame, + when(size, is_equal_to(MAX_FRAME_SIZE)), + when(data, is_equal_to_contents_of(expected, MAX_FRAME_SIZE)) + ); + int i; + byte_stuffer_recv_byte(0, 1); + for(i=0;i +#include +#include "serial_link/protocol/byte_stuffer.c" +#include "serial_link/protocol/frame_validator.c" +#include "serial_link/protocol/frame_router.c" +#include "serial_link/protocol/transport.h" + +static uint8_t received_data[256]; +static uint16_t received_data_size; + +typedef struct { + uint8_t sent_data[256]; + uint16_t sent_data_size; +} receive_buffer_t; + +typedef struct { + receive_buffer_t send_buffers[2]; +} router_buffer_t; + +router_buffer_t router_buffers[8]; + +router_buffer_t* current_router_buffer; + + +Describe(FrameRouter); +BeforeEach(FrameRouter) { + init_byte_stuffer(); + memset(router_buffers, 0, sizeof(router_buffers)); + current_router_buffer = 0; +} +AfterEach(FrameRouter) {} + +typedef struct { + uint32_t data; + uint8_t extra[16]; +} frame_buffer_t; + + +void send_data(uint8_t link, const uint8_t* data, uint16_t size) { + receive_buffer_t* buffer = ¤t_router_buffer->send_buffers[link]; + memcpy(buffer->sent_data + buffer->sent_data_size, data, size); + buffer->sent_data_size += size; +} + +static void receive_data(uint8_t link, uint8_t* data, uint16_t size) { + int i; + for(i=0;i to) { + receive_data(DOWN_LINK, + router_buffers[from].send_buffers[UP_LINK].sent_data, + router_buffers[from].send_buffers[UP_LINK].sent_data_size); + } + else if(to > from) { + receive_data(UP_LINK, + router_buffers[from].send_buffers[DOWN_LINK].sent_data, + router_buffers[from].send_buffers[DOWN_LINK].sent_data_size); + } +} + +void transport_recv_frame(uint8_t from, uint8_t* data, uint16_t size) { + mock(from, data, size); +} + + +Ensure(FrameRouter, master_broadcast_is_received_by_everyone) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(0); + router_send_frame(0xFF, (uint8_t*)&data, 4); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(0)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(0, 1); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(0)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(1, 2); + assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); +} + +Ensure(FrameRouter, master_send_is_received_by_targets) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(0); + router_send_frame((1 << 1) | (1 << 2), (uint8_t*)&data, 4); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + simulate_transport(0, 1); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(0)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(1, 2); + assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(0)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(2, 3); + assert_that(router_buffers[3].send_buffers[DOWN_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[3].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); +} + +Ensure(FrameRouter, first_link_sends_to_master) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(1); + router_send_frame(0, (uint8_t*)&data, 4); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(1)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(1, 0); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); +} + +Ensure(FrameRouter, second_link_sends_to_master) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(2); + router_send_frame(0, (uint8_t*)&data, 4); + assert_that(router_buffers[2].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[2].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + + simulate_transport(2, 1); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + + expect(transport_recv_frame, + when(from, is_equal_to(2)), + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(&data.data, 4)) + ); + simulate_transport(1, 0); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); +} + +Ensure(FrameRouter, master_sends_to_master_does_nothing) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(0); + router_send_frame(0, (uint8_t*)&data, 4); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); +} + +Ensure(FrameRouter, link_sends_to_other_link_does_nothing) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(1); + router_send_frame(2, (uint8_t*)&data, 4); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); +} + +Ensure(FrameRouter, master_receives_on_uplink_does_nothing) { + frame_buffer_t data; + data.data = 0xAB7055BB; + activate_router(1); + router_send_frame(0, (uint8_t*)&data, 4); + assert_that(router_buffers[1].send_buffers[UP_LINK].sent_data_size, is_greater_than(0)); + assert_that(router_buffers[1].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); + + never_expect(transport_recv_frame); + activate_router(0); + receive_data(UP_LINK, + router_buffers[1].send_buffers[UP_LINK].sent_data, + router_buffers[1].send_buffers[UP_LINK].sent_data_size); + assert_that(router_buffers[0].send_buffers[UP_LINK].sent_data_size, is_equal_to(0)); + assert_that(router_buffers[0].send_buffers[DOWN_LINK].sent_data_size, is_equal_to(0)); +} diff --git a/quantum/serial_link/tests/frame_validator_tests.c b/quantum/serial_link/tests/frame_validator_tests.c new file mode 100644 index 000000000..d20947e2c --- /dev/null +++ b/quantum/serial_link/tests/frame_validator_tests.c @@ -0,0 +1,101 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include +#include "serial_link/protocol/frame_validator.c" + +void route_incoming_frame(uint8_t link, uint8_t* data, uint16_t size) { + mock(data, size); +} + +void byte_stuffer_send_frame(uint8_t link, uint8_t* data, uint16_t size) { + mock(data, size); +} + +Describe(FrameValidator); +BeforeEach(FrameValidator) {} +AfterEach(FrameValidator) {} + +Ensure(FrameValidator, doesnt_validate_frames_under_5_bytes) { + never_expect(route_incoming_frame); + uint8_t data[] = {1, 2}; + validator_recv_frame(0, 0, 1); + validator_recv_frame(0, data, 2); + validator_recv_frame(0, data, 3); + validator_recv_frame(0, data, 4); +} + +Ensure(FrameValidator, validates_one_byte_frame_with_correct_crc) { + uint8_t data[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; + expect(route_incoming_frame, + when(size, is_equal_to(1)), + when(data, is_equal_to_contents_of(data, 1)) + ); + validator_recv_frame(0, data, 5); +} + +Ensure(FrameValidator, does_not_validate_one_byte_frame_with_incorrect_crc) { + uint8_t data[] = {0x44, 0, 0, 0, 0}; + never_expect(route_incoming_frame); + validator_recv_frame(1, data, 5); +} + +Ensure(FrameValidator, validates_four_byte_frame_with_correct_crc) { + uint8_t data[] = {0x44, 0x10, 0xFF, 0x00, 0x74, 0x4E, 0x30, 0xBA}; + expect(route_incoming_frame, + when(size, is_equal_to(4)), + when(data, is_equal_to_contents_of(data, 4)) + ); + validator_recv_frame(1, data, 8); +} + +Ensure(FrameValidator, validates_five_byte_frame_with_correct_crc) { + uint8_t data[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; + expect(route_incoming_frame, + when(size, is_equal_to(5)), + when(data, is_equal_to_contents_of(data, 5)) + ); + validator_recv_frame(0, data, 9); +} + +Ensure(FrameValidator, sends_one_byte_with_correct_crc) { + uint8_t original[] = {0x44, 0, 0, 0, 0}; + uint8_t expected[] = {0x44, 0x04, 0x6A, 0xB3, 0xA3}; + expect(byte_stuffer_send_frame, + when(size, is_equal_to(sizeof(expected))), + when(data, is_equal_to_contents_of(expected, sizeof(expected))) + ); + validator_send_frame(0, original, 1); +} + +Ensure(FrameValidator, sends_five_bytes_with_correct_crc) { + uint8_t original[] = {1, 2, 3, 4, 5, 0, 0, 0, 0}; + uint8_t expected[] = {1, 2, 3, 4, 5, 0xF4, 0x99, 0x0B, 0x47}; + expect(byte_stuffer_send_frame, + when(size, is_equal_to(sizeof(expected))), + when(data, is_equal_to_contents_of(expected, sizeof(expected))) + ); + validator_send_frame(0, original, 5); +} diff --git a/quantum/serial_link/tests/transport_tests.c b/quantum/serial_link/tests/transport_tests.c new file mode 100644 index 000000000..358e1b9fd --- /dev/null +++ b/quantum/serial_link/tests/transport_tests.c @@ -0,0 +1,168 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include +#include "serial_link/protocol/transport.c" +#include "serial_link/protocol/triple_buffered_object.c" + +void signal_data_written(void) { + mock(); +} + +static uint8_t sent_data[2048]; +static uint16_t sent_data_size; + +void router_send_frame(uint8_t destination, uint8_t* data, uint16_t size) { + mock(destination); + memcpy(sent_data + sent_data_size, data, size); + sent_data_size += size; +} + +typedef struct { + uint32_t test; +} test_object1_t; + +typedef struct { + uint32_t test1; + uint32_t test2; +} test_object2_t; + +MASTER_TO_ALL_SLAVES_OBJECT(master_to_slave, test_object1_t); +MASTER_TO_SINGLE_SLAVE_OBJECT(master_to_single_slave, test_object1_t); +SLAVE_TO_MASTER_OBJECT(slave_to_master, test_object1_t); + +static remote_object_t* test_remote_objects[] = { + REMOTE_OBJECT(master_to_slave), + REMOTE_OBJECT(master_to_single_slave), + REMOTE_OBJECT(slave_to_master), +}; + +Describe(Transport); +BeforeEach(Transport) { + add_remote_objects(test_remote_objects, sizeof(test_remote_objects) / sizeof(remote_object_t*)); + sent_data_size = 0; +} +AfterEach(Transport) {} + +Ensure(Transport, write_to_local_signals_an_event) { + begin_write_master_to_slave(); + expect(signal_data_written); + end_write_master_to_slave(); + begin_write_slave_to_master(); + expect(signal_data_written); + end_write_slave_to_master(); + begin_write_master_to_single_slave(1); + expect(signal_data_written); + end_write_master_to_single_slave(1); +} + +Ensure(Transport, writes_from_master_to_all_slaves) { + update_transport(); + test_object1_t* obj = begin_write_master_to_slave(); + obj->test = 5; + expect(signal_data_written); + end_write_master_to_slave(); + expect(router_send_frame, + when(destination, is_equal_to(0xFF))); + update_transport(); + transport_recv_frame(0, sent_data, sent_data_size); + test_object1_t* obj2 = read_master_to_slave(); + assert_that(obj2, is_not_equal_to(NULL)); + assert_that(obj2->test, is_equal_to(5)); +} + +Ensure(Transport, writes_from_slave_to_master) { + update_transport(); + test_object1_t* obj = begin_write_slave_to_master(); + obj->test = 7; + expect(signal_data_written); + end_write_slave_to_master(); + expect(router_send_frame, + when(destination, is_equal_to(0))); + update_transport(); + transport_recv_frame(3, sent_data, sent_data_size); + test_object1_t* obj2 = read_slave_to_master(2); + assert_that(read_slave_to_master(0), is_equal_to(NULL)); + assert_that(obj2, is_not_equal_to(NULL)); + assert_that(obj2->test, is_equal_to(7)); +} + +Ensure(Transport, writes_from_master_to_single_slave) { + update_transport(); + test_object1_t* obj = begin_write_master_to_single_slave(3); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_single_slave(3); + expect(router_send_frame, + when(destination, is_equal_to(4))); + update_transport(); + transport_recv_frame(0, sent_data, sent_data_size); + test_object1_t* obj2 = read_master_to_single_slave(); + assert_that(obj2, is_not_equal_to(NULL)); + assert_that(obj2->test, is_equal_to(7)); +} + +Ensure(Transport, ignores_object_with_invalid_id) { + update_transport(); + test_object1_t* obj = begin_write_master_to_single_slave(3); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_single_slave(3); + expect(router_send_frame, + when(destination, is_equal_to(4))); + update_transport(); + sent_data[sent_data_size - 1] = 44; + transport_recv_frame(0, sent_data, sent_data_size); + test_object1_t* obj2 = read_master_to_single_slave(); + assert_that(obj2, is_equal_to(NULL)); +} + +Ensure(Transport, ignores_object_with_size_too_small) { + update_transport(); + test_object1_t* obj = begin_write_master_to_slave(); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_slave(); + expect(router_send_frame); + update_transport(); + sent_data[sent_data_size - 2] = 0; + transport_recv_frame(0, sent_data, sent_data_size - 1); + test_object1_t* obj2 = read_master_to_slave(); + assert_that(obj2, is_equal_to(NULL)); +} + +Ensure(Transport, ignores_object_with_size_too_big) { + update_transport(); + test_object1_t* obj = begin_write_master_to_slave(); + obj->test = 7; + expect(signal_data_written); + end_write_master_to_slave(); + expect(router_send_frame); + update_transport(); + sent_data[sent_data_size + 21] = 0; + transport_recv_frame(0, sent_data, sent_data_size + 22); + test_object1_t* obj2 = read_master_to_slave(); + assert_that(obj2, is_equal_to(NULL)); +} diff --git a/quantum/serial_link/tests/triple_buffered_object_tests.c b/quantum/serial_link/tests/triple_buffered_object_tests.c new file mode 100644 index 000000000..6f7c82b46 --- /dev/null +++ b/quantum/serial_link/tests/triple_buffered_object_tests.c @@ -0,0 +1,82 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#include +#include "serial_link/protocol/triple_buffered_object.c" + +typedef struct { + uint8_t state; + uint32_t buffer[3]; +}test_object_t; + +test_object_t test_object; + +Describe(TripleBufferedObject); +BeforeEach(TripleBufferedObject) { + triple_buffer_init((triple_buffer_object_t*)&test_object); +} +AfterEach(TripleBufferedObject) {} + + +Ensure(TripleBufferedObject, writes_and_reads_object) { + *triple_buffer_begin_write(&test_object) = 0x3456ABCC; + triple_buffer_end_write(&test_object); + assert_that(*triple_buffer_read(&test_object), is_equal_to(0x3456ABCC)); +} + +Ensure(TripleBufferedObject, does_not_read_empty) { + assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); +} + +Ensure(TripleBufferedObject, writes_twice_and_reads_object) { + *triple_buffer_begin_write(&test_object) = 0x3456ABCC; + triple_buffer_end_write(&test_object); + *triple_buffer_begin_write(&test_object) = 0x44778899; + triple_buffer_end_write(&test_object); + assert_that(*triple_buffer_read(&test_object), is_equal_to(0x44778899)); +} + +Ensure(TripleBufferedObject, performs_another_write_in_the_middle_of_read) { + *triple_buffer_begin_write(&test_object) = 1; + triple_buffer_end_write(&test_object); + uint32_t* read = triple_buffer_read(&test_object); + *triple_buffer_begin_write(&test_object) = 2; + triple_buffer_end_write(&test_object); + assert_that(*read, is_equal_to(1)); + assert_that(*triple_buffer_read(&test_object), is_equal_to(2)); + assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); +} + +Ensure(TripleBufferedObject, performs_two_writes_in_the_middle_of_read) { + *triple_buffer_begin_write(&test_object) = 1; + triple_buffer_end_write(&test_object); + uint32_t* read = triple_buffer_read(&test_object); + *triple_buffer_begin_write(&test_object) = 2; + triple_buffer_end_write(&test_object); + *triple_buffer_begin_write(&test_object) = 3; + triple_buffer_end_write(&test_object); + assert_that(*read, is_equal_to(1)); + assert_that(*triple_buffer_read(&test_object), is_equal_to(3)); + assert_that(triple_buffer_read(&test_object), is_equal_to(NULL)); +} -- cgit v1.2.3-24-g4f1b From eb6e17be6fc378fdfb8c5c2c7253c17ffc07d225 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 6 Jul 2016 09:04:04 -0400 Subject: adds eep, removes usbconfig.h --- keyboards/lets_split/eeprom-lefthand.eep | 2 + keyboards/lets_split/eeprom-righthand.eep | 2 + keyboards/lets_split/usbconfig.h | 377 ------------------------------ 3 files changed, 4 insertions(+), 377 deletions(-) create mode 100644 keyboards/lets_split/eeprom-lefthand.eep create mode 100644 keyboards/lets_split/eeprom-righthand.eep delete mode 100644 keyboards/lets_split/usbconfig.h diff --git a/keyboards/lets_split/eeprom-lefthand.eep b/keyboards/lets_split/eeprom-lefthand.eep new file mode 100644 index 000000000..a92200b12 --- /dev/null +++ b/keyboards/lets_split/eeprom-lefthand.eep @@ -0,0 +1,2 @@ +:080000000000000000000001F7 +:00000001FF diff --git a/keyboards/lets_split/eeprom-righthand.eep b/keyboards/lets_split/eeprom-righthand.eep new file mode 100644 index 000000000..91a683170 --- /dev/null +++ b/keyboards/lets_split/eeprom-righthand.eep @@ -0,0 +1,2 @@ +:080000000000000000000000F8 +:00000001FF diff --git a/keyboards/lets_split/usbconfig.h b/keyboards/lets_split/usbconfig.h deleted file mode 100644 index d0ca4c717..000000000 --- a/keyboards/lets_split/usbconfig.h +++ /dev/null @@ -1,377 +0,0 @@ -/* Name: usbconfig.h - * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers - * Author: Christian Starkjohann - * Creation Date: 2005-04-01 - * Tabsize: 4 - * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH - * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) - * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ - */ - -#ifndef __usbconfig_h_included__ -#define __usbconfig_h_included__ - - -/* -General Description: -This file is an example configuration (with inline documentation) for the USB -driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is -also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may -wire the lines to any other port, as long as D+ is also wired to INT0 (or any -other hardware interrupt, as long as it is the highest level interrupt, see -section at the end of this file). -*/ - -/* ---------------------------- Hardware Config ---------------------------- */ - -#define USB_CFG_IOPORTNAME D -/* This is the port where the USB bus is connected. When you configure it to - * "B", the registers PORTB, PINB and DDRB will be used. - */ -#define USB_CFG_DMINUS_BIT 3 -/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. - * This may be any bit in the port. - */ -#define USB_CFG_DPLUS_BIT 2 -/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. - * This may be any bit in the port. Please note that D+ must also be connected - * to interrupt pin INT0! [You can also use other interrupts, see section - * "Optional MCU Description" below, or you can connect D- to the interrupt, as - * it is required if you use the USB_COUNT_SOF feature. If you use D- for the - * interrupt, the USB interrupt will also be triggered at Start-Of-Frame - * markers every millisecond.] - */ -#define USB_CFG_CLOCK_KHZ (F_CPU/1000) -/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, - * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code - * require no crystal, they tolerate +/- 1% deviation from the nominal - * frequency. All other rates require a precision of 2000 ppm and thus a - * crystal! - * Since F_CPU should be defined to your actual clock rate anyway, you should - * not need to modify this setting. - */ -#define USB_CFG_CHECK_CRC 0 -/* Define this to 1 if you want that the driver checks integrity of incoming - * data packets (CRC checks). CRC checks cost quite a bit of code size and are - * currently only available for 18 MHz crystal clock. You must choose - * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. - */ - -/* ----------------------- Optional Hardware Config ------------------------ */ - -/* #define USB_CFG_PULLUP_IOPORTNAME D */ -/* If you connect the 1.5k pullup resistor from D- to a port pin instead of - * V+, you can connect and disconnect the device from firmware by calling - * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). - * This constant defines the port on which the pullup resistor is connected. - */ -/* #define USB_CFG_PULLUP_BIT 4 */ -/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined - * above) where the 1.5k pullup resistor is connected. See description - * above for details. - */ - -/* --------------------------- Functional Range ---------------------------- */ - -#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 -/* Define this to 1 if you want to compile a version with two endpoints: The - * default control endpoint 0 and an interrupt-in endpoint (any other endpoint - * number). - */ -#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 -/* Define this to 1 if you want to compile a version with three endpoints: The - * default control endpoint 0, an interrupt-in endpoint 3 (or the number - * configured below) and a catch-all default interrupt-in endpoint as above. - * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. - */ -#define USB_CFG_EP3_NUMBER 3 -/* If the so-called endpoint 3 is used, it can now be configured to any other - * endpoint number (except 0) with this macro. Default if undefined is 3. - */ -/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ -/* The above macro defines the startup condition for data toggling on the - * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. - * Since the token is toggled BEFORE sending any data, the first packet is - * sent with the oposite value of this configuration! - */ -#define USB_CFG_IMPLEMENT_HALT 0 -/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature - * for endpoint 1 (interrupt endpoint). Although you may not need this feature, - * it is required by the standard. We have made it a config option because it - * bloats the code considerably. - */ -#define USB_CFG_SUPPRESS_INTR_CODE 0 -/* Define this to 1 if you want to declare interrupt-in endpoints, but don't - * want to send any data over them. If this macro is defined to 1, functions - * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if - * you need the interrupt-in endpoints in order to comply to an interface - * (e.g. HID), but never want to send any data. This option saves a couple - * of bytes in flash memory and the transmit buffers in RAM. - */ -#define USB_CFG_INTR_POLL_INTERVAL 10 -/* If you compile a version with endpoint 1 (interrupt-in), this is the poll - * interval. The value is in milliseconds and must not be less than 10 ms for - * low speed devices. - */ -#define USB_CFG_IS_SELF_POWERED 0 -/* Define this to 1 if the device has its own power supply. Set it to 0 if the - * device is powered from the USB bus. - */ -#define USB_CFG_MAX_BUS_POWER 100 -/* Set this variable to the maximum USB bus power consumption of your device. - * The value is in milliamperes. [It will be divided by two since USB - * communicates power requirements in units of 2 mA.] - */ -#define USB_CFG_IMPLEMENT_FN_WRITE 1 -/* Set this to 1 if you want usbFunctionWrite() to be called for control-out - * transfers. Set it to 0 if you don't need it and want to save a couple of - * bytes. - */ -#define USB_CFG_IMPLEMENT_FN_READ 0 -/* Set this to 1 if you need to send control replies which are generated - * "on the fly" when usbFunctionRead() is called. If you only want to send - * data from a static buffer, set it to 0 and return the data from - * usbFunctionSetup(). This saves a couple of bytes. - */ -#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 -/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. - * You must implement the function usbFunctionWriteOut() which receives all - * interrupt/bulk data sent to any endpoint other than 0. The endpoint number - * can be found in 'usbRxToken'. - */ -#define USB_CFG_HAVE_FLOWCONTROL 0 -/* Define this to 1 if you want flowcontrol over USB data. See the definition - * of the macros usbDisableAllRequests() and usbEnableAllRequests() in - * usbdrv.h. - */ -#define USB_CFG_DRIVER_FLASH_PAGE 0 -/* If the device has more than 64 kBytes of flash, define this to the 64 k page - * where the driver's constants (descriptors) are located. Or in other words: - * Define this to 1 for boot loaders on the ATMega128. - */ -#define USB_CFG_LONG_TRANSFERS 0 -/* Define this to 1 if you want to send/receive blocks of more than 254 bytes - * in a single control-in or control-out transfer. Note that the capability - * for long transfers increases the driver size. - */ -/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ -/* This macro is a hook if you want to do unconventional things. If it is - * defined, it's inserted at the beginning of received message processing. - * If you eat the received message and don't want default processing to - * proceed, do a return after doing your things. One possible application - * (besides debugging) is to flash a status LED on each packet. - */ -/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ -/* This macro is a hook if you need to know when an USB RESET occurs. It has - * one parameter which distinguishes between the start of RESET state and its - * end. - */ -/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ -/* This macro (if defined) is executed when a USB SET_ADDRESS request was - * received. - */ -#define USB_COUNT_SOF 0 -/* define this macro to 1 if you need the global variable "usbSofCount" which - * counts SOF packets. This feature requires that the hardware interrupt is - * connected to D- instead of D+. - */ -/* #ifdef __ASSEMBLER__ - * macro myAssemblerMacro - * in YL, TCNT0 - * sts timer0Snapshot, YL - * endm - * #endif - * #define USB_SOF_HOOK myAssemblerMacro - * This macro (if defined) is executed in the assembler module when a - * Start Of Frame condition is detected. It is recommended to define it to - * the name of an assembler macro which is defined here as well so that more - * than one assembler instruction can be used. The macro may use the register - * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages - * immediately after an SOF pulse may be lost and must be retried by the host. - * What can you do with this hook? Since the SOF signal occurs exactly every - * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in - * designs running on the internal RC oscillator. - * Please note that Start Of Frame detection works only if D- is wired to the - * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! - */ -#define USB_CFG_CHECK_DATA_TOGGLING 0 -/* define this macro to 1 if you want to filter out duplicate data packets - * sent by the host. Duplicates occur only as a consequence of communication - * errors, when the host does not receive an ACK. Please note that you need to - * implement the filtering yourself in usbFunctionWriteOut() and - * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable - * for each control- and out-endpoint to check for duplicate packets. - */ -#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 -/* define this macro to 1 if you want the function usbMeasureFrameLength() - * compiled in. This function can be used to calibrate the AVR's RC oscillator. - */ -#define USB_USE_FAST_CRC 0 -/* The assembler module has two implementations for the CRC algorithm. One is - * faster, the other is smaller. This CRC routine is only used for transmitted - * messages where timing is not critical. The faster routine needs 31 cycles - * per byte while the smaller one needs 61 to 69 cycles. The faster routine - * may be worth the 32 bytes bigger code size if you transmit lots of data and - * run the AVR close to its limit. - */ - -/* -------------------------- Device Description --------------------------- */ - -#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) -/* USB vendor ID for the device, low byte first. If you have registered your - * own Vendor ID, define it here. Otherwise you may use one of obdev's free - * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) -/* This is the ID of the product, low byte first. It is interpreted in the - * scope of the vendor ID. If you have registered your own VID with usb.org - * or if you have licensed a PID from somebody else, define it here. Otherwise - * you may use one of obdev's free shared VID/PID pairs. See the file - * USB-IDs-for-free.txt for details! - * *** IMPORTANT NOTE *** - * This template uses obdev's shared VID/PID pair for Vendor Class devices - * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand - * the implications! - */ -#define USB_CFG_DEVICE_VERSION 0x00, 0x01 -/* Version number of the device: Minor number first, then major number. - */ -#define USB_CFG_VENDOR_NAME 't', '.', 'm', '.', 'k', '.' -#define USB_CFG_VENDOR_NAME_LEN 6 -/* These two values define the vendor name returned by the USB device. The name - * must be given as a list of characters under single quotes. The characters - * are interpreted as Unicode (UTF-16) entities. - * If you don't want a vendor name string, undefine these macros. - * ALWAYS define a vendor name containing your Internet domain name if you use - * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for - * details. - */ -#define USB_CFG_DEVICE_NAME 'P', 'S', '/', '2', ' ', 'k', 'e', 'y', 'b', 'o', 'a', 'r', 'd', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 't', 'e', 'r' -#define USB_CFG_DEVICE_NAME_LEN 23 -/* Same as above for the device name. If you don't want a device name, undefine - * the macros. See the file USB-IDs-for-free.txt before you assign a name if - * you use a shared VID/PID. - */ -/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ -/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ -/* Same as above for the serial number. If you don't want a serial number, - * undefine the macros. - * It may be useful to provide the serial number through other means than at - * compile time. See the section about descriptor properties below for how - * to fine tune control over USB descriptors such as the string descriptor - * for the serial number. - */ -#define USB_CFG_DEVICE_CLASS 0 -#define USB_CFG_DEVICE_SUBCLASS 0 -/* See USB specification if you want to conform to an existing device class. - * Class 0xff is "vendor specific". - */ -#define USB_CFG_INTERFACE_CLASS 3 /* HID */ -#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ -#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ -/* See USB specification if you want to conform to an existing device class or - * protocol. The following classes must be set at interface level: - * HID class is 3, no subclass and protocol required (but may be useful!) - * CDC class is 2, use subclass 2 and protocol 1 for ACM - */ -#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 -/* Define this to the length of the HID report descriptor, if you implement - * an HID device. Otherwise don't define it or define it to 0. - * If you use this define, you must add a PROGMEM character array named - * "usbHidReportDescriptor" to your code which contains the report descriptor. - * Don't forget to keep the array and this define in sync! - */ - -/* #define USB_PUBLIC static */ -/* Use the define above if you #include usbdrv.c instead of linking against it. - * This technique saves a couple of bytes in flash memory. - */ - -/* ------------------- Fine Control over USB Descriptors ------------------- */ -/* If you don't want to use the driver's default USB descriptors, you can - * provide our own. These can be provided as (1) fixed length static data in - * flash memory, (2) fixed length static data in RAM or (3) dynamically at - * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more - * information about this function. - * Descriptor handling is configured through the descriptor's properties. If - * no properties are defined or if they are 0, the default descriptor is used. - * Possible properties are: - * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched - * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is - * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if - * you want RAM pointers. - * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found - * in static memory is in RAM, not in flash memory. - * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), - * the driver must know the descriptor's length. The descriptor itself is - * found at the address of a well known identifier (see below). - * List of static descriptor names (must be declared PROGMEM if in flash): - * char usbDescriptorDevice[]; - * char usbDescriptorConfiguration[]; - * char usbDescriptorHidReport[]; - * char usbDescriptorString0[]; - * int usbDescriptorStringVendor[]; - * int usbDescriptorStringDevice[]; - * int usbDescriptorStringSerialNumber[]; - * Other descriptors can't be provided statically, they must be provided - * dynamically at runtime. - * - * Descriptor properties are or-ed or added together, e.g.: - * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) - * - * The following descriptors are defined: - * USB_CFG_DESCR_PROPS_DEVICE - * USB_CFG_DESCR_PROPS_CONFIGURATION - * USB_CFG_DESCR_PROPS_STRINGS - * USB_CFG_DESCR_PROPS_STRING_0 - * USB_CFG_DESCR_PROPS_STRING_VENDOR - * USB_CFG_DESCR_PROPS_STRING_PRODUCT - * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER - * USB_CFG_DESCR_PROPS_HID - * USB_CFG_DESCR_PROPS_HID_REPORT - * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) - * - * Note about string descriptors: String descriptors are not just strings, they - * are Unicode strings prefixed with a 2 byte header. Example: - * int serialNumberDescriptor[] = { - * USB_STRING_DESCRIPTOR_HEADER(6), - * 'S', 'e', 'r', 'i', 'a', 'l' - * }; - */ - -#define USB_CFG_DESCR_PROPS_DEVICE 0 -#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 -#define USB_CFG_DESCR_PROPS_STRINGS 0 -#define USB_CFG_DESCR_PROPS_STRING_0 0 -#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 -#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 -#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 -//#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC -#define USB_CFG_DESCR_PROPS_HID 0 -#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC -//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 -#define USB_CFG_DESCR_PROPS_UNKNOWN 0 - -/* ----------------------- Optional MCU Description ------------------------ */ - -/* The following configurations have working defaults in usbdrv.h. You - * usually don't need to set them explicitly. Only if you want to run - * the driver on a device which is not yet supported or with a compiler - * which is not fully supported (such as IAR C) or if you use a differnt - * interrupt than INT0, you may have to define some of these. - */ -/* #define USB_INTR_CFG MCUCR */ -/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ -/* #define USB_INTR_CFG_CLR 0 */ -/* #define USB_INTR_ENABLE GIMSK */ -/* #define USB_INTR_ENABLE_BIT INT0 */ -/* #define USB_INTR_PENDING GIFR */ -/* #define USB_INTR_PENDING_BIT INTF0 */ -/* #define USB_INTR_VECTOR INT0_vect */ - -#endif /* __usbconfig_h_included__ */ -- cgit v1.2.3-24-g4f1b From a7e3e4e652a2b9f172282f3876d74ee247a63105 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 6 Jul 2016 14:29:46 +0300 Subject: Add serial_link compilation to Infinity Ergodox --- Makefile | 12 +++++++++++- keyboards/infinity_ergodox/Makefile | 1 + keyboards/infinity_ergodox/infinity_ergodox.c | 10 ++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c285dabad..79f9e8b42 100644 --- a/Makefile +++ b/Makefile @@ -198,10 +198,20 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - OPT_DEFS += -DTAP_DANCE_ENABLE + OPT_DEFS += -DTAP_DANCE_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c endif +ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) + SERIAL_DIR = $(QUANTUM_DIR)/serial_link + SERIAL_PATH = $(QUANTUM_PATH)/serial_link + SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c) + SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) + SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) + OPT_DEFS += -DUSE_SERIAL_LINK + VAPTH += $(SERIAL_PATH) +endif + # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile index fb21aae5e..efa32e037 100644 --- a/keyboards/infinity_ergodox/Makefile +++ b/keyboards/infinity_ergodox/Makefile @@ -66,6 +66,7 @@ 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 ifndef QUANTUM_DIR include ../../Makefile diff --git a/keyboards/infinity_ergodox/infinity_ergodox.c b/keyboards/infinity_ergodox/infinity_ergodox.c index 34aded1a7..85054775e 100644 --- a/keyboards/infinity_ergodox/infinity_ergodox.c +++ b/keyboards/infinity_ergodox/infinity_ergodox.c @@ -1 +1,11 @@ #include "infinity_ergodox.h" +#include "ch.h" +#include "hal.h" +#include "serial_link/system/serial_link.h" + +void init_serial_link_hal(void) { + PORTA->PCR[1] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(2); + PORTA->PCR[2] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(2); + PORTE->PCR[0] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(3); + PORTE->PCR[1] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(3); +} -- cgit v1.2.3-24-g4f1b From 4b45deb652045aac73e5fdd7412a73bcef19c0c8 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 6 Jul 2016 15:22:34 +0300 Subject: Enable serial_link support for ChibiOS --- Makefile | 2 +- tmk_core/common/keyboard.c | 11 +++++++++-- tmk_core/protocol/chibios/main.c | 30 +++++++++++++++++++++++++++--- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 79f9e8b42..cfbe0e994 100644 --- a/Makefile +++ b/Makefile @@ -208,7 +208,7 @@ ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c) SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) - OPT_DEFS += -DUSE_SERIAL_LINK + OPT_DEFS += -DSERIAL_LINK_ENABLE VAPTH += $(SERIAL_PATH) endif diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 81df8eb73..3a1262a9f 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -49,6 +49,9 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE # include "rgblight.h" #endif +#ifdef SERIAL_LINK_ENABLE +# include "serial_link/system/serial_link.h" +#endif #ifdef MATRIX_HAS_GHOST static bool has_ghost_in_row(uint8_t row) @@ -167,11 +170,15 @@ MATRIX_LOOP_END: #endif #ifdef SERIAL_MOUSE_ENABLE - serial_mouse_task(); + serial_mouse_task(); #endif #ifdef ADB_MOUSE_ENABLE - adb_mouse_task(); + adb_mouse_task(); +#endif + +#ifdef SERIAL_LINK_ENABLE + serial_link_update(); #endif // update LED diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 54bb6a8f5..aeb11752f 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -35,6 +35,9 @@ #ifdef SLEEP_LED_ENABLE #include "sleep_led.h" #endif +#ifdef SERIAL_LINK_ENABLE +#include "serial_link/system/serial_link.h" +#endif #include "suspend.h" @@ -98,9 +101,27 @@ int main(void) { /* init printf */ init_printf(NULL,sendchar_pf); - /* Wait until the USB is active */ - while(USB_DRIVER.state != USB_ACTIVE) +#ifdef SERIAL_LINK_ENABLE + init_serial_link(); +#endif + + host_driver_t* driver = NULL; + + /* Wait until the USB or serial link is active */ + while (true) { + if(USB_DRIVER.state == USB_ACTIVE) { + driver = &chibios_driver; + break; + } +#ifdef SERIAL_LINK_ENABLE + if(is_serial_link_connected()) { + driver = get_serial_link_driver(); + break; + } + serial_link_update(); +#endif chThdSleepMilliseconds(50); + } /* Do need to wait here! * Otherwise the next print might start a transfer on console EP @@ -113,7 +134,7 @@ int main(void) { /* init TMK modules */ keyboard_init(); - host_set_driver(&chibios_driver); + host_set_driver(driver); #ifdef SLEEP_LED_ENABLE sleep_led_init(); @@ -128,6 +149,9 @@ int main(void) { print("[s]"); while(USB_DRIVER.state == USB_SUSPENDED) { /* Do this in the suspended state */ +#ifdef SERIAL_LINK_ENABLE + serial_link_update(); +#endif suspend_power_down(); // on AVR this deep sleeps for 15ms /* Remote wakeup */ if((USB_DRIVER.status & 2) && suspend_wakeup_condition()) { -- cgit v1.2.3-24-g4f1b From e5726b017a9de2922ea923818c6e215600f68a85 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 6 Jul 2016 15:36:45 +0300 Subject: Add setting of the master side to the makefile --- Makefile | 14 ++++++++++++++ tmk_core/common.mk | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/Makefile b/Makefile index cfbe0e994..7c00ce2cc 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,12 @@ ifndef KEYBOARD KEYBOARD=planck endif +MASTER ?= left +ifdef master + MASTER = $(master) +endif + + # converts things to keyboards/subproject ifneq (,$(findstring /,$(KEYBOARD))) TEMP:=$(KEYBOARD) @@ -212,6 +218,14 @@ ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) VAPTH += $(SERIAL_PATH) endif +ifeq ($(MASTER),right) + OPT_DEFS += -DMASTER_IS_ON_RIGHT +else + ifneq ($(MASTER),left) +$(error MASTER does not have a valid value(left/right)) + endif +endif + # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax diff --git a/tmk_core/common.mk b/tmk_core/common.mk index d71fba9bc..5bae0d762 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -97,6 +97,15 @@ ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes) endif endif +ifeq ($(MASTER),right) + OPT_DEFS += -DMASTER_IS_ON_RIGHT +else + ifneq ($(MASTER),left) +$(error MASTER does not have a valid value(left/right)) + endif +endif + + # Version string OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null) -- cgit v1.2.3-24-g4f1b From f727801bc69b3db28f84b7b8986756193bbfd21e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Wed, 6 Jul 2016 20:17:16 +0300 Subject: Delete .gitmodules from visualizer --- quantum/visualizer/.gitmodules | 3 --- quantum/visualizer/ugfx | 1 - 2 files changed, 4 deletions(-) delete mode 100644 quantum/visualizer/.gitmodules delete mode 160000 quantum/visualizer/ugfx diff --git a/quantum/visualizer/.gitmodules b/quantum/visualizer/.gitmodules deleted file mode 100644 index b320458c0..000000000 --- a/quantum/visualizer/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "ugfx"] - path = ugfx - url = https://bitbucket.org/fredizzimo/ugfx.git diff --git a/quantum/visualizer/ugfx b/quantum/visualizer/ugfx deleted file mode 160000 index e221a6906..000000000 --- a/quantum/visualizer/ugfx +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e221a690616e20f87e0b0088baffdbd5427be862 -- cgit v1.2.3-24-g4f1b From 10f3a1b6215af2a1c74b0245e46f5b6352ee18a4 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 00:17:32 +0300 Subject: Add ugfx submodule --- .gitmodules | 3 +++ lib/ugfx | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/ugfx diff --git a/.gitmodules b/.gitmodules index 1576b8dc0..7e3c92d03 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "lib/chibios-contrib"] path = lib/chibios-contrib url = https://github.com/ChibiOS/ChibiOS-Contrib.git +[submodule "lib/ugfx"] + path = lib/ugfx + url = https://bitbucket.org/Tectu/ugfx diff --git a/lib/ugfx b/lib/ugfx new file mode 160000 index 000000000..13e084ae6 --- /dev/null +++ b/lib/ugfx @@ -0,0 +1 @@ +Subproject commit 13e084ae6231857cd0d472c529f34be07d93c08b -- cgit v1.2.3-24-g4f1b From 70797bb8f21c72cba15b314b2d0a6684bfedc369 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 00:20:20 +0300 Subject: Makefile changes and files to compile Visualizer --- Makefile | 15 +- keyboards/infinity_ergodox/Makefile | 3 + keyboards/infinity_ergodox/gfxconf.h | 331 +++++++++++++++++++++++++ keyboards/infinity_ergodox/lcd_backlight_hal.c | 84 +++++++ keyboards/infinity_ergodox/visualizer_user.c | 168 +++++++++++++ quantum/visualizer/visualizer.c | 2 - quantum/visualizer/visualizer.h | 2 - quantum/visualizer/visualizer.mk | 22 +- 8 files changed, 604 insertions(+), 23 deletions(-) create mode 100644 keyboards/infinity_ergodox/gfxconf.h create mode 100644 keyboards/infinity_ergodox/lcd_backlight_hal.c create mode 100644 keyboards/infinity_ergodox/visualizer_user.c diff --git a/Makefile b/Makefile index 7c00ce2cc..a7a10bf32 100644 --- a/Makefile +++ b/Makefile @@ -218,14 +218,6 @@ ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes) VAPTH += $(SERIAL_PATH) endif -ifeq ($(MASTER),right) - OPT_DEFS += -DMASTER_IS_ON_RIGHT -else - ifneq ($(MASTER),left) -$(error MASTER does not have a valid value(left/right)) - endif -endif - # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax @@ -257,10 +249,17 @@ ifeq ($(PLATFORM),AVR) else ifeq ($(PLATFORM),CHIBIOS) include $(TMK_PATH)/protocol/chibios.mk include $(TMK_PATH)/chibios.mk + OPT_OS = chibios else $(error Unknown platform) endif +ifeq ($(strip $(VISUALIZER_ENABLE)), yes) + VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer + VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer + include $(VISUALIZER_PATH)/visualizer.mk +endif + include $(TMK_PATH)/rules.mk GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile index efa32e037..8be2f51b1 100644 --- a/keyboards/infinity_ergodox/Makefile +++ b/keyboards/infinity_ergodox/Makefile @@ -67,6 +67,9 @@ 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 +LCD_ENABLE ?= yes +LCD_BACKLIGHT_ENABLE ?= yes ifndef QUANTUM_DIR include ../../Makefile diff --git a/keyboards/infinity_ergodox/gfxconf.h b/keyboards/infinity_ergodox/gfxconf.h new file mode 100644 index 000000000..8caa577b7 --- /dev/null +++ b/keyboards/infinity_ergodox/gfxconf.h @@ -0,0 +1,331 @@ +/** + * This file has a different license to the rest of the uGFX system. + * You can copy, modify and distribute this file as you see fit. + * You do not need to publish your source modifications to this file. + * The only thing you are not permitted to do is to relicense it + * under a different license. + */ + +/** + * Copy this file into your project directory and rename it as gfxconf.h + * Edit your copy to turn on the uGFX features you want to use. + * The values below are the defaults. + * + * Only remove the comments from lines where you want to change the + * default value. This allows definitions to be included from + * driver makefiles when required and provides the best future + * compatibility for your project. + * + * Please use spaces instead of tabs in this file. + */ + +#ifndef _GFXCONF_H +#define _GFXCONF_H + + +/////////////////////////////////////////////////////////////////////////// +// GOS - One of these must be defined, preferably in your Makefile // +/////////////////////////////////////////////////////////////////////////// +//#define GFX_USE_OS_CHIBIOS TRUE +//#define GFX_USE_OS_FREERTOS FALSE +// #define GFX_FREERTOS_USE_TRACE FALSE +//#define GFX_USE_OS_WIN32 FALSE +//#define GFX_USE_OS_LINUX FALSE +//#define GFX_USE_OS_OSX FALSE +//#define GFX_USE_OS_ECOS FALSE +//#define GFX_USE_OS_RAWRTOS FALSE +//#define GFX_USE_OS_ARDUINO FALSE +//#define GFX_USE_OS_KEIL FALSE +//#define GFX_USE_OS_CMSIS FALSE +//#define GFX_USE_OS_RAW32 FALSE +// #define INTERRUPTS_OFF() optional_code +// #define INTERRUPTS_ON() optional_code +// These are not defined by default for some reason +#define GOS_NEED_X_THREADS FALSE +#define GOS_NEED_X_HEAP FALSE + +// Options that (should where relevant) apply to all operating systems + #define GFX_NO_INLINE FALSE +// #define GFX_COMPILER GFX_COMPILER_UNKNOWN +// #define GFX_CPU GFX_CPU_UNKNOWN +// #define GFX_OS_HEAP_SIZE 0 +// #define GFX_OS_NO_INIT FALSE +// #define GFX_OS_INIT_NO_WARNING FALSE +// #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine +// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine +// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine + + +/////////////////////////////////////////////////////////////////////////// +// GDISP // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GDISP TRUE + +//#define GDISP_NEED_AUTOFLUSH FALSE +//#define GDISP_NEED_TIMERFLUSH FALSE +//#define GDISP_NEED_VALIDATION TRUE +//#define GDISP_NEED_CLIP TRUE +#define GDISP_NEED_CIRCLE TRUE +#define GDISP_NEED_ELLIPSE TRUE +#define GDISP_NEED_ARC TRUE +#define GDISP_NEED_ARCSECTORS TRUE +#define GDISP_NEED_CONVEX_POLYGON TRUE +//#define GDISP_NEED_SCROLL FALSE +#define GDISP_NEED_PIXELREAD TRUE +#define GDISP_NEED_CONTROL TRUE +//#define GDISP_NEED_QUERY FALSE +//#define GDISP_NEED_MULTITHREAD FALSE +//#define GDISP_NEED_STREAMING FALSE +#define GDISP_NEED_TEXT TRUE +// #define GDISP_NEED_TEXT_WORDWRAP FALSE +// #define GDISP_NEED_ANTIALIAS FALSE +// #define GDISP_NEED_UTF8 FALSE + #define GDISP_NEED_TEXT_KERNING TRUE +// #define GDISP_INCLUDE_FONT_UI1 FALSE +// #define GDISP_INCLUDE_FONT_UI2 FALSE // The smallest preferred font. +// #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS20 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE + #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 TRUE +// #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE +// #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE + #define GDISP_INCLUDE_FONT_FIXED_5X8 TRUE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS20_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE +// #define GDISP_INCLUDE_USER_FONTS FALSE + +//#define GDISP_NEED_IMAGE FALSE +// #define GDISP_NEED_IMAGE_NATIVE FALSE +// #define GDISP_NEED_IMAGE_GIF FALSE +// #define GDISP_NEED_IMAGE_BMP FALSE +// #define GDISP_NEED_IMAGE_BMP_1 FALSE +// #define GDISP_NEED_IMAGE_BMP_4 FALSE +// #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE +// #define GDISP_NEED_IMAGE_BMP_8 FALSE +// #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE +// #define GDISP_NEED_IMAGE_BMP_16 FALSE +// #define GDISP_NEED_IMAGE_BMP_24 FALSE +// #define GDISP_NEED_IMAGE_BMP_32 FALSE +// #define GDISP_NEED_IMAGE_JPG FALSE +// #define GDISP_NEED_IMAGE_PNG FALSE +// #define GDISP_NEED_IMAGE_ACCOUNTING FALSE +#ifdef EMULATOR +#define GDISP_NEED_PIXMAP TRUE +#endif +// #define GDISP_NEED_PIXMAP_IMAGE FALSE + +//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used. +//#define GDISP_LINEBUF_SIZE 128 +//#define GDISP_STARTUP_COLOR Black +#define GDISP_NEED_STARTUP_LOGO FALSE + +//#define GDISP_TOTAL_DISPLAYS 2 + +#ifndef EMULATOR +#define GDISP_DRIVER_LIST GDISPVMT_ST7565_ERGODOX, GDISPVMT_IS31FL3731C_ERGODOX +#else +#define GDISP_DRIVER_LIST GDISPVMT_EMULATOR_LCD_ERGODOX, GDISPVMT_EMULATOR_LED_ERGODOX +#endif + + #ifdef GDISP_DRIVER_LIST + // For code and speed optimization define as TRUE or FALSE if all controllers have the same capability + #define GDISP_HARDWARE_STREAM_WRITE FALSE + #define GDISP_HARDWARE_STREAM_READ FALSE + #define GDISP_HARDWARE_STREAM_POS FALSE + #define GDISP_HARDWARE_DRAWPIXEL TRUE + #define GDISP_HARDWARE_CLEARS FALSE + #define GDISP_HARDWARE_FILLS FALSE + #define GDISP_HARDWARE_BITFILLS FALSE + #define GDISP_HARDWARE_SCROLL FALSE + #define GDISP_HARDWARE_PIXELREAD TRUE + #define GDISP_HARDWARE_CONTROL TRUE + #define GDISP_HARDWARE_QUERY FALSE + #define GDISP_HARDWARE_CLIP FALSE + + #define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 + #endif + +// The custom format is not defined for some reason, so define it as error +// so we don't get compiler warnings +#define GDISP_PIXELFORMAT_CUSTOM GDISP_PIXELFORMAT_ERROR + +#define GDISP_USE_GFXNET FALSE +// #define GDISP_GFXNET_PORT 13001 +// #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE +// #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE +// #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GWIN // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GWIN FALSE + +//#define GWIN_NEED_WINDOWMANAGER FALSE +// #define GWIN_REDRAW_IMMEDIATE FALSE +// #define GWIN_REDRAW_SINGLEOP FALSE +// #define GWIN_NEED_FLASHING FALSE +// #define GWIN_FLASHING_PERIOD 250 + +//#define GWIN_NEED_CONSOLE FALSE +// #define GWIN_CONSOLE_USE_HISTORY FALSE +// #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE +// #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE +// #define GWIN_CONSOLE_ESCSEQ FALSE +// #define GWIN_CONSOLE_USE_BASESTREAM FALSE +// #define GWIN_CONSOLE_USE_FLOAT FALSE +//#define GWIN_NEED_GRAPH FALSE +//#define GWIN_NEED_GL3D FALSE + +//#define GWIN_NEED_WIDGET FALSE +//#define GWIN_FOCUS_HIGHLIGHT_WIDTH 1 +// #define GWIN_NEED_LABEL FALSE +// #define GWIN_LABEL_ATTRIBUTE FALSE +// #define GWIN_NEED_BUTTON FALSE +// #define GWIN_BUTTON_LAZY_RELEASE FALSE +// #define GWIN_NEED_SLIDER FALSE +// #define GWIN_SLIDER_NOSNAP FALSE +// #define GWIN_SLIDER_DEAD_BAND 5 +// #define GWIN_SLIDER_TOGGLE_INC 20 +// #define GWIN_NEED_CHECKBOX FALSE +// #define GWIN_NEED_IMAGE FALSE +// #define GWIN_NEED_IMAGE_ANIMATION FALSE +// #define GWIN_NEED_RADIO FALSE +// #define GWIN_NEED_LIST FALSE +// #define GWIN_NEED_LIST_IMAGES FALSE +// #define GWIN_NEED_PROGRESSBAR FALSE +// #define GWIN_PROGRESSBAR_AUTO FALSE +// #define GWIN_NEED_KEYBOARD FALSE +// #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_English1 +// #define GWIN_NEED_KEYBOARD_ENGLISH1 TRUE +// #define GWIN_NEED_TEXTEDIT FALSE +// #define GWIN_FLAT_STYLING FALSE +// #define GWIN_WIDGET_TAGS FALSE + +//#define GWIN_NEED_CONTAINERS FALSE +// #define GWIN_NEED_CONTAINER FALSE +// #define GWIN_NEED_FRAME FALSE +// #define GWIN_NEED_TABSET FALSE +// #define GWIN_TABSET_TABHEIGHT 18 + + +/////////////////////////////////////////////////////////////////////////// +// GEVENT // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GEVENT TRUE + +//#define GEVENT_ASSERT_NO_RESOURCE FALSE +//#define GEVENT_MAXIMUM_SIZE 32 +//#define GEVENT_MAX_SOURCE_LISTENERS 32 + + +/////////////////////////////////////////////////////////////////////////// +// GTIMER // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GTIMER FALSE + +//#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY +//#define GTIMER_THREAD_WORKAREA_SIZE 2048 + + +/////////////////////////////////////////////////////////////////////////// +// GQUEUE // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GQUEUE FALSE + +//#define GQUEUE_NEED_ASYNC FALSE +//#define GQUEUE_NEED_GSYNC FALSE +//#define GQUEUE_NEED_FSYNC FALSE +//#define GQUEUE_NEED_BUFFERS FALSE + +/////////////////////////////////////////////////////////////////////////// +// GINPUT // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GINPUT FALSE + +//#define GINPUT_NEED_MOUSE FALSE +// #define GINPUT_TOUCH_STARTRAW FALSE +// #define GINPUT_TOUCH_NOTOUCH FALSE +// #define GINPUT_TOUCH_NOCALIBRATE FALSE +// #define GINPUT_TOUCH_NOCALIBRATE_GUI FALSE +// #define GINPUT_MOUSE_POLL_PERIOD 25 +// #define GINPUT_MOUSE_CLICK_TIME 300 +// #define GINPUT_TOUCH_CXTCLICK_TIME 700 +// #define GINPUT_TOUCH_USER_CALIBRATION_LOAD FALSE +// #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE +// #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32 +//#define GINPUT_NEED_KEYBOARD FALSE +// #define GINPUT_KEYBOARD_POLL_PERIOD 200 +// #define GKEYBOARD_DRIVER_LIST GKEYBOARDVMT_Win32, GKEYBOARDVMT_Win32 +// #define GKEYBOARD_LAYOUT_OFF FALSE +// #define GKEYBOARD_LAYOUT_SCANCODE2_US FALSE +//#define GINPUT_NEED_TOGGLE FALSE +//#define GINPUT_NEED_DIAL FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GFILE // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GFILE FALSE + +//#define GFILE_NEED_PRINTG FALSE +//#define GFILE_NEED_SCANG FALSE +//#define GFILE_NEED_STRINGS FALSE +//#define GFILE_NEED_FILELISTS FALSE +//#define GFILE_NEED_STDIO FALSE +//#define GFILE_NEED_NOAUTOMOUNT FALSE +//#define GFILE_NEED_NOAUTOSYNC FALSE + +//#define GFILE_NEED_MEMFS FALSE +//#define GFILE_NEED_ROMFS FALSE +//#define GFILE_NEED_RAMFS FALSE +//#define GFILE_NEED_FATFS FALSE +//#define GFILE_NEED_NATIVEFS FALSE +//#define GFILE_NEED_CHBIOSFS FALSE + +//#define GFILE_ALLOW_FLOATS FALSE +//#define GFILE_ALLOW_DEVICESPECIFIC FALSE +//#define GFILE_MAX_GFILES 3 + +/////////////////////////////////////////////////////////////////////////// +// GADC // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GADC FALSE + +//#define GADC_MAX_LOWSPEED_DEVICES 4 + + +/////////////////////////////////////////////////////////////////////////// +// GAUDIO // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GAUDIO FALSE +// There seems to be a bug in the ugfx code, the wrong define is used +// So define it in order to avoid warnings +#define GFX_USE_GAUDIN GFX_USE_GAUDIO +// #define GAUDIO_NEED_PLAY FALSE +// #define GAUDIO_NEED_RECORD FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GMISC // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GMISC TRUE + +//#define GMISC_NEED_ARRAYOPS FALSE +//#define GMISC_NEED_FASTTRIG FALSE +//#define GMISC_NEED_FIXEDTRIG FALSE +//#define GMISC_NEED_INVSQRT FALSE +// #define GMISC_INVSQRT_MIXED_ENDIAN FALSE +// #define GMISC_INVSQRT_REAL_SLOW FALSE +#define GMISC_NEED_MATRIXFLOAT2D TRUE +#define GMISC_NEED_MATRIXFIXED2D FALSE + +#endif /* _GFXCONF_H */ diff --git a/keyboards/infinity_ergodox/lcd_backlight_hal.c b/keyboards/infinity_ergodox/lcd_backlight_hal.c new file mode 100644 index 000000000..05fc810b4 --- /dev/null +++ b/keyboards/infinity_ergodox/lcd_backlight_hal.c @@ -0,0 +1,84 @@ +/* +Copyright 2016 Fred Sundvik +Jun Wako + +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 . +*/ +#include "lcd_backlight.h" +#include "hal.h" + +#define RED_PIN 1 +#define GREEN_PIN 2 +#define BLUE_PIN 3 +#define CHANNEL_RED FTM0->CHANNEL[0] +#define CHANNEL_GREEN FTM0->CHANNEL[1] +#define CHANNEL_BLUE FTM0->CHANNEL[2] + +#define RGB_PORT PORTC +#define RGB_PORT_GPIO GPIOC + +// Base FTM clock selection (72 MHz system clock) +// @ 0xFFFF period, 72 MHz / (0xFFFF * 2) = Actual period +// Higher pre-scalar will use the most power (also look the best) +// Pre-scalar calculations +// 0 - 72 MHz -> 549 Hz +// 1 - 36 MHz -> 275 Hz +// 2 - 18 MHz -> 137 Hz +// 3 - 9 MHz -> 69 Hz (Slightly visible flicker) +// 4 - 4 500 kHz -> 34 Hz (Visible flickering) +// 5 - 2 250 kHz -> 17 Hz +// 6 - 1 125 kHz -> 9 Hz +// 7 - 562 500 Hz -> 4 Hz +// 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 + +void lcd_backlight_hal_init(void) { + // Setup Backlight + SIM->SCGC6 |= SIM_SCGC6_FTM0; + FTM0->CNT = 0; // Reset counter + + // PWM Period + // 16-bit maximum + FTM0->MOD = 0xFFFF; + + // Set FTM to PWM output - Edge Aligned, Low-true pulses +#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0) + CHANNEL_RED.CnSC = CNSC_MODE; + CHANNEL_GREEN.CnSC = CNSC_MODE; + CHANNEL_BLUE.CnSC = CNSC_MODE; + + // System clock, /w prescalar setting + FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE); + + CHANNEL_RED.CnV = 0; + CHANNEL_GREEN.CnV = 0; + CHANNEL_BLUE.CnV = 0; + + RGB_PORT_GPIO->PDDR |= (1 << RED_PIN); + RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN); + RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN); + +#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4) + RGB_PORT->PCR[RED_PIN] = RGB_MODE; + RGB_PORT->PCR[GREEN_PIN] = RGB_MODE; + RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; +} + +void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { + CHANNEL_RED.CnV = r; + CHANNEL_GREEN.CnV = g; + CHANNEL_BLUE.CnV = b; +} + diff --git a/keyboards/infinity_ergodox/visualizer_user.c b/keyboards/infinity_ergodox/visualizer_user.c new file mode 100644 index 000000000..c0d335ce6 --- /dev/null +++ b/keyboards/infinity_ergodox/visualizer_user.c @@ -0,0 +1,168 @@ +/* +Copyright 2016 Fred Sundvik + +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 . +*/ + +// Currently we are assuming that both the backlight and LCD are enabled +// But it's entirely possible to write a custom visualizer that use only +// one of them +#ifndef LCD_BACKLIGHT_ENABLE +#error This visualizer needs that LCD backlight is enabled +#endif + +#ifndef LCD_ENABLE +#error This visualizer needs that LCD is enabled +#endif + +#include "visualizer.h" +#include "led_test.h" + +static const char* welcome_text[] = {"TMK", "Infinity Ergodox"}; + +// Just an example how to write custom keyframe functions, we could have moved +// all this into the init function +bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + // Read the uGFX documentation for information how to use the displays + // http://wiki.ugfx.org/index.php/Main_Page + gdispClear(White); + // You can use static variables for things that can't be found in the animation + // or state structs + gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black); + gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black); + // Always remember to flush the display + gdispFlush(); + // you could set the backlight color as well, but we won't do it here, since + // it's part of the following animation + // lcd_backlight_color(hue, saturation, intensity); + // We don't need constant updates, just drawing the screen once is enough + return false; +} + +// Feel free to modify the animations below, or even add new ones if needed + +// Don't worry, if the startup animation is long, you can use the keyboard like normal +// during that time +static keyframe_animation_t startup_animation = { + .num_frames = 4, + .loop = false, + .frame_lengths = {0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, + .frame_functions = { + display_welcome, + keyframe_animate_backlight_color, + keyframe_no_operation, + enable_visualization + }, +}; + +// The color animation animates the LCD color when you change layers +static keyframe_animation_t color_animation = { + .num_frames = 2, + .loop = false, + // Note that there's a 200 ms no-operation frame, + // this prevents the color from changing when activating the layer + // momentarily + .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)}, + .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color}, +}; + +// The LCD animation alternates between the layer name display and a +// bitmap that displays all active layers +static keyframe_animation_t lcd_animation = { + .num_frames = 2, + .loop = true, + .frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)}, + .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap}, +}; + +static keyframe_animation_t suspend_animation = { + .num_frames = 3, + .loop = false, + .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0}, + .frame_functions = { + keyframe_display_layer_text, + keyframe_animate_backlight_color, + keyframe_disable_lcd_and_backlight, + }, +}; + +static keyframe_animation_t resume_animation = { + .num_frames = 5, + .loop = false, + .frame_lengths = {0, 0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, + .frame_functions = { + keyframe_enable_lcd_and_backlight, + display_welcome, + keyframe_animate_backlight_color, + keyframe_no_operation, + enable_visualization, + }, +}; + +void initialize_user_visualizer(visualizer_state_t* state) { + // The brightness will be dynamically adjustable in the future + // But for now, change it here. + lcd_backlight_brightness(0x50); + state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF); + state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); + start_keyframe_animation(&startup_animation); + start_keyframe_animation(&led_test_animation); +} + +void update_user_visualizer_state(visualizer_state_t* state) { + // Add more tests, change the colors and layer texts here + // Usually you want to check the high bits (higher layers first) + // because that's the order layers are processed for keypresses + // You can for check for example: + // state->status.layer + // state->status.default_layer + // state->status.leds (see led.h for available statuses) + if (state->status.layer & 0x8) { + state->target_lcd_color = LCD_COLOR(0xC0, 0xB0, 0xFF); + state->layer_text = "Numpad"; + } + else if (state->status.layer & 0x4) { + state->target_lcd_color = LCD_COLOR(0, 0xB0, 0xFF); + state->layer_text = "KBD functions"; + } + else if (state->status.layer & 0x2) { + state->target_lcd_color = LCD_COLOR(0x80, 0xB0, 0xFF); + state->layer_text = "Function keys"; + } + else { + state->target_lcd_color = LCD_COLOR(0x40, 0xB0, 0xFF); + state->layer_text = "Default"; + } + // You can also stop existing animations, and start your custom ones here + // remember that you should normally have only one animation for the LCD + // and one for the background. But you can also combine them if you want. + start_keyframe_animation(&lcd_animation); + start_keyframe_animation(&color_animation); +} + +void user_visualizer_suspend(visualizer_state_t* state) { + state->layer_text = "Suspending..."; + uint8_t hue = LCD_HUE(state->current_lcd_color); + uint8_t sat = LCD_SAT(state->current_lcd_color); + state->target_lcd_color = LCD_COLOR(hue, sat, 0); + start_keyframe_animation(&suspend_animation); +} + +void user_visualizer_resume(visualizer_state_t* state) { + state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0x00); + state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); + start_keyframe_animation(&resume_animation); + start_keyframe_animation(&led_test_animation); +} diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index c24073405..abca22d85 100644 --- a/quantum/visualizer/visualizer.c +++ b/quantum/visualizer/visualizer.c @@ -29,9 +29,7 @@ SOFTWARE. #include "ch.h" #endif -#ifdef LCD_ENABLE #include "gfx.h" -#endif #ifdef LCD_BACKLIGHT_ENABLE #include "lcd_backlight.h" diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h index 45cfa9aa9..53e250725 100644 --- a/quantum/visualizer/visualizer.h +++ b/quantum/visualizer/visualizer.h @@ -28,9 +28,7 @@ SOFTWARE. #include #include -#ifdef LCD_ENABLE #include "gfx.h" -#endif #ifdef LCD_BACKLIGHT_ENABLE #include "lcd_backlight.h" diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk index 56525ffd9..b5dfad8e1 100644 --- a/quantum/visualizer/visualizer.mk +++ b/quantum/visualizer/visualizer.mk @@ -20,14 +20,14 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -GFXLIB = $(VISUALIZER_DIR)/ugfx SRC += $(VISUALIZER_DIR)/visualizer.c -UINCDIR += $(GFXINC) $(VISUALIZER_DIR) +EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR) +GFXLIB = $(LIB_PATH)/ugfx +VPATH += $(VISUALIZER_PATH) ifdef LCD_ENABLE -UDEFS += -DLCD_ENABLE +OPT_DEFS += -DLCD_ENABLE ULIBS += -lm -USE_UGFX = yes endif ifdef LCD_BACKLIGHT_ENABLE @@ -35,21 +35,21 @@ SRC += $(VISUALIZER_DIR)/lcd_backlight.c ifndef EMULATOR SRC += lcd_backlight_hal.c endif -UDEFS += -DLCD_BACKLIGHT_ENABLE +OPT_DEFS += -DLCD_BACKLIGHT_ENABLE endif ifdef LED_ENABLE SRC += $(VISUALIZER_DIR)/led_test.c UDEFS += -DLED_ENABLE -USE_UGFX = yes endif -ifdef USE_UGFX include $(GFXLIB)/gfx.mk -SRC += $(GFXSRC) -UDEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) -ULIBS += $(patsubst %,-l%,$(patsubst -l%,%,$(GFXLIBS))) -endif +#SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c) +#SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) +#SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) +#SRC += $(GFXSRC) +OPT_DEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) +#ULIBS += $(patsubst %,-l%,$(patsubst -l%,%,$(GFXLIBS))) ifndef VISUALIZER_USER VISUALIZER_USER = visualizer_user.c -- cgit v1.2.3-24-g4f1b From 5ed673d82d6cf91aa966a3e903ac37adb519f12c Mon Sep 17 00:00:00 2001 From: Josh Colbeck Date: Wed, 6 Jul 2016 20:24:57 -0500 Subject: Changed layer switching to momentary corrected macro --- keyboards/ergodox_ez/keymaps/josh/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/josh/keymap.c b/keyboards/ergodox_ez/keymaps/josh/keymap.c index 4ad229182..de5664a25 100644 --- a/keyboards/ergodox_ez/keymaps/josh/keymap.c +++ b/keyboards/ergodox_ez/keymaps/josh/keymap.c @@ -9,7 +9,7 @@ //macros #define CTL_SFT_T 100 #define CTL_SFT_G 101 -#define CTL_ALT_T 102 +#define CTL_ALT_H 102 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -40,8 +40,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, ALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_FN1, - KC_LGUI, KC_GRV, M(CTL_ALT_T),M(CTL_SFT_G),LALT(KC_LSFT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(SYMB), + KC_LGUI, KC_GRV, M(CTL_ALT_H),M(CTL_SFT_G),LALT(KC_LSFT), CTL_T(KC_APP), KC_LALT, KC_HOME, KC_SPC,KC_BSPC,KC_END, @@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { M(CTL_SFT_T),KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, MEH_T(KC_NO),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), - KC_FN1, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + MO(SYMB), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, LALT(KC_LSFT),KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_LALT, KC_CAPS, KC_PGUP, @@ -165,9 +165,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO(U(LCTL), U(LSFT), END); break; - case CTL_ALT_T: + case CTL_ALT_H: if (record->event.pressed) { - return MACRO(D(LCTL), D(LALT), T(T), END); + return MACRO(D(LCTL), D(LALT), T(H), END); } return MACRO(U(LCTL), U(LALT), END); break; -- cgit v1.2.3-24-g4f1b From a4bf46f9b1d0a0be0cecb2cd0f0d941aa7c71bd3 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 6 Jul 2016 22:48:19 -0400 Subject: default keymap, reset sorted out for now, added serial to makefile --- keyboards/atreus/Makefile | 1 + keyboards/lets_split/Makefile | 3 +- keyboards/lets_split/config.h | 6 +- keyboards/lets_split/keymaps/default/keymap.c | 200 ++++++++++++++++++++++++-- keyboards/lets_split/lets_split.c | 26 +--- keyboards/lets_split/lets_split.h | 8 +- quantum/quantum.c | 2 +- tmk_core/common/avr/bootloader.c | 54 ++++--- 8 files changed, 241 insertions(+), 59 deletions(-) diff --git a/keyboards/atreus/Makefile b/keyboards/atreus/Makefile index 72b694faa..95ee1d4d7 100644 --- a/keyboards/atreus/Makefile +++ b/keyboards/atreus/Makefile @@ -5,6 +5,7 @@ ifdef TEENSY2 ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex else OPT_DEFS += -DATREUS_ASTAR + OPT_DEFS += -DCATERINA_BOOTLOADER ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) endif diff --git a/keyboards/lets_split/Makefile b/keyboards/lets_split/Makefile index d8e283896..b9f07636b 100644 --- a/keyboards/lets_split/Makefile +++ b/keyboards/lets_split/Makefile @@ -1,6 +1,7 @@ SRC += matrix.c \ i2c.c \ - split_util.c + split_util.c \ + serial.c # MCU name #MCU = at90usb1287 diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index 5937ca44e..6f90997ab 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h @@ -37,7 +37,9 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { B5, B4, E6, D7 } #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 } -#define USE_I2C +#define CATERINA_BOOTLOADER + +// #define USE_I2C // #define EE_HANDS @@ -51,7 +53,7 @@ along with this program. If not, see . //#define MATRIX_HAS_GHOST /* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 +// #define BACKLIGHT_LEVELS 3 /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c index 01e3593c2..0d2d94b67 100644 --- a/keyboards/lets_split/keymaps/default/keymap.c +++ b/keyboards/lets_split/keymaps/default/keymap.c @@ -1,11 +1,27 @@ #include "lets_split.h" #include "action_layer.h" +#include "eeconfig.h" -#define BASE 0 +extern keymap_config_t keymap_config; -enum preonic_keycodes { - KC_IDK = SAFE_RANGE, - PM_RESET +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, }; // Fillers to make layering more clear @@ -14,29 +30,185 @@ enum preonic_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = KEYMAP( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ - KC_IDK, KC_LCTL, KC_LALT, KC_LGUI, PM_RESET,KC_SPC, KC_SPC, PM_RESET,KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = KEYMAP( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) + }; +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case KC_IDK: + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: if (record->event.pressed) { - SEND_STRING("IDK. "); + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); } return false; break; - case PM_RESET: + case ADJUST: if (record->event.pressed) { - promicro_bootloader_jmp(true); + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); } return false; break; } return true; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/keyboards/lets_split/lets_split.c b/keyboards/lets_split/lets_split.c index 1859dc20a..574c116a7 100644 --- a/keyboards/lets_split/lets_split.c +++ b/keyboards/lets_split/lets_split.c @@ -23,26 +23,8 @@ void matrix_init_kb(void) { matrix_init_user(); }; -void promicro_bootloader_jmp(bool program) { - - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_goodbye, false, 0); - _delay_ms(150); - stop_all_notes(); - #endif - - uint16_t *const bootKeyPtr = (uint16_t *)0x0800; - - // Value used by Caterina bootloader use to determine whether to run the - // sketch or the bootloader programmer. - uint16_t bootKey = program ? 0x7777 : 0; - - *bootKeyPtr = bootKey; - - // setup watchdog timeout - wdt_enable(WDTO_60MS); - - while(1) {} // wait for watchdog timer to trigger +void shutdown_user(void) { + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); } - - diff --git a/keyboards/lets_split/lets_split.h b/keyboards/lets_split/lets_split.h index e59aed592..fe7ae0767 100644 --- a/keyboards/lets_split/lets_split.h +++ b/keyboards/lets_split/lets_split.h @@ -1,5 +1,7 @@ +#ifndef LETS_SPLIT_H +#define LETS_SPLIT_H + #include "quantum.h" -#include void promicro_bootloader_jmp(bool program); @@ -18,4 +20,6 @@ void promicro_bootloader_jmp(bool program); { k50, k51, k52, k53, k54, k55 }, \ { k60, k61, k62, k63, k64, k65 }, \ { k70, k71, k72, k73, k74, k75 } \ - } \ No newline at end of file + } + +#endif \ No newline at end of file diff --git a/quantum/quantum.c b/quantum/quantum.c index d59bd5a3f..d8e43a465 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -89,7 +89,7 @@ bool process_record_quantum(keyrecord_t *record) { shutdown_user(); #endif wait_ms(250); - #ifdef ATREUS_ASTAR + #ifdef CATERINA_BOOTLOADER *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific #endif bootloader_jump(); diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c index 7c744e8c7..fb9bf2d1c 100644 --- a/tmk_core/common/avr/bootloader.c +++ b/tmk_core/common/avr/bootloader.c @@ -73,26 +73,46 @@ uint32_t reset_key __attribute__ ((section (".noinit"))); /* initialize MCU status by watchdog reset */ void bootloader_jump(void) { -#ifdef PROTOCOL_LUFA - USB_Disable(); - cli(); - _delay_ms(2000); -#endif + #ifndef CATERINA_BOOTLOADER -#ifdef PROTOCOL_PJRC - cli(); - UDCON = 1; - USBCON = (1< Date: Thu, 7 Jul 2016 12:45:34 +0300 Subject: Add Infinity Ergodox display drivers --- .../drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h | 113 +++++++ .../drivers/gdisp/IS31FL3731C/driver.mk | 2 + .../drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 333 +++++++++++++++++++++ .../drivers/gdisp/IS31FL3731C/gdisp_lld_config.h | 36 +++ .../drivers/gdisp/emulator_lcd/driver.mk | 2 + .../drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 + .../drivers/gdisp/emulator_led/driver.mk | 2 + .../drivers/gdisp/emulator_led/emulator_led.c | 10 + .../drivers/gdisp/st7565ergodox/board_ST7565.h | 127 ++++++++ .../drivers/gdisp/st7565ergodox/driver.mk | 2 + .../drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c | 292 ++++++++++++++++++ .../drivers/gdisp/st7565ergodox/gdisp_lld_config.h | 26 ++ .../drivers/gdisp/st7565ergodox/st7565.h | 37 +++ 13 files changed, 992 insertions(+) create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h create mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h new file mode 100644 index 000000000..2ea73f1fb --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h @@ -0,0 +1,113 @@ +/* +Copyright 2016 Fred Sundvik + +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 _GDISP_LLD_BOARD_H +#define _GDISP_LLD_BOARD_H + +static const I2CConfig i2ccfg = { + 400000 // clock speed (Hz); 400kHz max for IS31 +}; + +#define GDISP_SCREEN_WIDTH 7 +#define GDISP_SCREEN_HEIGHT 7 + +static const uint8_t led_mask[] = { + 0xFF, 0x00, /* C1-1 -> C1-16 */ + 0xFF, 0x00, /* C2-1 -> C2-16 */ + 0xFF, 0x00, /* C3-1 -> C3-16 */ + 0xFF, 0x00, /* C4-1 -> C4-16 */ + 0x3F, 0x00, /* C5-1 -> C5-16 */ + 0x00, 0x00, /* C6-1 -> C6-16 */ + 0x00, 0x00, /* C7-1 -> C7-16 */ + 0x00, 0x00, /* C8-1 -> C8-16 */ + 0x00, 0x00, /* C9-1 -> C9-16 */ +}; + +// The address of the LED +#define LA(c, r) (c + r * 16 ) +// Need to be an address that is not mapped, but inside the range of the controller matrix +#define NA LA(8, 8) + +// The numbers in the comments are the led numbers DXX on the PCB +// The mapping is taken from the schematic of left hand side +static const uint8_t led_mapping[GDISP_SCREEN_HEIGHT][GDISP_SCREEN_WIDTH] = { +// 45 44 43 42 41 40 39 + { LA(1, 1), LA(1, 0), LA(0, 4), LA(0, 3), LA(0, 2), LA(0, 1), LA(0, 0)}, +// 52 51 50 49 48 47 46 + { LA(2, 3), LA(2, 2), LA(2, 1), LA(2, 0), LA(1, 4), LA(1, 3), LA(1, 2) }, +// 58 57 56 55 54 53 N/A + { LA(3, 4), LA(3, 3), LA(3, 2), LA(3, 1), LA(3, 0), LA(2, 4), NA }, +// 67 66 65 64 63 62 61 + { LA(5, 3), LA(5, 2), LA(5, 1), LA(5, 0), LA(4, 4), LA(4, 3), LA(4, 2) }, +// 76 75 74 73 72 60 59 + { LA(7, 3), LA(7, 2), LA(7, 1), LA(7, 0), LA(6, 3), LA(4, 1), LA(4, 0) }, +// N/A N/A N/A N/A N/A N/A 68 + { NA, NA, NA, NA, NA, NA, LA(5, 4) }, +// N/A N/A N/A N/A 71 70 69 + { NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0) }, +}; + + +#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND +#define IS31_TIMEOUT 5000 + +static GFXINLINE void init_board(GDisplay *g) { + (void) g; + /* I2C pins */ + palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATIVE_2); // PTB0/I2C0/SCL + palSetPadMode(GPIOB, 1, PAL_MODE_ALTERNATIVE_2); // PTB1/I2C0/SDA + palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL); + palClearPad(GPIOB, 16); + /* start I2C */ + i2cStart(&I2CD1, &i2ccfg); + // try high drive (from kiibohd) + I2CD1.i2c->C2 |= I2Cx_C2_HDRS; + // try glitch fixing (from kiibohd) + I2CD1.i2c->FLT = 4; +} + +static GFXINLINE void post_init_board(GDisplay *g) { + (void) g; +} + +static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) { + (void) g; + return led_mask; +} + +static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y) +{ + (void) g; + return led_mapping[y][x]; +} + +static GFXINLINE void set_hardware_shutdown(GDisplay* g, bool shutdown) { + (void) g; + if(!shutdown) { + palSetPad(GPIOB, 16); + } + else { + palClearPad(GPIOB, 16); + } +} + +static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { + (void) g; + i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, data, length, 0, 0, US2ST(IS31_TIMEOUT)); +} + +#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk new file mode 100644 index 000000000..f32d0d868 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/IS31FL3731C +GFXSRC += drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c new file mode 100644 index 000000000..1d21f0c49 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c @@ -0,0 +1,333 @@ +/* +Copyright 2016 Fred Sundvik + +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 . +*/ + +#include "gfx.h" + +#if GFX_USE_GDISP + +#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX +#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h" +#include "src/gdisp/gdisp_driver.h" + +#include "board_IS31FL3731C.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 9 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 16 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 0 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) + +#define IS31_ADDR_DEFAULT 0x74 + +#define IS31_REG_CONFIG 0x00 +// bits in reg +#define IS31_REG_CONFIG_PICTUREMODE 0x00 +#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08 +#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18 +// D2:D0 bits are starting frame for autoplay mode + +#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode + +#define IS31_REG_AUTOPLAYCTRL1 0x02 +// D6:D4 number of loops (000=infty) +// D2:D0 number of frames to be used + +#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms) + +#define IS31_REG_DISPLAYOPT 0x05 +#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames +#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x8 +// D2:D0 bits blink period time (*0.27s) + +#define IS31_REG_AUDIOSYNC 0x06 +#define IS31_REG_AUDIOSYNC_ENABLE 0x1 + +#define IS31_REG_FRAMESTATE 0x07 + +#define IS31_REG_BREATHCTRL1 0x08 +// D6:D4 fade out time (26ms*2^i) +// D2:D0 fade in time (26ms*2^i) + +#define IS31_REG_BREATHCTRL2 0x09 +#define IS31_REG_BREATHCTRL2_ENABLE 0x10 +// D2:D0 extinguish time (3.5ms*2^i) + +#define IS31_REG_SHUTDOWN 0x0A +#define IS31_REG_SHUTDOWN_OFF 0x0 +#define IS31_REG_SHUTDOWN_ON 0x1 + +#define IS31_REG_AGCCTRL 0x0B +#define IS31_REG_ADCRATE 0x0C + +#define IS31_COMMANDREGISTER 0xFD +#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine' +#define IS31_FUNCTIONREG_SIZE 0xD + +#define IS31_FRAME_SIZE 0xB4 + +#define IS31_PWM_REG 0x24 +#define IS31_PWM_SIZE 0x90 + +#define IS31_LED_MASK_SIZE 0x12 +#define IS31_SCREEN_WIDTH 16 + +#define IS31 + +//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm +const unsigned char cie[256] = { + 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, + 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, + 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, + 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, + 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, + 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, + 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, + 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, + 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, + 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, + 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, + 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, + 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, + 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, + 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, + 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, + 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, + 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, + 242, 245, 247, 250, 252, 255, +}; + + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +typedef struct{ + uint8_t write_buffer_offset; + uint8_t write_buffer[IS31_FRAME_SIZE]; + uint8_t frame_buffer[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH]; + uint8_t page; +}__attribute__((__packed__)) PrivData; + +// Some common routines and macros +#define PRIV(g) ((PrivData*)g->priv) + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +static GFXINLINE void write_page(GDisplay* g, uint8_t page) { + uint8_t tx[2] __attribute__((aligned(2))); + tx[0] = IS31_COMMANDREGISTER; + tx[1] = page; + write_data(g, tx, 2); +} + +static GFXINLINE void write_register(GDisplay* g, uint8_t page, uint8_t reg, uint8_t data) { + uint8_t tx[2] __attribute__((aligned(2))); + tx[0] = reg; + tx[1] = data; + write_page(g, page); + write_data(g, tx, 2); +} + +static GFXINLINE void write_ram(GDisplay *g, uint8_t page, uint16_t offset, uint16_t length) { + PRIV(g)->write_buffer_offset = offset; + write_page(g, page); + write_data(g, (uint8_t*)PRIV(g), length + 1); +} + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // The private area is the display surface. + g->priv = gfxAlloc(sizeof(PrivData)); + __builtin_memset(PRIV(g), 0, sizeof(PrivData)); + PRIV(g)->page = 0; + + // Initialise the board interface + init_board(g); + gfxSleepMilliseconds(10); + + // zero function page, all registers (assuming full_page is all zeroes) + write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); + set_hardware_shutdown(g, false); + gfxSleepMilliseconds(10); + // software shutdown + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); + gfxSleepMilliseconds(10); + // zero function page, all registers + write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); + gfxSleepMilliseconds(10); + + + // zero all LED registers on all 8 pages, and enable the mask + __builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE); + for(uint8_t i=0; i<8; i++) { + write_ram(g, i, 0, IS31_FRAME_SIZE); + gfxSleepMilliseconds(1); + } + + // software shutdown disable (i.e. turn stuff on) + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + gfxSleepMilliseconds(10); + + // Finish Init + post_init_board(g); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + return TRUE; +} + +#if GDISP_HARDWARE_FLUSH + LLDSPEC void gdisp_lld_flush(GDisplay *g) { + // Don't flush if we don't need it. + if (!(g->flags & GDISP_FLG_NEEDFLUSH)) + return; + + PRIV(g)->page++; + PRIV(g)->page %= 2; + // TODO: some smarter algorithm for this + // We should run only one physical page at a time + // This way we don't need to send so much data, and + // we could use slightly less memory + uint8_t* src = PRIV(g)->frame_buffer; + for (int y=0;ywrite_buffer[get_led_address(g, x, y)]=cie[*src]; + ++src; + } + } + write_ram(g, PRIV(g)->page, IS31_PWM_REG, IS31_PWM_SIZE); + gfxSleepMilliseconds(1); + write_register(g, IS31_FUNCTIONREG, IS31_REG_PICTDISP, PRIV(g)->page); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_DRAWPIXEL + LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = g->p.y; + break; + } + PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x] = gdispColor2Native(g->p.color); + g->flags |= GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = g->p.y; + break; + } + return gdispNative2Color(PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x]); + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + case powerSleep: + case powerDeepSleep: + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); + break; + case powerOn: + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + break; + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + /* Rotation is handled by the drawing routines */ + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + default: + return; + } + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_CONTRAST: + return; + } + } +#endif // GDISP_NEED_CONTROL + +#endif // GFX_USE_GDISP diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h new file mode 100644 index 000000000..bb28ad775 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h @@ -0,0 +1,36 @@ +/* +Copyright 2016 Fred Sundvik + +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 _GDISP_LLD_CONFIG_H +#define _GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_GRAY256 + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk new file mode 100644 index 000000000..16c3f80f5 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/emulator_lcd +GFXSRC += drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c new file mode 100644 index 000000000..babfe2b36 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c @@ -0,0 +1,10 @@ +#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LCD_ERGODOX +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO +#define GDISP_SCREEN_WIDTH 128 +#define GDISP_SCREEN_HEIGHT 32 +#define ROTATE_180_IS_FLIP + +#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk b/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk new file mode 100644 index 000000000..255434432 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/emulator_led +GFXSRC += drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c new file mode 100644 index 000000000..b0ebcdc47 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c @@ -0,0 +1,10 @@ +#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LED_ERGODOX +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO +#define GDISP_SCREEN_WIDTH 7 +#define GDISP_SCREEN_HEIGHT 7 +#define ROTATE_180_IS_FLIP + +#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h new file mode 100644 index 000000000..290571ce5 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h @@ -0,0 +1,127 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _GDISP_LLD_BOARD_H +#define _GDISP_LLD_BOARD_H + +#include "print.h" + +#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 +#define ST7565_ADC ST7565_ADC_NORMAL +#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC +#define ST7565_PAGE_ORDER 0,1,2,3 +/* + * Custom page order for several LCD boards, e.g. HEM12864-99 + * #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3 + */ + +#define ST7565_GPIOPORT GPIOC +#define ST7565_PORT PORTC +#define ST7565_A0_PIN 7 +#define ST7565_RST_PIN 8 +#define ST7565_MOSI_PIN 6 +#define ST7565_SLCK_PIN 5 +#define ST7565_SS_PIN 4 + +#define palSetPadModeRaw(portname, bits) \ + ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits + +#define palSetPadModeNamed(portname, portmode) \ + palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode) + +#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2) +// DSPI Clock and Transfer Attributes +// Frame Size: 8 bits +// MSB First +// CLK Low by default +static const SPIConfig spi1config = { + NULL, + /* HW dependent part.*/ + ST7565_GPIOPORT, + ST7565_SS_PIN, + SPIx_CTARn_FMSZ(7) + | SPIx_CTARn_ASC(7) + | SPIx_CTARn_DT(7) + | SPIx_CTARn_CSSCK(7) + | SPIx_CTARn_PBR(0) + | SPIx_CTARn_BR(7) + //SPI_CR1_BR_0 +}; + +static bool_t st7565_is_data_mode = 1; + +static GFXINLINE void init_board(GDisplay *g) { + (void) g; + palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); + st7565_is_data_mode = 1; + palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); + palSetPadModeRaw(MOSI, ST7565_SPI_MODE); + palSetPadModeRaw(SLCK, ST7565_SPI_MODE); + palSetPadModeRaw(SS, ST7565_SPI_MODE); + + spiInit(); + spiStart(&SPID1, &spi1config); + spiSelect(&SPID1); +} + +static GFXINLINE void post_init_board(GDisplay *g) { + (void) g; +} + +static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { + (void) g; + if (state) { + palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN); + } + else { + palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); + } +} + +static GFXINLINE void acquire_bus(GDisplay *g) { + (void) g; + // Only the LCD is using the SPI bus, so no need to acquire + // spiAcquireBus(&SPID1); +} + +static GFXINLINE void release_bus(GDisplay *g) { + (void) g; + // Only the LCD is using the SPI bus, so no need to release + //spiReleaseBus(&SPID1); +} + +static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { + (void) g; + if (st7565_is_data_mode) { + // The sleeps need to be at lest 10 vs 25 ns respectively + // So let's sleep two ticks, one tick might not be enough + // if we are at the end of the tick + chThdSleep(2); + palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); + chThdSleep(2); + st7565_is_data_mode = 0; + } + spiSend(&SPID1, 1, &cmd); +} + +static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { + (void) g; + if (!st7565_is_data_mode) { + // The sleeps need to be at lest 10 vs 25 ns respectively + // So let's sleep two ticks, one tick might not be enough + // if we are at the end of the tick + chThdSleep(2); + palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); + chThdSleep(2); + st7565_is_data_mode = 1; + } + spiSend(&SPID1, length, data); +} + +#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk new file mode 100644 index 000000000..889a1a031 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/st7565ergodox +GFXSRC += drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c new file mode 100644 index 000000000..c33aea81a --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c @@ -0,0 +1,292 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#include "gfx.h" + +#if GFX_USE_GDISP + +#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX +#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h" +#include "src/gdisp/gdisp_driver.h" + +#include "board_ST7565.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 32 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 128 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 0 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) + +#include "drivers/gdisp/st7565ergodox/st7565.h" + +/*===========================================================================*/ +/* Driver config defaults for backward compatibility. */ +/*===========================================================================*/ +#ifndef ST7565_LCD_BIAS + #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 +#endif +#ifndef ST7565_ADC + #define ST7565_ADC ST7565_ADC_NORMAL +#endif +#ifndef ST7565_COM_SCAN + #define ST7565_COM_SCAN ST7565_COM_SCAN_INC +#endif +#ifndef ST7565_PAGE_ORDER + #define ST7565_PAGE_ORDER 0,1,2,3 +#endif + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +typedef struct{ + bool_t buffer2; + uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; +}PrivData; + +// Some common routines and macros +#define PRIV(g) ((PrivData*)g->priv) +#define RAM(g) (PRIV(g)->ram) +#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } +#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } + +// Some common routines and macros +#define delay(us) gfxSleepMicroseconds(us) +#define delay_ms(ms) gfxSleepMilliseconds(ms) + +#define xyaddr(x, y) ((x) + ((y)>>3)*GDISP_SCREEN_WIDTH) +#define xybit(y) (1<<((y)&7)) + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/* + * As this controller can't update on a pixel boundary we need to maintain the + * the entire display surface in memory so that we can do the necessary bit + * operations. Fortunately it is a small display in monochrome. + * 64 * 128 / 8 = 1024 bytes. + */ + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // The private area is the display surface. + g->priv = gfxAlloc(sizeof(PrivData)); + PRIV(g)->buffer2 = false; + + // Initialise the board interface + init_board(g); + + // Hardware reset + setpin_reset(g, TRUE); + gfxSleepMilliseconds(20); + setpin_reset(g, FALSE); + gfxSleepMilliseconds(20); + + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_OFF); + write_cmd(g, ST7565_LCD_BIAS); + write_cmd(g, ST7565_ADC); + write_cmd(g, ST7565_COM_SCAN); + + write_cmd(g, ST7565_START_LINE | 0); + + write_cmd(g, ST7565_RESISTOR_RATIO | 0x6); + + // turn on voltage converter (VC=1, VR=0, VF=0) + write_cmd(g, ST7565_POWER_CONTROL | 0x04); + delay_ms(50); + + // turn on voltage regulator (VC=1, VR=1, VF=0) + write_cmd(g, ST7565_POWER_CONTROL | 0x06); + delay_ms(50); + + // turn on voltage follower (VC=1, VR=1, VF=1) + write_cmd(g, ST7565_POWER_CONTROL | 0x07); + delay_ms(50); + + write_cmd(g, 0xE2); + write_cmd(g, ST7565_COM_SCAN); + write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101); + //write_cmd2(g, ST7565_CONTRAST, 0); + write_cmd(g, ST7565_DISPLAY_ON); + write_cmd(g, ST7565_ALLON_NORMAL); + write_cmd(g, ST7565_INVERT_DISPLAY); + + write_cmd(g, ST7565_RMW); + + // Finish Init + post_init_board(g); + + // Release the bus + release_bus(g); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + return TRUE; +} + +#if GDISP_HARDWARE_FLUSH + LLDSPEC void gdisp_lld_flush(GDisplay *g) { + unsigned p; + + // Don't flush if we don't need it. + if (!(g->flags & GDISP_FLG_NEEDFLUSH)) + return; + + acquire_bus(g); + unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); + for (p = 0; p < 4; p++) { + write_cmd(g, ST7565_PAGE | (p + dstOffset)); + write_cmd(g, ST7565_COLUMN_MSB | 0); + write_cmd(g, ST7565_COLUMN_LSB | 0); + write_cmd(g, ST7565_RMW); + write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); + } + unsigned line = (PRIV(g)->buffer2 ? 32 : 0); + write_cmd(g, ST7565_START_LINE | line); + PRIV(g)->buffer2 = !PRIV(g)->buffer2; + release_bus(g); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_DRAWPIXEL + LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_HEIGHT-1 - g->p.y; + y = g->p.x; + break; + } + if (gdispColor2Native(g->p.color) != Black) + RAM(g)[xyaddr(x, y)] |= xybit(y); + else + RAM(g)[xyaddr(x, y)] &= ~xybit(y); + g->flags |= GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_HEIGHT-1 - g->p.y; + y = g->p.x; + break; + } + return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + case powerSleep: + case powerDeepSleep: + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_OFF); + release_bus(g); + break; + case powerOn: + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_ON); + release_bus(g); + break; + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + /* Rotation is handled by the drawing routines */ + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + default: + return; + } + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_CONTRAST: + if ((unsigned)g->p.ptr > 100) + g->p.ptr = (void *)100; + acquire_bus(g); + write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); + release_bus(g); + g->g.Contrast = (unsigned)g->p.ptr; + return; + } + } +#endif // GDISP_NEED_CONTROL + +#endif // GFX_USE_GDISP diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h new file mode 100644 index 000000000..48587b9e1 --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h @@ -0,0 +1,26 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _GDISP_LLD_CONFIG_H +#define _GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h new file mode 100644 index 000000000..48636b33d --- /dev/null +++ b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h @@ -0,0 +1,37 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _ST7565_H +#define _ST7565_H + +#define ST7565_CONTRAST 0x81 +#define ST7565_ALLON_NORMAL 0xA4 +#define ST7565_ALLON 0xA5 +#define ST7565_POSITIVE_DISPLAY 0xA6 +#define ST7565_INVERT_DISPLAY 0xA7 +#define ST7565_DISPLAY_OFF 0xAE +#define ST7565_DISPLAY_ON 0xAF + +#define ST7565_LCD_BIAS_7 0xA3 +#define ST7565_LCD_BIAS_9 0xA2 + +#define ST7565_ADC_NORMAL 0xA0 +#define ST7565_ADC_REVERSE 0xA1 + +#define ST7565_COM_SCAN_INC 0xC0 +#define ST7565_COM_SCAN_DEC 0xC8 + +#define ST7565_START_LINE 0x40 +#define ST7565_PAGE 0xB0 +#define ST7565_COLUMN_MSB 0x10 +#define ST7565_COLUMN_LSB 0x00 +#define ST7565_RMW 0xE0 + +#define ST7565_RESISTOR_RATIO 0x20 +#define ST7565_POWER_CONTROL 0x28 + +#endif /* _ST7565_H */ -- cgit v1.2.3-24-g4f1b From 07d0d5cbe48d7afaf0bc8c9916d40179ec51cb42 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 12:46:10 +0300 Subject: Makefile fixes and update of Visualizer --- keyboards/infinity_ergodox/Makefile | 9 +++++++++ quantum/visualizer/led_test.c | 4 ++-- quantum/visualizer/visualizer.mk | 8 +++----- tmk_core/common/keyboard.c | 8 ++++++++ tmk_core/protocol/chibios/main.c | 7 +++++++ 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile index 8be2f51b1..7edc03d8c 100644 --- a/keyboards/infinity_ergodox/Makefile +++ b/keyboards/infinity_ergodox/Makefile @@ -69,8 +69,17 @@ CUSTOM_MATRIX ?= yes # Custom matrix file SERIAL_LINK_ENABLE = yes VISUALIZER_ENABLE ?= yes LCD_ENABLE ?= yes +LED_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes +ifdef LCD_ENABLE +include drivers/gdisp/st7565ergodox/driver.mk +endif + +ifdef LED_ENABLE +include drivers/gdisp/IS31FL3731C/driver.mk +endif + ifndef QUANTUM_DIR include ../../Makefile endif \ No newline at end of file diff --git a/quantum/visualizer/led_test.c b/quantum/visualizer/led_test.c index c2ea30b55..a9abace8d 100644 --- a/quantum/visualizer/led_test.c +++ b/quantum/visualizer/led_test.c @@ -89,8 +89,8 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS]; static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS]; static uint8_t compute_gradient_color(float t, float index, float num) { - const float two_pi = 2.0f * PI; - float normalized_index = (1.0f - index / (num - 1)) * two_pi; + const float two_pi = M_2_PI; + float normalized_index = (1.0f - index / (num - 1.0f)) * two_pi; float x = t * two_pi + normalized_index; float v = 0.5 * (cosf(x) + 1.0f); return (uint8_t)(255.0f * v); diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk index b5dfad8e1..149968de7 100644 --- a/quantum/visualizer/visualizer.mk +++ b/quantum/visualizer/visualizer.mk @@ -25,6 +25,8 @@ EXTRAINCDIRS += $(GFXINC) $(VISUALIZER_DIR) GFXLIB = $(LIB_PATH)/ugfx VPATH += $(VISUALIZER_PATH) +OPT_DEFS += -DVISUALIZER_ENABLE + ifdef LCD_ENABLE OPT_DEFS += -DLCD_ENABLE ULIBS += -lm @@ -44,12 +46,8 @@ UDEFS += -DLED_ENABLE endif include $(GFXLIB)/gfx.mk -#SERIAL_SRC = $(wildcard $(SERIAL_PATH)/protocol/*.c) -#SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c) -#SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC)) -#SRC += $(GFXSRC) +SRC += $(patsubst $(TOP_DIR)/%,%,$(GFXSRC)) OPT_DEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) -#ULIBS += $(patsubst %,-l%,$(patsubst -l%,%,$(GFXLIBS))) ifndef VISUALIZER_USER VISUALIZER_USER = visualizer_user.c diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 3a1262a9f..c46a701b3 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -29,6 +29,7 @@ along with this program. If not, see . #include "sendchar.h" #include "eeconfig.h" #include "backlight.h" +#include "action_layer.h" #ifdef BOOTMAGIC_ENABLE # include "bootmagic.h" #else @@ -52,6 +53,9 @@ along with this program. If not, see . #ifdef SERIAL_LINK_ENABLE # include "serial_link/system/serial_link.h" #endif +#ifdef VISUALIZER_ENABLE +# include "visualizer/visualizer.h" +#endif #ifdef MATRIX_HAS_GHOST static bool has_ghost_in_row(uint8_t row) @@ -181,6 +185,10 @@ MATRIX_LOOP_END: serial_link_update(); #endif +#ifdef VISUALIZER_ENABLE + visualizer_update(default_layer_state, layer_state, host_keyboard_leds()); +#endif + // update LED if (led_status != host_keyboard_leds()) { led_status = host_keyboard_leds(); diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index aeb11752f..6bf9c1668 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -38,6 +38,9 @@ #ifdef SERIAL_LINK_ENABLE #include "serial_link/system/serial_link.h" #endif +#ifdef VISUALIZER_ENABLE +#include "visualizer/visualizer.h" +#endif #include "suspend.h" @@ -101,6 +104,10 @@ int main(void) { /* init printf */ init_printf(NULL,sendchar_pf); +#ifdef VISUALIZER_ENABLE + visualizer_init(); +#endif + #ifdef SERIAL_LINK_ENABLE init_serial_link(); #endif -- cgit v1.2.3-24-g4f1b From 7229751ba9d402b2a6c9dc1b7b29385b5162fe41 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 14:01:20 +0300 Subject: Fix visualizer crash at startup Visualizer and serial link initialized in the wrong order. The LED_ENABLED define wasn't set properly uGfx is always initialized --- quantum/visualizer/visualizer.c | 2 -- quantum/visualizer/visualizer.mk | 2 +- tmk_core/protocol/chibios/main.c | 7 ++++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index abca22d85..dfa2ff4ee 100644 --- a/quantum/visualizer/visualizer.c +++ b/quantum/visualizer/visualizer.c @@ -456,9 +456,7 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) { } void visualizer_init(void) { -#ifdef LCD_ENABLE gfxInit(); -#endif #ifdef LCD_BACKLIGHT_ENABLE lcd_backlight_init(); diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk index 149968de7..379496fb6 100644 --- a/quantum/visualizer/visualizer.mk +++ b/quantum/visualizer/visualizer.mk @@ -42,7 +42,7 @@ endif ifdef LED_ENABLE SRC += $(VISUALIZER_DIR)/led_test.c -UDEFS += -DLED_ENABLE +OPT_DEFS += -DLED_ENABLE endif include $(GFXLIB)/gfx.mk diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 6bf9c1668..36fd45d45 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -104,13 +104,14 @@ int main(void) { /* init printf */ init_printf(NULL,sendchar_pf); +#ifdef SERIAL_LINK_ENABLE + init_serial_link(); +#endif + #ifdef VISUALIZER_ENABLE visualizer_init(); #endif -#ifdef SERIAL_LINK_ENABLE - init_serial_link(); -#endif host_driver_t* driver = NULL; -- cgit v1.2.3-24-g4f1b From dae7c9bfb3325412c542fbbe4342c9c8e0fc1904 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 14:12:56 +0300 Subject: Fix the SERIAL_LINK_ENABLE macro in Visualizer Rename from USE_SERIAL_LINK -> SERIAL_LINK_ENABLE --- quantum/visualizer/visualizer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c index dfa2ff4ee..54f6faaa4 100644 --- a/quantum/visualizer/visualizer.c +++ b/quantum/visualizer/visualizer.c @@ -43,7 +43,7 @@ SOFTWARE. #include "nodebug.h" #endif -#ifdef USE_SERIAL_LINK +#ifdef SERIAL_LINK_ENABLE #include "serial_link/protocol/transport.h" #include "serial_link/system/serial_link.h" #endif @@ -73,7 +73,7 @@ static bool visualizer_enabled = false; #define MAX_SIMULTANEOUS_ANIMATIONS 4 static keyframe_animation_t* animations[MAX_SIMULTANEOUS_ANIMATIONS] = {}; -#ifdef USE_SERIAL_LINK +#ifdef SERIAL_LINK_ENABLE MASTER_TO_ALL_SLAVES_OBJECT(current_status, visualizer_keyboard_status_t); static remote_object_t* remote_objects[] = { @@ -462,7 +462,7 @@ void visualizer_init(void) { lcd_backlight_init(); #endif -#ifdef USE_SERIAL_LINK +#ifdef SERIAL_LINK_ENABLE add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*) ); #endif @@ -486,7 +486,7 @@ void update_status(bool changed) { geventSendEvent(listener); } } -#ifdef USE_SERIAL_LINK +#ifdef SERIAL_LINK_ENABLE static systime_t last_update = 0; systime_t current_update = chVTGetSystemTimeX(); systime_t delta = current_update - last_update; @@ -506,7 +506,7 @@ void visualizer_update(uint32_t default_state, uint32_t state, uint32_t leds) { // Alternatively a mutex could be used instead of the volatile variables bool changed = false; -#ifdef USE_SERIAL_LINK +#ifdef SERIAL_LINK_ENABLE if (is_serial_link_connected ()) { visualizer_keyboard_status_t* new_status = read_current_status(); if (new_status) { -- cgit v1.2.3-24-g4f1b From bcbd8f1c50c6bc6169fe8afadafd6a21e182fa1f Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 14:22:45 +0300 Subject: Add suspend support to the ChibiOS visualizer --- tmk_core/protocol/chibios/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 36fd45d45..b0eb9aef8 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -155,6 +155,9 @@ int main(void) { if(USB_DRIVER.state == USB_SUSPENDED) { print("[s]"); +#ifdef VISUALIZER_ENABLE + visualizer_suspend(); +#endif while(USB_DRIVER.state == USB_SUSPENDED) { /* Do this in the suspended state */ #ifdef SERIAL_LINK_ENABLE @@ -172,6 +175,10 @@ int main(void) { #ifdef MOUSEKEY_ENABLE mousekey_send(); #endif /* MOUSEKEY_ENABLE */ + +#ifdef VISUALIZER_ENABLE + visualizer_resume(); +#endif } keyboard_task(); -- cgit v1.2.3-24-g4f1b From aaac254ebce2005272e7385488b5690bbbe6d7c8 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 14:29:53 +0300 Subject: Delete lcd_backlight_hal.c The functionality can now be found in the infinity_erogodox.c file instead. --- keyboards/infinity_ergodox/infinity_ergodox.c | 65 ++++++++++++++++++++ keyboards/infinity_ergodox/lcd_backlight_hal.c | 84 -------------------------- quantum/visualizer/visualizer.mk | 3 - 3 files changed, 65 insertions(+), 87 deletions(-) delete mode 100644 keyboards/infinity_ergodox/lcd_backlight_hal.c diff --git a/keyboards/infinity_ergodox/infinity_ergodox.c b/keyboards/infinity_ergodox/infinity_ergodox.c index 85054775e..87ed40fab 100644 --- a/keyboards/infinity_ergodox/infinity_ergodox.c +++ b/keyboards/infinity_ergodox/infinity_ergodox.c @@ -2,6 +2,7 @@ #include "ch.h" #include "hal.h" #include "serial_link/system/serial_link.h" +#include "lcd_backlight.h" void init_serial_link_hal(void) { PORTA->PCR[1] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(2); @@ -9,3 +10,67 @@ void init_serial_link_hal(void) { PORTE->PCR[0] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(3); PORTE->PCR[1] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(3); } + +#define RED_PIN 1 +#define GREEN_PIN 2 +#define BLUE_PIN 3 +#define CHANNEL_RED FTM0->CHANNEL[0] +#define CHANNEL_GREEN FTM0->CHANNEL[1] +#define CHANNEL_BLUE FTM0->CHANNEL[2] + +#define RGB_PORT PORTC +#define RGB_PORT_GPIO GPIOC + +// Base FTM clock selection (72 MHz system clock) +// @ 0xFFFF period, 72 MHz / (0xFFFF * 2) = Actual period +// Higher pre-scalar will use the most power (also look the best) +// Pre-scalar calculations +// 0 - 72 MHz -> 549 Hz +// 1 - 36 MHz -> 275 Hz +// 2 - 18 MHz -> 137 Hz +// 3 - 9 MHz -> 69 Hz (Slightly visible flicker) +// 4 - 4 500 kHz -> 34 Hz (Visible flickering) +// 5 - 2 250 kHz -> 17 Hz +// 6 - 1 125 kHz -> 9 Hz +// 7 - 562 500 Hz -> 4 Hz +// 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 + +void lcd_backlight_hal_init(void) { + // Setup Backlight + SIM->SCGC6 |= SIM_SCGC6_FTM0; + FTM0->CNT = 0; // Reset counter + + // PWM Period + // 16-bit maximum + FTM0->MOD = 0xFFFF; + + // Set FTM to PWM output - Edge Aligned, Low-true pulses +#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0) + CHANNEL_RED.CnSC = CNSC_MODE; + CHANNEL_GREEN.CnSC = CNSC_MODE; + CHANNEL_BLUE.CnSC = CNSC_MODE; + + // System clock, /w prescalar setting + FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE); + + CHANNEL_RED.CnV = 0; + CHANNEL_GREEN.CnV = 0; + CHANNEL_BLUE.CnV = 0; + + RGB_PORT_GPIO->PDDR |= (1 << RED_PIN); + RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN); + RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN); + +#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4) + RGB_PORT->PCR[RED_PIN] = RGB_MODE; + RGB_PORT->PCR[GREEN_PIN] = RGB_MODE; + RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; +} + +void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { + CHANNEL_RED.CnV = r; + CHANNEL_GREEN.CnV = g; + CHANNEL_BLUE.CnV = b; +} diff --git a/keyboards/infinity_ergodox/lcd_backlight_hal.c b/keyboards/infinity_ergodox/lcd_backlight_hal.c deleted file mode 100644 index 05fc810b4..000000000 --- a/keyboards/infinity_ergodox/lcd_backlight_hal.c +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2016 Fred Sundvik -Jun Wako - -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 . -*/ -#include "lcd_backlight.h" -#include "hal.h" - -#define RED_PIN 1 -#define GREEN_PIN 2 -#define BLUE_PIN 3 -#define CHANNEL_RED FTM0->CHANNEL[0] -#define CHANNEL_GREEN FTM0->CHANNEL[1] -#define CHANNEL_BLUE FTM0->CHANNEL[2] - -#define RGB_PORT PORTC -#define RGB_PORT_GPIO GPIOC - -// Base FTM clock selection (72 MHz system clock) -// @ 0xFFFF period, 72 MHz / (0xFFFF * 2) = Actual period -// Higher pre-scalar will use the most power (also look the best) -// Pre-scalar calculations -// 0 - 72 MHz -> 549 Hz -// 1 - 36 MHz -> 275 Hz -// 2 - 18 MHz -> 137 Hz -// 3 - 9 MHz -> 69 Hz (Slightly visible flicker) -// 4 - 4 500 kHz -> 34 Hz (Visible flickering) -// 5 - 2 250 kHz -> 17 Hz -// 6 - 1 125 kHz -> 9 Hz -// 7 - 562 500 Hz -> 4 Hz -// 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 - -void lcd_backlight_hal_init(void) { - // Setup Backlight - SIM->SCGC6 |= SIM_SCGC6_FTM0; - FTM0->CNT = 0; // Reset counter - - // PWM Period - // 16-bit maximum - FTM0->MOD = 0xFFFF; - - // Set FTM to PWM output - Edge Aligned, Low-true pulses -#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0) - CHANNEL_RED.CnSC = CNSC_MODE; - CHANNEL_GREEN.CnSC = CNSC_MODE; - CHANNEL_BLUE.CnSC = CNSC_MODE; - - // System clock, /w prescalar setting - FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE); - - CHANNEL_RED.CnV = 0; - CHANNEL_GREEN.CnV = 0; - CHANNEL_BLUE.CnV = 0; - - RGB_PORT_GPIO->PDDR |= (1 << RED_PIN); - RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN); - RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN); - -#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4) - RGB_PORT->PCR[RED_PIN] = RGB_MODE; - RGB_PORT->PCR[GREEN_PIN] = RGB_MODE; - RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; -} - -void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { - CHANNEL_RED.CnV = r; - CHANNEL_GREEN.CnV = g; - CHANNEL_BLUE.CnV = b; -} - diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk index 379496fb6..449957d63 100644 --- a/quantum/visualizer/visualizer.mk +++ b/quantum/visualizer/visualizer.mk @@ -34,9 +34,6 @@ endif ifdef LCD_BACKLIGHT_ENABLE SRC += $(VISUALIZER_DIR)/lcd_backlight.c -ifndef EMULATOR -SRC += lcd_backlight_hal.c -endif OPT_DEFS += -DLCD_BACKLIGHT_ENABLE endif -- cgit v1.2.3-24-g4f1b From caedec92d2c22480313c43a364408fb920c55364 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 14:42:16 +0300 Subject: Move the visualizer_user file to keymap folder Also rename it to visualizer.c --- .../infinity_ergodox/keymaps/default/visualizer.c | 168 +++++++++++++++++++++ keyboards/infinity_ergodox/visualizer_user.c | 168 --------------------- quantum/visualizer/visualizer.mk | 11 +- 3 files changed, 176 insertions(+), 171 deletions(-) create mode 100644 keyboards/infinity_ergodox/keymaps/default/visualizer.c delete mode 100644 keyboards/infinity_ergodox/visualizer_user.c diff --git a/keyboards/infinity_ergodox/keymaps/default/visualizer.c b/keyboards/infinity_ergodox/keymaps/default/visualizer.c new file mode 100644 index 000000000..c0d335ce6 --- /dev/null +++ b/keyboards/infinity_ergodox/keymaps/default/visualizer.c @@ -0,0 +1,168 @@ +/* +Copyright 2016 Fred Sundvik + +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 . +*/ + +// Currently we are assuming that both the backlight and LCD are enabled +// But it's entirely possible to write a custom visualizer that use only +// one of them +#ifndef LCD_BACKLIGHT_ENABLE +#error This visualizer needs that LCD backlight is enabled +#endif + +#ifndef LCD_ENABLE +#error This visualizer needs that LCD is enabled +#endif + +#include "visualizer.h" +#include "led_test.h" + +static const char* welcome_text[] = {"TMK", "Infinity Ergodox"}; + +// Just an example how to write custom keyframe functions, we could have moved +// all this into the init function +bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + // Read the uGFX documentation for information how to use the displays + // http://wiki.ugfx.org/index.php/Main_Page + gdispClear(White); + // You can use static variables for things that can't be found in the animation + // or state structs + gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black); + gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black); + // Always remember to flush the display + gdispFlush(); + // you could set the backlight color as well, but we won't do it here, since + // it's part of the following animation + // lcd_backlight_color(hue, saturation, intensity); + // We don't need constant updates, just drawing the screen once is enough + return false; +} + +// Feel free to modify the animations below, or even add new ones if needed + +// Don't worry, if the startup animation is long, you can use the keyboard like normal +// during that time +static keyframe_animation_t startup_animation = { + .num_frames = 4, + .loop = false, + .frame_lengths = {0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, + .frame_functions = { + display_welcome, + keyframe_animate_backlight_color, + keyframe_no_operation, + enable_visualization + }, +}; + +// The color animation animates the LCD color when you change layers +static keyframe_animation_t color_animation = { + .num_frames = 2, + .loop = false, + // Note that there's a 200 ms no-operation frame, + // this prevents the color from changing when activating the layer + // momentarily + .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)}, + .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color}, +}; + +// The LCD animation alternates between the layer name display and a +// bitmap that displays all active layers +static keyframe_animation_t lcd_animation = { + .num_frames = 2, + .loop = true, + .frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)}, + .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap}, +}; + +static keyframe_animation_t suspend_animation = { + .num_frames = 3, + .loop = false, + .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0}, + .frame_functions = { + keyframe_display_layer_text, + keyframe_animate_backlight_color, + keyframe_disable_lcd_and_backlight, + }, +}; + +static keyframe_animation_t resume_animation = { + .num_frames = 5, + .loop = false, + .frame_lengths = {0, 0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, + .frame_functions = { + keyframe_enable_lcd_and_backlight, + display_welcome, + keyframe_animate_backlight_color, + keyframe_no_operation, + enable_visualization, + }, +}; + +void initialize_user_visualizer(visualizer_state_t* state) { + // The brightness will be dynamically adjustable in the future + // But for now, change it here. + lcd_backlight_brightness(0x50); + state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF); + state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); + start_keyframe_animation(&startup_animation); + start_keyframe_animation(&led_test_animation); +} + +void update_user_visualizer_state(visualizer_state_t* state) { + // Add more tests, change the colors and layer texts here + // Usually you want to check the high bits (higher layers first) + // because that's the order layers are processed for keypresses + // You can for check for example: + // state->status.layer + // state->status.default_layer + // state->status.leds (see led.h for available statuses) + if (state->status.layer & 0x8) { + state->target_lcd_color = LCD_COLOR(0xC0, 0xB0, 0xFF); + state->layer_text = "Numpad"; + } + else if (state->status.layer & 0x4) { + state->target_lcd_color = LCD_COLOR(0, 0xB0, 0xFF); + state->layer_text = "KBD functions"; + } + else if (state->status.layer & 0x2) { + state->target_lcd_color = LCD_COLOR(0x80, 0xB0, 0xFF); + state->layer_text = "Function keys"; + } + else { + state->target_lcd_color = LCD_COLOR(0x40, 0xB0, 0xFF); + state->layer_text = "Default"; + } + // You can also stop existing animations, and start your custom ones here + // remember that you should normally have only one animation for the LCD + // and one for the background. But you can also combine them if you want. + start_keyframe_animation(&lcd_animation); + start_keyframe_animation(&color_animation); +} + +void user_visualizer_suspend(visualizer_state_t* state) { + state->layer_text = "Suspending..."; + uint8_t hue = LCD_HUE(state->current_lcd_color); + uint8_t sat = LCD_SAT(state->current_lcd_color); + state->target_lcd_color = LCD_COLOR(hue, sat, 0); + start_keyframe_animation(&suspend_animation); +} + +void user_visualizer_resume(visualizer_state_t* state) { + state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0x00); + state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); + start_keyframe_animation(&resume_animation); + start_keyframe_animation(&led_test_animation); +} diff --git a/keyboards/infinity_ergodox/visualizer_user.c b/keyboards/infinity_ergodox/visualizer_user.c deleted file mode 100644 index c0d335ce6..000000000 --- a/keyboards/infinity_ergodox/visualizer_user.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 . -*/ - -// Currently we are assuming that both the backlight and LCD are enabled -// But it's entirely possible to write a custom visualizer that use only -// one of them -#ifndef LCD_BACKLIGHT_ENABLE -#error This visualizer needs that LCD backlight is enabled -#endif - -#ifndef LCD_ENABLE -#error This visualizer needs that LCD is enabled -#endif - -#include "visualizer.h" -#include "led_test.h" - -static const char* welcome_text[] = {"TMK", "Infinity Ergodox"}; - -// Just an example how to write custom keyframe functions, we could have moved -// all this into the init function -bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) { - (void)animation; - // Read the uGFX documentation for information how to use the displays - // http://wiki.ugfx.org/index.php/Main_Page - gdispClear(White); - // You can use static variables for things that can't be found in the animation - // or state structs - gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black); - gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black); - // Always remember to flush the display - gdispFlush(); - // you could set the backlight color as well, but we won't do it here, since - // it's part of the following animation - // lcd_backlight_color(hue, saturation, intensity); - // We don't need constant updates, just drawing the screen once is enough - return false; -} - -// Feel free to modify the animations below, or even add new ones if needed - -// Don't worry, if the startup animation is long, you can use the keyboard like normal -// during that time -static keyframe_animation_t startup_animation = { - .num_frames = 4, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, - .frame_functions = { - display_welcome, - keyframe_animate_backlight_color, - keyframe_no_operation, - enable_visualization - }, -}; - -// The color animation animates the LCD color when you change layers -static keyframe_animation_t color_animation = { - .num_frames = 2, - .loop = false, - // Note that there's a 200 ms no-operation frame, - // this prevents the color from changing when activating the layer - // momentarily - .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)}, - .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color}, -}; - -// The LCD animation alternates between the layer name display and a -// bitmap that displays all active layers -static keyframe_animation_t lcd_animation = { - .num_frames = 2, - .loop = true, - .frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)}, - .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap}, -}; - -static keyframe_animation_t suspend_animation = { - .num_frames = 3, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0}, - .frame_functions = { - keyframe_display_layer_text, - keyframe_animate_backlight_color, - keyframe_disable_lcd_and_backlight, - }, -}; - -static keyframe_animation_t resume_animation = { - .num_frames = 5, - .loop = false, - .frame_lengths = {0, 0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, - .frame_functions = { - keyframe_enable_lcd_and_backlight, - display_welcome, - keyframe_animate_backlight_color, - keyframe_no_operation, - enable_visualization, - }, -}; - -void initialize_user_visualizer(visualizer_state_t* state) { - // The brightness will be dynamically adjustable in the future - // But for now, change it here. - lcd_backlight_brightness(0x50); - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&startup_animation); - start_keyframe_animation(&led_test_animation); -} - -void update_user_visualizer_state(visualizer_state_t* state) { - // Add more tests, change the colors and layer texts here - // Usually you want to check the high bits (higher layers first) - // because that's the order layers are processed for keypresses - // You can for check for example: - // state->status.layer - // state->status.default_layer - // state->status.leds (see led.h for available statuses) - if (state->status.layer & 0x8) { - state->target_lcd_color = LCD_COLOR(0xC0, 0xB0, 0xFF); - state->layer_text = "Numpad"; - } - else if (state->status.layer & 0x4) { - state->target_lcd_color = LCD_COLOR(0, 0xB0, 0xFF); - state->layer_text = "KBD functions"; - } - else if (state->status.layer & 0x2) { - state->target_lcd_color = LCD_COLOR(0x80, 0xB0, 0xFF); - state->layer_text = "Function keys"; - } - else { - state->target_lcd_color = LCD_COLOR(0x40, 0xB0, 0xFF); - state->layer_text = "Default"; - } - // You can also stop existing animations, and start your custom ones here - // remember that you should normally have only one animation for the LCD - // and one for the background. But you can also combine them if you want. - start_keyframe_animation(&lcd_animation); - start_keyframe_animation(&color_animation); -} - -void user_visualizer_suspend(visualizer_state_t* state) { - state->layer_text = "Suspending..."; - uint8_t hue = LCD_HUE(state->current_lcd_color); - uint8_t sat = LCD_SAT(state->current_lcd_color); - state->target_lcd_color = LCD_COLOR(hue, sat, 0); - start_keyframe_animation(&suspend_animation); -} - -void user_visualizer_resume(visualizer_state_t* state) { - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0x00); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&resume_animation); - start_keyframe_animation(&led_test_animation); -} diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk index 449957d63..2f4a41d66 100644 --- a/quantum/visualizer/visualizer.mk +++ b/quantum/visualizer/visualizer.mk @@ -46,10 +46,15 @@ include $(GFXLIB)/gfx.mk SRC += $(patsubst $(TOP_DIR)/%,%,$(GFXSRC)) OPT_DEFS += $(patsubst %,-D%,$(patsubst -D%,%,$(GFXDEFS))) -ifndef VISUALIZER_USER -VISUALIZER_USER = visualizer_user.c +ifneq ("$(wildcard $(KEYMAP_PATH)/visualizer.c)","") + SRC += keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/visualizer.c +else + ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/visualizer.c)","") +$(error "$(KEYMAP_PATH)/visualizer.c" does not exist) + else + SRC += keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/visualizer.c + endif endif -SRC += $(VISUALIZER_USER) ifdef EMULATOR UINCDIR += $(TMK_DIR)/common -- cgit v1.2.3-24-g4f1b From 589df84d6cd19ad7d776cc19bcddade1cd178ddc Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 7 Jul 2016 09:58:44 -0400 Subject: corrects quantum template --- quantum/template/template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/template/template.c b/quantum/template/template.c index dcc4b0a22..3057557ea 100644 --- a/quantum/template/template.c +++ b/quantum/template/template.c @@ -18,7 +18,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { // put your per-action keyboard code here // runs for every action, just before processing by the firmware - return process_action_user(record); + return process_record_user(record); } void led_set_kb(uint8_t usb_led) { -- cgit v1.2.3-24-g4f1b From 57e08eb8badc5db2fb44d2df684f32ea48cce411 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 7 Jul 2016 11:33:32 -0400 Subject: updates rgblight implementation, makes non-timer stuff compatible with audio --- keyboards/clueboard/rev1/config.h | 5 +- keyboards/clueboard/rev2/config.h | 5 +- keyboards/cluepad/config.h | 13 +++-- keyboards/kc60/keymaps/ws2812/config.h | 5 +- keyboards/lets_split/config.h | 5 +- keyboards/phantom/config.h | 13 +++-- keyboards/planck/keymaps/experimental/Makefile | 6 +-- keyboards/planck/keymaps/experimental/config.h | 8 +++ keyboards/planck/keymaps/experimental/keymap.c | 73 ++++++++++++++++++++++++-- keyboards/planck/keymaps/pvc/config.h | 5 +- keyboards/planck/keymaps/yang/config.h | 5 +- keyboards/preonic/config.h | 5 +- keyboards/satan/config.h | 14 ++--- quantum/light_ws2812.c | 25 ++++++--- quantum/rgblight.c | 23 ++++++-- quantum/rgblight.h | 7 ++- readme.md | 17 +++--- 17 files changed, 160 insertions(+), 74 deletions(-) diff --git a/keyboards/clueboard/rev1/config.h b/keyboards/clueboard/rev1/config.h index 9bb58f56e..8c9497232 100644 --- a/keyboards/clueboard/rev1/config.h +++ b/keyboards/clueboard/rev1/config.h @@ -25,9 +25,8 @@ /* Underlight configuration */ -#define ws2812_PORTREG PORTB -#define ws2812_DDRREG DDRB -#define ws2812_pin 2 +#define RGB_DI_PIN B2 +#define RGBLIGHT_TIMER #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/clueboard/rev2/config.h b/keyboards/clueboard/rev2/config.h index e2f8336be..02982ff29 100644 --- a/keyboards/clueboard/rev2/config.h +++ b/keyboards/clueboard/rev2/config.h @@ -29,9 +29,8 @@ /* Underlight configuration */ -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD -#define ws2812_pin 7 +#define RGB_DI_PIN D7 +#define RGBLIGHT_TIMER #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/cluepad/config.h b/keyboards/cluepad/config.h index 0955e0f70..bae05fade 100644 --- a/keyboards/cluepad/config.h +++ b/keyboards/cluepad/config.h @@ -69,13 +69,12 @@ along with this program. If not, see . /* Underlight configuration */ - #define ws2812_PORTREG PORTF - #define ws2812_DDRREG DDRF - #define ws2812_pin 6 - #define RGBLED_NUM 4 // Number of LEDs - #define RGBLIGHT_HUE_STEP 10 - #define RGBLIGHT_SAT_STEP 17 - #define RGBLIGHT_VAL_STEP 17 +#define RGB_DI_PIN F6 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 4 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 /* * Feature disable options diff --git a/keyboards/kc60/keymaps/ws2812/config.h b/keyboards/kc60/keymaps/ws2812/config.h index 933bb0d2d..2f39ea8e5 100644 --- a/keyboards/kc60/keymaps/ws2812/config.h +++ b/keyboards/kc60/keymaps/ws2812/config.h @@ -1,9 +1,8 @@ #include "../../config.h" /* WS2812B RGB Underglow LED */ -#define ws2812_PORTREG PORTF -#define ws2812_DDRREG DDRF -#define ws2812_pin PF5 // Based on wiring depicted in ws2812_wiring.jpg +#define RGB_DI_PIN F5 // Based on wiring depicted in ws2812_wiring.jpg +#define RGBLIGHT_TIMER #define RGBLED_NUM 16 // Number of LEDs. Change this to match your use case. #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index 6f90997ab..833818ce6 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h @@ -69,9 +69,8 @@ along with this program. If not, see . ) /* ws2812 RGB LED */ -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD -#define ws2812_pin PD1 +#define RGB_DI_PIN D2 +#define RGBLIGHT_TIMER #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/phantom/config.h b/keyboards/phantom/config.h index d5878766f..983a1d73f 100644 --- a/keyboards/phantom/config.h +++ b/keyboards/phantom/config.h @@ -62,13 +62,12 @@ along with this program. If not, see . /* Underlight configuration */ - #define ws2812_PORTREG PORTE - #define ws2812_DDRREG DDRE - #define ws2812_pin 2 - #define RGBLED_NUM 20 // Number of LEDs - #define RGBLIGHT_HUE_STEP 10 - #define RGBLIGHT_SAT_STEP 17 - #define RGBLIGHT_VAL_STEP 17 +#define RGB_DI_PIN E2 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 20 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 /* * Feature disable options diff --git a/keyboards/planck/keymaps/experimental/Makefile b/keyboards/planck/keymaps/experimental/Makefile index 581e08cd0..877c4aed0 100644 --- a/keyboards/planck/keymaps/experimental/Makefile +++ b/keyboards/planck/keymaps/experimental/Makefile @@ -10,12 +10,12 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 +AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h index 985e250ab..52acd1905 100644 --- a/keyboards/planck/keymaps/experimental/config.h +++ b/keyboards/planck/keymaps/experimental/config.h @@ -6,4 +6,12 @@ #define LEADER_TIMEOUT 300 #define BACKLIGHT_BREATHING + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B1 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + #endif diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c index 8ec335d7d..d9303fcae 100644 --- a/keyboards/planck/keymaps/experimental/keymap.c +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -15,7 +15,7 @@ extern keymap_config_t keymap_config; // The underscores don't mean anything - you can have a layer called STUFF or any other name. // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -#define _QWERTY 0 +#define _QWERTY 10 #define _COLEMAK 1 #define _DVORAK 2 #define _LOWER 3 @@ -31,7 +31,15 @@ enum planck_keycodes { LOWER, RAISE, BACKLIT, - EXT_PLV + EXT_PLV, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, }; // Fillers to make layering more clear @@ -39,14 +47,20 @@ enum planck_keycodes { #define XXXXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = { + {KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL}, + {KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL}, + {KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL}, + {KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL} +}, /* Qwerty - * ,-----------------------------------------------------------------------------------. + ,-----------------------------------------------------------------------------------. * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| * | Esc | A | S | D | F | G | H | J | K | L | ; | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * | Shift| Z | X | C | V | B | N | M |, | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' @@ -292,6 +306,57 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; return false; + case RGBLED_TOGGLE: + //led operations + if (record->event.pressed) { + rgblight_toggle(); + } + return false; + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + return false; + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + return false; + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + return false; + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + return false; + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + return false; + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + return false; + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + return false; + break; + + } return true; }; diff --git a/keyboards/planck/keymaps/pvc/config.h b/keyboards/planck/keymaps/pvc/config.h index b64893108..c857a3e89 100644 --- a/keyboards/planck/keymaps/pvc/config.h +++ b/keyboards/planck/keymaps/pvc/config.h @@ -60,9 +60,8 @@ along with this program. If not, see . ) /* ws2812 RGB LED */ -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD -#define ws2812_pin PD1 +#define RGB_DI_PIN D1 +#define RGBLIGHT_TIMER #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/planck/keymaps/yang/config.h b/keyboards/planck/keymaps/yang/config.h index 5921e9377..feb5a1190 100644 --- a/keyboards/planck/keymaps/yang/config.h +++ b/keyboards/planck/keymaps/yang/config.h @@ -4,9 +4,8 @@ #include "../../config.h" /* ws2812 RGB LED */ -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD -#define ws2812_pin PD1 +#define RGB_DI_PIN D1 +#define RGBLIGHT_TIMER #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h index 04946f7fb..3fb978c2f 100644 --- a/keyboards/preonic/config.h +++ b/keyboards/preonic/config.h @@ -62,9 +62,8 @@ along with this program. If not, see . ) /* ws2812 RGB LED */ -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD -#define ws2812_pin PD1 +#define RGB_DI_PIN D1 +#define RGBLIGHT_TIMER #define RGBLED_NUM 28 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/satan/config.h b/keyboards/satan/config.h index a7ea8f904..7e9f91cc8 100644 --- a/keyboards/satan/config.h +++ b/keyboards/satan/config.h @@ -65,13 +65,13 @@ along with this program. If not, see . /* Underlight configuration */ - #define ws2812_PORTREG PORTE - #define ws2812_DDRREG DDRE - #define ws2812_pin 2 - #define RGBLED_NUM 8 // Number of LEDs - #define RGBLIGHT_HUE_STEP 10 - #define RGBLIGHT_SAT_STEP 17 - #define RGBLIGHT_VAL_STEP 17 + +#define RGB_DI_PIN E2 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 /* * Feature disable options diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c index f20043067..401845e85 100755 --- a/quantum/light_ws2812.c +++ b/quantum/light_ws2812.c @@ -19,12 +19,16 @@ // Setleds for standard RGB void inline ws2812_setleds(struct cRGB *ledarray, uint16_t leds) { - ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin)); + // ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin)); + ws2812_setleds_pin(ledarray,leds, _BV(RGB_DI_PIN & 0xF)); } void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pinmask) { - ws2812_DDRREG |= pinmask; // Enable DDR + // ws2812_DDRREG |= pinmask; // Enable DDR + // new universal format (DDR) + _SFR_IO8((RGB_DI_PIN >> 4) + 1) |= pinmask; + ws2812_sendarray_mask((uint8_t*)ledarray,leds+leds+leds,pinmask); _delay_us(50); } @@ -32,14 +36,17 @@ void inline ws2812_setleds_pin(struct cRGB *ledarray, uint16_t leds, uint8_t pin // Setleds for SK6812RGBW void inline ws2812_setleds_rgbw(struct cRGBW *ledarray, uint16_t leds) { - ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR - ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(ws2812_pin)); + // ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR + // new universal format (DDR) + _SFR_IO8((RGB_DI_PIN >> 4) + 1) |= _BV(RGB_DI_PIN & 0xF); + + ws2812_sendarray_mask((uint8_t*)ledarray,leds<<2,_BV(RGB_DI_PIN & 0xF)); _delay_us(80); } void ws2812_sendarray(uint8_t *data,uint16_t datlen) { - ws2812_sendarray_mask(data,datlen,_BV(ws2812_pin)); + ws2812_sendarray_mask(data,datlen,_BV(RGB_DI_PIN & 0xF)); } /* @@ -108,8 +115,10 @@ void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi) uint8_t curbyte,ctr,masklo; uint8_t sreg_prev; - masklo =~maskhi&ws2812_PORTREG; - maskhi |= ws2812_PORTREG; + // masklo =~maskhi&ws2812_PORTREG; + // maskhi |= ws2812_PORTREG; + masklo =~maskhi&_SFR_IO8((RGB_DI_PIN >> 4) + 2); + maskhi |= _SFR_IO8((RGB_DI_PIN >> 4) + 2); sreg_prev=SREG; cli(); @@ -173,7 +182,7 @@ w_nop16 " dec %0 \n\t" // '1' [+2] '0' [+2] " brne loop%=\n\t" // '1' [+3] '0' [+4] : "=&d" (ctr) - : "r" (curbyte), "I" (_SFR_IO_ADDR(ws2812_PORTREG)), "r" (maskhi), "r" (masklo) + : "r" (curbyte), "I" (_SFR_IO_ADDR(_SFR_IO8((RGB_DI_PIN >> 4) + 2))), "r" (maskhi), "r" (masklo) ); } diff --git a/quantum/rgblight.c b/quantum/rgblight.c index c29ffedc3..b1b0f035d 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -146,7 +146,9 @@ void rgblight_init(void) { } eeconfig_debug_rgblight(); // display current eeprom values - rgblight_timer_init(); // setup the timer + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_init(); // setup the timer + #endif if (rgblight_config.enable) { rgblight_mode(rgblight_config.mode); @@ -192,14 +194,19 @@ void rgblight_mode(uint8_t mode) { eeconfig_update_rgblight(rgblight_config.raw); xprintf("rgblight mode: %u\n", rgblight_config.mode); if (rgblight_config.mode == 1) { - rgblight_timer_disable(); + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_disable(); + #endif } else if (rgblight_config.mode >=2 && rgblight_config.mode <=23) { // MODE 2-5, breathing // MODE 6-8, rainbow mood // MODE 9-14, rainbow swirl // MODE 15-20, snake // MODE 21-23, knight - rgblight_timer_enable(); + + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_enable(); + #endif } rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } @@ -211,7 +218,10 @@ void rgblight_toggle(void) { if (rgblight_config.enable) { rgblight_mode(rgblight_config.mode); } else { - rgblight_timer_disable(); + + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_disable(); + #endif _delay_ms(50); rgblight_set(); } @@ -328,6 +338,9 @@ void rgblight_set(void) { } } + +#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + // Animation timer -- AVR Timer3 void rgblight_timer_init(void) { static uint8_t rgblight_timer_is_init = 0; @@ -503,3 +516,5 @@ void rgblight_effect_knight(uint8_t interval) { } } + +#endif \ No newline at end of file diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 64f92523e..def26c428 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -1,8 +1,11 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H -#ifndef RGBLIGHT_MODES -#define RGBLIGHT_MODES 23 + +#if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + #define RGBLIGHT_MODES 23 +#else + #define RGBLIGHT_MODES 1 #endif #ifndef RGBLIGHT_EFFECT_SNAKE_LENGTH diff --git a/readme.md b/readme.md index c24d951d8..e87481251 100644 --- a/readme.md +++ b/readme.md @@ -704,23 +704,18 @@ For this mod, you need an unused pin wiring to DI of WS2812 strip. After wiring RGBLIGHT_ENABLE = yes -Please note that the underglow is not compatible with audio output. So you cannot enable both of them at the same time. +In order to use the underglow timer functions, you need to have `#define RGBLIGHT_TIMER` in your `config.h`, and have audio disabled (`AUDIO_ENABLE = no` in your Makefile). -Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the F4 by default: - - #define ws2812_PORTREG PORTF - #define ws2812_DDRREG DDRF - #define ws2812_pin PF4 +Please add the following options into your config.h, and set them up according your hardware configuration. These settings are for the `F4` pin by default: + + #define RGB_DI_PIN F4 // The pin your RGB strip is wired to + #define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio) #define RGBLED_NUM 14 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 -You'll need to edit `PORTF`, `DDRF`, and `PF4` on the first three lines to the port/pin you have your LED(s) wired to, eg for B3 change things to: - - #define ws2812_PORTREG PORTB - #define ws2812_DDRREG DDRB - #define ws2812_pin PB3 +You'll need to edit `RGB_DI_PIN` to the pin you have your `DI` on your RGB strip wired to. The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. For details, please check this keymap. `keyboards/planck/keymaps/yang/keymap.c` -- cgit v1.2.3-24-g4f1b From c1dfb636ef61159456bdb24f4fee3f27e5babbeb Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 7 Jul 2016 12:22:10 -0400 Subject: fixes quantum template (actually) --- quantum/template/template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/template/template.c b/quantum/template/template.c index 3057557ea..5ef349583 100644 --- a/quantum/template/template.c +++ b/quantum/template/template.c @@ -18,7 +18,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { // put your per-action keyboard code here // runs for every action, just before processing by the firmware - return process_record_user(record); + return process_record_user(keycode, record); } void led_set_kb(uint8_t usb_led) { -- cgit v1.2.3-24-g4f1b From 9870082a06386eba8c0c5f22da90d0256ef6244b Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 19:48:39 +0300 Subject: Fix the range for consumer keys --- quantum/keymap_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 76872ac59..d0a8312c1 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -62,7 +62,7 @@ action_t action_for_key(uint8_t layer, keypos_t key) case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE: action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode)); break; - case KC_AUDIO_MUTE ... KC_WWW_FAVORITES: + case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode)); break; case KC_MS_UP ... KC_MS_ACCEL2: -- cgit v1.2.3-24-g4f1b From 0bfb6086158c64960f039524bbc2bb9e7bbee378 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 19:56:55 +0300 Subject: Remove unhandled KC_BTLD, RESET should be used instead --- keyboards/chibios_test/keymaps/default/keymap.c | 2 +- keyboards/infinity_ergodox/keymaps/default/keymap.c | 5 ++++- tmk_core/common/keycode.h | 5 ----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/keyboards/chibios_test/keymaps/default/keymap.c b/keyboards/chibios_test/keymaps/default/keymap.c index 239d70007..a362e2ccf 100644 --- a/keyboards/chibios_test/keymaps/default/keymap.c +++ b/keyboards/chibios_test/keymaps/default/keymap.c @@ -18,7 +18,7 @@ along with this program. If not, see . #include "chibios_test.h" const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD + {{KC_CAPS}}, // test with KC_CAPS, KC_A, RESET }; const uint16_t fn_actions[] = { diff --git a/keyboards/infinity_ergodox/keymaps/default/keymap.c b/keyboards/infinity_ergodox/keymaps/default/keymap.c index c33fb7b92..f1e6b1c8a 100644 --- a/keyboards/infinity_ergodox/keymaps/default/keymap.c +++ b/keyboards/infinity_ergodox/keymaps/default/keymap.c @@ -18,6 +18,9 @@ along with this program. If not, see . #include "infinity_ergodox.h" +// Workaround for old keymap format +#define KC_RESET RESET + const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KEYMAP( // layer 0 : default // left hand @@ -63,7 +66,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KEYMAP( // layer 2 : keyboard functions // left hand - BTLD,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + RESET,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index 448195306..fc66dc0ef 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -156,8 +156,6 @@ along with this program. If not, see . #define KC_WSTP KC_WWW_STOP #define KC_WREF KC_WWW_REFRESH #define KC_WFAV KC_WWW_FAVORITES -/* Jump to bootloader */ -#define KC_BTLD KC_BOOTLOADER /* Transparent */ #define KC_TRANSPARENT 1 #define KC_TRNS KC_TRANSPARENT @@ -428,9 +426,6 @@ enum internal_special_keycodes { KC_MEDIA_FAST_FORWARD, KC_MEDIA_REWIND, /* 0xBC */ - /* Jump to bootloader */ - KC_BOOTLOADER = 0xBF, - /* Fn key */ KC_FN0 = 0xC0, KC_FN1, -- cgit v1.2.3-24-g4f1b From a2eae81927ab0e817857d5b6ba2c7ce4a4b751b6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Thu, 7 Jul 2016 20:04:27 +0300 Subject: Fix IS_CONSUMER macro --- tmk_core/common/keycode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index fc66dc0ef..2f208c54e 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -31,7 +31,7 @@ along with this program. If not, see . #define IS_SPECIAL(code) ((0xA5 <= (code) && (code) <= 0xDF) || (0xE8 <= (code) && (code) <= 0xFF)) #define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE) -#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_WFAV) +#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_MRWD) #define IS_FN(code) (KC_FN0 <= (code) && (code) <= KC_FN31) #define IS_MOUSEKEY(code) (KC_MS_UP <= (code) && (code) <= KC_MS_ACCEL2) #define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT) -- cgit v1.2.3-24-g4f1b From 50c686587ed49d8079ba1b11d45ceb6a55d6cd4b Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Thu, 7 Jul 2016 23:34:33 -0400 Subject: Create keycodes for RGB control functions Moves RGB controls out of the macro function and assigns them their own keycodes: RGB_TOG (toggle on/off) RGB_MOD (mode step) RGB_HUI (increase hue) RGB_HUD (decrease hue) RGB_SAI (increase saturation) RGB_SAD (decrease saturation) RGB_VAI (increase brightness) RGB_VAD (decrease brightness) --- keyboards/clueboard/keymaps/default/keymap.c | 72 ++------------------------- keyboards/clueboard/keymaps/max/keymap.c | 66 ++----------------------- keyboards/cluepad/keymaps/default/keymap.c | 67 ++----------------------- keyboards/kc60/keymaps/stanleylai/keymap.c | 67 +------------------------ keyboards/kc60/keymaps/ws2812/keymap.c | 65 +------------------------ keyboards/phantom/keymaps/default/keymap.c | 69 +------------------------- keyboards/planck/keymaps/yang/keymap.c | 62 ++--------------------- keyboards/satan/keymaps/default/keymap.c | 68 +------------------------- keyboards/satan/keymaps/sethbc/keymap.c | 73 ++-------------------------- quantum/keymap.h | 10 ++++ quantum/quantum.c | 50 +++++++++++++++++++ 11 files changed, 83 insertions(+), 586 deletions(-) diff --git a/keyboards/clueboard/keymaps/default/keymap.c b/keyboards/clueboard/keymaps/default/keymap.c index 89f71e83a..896bc7ebc 100644 --- a/keyboards/clueboard/keymaps/default/keymap.c +++ b/keyboards/clueboard/keymaps/default/keymap.c @@ -67,11 +67,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_RS] = KEYMAP( #ifdef RGBLIGHT_ENABLE - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(1), F(7), \ - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(8), \ + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAI, \ + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, \ KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), F(5), \ - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, F(2), F(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(4), F(6), F(3)), + MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), RGB_SAI, \ + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI), #else KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ @@ -83,30 +83,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { enum function_id { SHIFT_ESC, - #ifdef RGBLIGHT_ENABLE - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL - #endif }; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_FUNCTION(SHIFT_ESC), - #ifdef RGBLIGHT_ENABLE - [1] = ACTION_FUNCTION(RGBLED_TOGGLE), - [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - #endif }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -132,49 +112,5 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; - //led operations - #ifdef RGBLIGHT_ENABLE - case RGBLED_TOGGLE: - if (record->event.pressed) { - rgblight_toggle(); - } - - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; - #endif } } diff --git a/keyboards/clueboard/keymaps/max/keymap.c b/keyboards/clueboard/keymaps/max/keymap.c index 82c93401d..080b4930b 100644 --- a/keyboards/clueboard/keymaps/max/keymap.c +++ b/keyboards/clueboard/keymaps/max/keymap.c @@ -66,78 +66,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `----------------------------------------------------------------------------------' */ [_RS] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(0), F(6), \ - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(7), \ + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAI, \ + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, \ KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), F(4), \ - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, F(1), F(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(3), F(5), F(2)), + MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), RGB_SAI, \ + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI), }; enum function_id { - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, }; const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(RGBLED_TOGGLE), - [1] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { switch (id) { - case RGBLED_TOGGLE: - //led operations - if (record->event.pressed) { - rgblight_toggle(); - } - - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; } } diff --git a/keyboards/cluepad/keymaps/default/keymap.c b/keyboards/cluepad/keymaps/default/keymap.c index 8ba49952f..10881e8de 100644 --- a/keyboards/cluepad/keymaps/default/keymap.c +++ b/keyboards/cluepad/keymaps/default/keymap.c @@ -1,7 +1,6 @@ #include "cluepad.h" #include "backlight.h" -#include "rgblight.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -46,77 +45,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '-------------------' */ [_FL] = KEYMAP( - LT(_FL, KC_NLCK), KC_TRNS, KC_TRNS, F(0), \ - KC_TRNS, F(4), KC_TRNS, F(6), \ - F(3), BL_STEP, F(2), \ - KC_TRNS, F(5), KC_TRNS, F(7), \ - F(1), KC_TRNS) + LT(_FL, KC_NLCK), KC_TRNS, KC_TRNS, RGB_TOG, \ + KC_TRNS, RGB_SAI, KC_TRNS, RGB_VAI, \ + RGB_HUD, BL_STEP, RGB_HUI, \ + KC_TRNS, RGB_SAD, KC_TRNS, RGB_VAD, \ + RGB_MOD, KC_TRNS) }; enum function_id { - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, }; const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(RGBLED_TOGGLE), - [1] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [2] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [3] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [5] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [7] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { switch (id) { - case RGBLED_TOGGLE: - if (record->event.pressed) { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; } } diff --git a/keyboards/kc60/keymaps/stanleylai/keymap.c b/keyboards/kc60/keymaps/stanleylai/keymap.c index a7ea6040d..057c73bf4 100644 --- a/keyboards/kc60/keymaps/stanleylai/keymap.c +++ b/keyboards/kc60/keymaps/stanleylai/keymap.c @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_TRNS,KC_NO, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), BL_STEP,BL_TOGG, KC_TRNS, KC_TRNS,\ + KC_TRNS,KC_NO, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,BL_STEP,BL_TOGG, KC_TRNS, KC_TRNS,\ KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS), #else RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ @@ -52,30 +52,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { enum function_id { SHIFT_ESC, - #ifdef RGBLIGHT_ENABLE - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, - #endif }; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_FUNCTION(SHIFT_ESC), - #ifdef RGBLIGHT_ENABLE - [1] = ACTION_FUNCTION(RGBLED_TOGGLE), - [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - #endif }; #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) @@ -102,50 +82,5 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; - - #ifdef RGBLIGHT_ENABLE - - case RGBLED_TOGGLE: - //led operations - if (record->event.pressed) { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; - #endif } } diff --git a/keyboards/kc60/keymaps/ws2812/keymap.c b/keyboards/kc60/keymaps/ws2812/keymap.c index bd5bef787..1c0574df0 100644 --- a/keyboards/kc60/keymaps/ws2812/keymap.c +++ b/keyboards/kc60/keymaps/ws2812/keymap.c @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET), #else KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ @@ -65,30 +65,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { enum function_id { SHIFT_ESC, - #ifdef RGBLIGHT_ENABLE - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL - #endif }; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_FUNCTION(SHIFT_ESC), - #ifdef RGBLIGHT_ENABLE - [1] = ACTION_FUNCTION(RGBLED_TOGGLE), - [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - #endif }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -114,48 +94,5 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; - //led operations - #ifdef RGBLIGHT_ENABLE - case RGBLED_TOGGLE: - if (record->event.pressed) { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; - #endif } } diff --git a/keyboards/phantom/keymaps/default/keymap.c b/keyboards/phantom/keymaps/default/keymap.c index 1368226aa..a4fc319ac 100644 --- a/keyboards/phantom/keymaps/default/keymap.c +++ b/keyboards/phantom/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include "phantom.h" -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - // Used for SHIFT_ESC #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) @@ -59,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, \ - KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #else KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ @@ -73,30 +69,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { enum function_id { SHIFT_ESC, - #ifdef RGBLIGHT_ENABLE - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL - #endif }; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_FUNCTION(SHIFT_ESC), - #ifdef RGBLIGHT_ENABLE - [1] = ACTION_FUNCTION(RGBLED_TOGGLE), - [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - #endif }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -122,48 +98,5 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; - //led operations - #ifdef RGBLIGHT_ENABLE - case RGBLED_TOGGLE: - if (record->event.pressed) { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; - #endif } } diff --git a/keyboards/planck/keymaps/yang/keymap.c b/keyboards/planck/keymaps/yang/keymap.c index 541b1a57e..5f2907a08 100644 --- a/keyboards/planck/keymaps/yang/keymap.c +++ b/keyboards/planck/keymaps/yang/keymap.c @@ -51,33 +51,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RGB] = { /* RGBLIGHT */ {KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL}, {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_TRNS}, - {KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS}, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} } }; enum function_id { - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, + }; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_TAP_KEY(_RGB, KC_SPC), - [1] = ACTION_FUNCTION(RGBLED_TOGGLE), - [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) @@ -100,47 +85,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { switch (id) { - case RGBLED_TOGGLE: - //led operations - if (record->event.pressed) { - rgblight_toggle(); - } - - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; + } } diff --git a/keyboards/satan/keymaps/default/keymap.c b/keyboards/satan/keymaps/default/keymap.c index b19404afc..35dbbb77b 100644 --- a/keyboards/satan/keymaps/default/keymap.c +++ b/keyboards/satan/keymaps/default/keymap.c @@ -1,8 +1,5 @@ #include "satan.h" -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif // Used for SHIFT_ESC #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) @@ -53,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #else KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ @@ -66,30 +63,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { enum function_id { SHIFT_ESC, - #ifdef RGBLIGHT_ENABLE - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL - #endif }; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_FUNCTION(SHIFT_ESC), - #ifdef RGBLIGHT_ENABLE - [1] = ACTION_FUNCTION(RGBLED_TOGGLE), - [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - #endif }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -115,48 +92,5 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; - //led operations - #ifdef RGBLIGHT_ENABLE - case RGBLED_TOGGLE: - if (record->event.pressed) { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; - #endif } } diff --git a/keyboards/satan/keymaps/sethbc/keymap.c b/keyboards/satan/keymaps/sethbc/keymap.c index 0ea4a7ae4..f8991f9fd 100644 --- a/keyboards/satan/keymaps/sethbc/keymap.c +++ b/keyboards/satan/keymaps/sethbc/keymap.c @@ -1,9 +1,5 @@ #include "satan.h" -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - // Used for SHIFT_ESC #define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) @@ -44,39 +40,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #else KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RESET, \ - KC_CAPS, KC_TRNS, F(1), F(2), F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ - KC_TRNS, KC_VOLD, F(4), F(5), F(6), KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ - KC_TRNS, F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ + KC_CAPS, KC_TRNS, RGB_TOG,RGB_MOD,RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ + KC_TRNS, KC_VOLD, RGB_HUD,RGB_SAI,RGB_SAD, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ + KC_TRNS, RGB_VAI,RGB_VAD,KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #endif }; enum function_id { SHIFT_ESC, - #ifdef RGBLIGHT_ENABLE - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL - #endif }; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_FUNCTION(SHIFT_ESC), - #ifdef RGBLIGHT_ENABLE - [1] = ACTION_FUNCTION(RGBLED_TOGGLE), - [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - #endif }; void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -102,48 +78,5 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } } break; - //led operations - #ifdef RGBLIGHT_ENABLE - case RGBLED_TOGGLE: - if (record->event.pressed) { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); - } - break; - #endif } } diff --git a/quantum/keymap.h b/quantum/keymap.h index 73f99f821..a15865183 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -156,6 +156,16 @@ enum quantum_keycodes { BL_INC, BL_TOGG, BL_STEP, + + // RGB functionality + RGB_TOG, + RGB_MOD, + RGB_HUI, + RGB_HUD, + RGB_SAI, + RGB_SAD, + RGB_VAI, + RGB_VAD, // Left shift, open paren KC_LSPO, diff --git a/quantum/quantum.c b/quantum/quantum.c index d8e43a465..5c0b53e22 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -103,6 +103,56 @@ bool process_record_quantum(keyrecord_t *record) { return false; } break; + #ifdef RGBLIGHT_ENABLE + case RGB_TOG: + if (record->event.pressed) { + rgblight_toggle(); + return false; + } + break; + case RGB_MOD: + if (record->event.pressed) { + rgblight_step(); + return false; + } + break; + case RGB_HUI: + if (record->event.pressed) { + rgblight_increase_hue(); + return false; + } + break; + case RGB_HUD: + if (record->event.pressed) { + rgblight_decrease_hue(); + return false; + } + break; + case RGB_SAI: + if (record->event.pressed) { + rgblight_increase_sat(); + return false; + } + break; + case RGB_SAD: + if (record->event.pressed) { + rgblight_decrease_sat(); + return false; + } + break; + case RGB_VAI: + if (record->event.pressed) { + rgblight_increase_val(); + return false; + } + break; + case RGB_VAD: + if (record->event.pressed) { + rgblight_decrease_val(); + return false; + } + break; + #endif case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_UNSWAP_ALT_GUI: if (record->event.pressed) { // MAGIC actions (BOOTMAGIC without the boot) -- cgit v1.2.3-24-g4f1b From ccfa7351add03eb6c3e081cd37893fc2da519c4b Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Thu, 7 Jul 2016 23:50:04 -0400 Subject: Fix compile error on Clueboard --- keyboards/clueboard/keymaps/max/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/clueboard/keymaps/max/keymap.c b/keyboards/clueboard/keymaps/max/keymap.c index 080b4930b..193809840 100644 --- a/keyboards/clueboard/keymaps/max/keymap.c +++ b/keyboards/clueboard/keymaps/max/keymap.c @@ -73,8 +73,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI), }; -enum function_id { -}; +/*enum function_id { +};*/ const uint16_t PROGMEM fn_actions[] = { }; -- cgit v1.2.3-24-g4f1b From e2ec45a755741a29ecd814e6151f4d4860b20386 Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Thu, 7 Jul 2016 23:57:11 -0400 Subject: Fix cluepad and planck --- keyboards/cluepad/keymaps/default/keymap.c | 4 ++-- keyboards/planck/keymaps/yang/keymap.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/cluepad/keymaps/default/keymap.c b/keyboards/cluepad/keymaps/default/keymap.c index 10881e8de..66827fe48 100644 --- a/keyboards/cluepad/keymaps/default/keymap.c +++ b/keyboards/cluepad/keymaps/default/keymap.c @@ -52,8 +52,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RGB_MOD, KC_TRNS) }; -enum function_id { -}; +/*enum function_id { +};*/ const uint16_t PROGMEM fn_actions[] = { }; diff --git a/keyboards/planck/keymaps/yang/keymap.c b/keyboards/planck/keymaps/yang/keymap.c index 5f2907a08..0ce849050 100644 --- a/keyboards/planck/keymaps/yang/keymap.c +++ b/keyboards/planck/keymaps/yang/keymap.c @@ -57,9 +57,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { } }; -enum function_id { - -}; +/*enum function_id { + +};*/ const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_TAP_KEY(_RGB, KC_SPC), -- cgit v1.2.3-24-g4f1b From 66ffb1cb3a21c670719263f187e3470fd888f42a Mon Sep 17 00:00:00 2001 From: Robbie Gill Date: Thu, 7 Jul 2016 21:03:20 -0700 Subject: port missing support for hhkb-jp from tmk --- keyboards/hhkb/Makefile | 4 +++ keyboards/hhkb/config.h | 6 +++- keyboards/hhkb/hhkb.h | 27 ++++++++++++++ keyboards/hhkb/keymaps/jp/Makefile | 1 + keyboards/hhkb/keymaps/jp/keymap.c | 58 ++++++++++++++++++++++++++++++ keyboards/hhkb/keymaps/rdg_jp/Makefile | 1 + keyboards/hhkb/keymaps/rdg_jp/keymap.c | 65 ++++++++++++++++++++++++++++++++++ 7 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 keyboards/hhkb/keymaps/jp/Makefile create mode 100644 keyboards/hhkb/keymaps/jp/keymap.c create mode 100644 keyboards/hhkb/keymaps/rdg_jp/Makefile create mode 100644 keyboards/hhkb/keymaps/rdg_jp/keymap.c diff --git a/keyboards/hhkb/Makefile b/keyboards/hhkb/Makefile index 53eece396..6fe973e1e 100644 --- a/keyboards/hhkb/Makefile +++ b/keyboards/hhkb/Makefile @@ -78,6 +78,10 @@ ifndef QUANTUM_DIR include ../../Makefile endif +ifneq (, $(findstring yes, $(HHKB_JP))) + OPT_DEFS += -DHHKB_JP +endif + debug-on: EXTRAFLAGS += -DDEBUG -DDEBUG_ACTION debug-on: all diff --git a/keyboards/hhkb/config.h b/keyboards/hhkb/config.h index ee66e4457..3f0528b4b 100644 --- a/keyboards/hhkb/config.h +++ b/keyboards/hhkb/config.h @@ -29,7 +29,11 @@ along with this program. If not, see . #define DESCRIPTION q.m.k keyboard firmware for HHKB /* key matrix size */ -#define MATRIX_ROWS 8 +#ifdef HHKB_JP +# define MATRIX_ROWS 16 +#else +# define MATRIX_ROWS 8 +#endif #define MATRIX_COLS 8 #define TAPPING_TERM 200 diff --git a/keyboards/hhkb/hhkb.h b/keyboards/hhkb/hhkb.h index cc756c456..e95125efc 100644 --- a/keyboards/hhkb/hhkb.h +++ b/keyboards/hhkb/hhkb.h @@ -21,4 +21,31 @@ { K70, K71, K72, K73, K74, K75, K76, KC_NO } \ } + +#define KEYMAP_JP( \ + K02, K32, K62, K22, K12, K52, K72, KA2, K92, K82, KB2, KE2, KF2, KD2, KC2, \ + K03, K63, K23, K13, K53, K73, KA3, K93, K83, KB3, KE3, KF3, KD3, \ + K06, K66, K26, K16, K56, K76, KA6, K96, K86, KB6, KE6, KF6, KD6, KC6, \ + K05, K65, K25, K15, K55, K75, KA5, K95, K85, KB5, KE5, KF5, KD5, KC5, \ + K04, K34, K64, K24, K14, K74, K94, K84, KB4, KE4, KF4, KD4, KC4) \ +{ \ + { KC_NO, KC_NO, K02, K03, K04, K05, K06, KC_NO }, \ + { KC_NO, KC_NO, K12, K13, K14, K15, K16, KC_NO }, \ + { KC_NO, KC_NO, K22, K23, K24, K25, K26, KC_NO }, \ + { KC_NO, KC_NO, K32, KC_NO, K34, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, K52, K53, KC_NO, K55, K56, KC_NO }, \ + { KC_NO, KC_NO, K62, K63, K64, K65, K66, KC_NO }, \ + { KC_NO, KC_NO, K72, K73, K74, K75, K76, KC_NO }, \ + { KC_NO, KC_NO, K82, K83, K84, K85, K86, KC_NO }, \ + { KC_NO, KC_NO, K92, K93, K94, K95, K96, KC_NO }, \ + { KC_NO, KC_NO, KA2, KA3, KC_NO, KA5, KA6, KC_NO }, \ + { KC_NO, KC_NO, KB2, KB3, KB4, KB5, KB6, KC_NO }, \ + { KC_NO, KC_NO, KC2, KC_NO, KC4, KC5, KC6, KC_NO }, \ + { KC_NO, KC_NO, KD2, KD3, KD4, KD5, KD6, KC_NO }, \ + { KC_NO, KC_NO, KE2, KE3, KE4, KE5, KE6, KC_NO }, \ + { KC_NO, KC_NO, KF2, KF3, KF4, KF5, KF6, KC_NO } \ +} + + #endif diff --git a/keyboards/hhkb/keymaps/jp/Makefile b/keyboards/hhkb/keymaps/jp/Makefile new file mode 100644 index 000000000..92986292a --- /dev/null +++ b/keyboards/hhkb/keymaps/jp/Makefile @@ -0,0 +1 @@ +HHKB_JP=yes diff --git a/keyboards/hhkb/keymaps/jp/keymap.c b/keyboards/hhkb/keymaps/jp/keymap.c new file mode 100644 index 000000000..8525adce5 --- /dev/null +++ b/keyboards/hhkb/keymaps/jp/keymap.c @@ -0,0 +1,58 @@ +#include "hhkb.h" + +#define _______ KC_TRNS + + +/* Layer 0: HHKB JP + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| -| =|Yen|Bsp| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | + * |------------------------------------------------------` Ent| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | + * |-----------------------------------------------------------| + * |Shft | Z| X| C| V| B| N| M| ,| .| /| \| Up|Sft| + * |-----------------------------------------------------------| + * | ||Ctl|Alt|Cmd| | Spc |Bsp| | | ||Lft|Dwn|Rgh| + * `-----------------------------------------------------------' + */ + +/* Layer 1: HHKB mode (HHKB Fn) + * ,-----------------------------------------------------------. + * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| + * |-----------------------------------------------------------| + * |Caps | | | | | | | |Psc|Slk|Pus|Up | | | + * |------------------------------------------------------` | + * | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig| | | + * |-----------------------------------------------------------| + * | | | | | | | +| -|End|PgD|Dow| | | | + * |-----------------------------------------------------------| + * | || | | | | | | | | || | | | + * `-----------------------------------------------------------' + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP_JP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_JYEN, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_UP, KC_RSFT, + MO(1), KC_ZKHK, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC, KC_HENK, KC_KANA, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = KEYMAP_JP( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, + _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, KC_PENT, + _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, + _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______ + ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t macro_id, uint8_t opt) { + return MACRO_NONE; +} + +const uint16_t PROGMEM fn_actions[] = { + +}; diff --git a/keyboards/hhkb/keymaps/rdg_jp/Makefile b/keyboards/hhkb/keymaps/rdg_jp/Makefile new file mode 100644 index 000000000..92986292a --- /dev/null +++ b/keyboards/hhkb/keymaps/rdg_jp/Makefile @@ -0,0 +1 @@ +HHKB_JP=yes diff --git a/keyboards/hhkb/keymaps/rdg_jp/keymap.c b/keyboards/hhkb/keymaps/rdg_jp/keymap.c new file mode 100644 index 000000000..700ba3a0b --- /dev/null +++ b/keyboards/hhkb/keymaps/rdg_jp/keymap.c @@ -0,0 +1,65 @@ +#include "hhkb.h" + +#define _______ KC_TRNS + +enum { + ZER, + HDN, + OSY +}; + + +#define CTL_ESC CTL_T(KC_ESC) +#define SFT_BSP SFT_T(KC_BSPC) + +#define SCRNS3 LGUI(LCTL(LSFT(KC_3))) +#define SCRNS4 LGUI(LCTL(LSFT(KC_4))) + + +/* hhkb jp ~ layout + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| -| =|Yen|Bsp| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | + * |------------------------------------------------------` Ent| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | + * |-----------------------------------------------------------| + * |Shft | Z| X| C| V| B| N| M| ,| .| /| \| Up|Sft| + * |-----------------------------------------------------------| + * | ||Ctl|Alt|Cmd| | Spc |Bsp| | | ||Lft|Dwn|Rgh| + * `-----------------------------------------------------------' + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [ZER] = KEYMAP_JP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_INS, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_GRV, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_UP, KC_RSFT, + MO(HDN), KC_LCTL, KC_LALT, KC_LGUI, MO(HDN), KC_SPC, SFT_BSP, MO(HDN), MO(OSY), KC_NO, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [HDN] = KEYMAP_JP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, + _______, KC_TILD, KC_GRV, KC_BSLS, KC_PIPE, KC_MINS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TILD, KC_GRV, _______, _______, + _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, _______, _______, KC_ENT, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, KC_UNDS , KC_DEL, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), + + [OSY] = KEYMAP_JP( + _______, _______, _______, SCRNS3, SCRNS4, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______ + ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t macro_id, uint8_t opt) { + return MACRO_NONE; +} + +const uint16_t PROGMEM fn_actions[] = { + +}; -- cgit v1.2.3-24-g4f1b From f7a86822266603b8ffd21e9f89ec1de8d4950791 Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Fri, 8 Jul 2016 03:32:28 -0400 Subject: Move return out of event if block According to Jack, this makes the return case not be processed. Doesn't break anything in the firmware. --- quantum/quantum.c | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 5c0b53e22..09daa4712 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -93,65 +93,65 @@ bool process_record_quantum(keyrecord_t *record) { *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific #endif bootloader_jump(); - return false; } + return false; break; case DEBUG: if (record->event.pressed) { print("\nDEBUG: enabled.\n"); debug_enable = true; - return false; } + return false; break; #ifdef RGBLIGHT_ENABLE case RGB_TOG: if (record->event.pressed) { rgblight_toggle(); - return false; - } - break; + } + return false; + break; case RGB_MOD: if (record->event.pressed) { rgblight_step(); - return false; - } - break; + } + return false; + break; case RGB_HUI: if (record->event.pressed) { rgblight_increase_hue(); - return false; - } - break; + } + return false; + break; case RGB_HUD: if (record->event.pressed) { rgblight_decrease_hue(); - return false; - } - break; + } + return false; + break; case RGB_SAI: if (record->event.pressed) { rgblight_increase_sat(); - return false; - } - break; + } + return false; + break; case RGB_SAD: if (record->event.pressed) { rgblight_decrease_sat(); - return false; - } - break; + } + return false; + break; case RGB_VAI: if (record->event.pressed) { rgblight_increase_val(); - return false; - } - break; + } + return false; + break; case RGB_VAD: if (record->event.pressed) { rgblight_decrease_val(); - return false; - } - break; + } + return false; + break; #endif case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_UNSWAP_ALT_GUI: if (record->event.pressed) { -- cgit v1.2.3-24-g4f1b From 564c743aa025c094f9c31ba2049aa50e15d76ab7 Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Fri, 8 Jul 2016 03:40:05 -0400 Subject: Fix a function mismatch that was causing LEDs to not properly initialize See #430. Name of function being called at init was updated to led_init_ports(), but the call itself wasn't renamed. --- keyboards/phantom/led.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/phantom/led.c b/keyboards/phantom/led.c index b2459c774..69dba7d40 100644 --- a/keyboards/phantom/led.c +++ b/keyboards/phantom/led.c @@ -19,7 +19,7 @@ along with this program. If not, see . #include "stdint.h" #include "led.h" -void led_init(void) { +void led_init_ports(void) { // * Set our LED pins as output DDRB |= (1<<6); DDRB |= (1<<7); -- cgit v1.2.3-24-g4f1b From b86b0480d530c9d5f40bbe835f120b1c1b563e47 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 8 Jul 2016 17:20:37 +0300 Subject: Speed up compilation by not using recusive make The cleaning is done outside the targets, by checking the requested target name. --- tmk_core/rules.mk | 59 ++++++++++++++++++++----------------------------------- 1 file changed, 21 insertions(+), 38 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 352e9314b..a518fc0c3 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -271,23 +271,10 @@ ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) # Default target. -all: - @$(MAKE) begin - @$(MAKE) gccversion - @$(MAKE) sizebefore - @$(MAKE) clean_list # force clean each time - @$(MAKE) build - @$(MAKE) sizeafter - @$(MAKE) end +all: build sizeafter # Quick make that doesn't clean -quick: - @$(MAKE) begin - @$(MAKE) gccversion - @$(MAKE) sizebefore - @$(MAKE) build - @$(MAKE) sizeafter - @$(MAKE) end +quick: build sizeafter # Change the build target to build a HEX file or a library. build: elf hex @@ -303,13 +290,7 @@ sym: $(BUILD_DIR)/$(TARGET).sym LIBNAME=lib$(TARGET).a lib: $(LIBNAME) - - -# Eye candy. -# AVR Studio 3.x does not check make's exit code but relies on -# the following magic strings to be generated by the compile job. -begin: - @$(SECHO) $(MSG_BEGIN) +check_submodule: git submodule status --recursive | \ while IFS= read -r x; do \ case "$$x" in \ @@ -318,10 +299,6 @@ begin: esac \ done -end: - @$(SECHO) $(MSG_END) - - # Display size of file. HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex #ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf @@ -331,7 +308,7 @@ sizebefore: @if test -f $(TARGET).hex; then $(SECHO) $(MSG_SIZE_BEFORE); $(SILENT) || $(HEXSIZE); \ 2>/dev/null; $(SECHO); fi -sizeafter: +sizeafter: $(BUILD_DIR)/$(TARGET).hex @if test -f $(TARGET).hex; then $(SECHO); $(SECHO) $(MSG_SIZE_AFTER); $(SILENT) || $(HEXSIZE); \ 2>/dev/null; $(SECHO); fi # test file sizes eventually @@ -386,9 +363,9 @@ gccversion : # Link: create ELF output file from object files. .SECONDARY : $(BUILD_DIR)/$(TARGET).elf .PRECIOUS : $(OBJ) -%.elf: $(OBJ) +%.elf: gccversion sizebefore check_submodule $(OBJ) @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) - $(eval CMD=$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)) + $(eval CMD=$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)) @$(BUILD_CMD) # Compile: create object files from C source files. @@ -429,14 +406,7 @@ $(OBJDIR)/%.o : %.S $(CC) -E -mmcu=$(MCU) $(CFLAGS) $< -o $@ # Target: clean project. -clean: begin clean_list end - -clean_list : - @$(REMOVE) -r $(BUILD_DIR) - @$(REMOVE) -r $(TOP_DIR)/$(BUILD_DIR) - @$(REMOVE) -r $(KEYBOARD_PATH)/$(BUILD_DIR) - @if $$SUBPROJECT; then $(REMOVE) -r $(SUBPROJECT_PATH)/$(BUILD_DIR); fi - @$(REMOVE) -r $(KEYMAP_PATH)/$(BUILD_DIR) +clean: show_path: @echo VPATH=$(VPATH) @@ -496,6 +466,19 @@ all-keymaps-%: all-keymaps: all-keymaps-all +GOAL=$(MAKECMDGOALS) +ifeq ($(MAKECMDGOALS),) +GOAL = all +endif +CLEANING_GOALS=clean clean_list all +ifneq ($(findstring $(GOAL),$(CLEANING_GOALS)),) +$(shell $(REMOVE) -r $(BUILD_DIR) 2>/dev/null) +$(shell $(REMOVE) -r $(TOP_DIR)/$(BUILD_DIR)) +$(shell $(REMOVE) -r $(KEYBOARD_PATH)/$(BUILD_DIR)) +$(shell if $$SUBPROJECT; then $(REMOVE) -r $(SUBPROJECT_PATH)/$(BUILD_DIR); fi) +$(shell $(REMOVE) -r $(KEYMAP_PATH)/$(BUILD_DIR)) +endif + # Create build directory $(shell mkdir $(BUILD_DIR) 2>/dev/null) @@ -508,7 +491,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) # Listing of phony targets. -.PHONY : all quick begin finish end sizebefore sizeafter gccversion \ +.PHONY : all quick finish sizebefore sizeafter gccversion \ build elf hex eep lss sym coff extcoff \ clean clean_list debug gdb-config show_path \ program teensy dfu flip dfu-ee flip-ee dfu-start \ -- cgit v1.2.3-24-g4f1b From ccebceeb6f24aeee102f6ef3180f4f563ca025a8 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 8 Jul 2016 17:44:41 +0300 Subject: Don't run git describe for ever file that is built --- tmk_core/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 5bae0d762..aa05b9491 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -107,7 +107,7 @@ endif # Version string -OPT_DEFS += -DVERSION=$(shell (git describe --always --dirty || echo 'unknown') 2> /dev/null) +OPT_DEFS += -DVERSION=$(GIT_VERSION) # Bootloader address ifdef STM32_BOOTLOADER_ADDRESS -- cgit v1.2.3-24-g4f1b From 1e3db59097f8c396d69179fdd66ef0131a6ba80d Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 8 Jul 2016 18:18:33 +0300 Subject: Fix the link target --- tmk_core/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index a518fc0c3..543d3da8a 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -365,7 +365,7 @@ gccversion : .PRECIOUS : $(OBJ) %.elf: gccversion sizebefore check_submodule $(OBJ) @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) - $(eval CMD=$(CC) $(ALL_CFLAGS) $(OBJ) --output $@ $(LDFLAGS)) + $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out gccversion sizebefore check_submodule,$^) --output $@ $(LDFLAGS)) @$(BUILD_CMD) # Compile: create object files from C source files. -- cgit v1.2.3-24-g4f1b From e8e300d5c4dd05b806869b648b93feeff1f8a7dc Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 8 Jul 2016 22:59:09 +0300 Subject: Fix name of makefile dep files The files can't start with a .dot, as the wildcard function wont find them. So this is fixed by removing the BUILD_DIR from the name. --- tmk_core/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 543d3da8a..8d843cc98 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -260,7 +260,7 @@ LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst # Compiler flags to generate dependency files. #GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d -GENDEPFLAGS = -MMD -MP -MF $(BUILD_DIR)/.dep/$(subst /,_,$@).d +GENDEPFLAGS = -MMD -MP -MF $(BUILD_DIR)/.dep/$(subst /,_,$(subst $(BUILD_DIR)/,,$@)).d # Combine all necessary flags and optional flags. -- cgit v1.2.3-24-g4f1b From 6911ead027202da981862c9259ff4d962d51a519 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 8 Jul 2016 23:19:48 +0300 Subject: Use order only prerequisites to avoid re-linking The prerequisites at the start of the build process are order-only so that the trget don't link again. Also added as a dependency to the compilation to force the messages to be printed at the start --- tmk_core/rules.mk | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 8d843cc98..f13351ea1 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -360,49 +360,51 @@ gccversion : $(eval CMD=$(AR) $@ $(OBJ) ) @$(BUILD_CMD) +BEGIN = gccversion check_submodule sizebefore + # Link: create ELF output file from object files. .SECONDARY : $(BUILD_DIR)/$(TARGET).elf .PRECIOUS : $(OBJ) -%.elf: gccversion sizebefore check_submodule $(OBJ) +%.elf: $(OBJ) | $(BEGIN) @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) - $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out gccversion sizebefore check_submodule,$^) --output $@ $(LDFLAGS)) + $(eval CMD=$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)) @$(BUILD_CMD) # Compile: create object files from C source files. -$(OBJDIR)/%.o : %.c +$(OBJDIR)/%.o : %.c | $(BEGIN) @mkdir -p $(@D) @$(SILENT) || printf "$(MSG_COMPILING) $<" | $(AWK_CMD) $(eval CMD=$(CC) -c $(ALL_CFLAGS) $< -o $@) @$(BUILD_CMD) # Compile: create object files from C++ source files. -$(OBJDIR)/%.o : %.cpp +$(OBJDIR)/%.o : %.cpp | $(BEGIN) @mkdir -p $(@D) @$(SILENT) || printf "$(MSG_COMPILING_CPP) $<" | $(AWK_CMD) $(eval CMD=$(CC) -c $(ALL_CPPFLAGS) $< -o $@) @$(BUILD_CMD) # Compile: create assembler files from C source files. -%.s : %.c +%.s : %.c | $(BEGIN) @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD) $(eval CMD=$(CC) -S $(ALL_CFLAGS) $< -o $@) @$(BUILD_CMD) # Compile: create assembler files from C++ source files. -%.s : %.cpp +%.s : %.cpp | $(BEGIN) @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD) $(eval CMD=$(CC) -S $(ALL_CPPFLAGS) $< -o $@) @$(BUILD_CMD) # Assemble: create object files from assembler source files. -$(OBJDIR)/%.o : %.S +$(OBJDIR)/%.o : %.S | $(BEGIN) @mkdir -p $(@D) @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD) $(eval CMD=$(CC) -c $(ALL_ASFLAGS) $< -o $@) @$(BUILD_CMD) # Create preprocessed source for use in sending a bug report. -%.i : %.c +%.i : %.c | $(BEGIN) $(CC) -E -mmcu=$(MCU) $(CFLAGS) $< -o $@ # Target: clean project. @@ -492,7 +494,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) # Listing of phony targets. .PHONY : all quick finish sizebefore sizeafter gccversion \ -build elf hex eep lss sym coff extcoff \ +build elf hex eep lss sym coff extcoff check_submodule \ clean clean_list debug gdb-config show_path \ program teensy dfu flip dfu-ee flip-ee dfu-start \ all-keyboards-defaults all-keyboards all-keymaps \ -- cgit v1.2.3-24-g4f1b From c444f4f702739633b11e548575cdbe8369d0a98b Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Fri, 8 Jul 2016 21:40:57 -0400 Subject: Documents tap dance --- readme.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/readme.md b/readme.md index e87481251..3657d2c15 100644 --- a/readme.md +++ b/readme.md @@ -353,6 +353,81 @@ void matrix_scan_user(void) { As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS` and `SEQ_THREE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously. +### Tap Dance: A single key can do 3, 5, or 100 different things + +Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/jackhumbert/qmk_firmware/pull/451). Here's how Algernon describes the feature: + +With this feature one can specify keys that behave differently, based on the amount of times they have been tapped, and when interrupted, they get handled before the interrupter. + +To make it clear how this is different from `ACTION_FUNCTION_TAP`, lets explore a certain setup! We want one key to send `Space` on single tap, but `Enter` on double-tap. + +With `ACTION_FUNCTION_TAP`, it is quite a rain-dance to set this up, and has the problem that when the sequence is interrupted, the interrupting key will be send first. Thus, `SPC a` will result in `a SPC` being sent, if they are typed within `TAPPING_TERM`. With the tap dance feature, that'll come out as `SPC a`, correctly. + +The implementation hooks into two parts of the system, to achieve this: into `process_record_quantum()`, and the matrix scan. We need the latter to be able to time out a tap sequence even when a key is not being pressed, so `SPC` alone will time out and register after `TAPPING_TERM` time. + +But lets start with how to use it, first! + +First, you will need `TAP_DANCE_ENABLE=yes` in your `Makefile`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array. + +This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are two possible options: + +* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. +* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the current state of the tap-dance action. + +The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. + +And that's the bulk of it! + +Do note, however, that this implementation does have some consequences: keys do not register until either they reach the tapping ceiling, or they time out. This means that if you hold the key, nothing happens, no repeat, no nothing. It is possible to detect held state, and register an action then too, but that's not implemented yet. Keys also unregister immediately after being registered, so you can't even hold the second tap. This is intentional, to be consistent. + +And now, on to the explanation of how it works! + +The main entry point is `process_tap_dance()`, called from `process_record_quantum()`, which is run for every keypress, and our handler gets to run early. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. If it was the same, we increment the counter and the timer. + +This means that you have `TAPPING_TERM` time to tap the key again, you do not have to input all the taps within that timeframe. This allows for longer tap counts, with minimal impact on responsiveness. + +Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-dance keys. + +For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros. + +In the end, let's see a full example! + +```c +enum { + CT_SE = 0, + CT_CLN, + CT_EGG +}; + +/* Have the above three on the keymap, TD(CT_SE), etc... */ + +void dance_cln (qk_tap_dance_state_t *state) { + if (state->count == 1) { + register_code (KC_RSFT); + register_code (KC_SCLN); + unregister_code (KC_SCLN); + unregister_code (KC_RSFT); + } else { + register_code (KC_SCLN); + unregister_code (KC_SCLN); + reset_tap_dance (state); + } +} + +void dance_egg (qk_tap_dance_state_t *state) { + if (state->count >= 100) { + SEND_STRING ("Safety dance!"); + reset_tap_dance (state); + } +} + +const qk_tap_dance_action_t tap_dance_actions[] = { + [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) + ,[CT_CLN] = ACTION_TAP_DANCE_FN (dance_cln) + ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) +}; +``` + ### Temporarily setting the default layer `DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does. -- cgit v1.2.3-24-g4f1b From 1ab527a4dbf6ad14c04b07dc6190470c8119b030 Mon Sep 17 00:00:00 2001 From: Max Whittingham Date: Sat, 9 Jul 2016 03:20:58 -0500 Subject: Cleaning up repo --- keyboards/gh60/keymaps/robotmaxtron/Makefile | 112 ++++++++++ .../gh60/keymaps/robotmaxtron/WS2812-wiring.jpg | Bin 0 -> 1038926 bytes keyboards/gh60/keymaps/robotmaxtron/config.h | 190 +++++++++++++++++ keyboards/gh60/keymaps/robotmaxtron/keymap.c | 228 +++++++++++++++++++++ keyboards/gh60/keymaps/robotmaxtron/readme.md | 16 ++ 5 files changed, 546 insertions(+) create mode 100644 keyboards/gh60/keymaps/robotmaxtron/Makefile create mode 100644 keyboards/gh60/keymaps/robotmaxtron/WS2812-wiring.jpg create mode 100644 keyboards/gh60/keymaps/robotmaxtron/config.h create mode 100644 keyboards/gh60/keymaps/robotmaxtron/keymap.c create mode 100644 keyboards/gh60/keymaps/robotmaxtron/readme.md diff --git a/keyboards/gh60/keymaps/robotmaxtron/Makefile b/keyboards/gh60/keymaps/robotmaxtron/Makefile new file mode 100644 index 000000000..2e69aee29 --- /dev/null +++ b/keyboards/gh60/keymaps/robotmaxtron/Makefile @@ -0,0 +1,112 @@ +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +# CONSOLE_ENABLE ?= yes # Console for debug(+400) +# COMMAND_ENABLE ?= yes # Commands for debug and configuration +KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# 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 +# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +# MIDI_ENABLE ?= YES # MIDI controls +# UNICODE_ENABLE ?= YES # Unicode +# BLUETOOTH_ENABLE ?= yes # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= yes # Enable RGB Underglow + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + diff --git a/keyboards/gh60/keymaps/robotmaxtron/WS2812-wiring.jpg b/keyboards/gh60/keymaps/robotmaxtron/WS2812-wiring.jpg new file mode 100644 index 000000000..4ab8cc31a Binary files /dev/null and b/keyboards/gh60/keymaps/robotmaxtron/WS2812-wiring.jpg differ diff --git a/keyboards/gh60/keymaps/robotmaxtron/config.h b/keyboards/gh60/keymaps/robotmaxtron/config.h new file mode 100644 index 000000000..8272875ed --- /dev/null +++ b/keyboards/gh60/keymaps/robotmaxtron/config.h @@ -0,0 +1,190 @@ +/* +Copyright 2012 Jun Wako + +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 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER geekhack +#define PRODUCT GH60 +#define DESCRIPTION t.m.k. keyboard firmware for GH60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + #define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +// Rev A +// #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B0, B5, B4, D7, D6, B3 } +// Rev B/C + #define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B7, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * RGB Underglow + * These settings are for the F4 by default: + * + * + * #define ws2812_PORTREG PORTF + * #define ws2812_DDRREG DDRF + * #define ws2812_pin PF4 + * #define RGBLED_NUM 14 // Number of LEDs + * #define RGBLIGHT_HUE_STEP 10 + * #define RGBLIGHT_SAT_STEP 17 + * #define RGBLIGHT_VAL_STEP 17 + * + * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. + * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. + * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c +*/ + +/* Deprecated code below +#define ws2812_PORTREG PORTF +#define ws2812_DDRREG DDRF +#define ws2812_pin PF4 +*/ +#define RGB_DI_PIN F4 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/gh60/keymaps/robotmaxtron/keymap.c b/keyboards/gh60/keymaps/robotmaxtron/keymap.c new file mode 100644 index 000000000..54cb2747f --- /dev/null +++ b/keyboards/gh60/keymaps/robotmaxtron/keymap.c @@ -0,0 +1,228 @@ +#include "gh60.h" +#include "action_layer.h" + +#define _BL 0 +#define _AL 1 +#define _FL 2 +#define _UL 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * Base layer, pretty standard ANSI layout. + * ,-----------------------------------------------------------. + * |FN12| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Caps/Fn| A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Fn |Menu|Ctrl| + * `-----------------------------------------------------------' + */ + [_BL] = KEYMAP( + FN12,1,2,3,4,5,6,7,8,9,0,MINS,EQL,BSPC, \ + TAB,Q,W,E,R,T,Y,U,I,O,P,LBRC,RBRC,BSLS, \ + FN2,A,S,D,F,G,H,J,K,L,SCLN,QUOT,NO,ENT, \ + LSFT,NO,Z,X,C,V,B,N,M,COMM,DOT,SLSH,NO,RSFT, \ + LCTL,LGUI,LALT, SPC, NO,RALT,FN0,APP, RCTL), + + /* + * Locking arrow keys to WASD for when you need dedicated arrow keys + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | |Up | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | |Left|Down|Rght| | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + [_AL] = KEYMAP( + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,UP,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), + + + /* + * Primary function layer, mostly the same as the traditional Pok3r layout. + * ,-------------------------------------------------------------. + * |`~ | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|DEL | + * |-------------------------------------------------------------| + * | |_AL| | | | |Calc|PgUp|Up|PgDn|Ptscn|Srlck|Pause| | + * |-------------------------------------------------------------| + * | | | | | | |Home|Left|Down|Rght|Ins| | | + * |-------------------------------------------------------------| + * | |_UL| | | | | | | | | | | + * |-------------------------------------------------------------| + * | | | | | | | | | + * `-------------------------------------------------------------' + */ + [_FL] = KEYMAP( + GRAVE,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12, DELETE, \ + TRNS,FN1,TRNS,TRNS,TRNS,TRNS,CALC,PGUP,UP,PGDN,PSCR,SLCK,PAUS,TRNS, \ + TRNS,MUTE,_VOLDOWN,_VOLUP,TRNS,TRNS,HOME,LEFT,DOWN,RGHT,INS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,FN3,TRNS,TRNS,TRNS,TRNS,END,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), + + /* + * Locking layer for controlling the underglow. + * + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | |On|Mode| | | | | | | | | | | + * |-----------------------------------------------------------| + * | | |Hue+|Hue-|Sat+|Sat-|Val+|Val-| | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + [_UL] = KEYMAP( + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,FN4,FN5,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,FN6,FN7,FN8,FN9,FN10,FN11,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), +}; + +enum function_id { + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(2), // Momentary Fn overlay + [1] = ACTION_LAYER_TOGGLE(1), // Toggle Arrow Layer overlay + [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer + [3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay + [4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow + [5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode + [6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [10] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [11] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + [12] = ACTION_FUNCTION(SHIFT_ESC), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + // This is some kind of macro code, haven't quite figured it out yet. + // Todo: Figure out macro coding here + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +void matrix_scan_user(void) { + +// Layer LED indicators +// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster +// Todo: Caps lock led on when caps lock is enabled + uint32_t layer = layer_state; + if (layer & (1<<1)) { + gh60_wasd_leds_on(); + } else { + gh60_wasd_leds_off(); + } + + if (layer & (1<<2)) { + gh60_esc_led_on(); + } else { + gh60_esc_led_off(); + } +}; + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case RGBLED_TOGGLE: + //led operations + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + static uint8_t shift_esc_shift_mask; + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +}; diff --git a/keyboards/gh60/keymaps/robotmaxtron/readme.md b/keyboards/gh60/keymaps/robotmaxtron/readme.md new file mode 100644 index 000000000..3e2292500 --- /dev/null +++ b/keyboards/gh60/keymaps/robotmaxtron/readme.md @@ -0,0 +1,16 @@ +robotmaxtron's GH60 Layout +===================== + +##Quantum MK Firmware +For the full Quantum feature list, see the parent readme.md. + +* Standard ANSI layout with Pok3r styled function layers +* ESC key led enables when on function layer +* Lockable layer with arrow keys on WASD with backlighting to indicate locked on arrow layer +* Neopixel/WS2812 RGB Underglow Support + +## Reference Images +![Wiring Refererence] (WS2812-wiring.jpg) + +### Additional Credits +Keymap has been based on various keymaps available from the QMK Repo for the GH60-SATAN and KC60 keyboards. -- cgit v1.2.3-24-g4f1b From 979a0d25f0092ecf181f753bac71ed4528dc2be5 Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Sat, 9 Jul 2016 16:42:26 -0400 Subject: Establish Poker clone keymap for Satan Maps all of the side-print legends on the stock Poker II keycaps that are feasible (doesn't support repeat rate toggling, Pmode recording). --- keyboards/satan/keymaps/poker/keymap.c | 116 +++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 keyboards/satan/keymaps/poker/keymap.c diff --git a/keyboards/satan/keymaps/poker/keymap.c b/keyboards/satan/keymaps/poker/keymap.c new file mode 100644 index 000000000..8181955cf --- /dev/null +++ b/keyboards/satan/keymaps/poker/keymap.c @@ -0,0 +1,116 @@ +#include "satan.h" + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 +#define _RL 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * `-----------------------------------------------------------' + */ +[_BL] = KEYMAP( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, MO(_RL), MO(_FL), KC_RCTL), + +/* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | ~ | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | + * |-----------------------------------------------------------| + * | | Up| | | | |Cal| |Ins| |PrSc|Sclk|Paus| | + * |-----------------------------------------------------------| + * | |Left|Down|Rig| | | | | | |Home|PgUp| | + * |-----------------------------------------------------------| + * | | |App| | | |Vdn|Vup|Mute|End|PgDn| | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ +[_FL] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS,KC_TRNS, KC_UP, KC_TRNS,KC_TRNS,KC_TRNS, KC_CALC,KC_TRNS,KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ + KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + /* Keymap _RL: Function Layer + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | RESET| + * |-----------------------------------------------------------| + * | | | | | | | | | | | |BL-|BL+|BL | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ +[_RL] = KEYMAP( + #ifdef RGBLIGHT_ENABLE + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #else + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #endif +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} -- cgit v1.2.3-24-g4f1b From df958a2dbc8b8ca19d57e7f4588656df40bb71f1 Mon Sep 17 00:00:00 2001 From: Max Whittingham Date: Sat, 9 Jul 2016 18:58:16 -0500 Subject: Update keymap.c --- keyboards/gh60/keymaps/robotmaxtron/keymap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keyboards/gh60/keymaps/robotmaxtron/keymap.c b/keyboards/gh60/keymaps/robotmaxtron/keymap.c index 54cb2747f..263eec4e5 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/keymap.c +++ b/keyboards/gh60/keymaps/robotmaxtron/keymap.c @@ -125,8 +125,6 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function - // This is some kind of macro code, haven't quite figured it out yet. - // Todo: Figure out macro coding here switch(id) { case 0: if (record->event.pressed) { @@ -143,7 +141,6 @@ void matrix_scan_user(void) { // Layer LED indicators // ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster -// Todo: Caps lock led on when caps lock is enabled uint32_t layer = layer_state; if (layer & (1<<1)) { gh60_wasd_leds_on(); @@ -204,6 +201,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { } break; static uint8_t shift_esc_shift_mask; + // Shift + ESC = ~ case SHIFT_ESC: shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; if (record->event.pressed) { -- cgit v1.2.3-24-g4f1b From c7728780dee32d3f5e63e13ffad44600492e45d6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 20:00:04 +0300 Subject: Remove out of place documentation, caused by ChibiOS merge --- readme.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/readme.md b/readme.md index e87481251..f7b43d64f 100644 --- a/readme.md +++ b/readme.md @@ -24,9 +24,6 @@ The project also includes community support for [lots of other keyboards](/keybo QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). This repo used to be a fork of [TMK](https://github.com/tmk/tmk_keyboard), and we are incredibly grateful for his founding contributions to the firmware. We've had to break the fork due to purely technical reasons - it simply became too different over time, and we've had to start refactoring some of the basic bits and pieces. We are huge fans of TMK and Hasu :) This documentation is edited and maintained by Erez Zukerman of ErgoDox EZ. If you spot any typos or inaccuracies, please [open an issue](https://github.com/jackhumbert/qmk_firmware/issues/new). -#### 2016/02/10 -core: flabbergast's Chibios protocol was merged from (@72b1668). See [tmk_core/protocol/chibios/README.md](tmk_core/protocol/chibios/README.md). Chibios protocol supports Cortex-M such as STM32 and Kinetis. - The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), and the Clueboard by [Zach White](https://github.com/skullydazed). -- cgit v1.2.3-24-g4f1b From 753cbee5c06d352ef185dc624cf1152d046b58b6 Mon Sep 17 00:00:00 2001 From: Stanley Lai Date: Sun, 10 Jul 2016 12:07:56 -0700 Subject: Added my custom keymap for Satan --- keyboards/satan/keymaps/stanleylai/config.h | 20 +++++++ keyboards/satan/keymaps/stanleylai/keymap.c | 84 +++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 keyboards/satan/keymaps/stanleylai/config.h create mode 100644 keyboards/satan/keymaps/stanleylai/keymap.c diff --git a/keyboards/satan/keymaps/stanleylai/config.h b/keyboards/satan/keymaps/stanleylai/config.h new file mode 100644 index 000000000..ae2bd36db --- /dev/null +++ b/keyboards/satan/keymaps/stanleylai/config.h @@ -0,0 +1,20 @@ +#include "../../config.h" + +// USB Device descriptor parameter +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Custom +#define PRODUCT GH60 rev.CHN +#define DESCRIPTION QMK keyboard firmware for GH60 with WS2812 support + +// Backlight configuration +#define BACKLIGHT_LEVELS 3 + +// Underlight configuration +#define RGB_DI_PIN E2 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 6 // Number of LEDs +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/satan/keymaps/stanleylai/keymap.c b/keyboards/satan/keymaps/stanleylai/keymap.c new file mode 100644 index 000000000..623427e97 --- /dev/null +++ b/keyboards/satan/keymaps/stanleylai/keymap.c @@ -0,0 +1,84 @@ +#include "satan.h" + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 +#define _RGBL 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// See base_layer.png and rgb_layer.png for layout reference + +// Base Default Layer +// Mac Modifier Layout. Use BootMagic to toggle GUI and ALT positions. +[_BL] = KEYMAP_HHKB( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NO, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + LT(_FL, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(_FL), \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + +// Function layer +[_FL] = KEYMAP_HHKB( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, \ + KC_NO, KC_MPRV, KC_UP, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LT(_RGBL, KC_PGUP), KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + +// RGB Layer +[_RGBL] = KEYMAP_HHKB( + #ifdef RGBLIGHT_ENABLE + RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_NO, KC_NO, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #else + RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #endif +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} -- cgit v1.2.3-24-g4f1b From b12fe6abb25db1feca6a7649097a8d1cb67a063f Mon Sep 17 00:00:00 2001 From: Smilliam Date: Sun, 10 Jul 2016 19:04:01 -0700 Subject: Made rollover behavior for space cadet optional --- keyboards/kc60/Makefile | 4 ++-- keyboards/kc60/config.h | 6 ++++++ quantum/quantum.c | 20 ++++++++++++-------- readme.md | 6 ++++++ 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/keyboards/kc60/Makefile b/keyboards/kc60/Makefile index 9717b519c..855e81b1c 100644 --- a/keyboards/kc60/Makefile +++ b/keyboards/kc60/Makefile @@ -53,11 +53,11 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +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 ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration +COMMAND_ENABLE ?= no # Commands for debug and configuration KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend diff --git a/keyboards/kc60/config.h b/keyboards/kc60/config.h index c4a9b9ff8..a315f688f 100644 --- a/keyboards/kc60/config.h +++ b/keyboards/kc60/config.h @@ -107,6 +107,12 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* Prevent stuck modifiers when switching between FN layers */ +#define PREVENT_STUCK_MODIFIERS + +/* Enable opposite shift key to cancel space cadet state */ +#define DISABLE_SPACE_CADET_ROLLOVER + /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true diff --git a/quantum/quantum.c b/quantum/quantum.c index 71c3c723b..d91b8f2d0 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -162,10 +162,12 @@ bool process_record_quantum(keyrecord_t *record) { register_mods(MOD_BIT(KC_LSFT)); } else { - if (get_mods() & MOD_BIT(KC_RSFT)) { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - } + #ifdef DISABLE_SPACE_CADET_ROLLOVER + if (get_mods() & MOD_BIT(KC_RSFT)) { + shift_interrupted[0] = true; + shift_interrupted[1] = true; + } + #endif if (!shift_interrupted[0]) { register_code(LSPO_KEY); unregister_code(LSPO_KEY); @@ -182,10 +184,12 @@ bool process_record_quantum(keyrecord_t *record) { register_mods(MOD_BIT(KC_RSFT)); } else { - if (get_mods() & MOD_BIT(KC_LSFT)) { - shift_interrupted[0] = true; - shift_interrupted[1] = true; - } + #ifdef DISABLE_SPACE_CADET_ROLLOVER + if (get_mods() & MOD_BIT(KC_LSFT)) { + shift_interrupted[0] = true; + shift_interrupted[1] = true; + } + #endif if (!shift_interrupted[1]) { register_code(RSPC_KEY); unregister_code(RSPC_KEY); diff --git a/readme.md b/readme.md index c24d951d8..cc36a34ff 100644 --- a/readme.md +++ b/readme.md @@ -309,6 +309,12 @@ It's defaulted to work on US keyboards, but if your layout uses different keys f #define LSPO_KEY KC_9 #define RSPC_KEY KC_0 +You can also choose between different rollover behaviors of the shift keys by defining: + + #define DISABLE_SPACE_CADET_ROLLOVER + +in your `config.h`. Disabling rollover allows you to use the opposite shift key to cancel the space cadet state in the event of an erroneous press instead of emitting a pair of parentheses when the keys are released. + The only other thing you're going to want to do is create a `Makefile` in your keymap directory and set the following: ``` -- cgit v1.2.3-24-g4f1b From 5e58e2281ad872048719b2c142169f3e8103af26 Mon Sep 17 00:00:00 2001 From: Smilliam Date: Sun, 10 Jul 2016 19:10:00 -0700 Subject: amended extraneous file edits --- keyboards/kc60/Makefile | 2 +- keyboards/kc60/config.h | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/keyboards/kc60/Makefile b/keyboards/kc60/Makefile index 855e81b1c..b00a488b9 100644 --- a/keyboards/kc60/Makefile +++ b/keyboards/kc60/Makefile @@ -57,7 +57,7 @@ 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 ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration +COMMAND_ENABLE ?= yes # Commands for debug and configuration KEYBOARD_LOCK_ENABLE ?= yes # Allow locking of keyboard via magic key # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend diff --git a/keyboards/kc60/config.h b/keyboards/kc60/config.h index a315f688f..c4a9b9ff8 100644 --- a/keyboards/kc60/config.h +++ b/keyboards/kc60/config.h @@ -107,12 +107,6 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* Prevent stuck modifiers when switching between FN layers */ -#define PREVENT_STUCK_MODIFIERS - -/* Enable opposite shift key to cancel space cadet state */ -#define DISABLE_SPACE_CADET_ROLLOVER - /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true //#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -- cgit v1.2.3-24-g4f1b From cb0e102adb4a8accd4f7210153cbcc3e5fa183ac Mon Sep 17 00:00:00 2001 From: Ruiqi Mao Date: Mon, 11 Jul 2016 01:18:07 -0700 Subject: fixed clueboard LED pin assignments and matrix documentation --- keyboards/clueboard/clueboard.c | 16 ---------------- keyboards/clueboard/rev1/rev1.c | 16 ++++++++++++++++ keyboards/clueboard/rev2/rev2.c | 16 ++++++++++++++++ keyboards/clueboard/rev2/rev2.h | 2 +- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/keyboards/clueboard/clueboard.c b/keyboards/clueboard/clueboard.c index 13195bda6..3435202ba 100644 --- a/keyboards/clueboard/clueboard.c +++ b/keyboards/clueboard/clueboard.c @@ -1,17 +1 @@ #include "clueboard.h" - -void led_init_ports() { - // * Set our LED pins as output - DDRB |= (1<<4); -} - -void led_set_kb(uint8_t usb_led) { - DDRF |= (1<<0); - if (usb_led & (1< Date: Wed, 13 Jul 2016 16:38:02 +0200 Subject: extract reset keyboard into a function that makes it easy to call reset_keyboard() from a function in a keymap --- quantum/quantum.c | 24 ++++++++++++++---------- quantum/quantum.h | 2 ++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index d5b9753b7..bc2da510f 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -15,6 +15,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +void reset_keyboard(void) { + clear_keyboard(); +#ifdef AUDIO_ENABLE + stop_all_notes(); + shutdown_user(); +#endif + wait_ms(250); +#ifdef CATERINA_BOOTLOADER + *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific +#endif + bootloader_jump(); +} + // Shift / paren setup #ifndef LSPO_KEY @@ -83,16 +96,7 @@ bool process_record_quantum(keyrecord_t *record) { switch(keycode) { case RESET: if (record->event.pressed) { - clear_keyboard(); - #ifdef AUDIO_ENABLE - stop_all_notes(); - shutdown_user(); - #endif - wait_ms(250); - #ifdef CATERINA_BOOTLOADER - *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific - #endif - bootloader_jump(); + reset_keyboard(); } return false; break; diff --git a/quantum/quantum.h b/quantum/quantum.h index 3a0b74202..7ebfb24e3 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -77,6 +77,8 @@ bool process_action_kb(keyrecord_t *record); bool process_record_kb(uint16_t keycode, keyrecord_t *record); bool process_record_user(uint16_t keycode, keyrecord_t *record); +void reset_keyboard(void); + void startup_user(void); void shutdown_user(void); -- cgit v1.2.3-24-g4f1b From 8f3cdea35706d03c1049c2d510340360930d70ba Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Wed, 13 Jul 2016 13:17:55 -0700 Subject: Created "teckinesis" keymap folder (Based on "ordinary" keymap by Nicholas Keene) --- keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 454 +++++++++++++++++++++ .../keymaps/teckinesis/ordinary-base.png | Bin 0 -> 99605 bytes .../keymaps/teckinesis/ordinary-base.txt | 27 ++ .../keymaps/teckinesis/ordinary-media.png | Bin 0 -> 124144 bytes .../keymaps/teckinesis/ordinary-media.txt | 27 ++ .../keymaps/teckinesis/ordinary-special.png | Bin 0 -> 63065 bytes .../keymaps/teckinesis/ordinary-special.txt | 27 ++ .../keymaps/teckinesis/ordinary-symbol.png | Bin 0 -> 103735 bytes .../keymaps/teckinesis/ordinary-symbol.txt | 27 ++ keyboards/ergodox_ez/keymaps/teckinesis/readme.md | 103 +++++ 10 files changed, 665 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/keymap.c create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.png create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.txt create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.png create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.txt create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.png create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.txt create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.png create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.txt create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/readme.md diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c new file mode 100644 index 000000000..778cbc63c --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c @@ -0,0 +1,454 @@ +#include "ergodox_ez.h" +#include "led.h" +#include "debug.h" +#include "action_layer.h" +#include "action_util.h" +#include "mousekey.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols layer +#define MDIA 2 // media layer +#define SPEC 3 // special layer + +#define LCaps 10 // left caps-shift key +#define LSymb 11 // left symbol-shift key +#define LMdia 12 // left media-shift key +#define LSpec 13 // left special-shift key +#define RCaps 14 // right caps-shift key +#define RSymb 15 // right symbol-shift key +#define RMdia 16 // right media-shift key +#define RSpec 17 // right special-shift key + +#define MUL 20 // mouse up left +#define MUR 21 // mouse up right +#define MDL 22 // mouse down left +#define MDR 23 // mouse down right + +/* + * The Ordinary Layout for the Ergodox EZ keyboard, v4 + * + * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com + * + * No rights reserved. This software is in the public domain. + * Credit me if you are friendly but if you're a jerk don't bother. + * + * Details: readme.md + * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/******* Base Layer ******************************************************************************************************** + * + * ,------------------------------------------------------. ,------------------------------------------------------. + * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | + * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| + * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | + * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| + * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | + * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| + * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | + * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' + * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | Home | End | | Left | Right| + * ,------|------|------| |------+------+------. + * | | | PgUp | | Up | | | + * |Backsp| Del |------| |------| Enter| Space| + * | | | PgDn | | Down | | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// left hand + F(LSpec),KC_1,KC_2,KC_3 ,KC_4 ,KC_5 ,KC_ESC +,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC +,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G +,M(LCaps) ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) +,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT,KC_LGUI + ,KC_HOME,KC_END + ,KC_PGUP + ,KC_BSPC,KC_DEL ,KC_PGDN + // right hand + ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) + ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) + ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) + ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) + ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL + ,KC_LEFT ,KC_RGHT + ,KC_UP + ,KC_DOWN ,KC_ENT ,KC_SPC + ), + +/******* Symbols Layer ***************************************************************************************************** + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | + * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| + * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | LCtrl | Meh |Hyper | LAlt | LGui | |RGui/0|RAlt/.|Hypr/=|Meh/+ |RCtrl/Ent| + * `-----------------------------------' `-------------------------------------' + * ,-------------. ,-------------. + * | Left | Right| | Home | End | + * ,------|------|------| |------+------+------. + * | | | Up | | PgUp | | | + * |Space |Enter |------| |------|BackSp| Del | + * | | | Down | | PgDn | | | + * `--------------------' `--------------------' + */ +[SYMB] = KEYMAP( +// left hand + KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC +,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) +,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV +,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB +,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT ,KC_LGUI + ,KC_LEFT ,KC_RGHT + ,KC_UP + ,KC_SPC ,KC_ENT ,KC_DOWN + // right hand + ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS + ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS + ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS + ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS + ,GUI_T(KC_0),ALT_T(KC_DOT),ALL_T(KC_EQL),MEH_T(KC_PLUS),CTL_T(KC_ENT) + ,KC_HOME ,KC_END + ,KC_PGUP + ,KC_PGDN ,KC_BSPC ,KC_DEL +), + +/******* Media Layer ******************************************************************************************************* + * + * ,---------------------------------------------------------------. ,---------------------------------------------------------------. + * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | + * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| + * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | + * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| + * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | + * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| + * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | + * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' + * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| + * `---------------------------------------------' `---------------------------------------------' + * ,-------------. ,-------------. + * | Stop |Refrsh| | Prev | Next | + * ,------|------|------| |------+------+------. + * |Brwser|Brwser|Search| |VolUp | | | + * |Back | Fwd |------| |------| Stop | Play-| + * | | | Home | |VolDn | | Pause| + * `--------------------' `--------------------' + */ +[MDIA] = KEYMAP( +// left hand + KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC +,KC_TRNS ,KC_POWER ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U +,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD +,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D +,KC_LCTL ,KC_MEH ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 + ,KC_WSTP ,KC_WREF + ,KC_WSCH + ,KC_WBAK ,KC_NO ,KC_WHOM + // right hand + ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS + ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS + ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS + ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS + ,GUI_T(KC_INS),ALT_T(KC_DEL),KC_HYPR ,KC_MEH ,KC_RCTL + ,KC_MPRV ,KC_MNXT + ,KC_VOLU + ,KC_VOLD ,KC_MSTP ,KC_MPLY +), + +/******* Special Layer ***************************************************************************************************** + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | Esc | | | | | | | | | | | | Bspc | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | RShift | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[SPEC] = KEYMAP( +// left hand + KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS,KC_TRNS ,KC_TRNS + // right hand + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_BSPC ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_RSFT + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + // the faux shift keys are implemented as macro taps + [LCaps] = ACTION_MACRO_TAP(LCaps) + ,[LSymb] = ACTION_MACRO_TAP(LSymb) + ,[LMdia] = ACTION_MACRO_TAP(LMdia) + ,[LSpec] = ACTION_MACRO_TAP(LSpec) + ,[RCaps] = ACTION_MACRO_TAP(RCaps) + ,[RSymb] = ACTION_MACRO_TAP(RSymb) + ,[RMdia] = ACTION_MACRO_TAP(RMdia) + ,[RSpec] = ACTION_MACRO_TAP(RSpec) +}; + +uint16_t caps_shift = 0; +uint16_t symb_shift = 0; +uint16_t mdia_shift = 0; + +bool symb_lock = false; +bool mdia_lock = false; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + // There are two shift keys for each layer so we increment a layer_shift var when one + // is pressed and decrement when one is released. If both are pressed at the same time + // then the layer is locked (or unlocked). The shift counts are bound between 0 and 2 + // only because sometimes rapid pressing led to irregular events; this way the states + // are self healing during use. + + case LCaps: // both caps-shift keys trigger Left Shift + case RCaps: // so they don't interfere with the magic combo + if (record->event.pressed && !record->tap.count) { + if(++caps_shift > 2) caps_shift = 2; + if(caps_shift == 2) { + register_code(KC_CAPS); + unregister_code(KC_CAPS); + } else if(caps_shift == 1) { + register_code(KC_LSFT); + } + } else { + if(--caps_shift < 0) caps_shift = 0; + if(caps_shift == 0) unregister_code(KC_LSFT); + } + break; + + case LSymb: + if (record->event.pressed) { + if(++symb_shift > 2) symb_shift = 2; + if(symb_shift == 2) { + symb_lock = !symb_lock; + } else if(symb_shift == 1) { + layer_on(SYMB); + } + } else { + if(--symb_shift < 0) symb_shift = 0; + if((symb_shift == 0) && (!symb_lock)) layer_off(SYMB); + } + break; + + case LMdia: + if (record->event.pressed) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + register_code(KC_TAB); + } else { + if(++mdia_shift > 2) mdia_shift = 2; + if(mdia_shift == 2) { + mdia_lock = !mdia_lock; + } else if(mdia_shift == 1) { + layer_on(MDIA); + } + } + } else { + if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + unregister_code(KC_TAB); + } else { + if(--mdia_shift < 0) mdia_shift = 0; + if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); + } + } + break; + + case LSpec: + if (record->event.pressed) { + if (record->tap.count && !record->tap.interrupted) { + register_code(KC_GRV); + } else { + layer_on(SPEC); + } + } else { + if(record->tap.count && !record->tap.interrupted) { + unregister_code(KC_GRV); + } else { + layer_off(SPEC); + } + } + break; + + case RSymb: + if (record->event.pressed) { + if (record->tap.count && (!symb_shift) && (!symb_lock)) { + register_code(KC_QUOT); + } else { + if(++symb_shift > 2) symb_shift = 2; + if(symb_shift == 2) { + symb_lock = !symb_lock; + } else if(symb_shift == 1) { + layer_on(SYMB); + } + } + } else { + if(record->tap.count && symb_shift == 0) { + unregister_code(KC_QUOT); + } else { + if(--symb_shift < 0) symb_shift = 0; + if((!symb_shift) && (!symb_lock)) layer_off(SYMB); + } + } + break; + + case RMdia: + if (record->event.pressed) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + register_code(KC_BSLS); + } else { + if(++mdia_shift > 2) mdia_shift = 2; + if(mdia_shift == 2) { + mdia_lock = !mdia_lock; + } else if(mdia_shift == 1) { + layer_on(MDIA); + } + } + } else { + if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + unregister_code(KC_BSLS); + } else { + if(--mdia_shift < 0) mdia_shift = 0; + if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); + } + } + break; + + case RSpec: + if (record->event.pressed) { + if (record->tap.count && !record->tap.interrupted) { + register_code(KC_EQL); + } else { + layer_on(SPEC); + } + } else { + if(record->tap.count && !record->tap.interrupted) { + unregister_code(KC_EQL); + } else { + layer_off(SPEC); + } + } + break; + + // mouse diagonals + + case MUL: // mouse up left + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + mousekey_send(); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + mousekey_send(); + } + break; + + case MUR: // mouse up right + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + mousekey_send(); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + mousekey_send(); + } + break; + + case MDL: // mouse down left + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + mousekey_send(); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + mousekey_send(); + } + break; + + case MDR: // mouse down right + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + mousekey_send(); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + mousekey_send(); + } + break; + + default: + // none + break; + } + + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + // shift or caps lock turns on red light + if(caps_shift || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<\n\n\nTab"], +[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], +[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], +[{y:-0.875,x:5.5},"B",{x:6.5},"N"], +[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc"},"Z",{x:14.5},"?\n/",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], +[{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], +[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Home","End"], +[{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], +[{x:2},"Page\n\n\n\n\n\nDown"], +[{r:-30,rx:13,y:-1,x:-3},"Left","Right"], +[{x:-3},"Up",{h:2},"Enter",{h:2},"Space"], +[{x:-3},"Down"] + diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.png b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.png new file mode 100644 index 000000000..99e5ed80b Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.png differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.txt b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.txt new file mode 100644 index 000000000..4eccc9f35 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.txt @@ -0,0 +1,27 @@ +[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], +[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], +[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], +[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#ffb063"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], +[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#e6e067"},"Print\n\n\n\n\n\nScreen"], +[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#e6e067",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#ff0000",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#ff8500",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], +[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], +[{y:-0.875,c:"#2277ff",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#e6e067"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#2277ff",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], +[{y:-0.75,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#ffb063"},"End",{x:1},"Page\n\n\n\n\n\nDown"], +[{y:-0.875,x:5.5,c:"#e6e067"},"Mute",{x:6.5,c:"#737373",a:7},""], +[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#ff8500"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#ffb063",fa:[0,0,0,1]},"Delete\n\n\nOption"], +[{y:-0.875,x:2.5,c:"#ff8500"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#ffb063"},"Insert\n\n\nCmd",{x:1,c:"#77aaff"},"Hyper"], +[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Crtl\n\n\nRCtrl"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ccbb00"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], +[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], +[{x:2},"Home\n\n\nBrowser"], +[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], +[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ccbb00",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], +[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nDown"] + diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.png b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.png new file mode 100644 index 000000000..6eecf447e Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.png differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.txt b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.txt new file mode 100644 index 000000000..a08827c6d --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.txt @@ -0,0 +1,27 @@ +[{x:3.5,a:7},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], +[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#54d6de"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{h:1.5},"",{x:4.5,h:1.5},"",""], +[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], +[{y:-0.375,x:3.5},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{x:6.5},""], +[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], +[{y:-0.625,x:6.5,h:1.5},"",{x:4.5,h:1.5},""], +[{y:-0.75,x:3.5},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{x:6.5},""], +[{y:-0.875,w:1.5},"","",{x:14.5},"",{c:"#2277ff",w:1.5},"RShift"], +[{y:-0.375,x:3.5,c:"#cccccc"},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.75,x:0.5},"","",{x:14.5},"",""], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], +[{h:2},"",{h:2},"",""], +[{x:2},""], +[{r:-30,rx:13,y:-1,x:-3},"",""], +[{x:-3},"",{h:2},"",{h:2},""], +[{x:-3},""] + diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.png b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.png new file mode 100644 index 000000000..e4de64a96 Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.png differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.txt b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.txt new file mode 100644 index 000000000..e199f5c59 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.txt @@ -0,0 +1,27 @@ +[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], +[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], +[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], +[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], +[{y:-0.875,c:"#2277ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb"},"!",{x:14.5,c:"#89b087"},"/",{c:"#2277ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#bbddbb"},"(",{x:10.5,c:"#89b087"},"5"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], +[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#54d6de",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], +[{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], +[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb"},"%",{x:14.5,c:"#89b087"},"-",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},".\n\n\nOption"], +[{y:-0.875,x:2.5,c:"#77aaff"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0\n\n\nCmd",{x:1},"=\n\n\nHyper"], +[{y:-0.75,x:0.5,c:"#77aaff"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+\n\n\nMeh","Enter\n\n\nCtrl"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Left","Right"], +[{h:2},"Space",{h:2},"Enter","Up"], +[{x:2},"Down"], +[{r:-30,rx:13,y:-1,x:-3},"Home","End"], +[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"], +[{x:-3},"Page\n\n\n\n\n\nDown"] + diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md new file mode 100644 index 000000000..6465cd79e --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md @@ -0,0 +1,103 @@ +# The Ordinary Layout, a familiar and powerful layout # + +The Ordinary Layout is intended to be unremarkably mundane and remarkably useful. This layout maintains most key positions from common QWERTY keyboards, and it features enhanced Symbol and Media layers compared to the default Ergodox EZ layout. + +The Ordinary Layout is supposed to look mostly like a normal keyboard, except in the ways that the Ergodox key arrangement is unique. The thumbs are responsible for space, enter, plus both forward and backward delete; with only a couple exceptions, all other keys are in the same place they are found on traditional keyboards. + +Nicholas Keene +ordinarylayout@nicholaskeene.com +no rights reserved, use for any purposes, credit me if you are a nice person + +## The Base Layout ## + +* The light blue keys are modifiers: traditional Control, Option, and Command keys, plus Hyper and Meh +* The dark blue keys are Shift keys: Capitals Shift (traditional shift), Symbol Shift, and Media Shift; plus a Shift Lock key +* Several dark blue keys double for entry of characters which would typically be in those locations +* The turquoise keys are text navigation and manipulation +* The red keys is Escape and it is always found in that location no matter what + +![Ordinary base layout](ordinary-base.png) + +This layout puts the modifier keys along the bottom of the keyboard where they are on most keyboards. They are in the regular order, with the addition of Hyper and Meh keys. The modifier keys are all in the same place on all layers, although some layers also assign symbols on those buttons. On the outside edges are the Shift keys. The traditional shift key is called Capitals Shift and it is in the normal location. Above that are Symbols Shift and Media Shift. Each Shift key momentarily switches the layout to that layer, and if you use the Shift Lock button you can lock the layout to that layer. + +Touch typists will also find tilde, tab, equals/plus, slash/pipe, and quote/double-quote sharing space on those Shift keys where they would probably be on a common keyboard. Other than the turquoise keys the only buttons which move to new locations are the Brackets and Dash and Escape. Most touch typists dont touch-type brackets or dash anyway so only Escape really requires retraining of muscle memory, and see below for the Special Escape Sequence. + +The four big turquoise keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. + +The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. + +## The Symbols Layer ## + +* The light green keys are the eponymous symbols +* The bright green keys are F-Keys +* The dark green keys constitute a number pad +* The turquoise keys are the *reverse* of the turquoise keys on the base layer + +![Ordinary symbol layout](ordinary-symbol.png) + +The Ergodox EZ ships with the "Coder Layer" which I like to call the Symbols layer. There are some significant improvements in The Ordinary Layout over the default layout. + +The symbol keys are mostly the same as on the default layout, which did a good job in this regard, but with a few enhancements: + +* Angle brackets on this layer mean that curly, square, and angle brackets are all available on different layers of the same two buttons. Also, they mean that all kinds of brackets, including parentheses, are available on both the Base and Symbols layers. +* The slash, backslash, and pipe characters are grouped together as a memory aid. +* The & and | symbols are juxtaposed as a memory aid + +The number pad area here, in green, includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads, because this layout does not use a Num Lock key to switch the buttons between numeric keycodes and navigational keycodes. See the explanation in The Media Layout section about navigation using these same buttons. + +Finally, consider the turquoise text-nav keys. Here in the Symbols layer, these are *reversed* from the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. + +## The Media Layer ## + +* The dark orange keys on the left move the mouse cursor +* The dark orange keys on the right move the text cursor +* The light orange keys are for scrolling and paging +* The bright green keys are more F-keys +* The dark yellow keys signal Web and Audio applications +* The light yellow keys signal the operating system +* The dark gray keys do nothing in case you bump them by accident + +![Ordinary media layout](ordinary-media.png) + +This layer was inspired by the Media layer on the Ergodox EZ but takes it farther. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. + +Moreover, the orange keys on the right overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. + +Alas, the yellow keys have at best spotty success with common software. Good luck with those but don't expect too much. + +## Switching Between Layers ## + +In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. + +Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. If you press both of a pair of shift keys, the layer will lock on until you press both shift keys again. For instance, the widely and rightly loathed Caps Lock is engaged by pressing both Capitals Shift buttons. All the Shift keys work this way. + +Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. + +## Special Sequences ## + +![Ordinary special layout](ordinary-special.png) + +### Escape ### + +The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, whnich is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. + +The Ordinary layout offers as a consolation prize a Special sequence for Escape: Special Shift + 1. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. + +### Backspace ### + +At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence, using the 0 key, to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. + +### RShift ### + +The Ordinary Layout locks layers by pressing both of a pair of shift keys. This interferes with the QMK firmware magic sequence, which is LShift+RShift. To work around this, both of the Capitals Shift keys produce a *Left Shift* keystroke. If for some reason a person needs *Right Shift* they can find it by pressing a Special Shift key, then the Capitals Shift key on the right side of the keyboard. + +**** + +The Ordinary Layout for the Ergodox EZ keyboard, v4 + +Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com + +No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. + +Details: readme.md + https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary -- cgit v1.2.3-24-g4f1b From 825aead3bdb74effee17d9436d79f2952550b5cf Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Thu, 14 Jul 2016 00:38:00 -0700 Subject: Replaced readme.md with stub (incl. reference to original layout) --- keyboards/ergodox_ez/keymaps/teckinesis/readme.md | 97 ++--------------------- 1 file changed, 5 insertions(+), 92 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md index 6465cd79e..5d2f1d07d 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md +++ b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md @@ -1,103 +1,16 @@ -# The Ordinary Layout, a familiar and powerful layout # +# teckinesis Layout # -The Ordinary Layout is intended to be unremarkably mundane and remarkably useful. This layout maintains most key positions from common QWERTY keyboards, and it features enhanced Symbol and Media layers compared to the default Ergodox EZ layout. - -The Ordinary Layout is supposed to look mostly like a normal keyboard, except in the ways that the Ergodox key arrangement is unique. The thumbs are responsible for space, enter, plus both forward and backward delete; with only a couple exceptions, all other keys are in the same place they are found on traditional keyboards. - -Nicholas Keene -ordinarylayout@nicholaskeene.com -no rights reserved, use for any purposes, credit me if you are a nice person +*A blend of TECK and Kinesis layouts, based on ["The Ordinary Layout" by Nicholas Keene](http://qmk.fm/keyboards/ergodox_ez/keymaps/ordinary/#the-ordinary-layout-a-familiar-and-powerful-layout)* ## The Base Layout ## -* The light blue keys are modifiers: traditional Control, Option, and Command keys, plus Hyper and Meh -* The dark blue keys are Shift keys: Capitals Shift (traditional shift), Symbol Shift, and Media Shift; plus a Shift Lock key -* Several dark blue keys double for entry of characters which would typically be in those locations -* The turquoise keys are text navigation and manipulation -* The red keys is Escape and it is always found in that location no matter what - -![Ordinary base layout](ordinary-base.png) - -This layout puts the modifier keys along the bottom of the keyboard where they are on most keyboards. They are in the regular order, with the addition of Hyper and Meh keys. The modifier keys are all in the same place on all layers, although some layers also assign symbols on those buttons. On the outside edges are the Shift keys. The traditional shift key is called Capitals Shift and it is in the normal location. Above that are Symbols Shift and Media Shift. Each Shift key momentarily switches the layout to that layer, and if you use the Shift Lock button you can lock the layout to that layer. - -Touch typists will also find tilde, tab, equals/plus, slash/pipe, and quote/double-quote sharing space on those Shift keys where they would probably be on a common keyboard. Other than the turquoise keys the only buttons which move to new locations are the Brackets and Dash and Escape. Most touch typists dont touch-type brackets or dash anyway so only Escape really requires retraining of muscle memory, and see below for the Special Escape Sequence. - -The four big turquoise keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. - -The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. +(placeholder) ## The Symbols Layer ## -* The light green keys are the eponymous symbols -* The bright green keys are F-Keys -* The dark green keys constitute a number pad -* The turquoise keys are the *reverse* of the turquoise keys on the base layer - -![Ordinary symbol layout](ordinary-symbol.png) - -The Ergodox EZ ships with the "Coder Layer" which I like to call the Symbols layer. There are some significant improvements in The Ordinary Layout over the default layout. - -The symbol keys are mostly the same as on the default layout, which did a good job in this regard, but with a few enhancements: - -* Angle brackets on this layer mean that curly, square, and angle brackets are all available on different layers of the same two buttons. Also, they mean that all kinds of brackets, including parentheses, are available on both the Base and Symbols layers. -* The slash, backslash, and pipe characters are grouped together as a memory aid. -* The & and | symbols are juxtaposed as a memory aid - -The number pad area here, in green, includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads, because this layout does not use a Num Lock key to switch the buttons between numeric keycodes and navigational keycodes. See the explanation in The Media Layout section about navigation using these same buttons. - -Finally, consider the turquoise text-nav keys. Here in the Symbols layer, these are *reversed* from the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. +(placeholder) ## The Media Layer ## -* The dark orange keys on the left move the mouse cursor -* The dark orange keys on the right move the text cursor -* The light orange keys are for scrolling and paging -* The bright green keys are more F-keys -* The dark yellow keys signal Web and Audio applications -* The light yellow keys signal the operating system -* The dark gray keys do nothing in case you bump them by accident - -![Ordinary media layout](ordinary-media.png) - -This layer was inspired by the Media layer on the Ergodox EZ but takes it farther. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. - -Moreover, the orange keys on the right overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. - -Alas, the yellow keys have at best spotty success with common software. Good luck with those but don't expect too much. - -## Switching Between Layers ## - -In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. - -Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. If you press both of a pair of shift keys, the layer will lock on until you press both shift keys again. For instance, the widely and rightly loathed Caps Lock is engaged by pressing both Capitals Shift buttons. All the Shift keys work this way. - -Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. - -## Special Sequences ## - -![Ordinary special layout](ordinary-special.png) - -### Escape ### - -The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, whnich is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. - -The Ordinary layout offers as a consolation prize a Special sequence for Escape: Special Shift + 1. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. - -### Backspace ### - -At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence, using the 0 key, to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. - -### RShift ### - -The Ordinary Layout locks layers by pressing both of a pair of shift keys. This interferes with the QMK firmware magic sequence, which is LShift+RShift. To work around this, both of the Capitals Shift keys produce a *Left Shift* keystroke. If for some reason a person needs *Right Shift* they can find it by pressing a Special Shift key, then the Capitals Shift key on the right side of the keyboard. - -**** - -The Ordinary Layout for the Ergodox EZ keyboard, v4 - -Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com - -No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. +(placeholder) -Details: readme.md - https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary -- cgit v1.2.3-24-g4f1b From b58724543086dc04603d7289c038267779357629 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Thu, 14 Jul 2016 00:39:01 -0700 Subject: Replaced ordinary-base.{png|json} with new base layout. --- .../keymaps/teckinesis/ordinary-base.png | Bin 99605 -> 0 bytes .../keymaps/teckinesis/ordinary-base.txt | 27 -- .../keymaps/teckinesis/teckinesis-base.json | 452 +++++++++++++++++++++ .../keymaps/teckinesis/teckinesis-base.png | Bin 0 -> 94828 bytes 4 files changed, 452 insertions(+), 27 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.png delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.txt create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.png b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.png deleted file mode 100644 index 9c561a10a..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.txt b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.txt deleted file mode 100644 index 25731ea2e..000000000 --- a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-base.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5},"#\n3",{x:10.5},"*\n8"], -[{y:-0.875,x:2.5},"@\n2",{x:1},"$\n4",{x:8.5},"&\n7",{x:1},"(\n9"], -[{y:-0.875,x:5.5},"%\n5",{c:"#ff4444"},"Esc",{x:4.5,c:"#cccccc"},"_\n\n\n\n\n\n-","^\n6"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n~\n\n\n\nShift\n`",{c:"#cccccc"},"!\n1",{x:14.5},")\n0",{c:"#2277ff",w:1.5},"+\n\nSpecial\n\n\n\n=\nShift"], -[{y:-0.375,x:3.5,c:"#cccccc"},"E",{x:10.5},"I"], -[{y:-0.875,x:2.5},"W",{x:1},"R",{x:8.5},"U",{x:1},"O"], -[{y:-0.875,x:5.5},"T",{h:1.5},"{\n\n\n\n\n\n[",{x:4.5,h:1.5},"}\n\n\n\n\n\n]","Y"], -[{y:-0.875,c:"#2277ff",w:1.5},"Media\n\nTab\n\n\n\nShift",{c:"#cccccc"},"Q",{x:14.5},"P",{c:"#2277ff",w:1.5},"|\n\\\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#cccccc"},"D",{x:10.5},"K"], -[{y:-0.875,x:2.5},"S",{x:1},"F",{x:8.5},"J",{x:1},"L"], -[{y:-0.875,x:5.5},"G",{x:6.5},"H"], -[{y:-0.875,c:"#2277ff",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#cccccc"},"A",{x:14.5},":\n;",{c:"#2277ff",w:1.5},"\"\n'\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#54d6de",fa:[0,0,0,1],h:1.5},"< Tab\n\n\nShift Tab",{x:4.5,h:1.5},"Tab >\n\n\nTab"], -[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], -[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], -[{y:-0.875,x:5.5},"B",{x:6.5},"N"], -[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc"},"Z",{x:14.5},"?\n/",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], -[{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], -[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Home","End"], -[{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], -[{x:2},"Page\n\n\n\n\n\nDown"], -[{r:-30,rx:13,y:-1,x:-3},"Left","Right"], -[{x:-3},"Up",{h:2},"Enter",{h:2},"Space"], -[{x:-3},"Down"] - diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json new file mode 100644 index 000000000..f1efab272 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json @@ -0,0 +1,452 @@ +[ + { + "name": "teckinesis", + "author": "Will Wolff-Myren", + "notes": "# teckinesis Layout # \r\n\r\n*A blend of TECK and Kinesis layouts, based on [\"The Ordinary Layout\" by Nicholas Keene](http://qmk.fm/keyboards/ergodox_ez/keymaps/ordinary/#the-ordinary-layout-a-familiar-and-powerful-layout)*\r\n\r\n## The Base Layout ##\r\n\r\n(placeholder)\r\n\r\n## The Symbols Layer ##\r\n\r\n(placeholder)\r\n\r\n## The Media Layer ##\r\n\r\n(placeholder)", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea" + }, + [ + { + "x": 3.5 + }, + "#\n3", + { + "x": 10.5 + }, + ")\n0" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "@\n2", + { + "x": 1 + }, + "$\n4" + ], + [ + { + "y": -0.995, + "x": 14 + }, + "(\n9", + { + "x": 1 + }, + "_\n-" + ], + [ + { + "y": -0.8799999999999999, + "x": 5.5 + }, + "%\n5", + "^\n6", + { + "x": 4.5 + }, + "&\n7", + "*\n8" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "!\n1", + { + "x": 14.5 + }, + "+\n=" + ], + [ + { + "y": -0.995, + "c": "#2277ff", + "w": 1.5 + }, + "Media\n\nEsc\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "~\n`\nMedia\n\n\n\n\nShift" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#cccccc" + }, + "E", + { + "x": 10.5 + }, + "I" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "W", + { + "x": 1 + }, + "R", + { + "x": 8.5 + }, + "U", + { + "x": 1 + }, + "O" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "T", + { + "h": 1.5 + }, + "{\n\n\n\n\n\n[", + { + "x": 4.5, + "h": 1.5 + }, + "}\n\n\n\n\n\n]", + "Y" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "Q", + { + "x": 14.5 + }, + "P" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "w": 1.5 + }, + "Symbols\n\n?\n/\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "|\n\\\nSymbols\n\n\n\n\nShift" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#cccccc" + }, + "D", + { + "x": 10.5 + }, + "K" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "S", + { + "x": 1 + }, + "F", + { + "x": 8.5 + }, + "J", + { + "x": 1 + }, + "L" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "G", + { + "x": 6.5 + }, + "H" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "A", + { + "x": 14.5 + }, + ":\n;" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "w": 1.5 + }, + "Capitals\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nCapitals\n\n\n\n\nShift" + ], + [ + { + "y": -0.6299999999999999, + "x": 6.5, + "c": "#54d6de", + "fa": [ + 0, + 0, + 0, + 1 + ], + "h": 1.5 + }, + "< Tab\n\n\nShift Tab", + { + "x": 4.5, + "h": 1.5 + }, + "Tab >\n\n\nTab" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#cccccc" + }, + "C", + { + "x": 10.5 + }, + "<\n," + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "X", + { + "x": 1 + }, + "V", + { + "x": 8.5 + }, + "M", + { + "x": 1 + }, + ">\n." + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "B", + { + "x": 6.5 + }, + "N" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "Z", + { + "x": 14.5 + }, + "?\n/" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "w": 1.5 + }, + "Ctrl", + { + "x": 16.5, + "w": 1.5 + }, + "Ctrl" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#77aaff" + }, + "Option\n\n\nLAlt", + { + "x": 10.5 + }, + "Option\n\n\nRAlt" + ], + [ + { + "y": -0.875, + "x": 2.5, + "f": 3 + }, + "Hyper\n\n}\n]", + { + "x": 1 + }, + "Cmd\n\n\nSuper", + { + "x": 8.5, + "fa": [ + 5, + 0, + 0, + 1, + 0, + 0, + 0 + ] + }, + "\n\n\nSuper", + { + "x": 1, + "fa": [ + 5, + 0, + 0, + 0, + 0, + 0, + 1 + ] + }, + "\n\n~\n`\n\n\nHyper" + ], + [ + { + "y": -0.75, + "x": 0.5, + "f": 2 + }, + "Print\n\n\n\n\n\nScreen", + { + "f": 3 + }, + "Meh\n\n{\n[", + { + "x": 14.5, + "fa": [ + 0, + 0, + 0, + 0, + 0, + 0, + 2 + ] + }, + "\n\n\"\n'\n\n\nMeh" + ], + [ + { + "y": -0.9950000000000001, + "x": 18, + "f": 2 + }, + "Special\n\n\n\n\n\nShift" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#54d6de", + "f": 3 + }, + "Home", + "End" + ], + [ + { + "fa": [ + 0, + 0, + 0, + 1 + ], + "h": 2 + }, + "< Del\n\n\nBackspace", + { + "h": 2 + }, + "Del >\n\n\nDelete", + "Page\n\n\n\n\n\nUp" + ], + [ + { + "x": 2 + }, + "Page\n\n\n\n\n\nDown" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3 + }, + "Left", + "Right" + ], + [ + { + "x": -3 + }, + "Up", + { + "h": 2 + }, + "Enter", + { + "h": 2 + }, + "Space" + ], + [ + { + "x": -3 + }, + "Down" + ] +] \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png new file mode 100644 index 000000000..f1a5eda0d Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png differ -- cgit v1.2.3-24-g4f1b From 1b776f0f339032bc6990269e24f35dc2153adae6 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Thu, 14 Jul 2016 01:03:45 -0700 Subject: Replaced ordinary-symbol.{png|json} with new base layout. --- .../keymaps/teckinesis/ordinary-symbol.png | Bin 103735 -> 0 bytes .../keymaps/teckinesis/ordinary-symbol.txt | 27 -- keyboards/ergodox_ez/keymaps/teckinesis/readme.md | 4 +- .../keymaps/teckinesis/teckinesis-symbol.json | 428 +++++++++++++++++++++ .../keymaps/teckinesis/teckinesis-symbol.png | Bin 0 -> 97055 bytes 5 files changed, 430 insertions(+), 29 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.png delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.txt create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.png b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.png deleted file mode 100644 index e4de64a96..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.txt b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.txt deleted file mode 100644 index e199f5c59..000000000 --- a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-symbol.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], -[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], -[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], -[{y:-0.875,c:"#2277ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb"},"!",{x:14.5,c:"#89b087"},"/",{c:"#2277ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"(",{x:10.5,c:"#89b087"},"5"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], -[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#54d6de",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], -[{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], -[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb"},"%",{x:14.5,c:"#89b087"},"-",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},".\n\n\nOption"], -[{y:-0.875,x:2.5,c:"#77aaff"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0\n\n\nCmd",{x:1},"=\n\n\nHyper"], -[{y:-0.75,x:0.5,c:"#77aaff"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+\n\n\nMeh","Enter\n\n\nCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Left","Right"], -[{h:2},"Space",{h:2},"Enter","Up"], -[{x:2},"Down"], -[{r:-30,rx:13,y:-1,x:-3},"Home","End"], -[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"], -[{x:-3},"Page\n\n\n\n\n\nDown"] - diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md index 5d2f1d07d..e4881dbbf 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md +++ b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md @@ -4,11 +4,11 @@ ## The Base Layout ## -(placeholder) +![teckinesis base layout](teckinesis-base.png) ## The Symbols Layer ## -(placeholder) +![teckinesis symbols layout](teckinesis-symbol.png) ## The Media Layer ## diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json new file mode 100644 index 000000000..052c23da5 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json @@ -0,0 +1,428 @@ +[ + { + "name": "teckinesis (Symbols Layer)", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea" + }, + [ + { + "x": 3.5, + "c": "#99de2a" + }, + "F3", + { + "x": 10.5 + }, + "F10" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "F2", + { + "x": 1 + }, + "F4" + ], + [ + { + "y": -0.995, + "x": 14 + }, + "F9", + { + "x": 1 + }, + "F11" + ], + [ + { + "y": -0.8799999999999999, + "x": 5.5 + }, + "F5", + "F6", + { + "x": 4.5 + }, + "F7", + "F8" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "F1" + ], + [ + { + "y": -0.995, + "c": "#2277ff", + "w": 1.5 + }, + "Media\n\nEsc\n\n\n\nShift", + { + "x": 15.5, + "c": "#99de2a" + }, + "F12", + { + "c": "#2277ff", + "w": 1.5 + }, + "\n\nMedia\n\n\n\n\nShift" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#bbddbb" + }, + "{", + { + "x": 10.5, + "c": "#89b087" + }, + "8" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bbddbb" + }, + "@", + { + "x": 1 + }, + "}", + { + "x": 8.5, + "c": "#89b087" + }, + "7", + { + "x": 1 + }, + "9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#bbddbb" + }, + "&", + { + "h": 1.5 + }, + "<", + { + "x": 4.5, + "h": 1.5 + }, + ">", + "|" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "!", + { + "x": 14.5, + "c": "#89b087" + }, + "/" + ], + [ + { + "y": -0.9950000000000001, + "c": "#000000", + "t": "#ff0000", + "w": 1.5 + }, + "Symbols\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nSymbols\n\n\n\n\nShift" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#bbddbb", + "t": "#000000" + }, + "(", + { + "x": 10.5, + "c": "#89b087" + }, + "5" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bbddbb" + }, + "$", + { + "x": 1 + }, + ")", + { + "x": 8.5, + "c": "#89b087" + }, + "4", + { + "x": 1 + }, + "6" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#bbddbb" + }, + "`", + { + "x": 6.5 + }, + "/" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "#", + { + "x": 14.5, + "c": "#89b087" + }, + "*" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "w": 1.5 + }, + "Capitals\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nCapitals\n\n\n\n\nShift" + ], + [ + { + "y": -0.6299999999999999, + "x": 6.5, + "c": "#54d6de", + "fa": [ + 0, + 0, + 0, + 1 + ], + "h": 1.5 + }, + "Tab >\n\n\nTab", + { + "x": 4.5, + "h": 1.5 + }, + "< Tab\n\n\nShift Tab" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#bbddbb" + }, + "[", + { + "x": 10.5, + "c": "#89b087" + }, + "2" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bbddbb" + }, + "^", + { + "x": 1 + }, + "]", + { + "x": 8.5, + "c": "#89b087" + }, + "1", + { + "x": 1 + }, + "3" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#bbddbb" + }, + "~", + { + "x": 6.5 + }, + "\\" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "%", + { + "x": 14.5, + "c": "#89b087" + }, + "-" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "w": 1.5 + }, + "Ctrl", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nCtrl" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#77aaff" + }, + "Option\n\n\nLAlt", + { + "x": 10.5, + "c": "#89b087" + }, + ".\n\n\nOption" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#77aaff" + }, + "Hyper", + { + "x": 1 + }, + "Cmd\n\n\nSuper", + { + "x": 8.5, + "c": "#89b087" + }, + "0\n\n\nCmd", + { + "x": 1 + }, + "=\n\n\nHyper" + ], + [ + { + "y": -0.75, + "x": 0.5, + "c": "#77aaff" + }, + "Ctrl\n\n\nLCtrl", + "Meh", + { + "x": 14.5, + "c": "#89b087" + }, + "+\n\n\nMeh", + "Enter\n\n\nCtrl" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#54d6de" + }, + "Left", + "Right" + ], + [ + { + "h": 2 + }, + "Space", + { + "h": 2 + }, + "Enter", + "Up" + ], + [ + { + "x": 2 + }, + "Down" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3 + }, + "Home", + "End" + ], + [ + { + "x": -3 + }, + "Page\n\n\n\n\n\nUp", + { + "h": 2 + }, + "< Del\n\n\nBackspace", + { + "h": 2 + }, + "Del >\n\n\nDelete" + ], + [ + { + "x": -3 + }, + "Page\n\n\n\n\n\nDown" + ] +] \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png new file mode 100644 index 000000000..4750dbf1f Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png differ -- cgit v1.2.3-24-g4f1b From 76469ebbcfd5b2582a45eb0dd0966bad724e4cdd Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Thu, 14 Jul 2016 01:22:15 -0700 Subject: Replaced ordinary-media.{png|json} with new media layout --- .../keymaps/teckinesis/ordinary-media.png | Bin 124144 -> 0 bytes .../keymaps/teckinesis/ordinary-media.txt | 27 -- .../keymaps/teckinesis/teckinesis-media.json | 436 +++++++++++++++++++++ .../keymaps/teckinesis/teckinesis-media.png | Bin 0 -> 112216 bytes 4 files changed, 436 insertions(+), 27 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.png delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.txt create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.png b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.png deleted file mode 100644 index 99e5ed80b..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.txt b/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.txt deleted file mode 100644 index 4eccc9f35..000000000 --- a/keyboards/ergodox_ez/keymaps/teckinesis/ordinary-media.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], -[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], -[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#ffb063"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#e6e067"},"Print\n\n\n\n\n\nScreen"], -[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#e6e067",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#ff0000",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], -[{y:-0.875,c:"#2277ff",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#e6e067"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#2277ff",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], -[{y:-0.75,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#ffb063"},"End",{x:1},"Page\n\n\n\n\n\nDown"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Mute",{x:6.5,c:"#737373",a:7},""], -[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#ffb063",fa:[0,0,0,1]},"Delete\n\n\nOption"], -[{y:-0.875,x:2.5,c:"#ff8500"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#ffb063"},"Insert\n\n\nCmd",{x:1,c:"#77aaff"},"Hyper"], -[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Crtl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ccbb00"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], -[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], -[{x:2},"Home\n\n\nBrowser"], -[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], -[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ccbb00",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], -[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nDown"] - diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json new file mode 100644 index 000000000..65fe394e8 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json @@ -0,0 +1,436 @@ +[ + { + "name": "teckinesis (MediaLayer)", + "author": "Will Wolff-Myren", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea" + }, + [ + { + "x": 3.5, + "c": "#99de2a" + }, + "F13", + { + "x": 10.5 + }, + "F18" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "F12", + { + "x": 1 + }, + "F14", + { + "x": 8.5 + }, + "F17", + { + "x": 1 + }, + "F19" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "F15", + { + "c": "#ff4444" + }, + "Esc", + { + "x": 4.5 + }, + "Esc", + { + "c": "#99de2a" + }, + "F16" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "F11", + { + "x": 14.5 + }, + "F20" + ], + [ + { + "y": -0.995, + "c": "#000000", + "t": "#ff0000", + "w": 1.5 + }, + "Media\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nMedia\n\n\n\n\nShift" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#ff8500", + "t": "#000000" + }, + "Mouse\n\n\n\n\n\nUp", + { + "x": 10.5 + }, + "Cursor\n\n\n\n\n\nUp" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "Mouse\n\n\n\n\n\nUpLeft", + { + "x": 1 + }, + "Mouse\n\n\n\n\n\nUpRgt", + { + "x": 8.5, + "c": "#ffb063" + }, + "Home", + { + "x": 1 + }, + "Page\n\n\n\n\n\nUp" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#e6e067" + }, + "Vol\n\n\n\n\n\nUp", + { + "c": "#ffb063", + "h": 1.5 + }, + "Scroll\n\n\n\n\n\nUp", + { + "x": 4.5, + "h": 1.5 + }, + "Scroll\n\n\n\n\n\nUp", + { + "c": "#e6e067" + }, + "Print\n\n\n\n\n\nScreen" + ], + [ + { + "y": -0.875, + "x": 1.5, + "c": "#737373", + "a": 7 + }, + "", + { + "x": 14.5 + }, + "" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "a": 4, + "w": 1.5 + }, + "Symbols\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nSymbols\n\n\n\n\nShift" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#ff8500" + }, + "Mouse\n\n\n\n\n\nDown", + { + "x": 10.5 + }, + "Cursor\n\n\n\n\n\nDown" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "Mouse\n\n\n\n\n\nLeft", + { + "x": 1 + }, + "Mouse\n\n\n\n\n\nRight", + { + "x": 8.5 + }, + "Cursor\n\n\n\n\n\nLeft", + { + "x": 1 + }, + "Cursor\n\n\n\n\n\nRight" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#e6e067" + }, + "Vol\n\n\n\n\n\nDown", + { + "x": 6.5 + }, + "Num\n\n\n\n\n\nLock" + ], + [ + { + "y": -0.875, + "x": 1.5, + "c": "#737373", + "a": 7 + }, + "", + { + "x": 14.5 + }, + "" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "a": 4, + "w": 1.5 + }, + "Capitals\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nCapitals\n\n\n\n\nShift" + ], + [ + { + "y": -0.6299999999999999, + "x": 6.5, + "c": "#ffb063", + "h": 1.5 + }, + "Scroll\n\n\n\n\n\nDown", + { + "x": 4.5, + "h": 1.5 + }, + "Scroll\n\n\n\n\n\nDown" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#ff8500" + }, + "Mouse\n\n\n\n\n\nDown", + { + "x": 10.5 + }, + "Cursor\n\n\n\n\n\nDown" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "Mouse\n\n\n\n\n\nDnLeft", + { + "x": 1 + }, + "Mouse\n\n\n\n\n\nDnRgt", + { + "x": 8.5, + "c": "#ffb063" + }, + "End", + { + "x": 1 + }, + "Page\n\n\n\n\n\nDown" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#e6e067" + }, + "Mute", + { + "x": 6.5, + "c": "#737373", + "a": 7 + }, + "" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "", + { + "x": 14.5 + }, + "" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "a": 4, + "w": 1.5 + }, + "Ctrl", + { + "x": 16.5, + "w": 1.5 + }, + "Ctrl" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#ff8500" + }, + "Middle\n\n\n\n\n\nClick", + { + "x": 10.5, + "c": "#ffb063", + "fa": [ + 0, + 0, + 0, + 1 + ] + }, + "Delete\n\n\nOption" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#ff8500" + }, + "Left\n\n\n\n\n\nClick", + { + "x": 1 + }, + "Right\n\n\n\n\n\nClick", + { + "x": 8.5, + "c": "#ffb063" + }, + "Insert\n\n\nCmd", + { + "x": 1, + "c": "#77aaff" + }, + "Hyper" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "Alt\n\n\nLAlt", + "Meh", + { + "x": 14.5 + }, + "Meh", + "Alt\n\n\nRAlt" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#ccbb00" + }, + "Stop\n\n\nBrowser", + "Reload\n\n\nBrowser" + ], + [ + { + "h": 2 + }, + "< Web\n\n\nBrowser", + { + "h": 2 + }, + "Web >\n\n\nBrowser", + "Search\n\n\nBrowser" + ], + [ + { + "x": 2 + }, + "Home\n\n\nBrowser" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3 + }, + "Prev\n\n\nAudio\n\n\nTrack", + "Next\n\n\nAudio\n\n\nTrack" + ], + [ + { + "x": -3, + "c": "#e6e067" + }, + "Vol\n\n\n\n\n\nUp", + { + "c": "#ccbb00", + "h": 2 + }, + "Stop\n\n\nAudio", + { + "h": 2 + }, + "Play\n\n\nAudio\n\n\nPause" + ], + [ + { + "x": -3, + "c": "#e6e067" + }, + "Vol\n\n\n\n\n\nDown" + ] +] \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png new file mode 100644 index 000000000..cc51605f9 Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png differ -- cgit v1.2.3-24-g4f1b From 010dd1308420e25b327fa4d5d6b13f67a849408b Mon Sep 17 00:00:00 2001 From: "Jonathan A. Kollasch" Date: Thu, 14 Jul 2016 11:04:25 -0500 Subject: keymap_extras: add newline at end of files --- quantum/keymap_extras/keymap_french.h | 2 +- quantum/keymap_extras/keymap_uk.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h index 2a44c80b1..4fd1f61ae 100644 --- a/quantum/keymap_extras/keymap_french.h +++ b/quantum/keymap_extras/keymap_french.h @@ -80,4 +80,4 @@ #define FR_EURO ALGR(KC_E) #define FR_BULT ALGR(FR_DLR) -#endif \ No newline at end of file +#endif diff --git a/quantum/keymap_extras/keymap_uk.h b/quantum/keymap_extras/keymap_uk.h index 5c5d95179..1458d64a9 100644 --- a/quantum/keymap_extras/keymap_uk.h +++ b/quantum/keymap_extras/keymap_uk.h @@ -33,4 +33,4 @@ #define UK_AACT ALGR(KC_A) -#endif \ No newline at end of file +#endif -- cgit v1.2.3-24-g4f1b From 25938a09a6bfb2624bc96841b53897eda532e293 Mon Sep 17 00:00:00 2001 From: "Jonathan A. Kollasch" Date: Thu, 14 Jul 2016 11:13:35 -0500 Subject: extra_keymaps: use RALT() instead of 0x1400 for AltGr --- quantum/keymap_extras/keymap_fr_ch.h | 2 +- quantum/keymap_extras/keymap_french.h | 2 +- quantum/keymap_extras/keymap_german.h | 2 +- quantum/keymap_extras/keymap_german_ch.h | 2 +- quantum/keymap_extras/keymap_nordic.h | 2 +- quantum/keymap_extras/keymap_spanish.h | 2 +- quantum/keymap_extras/keymap_uk.h | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/quantum/keymap_extras/keymap_fr_ch.h b/quantum/keymap_extras/keymap_fr_ch.h index 3fd971357..87d4bb24c 100644 --- a/quantum/keymap_extras/keymap_fr_ch.h +++ b/quantum/keymap_extras/keymap_fr_ch.h @@ -4,7 +4,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) kc | 0x1400 +#define ALGR(kc) RALT(kc) #define FR_CH_ALGR KC_RALT // normal characters diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h index 4fd1f61ae..834c69650 100644 --- a/quantum/keymap_extras/keymap_french.h +++ b/quantum/keymap_extras/keymap_french.h @@ -4,7 +4,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) kc | 0x1400 +#define ALGR(kc) RALT(kc) #define NO_ALGR KC_RALT // Normal characters diff --git a/quantum/keymap_extras/keymap_german.h b/quantum/keymap_extras/keymap_german.h index 3f9ae8bad..7e2e0ed44 100644 --- a/quantum/keymap_extras/keymap_german.h +++ b/quantum/keymap_extras/keymap_german.h @@ -4,7 +4,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) kc | 0x1400 +#define ALGR(kc) RALT(kc) #define DE_ALGR KC_RALT // normal characters diff --git a/quantum/keymap_extras/keymap_german_ch.h b/quantum/keymap_extras/keymap_german_ch.h index 6a782bcd7..b66d582a4 100644 --- a/quantum/keymap_extras/keymap_german_ch.h +++ b/quantum/keymap_extras/keymap_german_ch.h @@ -4,7 +4,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) kc | 0x1400 +#define ALGR(kc) RALT(kc) #define CH_ALGR KC_RALT // normal characters diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h index 3acb8b698..f8cf4e2e4 100644 --- a/quantum/keymap_extras/keymap_nordic.h +++ b/quantum/keymap_extras/keymap_nordic.h @@ -4,7 +4,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) kc | 0x1400 +#define ALGR(kc) RALT(kc) #define NO_ALGR KC_RALT // Normal characters diff --git a/quantum/keymap_extras/keymap_spanish.h b/quantum/keymap_extras/keymap_spanish.h index af76e39fc..4ba568af2 100644 --- a/quantum/keymap_extras/keymap_spanish.h +++ b/quantum/keymap_extras/keymap_spanish.h @@ -4,7 +4,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) kc | 0x1400 +#define ALGR(kc) RALT(kc) #define NO_ALGR KC_RALT // Normal characters diff --git a/quantum/keymap_extras/keymap_uk.h b/quantum/keymap_extras/keymap_uk.h index 1458d64a9..00c87afc3 100644 --- a/quantum/keymap_extras/keymap_uk.h +++ b/quantum/keymap_extras/keymap_uk.h @@ -4,7 +4,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) kc | 0x1400 +#define ALGR(kc) RALT(kc) #define NO_ALGR KC_RALT // Normal characters -- cgit v1.2.3-24-g4f1b From 4278d8861526ed285d9d00badcdc8c121454be60 Mon Sep 17 00:00:00 2001 From: "Jonathan A. Kollasch" Date: Thu, 14 Jul 2016 11:32:43 -0500 Subject: keymap_dvorak.h: add missing shifted keys, fix whitespace --- quantum/keymap_extras/keymap_dvorak.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/quantum/keymap_extras/keymap_dvorak.h b/quantum/keymap_extras/keymap_dvorak.h index e855056e8..17f205977 100644 --- a/quantum/keymap_extras/keymap_dvorak.h +++ b/quantum/keymap_extras/keymap_dvorak.h @@ -18,18 +18,19 @@ #define DV_LBRC KC_MINS #define DV_RBRC KC_EQL -#define DV_QUOT KC_Q +#define DV_QUOT KC_Q #define DV_COMM KC_W #define DV_DOT KC_E #define DV_P KC_R #define DV_Y KC_T #define DV_F KC_Y #define DV_G KC_U -#define DV_C KC_I +#define DV_C KC_I #define DV_R KC_O #define DV_L KC_P #define DV_SLSH KC_LBRC #define DV_EQL KC_RBRC +#define DV_BSLS KC_BSLS #define DV_A KC_A #define DV_O KC_S @@ -68,7 +69,13 @@ #define DV_RPRN LSFT(DV_0) #define DV_LCBR LSFT(DV_LBRC) #define DV_RCBR LSFT(DV_RBRC) -#define DV_UNDS LSFT(DV_MINS) -#define DV_PLUS LSFT(DV_EQL) + +#define DV_QUES LSFT(DV_SLSH) +#define DV_PLUS LSFT(DV_EQL) +#define DV_PIPE LSFT(DV_BSLS) + +#define DV_UNDS LSFT(DV_MINS) + +#define DV_COLN LSFT(DV_SCLN) #endif -- cgit v1.2.3-24-g4f1b From 0b8c448b300da233de8b8d4fcdb359ec0679a513 Mon Sep 17 00:00:00 2001 From: Travis La Marr Date: Fri, 15 Jul 2016 10:28:23 -0400 Subject: Make DFU wait for bootloader Added a loop for waiting for the keyboard to be put in bootloader mode, rather than failing out. Makes building keymaps easier. --- tmk_core/avr.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 3bf2b34f8..6c03e1650 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -107,6 +107,10 @@ flip: $(BUILD_DIR)/$(TARGET).hex batchisp -hardware usb -device $(MCU) -operation start reset 0 dfu: $(BUILD_DIR)/$(TARGET).hex sizeafter + until dfu-programmer $(MCU) get bootloader-version; do\ + echo "Error: Bootloader not found. Trying again in 5s." ;\ + sleep 5 ;\ + done ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1))) dfu-programmer $(MCU) erase --force else -- cgit v1.2.3-24-g4f1b From d48a4cf1eb80600fb3e8eb859e5b77c954a18137 Mon Sep 17 00:00:00 2001 From: Travis La Marr Date: Fri, 15 Jul 2016 10:41:32 -0400 Subject: Fix OS X Recognizing keyboard as Mouse/Tablet Modified the LUFA USB HID Descriptor to change the logical/usage minimums for System Control from 0x01 (Mouse) to 0x81 (System Power Down), this fixes OS X recognizing the Planck as having a mouse and tablet, even with mousekeys off. --- tmk_core/protocol/lufa/descriptor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmk_core/protocol/lufa/descriptor.c b/tmk_core/protocol/lufa/descriptor.c index 850a20fdb..539a58d66 100644 --- a/tmk_core/protocol/lufa/descriptor.c +++ b/tmk_core/protocol/lufa/descriptor.c @@ -140,9 +140,9 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM ExtrakeyReport[] = HID_RI_USAGE(8, 0x80), /* System Control */ HID_RI_COLLECTION(8, 0x01), /* Application */ HID_RI_REPORT_ID(8, REPORT_ID_SYSTEM), - HID_RI_LOGICAL_MINIMUM(16, 0x0001), + HID_RI_LOGICAL_MINIMUM(16, 0x0081), HID_RI_LOGICAL_MAXIMUM(16, 0x00B7), - HID_RI_USAGE_MINIMUM(16, 0x0001), /* System Power Down */ + HID_RI_USAGE_MINIMUM(16, 0x0081), /* System Power Down */ HID_RI_USAGE_MAXIMUM(16, 0x00B7), /* System Display LCD Autoscale */ HID_RI_REPORT_SIZE(8, 16), HID_RI_REPORT_COUNT(8, 1), -- cgit v1.2.3-24-g4f1b From 0446263935e418537966bc64bfd1c1cdb5206583 Mon Sep 17 00:00:00 2001 From: Erik Dasque Date: Fri, 15 Jul 2016 12:55:40 -0400 Subject: Adding Docker build system & documentation --- Dockerfile | 28 ++++++++++++++++++++++++++++ readme.md | 19 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..96ace4ec6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM debian:jessie +MAINTAINER Erik Dasque + +RUN apt-get update +RUN apt-get install --no-install-recommends -y build-essential \ + gcc \ + unzip \ + wget \ + zip \ + gcc-avr \ + binutils-avr \ + avr-libc \ + dfu-programmer \ + dfu-util \ + gcc-arm-none-eabi \ + binutils-arm-none-eabi \ + libnewlib-arm-none-eabi \ + git + +RUN apt-get clean +RUN rm -rf /var/lib/apt/lists/* + +ENV keyboard=ergodox_ez +ENV keymap=default + +VOLUME /qmk +WORKDIR /qmk +CMD make clean ; make keyboard=${keyboard} keymap=${keymap} \ No newline at end of file diff --git a/readme.md b/readme.md index e0dcd5608..7a970eea0 100644 --- a/readme.md +++ b/readme.md @@ -75,6 +75,25 @@ Debian/Ubuntu example: sudo apt-get update sudo apt-get install gcc-avr avr-libc dfu-programmer +### Docker + +If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following commands at the root of the QMK folder: + +```bash +# You only need to run this once, it'll take a little while + +docker build -t qmk . + +# and you'll run this every time you want to build a keymap +# modify the keymap and keyboard assigment to compile what you want +# defaults are ergodox_ez/default + +docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw qmk + +``` + +This will compile the targetted keyboard/keymap and leave it in your QMK directory for you to flash. + ### Vagrant If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](VAGRANT_GUIDE.md). -- cgit v1.2.3-24-g4f1b From aa2a79bbfa5e5134fc83daf5732ca4774edf2dc2 Mon Sep 17 00:00:00 2001 From: Erik Dasque Date: Fri, 15 Jul 2016 13:26:34 -0400 Subject: Further simplyfying the docker usage We'll be able to change the image user name if we set up the initial repo to trigger Docker images rebuilds on hub.docker.com --- readme.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 7a970eea0..ecad173fa 100644 --- a/readme.md +++ b/readme.md @@ -77,18 +77,14 @@ Debian/Ubuntu example: ### Docker -If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following commands at the root of the QMK folder: +If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap: ```bash -# You only need to run this once, it'll take a little while - -docker build -t qmk . - -# and you'll run this every time you want to build a keymap +# You'll run this every time you want to build a keymap # modify the keymap and keyboard assigment to compile what you want # defaults are ergodox_ez/default -docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw qmk +docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware ``` -- cgit v1.2.3-24-g4f1b From 1a7e954f9fc4d250ba1ae46e3bfc168aca2b5cce Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Wed, 13 Jul 2016 00:20:28 +0200 Subject: in case its NULL --- quantum/process_keycode/process_tap_dance.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 9b172e1b6..186889bc2 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -22,7 +22,9 @@ static void _process_tap_dance_action_pair (qk_tap_dance_state_t *state, static void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, qk_tap_dance_user_fn_t fn) { - fn(state); + if (fn) { + fn(state); + } } void process_tap_dance_action (uint16_t keycode) -- cgit v1.2.3-24-g4f1b From f3b56701ed7e6c622dc48e429780124ba5fde172 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Wed, 13 Jul 2016 16:47:45 +0200 Subject: add an `anyway` and a `reset` callback when using tap dance, we have the `regular` callback that is called on the last tap. this commit adds an `anyway` callback that is called on every tap, and a `reset` callback that is called on reset of the tap dance taps. --- quantum/process_keycode/process_tap_dance.c | 36 ++++++++++++++++++++++++++++- quantum/process_keycode/process_tap_dance.h | 28 ++++++++++++++++++---- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 186889bc2..40fba2a6a 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -40,7 +40,24 @@ void process_tap_dance_action (uint16_t keycode) action.pair.kc1, action.pair.kc2); break; case QK_TAP_DANCE_TYPE_FN: - _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn); + _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.regular); + break; + + default: + break; + } +} + +void process_tap_dance_action_anyway (uint16_t keycode) +{ + uint16_t idx = keycode - QK_TAP_DANCE; + qk_tap_dance_action_t action; + + action = tap_dance_actions[idx]; + + switch (action.type) { + case QK_TAP_DANCE_TYPE_FN: + _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.anyway); break; default: @@ -53,6 +70,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: + process_tap_dance_action_anyway (qk_tap_dance_state.keycode); if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { process_tap_dance_action (qk_tap_dance_state.keycode); } else { @@ -68,6 +86,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { default: if (qk_tap_dance_state.keycode) { + //process_tap_dance_action_anyway (qk_tap_dance_state.keycode); process_tap_dance_action (qk_tap_dance_state.keycode); reset_tap_dance (&qk_tap_dance_state); @@ -87,6 +106,21 @@ void matrix_scan_tap_dance () { } void reset_tap_dance (qk_tap_dance_state_t *state) { + uint16_t idx = state->keycode - QK_TAP_DANCE; + qk_tap_dance_action_t action; + + action = tap_dance_actions[idx]; + switch (action.type) { + case QK_TAP_DANCE_TYPE_FN: + if (action.fn.reset) { + action.fn.reset(); + } + break; + + default: + break; + } + state->keycode = 0; state->count = 0; } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index b9d7c7fcf..bf925df0f 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -22,6 +22,7 @@ typedef enum } qk_tap_dance_type_t; typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state); +typedef void (*qk_tap_dance_user_fn_reset_t) (void); typedef struct { @@ -31,18 +32,37 @@ typedef struct uint16_t kc1; uint16_t kc2; } pair; - qk_tap_dance_user_fn_t fn; + struct { + qk_tap_dance_user_fn_t regular; + qk_tap_dance_user_fn_t anyway; + qk_tap_dance_user_fn_reset_t reset; + } fn; }; } qk_tap_dance_action_t; #define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \ - .type = QK_TAP_DANCE_TYPE_PAIR, \ - .pair = { kc1, kc2 } \ + .type = QK_TAP_DANCE_TYPE_PAIR, \ + .pair = { kc1, kc2 } \ } #define ACTION_TAP_DANCE_FN(user_fn) { \ .type = QK_TAP_DANCE_TYPE_FN, \ - .fn = user_fn \ + .fn = { user_fn, NULL, NULL } \ + } + +#define ACTION_TAP_DANCE_FN_ANYWAY(user_fn, user_fn_anyway) { \ + .type = QK_TAP_DANCE_TYPE_FN, \ + .fn = { user_fn, user_fn_anyway, NULL } \ + } + +#define ACTION_TAP_DANCE_FN_RESET(user_fn, user_fn_reset) { \ + .type = QK_TAP_DANCE_TYPE_FN, \ + .fn = { user_fn, NULL, user_fn_reset } \ + } + +#define ACTION_TAP_DANCE_FN_ANYWAY_RESET(user_fn, user_fn_anyway, user_fn_reset) { \ + .type = QK_TAP_DANCE_TYPE_FN, \ + .fn = { user_fn, user_fn_anyway, user_fn_reset } \ } extern const qk_tap_dance_action_t tap_dance_actions[]; -- cgit v1.2.3-24-g4f1b From f13f48a35e1a2b0851bb9967976f39f2e233f838 Mon Sep 17 00:00:00 2001 From: Jonathan Lucas Date: Sat, 16 Jul 2016 20:24:14 -0700 Subject: Added CMD60 keymap --- keyboards/handwired/CMD60/CMD60.c | 8 + keyboards/handwired/CMD60/CMD60.h | 20 +++ keyboards/handwired/CMD60/Makefile | 73 ++++++++++ keyboards/handwired/CMD60/README.md | 35 +++++ keyboards/handwired/CMD60/config.h | 162 +++++++++++++++++++++ keyboards/handwired/CMD60/keymaps/default/keymap.c | 66 +++++++++ 6 files changed, 364 insertions(+) create mode 100644 keyboards/handwired/CMD60/CMD60.c create mode 100644 keyboards/handwired/CMD60/CMD60.h create mode 100644 keyboards/handwired/CMD60/Makefile create mode 100644 keyboards/handwired/CMD60/README.md create mode 100644 keyboards/handwired/CMD60/config.h create mode 100644 keyboards/handwired/CMD60/keymaps/default/keymap.c diff --git a/keyboards/handwired/CMD60/CMD60.c b/keyboards/handwired/CMD60/CMD60.c new file mode 100644 index 000000000..799848e34 --- /dev/null +++ b/keyboards/handwired/CMD60/CMD60.c @@ -0,0 +1,8 @@ +#include "CMD60.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/handwired/CMD60/CMD60.h b/keyboards/handwired/CMD60/CMD60.h new file mode 100644 index 000000000..f90871fc7 --- /dev/null +++ b/keyboards/handwired/CMD60/CMD60.h @@ -0,0 +1,20 @@ +#ifndef CMD60_H +#define CMD60_H + +#include "quantum.h" + +#define KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K45, K4A, K4B, K4C, K4D \ + ) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO,K4A, K4B, K4C, K4D } \ +} + +#endif \ No newline at end of file diff --git a/keyboards/handwired/CMD60/Makefile b/keyboards/handwired/CMD60/Makefile new file mode 100644 index 000000000..711759917 --- /dev/null +++ b/keyboards/handwired/CMD60/Makefile @@ -0,0 +1,73 @@ + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# change yes to no to disable +# +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 ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../../Makefile +endif + + diff --git a/keyboards/handwired/CMD60/README.md b/keyboards/handwired/CMD60/README.md new file mode 100644 index 000000000..83e371543 --- /dev/null +++ b/keyboards/handwired/CMD60/README.md @@ -0,0 +1,35 @@ +CMD60 keyboard firmware +====================== + +##CMD60 + +This layout has been designed to optimize use of the left-hand, and it focussed specifically on programmers who work +with text editors like SublimeText and Atom. It utilizes the power of Space_fn, and features a caps lock swap for Fn2 +and enter key on tap. These features allow you to keep your right hand on the mouse more and should enable you to +achieve a higher level of productivity if you take the time to learn its function layers. + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/handwired/CMD60 folder. +Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use +the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make`. + +### Other Keymaps + +To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: + +``` +$ make keymap=[default|jack|] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/handwired/CMD60/config.h b/keyboards/handwired/CMD60/config.h new file mode 100644 index 000000000..5e28dc17b --- /dev/null +++ b/keyboards/handwired/CMD60/config.h @@ -0,0 +1,162 @@ +7/* +Copyright 2012 Jun Wako + +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 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER cmd +#define PRODUCT CMD60 +#define DESCRIPTION Advanced Programming Keeb Layout + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, F4, F5, F6, F7 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, B7, D0, D1, D2, D3, C6, D7, B4, B5, B6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/handwired/CMD60/keymaps/default/keymap.c b/keyboards/handwired/CMD60/keymaps/default/keymap.c new file mode 100644 index 000000000..9f9cbcd66 --- /dev/null +++ b/keyboards/handwired/CMD60/keymaps/default/keymap.c @@ -0,0 +1,66 @@ +#include "CMD60.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP( /* CMD60 - QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + LT(3, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_NO, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, LT(2, KC_SPC), MO(3), MO(4), MO(5), TG(1) \ + ), + [1] = KEYMAP( /* CMD60 - GameMode */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_RSFT, \ + KC_TRNS, KC_NO, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [2] = KEYMAP( /* CMD60 - Arrows */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_BSPC, KC_UP, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [3] = KEYMAP( /* CMD60 - Functions */ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_AUDIO_MUTE, KC_BSPC, KC_PGUP, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_PAUSE, KC_SLCK, KC_PSCREEN, \ + KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_INSERT, KC_NO, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [4] = KEYMAP( /* CMD60 - Mouse */ + KC_SYSTEM_SLEEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_TRNS, KC_NO, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_WH_UP, KC_MS_BTN3, KC_MS_WH_DOWN, KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + [5] = KEYMAP( /* CMD60 - Media */ + KC_SYSTEM_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, KC_MEDIA_PLAY_PAUSE, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WWW_BACK, KC_WWW_FORWARD, KC_NO, KC_NO, KC_WWW_REFRESH, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; -- cgit v1.2.3-24-g4f1b From 2877b858d398b64787f679e7826cecce26dbb33f Mon Sep 17 00:00:00 2001 From: Jonathan Lucas Date: Sat, 16 Jul 2016 20:38:55 -0700 Subject: Fix erroneous character Must have been keeb testing :) --- keyboards/handwired/CMD60/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/handwired/CMD60/config.h b/keyboards/handwired/CMD60/config.h index 5e28dc17b..27eb400b8 100644 --- a/keyboards/handwired/CMD60/config.h +++ b/keyboards/handwired/CMD60/config.h @@ -1,4 +1,4 @@ -7/* +/* Copyright 2012 Jun Wako This program is free software: you can redistribute it and/or modify -- cgit v1.2.3-24-g4f1b From dddaebfa9829ef48f93f2be7119b9790271f8892 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 16 Jul 2016 23:41:20 -0400 Subject: update readme images --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index e0dcd5608..07280c2b4 100644 --- a/readme.md +++ b/readme.md @@ -774,7 +774,7 @@ AutoHotkey inserts the Text right of `Send, ` when this combination is pressed. ## RGB Under Glow Mod -![Planck with RGB Underglow](https://raw.githubusercontent.com/yangliu/qmk_firmware/planck-rgb/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg) +![Planck with RGB Underglow](https://raw.githubusercontent.com/jackhumbert/qmk_firmware/master/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg) Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY). @@ -799,7 +799,7 @@ The firmware supports 5 different light effects, and the color (hue, saturation, ### WS2812 Wiring -![WS2812 Wiring](https://raw.githubusercontent.com/yangliu/qmk_firmware/planck-rgb/keyboards/planck/keymaps/yang/WS2812-wiring.jpg) +![WS2812 Wiring](https://raw.githubusercontent.com/jackhumbert/qmk_firmware/master/keyboards/planck/keymaps/yang/WS2812-wiring.jpg) Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20. -- cgit v1.2.3-24-g4f1b From f9542237499c7f4f211ef88114d6a469ef69a38e Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 16 Jul 2016 23:51:27 -0400 Subject: update makefile to default to no virtual dip switches --- keyboards/satan/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/satan/Makefile b/keyboards/satan/Makefile index 184b5ac37..a0879fc9c 100644 --- a/keyboards/satan/Makefile +++ b/keyboards/satan/Makefile @@ -52,7 +52,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) CONSOLE_ENABLE ?= yes # Console for debug(+400) -- cgit v1.2.3-24-g4f1b From 6289332759938781ba1043168df894f844aa55e2 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 16 Jul 2016 23:52:02 -0400 Subject: add custom makefile for sethbc keymap --- keyboards/satan/keymaps/sethbc/Makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 keyboards/satan/keymaps/sethbc/Makefile diff --git a/keyboards/satan/keymaps/sethbc/Makefile b/keyboards/satan/keymaps/sethbc/Makefile new file mode 100644 index 000000000..2a7ff2779 --- /dev/null +++ b/keyboards/satan/keymaps/sethbc/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif -- cgit v1.2.3-24-g4f1b From d3091faf363afc8fef73ddf4948f872439b0e827 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Fri, 15 Jul 2016 23:54:08 +0200 Subject: change naming, and remove extraneous definition --- quantum/process_keycode/process_tap_dance.c | 32 ++++++++++++++--------------- quantum/process_keycode/process_tap_dance.h | 27 ++++++++---------------- 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 40fba2a6a..93b326b5f 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -27,7 +27,7 @@ static void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, } } -void process_tap_dance_action (uint16_t keycode) +void process_tap_dance_action_on_each_tap (uint16_t keycode) { uint16_t idx = keycode - QK_TAP_DANCE; qk_tap_dance_action_t action; @@ -35,12 +35,8 @@ void process_tap_dance_action (uint16_t keycode) action = tap_dance_actions[idx]; switch (action.type) { - case QK_TAP_DANCE_TYPE_PAIR: - _process_tap_dance_action_pair (&qk_tap_dance_state, - action.pair.kc1, action.pair.kc2); - break; case QK_TAP_DANCE_TYPE_FN: - _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.regular); + _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.on_each_tap); break; default: @@ -48,7 +44,7 @@ void process_tap_dance_action (uint16_t keycode) } } -void process_tap_dance_action_anyway (uint16_t keycode) +void process_tap_dance_action_on_dance_finished (uint16_t keycode) { uint16_t idx = keycode - QK_TAP_DANCE; qk_tap_dance_action_t action; @@ -56,8 +52,12 @@ void process_tap_dance_action_anyway (uint16_t keycode) action = tap_dance_actions[idx]; switch (action.type) { + case QK_TAP_DANCE_TYPE_PAIR: + _process_tap_dance_action_pair (&qk_tap_dance_state, + action.pair.kc1, action.pair.kc2); + break; case QK_TAP_DANCE_TYPE_FN: - _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.anyway); + _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.on_dance_finished); break; default: @@ -70,9 +70,9 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: - process_tap_dance_action_anyway (qk_tap_dance_state.keycode); + process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { - process_tap_dance_action (qk_tap_dance_state.keycode); + process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); } else { r = false; } @@ -85,10 +85,9 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { break; default: + process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); if (qk_tap_dance_state.keycode) { - //process_tap_dance_action_anyway (qk_tap_dance_state.keycode); - process_tap_dance_action (qk_tap_dance_state.keycode); - + process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); reset_tap_dance (&qk_tap_dance_state); } break; @@ -99,8 +98,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { void matrix_scan_tap_dance () { if (qk_tap_dance_state.keycode && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { - process_tap_dance_action (qk_tap_dance_state.keycode); - + process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); reset_tap_dance (&qk_tap_dance_state); } } @@ -112,8 +110,8 @@ void reset_tap_dance (qk_tap_dance_state_t *state) { action = tap_dance_actions[idx]; switch (action.type) { case QK_TAP_DANCE_TYPE_FN: - if (action.fn.reset) { - action.fn.reset(); + if (action.fn.on_reset) { + action.fn.on_reset(state); } break; diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index bf925df0f..7b820584a 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -22,7 +22,6 @@ typedef enum } qk_tap_dance_type_t; typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state); -typedef void (*qk_tap_dance_user_fn_reset_t) (void); typedef struct { @@ -33,9 +32,9 @@ typedef struct uint16_t kc2; } pair; struct { - qk_tap_dance_user_fn_t regular; - qk_tap_dance_user_fn_t anyway; - qk_tap_dance_user_fn_reset_t reset; + qk_tap_dance_user_fn_t on_each_tap; + qk_tap_dance_user_fn_t on_dance_finished; + qk_tap_dance_user_fn_t on_reset; } fn; }; } qk_tap_dance_action_t; @@ -45,24 +44,14 @@ typedef struct .pair = { kc1, kc2 } \ } -#define ACTION_TAP_DANCE_FN(user_fn) { \ +#define ACTION_TAP_DANCE_FN(user_fn) { \ .type = QK_TAP_DANCE_TYPE_FN, \ - .fn = { user_fn, NULL, NULL } \ + .fn = { NULL, user_fn, NULL } \ } -#define ACTION_TAP_DANCE_FN_ANYWAY(user_fn, user_fn_anyway) { \ - .type = QK_TAP_DANCE_TYPE_FN, \ - .fn = { user_fn, user_fn_anyway, NULL } \ - } - -#define ACTION_TAP_DANCE_FN_RESET(user_fn, user_fn_reset) { \ - .type = QK_TAP_DANCE_TYPE_FN, \ - .fn = { user_fn, NULL, user_fn_reset } \ - } - -#define ACTION_TAP_DANCE_FN_ANYWAY_RESET(user_fn, user_fn_anyway, user_fn_reset) { \ - .type = QK_TAP_DANCE_TYPE_FN, \ - .fn = { user_fn, user_fn_anyway, user_fn_reset } \ +#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset) { \ + .type = QK_TAP_DANCE_TYPE_FN, \ + .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \ } extern const qk_tap_dance_action_t tap_dance_actions[]; -- cgit v1.2.3-24-g4f1b From 38508180c755158a1933bc74b1b294bab3dd4c57 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 17 Jul 2016 03:24:00 -0400 Subject: update readmes in certain directories to work with qmk.fm --- keyboards/clueboard/readme.md | 4 ++++ keyboards/cluepad/readme.md | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 keyboards/clueboard/readme.md create mode 100644 keyboards/cluepad/readme.md diff --git a/keyboards/clueboard/readme.md b/keyboards/clueboard/readme.md new file mode 100644 index 000000000..aa301f020 --- /dev/null +++ b/keyboards/clueboard/readme.md @@ -0,0 +1,4 @@ +Clueboard keyboard firmware +====================== + +TODO: to be updated. diff --git a/keyboards/cluepad/readme.md b/keyboards/cluepad/readme.md new file mode 100644 index 000000000..8450340f2 --- /dev/null +++ b/keyboards/cluepad/readme.md @@ -0,0 +1,4 @@ +Cluepad number pad firmware +====================== + +TODO: to be updated. -- cgit v1.2.3-24-g4f1b From a95ab371627073a85ae420118ac7d1d55a096583 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 17 Jul 2016 03:24:36 -0400 Subject: update link to Vagrant docfile --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 07280c2b4..a8ed51b81 100644 --- a/readme.md +++ b/readme.md @@ -76,7 +76,7 @@ Debian/Ubuntu example: sudo apt-get install gcc-avr avr-libc dfu-programmer ### Vagrant -If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](VAGRANT_GUIDE.md). +If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [VAGRANT_GUIDE file](doc/VAGRANT_GUIDE.md). ## Verify Your Installation 1. If you haven't already, obtain this repository ([https://github.com/jackhumbert/qmk_firmware](https://github.com/jackhumbert/qmk_firmware)). You can either download it as a zip file and extract it, or clone it using the command line tool git or the Github Desktop application. -- cgit v1.2.3-24-g4f1b From 45414fed7b4a61453aad6bbfd1d761177c16bf65 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 17 Jul 2016 03:28:48 -0400 Subject: update tmk link --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index a8ed51b81..a179d7aa2 100644 --- a/readme.md +++ b/readme.md @@ -35,7 +35,7 @@ This is not a tiny project. While this is the main readme, there are many other * The list of possible keycodes you can use in your keymap is actually spread out in a few different places: * [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes. * [quantum/keymap.h](quantum/keymap.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `keymap.h` is where they're actually defined. -* The [TMK documentation](doc/TMK_readme.md). QMK is based on TMK, and this explains how it works internally. +* The [TMK documentation](doc/TMK_README.md). QMK is based on TMK, and this explains how it works internally. # Getting started -- cgit v1.2.3-24-g4f1b From 68b1affbbd9be209c5b7dcbd39f222492be3314d Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 17 Jul 2016 03:32:02 -0400 Subject: update audio links --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index a179d7aa2..4ccf51f98 100644 --- a/readme.md +++ b/readme.md @@ -732,7 +732,7 @@ float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float goodbye[][2] = SONG(GOODBYE_SOUND); ``` -Wherein we bind predefined songs (from [audio/song_list.h](/audio/song_list.h)) into named variables. This is one optimization that helps save on memory: These songs only take up memory when you reference them in your keymap, because they're essentially all preprocessor directives. +Wherein we bind predefined songs (from [quantum/audio/song_list.h](/quantum/audio/song_list.h)) into named variables. This is one optimization that helps save on memory: These songs only take up memory when you reference them in your keymap, because they're essentially all preprocessor directives. So now you have something called `tone_plover` for example. How do you make it play the Plover tune, then? If you look further down the keymap, you'll see this: -- cgit v1.2.3-24-g4f1b From 0a2653bac8950fed180cd2cf9e7a5caab8755cd2 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 17 Jul 2016 03:38:53 -0400 Subject: update broken link --- .../ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md index 4188d2b50..16cebd091 100644 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md +++ b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md @@ -10,7 +10,7 @@ There are four layers: Looking for IJKL arrows? [Here we go](../romanzolotarev-norman-plover-osx/). -[![keyboard-layout](romanzolotarev-norman-plover-osx-hjkl.png)](rttp://www.keyboard-layout-editor.com/#/gists/56ffedceb0668dda47c993e7271563e0) +[![keyboard-layout](romanzolotarev-norman-plover-osx-hjkl.png)](http://www.keyboard-layout-editor.com/#/gists/56ffedceb0668dda47c993e7271563e0) ## Switching -- cgit v1.2.3-24-g4f1b From f6aeaac5b549ff111f24b6d07c33a3f29b785823 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 17 Jul 2016 03:53:34 -0400 Subject: update more non-existent readmes for QMK.fm --- keyboards/alps64/readme.md | 4 ++++ keyboards/jd45/readme.md | 4 ++++ keyboards/phantom/readme.md | 4 ++++ keyboards/satan/readme.md | 4 ++++ 4 files changed, 16 insertions(+) create mode 100644 keyboards/alps64/readme.md create mode 100644 keyboards/jd45/readme.md create mode 100644 keyboards/phantom/readme.md create mode 100644 keyboards/satan/readme.md diff --git a/keyboards/alps64/readme.md b/keyboards/alps64/readme.md new file mode 100644 index 000000000..1798b193a --- /dev/null +++ b/keyboards/alps64/readme.md @@ -0,0 +1,4 @@ +Alps64 keyboard firmware +====================== + +TODO: to be updated. diff --git a/keyboards/jd45/readme.md b/keyboards/jd45/readme.md new file mode 100644 index 000000000..2822666e8 --- /dev/null +++ b/keyboards/jd45/readme.md @@ -0,0 +1,4 @@ +JD45 keyboard firmware +====================== + +TODO: to be updated. diff --git a/keyboards/phantom/readme.md b/keyboards/phantom/readme.md new file mode 100644 index 000000000..190f738fa --- /dev/null +++ b/keyboards/phantom/readme.md @@ -0,0 +1,4 @@ +Phantom keyboard firmware +====================== + +TODO: to be updated. diff --git a/keyboards/satan/readme.md b/keyboards/satan/readme.md new file mode 100644 index 000000000..aa301f020 --- /dev/null +++ b/keyboards/satan/readme.md @@ -0,0 +1,4 @@ +Clueboard keyboard firmware +====================== + +TODO: to be updated. -- cgit v1.2.3-24-g4f1b From de96513ff2f12e56a572b6f54db548725194c10b Mon Sep 17 00:00:00 2001 From: Toni Date: Sun, 17 Jul 2016 14:57:56 +0200 Subject: changes needed for a ISO satan PCB including a split right-shift key --- keyboards/satan/keymaps/iso_split_rshift/Makefile | 70 ++++++++ keyboards/satan/keymaps/iso_split_rshift/build.sh | 17 ++ keyboards/satan/keymaps/iso_split_rshift/config.h | 31 ++++ keyboards/satan/keymaps/iso_split_rshift/keymap.c | 192 +++++++++++++++++++++ .../satan/keymaps/iso_split_rshift/resetboard.sh | 4 + keyboards/satan/keymaps/iso_split_rshift/satan.c | 30 ++++ keyboards/satan/keymaps/iso_split_rshift/satan.h | 96 +++++++++++ 7 files changed, 440 insertions(+) create mode 100644 keyboards/satan/keymaps/iso_split_rshift/Makefile create mode 100755 keyboards/satan/keymaps/iso_split_rshift/build.sh create mode 100644 keyboards/satan/keymaps/iso_split_rshift/config.h create mode 100644 keyboards/satan/keymaps/iso_split_rshift/keymap.c create mode 100755 keyboards/satan/keymaps/iso_split_rshift/resetboard.sh create mode 100644 keyboards/satan/keymaps/iso_split_rshift/satan.c create mode 100644 keyboards/satan/keymaps/iso_split_rshift/satan.h diff --git a/keyboards/satan/keymaps/iso_split_rshift/Makefile b/keyboards/satan/keymaps/iso_split_rshift/Makefile new file mode 100644 index 000000000..67eaa078f --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/Makefile @@ -0,0 +1,70 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/satan/keymaps/iso_split_rshift/build.sh b/keyboards/satan/keymaps/iso_split_rshift/build.sh new file mode 100755 index 000000000..2bfc3bb32 --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# adjust for cpu +# -j 16 gave best result on a hyperthreaded quad core core i7 +THREADS="-j 16" +echo "We need sudo later" +sudo ls 2>&1 /dev/null +make clean +make KEYMAP=toni77 ${THREADS} +if [[ $? -eq 0 ]] +then + echo "please trigger flashing! you have 5 seconds" + sleep 5 + sudo make KEYMAP=toni77 dfu ${THREADS} +else + echo "make failed" + exit 77 +fi diff --git a/keyboards/satan/keymaps/iso_split_rshift/config.h b/keyboards/satan/keymaps/iso_split_rshift/config.h new file mode 100644 index 000000000..39eec4b59 --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/config.h @@ -0,0 +1,31 @@ +/* +Copyright 2012 Jun Wako + +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_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + + +#define RGB_DI_PIN B2 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c new file mode 100644 index 000000000..fc07f6da8 --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -0,0 +1,192 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "satan.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DEF 0 +#define _SPC 1 +#define _TAB 2 +#define _SFX 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _DEF: Default Layer + * ,-----------------------------------------------------------.------------------------------------- + * |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1 !! + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP + * |-----------------------------------------------------------| + * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is + * `-----------------------------------------------------------' LEFT DWN RIGHT + */ +[_DEF] = KEYMAP_ISO_SPLITRSHIFT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + F(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, F(17), \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX),F(4), \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, F(5), F(6), F(7)) , + /* Keymap 1: F-and-vim Layer, modified with Space (Fn0) + * ,-----------------------------------------------------------.----------------------------------------- + * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete| + * |-----------------------------------------------------------| + * | |Paus| Up| | | | | | | | | | | | + * |-----------------------------------------------------------| + * | |Lft|Dwn|Rgt| | | |Left|Down|Right|Up| | PLAY | + * |-----------------------------------------------------------| + * | | | | | | |M0 | | | | | Vol+ | | + * |-----------------------------------------------------------| + * | | | | |Alt |Prev|Vol-|Next| + * `-----------------------------------------------------------' + */ +[_SPC] = KEYMAP_ISO_SPLITRSHIFT( + KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE,M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT) , + + /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (Fn1) + * ,-----------------------------------------------------------.----------------------------------------- + * |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | |Pos1|PgDn|PgUp|End| |Retrn | + * |-----------------------------------------------------------| + * | | | | | | |AF2| | | | | PgUp | | + * |-----------------------------------------------------------| + * | | | | |Alt |Pos1|PgDn|End | + * `-----------------------------------------------------------' + */ +[_TAB] = KEYMAP_ISO_SPLITRSHIFT( + KC_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END) , + + /* Keymap 3: Split right shift Numpad toggle Layer (Fn2) + * ,-----------------------------------------------------------.----------------------------------------- + * |RSET| | | | | | | 7| 8| 9| | | |Backsp | + * |-----------------------------------------------------------| + * | | | | | | | | 4 | 5 | 6 | | | | \ | + * |-----------------------------------------------------------| + * | | L | L | | | | | 1 | 2 | 3 | | | Return | + * |-----------------------------------------------------------| + * | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent + * |-----------------------------------------------------------| LED controlling + * |Ctrl|Win |Alt | |Alt |Left|Down|Right| + * `-----------------------------------------------------------' + */ +[_SFX] = KEYMAP_ISO_SPLITRSHIFT( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, \ + KC_TRNS, F(9), F(10), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ + KC_TRNS, F(11), F(12), F(13), F(14), F(15), F(16), KC_TRNS, KC_TRNS, KC_0, KC_TRNS, KC_SLSH, KC_TRNS, KC_UP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT) , + +}; + +enum function_id { + LAUNCH, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_SPC, KC_SPACE), + [1] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC), + [2] = ACTION_LAYER_TAP_KEY(_TAB, KC_TAB), + [3] = ACTION_LAYER_TOGGLE(_SFX), + [4] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_UP), + [5] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_LEFT), + [6] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_DOWN), + [7] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_RIGHT), + [8] = ACTION_FUNCTION(LAUNCH), + [9] = ACTION_FUNCTION(RGBLED_TOGGLE), + [10] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [11] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [12] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [13] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [14] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [15] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [16] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + [17] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + return (record->event.pressed ? + MACRO( D(RALT), T(SPC), U(RALT), END ) + :MACRO( END )); + break; + case 1: + return (record->event.pressed ? + MACRO( D(LALT), T(F2), U(LALT), END ) + :MACRO( END )); + break; + } + return MACRO_NONE; +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case RGBLED_TOGGLE: + //led operations + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + } +} diff --git a/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh b/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh new file mode 100755 index 000000000..d955ccf54 --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/resetboard.sh @@ -0,0 +1,4 @@ +#!/bin/bash +sudo dfu-programmer atmega32u4 erase --force +sudo dfu-programmer atmega32u4 flash clear_flash.hex +sudo dfu-programmer atmega32u4 reset diff --git a/keyboards/satan/keymaps/iso_split_rshift/satan.c b/keyboards/satan/keymaps/iso_split_rshift/satan.c new file mode 100644 index 000000000..d2c5d5c20 --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/satan.c @@ -0,0 +1,30 @@ +#include "satan.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + DDRB |= (1<<2); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1< Date: Sun, 17 Jul 2016 15:10:14 +0200 Subject: helper file for me to stay up-to-date with master --- keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh diff --git a/keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh b/keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh new file mode 100755 index 000000000..d17ec76ec --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh @@ -0,0 +1,4 @@ +#!/bin/bash +git checkout iso_split_rshift # gets you "on branch dmgr2" +git fetch origin # gets you up to date with origin +git merge origin/master -- cgit v1.2.3-24-g4f1b From d40d18ab1ae8a1ef9feb408e43d4b840d37998a8 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sun, 17 Jul 2016 10:37:45 -0400 Subject: don't believe the hex files are posted to qmk.fm --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 4ccf51f98..b55659c7a 100644 --- a/readme.md +++ b/readme.md @@ -97,7 +97,7 @@ In every keymap folder, the following files are recommended: The `make` command is how you compile the firmware into a .hex file, which can be loaded by a dfu programmer (like dfu-progammer via `make dfu`) or the [Teensy loader](https://www.pjrc.com/teensy/loader.html) (only used with Teensys). You can run `make` from the root (`/`), your keyboard folder (`/keyboards//`), or your keymap folder (`/keyboards//keymaps//`) if you have a `Makefile` there (see the example [here](/doc/keymap_makefile_example.mk)). -By default, this will generate a `_.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests. Your .hex file will also be available on qmk.fm/keyboards//keymaps//. +By default, this will generate a `_.hex` file in whichever folder you run `make` from. These files are ignored by git, so don't worry about deleting them when committing/creating pull requests. Below are some definitions that will be useful: -- cgit v1.2.3-24-g4f1b From 8c8f2f898ba07e10091b4737d48c3a5e9ecdd95f Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 13:02:54 -0500 Subject: Add empty arrow layer, reorder some keys in media, map layer keys --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 65 ++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 11 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 54427a2f4..4c2948b88 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -4,7 +4,8 @@ #define BASE 0 // default layer #define SYMB 1 // symbols -#define MDIA 2 // media keys +#define ARRW 2 // media keys +#define MDIA 3 // media keys const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -42,19 +43,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,LT(ARRW, KC_RGHT), ALT_T(KC_APP), KC_LGUI, KC_HOME, CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + LT(MDIA, KC_UP), KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) ), /* Keymap 1: Symbol Layer * @@ -120,6 +121,48 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ // MEDIA AND MOUSE +[ARRW] = KEYMAP( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE [MDIA] = KEYMAP( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, @@ -134,7 +177,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WBAK -- cgit v1.2.3-24-g4f1b From 6dc5aba315bea486e025fcc439a5f7b316968b10 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 13:09:54 -0500 Subject: Minor changes --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 4c2948b88..f52e9f397 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -4,8 +4,8 @@ #define BASE 0 // default layer #define SYMB 1 // symbols -#define ARRW 2 // media keys -#define MDIA 3 // media keys +#define ARRW 2 // arrow keys +#define MDIA 3 // media keys, including mouse const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -134,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -- cgit v1.2.3-24-g4f1b From f76f5af8539e048c4fdb91461e56269853346338 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 13:14:04 -0500 Subject: Add arrow keys to layer --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index f52e9f397..e67f8adb2 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -134,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -- cgit v1.2.3-24-g4f1b From d7b1cee2dfb06fc7262890a1dbe438ec18f869e0 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 13:19:11 -0500 Subject: Edit visual keymap --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index e67f8adb2..9f387d7ab 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -99,24 +99,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -/* Keymap 2: Media and mouse keys +/* Keymap 2: Arrow keys * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | + * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | + * | | | | | | |------| |------| | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | + * | | | | | | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | + * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | + * | | | | | | | | + * | | |------| |------| | | * | | | | | | | | * `--------------------' `--------------------' */ @@ -141,7 +141,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), -/* Keymap 2: Media and mouse keys +/* Keymap 3: Media and mouse keys * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | @@ -152,7 +152,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | | Prev | Next | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | + * | | | | | | | | |VolUp |VolDn | Mute | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | -- cgit v1.2.3-24-g4f1b From ec505d07d20abadf6985ef0d817a49814446ad20 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 13:35:47 -0500 Subject: Remove unnecessary modifiers --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 9f387d7ab..689378bf8 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -41,19 +41,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,LT(ARRW, KC_RGHT), ALT_T(KC_APP), KC_LGUI, KC_HOME, CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - LT(MDIA, KC_UP), KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + LT(MDIA, KC_UP), KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + KC_LALT, KC_ESC, KC_PGUP, KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) ), -- cgit v1.2.3-24-g4f1b From 742d6dbdc2e6985bff6280d608e7a91c00696a2c Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 13:55:10 -0500 Subject: Reorganize media keys --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 689378bf8..b6e5f292c 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,LT(ARRW, KC_RGHT), ALT_T(KC_APP), KC_LGUI, KC_HOME, @@ -106,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | + * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -148,17 +148,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | | | MsUp | | | | | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | + * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | + * | | |Mute |VolDn | VolUp| | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | |VolUp |VolDn | Mute | + * | | | Prev | Play | Next | | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | + * |Brwser| | | | | | | + * |Back | |------| |------| | | * | | | | | | | | * `--------------------' `--------------------' */ @@ -167,20 +167,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, + KC_WBAK, KC_TRNS, KC_TRNS, // right hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK + KC_TRNS, KC_TRNS, KC_TRNS ), }; -- cgit v1.2.3-24-g4f1b From f83591cff0910b24ed88961e564871ad32d1076b Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 14:02:46 -0500 Subject: Change visual --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index b6e5f292c..bf4b258e7 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -15,9 +15,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |esc/ctrl| A | S | D | F | G |------| |------| H | J | K | L |; / L2|'/ ctrl | + * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' -- cgit v1.2.3-24-g4f1b From 76b5dc84af9a60fb8bba88072f7f4711206b5ad0 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 14:11:08 -0500 Subject: Add page up/down and home/end to arrow --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index bf4b258e7..f391b80f4 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -104,11 +104,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | + * | | | | | | | | | | |PGDOWN| PGUP | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | + * | | | | | | | | | | | HOME | END | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' @@ -132,11 +132,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_PGDOWN, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -- cgit v1.2.3-24-g4f1b From 266eacc9ec94c5447af2923d62aac4e01bd7d290 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 14:29:37 -0500 Subject: Remove more unnecessary buttons --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index f391b80f4..8bce4d230 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -19,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * |Grv/L1| | | |*ARRW*| | | | [ | ] | ~L1 | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | App | LGui | | Alt |Ctrl/Esc| @@ -42,8 +42,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT,LT(ARRW, KC_RGHT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV), KC_TRNS, KC_TRNS,KC_TRNS,MO(ARRW), ALT_T(KC_APP), KC_LGUI, KC_HOME, CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - LT(MDIA, KC_UP), KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + MO(MDIA), KC_TRNS, KC_LBRC,KC_RBRC, KC_FN1, KC_LALT, KC_ESC, KC_PGUP, KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) -- cgit v1.2.3-24-g4f1b From 7a5b7233f235e5b50ae5cf0aa357bc7f26285e41 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 14:43:21 -0500 Subject: Move modifier kyes around --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 8bce4d230..af390d2ed 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -19,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| | | |*ARRW*| | | | [ | ] | ~L1 | + * | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | App | LGui | | Alt |Ctrl/Esc| @@ -39,11 +39,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV), KC_TRNS, KC_TRNS,KC_TRNS,MO(ARRW), + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_TRNS, KC_GRV, KC_TRNS,MO(SYMB),MO(ARRW), ALT_T(KC_APP), KC_LGUI, KC_HOME, CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - MO(MDIA), KC_TRNS, KC_LBRC,KC_RBRC, KC_FN1, + MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, KC_LALT, KC_ESC, KC_PGUP, KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) -- cgit v1.2.3-24-g4f1b From cfa5a475d02e1faddd44ff1cfbde62d1a1155c60 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 14:44:37 -0500 Subject: Move dot in symbol layer --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index af390d2ed..95ab974bc 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -64,11 +64,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | + * | | | | | | | | | 0 | = | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | @@ -92,9 +92,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // right hand KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_DOT, KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS,KC_TRNS, KC_0, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -- cgit v1.2.3-24-g4f1b From cb25f1ad931b031c5ddde79398b68a91ad9cb21d Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 14:56:32 -0500 Subject: Remove more keys --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index 95ab974bc..e9af3e91a 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -11,7 +11,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -22,9 +22,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| + * | | | | | | * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | + * | | | | | | | | * | Space| Bksp |------| |------| Tab |Enter | * | ctrl | gui | Alt | | Alt | gui | ctrl | * `--------------------' `----------------------' @@ -39,22 +39,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [BASE] = KEYMAP( // layer 0 : default // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), KC_TRNS, KC_GRV, KC_TRNS,MO(SYMB),MO(ARRW), - ALT_T(KC_APP), KC_LGUI, - KC_HOME, + KC_TRNS, KC_TRNS, + KC_TRNS, CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, - KC_LALT, KC_ESC, - KC_PGUP, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) ), /* Keymap 1: Symbol Layer -- cgit v1.2.3-24-g4f1b From 1336b0198c2a41e6a1bc447e5dc42b04ff37bf70 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 15:32:53 -0500 Subject: Add caps lock; sucks that there is no light for it... --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c index e9af3e91a..7b8f0df74 100644 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ b/keyboard/ergodox_ez/keymaps/maz/keymap.c @@ -13,7 +13,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,--------------------------------------------------. ,--------------------------------------------------. * | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| @@ -29,10 +29,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | ctrl | gui | Alt | | Alt | gui | ctrl | * `--------------------' `----------------------' */ - // TODO: somehow map shit so you can hold down a button to override the macro hold down feature (e.g. override control hold so that holding a key and space/bksp/ent/tab will repeat those) ~~~~~~ this might be taken care of.... you can just tap once, then hold, and it does this shit :::))) ... not sure if this is desirable for most use-cases / situations - // TODO: maybe make almost identical layers but for wintdows and mac - // TODO: find a do nothing key, so you aren't tempted by useless keys - // TODO: add vi layer for arrow keys and shit on hjkl? // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing // If it accepts an argument (i.e, is a function), it doesn't need KC_. @@ -49,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, // right hand KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_CAPSLOCK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, -- cgit v1.2.3-24-g4f1b From abe8bfa3a6b4dfdf7f561c8028de807c0951d2f8 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 13:50:36 -0700 Subject: Update .gitignore to include VSCode setting. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7c1e434e3..849143352 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,4 @@ CMakeLists.txt .project .settings/ .idea +.browse.VC.db* \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 964c0641232643d66e3bf169feaadb2a86e8a59e Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 15:53:42 -0500 Subject: Update readme. My layout optimized for emacs & vim --- keyboard/ergodox_ez/keymaps/maz/readme.md | 88 +++++++++++++++++++++---------- 1 file changed, 61 insertions(+), 27 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index 0de7d3646..37dddab8a 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -1,13 +1,24 @@ # Introduction ## Motivation -I created this keymap in an attempt to optimize my typing experience in text editors and the command-line. +I created this keymap in an attempt to optimize my typing experience in text editors (vim and emacs) and the command-line. More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. ## Changes +There are some miscellaneous changes that I kind of forgot I made, such as moving the tilde key, but you can check out the visual layouts below, which I **have** kept up to date. +### Modifier Keys The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. You must hold each key down for a certain amount of time (forgot where this is specified) in order for the modifier key to activate. +### Layers +* an arrow layer (ARRW) has been created because the default arrow keys suck. Beware, these do use vim bindings because they're the best. +* the keys in the media layer have been moved around for a better experience (imo), especially with respect to the mouse +* the three layers (SYMB, MDIA, and ARRW) now have their own dedicated keys accessible by the thumbs in the basic layer +* caps lock has been put in place of the right-side `L1` toggle key because there was really no need to have two keys to toggle one layer, and caps lock is useful when writing queries + +### Removal Of Keys +I also removed a bunch of unnecessary keys that I wasn't going to use anyway. You'll see such keys are blank in the basic layer. I will probably add some more keys in place of these, but I'm fine for now; I just didn't want the distraction of extra keys I barely use. + ## Caveats ### Thumb Cluster Range I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: @@ -20,39 +31,62 @@ I think it's quite dangerous to put something like control on the same key as en # Keymap ## Keymap 0: Basic layer ``` - ,--------------------------------------------------. ,--------------------------------------------------. - | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - |esc/ctrl| A | S | D | F | G |------| |------| H | J | K | L |; / L2|'/ ctrl | - |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | App | LGui | | Alt |Ctrl/Esc| - ,------|------|------| |------+--------+------. - | | | Home | | PgUp | | | - | Space| Bksp |------| |------| Tab |Enter | - |[ctrl]| [gui]|[Alt] | |[Alt] | [gui] |[ctrl]| - `--------------------' `----------------------' + ,--------------------------------------------------. ,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+--------+------. + | | | | | | | | + | Space| Bksp |------| |------| Tab |Enter | + | ctrl | gui | Alt | | Alt | gui | ctrl | + `--------------------' `----------------------' ``` ## Keymap 1: Symbol Layer +The only change here is the *dot* (`.`) character moving from next to `0` next to `+` in order to move the layer keys in the correct position ``` ,--------------------------------------------------. ,--------------------------------------------------. | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | . | 0 | = | | + | | | | | | | | | 0 | = | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Keymap 2: Arrow Layer +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | | | | | | | | | | | | | | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | | | | | | | | |PGDOWN| PGUP | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | | | | | | HOME | END | | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | `----------------------------------' `----------------------------------' ,-------------. ,-------------. | | | | | | @@ -63,24 +97,24 @@ I think it's quite dangerous to put something like control on the same key as en `--------------------' `--------------------' ``` -## Keymap 2: Media and mouse keys +## Keymap 3: Media and mouse keys ``` ,--------------------------------------------------. ,--------------------------------------------------. | | | | | | | | | | | | | | | | |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| | | | | MsUp | | | | | | | | | | | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play | + | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | | | | | | | Prev | Next | | | + | | |Mute |VolDn | VolUp| | | | | | | | | | | `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | |VolUp |VolDn | Mute | | | + | | | Prev | Play | Next | | | | | | | `----------------------------------' `----------------------------------' ,-------------. ,-------------. | | | | | | ,------|------|------| |------+------+------. - | | | | | | |Brwser| - | | |------| |------| |Back | + |Brwser| | | | | | | + |Back | |------| |------| | | | | | | | | | | `--------------------' `--------------------' ``` -- cgit v1.2.3-24-g4f1b From b9102b4bfa1040b34425af9d15ebd0d31caa0207 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Sun, 17 Jul 2016 15:57:23 -0500 Subject: Update readme. My layout optimized for emacs & vim --- keyboard/ergodox_ez/keymaps/maz/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index 37dddab8a..dab06b8eb 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -15,6 +15,7 @@ The biggest changes from the ergodox ez default keymap are the modifiers on the * the keys in the media layer have been moved around for a better experience (imo), especially with respect to the mouse * the three layers (SYMB, MDIA, and ARRW) now have their own dedicated keys accessible by the thumbs in the basic layer * caps lock has been put in place of the right-side `L1` toggle key because there was really no need to have two keys to toggle one layer, and caps lock is useful when writing queries +** unfortunatley, caps lock is not indicated by an LED, so be careful. I use caps lock just like I do insert in vim; for a short burst of text. I always turn off caps lock when I change my focus ### Removal Of Keys I also removed a bunch of unnecessary keys that I wasn't going to use anyway. You'll see such keys are blank in the basic layer. I will probably add some more keys in place of these, but I'm fine for now; I just didn't want the distraction of extra keys I barely use. -- cgit v1.2.3-24-g4f1b From 973ea2f917001ed11238a3d2c747c602a2765298 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 13:58:43 -0700 Subject: LSpec: KC_GRV -> KC_EQL --- keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c index 778cbc63c..3e3763e3f 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c @@ -292,13 +292,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case LSpec: if (record->event.pressed) { if (record->tap.count && !record->tap.interrupted) { - register_code(KC_GRV); + register_code(KC_EQL); } else { layer_on(SPEC); } } else { if(record->tap.count && !record->tap.interrupted) { - unregister_code(KC_GRV); + unregister_code(KC_EQL); } else { layer_off(SPEC); } -- cgit v1.2.3-24-g4f1b From e900c39669d457263d2ded393f512e928a64c6a2 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 14:01:41 -0700 Subject: RSpec: KC_EQL -> KC_MINS --- keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c index 3e3763e3f..933d1d80c 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c @@ -352,13 +352,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case RSpec: if (record->event.pressed) { if (record->tap.count && !record->tap.interrupted) { - register_code(KC_EQL); + register_code(KC_MINS); } else { layer_on(SPEC); } } else { if(record->tap.count && !record->tap.interrupted) { - unregister_code(KC_EQL); + unregister_code(KC_MINS); } else { layer_off(SPEC); } -- cgit v1.2.3-24-g4f1b From 11f8d167eccf4b11f4405175c3a195717252c373 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 14:07:14 -0700 Subject: [BASE]: KC_MINS -> KC_GRV --- keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c index 933d1d80c..9c0a96ebb 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c @@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_PGUP ,KC_BSPC,KC_DEL ,KC_PGDN // right hand - ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) + ,KC_GRV ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) -- cgit v1.2.3-24-g4f1b From e9453b3fdc73a4b79bbc43024e0eeba9469e6910 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 14:08:22 -0700 Subject: Update Base Layer comment to match new layout. --- keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c index 9c0a96ebb..60b9afd3e 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /******* Base Layer ******************************************************************************************************** * * ,------------------------------------------------------. ,------------------------------------------------------. - * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | + * | Special =+ | 1 | 2 | 3 | 4 | 5 | ESC | | ` | 6 | 7 | 8 | 9 | 0 | -_ Special | * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| -- cgit v1.2.3-24-g4f1b From 11bf8355cf90b64d749d39cd49ec597a48e8beb9 Mon Sep 17 00:00:00 2001 From: Toni Date: Sun, 17 Jul 2016 23:13:49 +0200 Subject: new modifier "J" is crtl --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index fc07f6da8..a2623e0e0 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEF] = KEYMAP_ISO_SPLITRSHIFT( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ F(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, F(17), \ + F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, F(17), KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX),F(4), \ KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, F(5), F(6), F(7)) , /* Keymap 1: F-and-vim Layer, modified with Space (Fn0) @@ -124,7 +124,7 @@ const uint16_t PROGMEM fn_actions[] = { [14] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), [15] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), [16] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - [17] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), + [17] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_J), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -- cgit v1.2.3-24-g4f1b From ecc0fce210e398566ed9cfbd69887d729ef0d8bd Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 14:16:31 -0700 Subject: [BASE]: Meh, Hyper now have symbols on both sides Left: MEH_T(KC_BSLS),ALL_T(KC_SLSH) Right: ALL_T(KC_LBRC),MEH_T(KC_RBRC) --- keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c index 60b9afd3e..4654f1cb9 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c @@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | + * | LCtrl |Meh/\ |Hypr//| LAlt | LGui | | RGui | RAlt |Hypr/[|Meh/] | RCtrl | * `-----------------------------------' `-----------------------------------' * ,-------------. ,-------------. * | Home | End | | Left | Right| @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC ,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,M(LCaps) ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) -,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT,KC_LGUI +,KC_LCTL,MEH_T(KC_BSLS),ALL_T(KC_SLSH),KC_LALT,KC_LGUI ,KC_HOME,KC_END ,KC_PGUP ,KC_BSPC,KC_DEL ,KC_PGDN @@ -74,7 +74,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) - ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL + ,KC_RGUI,KC_RALT,ALL_T(KC_LBRC),MEH_T(KC_RBRC),KC_RCTL ,KC_LEFT ,KC_RGHT ,KC_UP ,KC_DOWN ,KC_ENT ,KC_SPC @@ -107,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) ,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV ,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB -,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT ,KC_LGUI +,KC_LCTL ,KC_MEH ,KC_HYPR ,KC_LALT ,KC_LGUI ,KC_LEFT ,KC_RGHT ,KC_UP ,KC_SPC ,KC_ENT ,KC_DOWN -- cgit v1.2.3-24-g4f1b From 5bf40bfb36fbd54dc154ef25c2dad41ddcb0b268 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 14:19:22 -0700 Subject: [MEDIA]: Remove Power, Sleep, Mail, MyComp I kept hitting these on accident while attempting to move the cursor or mouse. =P --- keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c index 4654f1cb9..dc0f8aa6c 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c @@ -127,9 +127,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,---------------------------------------------------------------. ,---------------------------------------------------------------. * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| - * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | + * | | |MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | | | * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| - * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | + * | | |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | | | * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' @@ -146,8 +146,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [MDIA] = KEYMAP( // left hand KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC -,KC_TRNS ,KC_POWER ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U -,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD +,KC_TRNS ,KC_NO ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U +,KC_TRNS ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD ,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D ,KC_LCTL ,KC_MEH ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 ,KC_WSTP ,KC_WREF @@ -155,8 +155,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_WBAK ,KC_NO ,KC_WHOM // right hand ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS - ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS - ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS + ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_TRNS + ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO ,KC_TRNS ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS ,GUI_T(KC_INS),ALT_T(KC_DEL),KC_HYPR ,KC_MEH ,KC_RCTL ,KC_MPRV ,KC_MNXT -- cgit v1.2.3-24-g4f1b From ea2b1670f61d166463d9edcba637564fca5d9a7a Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 14:56:37 -0700 Subject: Update description comment. --- keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c index dc0f8aa6c..ec6ceb96b 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c @@ -25,15 +25,16 @@ #define MDR 23 // mouse down right /* - * The Ordinary Layout for the Ergodox EZ keyboard, v4 + * teckinesis layout for ErgoDox (EZ) * + * Modifications from The Ordinary Layout v4 by Will Wolff-Myren willwm@gmail.com * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com * * No rights reserved. This software is in the public domain. * Credit me if you are friendly but if you're a jerk don't bother. * * Details: readme.md - * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary + * https://github.com/willwm/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/teckinesis */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -- cgit v1.2.3-24-g4f1b From 8fb407457857c48e16f27d1a774a08f2214d50e6 Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 15:04:50 -0700 Subject: Update readme.md * Updated layout images, json from Keyboard Layout Designer * Added links to Keyboard Layout Designer templates. * Added images of TECK, Kinesis layouts. --- .../keymaps/teckinesis/advantage_layout_win.png | Bin 0 -> 93337 bytes keyboards/ergodox_ez/keymaps/teckinesis/readme.md | 39 +++- .../keymaps/teckinesis/teck209layout.jpg | Bin 0 -> 89673 bytes .../keymaps/teckinesis/teckinesis-base.json | 200 ++++++++++----------- .../keymaps/teckinesis/teckinesis-base.png | Bin 94828 -> 93743 bytes .../keymaps/teckinesis/teckinesis-symbol.json | 130 +++++++------- .../keymaps/teckinesis/teckinesis-symbol.png | Bin 97055 -> 97350 bytes 7 files changed, 191 insertions(+), 178 deletions(-) create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/advantage_layout_win.png create mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teck209layout.jpg diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/advantage_layout_win.png b/keyboards/ergodox_ez/keymaps/teckinesis/advantage_layout_win.png new file mode 100644 index 000000000..0a1df6809 Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/teckinesis/advantage_layout_win.png differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md index e4881dbbf..c6f2c666f 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md +++ b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md @@ -2,15 +2,52 @@ *A blend of TECK and Kinesis layouts, based on ["The Ordinary Layout" by Nicholas Keene](http://qmk.fm/keyboards/ergodox_ez/keymaps/ordinary/#the-ordinary-layout-a-familiar-and-powerful-layout)* +I love "The Ordinary Layout", but I still use a [TECK](https://www.trulyergonomic.com/store/index.php) +at the office, and I found the transition back and forth to be a bit more difficult than I expected. + +This layout consists of only slight changes to "The Ordinary Layout" based on the layouts of the +[(original) TECK Model 209](https://www.trulyergonomic.com/store/layout-designer--configurator--reprogrammable--truly-ergonomic-mechanical-keyboard/#KTo7PD0+P0BBQkNERUw5394rNR4fICEi4yMkJSYnLS4xOBQaCBUXTBwYDBITLzDhBBYHCQorCw0ODzPl4B0bBhkFKhEQNjc05OPiSktOTSwoLFBSUU/mZQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX2BhAFZXAAAAAAAAAAAAXF1eVAAAAAAAAAAAAABZWltVAAAAAAAAAAAAYgBjAAAAAAAAAAAAWFcAAAAAAACTAQAMAiMBAAwBigEADAIhAQAMAZQBAAwBkgEADAGDAQAMALYBAAwAzQEADAC1AQAMAOIBAAwA6gEADADpAQAMALhJAEYAAAAAAEitR64AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACk6Ozw9Pj9AQUJDREVMOd/eKzUeHyAhIuMjJCUmJy0uMTgUGggVF0wcGAwSEy8w4QQWBwkKKwsNDg8z5eMdGwYZBSoREDY3NOfg4kpLTk0sKCxQUlFP5uQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF9gYQBWVwAAAAAAAAAAAFxdXlQAAAAAAAAAAAAAWVpbVQAAAAAAAAAAAGIAYwAAAAAAAAAAAFhXAAAAAAAAkwEADAIjAQAMAYoBAAwCIQEADAGUAQAMAZIBAAwBgwEADAC2AQAMAM0BAAwAtQEADADiAQAMAOoBAAwA6QEADAC4SQBGAAAAAABIrUeuAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) and +the [Kinesis Advantage](http://www.kinesis-ergo.com/wp-content/uploads/2013/06/advantage_layout_win.pdf) + ## The Base Layout ## +[Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/befd4c5800d92114aa9e50d4f7c0dfb0) \ ![teckinesis base layout](teckinesis-base.png) +### Changes from The Ordinary Layout ### + +* Moved KC_MINS from the key left of the 6 to the RSpec key. +* Moved KC_EQL from RSpec to LSpec. +* Moved KC_GRV from LSpec to the key left of the 6. +* Mdded KC_BSLS to the left Meh key. +* Added KC_SLSH to the left Hyper key. +* Added KC_LBRC to the right Hyper key. +* Added KC_RBRC to the right Meh key. + ## The Symbols Layer ## +[teckinesis (Symbols Layer)](http://www.keyboard-layout-editor.com/#/gists/e6ddc4e9e0d194b3e52ac0616238ab61) \ ![teckinesis symbols layout](teckinesis-symbol.png) +### Changes from The Ordinary Layout ### + +* None. + ## The Media Layer ## -(placeholder) +[teckinesis (Media Layer)](http://www.keyboard-layout-editor.com/#/gists/41ff65e6a7c490211fd6702fb34d9908) \ +![teckinesis media layout](teckinesis-media.png) + +### Changes from The Ordinary Layout ### + +* Removed Power, Sleep, Mail, My Computer keys. +(I kept hitting these while using the mouse/cursor. =P) + +## TECK Layout ## + +![TECK 209 Layout](teck209layout.jpg) + +## Kinesis Advantage Layout ## + +![Kinesis Advantage Layout](advantage_layout_win.png) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teck209layout.jpg b/keyboards/ergodox_ez/keymaps/teckinesis/teck209layout.jpg new file mode 100644 index 000000000..a97844f4f Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/teckinesis/teck209layout.jpg differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json index f1efab272..69fe28cf7 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json +++ b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json @@ -1,8 +1,8 @@ [ { - "name": "teckinesis", + "name": "teckinesis (Base Layer)", "author": "Will Wolff-Myren", - "notes": "# teckinesis Layout # \r\n\r\n*A blend of TECK and Kinesis layouts, based on [\"The Ordinary Layout\" by Nicholas Keene](http://qmk.fm/keyboards/ergodox_ez/keymaps/ordinary/#the-ordinary-layout-a-familiar-and-powerful-layout)*\r\n\r\n## The Base Layout ##\r\n\r\n(placeholder)\r\n\r\n## The Symbols Layer ##\r\n\r\n(placeholder)\r\n\r\n## The Media Layer ##\r\n\r\n(placeholder)", + "notes": "# teckinesis Layout # \r\n\r\n*A blend of TECK and Kinesis layouts, based on [\"The Ordinary Layout\" by Nicholas Keene](http://qmk.fm/keyboards/ergodox_ez/keymaps/ordinary/#the-ordinary-layout-a-familiar-and-powerful-layout)*\r\n\r\n## The Base Layout ##\r\n\r\n![teckinesis base layout](teckinesis-base.png)\r\n\r\n## The Symbols Layer ##\r\n\r\n![teckinesis symbols layout](teckinesis-symbol.png)\r\n\r\n## The Media Layer ##\r\n\r\n(placeholder)\r\n", "switchMount": "cherry", "switchBrand": "gateron", "switchType": "KS-3-Tea" @@ -15,7 +15,7 @@ { "x": 10.5 }, - ")\n0" + "*\n8" ], [ { @@ -26,59 +26,57 @@ { "x": 1 }, - "$\n4" - ], - [ + "$\n4", { - "y": -0.995, - "x": 14 + "x": 8.5 }, - "(\n9", + "&\n7", { "x": 1 }, - "_\n-" + "(\n9" ], [ { - "y": -0.8799999999999999, + "y": -0.875, "x": 5.5 }, "%\n5", - "^\n6", { - "x": 4.5 + "c": "#ff4444" }, - "&\n7", - "*\n8" + "Esc", + { + "x": 4.5, + "c": "#cccccc" + }, + "~\n`", + "^\n6" ], [ { "y": -0.875, - "x": 1.5 + "c": "#2277ff", + "w": 1.5 + }, + "Special\n\n+\n\n\n\nShift\n=", + { + "c": "#cccccc" }, "!\n1", { "x": 14.5 }, - "+\n=" - ], - [ + ")\n0", { - "y": -0.995, "c": "#2277ff", "w": 1.5 }, - "Media\n\nEsc\n\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "~\n`\nMedia\n\n\n\n\nShift" + "_\n\nSpecial\n\n\n\n-\nShift" ], [ { - "y": -0.3799999999999999, + "y": -0.375, "x": 3.5, "c": "#cccccc" }, @@ -127,30 +125,33 @@ [ { "y": -0.875, - "x": 1.5 + "c": "#2277ff", + "fa": [ + 0, + 0, + 4 + ], + "w": 1.5 + }, + "Media\n\n\n\n\n\nShift", + { + "c": "#cccccc" }, "Q", { "x": 14.5 }, - "P" - ], - [ + "P", { - "y": -0.9950000000000001, "c": "#2277ff", + "f": 3, "w": 1.5 }, - "Symbols\n\n?\n/\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "|\n\\\nSymbols\n\n\n\n\nShift" + "|\n\\\nMedia\n\n\n\n\nShift" ], [ { - "y": -0.3799999999999999, + "y": -0.375, "x": 3.5, "c": "#cccccc" }, @@ -193,36 +194,34 @@ [ { "y": -0.875, - "x": 1.5 + "c": "#2277ff", + "w": 1.5 + }, + "Symbols\n\n\n\n\n\nShift", + { + "c": "#cccccc" }, "A", { "x": 14.5 }, - ":\n;" - ], - [ + ":\n;", { - "y": -0.9950000000000001, "c": "#2277ff", + "f": 3, "w": 1.5 }, - "Capitals\n\n\n\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "\n\nCapitals\n\n\n\n\nShift" + "\"\n'\nSymbols\n\n\n\n\nShift" ], [ { - "y": -0.6299999999999999, + "y": -0.625, "x": 6.5, "c": "#54d6de", "fa": [ 0, 0, - 0, + 4, 1 ], "h": 1.5 @@ -279,109 +278,99 @@ [ { "y": -0.875, - "x": 1.5 + "c": "#2277ff", + "w": 1.5 + }, + "Capitals\n\n\n\n\n\nShift", + { + "c": "#cccccc" }, "Z", { "x": 14.5 }, - "?\n/" - ], - [ + "?\n/", { - "y": -0.9950000000000001, "c": "#2277ff", + "f": 3, "w": 1.5 }, - "Ctrl", - { - "x": 16.5, - "w": 1.5 - }, - "Ctrl" + "\n\nCapitals\n\n\n\n\nShift" ], [ { - "y": -0.3799999999999999, + "y": -0.375, "x": 3.5, - "c": "#77aaff" + "c": "#77aaff", + "fa": [ + 5, + 0, + 4, + 1 + ] }, - "Option\n\n\nLAlt", + "\n\n\nLAlt", { "x": 10.5 }, - "Option\n\n\nRAlt" + "\n\n\nRAlt" ], [ { "y": -0.875, "x": 2.5, - "f": 3 - }, - "Hyper\n\n}\n]", - { - "x": 1 + "fa": [ + 5, + 1 + ] }, - "Cmd\n\n\nSuper", + "\nHyper\n?\n/", { - "x": 8.5, + "x": 1, "fa": [ 5, - 0, - 0, 1, 0, - 0, - 0 + 1 ] }, "\n\n\nSuper", + { + "x": 8.5 + }, + "\n\n\nSuper", { "x": 1, "fa": [ - 5, - 0, - 0, 0, 0, 0, 1 ] }, - "\n\n~\n`\n\n\nHyper" + "{\n[\n\nHyper" ], [ { "y": -0.75, - "x": 0.5, - "f": 2 + "x": 0.5 }, - "Print\n\n\n\n\n\nScreen", + "Ctrl\n\n\nLCtrl", { - "f": 3 + "f2": 1 }, - "Meh\n\n{\n[", + "\nMeh\n|\n\\", { "x": 14.5, "fa": [ 0, 0, - 0, - 0, - 0, - 0, - 2 + 1, + 1 ] }, - "\n\n\"\n'\n\n\nMeh" - ], - [ - { - "y": -0.9950000000000001, - "x": 18, - "f": 2 - }, - "Special\n\n\n\n\n\nShift" + "}\n]\n\nMeh", + "Ctrl\n\n\nRCtrl" ], [ { @@ -390,20 +379,13 @@ "ry": 4.25, "y": -1, "x": 1, - "c": "#54d6de", - "f": 3 + "c": "#54d6de" }, "Home", "End" ], [ { - "fa": [ - 0, - 0, - 0, - 1 - ], "h": 2 }, "< Del\n\n\nBackspace", diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png index f1a5eda0d..7c4584e9f 100644 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png and b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json index 052c23da5..439d0128e 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json +++ b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json @@ -1,6 +1,7 @@ [ { - "name": "teckinesis (Symbols Layer)", + "name": "teckinesis (Symbol Layer)", + "author": "Will Wolff-Myren", "switchMount": "cherry", "switchBrand": "gateron", "switchType": "KS-3-Tea" @@ -14,7 +15,7 @@ { "x": 10.5 }, - "F10" + "F8" ], [ { @@ -25,60 +26,60 @@ { "x": 1 }, - "F4" - ], - [ + "F4", { - "y": -0.995, - "x": 14 + "x": 8.5 }, - "F9", + "F7", { "x": 1 }, - "F11" + "F9" ], [ { - "y": -0.8799999999999999, + "y": -0.875, "x": 5.5 }, "F5", - "F6", { - "x": 4.5 + "c": "#ff4444" }, - "F7", - "F8" - ], - [ + "Esc", { - "y": -0.875, - "x": 1.5 + "x": 4.5, + "c": "#bbddbb" }, - "F1" + "_\n\n\n\n\n\n-", + { + "c": "#99de2a" + }, + "F6" ], [ { - "y": -0.995, + "y": -0.875, "c": "#2277ff", "w": 1.5 }, - "Media\n\nEsc\n\n\n\nShift", + "Special\n\n\n\n\n\nShift", { - "x": 15.5, "c": "#99de2a" }, - "F12", + "F1", + { + "x": 14.5 + }, + "F10", { "c": "#2277ff", "w": 1.5 }, - "\n\nMedia\n\n\n\n\nShift" + "\n\nSpecial\n\n\n\n\nShift" ], [ { - "y": -0.3799999999999999, + "y": -0.375, "x": 3.5, "c": "#bbddbb" }, @@ -131,35 +132,30 @@ [ { "y": -0.875, - "x": 1.5 + "c": "#2277ff", + "w": 1.5 + }, + "Media\n\n\n\n\n\nShift", + { + "c": "#bbddbb" }, "!", { "x": 14.5, "c": "#89b087" }, - "/" - ], - [ + "/", { - "y": -0.9950000000000001, - "c": "#000000", - "t": "#ff0000", - "w": 1.5 - }, - "Symbols\n\n\n\n\n\nShift", - { - "x": 16.5, + "c": "#2277ff", "w": 1.5 }, - "\n\nSymbols\n\n\n\n\nShift" + "\n\nMedia\n\n\n\n\nShift" ], [ { - "y": -0.3799999999999999, + "y": -0.375, "x": 3.5, - "c": "#bbddbb", - "t": "#000000" + "c": "#bbddbb" }, "(", { @@ -204,33 +200,34 @@ [ { "y": -0.875, - "x": 1.5 + "c": "#000000", + "t": "#ff0000", + "w": 1.5 + }, + "Symbols\n\n\n\n\n\nShift", + { + "c": "#bbddbb", + "t": "#000000" }, "#", { "x": 14.5, "c": "#89b087" }, - "*" - ], - [ + "*", { - "y": -0.9950000000000001, - "c": "#2277ff", - "w": 1.5 - }, - "Capitals\n\n\n\n\n\nShift", - { - "x": 16.5, + "c": "#000000", + "t": "#ff0000", "w": 1.5 }, - "\n\nCapitals\n\n\n\n\nShift" + "\n\nSymbols\n\n\n\n\nShift" ], [ { - "y": -0.6299999999999999, + "y": -0.625, "x": 6.5, "c": "#54d6de", + "t": "#000000", "fa": [ 0, 0, @@ -295,35 +292,32 @@ [ { "y": -0.875, - "x": 1.5 + "c": "#2277ff", + "w": 1.5 + }, + "Capitals\n\n\n\n\n\nShift", + { + "c": "#bbddbb" }, "%", { "x": 14.5, "c": "#89b087" }, - "-" - ], - [ + "-", { - "y": -0.9950000000000001, "c": "#2277ff", "w": 1.5 }, - "Ctrl", - { - "x": 16.5, - "w": 1.5 - }, - "\n\nCtrl" + "\n\nCapitals\n\n\n\n\nShift" ], [ { - "y": -0.3799999999999999, + "y": -0.375, "x": 3.5, "c": "#77aaff" }, - "Option\n\n\nLAlt", + "\n\n\nLAlt", { "x": 10.5, "c": "#89b087" @@ -340,7 +334,7 @@ { "x": 1 }, - "Cmd\n\n\nSuper", + "\n\n\nSuper", { "x": 8.5, "c": "#89b087" diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png index 4750dbf1f..7ca86cf47 100644 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png and b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png differ -- cgit v1.2.3-24-g4f1b From 3c4620bf8192a38e0d5e83e4e65ffda4a33a882d Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 17 Jul 2016 15:08:04 -0700 Subject: Update readme.md * Markdown cleanup --- keyboards/ergodox_ez/keymaps/teckinesis/readme.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md index c6f2c666f..84b737505 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md +++ b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md @@ -1,4 +1,4 @@ -# teckinesis Layout # +# teckinesis Layout *A blend of TECK and Kinesis layouts, based on ["The Ordinary Layout" by Nicholas Keene](http://qmk.fm/keyboards/ergodox_ez/keymaps/ordinary/#the-ordinary-layout-a-familiar-and-powerful-layout)* @@ -11,7 +11,7 @@ the [Kinesis Advantage](http://www.kinesis-ergo.com/wp-content/uploads/2013/06/a ## The Base Layout ## -[Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/befd4c5800d92114aa9e50d4f7c0dfb0) \ +[teckinesis (Base Layer)](http://www.keyboard-layout-editor.com/#/gists/befd4c5800d92114aa9e50d4f7c0dfb0) ![teckinesis base layout](teckinesis-base.png) ### Changes from The Ordinary Layout ### @@ -26,7 +26,7 @@ the [Kinesis Advantage](http://www.kinesis-ergo.com/wp-content/uploads/2013/06/a ## The Symbols Layer ## -[teckinesis (Symbols Layer)](http://www.keyboard-layout-editor.com/#/gists/e6ddc4e9e0d194b3e52ac0616238ab61) \ +[teckinesis (Symbols Layer)](http://www.keyboard-layout-editor.com/#/gists/e6ddc4e9e0d194b3e52ac0616238ab61) ![teckinesis symbols layout](teckinesis-symbol.png) ### Changes from The Ordinary Layout ### @@ -35,7 +35,7 @@ the [Kinesis Advantage](http://www.kinesis-ergo.com/wp-content/uploads/2013/06/a ## The Media Layer ## -[teckinesis (Media Layer)](http://www.keyboard-layout-editor.com/#/gists/41ff65e6a7c490211fd6702fb34d9908) \ +[teckinesis (Media Layer)](http://www.keyboard-layout-editor.com/#/gists/41ff65e6a7c490211fd6702fb34d9908) ![teckinesis media layout](teckinesis-media.png) ### Changes from The Ordinary Layout ### @@ -43,7 +43,9 @@ the [Kinesis Advantage](http://www.kinesis-ergo.com/wp-content/uploads/2013/06/a * Removed Power, Sleep, Mail, My Computer keys. (I kept hitting these while using the mouse/cursor. =P) -## TECK Layout ## +# Truly Ergonomic and Kinesis Advantage Layouts + +## TECK 209 Layout ## ![TECK 209 Layout](teck209layout.jpg) -- cgit v1.2.3-24-g4f1b From 53eb36c085dafc1305de77de629eb157a0a8ef8f Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 18 Jul 2016 08:46:04 +0200 Subject: ergodox_ez: Update my keymap to v1.3 This updates my ErgoDox EZ layout to v1.3, which has the following noteworthy changes: * Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a **heatmap** out of the logs. * The arrow and navigation keys were rearranged again, and now require an additional key being held to activate. See the **base layer** for an image that shows where arrows are. * The **experimental** layer has been redone, and is now called **ADORE**, and as such, can be enabled by `LEAD a` now. * Switching between Dvorak and ADORE is now persisted into EEPROM, and survives a reboot. Signed-off-by: Gergely Nagy --- keyboards/ergodox_ez/keymaps/algernon/Makefile | 3 + .../keymaps/algernon/images/adore-layer.png | Bin 0 -> 95615 bytes .../keymaps/algernon/images/base-layer.png | Bin 105162 -> 95654 bytes .../keymaps/algernon/images/experimental-layer.png | Bin 105172 -> 0 bytes .../ergodox_ez/keymaps/algernon/images/heatmap.png | Bin 0 -> 137912 bytes keyboards/ergodox_ez/keymaps/algernon/keymap.c | 181 +++---- keyboards/ergodox_ez/keymaps/algernon/readme.md | 207 ++++---- .../algernon/tools/heatmap-base-layout.json | 533 +++++++++++++++++++++ .../keymaps/algernon/tools/log-to-heatmap.py | 145 ++++++ 9 files changed, 855 insertions(+), 214 deletions(-) create mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/experimental-layer.png create mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png create mode 100644 keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json create mode 100755 keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py diff --git a/keyboards/ergodox_ez/keymaps/algernon/Makefile b/keyboards/ergodox_ez/keymaps/algernon/Makefile index cd7e9e9d2..005f9750c 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/Makefile +++ b/keyboards/ergodox_ez/keymaps/algernon/Makefile @@ -3,6 +3,9 @@ COMMAND_ENABLE=no SLEEP_LED_ENABLE=no UNICODE_ENABLE=no FORCE_NKRO ?= yes +DEBUG_ENABLE = no +CONSOLE_ENABLE = yes +TAP_DANCE_ENABLE = yes ifeq (${FORCE_NKRO},yes) OPT_DEFS += -DFORCE_NKRO diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png new file mode 100644 index 000000000..3df68ea53 Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png index c4e298b6b..7b25a05b3 100644 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png and b/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/experimental-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/experimental-layer.png deleted file mode 100644 index 81155851b..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/experimental-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png b/keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png new file mode 100644 index 000000000..356035e0a Binary files /dev/null and b/keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/keymap.c b/keyboards/ergodox_ez/keymaps/algernon/keymap.c index 2af3d5f8c..09d8dffd5 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/keymap.c +++ b/keyboards/ergodox_ez/keymaps/algernon/keymap.c @@ -10,12 +10,13 @@ #include "mousekey.h" #include "timer.h" #include "keymap_plover.h" +#include "eeconfig.h" /* Layers */ enum { BASE = 0, - EXPRM, + ADORE, ARRW, APPSEL, HUN, @@ -94,7 +95,7 @@ enum { /* Custom keycodes */ enum { - CT_CLN = 0x7101 + CT_CLN = 0 }; /* States & timers */ @@ -114,8 +115,7 @@ uint16_t oh_left_blink_timer = 0; uint8_t oh_right_blink = 0; uint16_t oh_right_blink_timer = 0; -uint8_t ct_cln_count = 0; -uint16_t ct_cln_timer = 0; +bool log_enable = false; /* The Keymap */ @@ -124,18 +124,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Base Layer * * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | 1HND | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| * | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab | A | O | E | U | I |------| |------| D | H | T | N | S | = | + * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | Left | Up | : | | - | Down | Rght | | | + * | | | | | : | | - | | | | | * `-----------------------------------' `-----------------------------------' * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | ARRW | + * | LAlt | GUI | | MDIA | 1HND | * ,------|------|------| |------+------+------. * | | | Ctrl | | LEAD | | | * |Backsp|LShift|------| |------| Enter| Space| @@ -146,67 +146,67 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) ,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,KC_TAB ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,LT(ARRW,KC_TAB) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I ,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_LEFT ,KC_UP ,CT_CLN +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) ,F(F_ALT),F(F_GUI) ,F(F_CTRL) ,KC_BSPC,F(F_SFT),M(A_ESC) // right hand - ,M(OH_LEFT),M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS - ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL - ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP - ,KC_MINS,KC_DOWN,KC_RGHT ,KC_NO ,KC_NO + ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS + ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,LT(ARRW, KC_EQL) + ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP + ,KC_MINS,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,OSL(NMDIA),OSL(ARRW) + ,OSL(NMDIA),M(OH_LEFT) ,KC_LEAD ,F(F_HUN) ,KC_ENT ,KC_SPC ), -/* Keymap 1: Experimental layer +/* Keymap 1: Adore layer * * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | 1HND | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | ' | , | . | P | Y | [ | | ] | L | F | C | R | J | = | + * | Next/Prev | , | . | L | W | M | [ | | ] | F | H | C | P | Y | \ | * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab | A | O | E | U | I |------| |------| D | H | T | N | S | \ | + * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = / Arrow | * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| Z | G | V | K | X | | | | Q | M | W | B | / | Stop | + * | Play/Pause| / | Z | ' | K | X | | | | B | G | V | J | Q | Stop | * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | Left | Up | : | | - | Down | Rght | | | + * | | | | | : | | - | | | | | * `-----------------------------------' `-----------------------------------' * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | ARRW | + * | LAlt | GUI | | MDIA | 1HND | * ,------|------|------| |------+------+------. * | | | Ctrl | | LEAD | | | * |Backsp|LShift|------| |------| Enter| Space| * | | | ESC | | HUN | | | * `--------------------' `--------------------' */ -[EXPRM] = KEYMAP( +[ADORE] = KEYMAP( // left hand KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,KC_TAB ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_Z ,KC_G ,KC_V ,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_LEFT ,KC_UP ,CT_CLN +,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC +,LT(ARRW, KC_TAB) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U +,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) ,F(F_ALT),F(F_GUI) ,F(F_CTRL) ,KC_BSPC,F(F_SFT),M(A_ESC) // right hand - ,M(OH_LEFT),M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_L ,KC_F ,KC_C ,KC_R ,KC_J ,KC_BSLS - ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL - ,KC_RPRN ,KC_Q ,KC_M ,KC_W ,KC_B ,KC_SLSH ,KC_MSTP - ,KC_MINS,KC_DOWN,KC_RGHT ,KC_NO ,KC_NO + ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS + ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,LT(ARRW, KC_EQL) + ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP + ,KC_MINS,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,OSL(NMDIA),OSL(ARRW) + ,OSL(NMDIA),M(OH_LEFT) ,KC_LEAD ,F(F_HUN) ,KC_ENT ,KC_SPC ), @@ -216,19 +216,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------. ,-----------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | + * | | | | | | | | | | | Home | Up | End | | | * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | + * | | | | | | |------| |------| | Left | Down | Rght | | | * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| * | | | | | | | | | | | | | | | | * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | Home | PgUp | | | | PgDn | End | | | + * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. * | | | | | | | | - * | | |------| |------| | | + * | | |------| |------| PgUp | PgDn | * | | | | | | | | * `--------------------' `--------------------' */ @@ -239,7 +239,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_HOME ,KC_PGUP ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS @@ -247,14 +247,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // right hand ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_HOME ,KC_UP ,KC_END ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_PGDN ,KC_END ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_PGUP ,KC_PGDN ), /* Keymap 3: Application select layer @@ -843,8 +843,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; +uint8_t is_adore = 0; + // Runs just one time when the keyboard initializes. void matrix_init_user(void) { + uint8_t dl; + ergodox_led_all_on(); for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { ergodox_led_all_set (i); @@ -856,6 +860,12 @@ void matrix_init_user(void) { _delay_ms (10); } ergodox_led_all_off(); + + if (!eeconfig_is_enabled()) + eeconfig_init(); + dl = eeconfig_read_default_layer (); + if (dl == (1UL << ADORE)) + is_adore = 1; }; LEADER_EXTERNS(); @@ -882,29 +892,32 @@ void ang_tap (uint16_t codes[]) { register_code (code); \ unregister_code (code) -uint8_t is_exp = 0; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) - unregister_code (KC_LGUI); - - if (ct_cln_timer && timer_elapsed (ct_cln_timer) > TAPPING_TERM) { - if (ct_cln_count == 1) { +void ang_tap_dance (qk_tap_dance_state_t *state) { + switch (state->keycode) { + case TD(CT_CLN): + if (state->count == 1) { register_code (KC_RSFT); register_code (KC_SCLN); unregister_code (KC_SCLN); unregister_code (KC_RSFT); - } else if (ct_cln_count == 2) { + } else if (state->count == 2) { register_code (KC_SCLN); unregister_code (KC_SCLN); + reset_tap_dance (state); } - - ct_cln_count = 0; - ct_cln_timer = 0; } +} + +const qk_tap_dance_action_t tap_dance_actions[] = { + [CT_CLN] = ACTION_TAP_DANCE_FN (ang_tap_dance) +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) + unregister_code (KC_LGUI); if (layer != OHLFT) oh_left_blink = 0; @@ -921,7 +934,7 @@ void matrix_scan_user(void) { ergodox_right_led_1_on (); ergodox_right_led_2_on (); ergodox_right_led_3_on (); - } else if (layer == EXPRM) { + } else if (layer == ADORE) { ergodox_right_led_1_on (); ergodox_right_led_2_on (); ergodox_right_led_3_on (); @@ -961,7 +974,7 @@ void matrix_scan_user(void) { ergodox_right_led_1_on (); } else { ergodox_right_led_1_set (LED_BRIGHTNESS_LO); - if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != EXPRM) + if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) ergodox_right_led_1_off (); } @@ -971,7 +984,7 @@ void matrix_scan_user(void) { ergodox_right_led_2_on (); } else { ergodox_right_led_2_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != EXPRM) + if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) ergodox_right_led_2_off (); } @@ -981,7 +994,7 @@ void matrix_scan_user(void) { ergodox_right_led_3_on (); } else { ergodox_right_led_3_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != PLVR && layer != EXPRM) + if (layer != OHRGT && layer != HUN && layer != PLVR && layer != ADORE) ergodox_right_led_3_off (); } @@ -989,6 +1002,10 @@ void matrix_scan_user(void) { leading = false; leader_end (); + SEQ_ONE_KEY (KC_D) { + log_enable = !log_enable; + } + SEQ_ONE_KEY (KC_U) { ang_do_unicode (); } @@ -1036,11 +1053,12 @@ void matrix_scan_user(void) { unregister_code (KC_LGUI); } - SEQ_ONE_KEY (KC_E) { - if (is_exp == 0) { + SEQ_ONE_KEY (KC_A) { + if (is_adore == 0) { default_layer_and (0); - default_layer_or ((1 << EXPRM)); - is_exp = 1; + default_layer_or ((1UL << ADORE)); + eeconfig_update_default_layer ((1UL << ADORE)); + is_adore = 1; ergodox_led_all_off (); ergodox_right_led_3_on (); @@ -1054,9 +1072,10 @@ void matrix_scan_user(void) { _delay_ms (100); ergodox_right_led_1_off (); } else { - is_exp = 0; + is_adore = 0; default_layer_and (0); - default_layer_or (1 << BASE); + default_layer_or (1UL << BASE); + eeconfig_update_default_layer ((1UL << BASE)); ergodox_led_all_off (); ergodox_right_led_1_on (); @@ -1075,29 +1094,11 @@ void matrix_scan_user(void) { } bool process_record_user (uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case CT_CLN: - if (record->event.pressed) { - ct_cln_count++; - ct_cln_timer = timer_read (); - } else { - } - return false; - break; + uint8_t layer = biton32(layer_state); - default: - if (ct_cln_count == 1) { - register_code (KC_RSFT); - register_code (KC_SCLN); - unregister_code (KC_SCLN); - unregister_code (KC_RSFT); - } else if (ct_cln_count == 2) { - register_code (KC_SCLN); - unregister_code (KC_SCLN); - } - ct_cln_count = 0; - ct_cln_timer = 0; - break; + if (log_enable && layer == BASE) { + xprintf ("KL: col=%d, row=%d\n", record->event.key.col, + record->event.key.row); } return true; diff --git a/keyboards/ergodox_ez/keymaps/algernon/readme.md b/keyboards/ergodox_ez/keymaps/algernon/readme.md index 6b7e8fa2e..2312dc59e 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/readme.md +++ b/keyboards/ergodox_ez/keymaps/algernon/readme.md @@ -1,27 +1,28 @@ + + algernon's layout ======================= -This is an unconventional layout for the ErgoDox EZ. For more details about the -history of the layout, see my -[blog posts about my ErgoDox journey][blog-ergodox]. +This is an unconventional layout for the ErgoDox EZ. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox]. [blog-ergodox]: https://asylum.madhouse-project.org/blog/tags/ergodox/ -Some of the things in the layout only work when one uses Spacemacs and GNOME -under Linux. Your mileage may vary. +Some of the things in the layout only work when one uses Spacemacs and GNOME under Linux. Your mileage may vary. ## Table of Contents * [Layouts](#layouts) - - [Base layer](#base-layer) - - [Experimental layer](#experimental-layer) - - [Hungarian layer](#hungarian-layer) - - [Navigation and media layer](#navigation-and-media-layer) - - [One-handed layer](#one-handed-layer) - - [Steno layer](#steno-layer) - - [LED states](#led-states) + - [Base layer](#base-layer) + - [ADORE layer](#adore-layer) + - [Hungarian layer](#hungarian-layer) + - [Navigation and media layer](#navigation-and-media-layer) + - [One-handed layer](#one-handed-layer) + - [Steno layer](#steno-layer) + - [LED states](#led-states) +* [Tools](#tools) + - [Heatmap](#heatmap) * [Building](#building) - - [Using on Windows](#using-on-windows) + - [Using on Windows](#using-on-windows) * [Changelog](#changelog) * [License](#license) @@ -31,133 +32,98 @@ under Linux. Your mileage may vary. [![Base layer](images/base-layer.png)](http://www.keyboard-layout-editor.com/#/gists/28f7eb305fdbff943613e1dc7aa9e82b) -At its core, this is a Dvorak layout, with some minor changes. The more -interesting parts are how certain keys behave: - -* The keys on the number row double as function keys, when held for a bit longer - than an usual tap. This allows me to use the function keys without having to - switch layers. -* The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they - are considered active for the next key press only. When double tapped, they - toggle on, until a third, single tap sometime later. When held, they act as - expected. My usual pattern is that I use these for the next keypress only, so - this behaviour is perfect. If I need them held, I'll just double-tap. -* The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, - which pops up an application selector. It also switches to a one-shot layer, - where the number row on the left half turns into app selector macros, for the - most common things I usually want to switch to. Otherwise it behaves as on a - normal layout. -* The `ESC` key also doubles as a one-shot cancel key: if tapped while any of - the one-shot modifiers are in-flight (as in, single-tapped, and not expired - yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if - active. Otherwise it sends the usual keycode. -* The **Media**, **Arrow**, and **Hun** layer keys are one-shot, the **1Hand** - and **STENO** keys are toggles. -* Toggling the **Arrow** layer toggles between the cursor arrows and the paging - keys on the bottom row. +At its core, this is a Dvorak layout, with some minor changes. The more interesting parts are how certain keys behave: + +* The keys on the number row double as function keys, when held for a bit longer than an usual tap. This allows me to use the function keys without having to switch layers. +* The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they are considered active for the next key press only. When double tapped, they toggle on, until a third, single tap sometime later. When held, they act as expected. My usual pattern is that I use these for the next keypress only, so this behaviour is perfect. If I need them held, I'll just double-tap. +* The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout. +* The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode. +* The **Media** and **Hun** layer keys are one-shot, the **1Hand** and **STENO** keys are toggles. +* When holding any of the **Arrow** layer keys, the arrow layer activates while the layer key is held. Tapping the key produces the normal key. * Tapping the `:` key once yields `:`, tapping it twice yields `;`. -* The **Lead** key allows me to type in a sequence of keys, and trigger some - actions: - - `LEAD u` enters unicode input mode, by sending the GTK+ key sequence that - does this. +* The **Lead** key allows me to type in a sequence of keys, and trigger some actions: + - `LEAD u` enters unicode input mode, by sending the GTK+ key sequence that does this. - `LEAD l` uses the unicode input method to enter a `λ`. - `LEAD s` does a lot of magic to type in a shruggie: `¯\_(ツ)_/¯` - `LEAD y` types `\o/`. - `LEAD w m` maximises the currently focused window. - - `LEAD e` makes the [experimental layer](#experimental-layer) the default. + - `LEAD a` makes the [ADORE layer](#adore-layer) the default. - `LEAD v` prints the firmware version, the keyboard and the keymap. + - `LEAD d` toggles logging keypress positions to the HID console. -## Experimental layer +## ADORE layer -[![Experimental layer](images/experimental-layer.png)](http://www.keyboard-layout-editor.com/#/gists/6ff50bf71248e05aab5b3fec4fae3d08) +[![ADORE layer](images/adore-layer.png)](http://www.keyboard-layout-editor.com/#/gists/45681a17453d235925b6028dd83bf12a) -While using the standard Dvorak layout, I encountered a number of -inconveniences, and on this layer, I am playing with ideas to make the layout -feel better. Initially, it was based on [Capewell-Dvorak][cpd], but that too, -had shortcomings I was not happy with. So now this is something inbetween, with -own observations thrown in. How it works out in the long run remains to be seen. +While using the standard Dvorak layout, I encountered a number of inconveniences, and on this layer, I am playing with ideas to make the layout feel better. Initially, it was based on [Capewell-Dvorak][cpd], but that too, had shortcomings I was not happy with. So now this is something inbetween, with own observations thrown in. How it works out in the long run remains to be seen. [cpd]: http://www.michaelcapewell.com/projects/keyboard/layout_capewell-dvorak.htm + +Based on a week and a half of typing, the keys were rearranged, and the home row neatly spelled out **ADORE**, that gave the layout its name. ## Hungarian layer [![Hungarian layer](images/hun-layer.png)](http://www.keyboard-layout-editor.com/#/gists/b160f6ec90d58c127c114c89f66e9dc9) -On this layer, the accented characters are at the same position as their base -variant. For some, which can have other diatribes, the long one is on top, -short's on bottom. Tapping any of the accented characters takes us back to the -base layer. +On this layer, the accented characters are at the same position as their base variant. For some, which can have other diatribes, the long one is on top, short's on bottom. Tapping any of the accented characters takes us back to the base layer. ## Navigation and media layer [![Navigation and media layer](images/nav-n-media-layer.png)](http://www.keyboard-layout-editor.com/#/gists/c59c453f9fe1a3238ba1494e7e5c6892) -This layer is primarily for navigating with the cursor or the mouse, and some -media things. +This layer is primarily for navigating with the cursor or the mouse, and some media things. ## One-handed layer [![One-handed layer](images/one-handed-layer.png)](http://www.keyboard-layout-editor.com/#/gists/edff2495135955b8963198dace7f7ece) -The one-handed layer is used in situations where the right hand is occupied, by -mousing around, for example. Tapping the `OTHER` key switches which side is -active. For the most part, keys remain in their usual position. When the right -half is active, keys are mirrored to the left half. +The one-handed layer is used in situations where the right hand is occupied, by mousing around, for example. Tapping the `OTHER` key switches which side is active. For the most part, keys remain in their usual position. When the right half is active, keys are mirrored to the left half. The differences are as follows: -* The `ESC` key has been moved to the bottom row, so the `OTHER` key is easier - to tap. -* Most keys on the thumb cluster now have dual uses, and these do not change - when switching sides: - - The `Space`/`Backspace` key sends `Space` on tap, `Backspace` when held - for longer than a normal tap. +* The `ESC` key has been moved to the bottom row, so the `OTHER` key is easier to tap. +* Most keys on the thumb cluster now have dual uses, and these do not change when switching sides: + - The `Space`/`Backspace` key sends `Space` on tap, `Backspace` when held for longer than a normal tap. - The `Enter`/`Shift` key sends `Enter` on short-tap, `Shift` on long-tap. -* The `Apps`/`BASE` key can be used to go back to the base layer, by - long-tapping it. A short-tap will send the `App` key, as usual. +* The `Apps`/`BASE` key can be used to go back to the base layer, by long-tapping it. A short-tap will send the `App` key, as usual. ## Steno layer [![Steno layer for Plover](images/steno-layer.png)](http://www.keyboard-layout-editor.com/#/gists/401ef9a84369e47c57f9aedcf0a0d667) -This is to be used with [Plover](http://www.openstenoproject.org/plover/), -nothing really fancy here. The **STENO** key toggles the layer on and off, and -sends the toggle command to Plover too. +This is to be used with [Plover](http://www.openstenoproject.org/plover/), nothing really fancy here. The **STENO** key toggles the layer on and off, and sends the toggle command to Plover too. ## LED states -The primary purpose of the LEDs is to show the modifier status, a secondary, to -show which layer is active. Each modifier, `Shift`, `Alt` and `Control` each -have their designated LEDs: the *red*, *green* and *blue*, respectively. When a -modifier is in a one-shot state, the respective LED will turn on with a dimmer -light. If the modifier is toggled on, the brightness of the LED turns full. +The primary purpose of the LEDs is to show the modifier status, a secondary, to show which layer is active. Each modifier, `Shift`, `Alt` and `Control` each have their designated LEDs: the *red*, *green* and *blue*, respectively. When a modifier is in a one-shot state, the respective LED will turn on with a dimmer light. If the modifier is toggled on, the brightness of the LED turns full. For the layers, the following rules apply: -* When the [Experimental layer](#experimental-layer) is toggled on, LEDs will - light up from left to right in a sequence, then turn off. When the layer is - toggled off, the LEDs light up and turn off in the other direction. No LEDs - are on while the layer is active. -* When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* - LEDs are on. -* When the [Navigation and media layer](#navigation-and-media-layer) is active, - the *red* and *green* ones are on. -* When the [One-handed layer](#one-handed-layer) is active, the *green* LED is - on and bright, and either the *red* or the *blue* one is going to slowly - blink, depending on the currently active side. +* When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active. +* When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on. +* When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on. +* When the [One-handed layer](#one-handed-layer) is active, the *green* LED is on and bright, and either the *red* or the *blue* one is going to slowly blink, depending on the currently active side. * For the [Steno layer](#steno-layer), all LEDs will be turned on. -Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers -use a stronger one, and modifiers override any layer preferences. For example, -when on the one-handed layer, with the left side active (*red* light blinking), -if `Shift` is on, the *red* light will be constantly on. +Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on. + +# Tools + +## Heatmap + +When the keypress logging functionality is enabled (by `LEAD d`), the keyboard will output a line every time a key is pressed, containing the position of the key in the matrix. This allows one to collect this information, and build analytics over it, such as a heat map, including dead keys too. + +Included with the firmware is a small tool that can parse these logs, and create a heatmap that one can import into [KLE][kle]. To use it, simply point `tools/log-to-heatmap.py` to a base layout file (one is included in the `tools/` directory), and the key position log. The latter one can create by running `hid-listen`, and redirecting its output to a file. + + [kle]: http://www.keyboard-layout-editor.com/ + +The generated heatmap looks somewhat like this: + + ![Heatmap](images/heatmap.png) # Building -To make my workflow easier, this layout is maintained in -[its own repository][algernon:ez-layout]. To build it, you will need the -[QMK][qmk] firmware checked out, and this repo either checked out to something -like `keyboards/ergodox_ez/algernon-master`. One way to achieve that is this: +To make my workflow easier, this layout is maintained in [its own repository][algernon:ez-layout]. To build it, you will need the [QMK][qmk] firmware checked out, and this repo either checked out to something like `keyboards/ergodox_ez/algernon-master`. One way to achieve that is this: [algernon:ez-layout]: https://github.com/algernon/ergodox-layout [qmk]: https://github.com/jackhumbert/qmk_firmware @@ -170,9 +136,7 @@ $ git clone https://github.com/algernon/ergodox-layout.git \ $ make KEYBOARD=ergodox_ez KEYMAP=algernon-master ``` -From time to time, updates may be submitted back to the QMK repository. If you -are reading it there, you can build the firmware like any other firmware -included with it (assuming you are in the root directory of the firmware): +From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware): ``` $ make KEYBOARD=ergodox_ez KEYMAP=algernon @@ -180,43 +144,40 @@ $ make KEYBOARD=ergodox_ez KEYMAP=algernon ## Using on Windows -The keymap default to forcing NKRO, which seems to upset Windows, and except the -modifiers, none of them work. If you experience this problem, recompile the -firmware with `FORCE_NKRO=no` added to the `make` command line. +The keymap default to forcing NKRO, which seems to upset Windows, and except the modifiers, none of them work. If you experience this problem, recompile the firmware with `FORCE_NKRO=no` added to the `make` command line. # Changelog +## v1.3 - 2016-07-06 + +* Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a [heatmap](#heatmap) out of the logs. +* The arrow and navigation keys were rearranged again, and now require an additional key being held to activate. See the [base layer](#base-layer) for an image that shows where arrows are. +* The **experimental** layer has been redone, and is now called [ADORE](#adore-layer), and as such, can be enabled by `LEAD a` now. +* Switching between Dvorak and ADORE is now persisted into EEPROM, and survives a reboot. + ## v1.2 - 2016-06-22 -* The forced NKRO mode can be easily toggled off at compile-time, to make the - firmware compatible with [certain operating systems](#using-on-windows). -* The `:;` key has changed behaviour: to access the `;` symbol, the key needs to - be double-tapped, instead of shifted. -* The `=` and `\` keys were swapped, `=` moved to the home row, on both the - [base](#base-layer) and the [experimental](#experimental-layer) layers. -* The arrow and navigation keys were redone, they are now more accessible, but - the navigation keys require an extra tap to access. -* The **Emacs** layer is gone, replaced by a simplified - [navigation and media](#navigation-and-media-layer) layer. +* The forced NKRO mode can be easily toggled off at compile-time, to make the firmware compatible with [certain operating systems](#using-on-windows). +* The `:;` key has changed behaviour: to access the `;` symbol, the key needs to be double-tapped, instead of shifted. +* The `=` and `\` keys were swapped, `=` moved to the home row, on both the [base](#base-layer) and the **experimental** layers. +* The arrow and navigation keys were redone, they are now more accessible, but the navigation keys require an extra tap to access. +* The **Emacs** layer is gone, replaced by a simplified [navigation and media](#navigation-and-media-layer) layer. * `LEAD v` types the firmware version, and the keymap version. -* On the [experimental](#experimental-layer) layer, the `L` and `Q`, and the `K` - and `G` keys were swapped. -* The [Steno](#steno-layer) layer gained a few more `#` and `*` keys, to make it - easier on my fingers. +* On the **experimental** layer, the `L` and `Q`, and the `K` and `G` keys were swapped. +* The [Steno](#steno-layer) layer gained a few more `#` and `*` keys, to make it easier on my fingers. ## v1.1 - 2016-06-14 * The keyboard starts in NKRO mode, bootmagic and other things are disabled. * A [Steno](#steno-layer) layer was added, to be used with Plover. -* An [experimental](#experimental-layer) layer was added, something halfway - between Dvorak and Capewell-Dvorak. A work in progress. +* An **experimental** layer was added, something halfway between Dvorak and Capewell-Dvorak. A work in progress. * `LEAD y` types `\o/`. * Some keys on the [Base](#base-layer) layer have been moved around: - - `?` moved to the left pinky, left of `Q`. - - `=` shifted one row down, but `F11` stayed where it was. - - `-` on the left half was replaced by `Tab`. - - `Tab`'s original position is taken by a `Media Next`/`Media Prev` key. - - `:` now inputs `;` when shifted. + - `?` moved to the left pinky, left of `Q`. + - `=` shifted one row down, but `F11` stayed where it was. + - `-` on the left half was replaced by `Tab`. + - `Tab`'s original position is taken by a `Media Next`/`Media Prev` key. + - `:` now inputs `;` when shifted. * `ESC` cancels the [Hungarian](#hungarian-layer) layer too, not just modifiers. ## v1.0 - 2016-05-26 @@ -225,6 +186,4 @@ Initial version. # License -The layout, being a derivative of the original TMK firmware which is under the -GPL-2+, this layout is under the GPL as well, but GPL-3+, rather than the older -version. +The layout, being a derivative of the original TMK firmware which is under the GPL-2+, this layout is under the GPL as well, but GPL-3+, rather than the older version. diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json b/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json new file mode 100644 index 000000000..148bb1f23 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json @@ -0,0 +1,533 @@ +[ + { + "backcolor": "#ffffff", + "name": "ErgoDox - algernon's layout: Heatmap", + "author": "Gergely Nagy ", + "notes": "See [here](https://github.com/algernon/ergodox-layout#readme) for the QMK keymap source.", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea", + "pcb": true, + "css": ".keyborder { -webkit-filter: blur(5px); filter: blur(5px); } .keytop { -webkit-filter: blur(10px); } .keylabels { border: 1px solid black; }" + }, + [ + { + "x": 3.5, + "c": "#a7d0db", + "fa": [ + 0, + 0, + 2 + ] + }, + "#\n3\nF3", + { + "x": 10.5, + "c": "#a7d0db", + "t": "#000000", + "a": 4, + "fa": [ + 0, + 0, + 2 + ] + }, + "*\n8\nF8" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "@\n2\nF2", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "$\n4\nF4", + { + "x": 8.5 + }, + "&\n7\nF7", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "(\n9\nF9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "%\n5\nF5", + { + "c": "#f9cd31", + "a": 7, + "f": 2 + }, + "STENO", + { + "x": 4.5, + "f": 6 + }, + "", + { + "c": "#7adabd", + "a": 4, + "f": 3, + "fa": [ + 0, + 0, + 2 + ] + }, + "^\n6\nF6" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "f": 3, + "w": 1.5 + }, + "\n\n~\n`", + { + "t": "#0d0d0b" + }, + "!\n1\nF1", + { + "x": 14.5 + }, + ")\n0\nF10", + { + "a": 7, + "w": 1.5 + }, + "F11" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 4 + }, + ">\n.", + { + "x": 10.5, + "a": 6 + }, + "C" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b", + "a": 4 + }, + "<\n,", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "a": 6 + }, + "P", + { + "x": 8.5 + }, + "G", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "R" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "Y", + { + "c": "#93c9b7", + "a": 4, + "h": 1.5 + }, + "{\n[", + { + "x": 4.5, + "h": 1.5 + }, + "}\n]", + { + "c": "#7adabd", + "a": 6 + }, + "F" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "t": "#0d0d0b", + "f": 6, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "a": 4, + "f": 3 + }, + "\"\n'", + { + "x": 14.5, + "a": 6 + }, + "L", + { + "a": 4, + "w": 1.5 + }, + "|\n\\" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 6 + }, + "E", + { + "x": 10.5 + }, + "T" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "O", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "n": true + }, + "U", + { + "x": 8.5, + "n": true + }, + "H", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "N" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "I", + { + "x": 6.5 + }, + "D" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "t": "#0d0d0b", + "fa": [ + 6 + ], + "w": 1.5 + }, + "\n\nTab", + { + "f": 3 + }, + "A", + { + "x": 14.5, + "f": 3 + }, + "S", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 6 + ], + "w": 1.5 + }, + "+\n=" + ], + [ + { + "y": -0.625, + "x": 6.5, + "c": "#93c9b7", + "t": "#000000", + "a": 7, + "h": 1.5 + }, + "(", + { + "x": 4.5, + "h": 1.5 + }, + ")" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#a7d0db", + "a": 6 + }, + "J", + { + "x": 10.5 + }, + "W" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "Q", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "K", + { + "x": 8.5 + }, + "M", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "V" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "X", + { + "x": 6.5 + }, + "B" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "f": 9, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "t": "#0d0d0b", + "a": 4, + "f": 3 + }, + "?\n/", + { + "x": 14.5, + "a": 6 + }, + "Z", + { + "c": "#ffb07b", + "t": "#000000", + "f": 9, + "w": 1.5 + }, + "" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#d9dae0", + "g": true, + "a": 7, + "f": 3 + }, + "", + { + "x": 10.5 + }, + "" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "", + { + "x": 1, + "c": "#d4872a", + "g": false, + "a": 5 + }, + ";\n:", + { + "x": 8.5 + }, + "_\n-", + { + "x": 1, + "c": "#d9dae0", + "g": true, + "a": 7 + }, + "" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "", + {}, + "", + { + "x": 14.5 + }, + "", + {}, + "" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#f9cd31", + "g": false + }, + "Alt", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 9 + ] + }, + "\n\n\n" + ], + [ + { + "c": "#d4872a", + "a": 7, + "f": 9, + "h": 2 + }, + "", + { + "h": 2 + }, + "", + { + "c": "#f9cd31", + "f": 3 + }, + "Ctrl" + ], + [ + { + "x": 2, + "c": "#e26757" + }, + "ESC" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "MEDIA", + {}, + "1HAND" + ], + [ + { + "x": -3 + }, + "LEAD", + { + "c": "#d4872a", + "f": 9, + "h": 2 + }, + "", + { + "f": 3, + "h": 2 + }, + "SPC" + ], + [ + { + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "HUN" + ] +] diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py b/keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py new file mode 100755 index 000000000..a13d12e81 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py @@ -0,0 +1,145 @@ +#! /usr/bin/env python +import json +import os +import sys +import re + +from math import floor + +cr_coord_map = [ + [ + # Row 0 + [ 4, 0], [ 4, 2], [ 2, 0], [ 1, 0], [ 2, 2], [ 3, 0], [ 3, 2], + [ 3, 4], [ 3, 6], [ 2, 4], [ 1, 2], [ 2, 6], [ 4, 4], [ 4, 6], + ], + [ + # Row 1 + [ 8, 0], [ 8, 2], [ 6, 0], [ 5, 0], [ 6, 2], [ 7, 0], [ 7, 2], + [ 7, 4], [ 7, 6], [ 6, 4], [ 5, 2], [ 6, 6], [ 8, 4], [ 8, 6], + ], + [ + # Row 2 + [12, 0], [12, 2], [10, 0], [ 9, 0], [10, 2], [11, 0], [ ], + [ ], [11, 2], [10, 4], [ 9, 2], [10, 6], [12, 4], [12, 6], + ], + [ + # Row 3 + [17, 0], [17, 2], [15, 0], [14, 0], [15, 2], [16, 0], [13, 0], + [13, 2], [16, 2], [15, 4], [14, 2], [15, 6], [17, 4], [17, 6], + ], + [ + # Row 4 + [20, 0], [20, 2], [19, 0], [18, 0], [19, 2], [], [], [], [], + [19, 4], [18, 2], [19, 6], [20, 4], [20, 6], + ], + [ + # Row 5 + [ ], [23, 0], [22, 2], [22, 0], [22, 4], [21, 0], [21, 2], + [24, 0], [24, 2], [25, 0], [25, 4], [25, 2], [26, 0], [ ], + ], +] + +def set_attr_at(j, b, n, attr, fn, val): + blk = j[b][n] + if attr in blk: + blk[attr] = fn(blk[attr], val) + else: + blk[attr] = fn(None, val) + +def coord(col, row): + return cr_coord_map[row][col] + +def set_attr(orig, new): + return new + +def set_bg(j, (b, n), color): + set_attr_at(j, b, n, "c", set_attr, color) + #set_attr_at(j, b, n, "g", set_attr, False) + +def _set_tap_info(o, count, cap): + ns = 4 - o.count ("\n") + return o + "\n" * ns + "%.02f%%" % (float(count) / float(cap) * 100) + +def set_tap_info(j, (b, n), count, cap): + j[b][n + 1] = _set_tap_info (j[b][n + 1], count, cap) + +def heatmap_color (v): + colors = [ [0.3, 0.3, 1], [0.3, 1, 0.3], [1, 1, 0.3], [1, 0.3, 0.3]] + fb = 0 + if v <= 0: + idx1, idx2 = 0, 0 + elif v >= 1: + idx1, idx2 = len(colors) - 1, len(colors) - 1 + else: + val = v * (len(colors) - 1) + idx1 = int(floor(val)) + idx2 = idx1 + 1 + fb = val - float(idx1) + + r = (colors[idx2][0] - colors[idx1][0]) * fb + colors[idx1][0] + g = (colors[idx2][1] - colors[idx1][1]) * fb + colors[idx1][1] + b = (colors[idx2][2] - colors[idx1][2]) * fb + colors[idx1][2] + + r, g, b = [x * 255 for x in r, g, b] + return "#%02x%02x%02x" % (r, g, b) + +# Load the keylog +def load_keylog(fname, restrict_row): + keylog = {} + total = 0 + with open(fname, "r") as f: + lines = f.readlines() + for line in lines: + m = re.search ('KL: col=(\d+), row=(\d+)', line) + if not m: + continue + (c, r) = (int(m.group (2)), int(m.group (1))) + if restrict_row != None and r != int(restrict_row): + continue + if (c, r) in keylog: + keylog[(c, r)] = keylog[(c, r)] + 1 + else: + keylog[(c, r)] = 1 + total = total + 1 + return total / 2, keylog + +def l_flat(s): + f = s.split("\n") + return ", ".join (f) + +def main(base_fn, log_fn, restrict_row = None): + + with open(base_fn, "r") as f: + layout = json.load (f) + + ## Reset colors + for row in cr_coord_map: + for col in row: + if col != []: + set_bg (layout, col, "#d9dae0") + #set_attr_at (layout, col[0], col[1], "g", set_attr, True) + + total, log = load_keylog (log_fn, restrict_row) + max_cnt = 0 + for (c, r) in log: + max_cnt = max(max_cnt, log[(c, r)]) + + # Create the heatmap + for (c, r) in log: + coords = coord(c, r) + b, n = coords + cap = max_cnt + v = float(log[(c, r)]) / cap + print >> sys.stderr, "%s => %d/%d => %f = %s" % (l_flat(layout[b][n+1]), log[(c,r)], cap, v, heatmap_color(v)) + set_bg (layout, coord(c, r), heatmap_color (v)) + set_tap_info (layout, coord (c, r), log[(c, r)], total) + + print json.dumps(layout) + +if __name__ == "__main__": + if len(sys.argv) < 3: + print """Log to Heatmap -- creates a heatmap out of keyboard logs + +Usage: log-to-heatmap.py base-layout.json logfile [row] >layout.json""" + sys.exit (1) + main(*sys.argv[1:]) -- cgit v1.2.3-24-g4f1b From 36242d5ac5b42d828b51ff87a9317dc8420c1b6c Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 18 Jul 2016 10:50:19 +0200 Subject: reduced makefile size. not so much needed due to "inheritance" --- keyboards/satan/keymaps/iso_split_rshift/Makefile | 51 ----------------------- 1 file changed, 51 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/Makefile b/keyboards/satan/keymaps/iso_split_rshift/Makefile index 67eaa078f..e25515b69 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/Makefile +++ b/keyboards/satan/keymaps/iso_split_rshift/Makefile @@ -1,54 +1,3 @@ - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - # Build Options # comment out to disable the options. # -- cgit v1.2.3-24-g4f1b From 4b32a161d04c9efe650479b89d4c8f323dd41aa3 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 18 Jul 2016 10:50:45 +0200 Subject: renamed keymap --- keyboards/satan/keymaps/iso_split_rshift/build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/build.sh b/keyboards/satan/keymaps/iso_split_rshift/build.sh index 2bfc3bb32..c286f26f8 100755 --- a/keyboards/satan/keymaps/iso_split_rshift/build.sh +++ b/keyboards/satan/keymaps/iso_split_rshift/build.sh @@ -2,15 +2,16 @@ # adjust for cpu # -j 16 gave best result on a hyperthreaded quad core core i7 THREADS="-j 16" +KMAP=iso_split_rschift echo "We need sudo later" sudo ls 2>&1 /dev/null make clean -make KEYMAP=toni77 ${THREADS} +make KEYMAP=iso_split_rschift ${THREADS} if [[ $? -eq 0 ]] then echo "please trigger flashing! you have 5 seconds" sleep 5 - sudo make KEYMAP=toni77 dfu ${THREADS} + sudo make KEYMAP=iso_split_rschift dfu ${THREADS} else echo "make failed" exit 77 -- cgit v1.2.3-24-g4f1b From dda2fd6ff3984ed96f8275c661b47a0484f9ee18 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Mon, 18 Jul 2016 23:34:02 +0200 Subject: in the default case, it should be called if there is actually a tap dance happening, and in the normal case, it should be called when the tap down is happening. --- quantum/process_keycode/process_tap_dance.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 93b326b5f..bab6bb81b 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -70,7 +70,6 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: - process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); } else { @@ -81,12 +80,13 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { qk_tap_dance_state.keycode = keycode; qk_tap_dance_state.timer = timer_read (); qk_tap_dance_state.count++; + process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); } break; default: - process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); if (qk_tap_dance_state.keycode) { + process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); reset_tap_dance (&qk_tap_dance_state); } -- cgit v1.2.3-24-g4f1b From d8a979b6d50fb5a6735ceab02f5d93163609aa68 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Tue, 19 Jul 2016 00:01:11 +0200 Subject: add a bit of documentation --- readme.md | 48 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index e0dcd5608..b5f7f6945 100644 --- a/readme.md +++ b/readme.md @@ -372,10 +372,11 @@ But lets start with how to use it, first! First, you will need `TAP_DANCE_ENABLE=yes` in your `Makefile`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array. -This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are two possible options: +This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options: * `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. -* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the current state of the tap-dance action. +* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action. +* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets. The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. @@ -399,7 +400,8 @@ In the end, let's see a full example! enum { CT_SE = 0, CT_CLN, - CT_EGG + CT_EGG, + CT_FLSH, }; /* Have the above three on the keymap, TD(CT_SE), etc... */ @@ -424,10 +426,50 @@ void dance_egg (qk_tap_dance_state_t *state) { } } +// on each tap, light up one led, from right to left +// on the forth tap, turn them off from right to left +void dance_flsh_each(qk_tap_dance_state_t *state) { + switch (state->count) { + case 1: + ergodox_right_led_3_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_1_on(); + break; + case 4: + ergodox_right_led_3_off(); + _delay_ms(50); + ergodox_right_led_2_off(); + _delay_ms(50); + ergodox_right_led_1_off(); + } +} + +// on the fourth tap, set the keyboard on flash state +void dance_flsh_finished(qk_tap_dance_state_t *state) { + if (state->count >= 4) { + reset_keyboard(); + reset_tap_dance(state); + } +} + +// if the flash state didnt happen, then turn off leds, left to right +void dance_flsh_reset(qk_tap_dance_state_t *state) { + ergodox_right_led_1_off(); + _delay_ms(50); + ergodox_right_led_2_off(); + _delay_ms(50); + ergodox_right_led_3_off(); +} + const qk_tap_dance_action_t tap_dance_actions[] = { [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) ,[CT_CLN] = ACTION_TAP_DANCE_FN (dance_cln) ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) + ,[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset) }; ``` -- cgit v1.2.3-24-g4f1b From 6eb21d2680dc6f8e2cb2e2b6fabf41d82e240256 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Tue, 19 Jul 2016 00:07:50 +0200 Subject: add some debugging doc, after i found out how to print debug messages --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index e0dcd5608..2374bf554 100644 --- a/readme.md +++ b/readme.md @@ -152,7 +152,7 @@ This allows you to use the system and audio control key codes. `CONSOLE_ENABLE` -TODO +This allows you to print messages that can be read using `hid_listen`. Add this to your `Makefile`, and set it to `yes`. Then put `println`, `printf`, etc. in your keymap or anywhere in the `qmk` source. Finally, open `hid_listen` and enjoy looking at your printed messages. `COMMAND_ENABLE` -- cgit v1.2.3-24-g4f1b From 1988c180e3cc971e83db0f9e862de4857ce6d766 Mon Sep 17 00:00:00 2001 From: Toni Date: Tue, 19 Jul 2016 09:16:55 +0200 Subject: small cosmetic change --- keyboards/satan/keymaps/iso_split_rshift/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/build.sh b/keyboards/satan/keymaps/iso_split_rshift/build.sh index c286f26f8..9523f6716 100755 --- a/keyboards/satan/keymaps/iso_split_rshift/build.sh +++ b/keyboards/satan/keymaps/iso_split_rshift/build.sh @@ -2,16 +2,16 @@ # adjust for cpu # -j 16 gave best result on a hyperthreaded quad core core i7 THREADS="-j 16" -KMAP=iso_split_rschift +KMAP=iso_split_rshift echo "We need sudo later" sudo ls 2>&1 /dev/null make clean -make KEYMAP=iso_split_rschift ${THREADS} +make KEYMAP=${KMAP} ${THREADS} if [[ $? -eq 0 ]] then echo "please trigger flashing! you have 5 seconds" sleep 5 - sudo make KEYMAP=iso_split_rschift dfu ${THREADS} + sudo make KEYMAP=${KMAP} dfu ${THREADS} else echo "make failed" exit 77 -- cgit v1.2.3-24-g4f1b From 5cd6d607fc7362fdf72ecd76f802305bce68270c Mon Sep 17 00:00:00 2001 From: Toni Date: Tue, 19 Jul 2016 09:17:31 +0200 Subject: changed ctrl back to enter. "j" interfered with my vimming --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index a2623e0e0..fc07f6da8 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DEF] = KEYMAP_ISO_SPLITRSHIFT( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ F(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, F(17), KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ + F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, F(17), \ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX),F(4), \ KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, F(5), F(6), F(7)) , /* Keymap 1: F-and-vim Layer, modified with Space (Fn0) @@ -124,7 +124,7 @@ const uint16_t PROGMEM fn_actions[] = { [14] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), [15] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), [16] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - [17] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_J), + [17] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -- cgit v1.2.3-24-g4f1b From 47223ebee4823e58e951d9fd89a66e16e29b6357 Mon Sep 17 00:00:00 2001 From: Robert Dale Date: Tue, 19 Jul 2016 08:00:03 -0400 Subject: Corrected the ascii layout to match the coded layout --- keyboards/preonic/keymaps/default/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/preonic/keymaps/default/keymap.c b/keyboards/preonic/keymaps/default/keymap.c index 9a957f7ee..2c2299fd2 100644 --- a/keyboards/preonic/keymaps/default/keymap.c +++ b/keyboards/preonic/keymaps/default/keymap.c @@ -142,9 +142,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | | Reset| | | | | | | | | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | + * | |Voice-|Voice+|Mus on|MusOff| | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' @@ -277,4 +277,4 @@ void music_scale_user(void) PLAY_NOTE_ARRAY(music_scale, false, 0); } -#endif \ No newline at end of file +#endif -- cgit v1.2.3-24-g4f1b From 9c26498f4990ac15ff9acd46440db2ce11b8f80f Mon Sep 17 00:00:00 2001 From: Robert Dale Date: Tue, 19 Jul 2016 08:43:41 -0400 Subject: added Midi On/Off; Enter is actually transparent --- keyboards/preonic/keymaps/default/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/preonic/keymaps/default/keymap.c b/keyboards/preonic/keymaps/default/keymap.c index 2c2299fd2..78b4997a8 100644 --- a/keyboards/preonic/keymaps/default/keymap.c +++ b/keyboards/preonic/keymaps/default/keymap.c @@ -102,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' @@ -123,7 +123,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' @@ -144,7 +144,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|MusOff| | | | | | | | + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' -- cgit v1.2.3-24-g4f1b From 2e815ad9a2f4e36d6c11dbe0475d1fb1e1fa9d18 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Tue, 19 Jul 2016 17:34:23 +0200 Subject: add link to hid_listen --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 2374bf554..8e005155b 100644 --- a/readme.md +++ b/readme.md @@ -152,7 +152,7 @@ This allows you to use the system and audio control key codes. `CONSOLE_ENABLE` -This allows you to print messages that can be read using `hid_listen`. Add this to your `Makefile`, and set it to `yes`. Then put `println`, `printf`, etc. in your keymap or anywhere in the `qmk` source. Finally, open `hid_listen` and enjoy looking at your printed messages. +This allows you to print messages that can be read using [`hid_listen`](https://www.pjrc.com/teensy/hid_listen.html). Add this to your `Makefile`, and set it to `yes`. Then put `println`, `printf`, etc. in your keymap or anywhere in the `qmk` source. Finally, open `hid_listen` and enjoy looking at your printed messages. `COMMAND_ENABLE` -- cgit v1.2.3-24-g4f1b From d5daec2a58019ebdb9804787e0f786e4fc3c05b9 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Tue, 19 Jul 2016 18:00:59 +0200 Subject: on_each_tap_fn is called on tap down and tap up --- quantum/process_keycode/process_tap_dance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index bab6bb81b..58192413f 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -70,6 +70,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: + process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); } else { @@ -80,7 +81,6 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { qk_tap_dance_state.keycode = keycode; qk_tap_dance_state.timer = timer_read (); qk_tap_dance_state.count++; - process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); } break; -- cgit v1.2.3-24-g4f1b From 4e6a8627d8ebd7af942f68142d1a959d60361d90 Mon Sep 17 00:00:00 2001 From: Pavlos Vinieratos Date: Tue, 19 Jul 2016 18:02:13 +0200 Subject: add a couple of comments --- quantum/process_keycode/process_tap_dance.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 58192413f..b9b836df2 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -86,6 +86,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { default: if (qk_tap_dance_state.keycode) { + // if we are here, the tap dance was interrupted by a different key process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); reset_tap_dance (&qk_tap_dance_state); @@ -98,6 +99,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { void matrix_scan_tap_dance () { if (qk_tap_dance_state.keycode && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { + // if we are here, the tap dance was timed out process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); reset_tap_dance (&qk_tap_dance_state); } -- cgit v1.2.3-24-g4f1b From 8ee9c486fd092aa2c5457f7747385ff82b003c36 Mon Sep 17 00:00:00 2001 From: Joshua T Date: Tue, 19 Jul 2016 17:33:10 -0500 Subject: Adjusted Atreus KEYMAP() function. This change adjusts the KEYMAP() function to provide a more visual representation of the key positions on the keyboard. Previously, keymaps have been defined directly using arrays for the Atreus keyboard. While this works, it doesn't utilize the helpful KEYMAP() function at all to allow the user to visually position the key codes for ease of editing. See the Ergodox-EZ KEYMAP() function and layouts for a great example of how this can work. This change should not break any existing Atreus layouts. At the time of this commit, there are two existing layouts for the Atreus board, and neither use the KEYMAP() function. --- keyboards/atreus/atreus.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/atreus/atreus.h b/keyboards/atreus/atreus.h index 2b3803bc2..f841c3519 100644 --- a/keyboards/atreus/atreus.h +++ b/keyboards/atreus/atreus.h @@ -10,16 +10,16 @@ // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array #define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ ) \ { \ { k00, k01, k02, k03, k04, KC_NO, k05, k06, k07, k08, k09 }, \ { k10, k11, k12, k13, k14, KC_NO, k15, k16, k17, k18, k19 }, \ { k20, k21, k22, k23, k24, k35, k25, k26, k27, k28, k29 }, \ - { k2a, k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a } \ + { k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b } \ } #endif -- cgit v1.2.3-24-g4f1b From 19848613380153f6d420f7807b41c70ee2f5797f Mon Sep 17 00:00:00 2001 From: milestogo Date: Tue, 19 Jul 2016 22:35:38 -0700 Subject: initial kinisis advantage build --- keyboards/kinesis/Makefile | 79 +++ keyboards/kinesis/config.h | 174 +++++++ keyboards/kinesis/docs/kicad/kinesis-cache.lib | 232 +++++++++ keyboards/kinesis/docs/kicad/kinesis.pro | 83 ++++ keyboards/kinesis/docs/kicad/kinesis.sch | 634 +++++++++++++++++++++++++ keyboards/kinesis/docs/photos/P1050573.jpg | Bin 0 -> 177711 bytes keyboards/kinesis/docs/photos/P1050574.jpg | Bin 0 -> 343978 bytes keyboards/kinesis/docs/photos/P1050575.jpg | Bin 0 -> 266771 bytes keyboards/kinesis/docs/readme.txt | 52 ++ keyboards/kinesis/docs/schematic.png | Bin 0 -> 175014 bytes keyboards/kinesis/keymaps/default/Makefile | 21 + keyboards/kinesis/keymaps/default/config.h | 8 + keyboards/kinesis/keymaps/default/keymap.c | 116 +++++ keyboards/kinesis/keymaps/default/readme.md | 1 + keyboards/kinesis/keymaps/programmer/Makefile | 21 + keyboards/kinesis/keymaps/programmer/config.h | 8 + keyboards/kinesis/keymaps/programmer/keymap.c | 245 ++++++++++ keyboards/kinesis/keymaps/programmer/readme.md | 2 + keyboards/kinesis/kinesis.c | 106 +++++ keyboards/kinesis/kinesis.h | 67 +++ keyboards/kinesis/matrix.c | 228 +++++++++ keyboards/kinesis/readme.md | 42 ++ 22 files changed, 2119 insertions(+) create mode 100644 keyboards/kinesis/Makefile create mode 100644 keyboards/kinesis/config.h create mode 100644 keyboards/kinesis/docs/kicad/kinesis-cache.lib create mode 100644 keyboards/kinesis/docs/kicad/kinesis.pro create mode 100644 keyboards/kinesis/docs/kicad/kinesis.sch create mode 100644 keyboards/kinesis/docs/photos/P1050573.jpg create mode 100644 keyboards/kinesis/docs/photos/P1050574.jpg create mode 100644 keyboards/kinesis/docs/photos/P1050575.jpg create mode 100644 keyboards/kinesis/docs/readme.txt create mode 100644 keyboards/kinesis/docs/schematic.png create mode 100644 keyboards/kinesis/keymaps/default/Makefile create mode 100644 keyboards/kinesis/keymaps/default/config.h create mode 100644 keyboards/kinesis/keymaps/default/keymap.c create mode 100644 keyboards/kinesis/keymaps/default/readme.md create mode 100644 keyboards/kinesis/keymaps/programmer/Makefile create mode 100644 keyboards/kinesis/keymaps/programmer/config.h create mode 100644 keyboards/kinesis/keymaps/programmer/keymap.c create mode 100644 keyboards/kinesis/keymaps/programmer/readme.md create mode 100644 keyboards/kinesis/kinesis.c create mode 100644 keyboards/kinesis/kinesis.h create mode 100644 keyboards/kinesis/matrix.c create mode 100644 keyboards/kinesis/readme.md diff --git a/keyboards/kinesis/Makefile b/keyboards/kinesis/Makefile new file mode 100644 index 000000000..ca077e636 --- /dev/null +++ b/keyboards/kinesis/Makefile @@ -0,0 +1,79 @@ + +## Project specific files + +SRC= matrix.c + +# MCU name +MCU = at90usb1286 +#MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=1024 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # 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 ?= no +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output should be port E6, current quantum library hardcodes C6, which we use for programming +CUSTOM_MATRIX=yes # need to do our own thing with the matrix + +ifndef QUANTUM_DIR + include ../../Makefile +endif + + diff --git a/keyboards/kinesis/config.h b/keyboards/kinesis/config.h new file mode 100644 index 000000000..8f1fdbdb6 --- /dev/null +++ b/keyboards/kinesis/config.h @@ -0,0 +1,174 @@ +/* +Copyright 2012 Jun Wako + +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 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT kinesis-advantage +#define DESCRIPTION A custom keyboard + +// Mouse +#define MOUSEKEY_DELAY 20 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 20 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_DELTA 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 1 + +/* key matrix size */ +#define MATRIX_ROWS 16 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +//Passed through the port multipler, so 4 pins =16 +#define MATRIX_ROW_PINS { F0,F1, F2, F3 } + +// May be upside down. +#define MATRIX_COL_PINS { B0,B1, B2, B3, B4, B5, B6, B7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/kinesis/docs/kicad/kinesis-cache.lib b/keyboards/kinesis/docs/kicad/kinesis-cache.lib new file mode 100644 index 000000000..f798d39d6 --- /dev/null +++ b/keyboards/kinesis/docs/kicad/kinesis-cache.lib @@ -0,0 +1,232 @@ +EESchema-LIBRARY Version 2.3 Date: Wednesday, November 12, 2014 'pmt' 10:15:19 pm +#encoding utf-8 +# +# AT90S4414-P +# +DEF AT90S4414-P IC 0 40 Y Y 1 F N +F0 "IC" -850 1880 40 H V L BNN +F1 "AT90S4414-P" 450 -1950 40 H V L BNN +F2 "DIL40" 0 0 30 H V C CIN +F3 "~" 0 0 60 H V C CNN +ALIAS AT90S8515-P +$FPLIST + 40DIP-ELL600 + 40dip600 +$ENDFPLIST +DRAW +S -850 1850 850 -1850 0 1 10 f +X (T0)PB0 1 1000 700 150 L 40 40 1 1 B +X (T1)PB1 2 1000 600 150 L 40 40 1 1 B +X (AIN0)PB2 3 1000 500 150 L 40 40 1 1 B +X (AIN1)PB3 4 1000 400 150 L 40 40 1 1 B +X (~SS~)PB4 5 1000 300 150 L 40 40 1 1 B +X (MOSI)PB5 6 1000 200 150 L 40 40 1 1 B +X (MISO)PB6 7 1000 100 150 L 40 40 1 1 B +X (SCK)PB7 8 1000 0 150 L 40 40 1 1 B +X ~RESET 9 -1000 1700 150 R 40 40 1 1 I +X (RXD)PD0 10 1000 -1000 150 L 40 40 1 1 B +X GND 20 0 -2000 150 U 40 40 1 1 W +X ALE 30 1000 850 150 L 40 40 1 1 O +X VCC 40 0 2000 150 D 40 40 1 1 W +X (TXD)PD1 11 1000 -1100 150 L 40 40 1 1 B +X (A8)PC0 21 1000 -150 150 L 40 40 1 1 B +X ICP 31 -1000 -1400 150 R 40 40 1 1 I +X (INT0)PD2 12 1000 -1200 150 L 40 40 1 1 B +X (A9)PC1 22 1000 -250 150 L 40 40 1 1 B +X (AD7)PA7 32 1000 1000 150 L 40 40 1 1 B +X (INT1)PD3 13 1000 -1300 150 L 40 40 1 1 B +X (A10)PC2 23 1000 -350 150 L 40 40 1 1 B +X (AD6)PA6 33 1000 1100 150 L 40 40 1 1 B +X PD4 14 1000 -1400 150 L 40 40 1 1 B +X (A11)PC3 24 1000 -450 150 L 40 40 1 1 B +X (AD5)PA5 34 1000 1200 150 L 40 40 1 1 B +X (OC1A)PD5 15 1000 -1500 150 L 40 40 1 1 B +X (A12)PC4 25 1000 -550 150 L 40 40 1 1 B +X (AD4)PA4 35 1000 1300 150 L 40 40 1 1 B +X (~WR~)PD6 16 1000 -1600 150 L 40 40 1 1 B +X (A13)PC5 26 1000 -650 150 L 40 40 1 1 B +X (AD3)PA3 36 1000 1400 150 L 40 40 1 1 B +X (~RD~)PD7 17 1000 -1700 150 L 40 40 1 1 B +X (A14)PC6 27 1000 -750 150 L 40 40 1 1 B +X (AD2)PA2 37 1000 1500 150 L 40 40 1 1 B +X XTAL2 18 -1000 1200 150 R 40 40 1 1 B +X (A15)PC7 28 1000 -850 150 L 40 40 1 1 B +X (AD1)PA1 38 1000 1600 150 L 40 40 1 1 B +X XTAL1 19 -1000 800 150 R 40 40 1 1 B +X OC1B 29 -1000 -1500 150 R 40 40 1 1 W +X (AD0)PA0 39 1000 1700 150 L 40 40 1 1 B +ENDDRAW +ENDDEF +# +# ATMEGA16U4-A +# +DEF ATMEGA16U4-A U 0 40 Y Y 1 F N +F0 "U" -950 1700 40 H V C CNN +F1 "ATMEGA16U4-A" 700 -1500 40 H V C CNN +F2 "TQFP44" 0 0 35 H V C CIN +F3 "~" 1100 1100 60 H V C CNN +ALIAS ATMEGA16U4RC-A ATMEGA32U4-A ATMEGA32U4RC-A +$FPLIST + TQFP44 +$ENDFPLIST +DRAW +S -1000 1650 950 -1450 0 1 10 f +X (INT6/AIN0)PE6 1 1100 -650 150 L 40 40 1 1 B +X UVCC 2 -450 1800 150 D 40 40 1 1 W +X D- 3 -1150 100 150 R 40 40 1 1 B +X D+ 4 -1150 200 150 R 40 40 1 1 B +X UGND 5 -400 -1600 150 U 40 40 1 1 P +X UCAP 6 -1150 -50 150 R 40 40 1 1 P +X VBUS 7 -1150 350 150 R 40 40 1 1 P +X (SS/PCINT0)PB0 8 1100 1550 150 L 40 40 1 1 B +X (SCLK/PCINT1)PB1 9 1100 1450 150 L 40 40 1 1 B +X (PDI/MOSI/PCINT2)PB2 10 1100 1350 150 L 40 40 1 1 B +X (RXD/INT2)PD2 20 1100 150 150 L 40 40 1 1 B +X (ADC13/OC1B/OC4B/PCINT13)PB6 30 1100 950 150 L 40 40 1 1 B +X (ADC1)PF1 40 1100 -950 150 L 40 40 1 1 B +X (PDO/MISO/PCINT3)PB3 11 1100 1250 150 L 40 40 1 1 B +X (TXD/INT3)PD3 21 1100 50 150 L 40 40 1 1 B +X (OC3A/~OC4A~)PC6 31 1100 650 150 L 40 40 1 1 B +X (ADC0)PF0 41 1100 -850 150 L 40 40 1 1 B +X (OC0A/OC1C/~RTS~/PCINT7)PB7 12 1100 850 150 L 40 40 1 1 B +X (XCK1/~CTS~)PD5 22 1100 -150 150 L 40 40 1 1 B +X (ICP3/CLK0/OC4A)PC7 32 1100 550 150 L 40 40 1 1 B +X AREF 42 -1150 -850 150 R 40 40 1 1 P +X ~RESET~ 13 -1150 1550 150 R 40 40 1 1 I +X GND 23 -50 -1600 150 U 40 40 1 1 W +X (~HWB~)PE2 33 1100 -550 150 L 40 40 1 1 B +X GND 43 150 -1600 150 U 40 40 1 1 W +X VCC 14 -200 1800 150 D 40 40 1 1 W +X AVCC 24 150 1800 150 D 40 40 1 1 W +X VCC 34 -100 1800 150 D 40 40 1 1 W +X AVCC 44 250 1800 150 D 40 40 1 1 W +X GND 15 -150 -1600 150 U 40 40 1 1 W +X (ICP2/ADC8)PD4 25 1100 -50 150 L 40 40 1 1 B +X GND 35 50 -1600 150 U 40 40 1 1 W +X XTAL2 16 -1150 950 150 R 40 40 1 1 O +X (T1/~OC4D~/ADC9)PD6 26 1100 -250 150 L 40 40 1 1 B +X (ADC7/TDI)PF7 36 1100 -1350 150 L 40 40 1 1 B +X XTAL1 17 -1150 1150 150 R 40 40 1 1 I +X (T0/OC4D/ADC10)PD7 27 1100 -350 150 L 40 40 1 1 B +X (ADC6/TDO)PF6 37 1100 -1250 150 L 40 40 1 1 B +X (OC0B/SCL/INT0)PD0 18 1100 350 150 L 40 40 1 1 B +X (ADC11/PCINT4)PB4 28 1100 1150 150 L 40 40 1 1 B +X (ADC5/TMS)PF5 38 1100 -1150 150 L 40 40 1 1 B +X (SDA/INT1)PD1 19 1100 250 150 L 40 40 1 1 B +X (ADC12/OC1A/~OC4B~/PCINT12)PB5 29 1100 1050 150 L 40 40 1 1 B +X (ADC4/TCK)PF4 39 1100 -1050 150 L 40 40 1 1 B +ENDDRAW +ENDDEF +# +# C +# +DEF C C 0 10 N Y 1 F N +F0 "C" 0 100 40 H V L CNN +F1 "C" 6 -85 40 H V L CNN +F2 "~" 38 -150 30 H V C CNN +F3 "~" 0 0 60 H V C CNN +$FPLIST + SM* + C? + C1-1 +$ENDFPLIST +DRAW +P 2 0 1 20 -80 -30 80 -30 N +P 2 0 1 20 -80 30 80 30 N +X ~ 1 0 200 170 D 40 40 1 1 P +X ~ 2 0 -200 170 U 40 40 1 1 P +ENDDRAW +ENDDEF +# +# CONN_7 +# +DEF CONN_7 P 0 40 Y N 1 F N +F0 "P" -30 0 60 V V C CNN +F1 "CONN_7" 70 0 60 V V C CNN +F2 "~" 0 0 60 H V C CNN +F3 "~" 0 0 60 H V C CNN +DRAW +S -100 350 150 -350 0 1 0 N +X P1 1 -350 300 250 R 50 50 1 1 P I +X P2 2 -350 200 250 R 50 50 1 1 P I +X P3 3 -350 100 250 R 50 50 1 1 P I +X P4 4 -350 0 250 R 50 50 1 1 P I +X P5 5 -350 -100 250 R 50 50 1 1 P I +X P6 6 -350 -200 250 R 50 50 1 1 P I +X P7 7 -350 -300 250 R 50 50 1 1 P I +ENDDRAW +ENDDEF +# +# GND +# +DEF ~GND #PWR 0 0 Y Y 1 F P +F0 "#PWR" 0 0 30 H I C CNN +F1 "GND" 0 -70 30 H I C CNN +F2 "~" 0 0 60 H V C CNN +F3 "~" 0 0 60 H V C CNN +DRAW +P 4 0 1 0 -50 0 0 -50 50 0 -50 0 N +X GND 1 0 0 0 U 30 30 1 1 W N +ENDDRAW +ENDDEF +# +# R +# +DEF R R 0 0 N Y 1 F N +F0 "R" 80 0 40 V V C CNN +F1 "R" 7 1 40 V V C CNN +F2 "~" -70 0 30 V V C CNN +F3 "~" 0 0 30 H V C CNN +$FPLIST + R? + SM0603 + SM0805 + R?-* + SM1206 +$ENDFPLIST +DRAW +S -40 150 40 -150 0 1 12 N +X ~ 1 0 250 100 D 60 60 1 1 P +X ~ 2 0 -250 100 U 60 60 1 1 P +ENDDRAW +ENDDEF +# +# USB-MINI-B +# +DEF USB-MINI-B CON 0 40 Y Y 1 F N +F0 "CON" -250 450 60 H V C CNN +F1 "USB-MINI-B" -50 -500 60 H V C CNN +F2 "~" 0 0 60 H V C CNN +F3 "~" 0 0 60 H V C CNN +$FPLIST + USB-Mini-B-Jack +$ENDFPLIST +DRAW +S -350 400 350 -400 0 1 0 N +X VBUS 1 -550 300 200 R 50 50 1 1 W +X D- 2 -550 150 200 R 50 50 1 1 B +X D+ 3 -550 0 200 R 50 50 1 1 B +X ID 4 -550 -150 200 R 50 50 1 1 B +X GND 5 -550 -300 200 R 50 50 1 1 W +X SHELL1 6 550 300 200 L 50 50 1 1 B +X SHELL2 7 550 150 200 L 50 50 1 1 B +X SHELL3 8 550 -150 200 L 50 50 1 1 B +X SHELL4 9 550 -300 200 L 50 50 1 1 B +ENDDRAW +ENDDEF +# +# VCC +# +DEF VCC #PWR 0 0 Y Y 1 F P +F0 "#PWR" 0 100 30 H I C CNN +F1 "VCC" 0 100 30 H V C CNN +F2 "~" 0 0 60 H V C CNN +F3 "~" 0 0 60 H V C CNN +DRAW +X VCC 1 0 0 0 U 20 20 0 0 W N +C 0 50 20 0 1 0 N +P 3 0 1 0 0 0 0 30 0 30 N +ENDDRAW +ENDDEF +# +#End Library diff --git a/keyboards/kinesis/docs/kicad/kinesis.pro b/keyboards/kinesis/docs/kicad/kinesis.pro new file mode 100644 index 000000000..9f130b509 --- /dev/null +++ b/keyboards/kinesis/docs/kicad/kinesis.pro @@ -0,0 +1,83 @@ +update=Wednesday, November 05, 2014 'pmt' 12:08:47 pm +version=1 +last_client=pcbnew +[cvpcb] +version=1 +NetIExt=net +[cvpcb/libraries] +EquName1=devcms +[general] +version=1 +[eeschema] +version=1 +PageLayoutDescrFile= +SubpartIdSeparator=0 +SubpartFirstId=65 +LibDir=../../../lib/kicad/library +NetFmtName= +RptD_X=0 +RptD_Y=100 +RptLab=1 +LabSize=60 +[eeschema/libraries] +LibName1=power +LibName2=device +LibName3=transistors +LibName4=conn +LibName5=linear +LibName6=regul +LibName7=74xx +LibName8=cmos4000 +LibName9=adc-dac +LibName10=memory +LibName11=xilinx +LibName12=special +LibName13=microcontrollers +LibName14=dsp +LibName15=microchip +LibName16=analog_switches +LibName17=motorola +LibName18=texas +LibName19=intel +LibName20=audio +LibName21=interface +LibName22=digital-audio +LibName23=philips +LibName24=display +LibName25=cypress +LibName26=siliconi +LibName27=opto +LibName28=atmel +LibName29=contrib +LibName30=valves +LibName31=custom +[pcbnew] +version=1 +LastNetListRead= +UseCmpFile=1 +PadDrill=1.016000000000 +PadDrillOvalY=1.016000000000 +PadSizeH=1.524000000000 +PadSizeV=1.524000000000 +PcbTextSizeV=1.500000000000 +PcbTextSizeH=1.500000000000 +PcbTextThickness=0.300000000000 +ModuleTextSizeV=1.000000000000 +ModuleTextSizeH=1.000000000000 +ModuleTextSizeThickness=0.150000000000 +SolderMaskClearance=0.000000000000 +SolderMaskMinWidth=0.000000000000 +DrawSegmentWidth=0.200000000000 +BoardOutlineThickness=0.100000000000 +ModuleOutlineThickness=0.150000000000 +[pcbnew/libraries] +LibDir=../../../lib/kicad/modules +LibName1=custom +LibName2=Sockets +LibName3=Connect +LibName4=Discret +LibName5=Divers +LibName6=Display +LibName7=LEDs +LibName8=SMD_Packages +LibName9=Sockets_DIP diff --git a/keyboards/kinesis/docs/kicad/kinesis.sch b/keyboards/kinesis/docs/kicad/kinesis.sch new file mode 100644 index 000000000..f75335aa0 --- /dev/null +++ b/keyboards/kinesis/docs/kicad/kinesis.sch @@ -0,0 +1,634 @@ +EESchema Schematic File Version 2 +LIBS:power +LIBS:device +LIBS:transistors +LIBS:conn +LIBS:linear +LIBS:regul +LIBS:74xx +LIBS:cmos4000 +LIBS:adc-dac +LIBS:memory +LIBS:xilinx +LIBS:special +LIBS:microcontrollers +LIBS:dsp +LIBS:microchip +LIBS:analog_switches +LIBS:motorola +LIBS:texas +LIBS:intel +LIBS:audio +LIBS:interface +LIBS:digital-audio +LIBS:philips +LIBS:display +LIBS:cypress +LIBS:siliconi +LIBS:opto +LIBS:atmel +LIBS:contrib +LIBS:valves +LIBS:custom +LIBS:kinesis-cache +EELAYER 27 0 +EELAYER END +$Descr A4 11693 8268 +encoding utf-8 +Sheet 1 1 +Title "" +Date "13 nov 2014" +Rev "" +Comp "" +Comment1 "" +Comment2 "" +Comment3 "" +Comment4 "" +$EndDescr +$Comp +L C C4 +U 1 1 545804FB +P 2850 4250 +F 0 "C4" H 2850 4350 40 0000 L CNN +F 1 "1uF" H 2856 4165 40 0000 L CNN +F 2 "~" H 2888 4100 30 0000 C CNN +F 3 "~" H 2850 4250 60 0000 C CNN + 1 2850 4250 + -1 0 0 1 +$EndComp +$Comp +L R R3 +U 1 1 545805E8 +P 2500 4000 +F 0 "R3" V 2580 4000 40 0000 C CNN +F 1 "22" V 2507 4001 40 0000 C CNN +F 2 "~" V 2430 4000 30 0000 C CNN +F 3 "~" H 2500 4000 30 0000 C CNN + 1 2500 4000 + 0 -1 -1 0 +$EndComp +$Comp +L R R2 +U 1 1 545805FA +P 2500 3800 +F 0 "R2" V 2580 3800 40 0000 C CNN +F 1 "22" V 2507 3801 40 0000 C CNN +F 2 "~" V 2430 3800 30 0000 C CNN +F 3 "~" H 2500 3800 30 0000 C CNN + 1 2500 3800 + 0 -1 -1 0 +$EndComp +Entry Wire Line + 6450 2450 6550 2550 +Entry Wire Line + 6450 2550 6550 2650 +Entry Wire Line + 6450 2650 6550 2750 +Entry Wire Line + 6450 2750 6550 2850 +Entry Wire Line + 6450 2950 6550 3050 +Entry Wire Line + 6450 3050 6550 3150 +Entry Wire Line + 6450 2850 6550 2950 +Entry Wire Line + 6450 3150 6550 3250 +Wire Wire Line + 10250 1800 10750 1800 +Entry Wire Line + 10750 1800 10850 1900 +Entry Wire Line + 10750 1900 10850 2000 +Entry Wire Line + 10750 2000 10850 2100 +Entry Wire Line + 10750 2800 10850 2900 +Entry Wire Line + 10750 2900 10850 3000 +Entry Wire Line + 10750 3000 10850 3100 +Entry Wire Line + 10750 3100 10850 3200 +Entry Wire Line + 10750 3200 10850 3300 +Entry Wire Line + 10750 3300 10850 3400 +$Comp +L AT90S8515-P IC2 +U 1 1 545A62EA +P 9250 3500 +F 0 "IC2" H 8400 5380 40 0000 L BNN +F 1 "AT90S8515-P" H 9700 1550 40 0000 L BNN +F 2 "DIL40" H 9250 3500 30 0000 C CIN +F 3 "" H 9250 3500 60 0000 C CNN + 1 9250 3500 + 1 0 0 -1 +$EndComp +NoConn ~ 10250 2650 +Entry Wire Line + 10750 3650 10850 3750 +Entry Wire Line + 10750 3750 10850 3850 +Entry Wire Line + 10750 3850 10850 3950 +Entry Wire Line + 10750 3950 10850 4050 +Entry Wire Line + 10750 4050 10850 4150 +Entry Wire Line + 10750 4150 10850 4250 +Entry Wire Line + 10750 4350 10850 4450 +Entry Wire Line + 10750 4250 10850 4350 +NoConn ~ 8250 4900 +NoConn ~ 8250 5000 +NoConn ~ 8250 1800 +Wire Wire Line + 10250 1900 10750 1900 +Wire Wire Line + 10250 2000 10750 2000 +Wire Wire Line + 10250 2100 10750 2100 +Wire Wire Line + 10250 2200 10750 2200 +Wire Wire Line + 10250 2300 10750 2300 +Wire Wire Line + 10250 2400 10750 2400 +Wire Wire Line + 10250 2500 10750 2500 +Text Label 10350 1800 0 60 ~ 0 +A +Text Label 10350 1900 0 60 ~ 0 +B +Text Label 10350 2000 0 60 ~ 0 +C +Text Label 10350 2100 0 60 ~ 0 +G +Wire Wire Line + 10250 2800 10750 2800 +Wire Wire Line + 10250 2900 10750 2900 +Wire Wire Line + 10250 3000 10750 3000 +Wire Wire Line + 10250 3100 10750 3100 +Wire Wire Line + 10250 3200 10750 3200 +Wire Wire Line + 10250 3300 10750 3300 +Wire Wire Line + 10250 3400 10750 3400 +Wire Wire Line + 10250 3500 10750 3500 +Text Label 10350 2800 0 60 ~ 0 +DL2 +Text Label 10350 2900 0 60 ~ 0 +DR1 +Text Label 10350 3000 0 60 ~ 0 +DR2 +Text Label 10350 3100 0 60 ~ 0 +DL1 +Text Label 10350 3400 0 60 ~ 0 +SCL +Text Label 10350 3500 0 60 ~ 0 +SDA +Wire Wire Line + 10250 3650 10750 3650 +Wire Wire Line + 10250 3750 10750 3750 +Wire Wire Line + 10250 3850 10750 3850 +Wire Wire Line + 10250 3950 10750 3950 +Wire Wire Line + 10250 4050 10750 4050 +Wire Wire Line + 10250 4150 10750 4150 +Wire Wire Line + 10250 4250 10750 4250 +Wire Wire Line + 10250 4350 10750 4350 +Text Label 10350 3650 0 60 ~ 0 +R1 +Text Label 10350 3750 0 60 ~ 0 +R2 +Text Label 10350 3850 0 60 ~ 0 +R3 +Text Label 10350 3950 0 60 ~ 0 +R4 +Text Label 10350 4050 0 60 ~ 0 +R5 +Text Label 10350 4150 0 60 ~ 0 +R6 +Text Label 10350 4250 0 60 ~ 0 +R7 +Text Label 10350 4350 0 60 ~ 0 +R8 +Wire Wire Line + 10250 4500 10750 4500 +Wire Wire Line + 10250 4600 10750 4600 +Wire Wire Line + 10250 4700 10750 4700 +Wire Wire Line + 10250 4800 10750 4800 +Wire Wire Line + 10250 4900 10750 4900 +Wire Wire Line + 10250 5000 10750 5000 +Wire Wire Line + 10250 5100 10750 5100 +Wire Wire Line + 10250 5200 10750 5200 +Text Label 10350 4600 0 60 ~ 0 +FS1 +Text Label 10350 5000 0 60 ~ 0 +FS3 +Text Label 10350 5200 0 60 ~ 0 +FS2 +$Comp +L GND #PWR01 +U 1 1 545A7377 +P 9250 5600 +F 0 "#PWR01" H 9250 5600 30 0001 C CNN +F 1 "GND" H 9250 5530 30 0001 C CNN +F 2 "" H 9250 5600 60 0000 C CNN +F 3 "" H 9250 5600 60 0000 C CNN + 1 9250 5600 + 1 0 0 -1 +$EndComp +Wire Wire Line + 9250 5500 9250 5600 +Text Label 10350 4700 0 60 ~ 0 +CLOCK +Text Label 10350 4800 0 60 ~ 0 +DATA +NoConn ~ 10750 4700 +NoConn ~ 10750 4800 +Text Label 10350 3200 0 60 ~ 0 +KP +Text Label 10350 3300 0 60 ~ 0 +PGM +Text Label 10350 2500 0 60 ~ 0 +BUZZ +NoConn ~ 8250 2300 +NoConn ~ 8250 2700 +$Comp +L GND #PWR02 +U 1 1 545A7565 +P 4750 5700 +F 0 "#PWR02" H 4750 5700 30 0001 C CNN +F 1 "GND" H 4750 5630 30 0001 C CNN +F 2 "" H 4750 5700 60 0000 C CNN +F 3 "" H 4750 5700 60 0000 C CNN + 1 4750 5700 + 1 0 0 -1 +$EndComp +Entry Wire Line + 6450 3650 6550 3750 +Entry Wire Line + 6450 3750 6550 3850 +Entry Wire Line + 6450 4150 6550 4250 +Entry Wire Line + 6450 4250 6550 4350 +Entry Wire Line + 6450 4050 6550 4150 +Entry Wire Line + 6450 4350 6550 4450 +NoConn ~ 3750 2850 +Wire Wire Line + 1200 2000 6450 2000 +NoConn ~ 3750 3050 +Wire Wire Line + 2750 3800 3750 3800 +Wire Wire Line + 2750 3900 3750 3900 +Wire Wire Line + 2750 3900 2750 4000 +Wire Bus Line + 6550 2100 6550 6050 +Wire Bus Line + 10850 1600 10850 6050 +Text Label 6050 4350 0 60 ~ 0 +DL1 +Text Label 6050 4250 0 60 ~ 0 +DR2 +Text Label 6050 4150 0 60 ~ 0 +DR1 +Text Label 6050 4050 0 60 ~ 0 +DL2 +Text Label 6050 2450 0 60 ~ 0 +R1 +Text Label 6050 2550 0 60 ~ 0 +R2 +Text Label 6050 2650 0 60 ~ 0 +R3 +Text Label 6050 2750 0 60 ~ 0 +R4 +Text Label 6050 2850 0 60 ~ 0 +R5 +Text Label 6050 2950 0 60 ~ 0 +R6 +Text Label 6050 3050 0 60 ~ 0 +R7 +Text Label 6050 3150 0 60 ~ 0 +R8 +Text Label 6050 5050 0 60 ~ 0 +A +Text Label 6050 5150 0 60 ~ 0 +B +Text Label 6050 5250 0 60 ~ 0 +C +Text Label 6050 5350 0 60 ~ 0 +G +Text Label 1300 3800 0 60 ~ 0 +D+ +Text Label 1300 4000 0 60 ~ 0 +D- +NoConn ~ 10750 2200 +NoConn ~ 10750 2300 +NoConn ~ 10750 2400 +Text Label 10350 4500 0 60 ~ 0 +GND +NoConn ~ 10750 4900 +NoConn ~ 10750 5100 +Text Label 6050 3450 0 60 ~ 0 +KP +Text Label 6050 3350 0 60 ~ 0 +PGM +$Comp +L ATMEGA32U4-A U1 +U 1 1 5462E0B1 +P 4900 4000 +F 0 "U1" H 3950 5700 40 0000 C CNN +F 1 "ATMEGA32U4-A" H 5600 2500 40 0000 C CNN +F 2 "TQFP44" H 4900 4000 35 0000 C CIN +F 3 "" H 6000 5100 60 0000 C CNN + 1 4900 4000 + 1 0 0 -1 +$EndComp +Wire Wire Line + 3750 4850 3750 5600 +Wire Wire Line + 4450 2200 5150 2200 +Connection ~ 4700 2200 +Connection ~ 4800 2200 +Connection ~ 5050 2200 +Connection ~ 4800 2000 +Wire Wire Line + 6000 2450 6450 2450 +Wire Wire Line + 6000 2550 6450 2550 +Wire Wire Line + 6000 2650 6450 2650 +Wire Wire Line + 6000 2750 6450 2750 +Wire Wire Line + 6000 2850 6450 2850 +Wire Wire Line + 6000 2950 6450 2950 +Wire Wire Line + 6000 3050 6450 3050 +Wire Wire Line + 6000 3150 6450 3150 +Wire Wire Line + 6000 5050 6450 5050 +Wire Wire Line + 6000 5150 6450 5150 +Wire Wire Line + 6000 5250 6450 5250 +Wire Wire Line + 6000 4050 6450 4050 +Wire Wire Line + 6000 4150 6450 4150 +Wire Wire Line + 6000 4250 6450 4250 +Wire Wire Line + 6000 4350 6450 4350 +Wire Wire Line + 6000 4550 6450 4550 +Entry Wire Line + 6450 3350 6550 3450 +Entry Wire Line + 6450 3450 6550 3550 +Entry Wire Line + 6450 5050 6550 5150 +Entry Wire Line + 6450 5150 6550 5250 +Entry Wire Line + 6450 5250 6550 5350 +Entry Wire Line + 6450 5350 6550 5450 +Entry Wire Line + 6450 4650 6550 4750 +Wire Wire Line + 6000 3350 6450 3350 +Wire Wire Line + 6000 3450 6450 3450 +Wire Wire Line + 1200 5600 6450 5600 +Connection ~ 4950 5600 +Connection ~ 4850 5600 +Wire Wire Line + 4750 5600 4750 5700 +Connection ~ 4750 5600 +Connection ~ 4500 5600 +Text Label 6050 4550 0 60 ~ 0 +HWB +Wire Wire Line + 6000 5350 6450 5350 +Wire Wire Line + 6000 3650 6450 3650 +Wire Wire Line + 6000 3750 6450 3750 +Text Label 6050 3650 0 60 ~ 0 +SCL +Text Label 6050 3750 0 60 ~ 0 +SDA +Wire Wire Line + 6000 3850 6450 3850 +Wire Wire Line + 6000 3950 6450 3950 +Wire Wire Line + 6000 4650 6450 4650 +Text Label 6050 4650 0 60 ~ 0 +BUZZ +NoConn ~ 10750 4600 +NoConn ~ 10750 5000 +NoConn ~ 10750 5200 +Entry Wire Line + 10750 3400 10850 3500 +Entry Wire Line + 10750 3500 10850 3600 +Entry Wire Line + 10750 4500 10850 4600 +Wire Wire Line + 2850 4050 3750 4050 +Text Label 2950 4050 0 60 ~ 0 +UCAP +Wire Wire Line + 6000 4850 6450 4850 +Wire Wire Line + 6000 4950 6450 4950 +NoConn ~ 6450 4850 +NoConn ~ 6450 4950 +NoConn ~ 6450 4550 +$Comp +L USB-MINI-B CON1 +U 1 1 546431C1 +P 2100 5050 +F 0 "CON1" H 1850 5500 60 0000 C CNN +F 1 "USB-MINI-B" H 2050 4550 60 0000 C CNN +F 2 "" H 2100 5050 60 0000 C CNN +F 3 "" H 2100 5050 60 0000 C CNN + 1 2100 5050 + 0 1 1 0 +$EndComp +$Comp +L VCC #PWR03 +U 1 1 54643698 +P 2400 4400 +F 0 "#PWR03" H 2400 4500 30 0001 C CNN +F 1 "VCC" H 2400 4500 30 0000 C CNN +F 2 "" H 2400 4400 60 0000 C CNN +F 3 "" H 2400 4400 60 0000 C CNN + 1 2400 4400 + 1 0 0 -1 +$EndComp +Text Notes 2600 2750 0 60 ~ 0 +Teensy 2.0\n(not fully drawn) +$Comp +L CONN_7 B7K-PH-K-S1 +U 1 1 54643939 +P 1950 6900 +F 0 "B7K-PH-K-S1" V 1920 6900 60 0000 C CNN +F 1 "CONN_7" V 2020 6900 60 0000 C CNN +F 2 "" H 1950 6900 60 0000 C CNN +F 3 "" H 1950 6900 60 0000 C CNN + 1 1950 6900 + 1 0 0 -1 +$EndComp +Connection ~ 3750 5600 +Connection ~ 2400 5600 +Connection ~ 2250 5600 +Connection ~ 1950 5600 +Wire Wire Line + 2400 4400 2400 4500 +Wire Wire Line + 2250 4000 2250 4500 +Wire Wire Line + 1200 3800 2250 3800 +Wire Wire Line + 2100 3800 2100 4500 +Wire Wire Line + 2850 4450 2850 5600 +Connection ~ 2850 5600 +Entry Wire Line + 1100 6800 1200 6900 +Entry Wire Line + 1100 6900 1200 7000 +Entry Wire Line + 1100 7000 1200 7100 +Entry Wire Line + 1100 6700 1200 6800 +Wire Wire Line + 1200 6600 1600 6600 +Wire Wire Line + 1200 6700 1600 6700 +Wire Wire Line + 1200 6800 1600 6800 +Wire Wire Line + 1200 6900 1600 6900 +Wire Wire Line + 1200 7000 1600 7000 +Wire Wire Line + 1200 7100 1600 7100 +Wire Wire Line + 1200 7200 1600 7200 +Text Label 1300 6600 0 60 ~ 0 +FS2 +Text Label 1300 6700 0 60 ~ 0 +FS1 +Text Label 1300 6800 0 60 ~ 0 +VCC +Text Label 1300 6900 0 60 ~ 0 +D- +Text Label 1300 7000 0 60 ~ 0 +D+ +Text Label 1300 7100 0 60 ~ 0 +GND +Text Label 1300 7200 0 60 ~ 0 +FS3 +NoConn ~ 3750 2450 +Wire Wire Line + 3600 2000 3600 3650 +Wire Wire Line + 3600 3650 3750 3650 +NoConn ~ 1950 4500 +Wire Bus Line + 1100 1900 1100 7100 +NoConn ~ 1200 6600 +NoConn ~ 1200 6700 +NoConn ~ 1200 7200 +Connection ~ 2100 3800 +Wire Wire Line + 1200 4000 2250 4000 +Entry Wire Line + 1100 3700 1200 3800 +Entry Wire Line + 1100 3900 1200 4000 +Text Label 10350 1500 0 60 ~ 0 +VCC +Entry Wire Line + 1100 1900 1200 2000 +Text Label 1250 2000 0 60 ~ 0 +VCC +Entry Wire Line + 1100 5500 1200 5600 +Connection ~ 1800 5600 +Text Label 1300 5600 0 60 ~ 0 +GND +Wire Wire Line + 9250 5500 10750 5500 +Entry Wire Line + 10750 5500 10850 5600 +Text Label 10350 5500 0 60 ~ 0 +GND +Wire Wire Line + 9250 1500 10750 1500 +Entry Wire Line + 10750 1500 10850 1600 +Connection ~ 3600 2000 +Wire Wire Line + 4800 2000 4800 2200 +Entry Wire Line + 6450 2000 6550 2100 +Text Label 6050 2000 0 60 ~ 0 +VCC +Connection ~ 5050 5600 +Entry Wire Line + 6450 5600 6550 5700 +Text Label 6050 5600 0 60 ~ 0 +GND +NoConn ~ 6450 3850 +NoConn ~ 6450 3950 +Wire Wire Line + 1800 4500 1500 4500 +Wire Wire Line + 1500 4500 1500 5600 +Connection ~ 1500 5600 +Entry Wire Line + 10750 2500 10850 2600 +Entry Wire Line + 10750 2100 10850 2200 +Text Notes 1000 5300 1 60 ~ 0 +Sacrificial USB cable from header to Teensy +Text Notes 7850 5950 0 60 ~ 0 +Ribbon cable between Teensy pins and socket +Wire Bus Line + 10850 6050 6550 6050 +$EndSCHEMATC diff --git a/keyboards/kinesis/docs/photos/P1050573.jpg b/keyboards/kinesis/docs/photos/P1050573.jpg new file mode 100644 index 000000000..027ab9efb Binary files /dev/null and b/keyboards/kinesis/docs/photos/P1050573.jpg differ diff --git a/keyboards/kinesis/docs/photos/P1050574.jpg b/keyboards/kinesis/docs/photos/P1050574.jpg new file mode 100644 index 000000000..d49c492b8 Binary files /dev/null and b/keyboards/kinesis/docs/photos/P1050574.jpg differ diff --git a/keyboards/kinesis/docs/photos/P1050575.jpg b/keyboards/kinesis/docs/photos/P1050575.jpg new file mode 100644 index 000000000..50cc9897c Binary files /dev/null and b/keyboards/kinesis/docs/photos/P1050575.jpg differ diff --git a/keyboards/kinesis/docs/readme.txt b/keyboards/kinesis/docs/readme.txt new file mode 100644 index 000000000..af33ac490 --- /dev/null +++ b/keyboards/kinesis/docs/readme.txt @@ -0,0 +1,52 @@ +This directory of documentation was copied from https://github.com/wjanssens/tmk_keyboard/tree/master/keyboard/kinesis +and is probably Copyright 2014 Warren Janssens +and probably released under GPL v2, which may be recovered at . + +Row configuration +PF0 A +PF1 B +PF2 C +PF3 G 0 = U4, 1 = U5 + +Column configuration + 4y0 4y1 4y2 4y3 4y4 4y5 4y6 4y7 5y0 5y1 5y2 5y3 5y4 5y5 5y6 5y7 + r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 +PB0 21 c1 f6 f8 f7 5 4 3 2 1 =+ +PB1 22 c2 f3 f5 f4 t r e w q TAB +PB2 23 c3 ESC f2 f1 g f d s a CL +PB3 24 c4 f9 f11 f10 b v c x z LS UP DN [{ ]} +PB4 25 c5 f12 SL PS RT LT §± `~ 6 7 8 9 0 -_ +PB5 26 c6 PB PGM KPD y u i o p \ +PB6 27 c7 LC DL BS RC EN SP h j k l ;: '" +PB7 28 c8 RA PU PD n m ,< .> /? RS + */ + + +40 pin connector + + DL2 1 40 VCC + DR1 2 39 A + DR2 3 38 B + DL1 4 37 C + KPD 5 36 G + PGM 6 35 + SCL 7 34 + SDA 8 33 + RST 9 32 BUZZ + WP 10 31 EA + FS1 11 30 ALE + CLOCK 12 29 PSEN + DATA 13 28 r8 + 14 27 r7 + FS3 15 26 r6 + 16 25 r5 + FS2 17 24 r4 + XTAL1 18 23 r3 + XTAL2 19 22 r2 + GND 20 21 r1 + + +references: +https://github.com/chrisandreae/keyboard-firmware + + diff --git a/keyboards/kinesis/docs/schematic.png b/keyboards/kinesis/docs/schematic.png new file mode 100644 index 000000000..fa9405a1f Binary files /dev/null and b/keyboards/kinesis/docs/schematic.png differ diff --git a/keyboards/kinesis/keymaps/default/Makefile b/keyboards/kinesis/keymaps/default/Makefile new file mode 100644 index 000000000..9d3df5964 --- /dev/null +++ b/keyboards/kinesis/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/kinesis/keymaps/default/config.h b/keyboards/kinesis/keymaps/default/config.h new file mode 100644 index 000000000..8893d122e --- /dev/null +++ b/keyboards/kinesis/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/kinesis/keymaps/default/keymap.c b/keyboards/kinesis/keymaps/default/keymap.c new file mode 100644 index 000000000..3bf80699c --- /dev/null +++ b/keyboards/kinesis/keymaps/default/keymap.c @@ -0,0 +1,116 @@ +#include "kinesis.h" +#include "action_layer.h" + +#define QWERTY 0 // Base qerty +#define SYMB 1// Symbol layer + +// An almost entirely blank keymap. Test layers with the upper right hand key - 1 in normal mode, reset in layer 2. + + +/**************************************************************************************************** +* +* Keymap: Default Layer in Qwerty +* +* ,-------------------------------------------------------------------------------------------------------------------. +* | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F8 | F9 | F10 | F12 | PSCR | SLCK | PAUS | FN0 | BOOT | +* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------| +* | =+ | 1! | 2@ | 3# | 4$ | 5% | | 6^ | 7& | 8* | 9( | 0) | -_ | +* |--------+------+------+------+------+------| +------+------+------+------+------+--------| +* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \| | +* |--------+------+------+------+------+------| |------+------+------+------+------+--------| +* | Caps | A | S | D | F | G | | H | J | K | L | ;: | '" | +* |--------+------+------+------+------+------| |------+------+------+------+------+--------| +* | Shift | Z | X | C | V | B | | N | M | ,. | .> | /? | Shift | +* `--------+------+------+------+------+------- `------+------+------+------+------+--------' +* | `~ | INS | Left | Right| | Up | Down | [{ | ]} | +* `---------------------------' `---------------------------' +* ,-------------. ,-------------. +* | Ctrl | Alt | | Gui | Ctrl | +* ,------|------|------| |------+------+------. +* | | | Home | | PgUp | | | +* | BkSp | Del |------| |------|Return| Space| +* | | | End | | PgDn | | | +* `--------------------' `--------------------' +*/ + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[QWERTY] = KEYMAP( + KC_ESC, KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8, + KC_EQL, KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , + KC_TAB, KC_Q ,KC_W ,KC_E ,KC_R ,KC_T , + KC_CAPS,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , + KC_GRV ,KC_INS ,KC_LEFT,KC_RGHT, + KC_LCTL,KC_LALT, + KC_HOME, + KC_BSPC,KC_DEL ,KC_END , + KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_PSCR ,KC_SLCK ,KC_PAUS, KC_FN0, KC_1, + KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS, + KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BSLS, + KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT, + KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT, + KC_UP ,KC_DOWN,KC_LBRC,KC_RBRC, + KC_RGUI,KC_RCTL, + KC_PGUP, + KC_PGDN,KC_ENTER ,KC_SPC + ), +[SYMB] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_FN0, RESET, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_TOGGLE(SYMB) , // FN1 - Momentary Layer 1 (Symbols) + + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kinesis/keymaps/default/readme.md b/keyboards/kinesis/keymaps/default/readme.md new file mode 100644 index 000000000..da033be1e --- /dev/null +++ b/keyboards/kinesis/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for kinesis-advantage diff --git a/keyboards/kinesis/keymaps/programmer/Makefile b/keyboards/kinesis/keymaps/programmer/Makefile new file mode 100644 index 000000000..9d3df5964 --- /dev/null +++ b/keyboards/kinesis/keymaps/programmer/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/kinesis/keymaps/programmer/config.h b/keyboards/kinesis/keymaps/programmer/config.h new file mode 100644 index 000000000..8893d122e --- /dev/null +++ b/keyboards/kinesis/keymaps/programmer/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/kinesis/keymaps/programmer/keymap.c b/keyboards/kinesis/keymaps/programmer/keymap.c new file mode 100644 index 000000000..83fb7bd5f --- /dev/null +++ b/keyboards/kinesis/keymaps/programmer/keymap.c @@ -0,0 +1,245 @@ +#include "kinesis.h" +#include "action_layer.h" +#include "mousekey.h" + +#define QWERTY 0 // Base qerty +#define SYMB 1// Symbol layer +#define MOUSE 2// + + + + +/* Macros */ +enum { + NONE = 0, + // Diagonal mouse movement + A_MUL, + A_MUR, + A_MDL, + A_MDR, +}; + + +// Borrowing very heavily from +// https://github.com/alvicstep/tmk_keyboard +/**************************************************************************************************** +* +* Keymap: Default Layer in Qwerty +* +* ,-------------------------------------------------------------------------------------------------------------------. +* | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F8 | F9 | F10 | F12 | FN0 | FN1 | FN2 | | bOOT | +* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------| +* | =+ | 1! | 2@ | 3# | 4$ | 5% | | 6^ | 7& | 8* | 9( | 0) | -_ | +* |--------+------+------+------+------+------| +------+------+------+------+------+--------| +* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \| | +* |--------+------+------+------+------+------| |------+------+------+------+------+--------| +* |MouseFN1| A | S | D | F | G | | H | J | K | L | ;: | '" | +* |--------+------+------+------+------+------| |------+------+------+------+------+--------| +* | Shift | Z | X | C | V | B | | N | M | ,. | .> | /? | Shift | +* `--------+------+------+------+------+------- `------+------+------+------+------+--------' +* | `~ | ESC |MOUSE1|MOUSE2| | [{ | ]} | ESC | GUI | +* `---------------------------' `---------------------------' +* ,-------------. ,-------------. +* | Ctrl | Alt | | Gui | Ctrl | +* ,------|------|------| |------+------+------. +* | | | Home | | PgUp | | | +* | BkSp | Del |------| |------|Return| Space| +* | | | End | | PgDn | | | +* `--------------------' `--------------------' +*/ + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[QWERTY] = KEYMAP( + KC_ESC, KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8, + KC_EQL, KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , + KC_TAB, KC_Q ,KC_W ,KC_E ,KC_R ,KC_T , + KC_FN1 ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , + KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B , + KC_GRV ,KC_ESC, KC_BTN1,KC_BTN2, + KC_LCTL,KC_LALT, + KC_HOME, + KC_BSPC,KC_DEL ,KC_FN0 , + KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_FN0 ,KC_FN1 ,KC_FN2, KC_NO, RESET, + KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS, + KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_BSLS, + KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT, + KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSFT, + KC_LBRC,KC_RBRC, KC_ESC, KC_RGUI, + KC_RGUI,KC_RCTL, + KC_PGUP, + KC_PGDN,KC_ENTER ,KC_SPC + ), +[SYMB] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_FN0, KC_2, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), +/* Keymap: Movement and function layer +* +* ,-------------------------------------------------------------------------------------------------------------------. +* | Caps | F1 | F2 | F3 | F4 | F5 | F6 | F8 | F9 | F10 | F12 | FN0 | FN1 | FN2 | Tada | bOOT | +* |--------+------+------+------+------+------+---------------------------+------+------+------+------+------+--------| +* | =+ | ! | @ | # | $ | % | | ^ | & | * | ( | ) |MS Fast | +* |--------+------+------+------+------+------| +------+------+------+------+------+--------| +* | Tab | | | Up | |PgUp | | MwU |MS_UL | MS_U |MS_UR | | Ms Norm| +* |--------+------+------+------+------+------| |------+------+------+------+------+--------| +* |MouseFN1| C^A | Left | Down |Right | C^E | | | MS_L |Mouse1| MS_R | |MS Slow | +* |--------+------+------+------+------+------| |------+------+------+------+------+--------| +* | | GuiZ | GUI X| GUI C| GUI_V|PgDown| | MWD | MDown|MS Dwn|MS_DR | ? | | +* `--------+------+------+------+------+------- `------+------+------+------+------+--------' +* | `~ | ESC | < | > | | { | } | ESC | | +* `---------------------------' `---------------------------' +* ,-------------. ,-------------. +* | Ctrl | Alt | | Gui | Ctrl | +* ,------|------|------| |------+------+------. +* | | | Home | | PgUp | | | +* | BkSp | Del |------| |------|Mouse1|Mouse2| +* | | | End | | PgDn |LClick|Rclick| +* `--------------------' `--------------------' +*/ + + +[MOUSE] = KEYMAP( + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_EXLM ,KC_AT, KC_HASH, KC_DLR ,KC_PERC , + KC_TRNS, KC_NO, KC_NO, KC_UP, KC_NO, KC_PGUP, + KC_FN1, LCTL(KC_A),KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_E), + KC_TRNS, LGUI(KC_Z),LGUI(KC_X),LGUI(KC_C),LGUI(KC_V),KC_PGDN, + KC_TRNS, KC_TRNS, KC_LABK, KC_RABK, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_FN0,RESET, + KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_ACL2, + KC_WH_U, M(A_MUL), KC_MS_U, M(A_MUR), KC_NO, KC_ACL1, + KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_ACL0, + KC_WH_D, M(A_MDL), KC_MS_D, M(A_MDR), KC_TRNS, KC_TRNS, + KC_LCBR, KC_RCBR, KC_ESC, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_BTN1, KC_BTN2 + ), + + +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_TOGGLE(MOUSE) , // FN1 - Momentary Layer 1 (Symbols) + [1] = ACTION_LAYER_TOGGLE(MOUSE) , // FN1 - Momentary Layer 1 (Symbols) + [2] = ACTION_LAYER_TAP_TOGGLE(SYMB) , // FN1 - Momentary Layer 1 (Symbols) + + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + + // from algernon's ErgoDox EZ layout, + case A_MUL: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MUR: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + case A_MDL: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MDR: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + + +} + +void matrix_scan_user(void) { + int8_t layer = biton32(layer_state); + + switch (layer) { + case 1: + all_led_off(); + break; + case 2: + if (!(host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK))) { + all_led_off(); + caps_lock_led_on(); + } + break; + case 0: + all_led_off(); + num_lock_led_on(); + break; + default: + break; + } + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kinesis/keymaps/programmer/readme.md b/keyboards/kinesis/keymaps/programmer/readme.md new file mode 100644 index 000000000..76356a687 --- /dev/null +++ b/keyboards/kinesis/keymaps/programmer/readme.md @@ -0,0 +1,2 @@ +# a programmer friendly keymap for the kinesis-advantage +# not really baked yet. diff --git a/keyboards/kinesis/kinesis.c b/keyboards/kinesis/kinesis.c new file mode 100644 index 000000000..1fee90e6f --- /dev/null +++ b/keyboards/kinesis/kinesis.c @@ -0,0 +1,106 @@ +#include "kinesis.h" + +// begin section origin https://github.com/alvicstep/tmk_keyboard + + +void all_led_off(void) +{ + PORTD = 0b11111111; +} + +void all_led_on(void) +{ + PORTD = 0b00000000; +} +void num_lock_led_on(void) +{ + PORTD = 0b11101111; +} + +void caps_lock_led_on(void) +{ + PORTD = 0b01111111; +} + +void scroll_lock_led_on(void) +{ + PORTD = 0b11011111; +} +void keypad_led_on(void) +{ + PORTD = 0b10111111; +} +void blink_all_leds(void) +{ + all_led_on(); + _delay_ms(500); + + all_led_off(); + _delay_ms(100); + + caps_lock_led_on(); + _delay_ms(100); + + num_lock_led_on(); + _delay_ms(100); + + scroll_lock_led_on(); + _delay_ms(100); + + keypad_led_on(); + _delay_ms(100); + + //back + + scroll_lock_led_on(); + _delay_ms(100); + + num_lock_led_on(); + _delay_ms(100); + + caps_lock_led_on(); + _delay_ms(100); + + all_led_off(); +} + +// End section origin https://github.com/alvicstep/tmk_keyboard + + void matrix_init_kb(void) { + blink_all_leds(); + matrix_init_user(); +} + + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + +//Copyright 2014 Warren Janssens + uint8_t leds = 0xF0; + if (usb_led & 1 << USB_LED_NUM_LOCK) + leds &= ~0x10; + if (usb_led & 1 << USB_LED_CAPS_LOCK) + leds &= ~0x80; + if (usb_led & 1 << USB_LED_SCROLL_LOCK) + leds &= ~0x20; + PORTD = (PORTD & 0x0F) | leds; + + led_set_user(usb_led); + +} + + diff --git a/keyboards/kinesis/kinesis.h b/keyboards/kinesis/kinesis.h new file mode 100644 index 000000000..c04fbda15 --- /dev/null +++ b/keyboards/kinesis/kinesis.h @@ -0,0 +1,67 @@ +#ifndef KINESIS_H +#define KINESIS_H + +#include "quantum.h" + + +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array + +#define KEYMAP( \ + k02,k22,k12,k01,k21,k11,k00,k20,k10, \ + k80,k70,k60,k50,k40,k30, \ + k81,k71,k61,k51,k41,k31, \ + k82,k72,k62,k52,k42,k32, \ + k83,k73,k63,k53,k43,k33, \ + k74,k64,k54,k34, \ + k36,k35, \ + k55, \ + k56,k46,k75, \ + k03,k23,k13,k04,k24,k14,k05,k85,k84, \ + k94,kA4,kB4,kD4,kE4,kF4, \ + k95,kA5,kB5,kD5,kE5,kF5, \ + k96,kA6,kB6,kD6,kE6,kF6, \ + k97,kA7,kB7,kD7,kE7,kF7, \ + k93,kB3,kD3,kE3, \ + k47,k66, \ + k67, \ + k87,k76,k86 \ +) { \ + { k00, k01, k02, k03, k04, k05, KC_NO, KC_NO }, \ + { k10, k11, k12, k13, k14, KC_NO, KC_NO, KC_NO }, \ + { k20, k21, k22, k23, k24, KC_NO, KC_NO, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, KC_NO }, \ + { k40, k41, k42, k43, KC_NO, KC_NO, k46, k47 }, \ + { k50, k51, k52, k53, k54, k55, k56, KC_NO }, \ + { k60, k61, k62, k63, k64, KC_NO, k66, k67 }, \ + { k70, k71, k72, k73, k74, k75, k76, KC_NO }, \ + { k80, k81, k82, k83, KC_NO ,KC_NO, k86, k87}, \ + { KC_NO, KC_NO ,KC_NO ,k93, k94, k95, k96, k97}, \ + { KC_NO, KC_NO ,KC_NO ,KC_NO, kA4, kA5, kA6, kA7}, \ + { KC_NO, KC_NO ,KC_NO ,kB3, kB4, kB5, kB6, kB7}, \ + { KC_NO, KC_NO ,KC_NO ,KC_NO, KC_NO, KC_NO, k84, k85}, \ + { KC_NO, KC_NO ,KC_NO ,kD3, kD4, kD5, kD6, kD7}, \ + { KC_NO, KC_NO ,KC_NO ,kE3, kE4, kE5, kE6, kE7}, \ + { KC_NO, KC_NO ,KC_NO ,KC_NO, kF4, kF5, kF6, kF7} \ +} + + +/* 4y0 A 4y1 B 4y2 4y3 D 4y4 E 4y5 F 4y6 G 4y7 H 5y0 I 5y1 J 5y2 K 5y3 L 5y4 M 5y5 N 5y6 O 5y7 P */ + +/* + 0 1 2 3 4 5 6 7 8 9 A B C D E F + A B C D E F G H I J K L M N O P + 4y0 4y1 4y2 4y3 4y4 4y5 4y6 4y7 5y0 5y1 5y2 5y3 5y4 5y5 5y6 5y7 + r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 +0 PB0 21 c0 f6 f8 f7 5 4 3 2 1 =+ +1 PB1 22 c1 f3 f5 f4 t r e w q TAB +2 PB2 23 c2 ESC f2 f1 g f d s a CL +3 PB3 24 c3 f9 f11 f10 b v c x z LS UP DN [{ ]} +4 PB4 25 c4 f12 SL PS RT LT §± `~ 6 7 8 9 0 -_ +5 PB5 26 c5 PB PGM KPD LA HM END y u i o p \ +6 PB6 27 c6 LC DEL BS RC ENT SP h j k l ;: '" +7 PB7 28 c7 RA PU PD n m ,< .> /? RS +*/ + + +#endif diff --git a/keyboards/kinesis/matrix.c b/keyboards/kinesis/matrix.c new file mode 100644 index 000000000..cb0d5ad7d --- /dev/null +++ b/keyboards/kinesis/matrix.c @@ -0,0 +1,228 @@ +/* +Copyright 2014 Warren Janssens + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "led.h" +#include "config.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static uint8_t matrix[MATRIX_ROWS]; +static uint8_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_row(uint8_t row); +static void unselect_rows(void); +static void select_rows(uint8_t row); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + //debug_enable = true; + + //dprint("matrix_init"); dprintln(); + // output high (leds) + DDRD = 0xFF; + PORTD = 0xFF; + + // output low (multiplexers) + DDRF = 0xFF; + PORTF = 0x00; + + // input with pullup (matrix) + DDRB = 0x00; + PORTB = 0xFF; + + // input with pullup (program and keypad buttons) + DDRC = 0x00; + PORTC = 0xFF; + + // initialize row and col + unselect_rows(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + +} + +uint8_t matrix_scan(void) +{ + + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_rows(i); + uint8_t row = read_row(i); + if (matrix_debouncing[i] != row) { + matrix_debouncing[i] = row; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + matrix_scan_quantum(); + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< /? RS + */ + + diff --git a/keyboards/kinesis/readme.md b/keyboards/kinesis/readme.md new file mode 100644 index 000000000..a990f9cb9 --- /dev/null +++ b/keyboards/kinesis/readme.md @@ -0,0 +1,42 @@ +kinesis-advantage keyboard firmware +====================== + +## Kinesis specific information +This is a port of https://github.com/alvicstep/tmk_keyboard, +which is a fork of https://github.com/wjanssens/tmk_keyboard, +which is based on work from https://github.com/chrisandreae/keyboard-firmware + +If you replace the kinesis CPU as described in the doc folder, then this code should allow you to use QMK. +I've tested with a Teensy 2++, remember to change the CPU if you use a 32u4 instead. + +Not yet implemented: +- Kinesis EEProm reading or writing +- Audio - this should be simple if we remove hardcoded pins from audio.h and switch to E7 + + + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/kinesis-advantage folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make`. + +### Other Keymaps + +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: + +``` +$ make keymap=[default|jack|] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` -- cgit v1.2.3-24-g4f1b From 3d7244e604f47dfbc2b45b17616350b6432c4a52 Mon Sep 17 00:00:00 2001 From: Jason Janse van Rensburg Date: Wed, 20 Jul 2016 16:42:09 +0200 Subject: updated bone2planck --- keyboards/planck/keymaps/bone2planck/keymap.c | 176 ++++++++++++++++---------- 1 file changed, 111 insertions(+), 65 deletions(-) diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c index f40b08685..765f0c770 100644 --- a/keyboards/planck/keymaps/bone2planck/keymap.c +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -3,89 +3,135 @@ #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif -#include "keymap_german.h" +#include "..\..\..\quantum\keymap_extras\keymap_german.h" +#include "..\..\..\quantum\keymap_common.h" +#include "..\..\..\tmk_core\common\keycode.h" +#define _______ = KC_TRNS; /* This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout. - It has Umlauts and "ß" as it is optimized for a mix of German & English. - My favourite features are the placement of the special characters often used for programming right on the home row - and the number & navigation block combo, so you never have to move your hands from their home position. - - Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone +It has "üäöß" as it is optimized for a mix of German & English. +My favourite features are the placement of the special characters often used for programming right on the home row +and the number & navigation block combo, so you never have to move your hands from their home position. + +Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Bone2 * ,-----------------------------------------------------------------------------------. - * | Q | J | D | U | A | X | P | H | L | M | W | ẞ | + * | Q | J | D | U | A | X | P | H | L | M | W | ẞ | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | M1 | C | T | I | E | O | B | N | R | S | G | M1 | + * |M1/Tab| C | T | I | E | O | B | N | R | S | G |M1/Ent| //hold for M1, tap for Tab/Enter * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| F | V | Ãœ | Ä | Ö | Y | Z | , | . | K |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Esc | Tab |Enter | + * | GUI | Ctrl | Alt | M4 | M2 | Space | M2 | M4 | | Ctrl | Esc | * `-----------------------------------------------------------------------------------' */ [0] = { - { DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS }, - { MO(1), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, MO(1) }, - { DE_S, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, DE_S }, - { KC_LCTL, KC_LGUI, KC_LALT, MO(3), MO(2), KC_SPC, KC_SPC, MO(2), MO(3), KC_ESC, KC_TAB, KC_ENT } - }, + { DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS }, + { LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) }, + { KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT }, + { KC_LGUI, KC_LCTL, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_NO, KC_RCTL, KC_ESC } +}, - /* M1 Special Characters - * ,-----------------------------------------------------------------------------------. - * | ° | @ | _ | [ | ] | ^ | ! | < | > | = | & | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | M1 | \ | / | { | } | * | ? | ( | ) | - | : | M1 | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | # | $ | | | ~ | € | + | % | " | ' | ; | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Esc | Tab |Enter | - * `-----------------------------------------------------------------------------------' - */ - [1] = { - { DE_RING, DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, KC_NO }, - { KC_TRNS, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, KC_TRNS }, - { KC_NO , DE_HASH, DE_DLR, DE_PIPE, DE_TILD, DE_EURO, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, KC_NO }, - { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS } - }, +/* M1 Special Characters +very ergonomic placement for coding +* ,-----------------------------------------------------------------------------------. +* | ° | @ | _ | [ | ] | ^ | ! | < | > | = | & | ´ | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* |M1/Tab| \ | / | { | } | * | ? | ( | ) | - | : |M1/Ent| //hold for M1, tap for Tab/Enter +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| # | $ | | | ~ | € | + | % | " | ' | ; |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | GUI | Ctrl | Alt | M4 | M2 | Space | M2 | M4 | | Ctrl | Esc | +* `-----------------------------------------------------------------------------------' +*/ +[1] = { + { DE_RING, DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, DE_ACUT }, + { _______, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, _______ }, + { _______, DE_HASH, DE_DLR, DE_PIPE, DE_TILD, DE_EURO, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } +}, - /* Navigation & Number Blocks - * ,-----------------------------------------------------------------------------------. - * | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | Home | Lft | Down | Right| End | . | 4 | 5 | 6 | , | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| | Tab | Ins | Enter| | 0 | 1 | 2 | 3 | ; |Shift | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Esc | Tab |Enter | - * `-----------------------------------------------------------------------------------' - */ - [2] = { - { KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_NO }, - { KC_NO, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_NO }, - { DE_S, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, KC_0, DE_1, DE_2, DE_3, DE_SCLN, DE_S }, - { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS } - }, +/* Navigation & Number Blocks +very easy to get used to & intuituve placement +* ,-----------------------------------------------------------------------------------. +* | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Tab | Home | Lft | Down | Right| End | . | 4 | 5 | 6 | , | Enter| +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| | Tab | Ins | Enter| | 0 | 1 | 2 | 3 | ; |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | GUI | Ctrl | Alt | M3 | M2 | Space | M2 | M3 | | Ctrl | Esc | +* `-----------------------------------------------------------------------------------' +*/ +[2] = { + { KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_NO }, + { KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_ENT }, + { _______, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, DE_0, DE_1, DE_2, DE_3, DE_SCLN, _______ }, + { _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ } +}, - /* Function & Media Keys - * ,-----------------------------------------------------------------------------------. - * | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | GUI | Alt | M3 | | Space | | M3 | Esc | Tab |Enter | - * `-----------------------------------------------------------------------------------' - */ - [3] = { - { KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO }, - { KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO }, - { KC_TRNS, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, KC_TRNS}, - { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} - } +/* Flipped Navigation & Number Blocks for one handed use +accessed by sliding from M2 to M3 with thumb +* ,-----------------------------------------------------------------------------------. +* | | | 7 | 8 | 9 | | PgUp | Bksp | Up | DEL | PgDn | | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | Tab | . | 4 | 5 | 6 | , | Home | Left | Down | Right| End | Enter| +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| 0 | 1 | 2 | 3 | ; | | Tab | Ins | Enter| |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | GUI | Ctrl | Alt | M3 | | Space | | M3 | | Ctrl | Esc | +* `-----------------------------------------------------------------------------------' +*/ + +[3] = { + { KC_NO, KC_NO, DE_7, DE_8 DE_9, KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO }, + { _______, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ }, + { _______, DE_0, DE_1, DE_2, DE_3, DE_SCLN, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, _______ }, + { _______, _______, _______, _______, KC_NO, _______, _______, KC_NO, _______, _______, _______, _______ } +}, + + +/* Function & Media Keys +slide from m4 to m5 to access flipped version +* ,-----------------------------------------------------------------------------------. +* | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | GUI | Ctrl | Alt | M4 | M5 | Space | M5 | M4 | | Ctrl | Esc | +* `-----------------------------------------------------------------------------------' +*/ +[4] = { + { KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO }, + { KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO }, + { _______, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ }, + { _______, _______, _______, _______, MO(5), _______, _______, MO(5), _______, _______, _______, _______ } +} + + +/* flipped Function & Media Keys +* ,-----------------------------------------------------------------------------------. +* | | | F7 | F8 | F9 | | | Print|Scroll| Pause| | | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* | | | F4 | F5 | F6 | ³ | | Mute | Vol- | Vol+ | | | +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| | F1 | F2 | F3 | ² | | Prev | Play | Next | |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | GUI | Ctrl | Alt | | M5 | Space | M5 | | | Ctrl | Esc | +* `-----------------------------------------------------------------------------------' +*/ +[5] = { + { KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO }, + { KC_NO, KC_NO, KC_F4, KC_F5, KC_F6, DE_SQ3, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO }, + { _______, KC_NO, KC_F1, KC_F2, KC_F3, DE_SQ2, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, _______ }, + { _______, _______, _______, KC_NO, _______, _______, _______, _______, KC_NO, _______, _______, _______ } +} }; const uint16_t PROGMEM fn_actions[] = { -- cgit v1.2.3-24-g4f1b From 32f5b34ad25e9c1a317109595a0db0e3e47f8f83 Mon Sep 17 00:00:00 2001 From: Jason Janse van Rensburg Date: Wed, 20 Jul 2016 16:58:10 +0200 Subject: reformat --- keyboards/planck/keymaps/bone2planck/keymap.c | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c index 765f0c770..2e20a9f6c 100644 --- a/keyboards/planck/keymaps/bone2planck/keymap.c +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -18,22 +18,22 @@ Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Bone2 - * ,-----------------------------------------------------------------------------------. - * | Q | J | D | U | A | X | P | H | L | M | W | ẞ | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * |M1/Tab| C | T | I | E | O | B | N | R | S | G |M1/Ent| //hold for M1, tap for Tab/Enter - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| F | V | Ãœ | Ä | Ö | Y | Z | , | . | K |Shift | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | GUI | Ctrl | Alt | M4 | M2 | Space | M2 | M4 | | Ctrl | Esc | - * `-----------------------------------------------------------------------------------' - */ - [0] = { - { DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS }, - { LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) }, - { KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT }, - { KC_LGUI, KC_LCTL, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_NO, KC_RCTL, KC_ESC } +/* Bone2 +* ,-----------------------------------------------------------------------------------. +* | Q | J | D | U | A | X | P | H | L | M | W | ẞ | +* |------+------+------+------+------+-------------+------+------+------+------+------| +* |M1/Tab| C | T | I | E | O | B | N | R | S | G |M1/Ent| //hold for M1, tap for Tab/Enter +* |------+------+------+------+------+------|------+------+------+------+------+------| +* | Shift| F | V | Ãœ | Ä | Ö | Y | Z | , | . | K |Shift | +* |------+------+------+------+------+------+------+------+------+------+------+------| +* | GUI | Ctrl | Alt | M4 | M2 | Space | M2 | M4 | | Ctrl | Esc | +* `-----------------------------------------------------------------------------------' +*/ +[0] = { + { DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS }, + { LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) }, + { KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT }, + { KC_LGUI, KC_LCTL, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_NO, KC_RCTL, KC_ESC } }, /* M1 Special Characters -- cgit v1.2.3-24-g4f1b From b0e9dbecee209a40ff1fc93ce4415d96cb0cdaba Mon Sep 17 00:00:00 2001 From: Jason Janse van Rensburg Date: Wed, 20 Jul 2016 17:05:23 +0200 Subject: fixed include paths --- keyboards/planck/keymaps/bone2planck/keymap.c | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c index 2e20a9f6c..ceb556425 100644 --- a/keyboards/planck/keymaps/bone2planck/keymap.c +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -3,9 +3,9 @@ #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif -#include "..\..\..\quantum\keymap_extras\keymap_german.h" -#include "..\..\..\quantum\keymap_common.h" -#include "..\..\..\tmk_core\common\keycode.h" +#include "..\..\..\..\quantum\keymap_extras\keymap_german.h" +#include "..\..\..\..\quantum\keymap_common.h" +#include "..\..\..\..\tmk_core\common\keycode.h" #define _______ = KC_TRNS; /* This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout. @@ -30,10 +30,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [0] = { - { DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS }, + { DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS }, { LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) }, - { KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT }, - { KC_LGUI, KC_LCTL, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_NO, KC_RCTL, KC_ESC } + { KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT }, + { KC_LGUI, KC_LCTL, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_NO, KC_RCTL, KC_ESC } }, /* M1 Special Characters @@ -68,8 +68,8 @@ very easy to get used to & intuituve placement * `-----------------------------------------------------------------------------------' */ [2] = { - { KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_NO }, - { KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_ENT }, + { KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_NO }, + { KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_ENT }, { _______, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, DE_0, DE_1, DE_2, DE_3, DE_SCLN, _______ }, { _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ } }, @@ -88,7 +88,7 @@ accessed by sliding from M2 to M3 with thumb */ [3] = { - { KC_NO, KC_NO, DE_7, DE_8 DE_9, KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO }, + { KC_NO, KC_NO, DE_7, DE_8 DE_9, KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO }, { _______, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ }, { _______, DE_0, DE_1, DE_2, DE_3, DE_SCLN, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, _______ }, { _______, _______, _______, _______, KC_NO, _______, _______, KC_NO, _______, _______, _______, _______ } @@ -108,8 +108,8 @@ slide from m4 to m5 to access flipped version * `-----------------------------------------------------------------------------------' */ [4] = { - { KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO }, - { KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO }, + { KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO }, + { KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO }, { _______, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ }, { _______, _______, _______, _______, MO(5), _______, _______, MO(5), _______, _______, _______, _______ } } @@ -119,17 +119,17 @@ slide from m4 to m5 to access flipped version * ,-----------------------------------------------------------------------------------. * | | | F7 | F8 | F9 | | | Print|Scroll| Pause| | | * |------+------+------+------+------+-------------+------+------+------+------+------| -* | | | F4 | F5 | F6 | ³ | | Mute | Vol- | Vol+ | | | +* | | ³ | F4 | F5 | F6 | | | Mute | Vol- | Vol+ | | | * |------+------+------+------+------+------|------+------+------+------+------+------| -* | Shift| | F1 | F2 | F3 | ² | | Prev | Play | Next | |Shift | +* | Shift| ² | F1 | F2 | F3 | | | Prev | Play | Next | |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| * | GUI | Ctrl | Alt | | M5 | Space | M5 | | | Ctrl | Esc | * `-----------------------------------------------------------------------------------' */ [5] = { - { KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO }, - { KC_NO, KC_NO, KC_F4, KC_F5, KC_F6, DE_SQ3, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO }, - { _______, KC_NO, KC_F1, KC_F2, KC_F3, DE_SQ2, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, _______ }, + { KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO }, + { KC_NO, KC_SQ3, KC_F4, KC_F5, KC_F6, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO }, + { _______, KC_SQ2, KC_F1, KC_F2, KC_F3, KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, _______ }, { _______, _______, _______, KC_NO, _______, _______, _______, _______, KC_NO, _______, _______, _______ } } }; -- cgit v1.2.3-24-g4f1b From 24e4e6dd18924295a0ce0cab653be2e63008f0af Mon Sep 17 00:00:00 2001 From: milestogo Date: Wed, 20 Jul 2016 21:12:00 -0700 Subject: adding traveller keyboard --- keyboards/handwired/traveller/Makefile | 89 ++++++ keyboards/handwired/traveller/config.h | 173 ++++++++++++ .../handwired/traveller/keymaps/default/keymap.c | 305 +++++++++++++++++++++ .../handwired/traveller/keymaps/default/readme.md | 2 + keyboards/handwired/traveller/readme.md | 35 +++ keyboards/handwired/traveller/traveller.c | 61 +++++ keyboards/handwired/traveller/traveller.h | 32 +++ 7 files changed, 697 insertions(+) create mode 100644 keyboards/handwired/traveller/Makefile create mode 100644 keyboards/handwired/traveller/config.h create mode 100644 keyboards/handwired/traveller/keymaps/default/keymap.c create mode 100644 keyboards/handwired/traveller/keymaps/default/readme.md create mode 100644 keyboards/handwired/traveller/readme.md create mode 100644 keyboards/handwired/traveller/traveller.c create mode 100644 keyboards/handwired/traveller/traveller.h diff --git a/keyboards/handwired/traveller/Makefile b/keyboards/handwired/traveller/Makefile new file mode 100644 index 000000000..12a4b71f4 --- /dev/null +++ b/keyboards/handwired/traveller/Makefile @@ -0,0 +1,89 @@ + +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# for avr upload +USB ?= /dev/cu.usbmodem1421 +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + + +ifdef TEENSY2 + OPT_DEFS += -DATREUS_TEENSY2 + ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex +else + OPT_DEFS += -DATREUS_ASTAR + OPT_DEFS += -DCATERINA_BOOTLOADER + ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) +endif +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# MCU name + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +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 ?= no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 +RGBLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../Makefile +endif + +upload: build + $(ATREUS_UPLOAD_COMMAND) + diff --git a/keyboards/handwired/traveller/config.h b/keyboards/handwired/traveller/config.h new file mode 100644 index 000000000..2b82da447 --- /dev/null +++ b/keyboards/handwired/traveller/config.h @@ -0,0 +1,173 @@ +/* +Copyright 2012 Jun Wako + +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 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT traveller +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D3, D2 } + // no I can't say why this order seemed like a good idea +#define MATRIX_COL_PINS { B5, D6, B7, B6, F6, B1, B3, F7, B4, E6, D7, C6, D4 } +#define UNUSED_PINS + +// LED stuff +#define RGB_DI_PIN B2 +//#define RBLIGHT_TIMER +#define RGBLED_NUM 1 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/handwired/traveller/keymaps/default/keymap.c b/keyboards/handwired/traveller/keymaps/default/keymap.c new file mode 100644 index 000000000..13d889ab8 --- /dev/null +++ b/keyboards/handwired/traveller/keymaps/default/keymap.c @@ -0,0 +1,305 @@ +#include "traveller.h" +#include "mousekey.h" +#include "action_layer.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +#define _QW 0 +#define _LW 1 +#define _HI 2 +#define _NAV 4 +#define _CUR 5 +#define _FKEYS 6 +#define _TRNS 8 + +// We do the same trick for functions +#define RGBLED_TOGGLE 10 +#define _HIOUT 15 +#define _LWOUT 16 +// Macros +#define MDL 4 +#define MDR 5 +#define MUR 6 +#define MUL 3 + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | NAV | ` ~ | W | E | R | T | | Y | U | I | O | - | = | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | S | D | F | G | | H | J | K | L | P | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + *|ctrl/esc| A | X | C | V | B |Ctrl /| N | M | , | . | ; | ' | + * |------+------+------+------+------+------+ // +------+------+------+------+------+------| + * | Shift| Z | Del | GUI | Low | Bspc |/Enter| Spc | Hi | GUI | Alt | / |Shift | + * `------------------------------------------------------------------------------------------' + * + */ +[_QW] = KEYMAP( + F(_NAV), KC_GRV, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_MINS, KC_EQL, + KC_TAB, KC_Q, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_P, KC_BSLS, + CTL_T(KC_ESC), KC_A, KC_X, KC_C, KC_V, KC_B, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_DEL, KC_LGUI, MO(_LW), KC_BSPC, KC_ENTER, KC_SPC, MO(_HI), KC_RGUI, KC_RALT, KC_SLSH, KC_RSFT + ), + +/* LOW - numbers, missing or awkward programming keys + Doubled 1 key allows lazy reach with ring finger. + * ,-----------------------------------------. .-----------------------------------------. + * | FKeys| 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |Ctrl-alt-del| + * |------+------+------+------+------+------| +------+------+------+------+------+------| + * | Tab | 1 | ] | ( | ) | | | * | ( | ) | [ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | Caps | [ | | { | } | ` | /| # | { | } | | ] | | + * |------+------+------+------+------+------+ // +------+------+------+------+------+------| + * | Shift| | | | Low | |/ | | Hi | | | |Shift | + * `------------------------------------------------------------------------------------------' + * + */ + +[_LW] = KEYMAP( + F(_FKEYS), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LCTL(LALT(KC_DEL)) , + KC_TRNS, KC_1, KC_RBRC, KC_LPRN, KC_RPRN, KC_NO, KC_ASTR, KC_LPRN, KC_RPRN, KC_LBRC, KC_NO, KC_NO, + KC_CAPS, KC_LBRC, KC_NO, KC_LCBR, KC_RCBR, KC_TILD, KC_TRNS, KC_HASH, KC_LCBR, KC_RCBR, KC_NO, KC_RBRC, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + +/* HI - Punctuation, shell and +url ://@.com row on bottom, && is opposite || ^$ are in regex order: ^.*$ +Right hand nav keys work pretty well chorded with the Right hand Hi Key + * ,-----------------------------------------. .-----------------------------------------. + * |FKEYS | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | ! | & | "|" | $ | % | | Vol+| Mute| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | CAPS | ^ | : | . | * | - | /| Vol-| Play | PgUp | Home | Up | End | + * |------+------+------+------+------+------+ // +------+------+------+------+------+------| + * | | / | | | Low | |/ | | Hi | PgDn | Left| Down | Right | + * `------------------------------------------------------------------------------------------' + * + */ + +[_HI] = KEYMAP( + F(_FKEYS), KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, + KC_TRNS, KC_EXLM, KC_AMPR, KC_PIPE, KC_DLR, KC_PERC, KC_VOLU, KC_MUTE, KC_NO, KC_NO, KC_NO, KC_NO, + KC_CAPS, KC_CIRC, KC_COLN, KC_DOT, KC_ASTR, KC_MINS, KC_TRNS, KC_VOLD, KC_PPLS, KC_PGUP, KC_HOME, KC_UP, KC_END, + KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS, F(_LW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT +), + +/* NAV - mouse & navigation +//gui left and right are line home/end, or fore & back in browser +// Mouse buttons are reversed for comfort - bigger stretch is to the right button. + + * ,-----------------------------------------. .-----------------------------------------. +* | NAV | | | Up | |Gui-> | | MwU | MS_UL| MS_U |MS_UR | |Ms Norm| +* |------+------+------+------+------+------| |------+------+------+------+------+--------| +* | |Gui<- | Left | Down |Right | C^E | | BTN3 | MS_L |MS Up | MS_R | |Ms Fast | +* |------+------+------+------+------+------|------|------+------+------+------+------+--------| +* | | C^A | GUI X| GUI C| GUI_V| |Enter/| MWD | M_DL |MS Dwn|MS_DR | Up |Ms Slow | +* |------+------+------+------+------+------+ // +------+------+------+------+------+------| +* | | GuiZ | | | Low | |/ButnR|ButnL | Hi | | Left | Down | Right | +* `------------------------------------------------------------------------------------------' +*/ + +[_NAV] = KEYMAP( + F(_NAV), KC_NO, KC_NO, KC_UP, KC_NO, RGUI(KC_RIGHT), KC_WH_U, M(MUL), KC_MS_U, M(MUR), KC_NO, KC_ACL2, + KC_TRNS, RGUI(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_E), KC_BTN3, KC_MS_L, KC_MS_U, KC_MS_R, KC_NO, KC_ACL1, + KC_TRNS, LCTL(KC_A), LGUI(KC_X),RGUI(KC_C), RGUI(KC_V),KC_NO, KC_ENTER, KC_WH_D, M(MDL), KC_MS_D, M(MDR), KC_UP, KC_ACL0, + KC_TRNS, RGUI(KC_Z), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT +), + +/* FKEYS - Funtion keys & mac stuff + * ,-----------------------------------------. .-----------------------------------------. + * | FKEYS| F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | F11 | F12 | F13 | F14 | F15 | Alt | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * |Qwerty| | | | | | /| | | | | | Del | + * |------+------+------+------+------+------+ // +------+------+------+------+------+------| + * | . |RGBTog| . | | LO | Bspc |/ | | HI | | | | | + * `------------------------------------------------------------------------------------------' + * + */ + +[_FKEYS] = KEYMAP( + F(_FKEYS), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RCTL, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LALT , + F(_QW), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, + KC_TRNS, F(RGBLED_TOGGLE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), + + +/* TRNS - skeleton for laters + * ,-----------------------------------------. .-----------------------------------------. + * | . | . | . | . | . | . | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | . | . | . | . | . | . | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | . | . | . | . | . | . | /| | | | . | ; | " | + * |------+------+------+------+------+------+ // +------+------+------+------+------+------| + * | . | . | . | GUI | LO | . |/ | Spc | HI | GUI | M0 | / |LSFT | + * `------------------------------------------------------------------------------------------' + * + */ + +[_TRNS] = { + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} + } + + +}; + + +const uint16_t PROGMEM fn_actions[] = { + [_QW] = ACTION_LAYER_ON(_QW,ON_RELEASE), // return to QWERTY layer + [_LW] = ACTION_LAYER_TAP_TOGGLE(_LW), // Turn on LW when holding, or tap 3 times to switch + [_HI] = ACTION_LAYER_TAP_TOGGLE(_HI), // Turn on LW when holding, or tap 3 times to switch + [_NAV] = ACTION_LAYER_TOGGLE(_NAV), + [_FKEYS] = ACTION_LAYER_TOGGLE(_FKEYS), + [_LWOUT] = ACTION_LAYER_OFF(_LW,ON_RELEASE), + [_HIOUT] = ACTION_LAYER_OFF(_HI,ON_RELEASE), + + // Functions + [RGBLED_TOGGLE] = ACTION_FUNCTION(RGBLED_TOGGLE), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + + // from algernon's ErgoDox EZ layout, + case MUL: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case MUR: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + case MDL: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case MDR: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + + } + return MACRO_NONE; +}; + + + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch (id) { + case RGBLED_TOGGLE: + //led operations + if (record->event.pressed) { + rgblight_toggle(); + } + break; + } +} + + + +void LayerLEDSet(uint8_t layr) { + + switch (layr) { + case _QW: + rgblight_setrgb(0,20, 0); // dim green + break; + case _LW: + // deep purple + rgblight_setrgb(20,0,35); + break; + case _HI: + // light blue + rgblight_setrgb(0,20,20); + break; + case _NAV: + // Yellowy orange + rgblight_setrgb(25,20,0); // brighter + break; + case _FKEYS: + // RED + rgblight_setrgb(20,0,0); // brighter + break; + default: + rgblight_setrgb(20,2,20);//error + break; + } + + return; + +} + +void matrix_init_user(void) { +} + +// Bleah globals need to be initialized. +uint8_t old_layer=_QW; + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + if (old_layer != layer) { + LayerLEDSet(layer); + old_layer=layer; + } +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} + + diff --git a/keyboards/handwired/traveller/keymaps/default/readme.md b/keyboards/handwired/traveller/keymaps/default/readme.md new file mode 100644 index 000000000..7ddc40b3c --- /dev/null +++ b/keyboards/handwired/traveller/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The default keymap for handwired/traveller +this is a kitchen sink build diff --git a/keyboards/handwired/traveller/readme.md b/keyboards/handwired/traveller/readme.md new file mode 100644 index 000000000..646844b1d --- /dev/null +++ b/keyboards/handwired/traveller/readme.md @@ -0,0 +1,35 @@ +traveler keyboard firmware +====================== + +## Traveller Specific Info ## +The traveller is a varient on the atreus keyboard. +Like the Atreus, it is designed to be a good compromise between size and ergonomics. + +key differences are +- an additional column for each pinky +- an RGB LED in the center to show the current layer +- more finger stagger, splay angle and contoured keycaps (F2 profile for space key). + +You can make your own traveller keyboard by using the openscad tools from the atreus repository, and adding a hole for the LED to shine through. + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent README.md](/README.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboard/traveler folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` and see keymap document (you can find in top README.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/handwired/traveller/traveller.c b/keyboards/handwired/traveller/traveller.c new file mode 100644 index 000000000..9d2534130 --- /dev/null +++ b/keyboards/handwired/traveller/traveller.c @@ -0,0 +1,61 @@ +#include "traveller.h" + +__attribute__ ((weak)) +void matrix_init_user(void) { + // leave this function blank - it can be defined in a keymap file +}; + +__attribute__ ((weak)) +void matrix_scan_user(void) { + // leave this function blank - it can be defined in a keymap file +} + +__attribute__ ((weak)) +void process_action_user(keyrecord_t *record) { + // leave this function blank - it can be defined in a keymap file +} + +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + // leave this function blank - it can be defined in a keymap file +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + +#ifdef RGBLIGHT_ENABLE + rgblight_init(); + rgblight_mode(1); // solid, no timer + rgblight_setrgb(0,20,0);// dim green, happens to be same as _QW +#endif + +// Turn status LED on + DDRC |= (1<<7); + PORTC |= (1<<7); + + matrix_init_user(); +} + + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + + diff --git a/keyboards/handwired/traveller/traveller.h b/keyboards/handwired/traveller/traveller.h new file mode 100644 index 000000000..972a1a94a --- /dev/null +++ b/keyboards/handwired/traveller/traveller.h @@ -0,0 +1,32 @@ +#ifndef TRAVELLER_H +#define TRAVELLER_H + +#include "quantum.h" +#include "led.h" + +#ifdef RGBLIGHT_ENABLE + #include "rgblight.h" +#endif +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif + + + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k07, k08, k09, k0a, k0b, k0c, \ + k10, k11, k12, k13, k14, k15, k17, k18, k19, k1a, k1b, k1c, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, KC_NO, k07, k08, k09, k0a, k0b, k0c }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, k17, k18, k19, k1a, k1b, k1c }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c } \ +} + +#endif -- cgit v1.2.3-24-g4f1b From c1f014b1dd24ba7e121ae3ca999d832b07ce50cf Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 22 Jul 2016 08:13:06 +0200 Subject: purely cosmetic changes --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 84 +++++++++++------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index fc07f6da8..17d4b3345 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -14,7 +14,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer - * ,-----------------------------------------------------------.------------------------------------- + * ,-----------------------------------------------------------. * |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | * |-----------------------------------------------------------| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1 !! @@ -26,14 +26,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is * `-----------------------------------------------------------' LEFT DWN RIGHT */ -[_DEF] = KEYMAP_ISO_SPLITRSHIFT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - F(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, F(17), \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX),F(4), \ - KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, F(5), F(6), F(7)) , + [_DEF] = KEYMAP_ISO_SPLITRSHIFT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + F(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, F(17), \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX),F(4), \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, F(5), F(6), F(7)) , + /* Keymap 1: F-and-vim Layer, modified with Space (Fn0) - * ,-----------------------------------------------------------.----------------------------------------- + * ,-----------------------------------------------------------. * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete| * |-----------------------------------------------------------| * | |Paus| Up| | | | | | | | | | | | @@ -45,15 +46,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | |Alt |Prev|Vol-|Next| * `-----------------------------------------------------------' */ -[_SPC] = KEYMAP_ISO_SPLITRSHIFT( - KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_TRNS, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE,M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT) , - + [_SPC] = KEYMAP_ISO_SPLITRSHIFT( + KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE,M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), + /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (Fn1) - * ,-----------------------------------------------------------.----------------------------------------- + * ,-----------------------------------------------------------. * |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE * |-----------------------------------------------------------| * | | | | | | | | | | | | | | | @@ -65,15 +66,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | |Alt |Pos1|PgDn|End | * `-----------------------------------------------------------' */ -[_TAB] = KEYMAP_ISO_SPLITRSHIFT( - KC_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END) , - + [_TAB] = KEYMAP_ISO_SPLITRSHIFT( + KC_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + /* Keymap 3: Split right shift Numpad toggle Layer (Fn2) - * ,-----------------------------------------------------------.----------------------------------------- + * ,-----------------------------------------------------------. * |RSET| | | | | | | 7| 8| 9| | | |Backsp | * |-----------------------------------------------------------| * | | | | | | | | 4 | 5 | 6 | | | | \ | @@ -85,13 +86,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | |Alt |Left|Down|Right| * `-----------------------------------------------------------' */ -[_SFX] = KEYMAP_ISO_SPLITRSHIFT( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, \ - KC_TRNS, F(9), F(10), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ - KC_TRNS, F(11), F(12), F(13), F(14), F(15), F(16), KC_TRNS, KC_TRNS, KC_0, KC_TRNS, KC_SLSH, KC_TRNS, KC_UP, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT) , - + [_SFX] = KEYMAP_ISO_SPLITRSHIFT( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, \ + KC_TRNS, F(9), F(10), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ + KC_TRNS, F(11), F(12), F(13), F(14), F(15), F(16), KC_TRNS, KC_TRNS, KC_0, KC_TRNS, KC_SLSH, KC_TRNS, KC_UP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT), }; enum function_id { @@ -129,19 +129,19 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { + // MACRODOWN only works in this function + switch(id) { case 0: - return (record->event.pressed ? - MACRO( D(RALT), T(SPC), U(RALT), END ) - :MACRO( END )); - break; + return (record->event.pressed ? + MACRO( D(RALT), T(SPC), U(RALT), END ) + :MACRO( END )); + break; case 1: - return (record->event.pressed ? - MACRO( D(LALT), T(F2), U(LALT), END ) - :MACRO( END )); - break; - } + return (record->event.pressed ? + MACRO( D(LALT), T(F2), U(LALT), END ) + :MACRO( END )); + break; + } return MACRO_NONE; }; -- cgit v1.2.3-24-g4f1b From 197244e47f619b0853e4fdb54bb821a32b584764 Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 22 Jul 2016 08:14:08 +0200 Subject: more cosmetic changes (whitespace) --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index 17d4b3345..c7aad3fc0 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -116,7 +116,7 @@ const uint16_t PROGMEM fn_actions[] = { [6] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_DOWN), [7] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_RIGHT), [8] = ACTION_FUNCTION(LAUNCH), - [9] = ACTION_FUNCTION(RGBLED_TOGGLE), + purely cosmetic changes [9] = ACTION_FUNCTION(RGBLED_TOGGLE), [10] = ACTION_FUNCTION(RGBLED_STEP_MODE), [11] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), [12] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), -- cgit v1.2.3-24-g4f1b From 70e42489dec375e558d8e81ed5ebfb69b4f3dbd9 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 20 Jul 2016 10:22:52 +0200 Subject: tap-dance: Support for holding keys With this change, tap dance will now store the pressed state of the tap-dance key, and allow one to make an action sooner, while the key is still held, and only unregister when the key is released. The registration must happen in the `on_dance_finished` callback, while unregistering goes to `on_reset`. The surrounding code makes sure not to call either multiple times. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_tap_dance.c | 11 ++++++++++- quantum/process_keycode/process_tap_dance.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index b9b836df2..097440405 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -73,10 +73,14 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); + } else if (qk_tap_dance_state.active && qk_tap_dance_state.pressed) { + reset_tap_dance (&qk_tap_dance_state); } else { r = false; } + qk_tap_dance_state.active = true; + qk_tap_dance_state.pressed = record->event.pressed; if (record->event.pressed) { qk_tap_dance_state.keycode = keycode; qk_tap_dance_state.timer = timer_read (); @@ -90,6 +94,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); reset_tap_dance (&qk_tap_dance_state); + qk_tap_dance_state.active = false; } break; } @@ -98,7 +103,7 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { } void matrix_scan_tap_dance () { - if (qk_tap_dance_state.keycode && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { + if (qk_tap_dance_state.active && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { // if we are here, the tap dance was timed out process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); reset_tap_dance (&qk_tap_dance_state); @@ -109,6 +114,9 @@ void reset_tap_dance (qk_tap_dance_state_t *state) { uint16_t idx = state->keycode - QK_TAP_DANCE; qk_tap_dance_action_t action; + if (state->pressed) + return; + action = tap_dance_actions[idx]; switch (action.type) { case QK_TAP_DANCE_TYPE_FN: @@ -123,4 +131,5 @@ void reset_tap_dance (qk_tap_dance_state_t *state) { state->keycode = 0; state->count = 0; + state->active = false; } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index 7b820584a..d457db9b3 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -11,6 +11,8 @@ typedef struct uint8_t count; uint16_t keycode; uint16_t timer; + bool active:1; + bool pressed:1; } qk_tap_dance_state_t; #define TD(n) (QK_TAP_DANCE + n) -- cgit v1.2.3-24-g4f1b From ce8cc9219fca5dde077f1142d03d011b38d27479 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 20 Jul 2016 11:34:45 +0200 Subject: tap-dance: Support user_data for the callbacks Refactored the code a little, so all callbacks now receive a `user_data` pointer, which can be anything. As an example, the key pairs from `ACTION_TAP_DANCE_DOUBLE` now use this, and custom, built-in functions. This makes it easier to extend the tap dance functionality, and also simplifies the code a little. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_tap_dance.c | 61 ++++++++++------------------- quantum/process_keycode/process_tap_dance.h | 41 +++++++++---------- 2 files changed, 38 insertions(+), 64 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 097440405..94b6af130 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -2,28 +2,32 @@ static qk_tap_dance_state_t qk_tap_dance_state; -static void _process_tap_dance_action_pair (qk_tap_dance_state_t *state, - uint16_t kc1, uint16_t kc2) { - uint16_t kc; +void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; - if (state->count == 0) - return; - - kc = (state->count == 1) ? kc1 : kc2; + if (state->count == 1) { + register_code (pair->kc1); + } else if (state->count == 2) { + register_code (pair->kc2); + } +} - register_code (kc); - unregister_code (kc); +void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; - if (state->count >= 2) { - reset_tap_dance (state); + if (state->count == 1) { + unregister_code (pair->kc1); + } else if (state->count == 2) { + unregister_code (pair->kc2); } } static void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, + void *user_data, qk_tap_dance_user_fn_t fn) { if (fn) { - fn(state); + fn(state, user_data); } } @@ -34,14 +38,7 @@ void process_tap_dance_action_on_each_tap (uint16_t keycode) action = tap_dance_actions[idx]; - switch (action.type) { - case QK_TAP_DANCE_TYPE_FN: - _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.on_each_tap); - break; - - default: - break; - } + _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_each_tap); } void process_tap_dance_action_on_dance_finished (uint16_t keycode) @@ -51,18 +48,7 @@ void process_tap_dance_action_on_dance_finished (uint16_t keycode) action = tap_dance_actions[idx]; - switch (action.type) { - case QK_TAP_DANCE_TYPE_PAIR: - _process_tap_dance_action_pair (&qk_tap_dance_state, - action.pair.kc1, action.pair.kc2); - break; - case QK_TAP_DANCE_TYPE_FN: - _process_tap_dance_action_fn (&qk_tap_dance_state, action.fn.on_dance_finished); - break; - - default: - break; - } + _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_dance_finished); } bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { @@ -118,15 +104,8 @@ void reset_tap_dance (qk_tap_dance_state_t *state) { return; action = tap_dance_actions[idx]; - switch (action.type) { - case QK_TAP_DANCE_TYPE_FN: - if (action.fn.on_reset) { - action.fn.on_reset(state); - } - break; - - default: - break; + if (action.fn.on_reset) { + action.fn.on_reset(state, action.user_data); } state->keycode = 0; diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index d457db9b3..e2c74efe9 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -17,42 +17,34 @@ typedef struct #define TD(n) (QK_TAP_DANCE + n) -typedef enum -{ - QK_TAP_DANCE_TYPE_PAIR, - QK_TAP_DANCE_TYPE_FN, -} qk_tap_dance_type_t; - -typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state); +typedef void (*qk_tap_dance_user_fn_t) (qk_tap_dance_state_t *state, void *user_data); typedef struct { - qk_tap_dance_type_t type; - union { - struct { - uint16_t kc1; - uint16_t kc2; - } pair; - struct { - qk_tap_dance_user_fn_t on_each_tap; - qk_tap_dance_user_fn_t on_dance_finished; - qk_tap_dance_user_fn_t on_reset; - } fn; - }; + struct { + qk_tap_dance_user_fn_t on_each_tap; + qk_tap_dance_user_fn_t on_dance_finished; + qk_tap_dance_user_fn_t on_reset; + } fn; + void *user_data; } qk_tap_dance_action_t; +typedef struct +{ + uint16_t kc1; + uint16_t kc2; +} qk_tap_dance_pair_t; + #define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \ - .type = QK_TAP_DANCE_TYPE_PAIR, \ - .pair = { kc1, kc2 } \ + .fn = { NULL, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset }, \ + .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }) \ } #define ACTION_TAP_DANCE_FN(user_fn) { \ - .type = QK_TAP_DANCE_TYPE_FN, \ .fn = { NULL, user_fn, NULL } \ } #define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset) { \ - .type = QK_TAP_DANCE_TYPE_FN, \ .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \ } @@ -64,6 +56,9 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record); void matrix_scan_tap_dance (void); void reset_tap_dance (qk_tap_dance_state_t *state); +void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data); +void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data); + #else #define TD(n) KC_NO -- cgit v1.2.3-24-g4f1b From 44e16ffc80620b61eaa17aedcfdd8233d9c99bd9 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 20 Jul 2016 11:49:59 +0200 Subject: tap-dance: Code cleanup Removes a number of duplicated code, by passing actions around instead of keycodes, so the various dance action functions do not have to look up the action, but the caller does that for them. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_tap_dance.c | 45 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 94b6af130..d240dc2e6 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -22,7 +22,7 @@ void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data) { } } -static void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, +static inline void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, void *user_data, qk_tap_dance_user_fn_t fn) { @@ -31,34 +31,33 @@ static void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, } } -void process_tap_dance_action_on_each_tap (uint16_t keycode) +static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t action) { - uint16_t idx = keycode - QK_TAP_DANCE; - qk_tap_dance_action_t action; - - action = tap_dance_actions[idx]; - _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_each_tap); } -void process_tap_dance_action_on_dance_finished (uint16_t keycode) +static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_action_t action) { - uint16_t idx = keycode - QK_TAP_DANCE; - qk_tap_dance_action_t action; - - action = tap_dance_actions[idx]; - _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_dance_finished); } +static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t action) +{ + _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_reset); +} + bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { bool r = true; + uint16_t idx = keycode - QK_TAP_DANCE; + qk_tap_dance_action_t action; switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: - process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); + action = tap_dance_actions[idx]; + + process_tap_dance_action_on_each_tap (action); if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { - process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); + process_tap_dance_action_on_dance_finished (action); } else if (qk_tap_dance_state.active && qk_tap_dance_state.pressed) { reset_tap_dance (&qk_tap_dance_state); } else { @@ -77,8 +76,11 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { default: if (qk_tap_dance_state.keycode) { // if we are here, the tap dance was interrupted by a different key - process_tap_dance_action_on_each_tap (qk_tap_dance_state.keycode); - process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); + idx = qk_tap_dance_state.keycode - QK_TAP_DANCE; + action = tap_dance_actions[idx]; + + process_tap_dance_action_on_each_tap (action); + process_tap_dance_action_on_dance_finished (action); reset_tap_dance (&qk_tap_dance_state); qk_tap_dance_state.active = false; } @@ -91,7 +93,10 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { void matrix_scan_tap_dance () { if (qk_tap_dance_state.active && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { // if we are here, the tap dance was timed out - process_tap_dance_action_on_dance_finished (qk_tap_dance_state.keycode); + uint16_t idx = qk_tap_dance_state.keycode - QK_TAP_DANCE; + qk_tap_dance_action_t action = tap_dance_actions[idx]; + + process_tap_dance_action_on_dance_finished (action); reset_tap_dance (&qk_tap_dance_state); } } @@ -104,9 +109,7 @@ void reset_tap_dance (qk_tap_dance_state_t *state) { return; action = tap_dance_actions[idx]; - if (action.fn.on_reset) { - action.fn.on_reset(state, action.user_data); - } + process_tap_dance_action_on_reset (action); state->keycode = 0; state->count = 0; -- cgit v1.2.3-24-g4f1b From fca34e2ad602b943a50c279d3b6e3a30c24dbc25 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 20 Jul 2016 11:54:25 +0200 Subject: readme.md: algernon is strictly lowercase Signed-off-by: Gergely Nagy --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index ed3da43bd..734741230 100644 --- a/readme.md +++ b/readme.md @@ -373,7 +373,7 @@ As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single- ### Tap Dance: A single key can do 3, 5, or 100 different things -Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/jackhumbert/qmk_firmware/pull/451). Here's how Algernon describes the feature: +Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/jackhumbert/qmk_firmware/pull/451). Here's how algernon describes the feature: With this feature one can specify keys that behave differently, based on the amount of times they have been tapped, and when interrupted, they get handled before the interrupter. -- cgit v1.2.3-24-g4f1b From 13385f5691f1a28b1349577ad58d0816f026ee05 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 20 Jul 2016 12:04:14 +0200 Subject: readme.md: Update the tap dance docs Signed-off-by: Gergely Nagy --- readme.md | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/readme.md b/readme.md index 734741230..4d6250f8e 100644 --- a/readme.md +++ b/readme.md @@ -389,7 +389,7 @@ First, you will need `TAP_DANCE_ENABLE=yes` in your `Makefile`, because the feat This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options: -* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. +* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held. * `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action. * `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets. @@ -397,8 +397,6 @@ The first option is enough for a lot of cases, that just want dual roles. For ex And that's the bulk of it! -Do note, however, that this implementation does have some consequences: keys do not register until either they reach the tapping ceiling, or they time out. This means that if you hold the key, nothing happens, no repeat, no nothing. It is possible to detect held state, and register an action then too, but that's not implemented yet. Keys also unregister immediately after being registered, so you can't even hold the second tap. This is intentional, to be consistent. - And now, on to the explanation of how it works! The main entry point is `process_tap_dance()`, called from `process_record_quantum()`, which is run for every keypress, and our handler gets to run early. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. If it was the same, we increment the counter and the timer. @@ -421,20 +419,25 @@ enum { /* Have the above three on the keymap, TD(CT_SE), etc... */ -void dance_cln (qk_tap_dance_state_t *state) { +void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { if (state->count == 1) { register_code (KC_RSFT); register_code (KC_SCLN); - unregister_code (KC_SCLN); - unregister_code (KC_RSFT); } else { register_code (KC_SCLN); + } +} + +void dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_RSFT); + unregister_code (KC_SCLN); + } else { unregister_code (KC_SCLN); - reset_tap_dance (state); } } -void dance_egg (qk_tap_dance_state_t *state) { +void dance_egg (qk_tap_dance_state_t *state, void *user_data) { if (state->count >= 100) { SEND_STRING ("Safety dance!"); reset_tap_dance (state); @@ -443,7 +446,7 @@ void dance_egg (qk_tap_dance_state_t *state) { // on each tap, light up one led, from right to left // on the forth tap, turn them off from right to left -void dance_flsh_each(qk_tap_dance_state_t *state) { +void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) { switch (state->count) { case 1: ergodox_right_led_3_on(); @@ -464,7 +467,7 @@ void dance_flsh_each(qk_tap_dance_state_t *state) { } // on the fourth tap, set the keyboard on flash state -void dance_flsh_finished(qk_tap_dance_state_t *state) { +void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) { if (state->count >= 4) { reset_keyboard(); reset_tap_dance(state); @@ -472,7 +475,7 @@ void dance_flsh_finished(qk_tap_dance_state_t *state) { } // if the flash state didnt happen, then turn off leds, left to right -void dance_flsh_reset(qk_tap_dance_state_t *state) { +void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) { ergodox_right_led_1_off(); _delay_ms(50); ergodox_right_led_2_off(); @@ -482,7 +485,7 @@ void dance_flsh_reset(qk_tap_dance_state_t *state) { const qk_tap_dance_action_t tap_dance_actions[] = { [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) - ,[CT_CLN] = ACTION_TAP_DANCE_FN (dance_cln) + ,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset) ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) ,[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset) }; -- cgit v1.2.3-24-g4f1b From 5631f1436c356fb9e09138f186981dc9b6cb43a2 Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 22 Jul 2016 11:17:57 +0200 Subject: converted funtions to QMK aliases --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 55 ++++++++++------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index c7aad3fc0..545cb1ab1 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -27,13 +27,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' LEFT DWN RIGHT */ [_DEF] = KEYMAP_ISO_SPLITRSHIFT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - F(2), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - F(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, F(17), \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX),F(4), \ - KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, F(5), F(6), F(7)) , - - /* Keymap 1: F-and-vim Layer, modified with Space (Fn0) + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + LT(_TAB,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, CTL_T(KC_ENT), \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), SFT_T(KC_UP), \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, ALT_T(KC_LEFT), GUI_T(KC_DOWN), CTL_T(KC_RIGHT)), + /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) * ,-----------------------------------------------------------. * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete| * |-----------------------------------------------------------| @@ -53,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE,M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), - /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (Fn1) + /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) * ,-----------------------------------------------------------. * |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE * |-----------------------------------------------------------| @@ -73,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), - /* Keymap 3: Split right shift Numpad toggle Layer (Fn2) + /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) * ,-----------------------------------------------------------. * |RSET| | | | | | | 7| 8| 9| | | |Backsp | * |-----------------------------------------------------------| @@ -87,11 +86,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_SFX] = KEYMAP_ISO_SPLITRSHIFT( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, \ - KC_TRNS, F(9), F(10), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ - KC_TRNS, F(11), F(12), F(13), F(14), F(15), F(16), KC_TRNS, KC_TRNS, KC_0, KC_TRNS, KC_SLSH, KC_TRNS, KC_UP, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT), + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, \ + KC_TRNS, F(2), F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ + KC_TRNS, F(4), F(5), F(6), F(7), F(8), F(9), KC_TRNS, KC_TRNS, KC_0, KC_TRNS, KC_SLSH, KC_TRNS, KC_UP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT), }; enum function_id { @@ -107,24 +106,16 @@ enum function_id { }; const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(_SPC, KC_SPACE), - [1] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC), - [2] = ACTION_LAYER_TAP_KEY(_TAB, KC_TAB), - [3] = ACTION_LAYER_TOGGLE(_SFX), - [4] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_UP), - [5] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_LEFT), - [6] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_DOWN), - [7] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_RIGHT), - [8] = ACTION_FUNCTION(LAUNCH), - purely cosmetic changes [9] = ACTION_FUNCTION(RGBLED_TOGGLE), - [10] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [11] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [12] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [13] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [14] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [15] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [16] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - [17] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), + [1] = ACTION_FUNCTION(LAUNCH), + [2] = ACTION_FUNCTION(RGBLED_TOGGLE), + [3] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [4] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [5] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [6] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [8] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [9] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + [10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -- cgit v1.2.3-24-g4f1b From 81fe3d962c1a04d180df89c0e052cc487b1bbc8a Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 23 Jul 2016 20:37:41 -0400 Subject: update sethbc keymap --- keyboards/satan/keymaps/sethbc/keymap.c | 23 +++++++++++++---------- keyboards/satan/keymaps/sethbc/readme.md | 3 +++ 2 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 keyboards/satan/keymaps/sethbc/readme.md diff --git a/keyboards/satan/keymaps/sethbc/keymap.c b/keyboards/satan/keymaps/sethbc/keymap.c index f8991f9fd..82c779081 100644 --- a/keyboards/satan/keymaps/sethbc/keymap.c +++ b/keyboards/satan/keymaps/sethbc/keymap.c @@ -10,6 +10,9 @@ #define _BL 0 #define _FL 1 +// Fillers to make layering more clear +#define _______ KC_TRNS + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-----------------------------------------------------------. @@ -33,17 +36,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_FL] = KEYMAP_HHKB( #ifdef RGBLIGHT_ENABLE - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RESET, \ - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ - KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RESET, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL, \ + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ + _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______), #else - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, RESET, \ - KC_CAPS, KC_TRNS, RGB_TOG,RGB_MOD,RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ - KC_TRNS, KC_VOLD, RGB_HUD,RGB_SAI,RGB_SAD, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ - KC_TRNS, RGB_VAI,RGB_VAD,KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RESET, \ + KC_CAPS, _______, RGB_TOG,RGB_MOD,RGB_HUI, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL, \ + _______, KC_VOLD, RGB_HUD,RGB_SAI,RGB_SAD, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ + _______, RGB_VAI,RGB_VAD,_______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______), #endif }; diff --git a/keyboards/satan/keymaps/sethbc/readme.md b/keyboards/satan/keymaps/sethbc/readme.md new file mode 100644 index 000000000..ed0eb8701 --- /dev/null +++ b/keyboards/satan/keymaps/sethbc/readme.md @@ -0,0 +1,3 @@ +# sethbc's Satan GH60 layout + +HHKB style split right shift and split backspace. Largely based on the HHKB layout. -- cgit v1.2.3-24-g4f1b From ef533be2d63602c85b58edf0376e142e74273e2e Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 23 Jul 2016 20:52:27 -0400 Subject: cleanup default layout --- keyboards/satan/keymaps/default/Makefile | 21 ++++++++++++++++++++ keyboards/satan/keymaps/default/keymap.c | 32 ++++++++++++++++--------------- keyboards/satan/keymaps/default/readme.md | 1 + 3 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 keyboards/satan/keymaps/default/Makefile create mode 100644 keyboards/satan/keymaps/default/readme.md diff --git a/keyboards/satan/keymaps/default/Makefile b/keyboards/satan/keymaps/default/Makefile new file mode 100644 index 000000000..2a7ff2779 --- /dev/null +++ b/keyboards/satan/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/satan/keymaps/default/keymap.c b/keyboards/satan/keymaps/default/keymap.c index 35dbbb77b..3806137e7 100644 --- a/keyboards/satan/keymaps/default/keymap.c +++ b/keyboards/satan/keymaps/default/keymap.c @@ -11,6 +11,8 @@ #define _BL 0 #define _FL 1 +#define _______ KC_TRNS + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _BL: (Base Layer) Default Layer * ,-----------------------------------------------------------. @@ -26,11 +28,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_BL] = KEYMAP( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL), + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL), /* Keymap _FL: Function Layer * ,-----------------------------------------------------------. @@ -47,17 +49,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FL] = KEYMAP( #ifdef RGBLIGHT_ENABLE - KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______, _______), #else - KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC, BL_INC,BL_TOGG, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______), #endif }; diff --git a/keyboards/satan/keymaps/default/readme.md b/keyboards/satan/keymaps/default/readme.md new file mode 100644 index 000000000..c366147df --- /dev/null +++ b/keyboards/satan/keymaps/default/readme.md @@ -0,0 +1 @@ +# default Satan GH60 layout -- cgit v1.2.3-24-g4f1b From 75f092271135ac5603eff93cd60bcd95d675278d Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 23 Jul 2016 20:55:20 -0400 Subject: fix typo in readme and satan.h --- keyboards/satan/readme.md | 2 +- keyboards/satan/satan.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/satan/readme.md b/keyboards/satan/readme.md index aa301f020..aaf189746 100644 --- a/keyboards/satan/readme.md +++ b/keyboards/satan/readme.md @@ -1,4 +1,4 @@ -Clueboard keyboard firmware +Satan GH60 keyboard firmware ====================== TODO: to be updated. diff --git a/keyboards/satan/satan.h b/keyboards/satan/satan.h index fa1711915..513446bf3 100644 --- a/keyboards/satan/satan.h +++ b/keyboards/satan/satan.h @@ -3,7 +3,7 @@ #include "quantum.h" -/* Clueboard matrix layout +/* Satan GH60 matrix layout * ,-----------------------------------------------------------. * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | * |-----------------------------------------------------------| -- cgit v1.2.3-24-g4f1b From b5761df57b024c29c69b24552fe1d43c49ac049d Mon Sep 17 00:00:00 2001 From: Jonathan Lucas Date: Sat, 23 Jul 2016 18:47:36 -0700 Subject: Create CMD-Preonic Keymap This is very Alpha-Mode, and has not been tested or even Made yet. --- keyboards/preonic/keymaps/CMD-Preonic/keymap.c | 322 +++++++++++++++++++++++++ 1 file changed, 322 insertions(+) create mode 100644 keyboards/preonic/keymaps/CMD-Preonic/keymap.c diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c new file mode 100644 index 000000000..c7a5be121 --- /dev/null +++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c @@ -0,0 +1,322 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _GAME 3 +#define _NUMPAD 13 +#define _LOWER 14 +#define _RAISE 15 +#define _ADJUST 16 + +// Macro name shortcuts +#define QWERTY M(_QWERTY) +#define COLEMAK M(_COLEMAK) +#define DVORAK M(_DVORAK) +#define GAME M(_GAME) +#define NUMPAD M(_NUMPAD) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) +#define M_BL 5 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH}, + {LT(_RAISE, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_MINUS, KC_EQUAL, KC_LBRC, KC_RBRC} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______}, + {_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {_______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______}, + {_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______}, + {_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* GAME + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | XXX | Lower | Space | Raise| - | = | [ | ] | + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH}, + {KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {_______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* NUMPAD + * ,-----------------------------------------------------------------------------------. + * | Esc | / | * | - | 4 | 5 | 6 | 7 | 8 | 9 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | 7 | 8 | 9 | + | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | 4 | 5 | 6 | + | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | 1 | 2 | 3 | Enter| V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | 0 | 0 | . | Enter| Lower| Space | Raise| - | = | [ | ] | + * `-----------------------------------------------------------------------------------' + */ +[_NUMPAD] = { + {KC_ESC, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_KP4, KC_KP_5, KC_KP_6, KC_KP_PLUS, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, _______, _______, _______, _______, _______, _______, _______, _______}, +}, +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Mute | BkSpc| Up | Del | Forwd| MBtn1| MUp| MBtn2| / | 7 | 8 | 9 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Left | Down | Right| Refr MLeft| MDn |MRight| * | 4 | 5 | 6 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Vol+| Prev | Play | Next | Back | MWDn| MBtn3| MWUp | - | 1 | 2 | 3 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Vol- | Pause| Ins | Print| | | | + | Enter| 0 | . | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL}, + {KC_MUTE, KC_BSPC, KC_UP, KC_DEL, KC_WWW_FORWARD, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_KP_SLASH, KC_KP_7, KC_KP_8, KC_KP_9}, + {_______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_KP_ASTERISK, KC_KP4, KC_KP_5, KC_KP_6}, + {KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_WWW_BACK, KC_MS_WH_DOWN, KC_MS_BTN3, KC_MS_WH_UP, KC_KP_MINUS, KC_KP_1, KC_KP_2, KC_KP_3}, + {KC_VOLD, KC_PAUSE, KC_INS, KC_PSCREEN, _______, _______, _______, _______, KC_KP_PLUS, KC_KP_ENTER, KC_KP_0, KC_KP_DOT} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Bksp | PgUp | Del | | | | PgUp | Up | PgDn | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Home | PgDn | End | | | Home | Left | Down | Right| ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | End | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {_______, KC_BSPC, KC_PGUP, KC_DEL, _______, _______, _______, KC_PGUP, KC_UP, _______, _______, _______}, + {_______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | |qwerty|ColMak|Dvorak| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |AGNorm|AGSwap| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud On|AudOff|MidiOn|MdiOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus On|MusOff| Sleep| Wake | Arrow| Game | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | Reset | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, _______, _______, _______}, + {_______, RESET, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, MI_ON, MI_OFF, QWERTY, COLEMAK, DVORAK, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, KC_SYSTEM_SLEEP, KC_SYSTEM_WAKE, ARROW, GAME, _______, _______, _______}, + {_______, _______, _______, _______, _______, RESET, RESET, _______, _______, _______, _______, _______} +} + + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +#ifdef AUDIO_ENABLE +float start_up[][2] = { + {440.0*pow(2.0,(14)/12.0), 20}, + {440.0*pow(2.0,(26)/12.0), 8}, + {440.0*pow(2.0,(18)/12.0), 20}, + {440.0*pow(2.0,(26)/12.0), 8} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); + +float goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + break; + case _COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + break; + case _DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + break; + case _GAME: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_GAME); + } + break; + case _NUMPAD: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_NUMPAD); + } + break; + case _LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case _RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case M_BL: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(start_up, false, 0); + #endif +} + +#ifdef AUDIO_ENABLE + +void play_goodbye_tone() +{ + PLAY_NOTE_ARRAY(goodbye, false, 0); + _delay_ms(150); +} + +#endif -- cgit v1.2.3-24-g4f1b From 3c7075011b93875ad74b7cfdd66eb009b972e0ed Mon Sep 17 00:00:00 2001 From: Jonathan Lucas Date: Sat, 23 Jul 2016 18:50:41 -0700 Subject: Create Makefile This is untested, use caution. --- keyboards/preonic/keymaps/CMD-Preonic/makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 keyboards/preonic/keymaps/CMD-Preonic/makefile diff --git a/keyboards/preonic/keymaps/CMD-Preonic/makefile b/keyboards/preonic/keymaps/CMD-Preonic/makefile new file mode 100644 index 000000000..2f7787e86 --- /dev/null +++ b/keyboards/preonic/keymaps/CMD-Preonic/makefile @@ -0,0 +1,23 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif -- cgit v1.2.3-24-g4f1b From 9b3708f830ed06f74e555decebbcc0d5d152ffe3 Mon Sep 17 00:00:00 2001 From: Jonathan Lucas Date: Sat, 23 Jul 2016 18:52:52 -0700 Subject: Init Readme This needs a better description. --- keyboards/preonic/keymaps/CMD-Preonic/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 keyboards/preonic/keymaps/CMD-Preonic/README.md diff --git a/keyboards/preonic/keymaps/CMD-Preonic/README.md b/keyboards/preonic/keymaps/CMD-Preonic/README.md new file mode 100644 index 000000000..91fa4adeb --- /dev/null +++ b/keyboards/preonic/keymaps/CMD-Preonic/README.md @@ -0,0 +1 @@ +# CMD-Preonic - This keymapping aims to increase productivity, specifically for programmer's who use Text editors like SublimeText and Atom by maximizing usage of the left-hand and function layers. -- cgit v1.2.3-24-g4f1b From fbafb9449e381858d19d8a9a7436ee6b5a078cf3 Mon Sep 17 00:00:00 2001 From: commandlinedesign Date: Sat, 23 Jul 2016 19:32:02 -0700 Subject: Resolved errors --- keyboards/preonic/keymaps/CMD-Preonic/keymap.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c index c7a5be121..f0bcacb41 100644 --- a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c +++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c @@ -13,6 +13,7 @@ #define _COLEMAK 1 #define _DVORAK 2 #define _GAME 3 +#define _ARROW 12 #define _NUMPAD 13 #define _LOWER 14 #define _RAISE 15 @@ -23,6 +24,7 @@ #define COLEMAK M(_COLEMAK) #define DVORAK M(_DVORAK) #define GAME M(_GAME) +#define ARROW M(_ARROW) #define NUMPAD M(_NUMPAD) #define LOWER M(_LOWER) #define RAISE M(_RAISE) @@ -47,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = { +[_QWERTY] = { {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH}, {LT(_RAISE, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, @@ -134,10 +136,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_NUMPAD] = { {KC_ESC, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, _______, _______, _______, _______, _______, _______, _______, _______}, {KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_KP4, KC_KP_5, KC_KP_6, KC_KP_PLUS, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, _______, _______, _______, _______, _______, _______, _______, _______}, {KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, _______, _______, _______, _______, _______, _______, _______, _______}, {KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, _______, _______, _______, _______, _______, _______, _______, _______}, -}, +}, /* Lower * ,-----------------------------------------------------------------------------------. * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Del | @@ -146,7 +148,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | | Left | Down | Right| Refr MLeft| MDn |MRight| * | 4 | 5 | 6 | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Vol+| Prev | Play | Next | Back | MWDn| MBtn3| MWUp | - | 1 | 2 | 3 | + * | Vol+| Prev | Play | Next | Back | MWDn| MBtn3| MWUp | - | 1 | 2 | 3 | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Vol- | Pause| Ins | Print| | | | + | Enter| 0 | . | * `-----------------------------------------------------------------------------------' @@ -154,7 +156,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = { {KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL}, {KC_MUTE, KC_BSPC, KC_UP, KC_DEL, KC_WWW_FORWARD, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_KP_SLASH, KC_KP_7, KC_KP_8, KC_KP_9}, - {_______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_KP_ASTERISK, KC_KP4, KC_KP_5, KC_KP_6}, + {_______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_KP_ASTERISK, KC_KP_4, KC_KP_5, KC_KP_6}, {KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_WWW_BACK, KC_MS_WH_DOWN, KC_MS_BTN3, KC_MS_WH_UP, KC_KP_MINUS, KC_KP_1, KC_KP_2, KC_KP_3}, {KC_VOLD, KC_PAUSE, KC_INS, KC_PSCREEN, _______, _______, _______, _______, KC_KP_PLUS, KC_KP_ENTER, KC_KP_0, KC_KP_DOT} }, @@ -188,7 +190,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | |Aud On|AudOff|MidiOn|MdiOff| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | |Voice-|Voice+|Mus On|MusOff| Sleep| Wake | Arrow| Game | | | | + * | |Voice-|Voice+|Mus On|MusOff| Sleep| Wake | Arrow| Game |NUMPAD| | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | Reset | | | | | | * `-----------------------------------------------------------------------------------' @@ -197,7 +199,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {_______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, _______, _______, _______}, {_______, RESET, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, _______, KC_DEL}, {_______, _______, _______, AU_ON, AU_OFF, MI_ON, MI_OFF, QWERTY, COLEMAK, DVORAK, _______, _______}, - {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, KC_SYSTEM_SLEEP, KC_SYSTEM_WAKE, ARROW, GAME, _______, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, KC_SYSTEM_SLEEP, KC_SYSTEM_WAKE, ARROW, GAME, NUMPAD, _______, _______}, {_______, _______, _______, _______, _______, RESET, RESET, _______, _______, _______, _______, _______} } @@ -271,6 +273,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) persistant_default_layer_set(1UL<<_NUMPAD); } break; + case _ARROW: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_LOWER); + } + break; case _LOWER: if (record->event.pressed) { layer_on(_LOWER); -- cgit v1.2.3-24-g4f1b From c1fb82623c8075bb375f31f4399c47e8e18c521b Mon Sep 17 00:00:00 2001 From: commandlinedesign Date: Sat, 23 Jul 2016 20:02:45 -0700 Subject: Tested, resolved Mouse issue, resolved numpad issue --- keyboards/preonic/keymaps/CMD-Preonic/keymap.c | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c index f0bcacb41..26384795f 100644 --- a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c +++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c @@ -50,11 +50,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH}, - {LT(_RAISE, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_MINUS, KC_EQUAL, KC_LBRC, KC_RBRC} + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH}, + {LT(_RAISE, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT(_LOWER, KC_SPC), KC_SPC, RAISE, KC_MINUS, KC_EQUAL, KC_LBRC, KC_RBRC} }, /* Colemak @@ -134,11 +134,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_NUMPAD] = { - {KC_ESC, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_ESC, KC_PSLS, KC_PAST, KC_PMNS, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_P7, KC_P8, KC_P9, KC_PPLS, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_P4, KC_P5, KC_P6, KC_PPLS, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_P0, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, _______, _______}, }, /* Lower * ,-----------------------------------------------------------------------------------. @@ -154,11 +154,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOWER] = { - {KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL}, - {KC_MUTE, KC_BSPC, KC_UP, KC_DEL, KC_WWW_FORWARD, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_KP_SLASH, KC_KP_7, KC_KP_8, KC_KP_9}, - {_______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_KP_ASTERISK, KC_KP_4, KC_KP_5, KC_KP_6}, - {KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_WWW_BACK, KC_MS_WH_DOWN, KC_MS_BTN3, KC_MS_WH_UP, KC_KP_MINUS, KC_KP_1, KC_KP_2, KC_KP_3}, - {KC_VOLD, KC_PAUSE, KC_INS, KC_PSCREEN, _______, _______, _______, _______, KC_KP_PLUS, KC_KP_ENTER, KC_KP_0, KC_KP_DOT} + {KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL}, + {KC_MUTE, KC_BSPC, KC_UP, KC_DEL, KC_WWW_FORWARD, KC_BTN1, KC_MS_U, KC_BTN2, KC_PSLS, KC_P7, KC_P8, KC_P9}, + {_______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_L, KC_MS_D, KC_MS_R, KC_PAST, KC_P4, KC_P5, KC_P6}, + {KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_WWW_BACK, KC_WH_D, KC_BTN3, KC_WH_U, KC_PMNS, KC_P1, KC_P2, KC_P3}, + {KC_VOLD, KC_PAUSE, KC_INS, KC_PSCREEN, _______, _______, _______, _______, KC_PPLS, KC_PENT, KC_P0, KC_PDOT} }, /* Raise -- cgit v1.2.3-24-g4f1b From 4480a74a4b815d62de18e35016b0fbe5d59b9c75 Mon Sep 17 00:00:00 2001 From: commandlinedesign Date: Sat, 23 Jul 2016 21:02:23 -0700 Subject: Arrow key fn layer shouldnt overwrite Ctrl key. Better Print Screen position --- keyboards/preonic/keymaps/CMD-Preonic/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c index 26384795f..287974dab 100644 --- a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c +++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c @@ -150,7 +150,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | Vol+| Prev | Play | Next | Back | MWDn| MBtn3| MWUp | - | 1 | 2 | 3 | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Vol- | Pause| Ins | Print| | | | + | Enter| 0 | . | + * | Vol- | | | | | | | + | Enter| 0 | . | * `-----------------------------------------------------------------------------------' */ [_LOWER] = { @@ -169,16 +169,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * | | Home | PgDn | End | | | Home | Left | Down | Right| ] | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | End | | | |Enter | + * | | Pause| Ins | | | Print|Screen| End | | | |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | + * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_RAISE] = { {KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, {_______, KC_BSPC, KC_PGUP, KC_DEL, _______, _______, _______, KC_PGUP, KC_UP, _______, _______, _______}, {_______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______}, + {_______, KC_PAUSE, KC_INS, _______, KC_PSCR, KC_PSCR, _______, KC_END, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, -- cgit v1.2.3-24-g4f1b From c826bcfc3969cba4a699da329dc146b9944fce6b Mon Sep 17 00:00:00 2001 From: commandlinedesign Date: Sat, 23 Jul 2016 21:08:00 -0700 Subject: Did a derp and forgot to set Trans on Arrow layer --- keyboards/preonic/keymaps/CMD-Preonic/keymap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c index 287974dab..5d217e261 100644 --- a/keyboards/preonic/keymaps/CMD-Preonic/keymap.c +++ b/keyboards/preonic/keymaps/CMD-Preonic/keymap.c @@ -154,11 +154,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOWER] = { - {KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL}, - {KC_MUTE, KC_BSPC, KC_UP, KC_DEL, KC_WWW_FORWARD, KC_BTN1, KC_MS_U, KC_BTN2, KC_PSLS, KC_P7, KC_P8, KC_P9}, - {_______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_L, KC_MS_D, KC_MS_R, KC_PAST, KC_P4, KC_P5, KC_P6}, - {KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_WWW_BACK, KC_WH_D, KC_BTN3, KC_WH_U, KC_PMNS, KC_P1, KC_P2, KC_P3}, - {KC_VOLD, KC_PAUSE, KC_INS, KC_PSCREEN, _______, _______, _______, _______, KC_PPLS, KC_PENT, KC_P0, KC_PDOT} + {KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL}, + {KC_MUTE, KC_BSPC, KC_UP, KC_DEL, KC_WWW_FORWARD, KC_BTN1, KC_MS_U, KC_BTN2, KC_PSLS, KC_P7, KC_P8, KC_P9}, + {_______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_L, KC_MS_D, KC_MS_R, KC_PAST, KC_P4, KC_P5, KC_P6}, + {KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_WWW_BACK, KC_WH_D, KC_BTN3, KC_WH_U, KC_PMNS, KC_P1, KC_P2, KC_P3}, + {KC_VOLD, _______, _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PENT, KC_P0, KC_PDOT} }, /* Raise -- cgit v1.2.3-24-g4f1b From e6a41e43aa524ae78aecb2eeeeca55c850d05cdd Mon Sep 17 00:00:00 2001 From: Jonathan Lucas Date: Sat, 23 Jul 2016 21:26:01 -0700 Subject: Updated Readme --- keyboards/preonic/keymaps/CMD-Preonic/README.md | 78 ++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/keyboards/preonic/keymaps/CMD-Preonic/README.md b/keyboards/preonic/keymaps/CMD-Preonic/README.md index 91fa4adeb..2b80c2b3a 100644 --- a/keyboards/preonic/keymaps/CMD-Preonic/README.md +++ b/keyboards/preonic/keymaps/CMD-Preonic/README.md @@ -1 +1,77 @@ -# CMD-Preonic - This keymapping aims to increase productivity, specifically for programmer's who use Text editors like SublimeText and Atom by maximizing usage of the left-hand and function layers. +CMD-Preonic +=================== +The CMD project seeks to improve productivity by optimizing usage of the left hand via clever use of the function layers. + +>Note: This project is currently optimized for grid layout, and has not been confirmed to work 100% on MIT layout, although it is expected to work correctly. + +---------- + +Modes +------------- + +#### QWERTY + +>CMD-Qwerty is very similar to the default Preonic with a few key differences: + + - Dual-role Raise/Enter Key at Caps Lock position. -Don't need to take your hand off the mouse to submit URLs + - Space_Function under left space (Grid layout) -Don't need to take your thumb off of the spacebar to use lower. + - Dedicated arrow keys replaced with ( - , = , [ , and ] ) - big improvement for programmers who are used to fn layer. + +---------- + +#### Game + +> Disables extra features to facilitate easier usage of the Preonic while gaming. this mode is toggled in the adjust layer. + + - Dual Role Function key becomes Caps Lock. + - Space_Function disabled and replaced with normal spacebar. + - Windows Key disabled. + +---------- + +#### Numpad + +> Enables left-hand numpad + + - Left-side numpad + - Can be toggled on in Adjust layer (under . key) + +---------- + +#### Arrow - (Lower) + +> Makes arrow keys easily accessible to Left Hand, and much more. + + - Arrow keys at WASD, Backspace at Q, Delete at E. + - Media Keys near arrow cluster, mute at A. + - Web Nav keys. + - Mouse cluster at YGHJ. + - Numpad in right side of board. + - Can be toggled on in Adjust layer (Under , key) + +---------- + +#### Function- (Raise) + +> Basic Functions. Open Keys for customization. + + - Turns WASD into Navigation cluster (Home, End, Page up and Page Down) + - Pok3r style right hand arrow cluster for accessibility (familiar for many users.) + - Doubles as shift key for top row numbers. + - Print Screen, Insert, etc. + +---------- + +#### Adjust- (Raise + Lower) + +> Switch Modes + + - Default modes moved to the left and new layer toggle modes located to the right. + - Sleep and Wake keys added. + - Reset button moved under Spacebar(s). + +Notes: +------------- + +Please feel free to reach out to Commandlinedesign@gmail.com with suggestions. +Special Thanks to Jack for QMK firmware and the Preonic! -- cgit v1.2.3-24-g4f1b From a4034b75c0f8ae9fd2e1001888fe07983f329597 Mon Sep 17 00:00:00 2001 From: Don Smith Date: Sun, 24 Jul 2016 19:18:22 +1200 Subject: Added LEADER_EXTERNS() call. This seems to be needed in most cases. --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index ed3da43bd..1a0e256b3 100644 --- a/readme.md +++ b/readme.md @@ -346,6 +346,8 @@ That's what `KC_LEAD` does. Here's an example: 3. Within your `matrix_scan_user` function, do something like this: ``` +LEADER_EXTERNS(); + void matrix_scan_user(void) { LEADER_DICTIONARY() { leading = false; -- cgit v1.2.3-24-g4f1b From 7b4d30ee50aa534a973473c715924964991739f0 Mon Sep 17 00:00:00 2001 From: Vivien Alger Date: Sun, 24 Jul 2016 10:57:49 +0200 Subject: Fix some errors in bepo mapping --- quantum/keymap_extras/keymap_bepo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/keymap_extras/keymap_bepo.h b/quantum/keymap_extras/keymap_bepo.h index 4c3096054..e5ef39552 100644 --- a/quantum/keymap_extras/keymap_bepo.h +++ b/quantum/keymap_extras/keymap_bepo.h @@ -118,7 +118,7 @@ // Fourth row #define BP_COLON LSFT(BP_DOT) // : #define BP_COLN BP_COLON -#define BP_QUESTION LSFT(BP_QUOTE) // ? +#define BP_QUESTION LSFT(BP_APOS) // ? #define BP_QEST BP_QUESTION // Space bar @@ -183,7 +183,7 @@ // Third row #define BP_AE_LIGATURE ALTGR(BP_A) // æ #define BP_AE BP_AE_LIGATURE -#define BP_U_GRAVE AGR(BP_U) // ù +#define BP_U_GRAVE ALTGR(BP_U) // ù #define BP_UGRV BP_U_GRAVE #define BP_DEAD_TREMA ALTGR(BP_I) // dead ¨ (trema/umlaut/diaresis) #define BP_DTRM BP_DEAD_TREMA -- cgit v1.2.3-24-g4f1b From 3ea738e450e9326b0d3ee4192da881cffb4c13c1 Mon Sep 17 00:00:00 2001 From: Robert Dale Date: Sun, 24 Jul 2016 10:00:39 -0400 Subject: ensure there's a recording to play before playing; also enables the LGUI button to play a tone --- quantum/process_keycode/process_music.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index c8f3ddb90..2d52e47a7 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -6,6 +6,7 @@ int offset = 7; // music sequencer static bool music_sequence_recording = false; +static bool music_sequence_recorded = false; static bool music_sequence_playing = false; static float music_sequence[16] = {0}; static uint8_t music_sequence_count = 0; @@ -77,6 +78,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { if (keycode == KC_LCTL && record->event.pressed) { // Start recording stop_all_notes(); music_sequence_recording = true; + music_sequence_recorded = false; music_sequence_playing = false; music_sequence_count = 0; return false; @@ -84,12 +86,15 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { if (keycode == KC_LALT && record->event.pressed) { // Stop recording/playing stop_all_notes(); + if (music_sequence_recording) { // was recording + music_sequence_recorded = true; + } music_sequence_recording = false; music_sequence_playing = false; return false; } - if (keycode == KC_LGUI && record->event.pressed) { // Start playing + if (keycode == KC_LGUI && record->event.pressed && music_sequence_recorded) { // Start playing stop_all_notes(); music_sequence_recording = false; music_sequence_playing = true; -- cgit v1.2.3-24-g4f1b From 812007a24168f895105330d3959909525c51636b Mon Sep 17 00:00:00 2001 From: Robert Dale Date: Sun, 24 Jul 2016 10:19:40 -0400 Subject: added music recording/playing doc --- readme.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/readme.md b/readme.md index ed3da43bd..9a4c314dc 100644 --- a/readme.md +++ b/readme.md @@ -801,6 +801,17 @@ This is inside one of the macros. So when that macro executes, your keyboard pla "Rest style" in the method signature above (the last parameter) specifies if there's a rest (a moment of silence) between the notes. + +## Recording And Playing back Music +* ```Music On``` - Turn music mode on. The default mapping is ```Lower+Upper+C``` +* ```LCTL``` - start a recording +* play some tones +* ```LALT``` - stop recording, stop playing +* ```LGUI``` - play recording +* ```LALT``` - stop playing +* ```Music Off``` - Turn music mode off. The default mapping is ```Lower+Upper+V``` + + ## MIDI functionalty This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. -- cgit v1.2.3-24-g4f1b From f9956c2aac357645c4a77887a28c3ab58467893a Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Sun, 24 Jul 2016 12:56:28 -0700 Subject: Fix compiler warning when PREVENT_STUCK_MODIFIERS is enabled. --- tmk_core/common/action_layer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 63fa2b5ae..a3c757964 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -111,7 +111,7 @@ void layer_debug(void) #endif #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) -uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS] = {0}; +uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS] = {{0}}; void update_source_layers_cache(keypos_t key, uint8_t layer) { -- cgit v1.2.3-24-g4f1b From f4cb84c9402cd58628b6cf895fc24fc34fcffdbd Mon Sep 17 00:00:00 2001 From: Will Wolff-Myren Date: Sun, 24 Jul 2016 14:33:17 -0700 Subject: Remove images, per @ezuk request. =) --- .../keymaps/teckinesis/advantage_layout_win.png | Bin 93337 -> 0 bytes keyboards/ergodox_ez/keymaps/teckinesis/readme.md | 10 ---------- .../ergodox_ez/keymaps/teckinesis/teck209layout.jpg | Bin 89673 -> 0 bytes 3 files changed, 10 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/advantage_layout_win.png delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teck209layout.jpg diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/advantage_layout_win.png b/keyboards/ergodox_ez/keymaps/teckinesis/advantage_layout_win.png deleted file mode 100644 index 0a1df6809..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/advantage_layout_win.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md index 84b737505..9494a4d4c 100644 --- a/keyboards/ergodox_ez/keymaps/teckinesis/readme.md +++ b/keyboards/ergodox_ez/keymaps/teckinesis/readme.md @@ -43,13 +43,3 @@ the [Kinesis Advantage](http://www.kinesis-ergo.com/wp-content/uploads/2013/06/a * Removed Power, Sleep, Mail, My Computer keys. (I kept hitting these while using the mouse/cursor. =P) -# Truly Ergonomic and Kinesis Advantage Layouts - -## TECK 209 Layout ## - -![TECK 209 Layout](teck209layout.jpg) - -## Kinesis Advantage Layout ## - -![Kinesis Advantage Layout](advantage_layout_win.png) - diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teck209layout.jpg b/keyboards/ergodox_ez/keymaps/teckinesis/teck209layout.jpg deleted file mode 100644 index a97844f4f..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/teck209layout.jpg and /dev/null differ -- cgit v1.2.3-24-g4f1b From 8b94e26d7c3b30cc57d710a11e5651d15e8e3b20 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 24 Jul 2016 22:07:43 -0400 Subject: Fixes midi functionality --- Makefile | 2 +- keyboards/lets_split/config.h | 4 ++-- keyboards/planck/keymaps/default/Makefile | 2 +- quantum/keymap_common.c | 2 +- quantum/process_keycode/process_midi.c | 24 ++++++++++++------------ 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index a7a10bf32..980ab26b2 100644 --- a/Makefile +++ b/Makefile @@ -181,7 +181,7 @@ endif ifeq ($(strip $(MIDI_ENABLE)), yes) OPT_DEFS += -DMIDI_ENABLE - SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c + SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c endif ifeq ($(strip $(AUDIO_ENABLE)), yes) diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index 833818ce6..ec99514aa 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h @@ -69,9 +69,9 @@ along with this program. If not, see . ) /* ws2812 RGB LED */ -#define RGB_DI_PIN D2 +#define RGB_DI_PIN D4 #define RGBLIGHT_TIMER -#define RGBLED_NUM 28 // Number of LEDs +#define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/planck/keymaps/default/Makefile b/keyboards/planck/keymaps/default/Makefile index 581e08cd0..38a504a27 100644 --- a/keyboards/planck/keymaps/default/Makefile +++ b/keyboards/planck/keymaps/default/Makefile @@ -11,7 +11,7 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls +MIDI_ENABLE = yes # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index d0a8312c1..833e5a8f8 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -30,7 +30,7 @@ along with this program. If not, see . #include "quantum.h" #ifdef MIDI_ENABLE - #include "keymap_midi.h" + #include "process_midi.h" #endif extern keymap_config_t keymap_config; diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index d6ab9c626..8784e64f3 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c @@ -1,8 +1,8 @@ #include "process_midi.h" bool midi_activated = false; -uint8_t starting_note = 0x0C; -int offset = 7; +uint8_t midi_starting_note = 0x0C; +int midi_offset = 7; bool process_midi(uint16_t keycode, keyrecord_t *record) { if (keycode == MI_ON && record->event.pressed) { @@ -20,42 +20,42 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) { if (midi_activated) { if (record->event.key.col == (MATRIX_COLS - 1) && record->event.key.row == (MATRIX_ROWS - 1)) { if (record->event.pressed) { - starting_note++; // Change key + midi_starting_note++; // Change key midi_send_cc(&midi_device, 0, 0x7B, 0); } return false; } if (record->event.key.col == (MATRIX_COLS - 2) && record->event.key.row == (MATRIX_ROWS - 1)) { if (record->event.pressed) { - starting_note--; // Change key + midi_starting_note--; // Change key midi_send_cc(&midi_device, 0, 0x7B, 0); } return false; } if (record->event.key.col == (MATRIX_COLS - 3) && record->event.key.row == (MATRIX_ROWS - 1) && record->event.pressed) { - offset++; // Change scale + midi_offset++; // Change scale midi_send_cc(&midi_device, 0, 0x7B, 0); return false; } if (record->event.key.col == (MATRIX_COLS - 4) && record->event.key.row == (MATRIX_ROWS - 1) && record->event.pressed) { - offset--; // Change scale + midi_offset--; // Change scale midi_send_cc(&midi_device, 0, 0x7B, 0); return false; } // basic - // uint8_t note = (starting_note + SCALE[record->event.key.col + offset])+12*(MATRIX_ROWS - record->event.key.row); + // uint8_t note = (midi_starting_note + SCALE[record->event.key.col + midi_offset])+12*(MATRIX_ROWS - record->event.key.row); // advanced - // uint8_t note = (starting_note + record->event.key.col + offset)+12*(MATRIX_ROWS - record->event.key.row); + // uint8_t note = (midi_starting_note + record->event.key.col + midi_offset)+12*(MATRIX_ROWS - record->event.key.row); // guitar - uint8_t note = (starting_note + record->event.key.col + offset)+5*(MATRIX_ROWS - record->event.key.row); + uint8_t note = (midi_starting_note + record->event.key.col + midi_offset)+5*(MATRIX_ROWS - record->event.key.row); // violin - // uint8_t note = (starting_note + record->event.key.col + offset)+7*(MATRIX_ROWS - record->event.key.row); + // uint8_t note = (midi_starting_note + record->event.key.col + midi_offset)+7*(MATRIX_ROWS - record->event.key.row); if (record->event.pressed) { - // midi_send_noteon(&midi_device, record->event.key.row, starting_note + SCALE[record->event.key.col], 127); + // midi_send_noteon(&midi_device, record->event.key.row, midi_starting_note + SCALE[record->event.key.col], 127); midi_send_noteon(&midi_device, 0, note, 127); } else { - // midi_send_noteoff(&midi_device, record->event.key.row, starting_note + SCALE[record->event.key.col], 127); + // midi_send_noteoff(&midi_device, record->event.key.row, midi_starting_note + SCALE[record->event.key.col], 127); midi_send_noteoff(&midi_device, 0, note, 127); } -- cgit v1.2.3-24-g4f1b From b6fa762234fb5a3590d0ff91ffdf5aa3ae322c8f Mon Sep 17 00:00:00 2001 From: Andreas Lindhé Date: Mon, 25 Jul 2016 11:29:54 +0200 Subject: Fix misspelled command in Norwegian helper --- quantum/keymap_extras/keymap_norwegian.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/keymap_extras/keymap_norwegian.h b/quantum/keymap_extras/keymap_norwegian.h index 018bfeae5..5c4e8c495 100644 --- a/quantum/keymap_extras/keymap_norwegian.h +++ b/quantum/keymap_extras/keymap_norwegian.h @@ -13,7 +13,7 @@ #undef NO_BSLS #define NO_BSLS KC_EQL // '\' #undef NO_CIRC -#define NO_CIRC LSFT(C_RBRC) // ^ +#define NO_CIRC LSFT(KC_RBRC) // ^ #undef NO_GRV #define NO_GRV LSFT(NO_BSLS) // #undef NO_OSLH -- cgit v1.2.3-24-g4f1b From 283ebbe14298fe75128765fa42c46f02534fb761 Mon Sep 17 00:00:00 2001 From: Andreas Lindhé Date: Mon, 25 Jul 2016 12:50:27 +0200 Subject: Change Nordic ampersand code to match the English Changed from "NO_AMP" to "NO_AMPR" since the KC one is "KC_AMPR" --- quantum/keymap_extras/keymap_nordic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h index f8cf4e2e4..da5c82975 100644 --- a/quantum/keymap_extras/keymap_nordic.h +++ b/quantum/keymap_extras/keymap_nordic.h @@ -25,7 +25,7 @@ #define NO_SECT LSFT(NO_HALF) #define NO_QUO2 LSFT(KC_2) #define NO_BULT LSFT(KC_4) -#define NO_AMP LSFT(KC_6) +#define NO_AMPR LSFT(KC_6) #define NO_SLSH LSFT(KC_7) #define NO_LPRN LSFT(KC_8) #define NO_RPRN LSFT(KC_9) -- cgit v1.2.3-24-g4f1b From 048e8b7849f94ebb486f941dd3f26f6c70ad42c9 Mon Sep 17 00:00:00 2001 From: erlo muvman Date: Mon, 25 Jul 2016 20:06:58 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index dab06b8eb..bdb5f2158 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -119,9 +119,3 @@ The only change here is the *dot* (`.`) character moving from next to `0` next t | | | | | | | | `--------------------' `--------------------' ``` - -# ErgoDox EZ Default Configuration - -As of Feb 2, 2016, the default ErgoDox EZ keymap is: - -![Default](default_highres.png) -- cgit v1.2.3-24-g4f1b From 6e2d7ebd80365f96f8f589969b773e2f2efce5d5 Mon Sep 17 00:00:00 2001 From: erlo muvman Date: Mon, 25 Jul 2016 20:12:48 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index bdb5f2158..c689813c4 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -32,24 +32,24 @@ I think it's quite dangerous to put something like control on the same key as en # Keymap ## Keymap 0: Basic layer ``` - ,--------------------------------------------------. ,--------------------------------------------------. - | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+--------+------. - | | | | | | | | - | Space| Bksp |------| |------| Tab |Enter | - | ctrl | gui | Alt | | Alt | gui | ctrl | - `--------------------' `----------------------' + ,--------------------------------------------------. ,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+--------+------. + | | | | | | | | + | Space| Bksp |------| |------| Tab |Enter | + | ctrl | gui | Alt | | Alt | gui | ctrl | + `--------------------' `----------------------' ``` -- cgit v1.2.3-24-g4f1b From 97efac0f1c9642b3f3cd6a56a2094ed9173c818e Mon Sep 17 00:00:00 2001 From: erlo muvman Date: Mon, 25 Jul 2016 20:14:19 -0500 Subject: Update readme.md --- keyboard/ergodox_ez/keymaps/maz/readme.md | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md index c689813c4..000a8d000 100644 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ b/keyboard/ergodox_ez/keymaps/maz/readme.md @@ -32,24 +32,24 @@ I think it's quite dangerous to put something like control on the same key as en # Keymap ## Keymap 0: Basic layer ``` - ,--------------------------------------------------. ,--------------------------------------------------. - | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+--------+------. - | | | | | | | | - | Space| Bksp |------| |------| Tab |Enter | - | ctrl | gui | Alt | | Alt | gui | ctrl | - `--------------------' `----------------------' +,--------------------------------------------------. ,--------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | +|--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| +| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+--------+------. + | | | | | | | | + | Space| Bksp |------| |------| Tab |Enter | + | ctrl | gui | Alt | | Alt | gui | ctrl | + `--------------------' `----------------------' ``` -- cgit v1.2.3-24-g4f1b From 3779e1988e43e0f4c9ad02acfebf1223d55d477e Mon Sep 17 00:00:00 2001 From: erlo muvman Date: Mon, 25 Jul 2016 20:16:07 -0500 Subject: Delete default_highres.png --- keyboard/ergodox_ez/keymaps/maz/default_highres.png | Bin 1459389 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 keyboard/ergodox_ez/keymaps/maz/default_highres.png diff --git a/keyboard/ergodox_ez/keymaps/maz/default_highres.png b/keyboard/ergodox_ez/keymaps/maz/default_highres.png deleted file mode 100644 index 7d9f045f4..000000000 Binary files a/keyboard/ergodox_ez/keymaps/maz/default_highres.png and /dev/null differ -- cgit v1.2.3-24-g4f1b From 26510e6de8fcfa2c58b66da165beb234f7684973 Mon Sep 17 00:00:00 2001 From: erlo muvman Date: Mon, 25 Jul 2016 20:16:11 -0500 Subject: Delete default.png --- keyboard/ergodox_ez/keymaps/maz/default.png | Bin 193672 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 keyboard/ergodox_ez/keymaps/maz/default.png diff --git a/keyboard/ergodox_ez/keymaps/maz/default.png b/keyboard/ergodox_ez/keymaps/maz/default.png deleted file mode 100644 index 6575f7b5e..000000000 Binary files a/keyboard/ergodox_ez/keymaps/maz/default.png and /dev/null differ -- cgit v1.2.3-24-g4f1b From 3a860c4bc210857f03ef9fae5043d6d5736d140d Mon Sep 17 00:00:00 2001 From: Jordi Orlando <0xdec@users.noreply.github.com> Date: Tue, 26 Jul 2016 14:43:45 -0500 Subject: Clean up rgblight.c Fix formatting issues, clarify comments --- quantum/rgblight.c | 731 +++++++++++++++++++++++++++-------------------------- 1 file changed, 377 insertions(+), 354 deletions(-) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index b1b0f035d..1b3c576d1 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -7,24 +7,41 @@ #include "debug.h" const uint8_t DIM_CURVE[] PROGMEM = { - 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, - 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, - 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, - 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, - 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, - 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, - 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, - 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 81, 82, - 83, 85, 86, 88, 90, 91, 93, 94, 96, 98, 99, 101, 103, 105, 107, 109, - 110, 112, 114, 116, 118, 121, 123, 125, 127, 129, 132, 134, 136, 139, 141, 144, - 146, 149, 151, 154, 157, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 190, - 193, 196, 200, 203, 207, 211, 214, 218, 222, 226, 230, 234, 238, 242, 248, 255, + 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, + 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, + 11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, + 15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, + 20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26, + 27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35, + 36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47, + 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 81, 82, + 83, 85, 86, 88, 90, 91, 93, 94, 96, 98, 99, 101, 103, 105, 107, 109, + 110, 112, 114, 116, 118, 121, 123, 125, 127, 129, 132, 134, 136, 139, 141, 144, + 146, 149, 151, 154, 157, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 190, + 193, 196, 200, 203, 207, 211, 214, 218, 222, 226, 230, 234, 238, 242, 248, 255 +}; +const uint8_t RGBLED_BREATHING_TABLE[] PROGMEM = { + 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 9, + 10, 11, 12, 14, 15, 17, 18, 20, 21, 23, 25, 27, 29, 31, 33, 35, + 37, 40, 42, 44, 47, 49, 52, 54, 57, 59, 62, 65, 67, 70, 73, 76, + 79, 82, 85, 88, 90, 93, 97, 100, 103, 106, 109, 112, 115, 118, 121, 124, + 127, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 162, 165, 167, 170, 173, + 176, 179, 182, 185, 188, 190, 193, 196, 198, 201, 203, 206, 208, 211, 213, 215, + 218, 220, 222, 224, 226, 228, 230, 232, 234, 235, 237, 238, 240, 241, 243, 244, + 245, 246, 248, 249, 250, 250, 251, 252, 253, 253, 254, 254, 254, 255, 255, 255, + 255, 255, 255, 255, 254, 254, 254, 253, 253, 252, 251, 250, 250, 249, 248, 246, + 245, 244, 243, 241, 240, 238, 237, 235, 234, 232, 230, 228, 226, 224, 222, 220, + 218, 215, 213, 211, 208, 206, 203, 201, 198, 196, 193, 190, 188, 185, 182, 179, + 176, 173, 170, 167, 165, 162, 158, 155, 152, 149, 146, 143, 140, 137, 134, 131, + 128, 124, 121, 118, 115, 112, 109, 106, 103, 100, 97, 93, 90, 88, 85, 82, + 79, 76, 73, 70, 67, 65, 62, 59, 57, 54, 52, 49, 47, 44, 42, 40, + 37, 35, 33, 31, 29, 27, 25, 23, 21, 20, 18, 17, 15, 14, 12, 11, + 10, 9, 7, 6, 5, 5, 4, 3, 2, 2, 1, 1, 1, 0, 0, 0 }; -const uint8_t RGBLED_BREATHING_TABLE[] PROGMEM = {0,0,0,0,1,1,1,2,2,3,4,5,5,6,7,9,10,11,12,14,15,17,18,20,21,23,25,27,29,31,33,35,37,40,42,44,47,49,52,54,57,59,62,65,67,70,73,76,79,82,85,88,90,93,97,100,103,106,109,112,115,118,121,124,127,131,134,137,140,143,146,149,152,155,158,162,165,167,170,173,176,179,182,185,188,190,193,196,198,201,203,206,208,211,213,215,218,220,222,224,226,228,230,232,234,235,237,238,240,241,243,244,245,246,248,249,250,250,251,252,253,253,254,254,254,255,255,255,255,255,255,255,254,254,254,253,253,252,251,250,250,249,248,246,245,244,243,241,240,238,237,235,234,232,230,228,226,224,222,220,218,215,213,211,208,206,203,201,198,196,193,190,188,185,182,179,176,173,170,167,165,162,158,155,152,149,146,143,140,137,134,131,128,124,121,118,115,112,109,106,103,100,97,93,90,88,85,82,79,76,73,70,67,65,62,59,57,54,52,49,47,44,42,40,37,35,33,31,29,27,25,23,21,20,18,17,15,14,12,11,10,9,7,6,5,5,4,3,2,2,1,1,1,0,0,0}; const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30}; const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; @@ -38,62 +55,56 @@ uint8_t rgblight_inited = 0; void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) { - /* convert hue, saturation and brightness ( HSB/HSV ) to RGB - The DIM_CURVE is used only on brightness/value and on saturation (inverted). - This looks the most natural. - */ + /* Convert hue, saturation and brightness ( HSB/HSV ) to RGB. The DIM_CURVE is + used only on brightness/value and on saturation (inverted). This looks the + most natural. */ uint8_t r = 0, g = 0, b = 0; val = pgm_read_byte(&DIM_CURVE[val]); - sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); - - uint8_t base; - - if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. - r = val; - g = val; - b = val; - } else { - base = ((255 - sat) * val) >> 8; - - switch (hue / 60) { - case 0: - r = val; - g = (((val - base)*hue) / 60) + base; - b = base; - break; - - case 1: - r = (((val - base)*(60 - (hue % 60))) / 60) + base; - g = val; - b = base; - break; - - case 2: - r = base; - g = val; - b = (((val - base)*(hue % 60)) / 60) + base; - break; - - case 3: - r = base; - g = (((val - base)*(60 - (hue % 60))) / 60) + base; - b = val; - break; - - case 4: - r = (((val - base)*(hue % 60)) / 60) + base; - g = base; - b = val; - break; - - case 5: - r = val; - g = base; - b = (((val - base)*(60 - (hue % 60))) / 60) + base; - break; - } - } + sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); + + uint8_t base; + + if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. + r = val; + g = val; + b = val; + } else { + base = ((255 - sat) * val) >> 8; + + switch (hue / 60) { + case 0: + r = val; + g = (((val - base) * hue) / 60) + base; + b = base; + break; + case 1: + r = (((val - base) * (60 - (hue % 60))) / 60) + base; + g = val; + b = base; + break; + case 2: + r = base; + g = val; + b = (((val - base) * (hue % 60)) / 60) + base; + break; + case 3: + r = base; + g = (((val - base) * (60 - (hue % 60))) / 60) + base; + b = val; + break; + case 4: + r = (((val - base) * (hue % 60)) / 60) + base; + g = base; + b = val; + break; + case 5: + r = val; + g = base; + b = (((val - base) * (60 - (hue % 60))) / 60) + base; + break; + } + } setrgb(r,g,b, led1); } @@ -111,44 +122,44 @@ void eeconfig_update_rgblight(uint32_t val) { eeprom_update_dword(EECONFIG_RGBLIGHT, val); } void eeconfig_update_rgblight_default(void) { - dprintf("eeconfig_update_rgblight_default\n"); - rgblight_config.enable = 1; - rgblight_config.mode = 1; - rgblight_config.hue = 200; - rgblight_config.sat = 204; - rgblight_config.val = 204; - eeconfig_update_rgblight(rgblight_config.raw); + dprintf("eeconfig_update_rgblight_default\n"); + rgblight_config.enable = 1; + rgblight_config.mode = 1; + rgblight_config.hue = 200; + rgblight_config.sat = 204; + rgblight_config.val = 204; + eeconfig_update_rgblight(rgblight_config.raw); } void eeconfig_debug_rgblight(void) { - dprintf("rgblight_config eprom\n"); - dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); - dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); - dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); - dprintf("rgblight_config.sat = %d\n", rgblight_config.sat); - dprintf("rgblight_config.val = %d\n", rgblight_config.val); + dprintf("rgblight_config eprom\n"); + dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); + dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); + dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); + dprintf("rgblight_config.sat = %d\n", rgblight_config.sat); + dprintf("rgblight_config.val = %d\n", rgblight_config.val); } void rgblight_init(void) { debug_enable = 1; // Debug ON! - dprintf("rgblight_init called.\n"); + dprintf("rgblight_init called.\n"); rgblight_inited = 1; - dprintf("rgblight_init start!\n"); + dprintf("rgblight_init start!\n"); if (!eeconfig_is_enabled()) { - dprintf("rgblight_init eeconfig is not enabled.\n"); + dprintf("rgblight_init eeconfig is not enabled.\n"); eeconfig_init(); - eeconfig_update_rgblight_default(); + eeconfig_update_rgblight_default(); } rgblight_config.raw = eeconfig_read_rgblight(); - if (!rgblight_config.mode) { - dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); - eeconfig_update_rgblight_default(); - rgblight_config.raw = eeconfig_read_rgblight(); - } - eeconfig_debug_rgblight(); // display current eeprom values + if (!rgblight_config.mode) { + dprintf("rgblight_init rgblight_config.mode = 0. Write default values to EEPROM.\n"); + eeconfig_update_rgblight_default(); + rgblight_config.raw = eeconfig_read_rgblight(); + } + eeconfig_debug_rgblight(); // display current eeprom values - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) - rgblight_timer_init(); // setup the timer - #endif + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_init(); // setup the timer + #endif if (rgblight_config.enable) { rgblight_mode(rgblight_config.mode); @@ -156,58 +167,57 @@ void rgblight_init(void) { } void rgblight_increase(void) { - uint8_t mode = 0; + uint8_t mode = 0; if (rgblight_config.mode < RGBLIGHT_MODES) { mode = rgblight_config.mode + 1; } - rgblight_mode(mode); + rgblight_mode(mode); } - void rgblight_decrease(void) { - uint8_t mode = 0; - if (rgblight_config.mode > 1) { //mode will never < 1, if mode is less than 1, eeprom need to be initialized. - mode = rgblight_config.mode-1; + uint8_t mode = 0; + // Mode will never be < 1. If it ever is, eeprom needs to be initialized. + if (rgblight_config.mode > 1) { + mode = rgblight_config.mode - 1; } - rgblight_mode(mode); + rgblight_mode(mode); } - void rgblight_step(void) { - uint8_t mode = 0; + uint8_t mode = 0; mode = rgblight_config.mode + 1; if (mode > RGBLIGHT_MODES) { mode = 1; } - rgblight_mode(mode); + rgblight_mode(mode); } void rgblight_mode(uint8_t mode) { - if (!rgblight_config.enable) { - return; - } - if (mode<1) { - rgblight_config.mode = 1; - } else if (mode > RGBLIGHT_MODES) { - rgblight_config.mode = RGBLIGHT_MODES; - } else { - rgblight_config.mode = mode; - } + if (!rgblight_config.enable) { + return; + } + if (mode < 1) { + rgblight_config.mode = 1; + } else if (mode > RGBLIGHT_MODES) { + rgblight_config.mode = RGBLIGHT_MODES; + } else { + rgblight_config.mode = mode; + } eeconfig_update_rgblight(rgblight_config.raw); xprintf("rgblight mode: %u\n", rgblight_config.mode); - if (rgblight_config.mode == 1) { - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) - rgblight_timer_disable(); - #endif - } else if (rgblight_config.mode >=2 && rgblight_config.mode <=23) { - // MODE 2-5, breathing - // MODE 6-8, rainbow mood - // MODE 9-14, rainbow swirl - // MODE 15-20, snake - // MODE 21-23, knight - - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) - rgblight_timer_enable(); - #endif - } + if (rgblight_config.mode == 1) { + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_disable(); + #endif + } else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) { + // MODE 2-5, breathing + // MODE 6-8, rainbow mood + // MODE 9-14, rainbow swirl + // MODE 15-20, snake + // MODE 21-23, knight + + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_enable(); + #endif + } rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } @@ -215,127 +225,125 @@ void rgblight_toggle(void) { rgblight_config.enable ^= 1; eeconfig_update_rgblight(rgblight_config.raw); xprintf("rgblight toggle: rgblight_config.enable = %u\n", rgblight_config.enable); - if (rgblight_config.enable) { - rgblight_mode(rgblight_config.mode); - } else { - - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) - rgblight_timer_disable(); - #endif - _delay_ms(50); - rgblight_set(); - } + if (rgblight_config.enable) { + rgblight_mode(rgblight_config.mode); + } else { + #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) + rgblight_timer_disable(); + #endif + _delay_ms(50); + rgblight_set(); + } } -void rgblight_increase_hue(void){ - uint16_t hue; +void rgblight_increase_hue(void) { + uint16_t hue; hue = (rgblight_config.hue+RGBLIGHT_HUE_STEP) % 360; rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); } -void rgblight_decrease_hue(void){ - uint16_t hue; - if (rgblight_config.hue-RGBLIGHT_HUE_STEP <0 ) { - hue = (rgblight_config.hue+360-RGBLIGHT_HUE_STEP) % 360; - } else { - hue = (rgblight_config.hue-RGBLIGHT_HUE_STEP) % 360; - } +void rgblight_decrease_hue(void) { + uint16_t hue; + if (rgblight_config.hue-RGBLIGHT_HUE_STEP < 0) { + hue = (rgblight_config.hue + 360 - RGBLIGHT_HUE_STEP) % 360; + } else { + hue = (rgblight_config.hue - RGBLIGHT_HUE_STEP) % 360; + } rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); } void rgblight_increase_sat(void) { - uint8_t sat; + uint8_t sat; if (rgblight_config.sat + RGBLIGHT_SAT_STEP > 255) { sat = 255; } else { - sat = rgblight_config.sat+RGBLIGHT_SAT_STEP; + sat = rgblight_config.sat + RGBLIGHT_SAT_STEP; } rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); } -void rgblight_decrease_sat(void){ - uint8_t sat; +void rgblight_decrease_sat(void) { + uint8_t sat; if (rgblight_config.sat - RGBLIGHT_SAT_STEP < 0) { sat = 0; } else { - sat = rgblight_config.sat-RGBLIGHT_SAT_STEP; + sat = rgblight_config.sat - RGBLIGHT_SAT_STEP; } rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); } -void rgblight_increase_val(void){ - uint8_t val; +void rgblight_increase_val(void) { + uint8_t val; if (rgblight_config.val + RGBLIGHT_VAL_STEP > 255) { val = 255; } else { - val = rgblight_config.val+RGBLIGHT_VAL_STEP; + val = rgblight_config.val + RGBLIGHT_VAL_STEP; } rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); } void rgblight_decrease_val(void) { - uint8_t val; + uint8_t val; if (rgblight_config.val - RGBLIGHT_VAL_STEP < 0) { val = 0; } else { - val = rgblight_config.val-RGBLIGHT_VAL_STEP; + val = rgblight_config.val - RGBLIGHT_VAL_STEP; } rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); } -void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val){ - inmem_config.raw = rgblight_config.raw; +void rgblight_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { + inmem_config.raw = rgblight_config.raw; if (rgblight_config.enable) { struct cRGB tmp_led; sethsv(hue, sat, val, &tmp_led); - inmem_config.hue = hue; - inmem_config.sat = sat; - inmem_config.val = val; + inmem_config.hue = hue; + inmem_config.sat = sat; + inmem_config.val = val; // dprintf("rgblight set hue [MEMORY]: %u,%u,%u\n", inmem_config.hue, inmem_config.sat, inmem_config.val); rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); } } -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val){ +void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { if (rgblight_config.enable) { - if (rgblight_config.mode == 1) { - // same static color - rgblight_sethsv_noeeprom(hue, sat, val); - } else { - // all LEDs in same color - if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { - // breathing mode, ignore the change of val, use in memory value instead - val = rgblight_config.val; - } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { - // rainbow mood and rainbow swirl, ignore the change of hue - hue = rgblight_config.hue; - } - } - rgblight_config.hue = hue; - rgblight_config.sat = sat; - rgblight_config.val = val; - eeconfig_update_rgblight(rgblight_config.raw); - xprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); - } -} - -void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b){ + if (rgblight_config.mode == 1) { + // same static color + rgblight_sethsv_noeeprom(hue, sat, val); + } else { + // all LEDs in same color + if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { + // breathing mode, ignore the change of val, use in memory value instead + val = rgblight_config.val; + } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { + // rainbow mood and rainbow swirl, ignore the change of hue + hue = rgblight_config.hue; + } + } + rgblight_config.hue = hue; + rgblight_config.sat = sat; + rgblight_config.val = val; + eeconfig_update_rgblight(rgblight_config.raw); + xprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + } +} + +void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) { // dprintf("rgblight set rgb: %u,%u,%u\n", r,g,b); - for (uint8_t i=0;i>8)&0xff; - OCR3AL = RGBLED_TIMER_TOP&0xff; - SREG = sreg; + static uint8_t rgblight_timer_is_init = 0; + if (rgblight_timer_is_init) { + return; + } + rgblight_timer_is_init = 1; + /* Timer 3 setup */ + TCCR3B = _BV(WGM32) //CTC mode OCR3A as TOP + | _BV(CS30); //Clock selelct: clk/1 + /* Set TOP value */ + uint8_t sreg = SREG; + cli(); + OCR3AH = (RGBLED_TIMER_TOP >> 8) & 0xff; + OCR3AL = RGBLED_TIMER_TOP & 0xff; + SREG = sreg; } void rgblight_timer_enable(void) { - TIMSK3 |= _BV(OCIE3A); - dprintf("TIMER3 enabled.\n"); + TIMSK3 |= _BV(OCIE3A); + dprintf("TIMER3 enabled.\n"); } void rgblight_timer_disable(void) { - TIMSK3 &= ~_BV(OCIE3A); - dprintf("TIMER3 disabled.\n"); + TIMSK3 &= ~_BV(OCIE3A); + dprintf("TIMER3 disabled.\n"); } void rgblight_timer_toggle(void) { - TIMSK3 ^= _BV(OCIE3A); - dprintf("TIMER3 toggled.\n"); + TIMSK3 ^= _BV(OCIE3A); + dprintf("TIMER3 toggled.\n"); } ISR(TIMER3_COMPA_vect) { - // Mode = 1, static light, do nothing here - if (rgblight_config.mode>=2 && rgblight_config.mode<=5) { - // mode = 2 to 5, breathing mode - rgblight_effect_breathing(rgblight_config.mode-2); - - } else if (rgblight_config.mode>=6 && rgblight_config.mode<=8) { - rgblight_effect_rainbow_mood(rgblight_config.mode-6); - } else if (rgblight_config.mode>=9 && rgblight_config.mode<=14) { - rgblight_effect_rainbow_swirl(rgblight_config.mode-9); - } else if (rgblight_config.mode>=15 && rgblight_config.mode<=20) { - rgblight_effect_snake(rgblight_config.mode-15); - } else if (rgblight_config.mode>=21 && rgblight_config.mode<=23) { - rgblight_effect_knight(rgblight_config.mode-21); - } -} - -// effects + // mode = 1, static light, do nothing here + if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { + // mode = 2 to 5, breathing mode + rgblight_effect_breathing(rgblight_config.mode - 2); + } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 8) { + // mode = 6 to 8, rainbow mood mod + rgblight_effect_rainbow_mood(rgblight_config.mode - 6); + } else if (rgblight_config.mode >= 9 && rgblight_config.mode <= 14) { + // mode = 9 to 14, rainbow swirl mode + rgblight_effect_rainbow_swirl(rgblight_config.mode - 9); + } else if (rgblight_config.mode >= 15 && rgblight_config.mode <= 20) { + // mode = 15 to 20, snake mode + rgblight_effect_snake(rgblight_config.mode - 15); + } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { + // mode = 21 to 23, knight mode + rgblight_effect_knight(rgblight_config.mode - 21); + } +} + +// Effects void rgblight_effect_breathing(uint8_t interval) { - static uint8_t pos = 0; - static uint16_t last_timer = 0; + static uint8_t pos = 0; + static uint16_t last_timer = 0; - if (timer_elapsed(last_timer)=RGBLED_NUM) k=RGBLED_NUM-1; - if (i==k) { - sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, &preled[i]); - } - } - } - if (RGBLIGHT_EFFECT_KNIGHT_OFFSET) { - for (i=0;iRGBLED_NUM+RGBLIGHT_EFFECT_KNIGHT_LENGTH) { - pos = RGBLED_NUM+RGBLIGHT_EFFECT_KNIGHT_LENGTH-1; - increament = 1; - } else { - pos += 1; - } - } - -} - -#endif \ No newline at end of file + static int8_t pos = 0; + static uint16_t last_timer = 0; + uint8_t i, j, cur; + int8_t k; + struct cRGB preled[RGBLED_NUM]; + static int8_t increament = -1; + if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval])) { + return; + } + last_timer = timer_read(); + for (i = 0; i < RGBLED_NUM; i++) { + preled[i].r = 0; + preled[i].g = 0; + preled[i].b = 0; + for (j = 0; j < RGBLIGHT_EFFECT_KNIGHT_LENGTH; j++) { + k = pos + j * increament; + if (k < 0) { + k = 0; + } + if (k >= RGBLED_NUM) { + k = RGBLED_NUM - 1; + } + if (i == k) { + sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, &preled[i]); + } + } + } + if (RGBLIGHT_EFFECT_KNIGHT_OFFSET) { + for (i = 0; i < RGBLED_NUM; i++) { + cur = (i + RGBLIGHT_EFFECT_KNIGHT_OFFSET) % RGBLED_NUM; + led[i].r = preled[cur].r; + led[i].g = preled[cur].g; + led[i].b = preled[cur].b; + } + } + rgblight_set(); + if (increament == 1) { + if (pos - 1 < 0 - RGBLIGHT_EFFECT_KNIGHT_LENGTH) { + pos = 0 - RGBLIGHT_EFFECT_KNIGHT_LENGTH; + increament = -1; + } else { + pos -= 1; + } + } else { + if (pos + 1 > RGBLED_NUM + RGBLIGHT_EFFECT_KNIGHT_LENGTH) { + pos = RGBLED_NUM + RGBLIGHT_EFFECT_KNIGHT_LENGTH - 1; + increament = 1; + } else { + pos += 1; + } + } +} + +#endif -- cgit v1.2.3-24-g4f1b From 899c88cd8bf024792760fcf3ee8be6fed13fb315 Mon Sep 17 00:00:00 2001 From: Jordi Orlando <0xdec@users.noreply.github.com> Date: Tue, 26 Jul 2016 14:46:30 -0500 Subject: Increament -> increment --- quantum/rgblight.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 1b3c576d1..c2841b851 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -453,9 +453,9 @@ void rgblight_effect_snake(uint8_t interval) { static uint16_t last_timer = 0; uint8_t i, j; int8_t k; - int8_t increament = 1; + int8_t increment = 1; if (interval % 2) { - increament = -1; + increment = -1; } if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_SNAKE_INTERVALS[interval / 2])) { return; @@ -466,7 +466,7 @@ void rgblight_effect_snake(uint8_t interval) { led[i].g = 0; led[i].b = 0; for (j = 0; j < RGBLIGHT_EFFECT_SNAKE_LENGTH; j++) { - k = pos + j * increament; + k = pos + j * increment; if (k < 0) { k = k + RGBLED_NUM; } @@ -476,7 +476,7 @@ void rgblight_effect_snake(uint8_t interval) { } } rgblight_set(); - if (increament == 1) { + if (increment == 1) { if (pos - 1 < 0) { pos = RGBLED_NUM - 1; } else { @@ -492,7 +492,7 @@ void rgblight_effect_knight(uint8_t interval) { uint8_t i, j, cur; int8_t k; struct cRGB preled[RGBLED_NUM]; - static int8_t increament = -1; + static int8_t increment = -1; if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval])) { return; } @@ -502,7 +502,7 @@ void rgblight_effect_knight(uint8_t interval) { preled[i].g = 0; preled[i].b = 0; for (j = 0; j < RGBLIGHT_EFFECT_KNIGHT_LENGTH; j++) { - k = pos + j * increament; + k = pos + j * increment; if (k < 0) { k = 0; } @@ -523,17 +523,17 @@ void rgblight_effect_knight(uint8_t interval) { } } rgblight_set(); - if (increament == 1) { + if (increment == 1) { if (pos - 1 < 0 - RGBLIGHT_EFFECT_KNIGHT_LENGTH) { pos = 0 - RGBLIGHT_EFFECT_KNIGHT_LENGTH; - increament = -1; + increment = -1; } else { pos -= 1; } } else { if (pos + 1 > RGBLED_NUM + RGBLIGHT_EFFECT_KNIGHT_LENGTH) { pos = RGBLED_NUM + RGBLIGHT_EFFECT_KNIGHT_LENGTH - 1; - increament = 1; + increment = 1; } else { pos += 1; } -- cgit v1.2.3-24-g4f1b From b66131eeb5774ab0406bfb332e784b5691233b97 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Tue, 26 Jul 2016 15:59:26 -0400 Subject: disable midi by default --- keyboards/planck/keymaps/default/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/planck/keymaps/default/Makefile b/keyboards/planck/keymaps/default/Makefile index 38a504a27..0f4953888 100644 --- a/keyboards/planck/keymaps/default/Makefile +++ b/keyboards/planck/keymaps/default/Makefile @@ -11,7 +11,7 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = yes # MIDI controls +MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID @@ -22,4 +22,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif -- cgit v1.2.3-24-g4f1b From ea2d2f5d5841791745c93ef27cd1528a7fd69c97 Mon Sep 17 00:00:00 2001 From: Jordi Orlando <0xdec@users.noreply.github.com> Date: Tue, 26 Jul 2016 15:31:22 -0500 Subject: Simplify HSV->RGB calculation De-dupe repeated code --- quantum/rgblight.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index c2841b851..f82e3ec55 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -55,57 +55,56 @@ uint8_t rgblight_inited = 0; void sethsv(uint16_t hue, uint8_t sat, uint8_t val, struct cRGB *led1) { - /* Convert hue, saturation and brightness ( HSB/HSV ) to RGB. The DIM_CURVE is - used only on brightness/value and on saturation (inverted). This looks the - most natural. */ - uint8_t r = 0, g = 0, b = 0; + // Convert hue, saturation, and value (HSV/HSB) to RGB. DIM_CURVE is used only + // on value and saturation (inverted). This looks the most natural. + uint8_t r = 0, g = 0, b = 0, base, color; val = pgm_read_byte(&DIM_CURVE[val]); sat = 255 - pgm_read_byte(&DIM_CURVE[255 - sat]); - uint8_t base; - if (sat == 0) { // Acromatic color (gray). Hue doesn't mind. r = val; g = val; b = val; } else { base = ((255 - sat) * val) >> 8; + color = (val - base) * (hue % 60) / 60; switch (hue / 60) { case 0: r = val; - g = (((val - base) * hue) / 60) + base; + g = base + color; b = base; break; case 1: - r = (((val - base) * (60 - (hue % 60))) / 60) + base; + r = val - color; g = val; b = base; break; case 2: r = base; g = val; - b = (((val - base) * (hue % 60)) / 60) + base; + b = base + color; break; case 3: r = base; - g = (((val - base) * (60 - (hue % 60))) / 60) + base; + g = val - color; b = val; break; case 4: - r = (((val - base) * (hue % 60)) / 60) + base; + r = base + color; g = base; b = val; break; case 5: r = val; g = base; - b = (((val - base) * (60 - (hue % 60))) / 60) + base; + b = val - color; break; } } - setrgb(r,g,b, led1); + + setrgb(r, g, b, led1); } void setrgb(uint8_t r, uint8_t g, uint8_t b, struct cRGB *led1) { @@ -346,7 +345,6 @@ void rgblight_set(void) { } } - #if !defined(AUDIO_ENABLE) && defined(RGBLIGHT_TIMER) // Animation timer -- AVR Timer3 -- cgit v1.2.3-24-g4f1b From 7e69de061ae63e356b31b656f18a205199f556ed Mon Sep 17 00:00:00 2001 From: Michael Klos Date: Tue, 26 Jul 2016 18:41:35 -0400 Subject: Added Tap Dance Example Added (simple) Tap Dance example implementation steps. --- readme.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index affee1b62..3854f4b8d 100644 --- a/readme.md +++ b/readme.md @@ -409,7 +409,32 @@ Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-danc For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros. -In the end, let's see a full example! +#### Examples + +Here's a simple example for a single definition: + +1. In your `makefile`, add `TAP_DANCE_ENABLE = yes` +2. In your `config.h` (which you can copy from `qmk_firmware/keyboards/planck/config.h` to your keymap directory), add `#define TAPPING_TERM 200` +3. In your `keymap.c` file, define the variables and definitions, then add to your keymap: + +```c +//Tap Dance Declarations +enum { + TD_ESC_CAPS = 0 +}; + +//Tap Dance Definitions +const qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Esc, twice for Caps Lock + [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) +// Other declarations would go here, separated by commas, if you have them +}; + +//In Layer declaration, add tap dance item in place of a key code +TD(TD_ESC_CAPS) +``` + +Here's a more complex example involving custom actions: ```c enum { -- cgit v1.2.3-24-g4f1b From 3fd1c9d72b71075504fab4b46dc295780d774258 Mon Sep 17 00:00:00 2001 From: Mazin Bokhari Date: Tue, 26 Jul 2016 22:43:04 -0500 Subject: Move to keyboards --- keyboard/ergodox_ez/keymaps/maz/keymap.c | 229 ----------------------------- keyboard/ergodox_ez/keymaps/maz/readme.md | 121 --------------- keyboards/ergodox_ez/keymaps/maz/keymap.c | 229 +++++++++++++++++++++++++++++ keyboards/ergodox_ez/keymaps/maz/readme.md | 121 +++++++++++++++ 4 files changed, 350 insertions(+), 350 deletions(-) delete mode 100644 keyboard/ergodox_ez/keymaps/maz/keymap.c delete mode 100644 keyboard/ergodox_ez/keymaps/maz/readme.md create mode 100644 keyboards/ergodox_ez/keymaps/maz/keymap.c create mode 100644 keyboards/ergodox_ez/keymaps/maz/readme.md diff --git a/keyboard/ergodox_ez/keymaps/maz/keymap.c b/keyboard/ergodox_ez/keymaps/maz/keymap.c deleted file mode 100644 index 7b8f0df74..000000000 --- a/keyboard/ergodox_ez/keymaps/maz/keymap.c +++ /dev/null @@ -1,229 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define ARRW 2 // arrow keys -#define MDIA 3 // media keys, including mouse - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | Space| Bksp |------| |------| Tab |Enter | - * | ctrl | gui | Alt | | Alt | gui | ctrl | - * `--------------------' `----------------------' - */ - // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue - // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_TRNS, KC_GRV, KC_TRNS,MO(SYMB),MO(ARRW), - KC_TRNS, KC_TRNS, - KC_TRNS, - CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, - // right hand - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_CAPSLOCK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_DOT, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_TRNS, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Arrow keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | |PGDOWN| PGUP | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | HOME | END | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[ARRW] = KEYMAP( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_PGDOWN, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 3: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |Mute |VolDn | VolUp| | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | Prev | Play | Next | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * |Brwser| | | | | | | - * |Back | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_WBAK, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboard/ergodox_ez/keymaps/maz/readme.md b/keyboard/ergodox_ez/keymaps/maz/readme.md deleted file mode 100644 index 000a8d000..000000000 --- a/keyboard/ergodox_ez/keymaps/maz/readme.md +++ /dev/null @@ -1,121 +0,0 @@ -# Introduction - -## Motivation -I created this keymap in an attempt to optimize my typing experience in text editors (vim and emacs) and the command-line. - -More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. - -## Changes -There are some miscellaneous changes that I kind of forgot I made, such as moving the tilde key, but you can check out the visual layouts below, which I **have** kept up to date. -### Modifier Keys -The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. You must hold each key down for a certain amount of time (forgot where this is specified) in order for the modifier key to activate. - -### Layers -* an arrow layer (ARRW) has been created because the default arrow keys suck. Beware, these do use vim bindings because they're the best. -* the keys in the media layer have been moved around for a better experience (imo), especially with respect to the mouse -* the three layers (SYMB, MDIA, and ARRW) now have their own dedicated keys accessible by the thumbs in the basic layer -* caps lock has been put in place of the right-side `L1` toggle key because there was really no need to have two keys to toggle one layer, and caps lock is useful when writing queries -** unfortunatley, caps lock is not indicated by an LED, so be careful. I use caps lock just like I do insert in vim; for a short burst of text. I always turn off caps lock when I change my focus - -### Removal Of Keys -I also removed a bunch of unnecessary keys that I wasn't going to use anyway. You'll see such keys are blank in the basic layer. I will probably add some more keys in place of these, but I'm fine for now; I just didn't want the distraction of extra keys I barely use. - -## Caveats -### Thumb Cluster Range -I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: -* I use DCS keycaps with SA Row 3 keycaps where the Alt keys are -* I have relatively large hands (I guarantee you there's no problem - I guarantee you) - -### Dangerous positioning -I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtations in which disaster could occur with one fell swoop of a keypress. - -# Keymap -## Keymap 0: Basic layer -``` -,--------------------------------------------------. ,--------------------------------------------------. -| = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | -|--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| -| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+--------+------. - | | | | | | | | - | Space| Bksp |------| |------| Tab |Enter | - | ctrl | gui | Alt | | Alt | gui | ctrl | - `--------------------' `----------------------' - -``` - -## Keymap 1: Symbol Layer -The only change here is the *dot* (`.`) character moving from next to `0` next to `+` in order to move the layer keys in the correct position -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | 0 | = | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Keymap 2: Arrow Layer -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | | | | | | | | | | | | | | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | | | | | | | | | |PGDOWN| PGUP | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | | | | | | HOME | END | | | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Keymap 3: Media and mouse keys -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | | | | | | | | | | | | | | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | | | MsUp | | | | | | | | | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | |Mute |VolDn | VolUp| | | | | | | | | | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | Prev | Play | Next | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - |Brwser| | | | | | | - |Back | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` diff --git a/keyboards/ergodox_ez/keymaps/maz/keymap.c b/keyboards/ergodox_ez/keymaps/maz/keymap.c new file mode 100644 index 000000000..7b8f0df74 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/maz/keymap.c @@ -0,0 +1,229 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define ARRW 2 // arrow keys +#define MDIA 3 // media keys, including mouse + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+--------+------. + * | | | | | | | | + * | Space| Bksp |------| |------| Tab |Enter | + * | ctrl | gui | Alt | | Alt | gui | ctrl | + * `--------------------' `----------------------' + */ + // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue + // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_TRNS, KC_GRV, KC_TRNS,MO(SYMB),MO(ARRW), + KC_TRNS, KC_TRNS, + KC_TRNS, + CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, + // right hand + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_CAPSLOCK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_DOT, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Arrow keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | |PGDOWN| PGUP | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | HOME | END | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[ARRW] = KEYMAP( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_PGDOWN, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 3: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |Mute |VolDn | VolUp| | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | Prev | Play | Next | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * |Brwser| | | | | | | + * |Back | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_WBAK, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox_ez/keymaps/maz/readme.md b/keyboards/ergodox_ez/keymaps/maz/readme.md new file mode 100644 index 000000000..000a8d000 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/maz/readme.md @@ -0,0 +1,121 @@ +# Introduction + +## Motivation +I created this keymap in an attempt to optimize my typing experience in text editors (vim and emacs) and the command-line. + +More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. + +## Changes +There are some miscellaneous changes that I kind of forgot I made, such as moving the tilde key, but you can check out the visual layouts below, which I **have** kept up to date. +### Modifier Keys +The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. You must hold each key down for a certain amount of time (forgot where this is specified) in order for the modifier key to activate. + +### Layers +* an arrow layer (ARRW) has been created because the default arrow keys suck. Beware, these do use vim bindings because they're the best. +* the keys in the media layer have been moved around for a better experience (imo), especially with respect to the mouse +* the three layers (SYMB, MDIA, and ARRW) now have their own dedicated keys accessible by the thumbs in the basic layer +* caps lock has been put in place of the right-side `L1` toggle key because there was really no need to have two keys to toggle one layer, and caps lock is useful when writing queries +** unfortunatley, caps lock is not indicated by an LED, so be careful. I use caps lock just like I do insert in vim; for a short burst of text. I always turn off caps lock when I change my focus + +### Removal Of Keys +I also removed a bunch of unnecessary keys that I wasn't going to use anyway. You'll see such keys are blank in the basic layer. I will probably add some more keys in place of these, but I'm fine for now; I just didn't want the distraction of extra keys I barely use. + +## Caveats +### Thumb Cluster Range +I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: +* I use DCS keycaps with SA Row 3 keycaps where the Alt keys are +* I have relatively large hands (I guarantee you there's no problem - I guarantee you) + +### Dangerous positioning +I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtations in which disaster could occur with one fell swoop of a keypress. + +# Keymap +## Keymap 0: Basic layer +``` +,--------------------------------------------------. ,--------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | +|--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| +| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+--------+------. + | | | | | | | | + | Space| Bksp |------| |------| Tab |Enter | + | ctrl | gui | Alt | | Alt | gui | ctrl | + `--------------------' `----------------------' + +``` + +## Keymap 1: Symbol Layer +The only change here is the *dot* (`.`) character moving from next to `0` next to `+` in order to move the layer keys in the correct position +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | 0 | = | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Keymap 2: Arrow Layer +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | | | | | | | | | | | | | | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | | | | | | | | |PGDOWN| PGUP | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | | | | | | HOME | END | | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Keymap 3: Media and mouse keys +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | | | | | | | | | | | | | | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | | MsUp | | | | | | | | | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | |Mute |VolDn | VolUp| | | | | | | | | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | Prev | Play | Next | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + |Brwser| | | | | | | + |Back | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` -- cgit v1.2.3-24-g4f1b From fdd07991def0fc54a41ccc9085d11255d8b63fcb Mon Sep 17 00:00:00 2001 From: SmackleFunky Date: Wed, 27 Jul 2016 04:44:24 +0000 Subject: Allow toggling out of plover layer --- keyboards/ergodox_ez/keymaps/plover/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/plover/keymap.c b/keyboards/ergodox_ez/keymaps/plover/keymap.c index a991e6082..8a58a37f6 100644 --- a/keyboards/ergodox_ez/keymaps/plover/keymap.c +++ b/keyboards/ergodox_ez/keymaps/plover/keymap.c @@ -160,7 +160,7 @@ KEYMAP( [PLVR] = KEYMAP( // layout: layer 4: Steno for Plover // left hand KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, @@ -169,7 +169,7 @@ KEYMAP( KC_C, KC_V, KC_NO, // right hand KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, -- cgit v1.2.3-24-g4f1b From 13bb3a73798da4c0f4ddc9cb644c1cd82f7fc8c1 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Wed, 27 Jul 2016 02:06:19 -0400 Subject: update NO_AMP to NO_AMPR --- keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c b/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c index 3b74d266f..a909ed3a4 100644 --- a/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c +++ b/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { NO_COLN, KC_A, KC_R, KC_S, KC_T, KC_D, KC_EXLM, KC_Z, KC_X, KC_C, KC_V, KC_B, NO_SCLN, MO(4), KC_BTN1, KC_BTN2, KC_TAB,GUI_T(KC_COMMA), - NO_AMP, NO_PIPE, + NO_AMPR, NO_PIPE, NO_PLUS, KC_FN1,CTL_T(KC_DOT),ALT_T(NO_MINS), // right hand -- cgit v1.2.3-24-g4f1b From 368d0bdf685b1b77f7dbcc8bb5769ccaed7f2d21 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Wed, 27 Jul 2016 02:21:09 -0400 Subject: kill warnings filling up travis buildlog --- keyboards/satan/keymaps/stanleylai/config.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/keyboards/satan/keymaps/stanleylai/config.h b/keyboards/satan/keymaps/stanleylai/config.h index ae2bd36db..7f4bb441c 100644 --- a/keyboards/satan/keymaps/stanleylai/config.h +++ b/keyboards/satan/keymaps/stanleylai/config.h @@ -1,20 +1,15 @@ #include "../../config.h" -// USB Device descriptor parameter -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0003 -#define MANUFACTURER Custom -#define PRODUCT GH60 rev.CHN -#define DESCRIPTION QMK keyboard firmware for GH60 with WS2812 support - // Backlight configuration +#undef BACKLIGHT_LEVELS #define BACKLIGHT_LEVELS 3 // Underlight configuration -#define RGB_DI_PIN E2 -#define RGBLIGHT_TIMER +#undef RGBLED_NUM #define RGBLED_NUM 6 // Number of LEDs +#undef RGBLIGHT_HUE_STEP #define RGBLIGHT_HUE_STEP 8 +#undef RGBLIGHT_SAT_STEP #define RGBLIGHT_SAT_STEP 8 +#undef RGBLIGHT_VAL_STEP #define RGBLIGHT_VAL_STEP 8 -- cgit v1.2.3-24-g4f1b From 95ef3f864eb1cbffe8a9151d9d3a09522f12000a Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Wed, 27 Jul 2016 02:30:17 -0400 Subject: fix numerous errors in bone2planck keymap --- keyboards/planck/keymaps/bone2planck/keymap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c index ceb556425..8d5e6dcc5 100644 --- a/keyboards/planck/keymaps/bone2planck/keymap.c +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -1,12 +1,12 @@ - -#include "planck.h" +#include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif -#include "..\..\..\..\quantum\keymap_extras\keymap_german.h" -#include "..\..\..\..\quantum\keymap_common.h" -#include "..\..\..\..\tmk_core\common\keycode.h" -#define _______ = KC_TRNS; +#include "keymap_german.h" +//#include "..\..\..\..\quantum\keymap_common.h" +//#include "..\..\..\..\tmk_core\common\keycode.h" + +#define _______ KC_TRNS /* This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout. It has "üäöß" as it is optimized for a mix of German & English. @@ -88,7 +88,7 @@ accessed by sliding from M2 to M3 with thumb */ [3] = { - { KC_NO, KC_NO, DE_7, DE_8 DE_9, KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO }, + { KC_NO, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO }, { _______, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ }, { _______, DE_0, DE_1, DE_2, DE_3, DE_SCLN, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, _______ }, { _______, _______, _______, _______, KC_NO, _______, _______, KC_NO, _______, _______, _______, _______ } @@ -112,7 +112,7 @@ slide from m4 to m5 to access flipped version { KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO }, { _______, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ }, { _______, _______, _______, _______, MO(5), _______, _______, MO(5), _______, _______, _______, _______ } -} +}, /* flipped Function & Media Keys @@ -128,8 +128,8 @@ slide from m4 to m5 to access flipped version */ [5] = { { KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO }, - { KC_NO, KC_SQ3, KC_F4, KC_F5, KC_F6, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO }, - { _______, KC_SQ2, KC_F1, KC_F2, KC_F3, KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, _______ }, + { KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO }, + { _______, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, _______ }, { _______, _______, _______, KC_NO, _______, _______, _______, _______, KC_NO, _______, _______, _______ } } }; -- cgit v1.2.3-24-g4f1b From 180a3da44dda89ca6d6e11972d5e9afe21119ed4 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Wed, 27 Jul 2016 02:32:15 -0400 Subject: remove unnecessary includes --- keyboards/planck/keymaps/bone2planck/keymap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/keyboards/planck/keymaps/bone2planck/keymap.c b/keyboards/planck/keymaps/bone2planck/keymap.c index 8d5e6dcc5..66cf9386d 100644 --- a/keyboards/planck/keymaps/bone2planck/keymap.c +++ b/keyboards/planck/keymaps/bone2planck/keymap.c @@ -3,8 +3,6 @@ #include "backlight.h" #endif #include "keymap_german.h" -//#include "..\..\..\..\quantum\keymap_common.h" -//#include "..\..\..\..\tmk_core\common\keycode.h" #define _______ KC_TRNS -- cgit v1.2.3-24-g4f1b From dd770547909ff0bbc391fbf38493cbd08285fb4c Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 27 Jul 2016 08:53:05 +0200 Subject: tmk_core/rules.mk: Make PRINT_ERROR* stop on error Instead of `&& false`, explicitly `exit 1` to make the rules using these macros fail. This fixes #571, and likely breaks Travis badly. Signed-off-by: Gergely Nagy --- tmk_core/rules.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index f13351ea1..2bf2a109f 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -60,9 +60,9 @@ TAB_LOG = printf "\n$$LOG\n\n" | $(AWK) '{ sub(/^/," | "); print }' TAB_LOG_PLAIN = printf "$$LOG\n" AWK_STATUS = $(AWK) '{ printf " %-10s\n", $$1; }' AWK_CMD = $(AWK) '{ printf "%-99s", $$0; }' -PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && false +PRINT_ERROR = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) && exit 1 PRINT_WARNING = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG) -PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && false && break +PRINT_ERROR_PLAIN = ($(SILENT) ||printf " $(ERROR_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) && exit 1 PRINT_WARNING_PLAIN = ($(SILENT) || printf " $(WARN_STRING)" | $(AWK_STATUS)) && $(TAB_LOG_PLAIN) PRINT_OK = $(SILENT) || printf " $(OK_STRING)" | $(AWK_STATUS) BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ "$$LOG" != "" ] ; then $(PRINT_WARNING); else $(PRINT_OK); fi; -- cgit v1.2.3-24-g4f1b From b21e8b97acb722bfa7b85831cfd010716ed77962 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 27 Jul 2016 08:42:09 +0200 Subject: tap-dance: Add some debugging support Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_tap_dance.c | 15 +++++++++++++++ quantum/process_keycode/process_tap_dance.h | 1 + 2 files changed, 16 insertions(+) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index d240dc2e6..5429e3438 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -1,6 +1,18 @@ #include "quantum.h" static qk_tap_dance_state_t qk_tap_dance_state; +bool td_debug_enable = false; + +#if CONSOLE_ENABLE +#define td_debug(s) if (td_debug_enable) \ + { \ + xprintf ("D:tap_dance:%s:%s = { keycode = %d, count = %d, active = %d, pressed = %d }\n", __FUNCTION__, s, \ + qk_tap_dance_state.keycode, qk_tap_dance_state.count, \ + qk_tap_dance_state.active, qk_tap_dance_state.pressed); \ + } +#else +#define td_debug(s) +#endif void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; @@ -33,16 +45,19 @@ static inline void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t action) { + td_debug("trigger"); _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_each_tap); } static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_action_t action) { + td_debug("trigger"); _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_dance_finished); } static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t action) { + td_debug("trigger") _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_reset); } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index e2c74efe9..6a1258067 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -49,6 +49,7 @@ typedef struct } extern const qk_tap_dance_action_t tap_dance_actions[]; +extern bool td_debug_enable; /* To be used internally */ -- cgit v1.2.3-24-g4f1b From 6ff8a8152035a32f6521d09d91594eeba269486d Mon Sep 17 00:00:00 2001 From: Toni Date: Wed, 27 Jul 2016 21:11:55 +0200 Subject: first try ar adding the parenthesis mess for german iso --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index 545cb1ab1..4bd990d37 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -32,25 +32,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, CTL_T(KC_ENT), \ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), SFT_T(KC_UP), \ KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, ALT_T(KC_LEFT), GUI_T(KC_DOWN), CTL_T(KC_RIGHT)), + /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) * ,-----------------------------------------------------------. * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete| * |-----------------------------------------------------------| - * | |Paus| Up| | | | | | | | | | | | + * | |Paus| Up| [ | ] | | | | ( | ) | | | | | * |-----------------------------------------------------------| * | |Lft|Dwn|Rgt| | | |Left|Down|Right|Up| | PLAY | * |-----------------------------------------------------------| - * | | | | | | |M0 | | | | | Vol+ | | + * | | | | < | > | |M0 | | { | } | | Vol+ | | * |-----------------------------------------------------------| * | | | | |Alt |Prev|Vol-|Next| * `-----------------------------------------------------------' */ [_SPC] = KEYMAP_ISO_SPLITRSHIFT( - KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_TRNS, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT,KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE,M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), + KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_PAUS, KC_UP, RALT(KC_8), RALT(KC_9), KC_TRNS, KC_TRNS, LSFT(KC_8), LSFT(KC_9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NUBS, LSFT(KC_NUBS), KC_SPACE,M(0), RALT(KC_7), RALT(KC_0), KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) * ,-----------------------------------------------------------. -- cgit v1.2.3-24-g4f1b From 9822b9f74348184706272fdc968f843bdab42cc2 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Wed, 27 Jul 2016 21:18:19 +0100 Subject: Added custom keymap. Added custom keymap. --- keyboards/planck/keymaps/callum/Makefile | 25 ++++++ keyboards/planck/keymaps/callum/keymap.c | 138 +++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 keyboards/planck/keymaps/callum/Makefile create mode 100644 keyboards/planck/keymaps/callum/keymap.c diff --git a/keyboards/planck/keymaps/callum/Makefile b/keyboards/planck/keymaps/callum/Makefile new file mode 100644 index 000000000..1d76966a6 --- /dev/null +++ b/keyboards/planck/keymaps/callum/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c new file mode 100644 index 000000000..a747dcb15 --- /dev/null +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -0,0 +1,138 @@ +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BASE 0 +#define _MOVE 1 +#define _SYMB 2 +#define _FUNC 3 + +enum planck_keycodes { + BASE = SAFE_RANGE, + MOVE, + SYMB, + FUNC +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BASE + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Bksp | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Func | GUI | Alt | Ctrl | Symb |Enter |Space | Move | GUI | Alt | Ctrl |Caps | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {FUNC, KC_LGUI, KC_LALT, KC_LCTL, SYMB, KC_ENT, KC_SPC, MOVE, KC_RGUI, KC_RALT, KC_RCTL, KC_CAPS} +}, + +/* MOVE + * ,-----------------------------------------------------------------------------------. + * | Esc | | Home | Up | End | | | Home | Up | End | | Esc | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | | Left | Down |Right | | | Left | Down |Right | | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | |Pg Up |Pg Dn | | |Pg Dn |Pg Up | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_MOVE] = { + {KC_ESC, _______, KC_HOME, KC_UP, KC_END, _______, _______, KC_HOME, KC_UP, KC_END, _______, KC_ESC}, + {KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_DEL}, + {_______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, KC_PGDN, KC_PGUP, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* SYMB + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Esc | + * |-----------------------------------------------------------------------------------. + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ~ | | | + | [ | { | } | ] | = | \ | ` | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_SYMB] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC }, + {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, KC_TILD, KC_PIPE, KC_PLUS, KC_LBRC, KC_LCBR, KC_RCBR, KC_RBRC, KC_EQL, KC_BSLS, KC_GRV, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* FUNC + * ,-----------------------------------------------------------------------------------. + * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * |-----------------------------------------------------------------------------------. + * | | Play | Prev | Next | BL+ | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Mute | Vol- | Vol+ | BL- | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | |Reset | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = { + {KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 }, + {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, _______, _______, _______, _______, _______}, + {_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET } +} + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MOVE: + if (record->event.pressed) { + layer_on(_MOVE); + update_tri_layer(_MOVE, _SYMB, _FUNC); + } else { + layer_off(_MOVE); + update_tri_layer(_MOVE, _SYMB, _FUNC); + } + return false; + break; + case SYMB: + if (record->event.pressed) { + layer_on(_SYMB); + update_tri_layer(_MOVE, _SYMB, _FUNC); + } else { + layer_off(_SYMB); + update_tri_layer(_MOVE, _SYMB, _FUNC); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + } + return true; +} -- cgit v1.2.3-24-g4f1b From 684d869fab8bf513b2939ea544068f115b9d7b85 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 28 Jul 2016 11:58:53 +0200 Subject: added homerow-ish brackets --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index 4bd990d37..7af7c14bd 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -21,7 +21,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return | * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP + * |Sft | < | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP * |-----------------------------------------------------------| * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is * `-----------------------------------------------------------' LEFT DWN RIGHT @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * | |Lft|Dwn|Rgt| | | |Left|Down|Right|Up| | PLAY | * |-----------------------------------------------------------| - * | | | | < | > | |M0 | | { | } | | Vol+ | | + * | | | | | < | > | |M0 | | { | } | | Vol+ | | * |-----------------------------------------------------------| * | | | | |Alt |Prev|Vol-|Next| * `-----------------------------------------------------------' @@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * | | | | | | | |Pos1|PgDn|PgUp|End| |Retrn | * |-----------------------------------------------------------| - * | | | | | | |AF2| | | | | PgUp | | + * | | | | | | | |AF2| | | | | PgUp | | * |-----------------------------------------------------------| * | | | | |Alt |Pos1|PgDn|End | * `-----------------------------------------------------------' @@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * | | L | L | | | | | 1 | 2 | 3 | | | Return | * |-----------------------------------------------------------| - * | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent + * | | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent * |-----------------------------------------------------------| LED controlling * |Ctrl|Win |Alt | |Alt |Left|Down|Right| * `-----------------------------------------------------------' -- cgit v1.2.3-24-g4f1b From 1eeceee355662305c5ceecb56a210628ddc723ec Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Thu, 28 Jul 2016 12:15:55 +0100 Subject: Added readme.md for custom layout. --- keyboards/planck/keymaps/callum/readme.md | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 keyboards/planck/keymaps/callum/readme.md diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md new file mode 100644 index 000000000..d4f3449f1 --- /dev/null +++ b/keyboards/planck/keymaps/callum/readme.md @@ -0,0 +1,48 @@ +# callum’s planck layout + +This is a layout for the grid planck, built with a few ideals in mind. These ideals are just my opinion mind! The great thing about *qmk* is that we can all afford to have different opinions about what makes a good layout: + +- Minimal response times should be maintained. i.e. keys that react differently depending on whether they are tapped or held, keys that react differently if they are double tapped, etc. should be avoided --- since they inevitably send their keycode later than a normal key, interrupting the immediate feedback from the screen. Therefore we restrict ourselves to chording. +- The hands should never need to leave the home position. The usual culprit for this is the arrow cluster, so the arrow cluster should be as close to home as possible. +- There should be two of every modifier (one on each side), since otherwise certain long key combinations become hard to make. +- Backspace should be in the “capslock position†as God intended. +- The keyboard should be usable without any firmware changes on any operating system. In my case that means it should work on *Windows* and *Linux* without any software modifications, while I can change the behaviour slightly on *macOS* in software since that’s my home OS. The images reflect the intended use on *macOS* **after** minor software tweaks; which will be noted. + +We have four layers. A `BASE` layer, in colemak; a `MOVE` layer, with an arrow cluster etc, a `SYMB` layer, with numbers and symbols; and a `FUNC` layer, with function keys and media keys. + +## The `BASE` layer +![](http://i.imgur.com/aEXOlWl.png) + +This is the default layer; in [colemak](https://colemak.com). `esc` and `del` are conspicuously absent but are especially easy to reach from either of the other main layers (see below). The `backspace` location is standard colemak. The `caps` key is still on the `BASE` layer but only because I don’t really use the bottom corners so there’s nothing else I would rather put there. Having `enter` on a thumb means I can still have `quote` immediately to the right of `O`, something that would have annoyed me endlessly otherwise. `minus` is in the upper right because I had an extra space and it’s probably my next most used key that didn’t yet have a home. + +The `MOVE` and `SYMB` layers are reached by holding down the `move` and `symb` keys respectively. The `FUNC` layer is reached by holding down both the `move` and `symb` keys simultaneosly, *or* by holding down the `fn` key. The intended use is that whenever both hands are on the keyboard, the former method is used, and the latter is only used when, for example, reaching over to the keyboard with one hand to access the media controls. + +The `ctrl`, `alt`, `cmd` cluster is asymmetric around the centre so that at least one of each of the modifiers can be reached with the thumbs. The intended use is to always hit the left `cmd` and the right `ctrl`, unless an awkward key combination dictates otherwise. + +In firmware `ctrl` and `cmd`/`GUI` are swapped with respect to the image above --- I swap them to the illustrated location when using *macOS* and leave them be for *Windows* and *Linux*. (so that `cmd-z,x,c,v,...` becomes `ctrl-z,x,c,v,...` saving me some confusion) + +## The `MOVE` layer +![](http://i.imgur.com/KXRSuHT.png) + +This is fairly self explanatory. I almost exclusively use the right hand cluster so that movement is a one handed affair, but the left hand cluster is there if it’s needed. + +On *macOS* I recommend using [Karabiner](https://pqrs.org/osx/karabiner/) and ticking *Use PC Style Home/End #2* and *Use PC Style PageUp/PageDown* so that `home` and `end` jump you to the beginning and end of the line respectively and so that `pg up` and `pg dn` move the cursor instead of just scrolling. + +None of the modifiers are overwritten so that `shift-alt-arrows` etc work as expected. + +## The `SYMB` layer +![](http://i.imgur.com/iuU144Y.png) + +The symbol layer has all the numbers and their usual corresponding symbols in the first two rows, with the symbols on the home row since I use them more frequently than the numbers. The third row contains all the remaining symbols, with brackets in the centre; then normally shifted symbols to the left, and non shifted to the right, in order of most to least used. + +`esc` and `del` are repeated here since I wanted to be able to reach either, one handed, with either hand. + +Again none of the modifiers are overwritten so that shortcuts involving numbers or symbols work as expected. + +## The `FUNC` layer +![](http://i.imgur.com/skxRZiH.png) + +The only thing of note here is that `bl+` and `bl-` are short for *backlight up* and *backlight down* respectively, and in firmware are actually `KC_PAUS` and `KC_SLCK` respectively, since *macOS* interprets these as the backlight keys. + +## Other changes from the default +I have LEDs and sound disabled, simply because I have no need of them. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 3b39910cb9506b9deb93f6395792e806e429aa61 Mon Sep 17 00:00:00 2001 From: Jordi Orlando Date: Thu, 28 Jul 2016 14:36:20 -0500 Subject: Create 0xdec Preonic keymap An ergonomically optimized Colemak keymap for the grid-layout Preonic --- keyboards/preonic/keymaps/0xdec/Makefile | 21 ++++ keyboards/preonic/keymaps/0xdec/README.md | 30 ++++++ keyboards/preonic/keymaps/0xdec/config.h | 10 ++ keyboards/preonic/keymaps/0xdec/keymap.c | 173 ++++++++++++++++++++++++++++++ 4 files changed, 234 insertions(+) create mode 100644 keyboards/preonic/keymaps/0xdec/Makefile create mode 100644 keyboards/preonic/keymaps/0xdec/README.md create mode 100644 keyboards/preonic/keymaps/0xdec/config.h create mode 100644 keyboards/preonic/keymaps/0xdec/keymap.c diff --git a/keyboards/preonic/keymaps/0xdec/Makefile b/keyboards/preonic/keymaps/0xdec/Makefile new file mode 100644 index 000000000..6600e3689 --- /dev/null +++ b/keyboards/preonic/keymaps/0xdec/Makefile @@ -0,0 +1,21 @@ +# Build 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/preonic/keymaps/0xdec/README.md b/keyboards/preonic/keymaps/0xdec/README.md new file mode 100644 index 000000000..603d3d455 --- /dev/null +++ b/keyboards/preonic/keymaps/0xdec/README.md @@ -0,0 +1,30 @@ +Ergonomic Colemak Keymap +======================== +An ergonomically optimized Colemak keymap for the grid-layout Preonic + +Modes +---------- + +#### Colemak + +> Base layer + +- All alphanumerics and symbols available on the base layer + +---------- + +#### Game + +> QWERTY layout for use with games or number entry + +- Standard QWERTY layout +- Integrated right-hand numpad in phone layout + +---------- + +#### Function (Raise) + +> Functions and mode switching + +- Turns NEIO into arrow cluster, with nav cluster below (Home, Page Down, Page Up, End) +- Reset key at lower left (Esc) diff --git a/keyboards/preonic/keymaps/0xdec/config.h b/keyboards/preonic/keymaps/0xdec/config.h new file mode 100644 index 000000000..5fc9b6f34 --- /dev/null +++ b/keyboards/preonic/keymaps/0xdec/config.h @@ -0,0 +1,10 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// Number of backlight levels +#undef BACKLIGHT_LEVELS +#define BACKLIGHT_LEVELS 5 + +#endif diff --git a/keyboards/preonic/keymaps/0xdec/keymap.c b/keyboards/preonic/keymaps/0xdec/keymap.c new file mode 100644 index 000000000..6c4b8a6fa --- /dev/null +++ b/keyboards/preonic/keymaps/0xdec/keymap.c @@ -0,0 +1,173 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Layer names +#define _COLEMAK 0 +#define _GAME 1 +#define _RAISE 2 + +enum preonic_keycodes { + COLEMAK = SAFE_RANGE, + GAME, + RAISE +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | = | Q | W | F | P | G | J | L | U | Y | [ | ] | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | - | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ; | Z | X | C | V | B | K | M | , | . | / | ENTER| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ESC | ALT | GUI | SHIFT| CTRL | BKSP | SPACE| RAISE| SHIFT| | DEL | TAB | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_BSLS}, + {KC_EQL ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_G ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_LBRC,KC_RBRC}, + {KC_MINS,KC_A ,KC_R ,KC_S ,KC_T ,KC_D ,KC_H ,KC_N ,KC_E ,KC_I ,KC_O ,KC_QUOT}, + {KC_SCLN,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_K ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_ENT }, + {KC_ESC ,KC_LALT,KC_LGUI,KC_LSFT,KC_LCTL,KC_BSPC,KC_SPC ,RAISE ,KC_RSFT,_______,KC_DEL ,KC_TAB } +}, + +/* Game + * ,-----------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 |NUM LK| ÷ | × | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+ + * | TAB | Q | W | E | R | T | Y | U | 1 | 2 | 3 | + | + * |------+------+------+------+------+------+------+------+------+------+------+------+ + * | CTRL | A | S | D | F | G | H | J | 4 | 5 | 6 | = | + * |------+------+------+------+------+------+------+------+------+------+------+------+ + * | SHIFT| Z | X | C | V | B | N | M | 7 | 8 | 9 | ENTER| + * |------+------+------+------+------+------+------+------+------+------+------+------+ + * | | ALT | GUI | SPACE| CTRL | BKSP | SPACE| RAISE| , | 0 | . | TAB | + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = { + {KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS}, + {KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_P1 ,KC_P2 ,KC_P3 ,KC_PPLS}, + {KC_LCTL,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_P4 ,KC_P5 ,KC_P6 ,KC_PEQL}, + {KC_LSFT,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_P7 ,KC_P8 ,KC_P9 ,KC_PENT}, + {XXXXXXX,KC_LALT,KC_LGUI,KC_SPC ,KC_LCTL,KC_BSPC,KC_SPC ,RAISE ,KC_PCMM,KC_P0 ,KC_PDOT,KC_TAB } +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | SLEEP| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |PRTSCR| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | SYM | F11 | F12 | |AU TOG| VOL+ |BL INC|COLMAK| GAME | MUSIC| MENU |SCRLCK| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | PREV | STOP | PLAY | NEXT | VOL- |BL DEC| LEFT | DOWN | UP | RIGHT| PAUSE| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | BACK | STOP | RFRSH| FRWRD| MUTE |BL TOG| HOME | PGDN | PGUP | END |INSERT| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | RESET| | | | | DEL | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_SLEP,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_PSCR}, + {XXXXXXX,KC_F11 ,KC_F12 ,XXXXXXX,AU_TOG ,KC_VOLU,BL_INC ,COLEMAK,GAME ,MU_TOG ,KC_MENU,KC_SLCK}, + {KC_CAPS,KC_MPRV,KC_MSTP,KC_MPLY,KC_MNXT,KC_VOLD,BL_DEC ,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,KC_PAUS}, + {XXXXXXX,KC_WBAK,KC_WSTP,KC_WREF,KC_WFWD,KC_MUTE,BL_TOGG,KC_HOME,KC_PGDN,KC_PGUP,KC_END ,KC_INS }, + {RESET ,_______,_______,_______,_______,KC_DEL ,_______,_______,_______,_______,_______,_______} +} + +}; + + + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} +}; +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_game[][2] = { + {NOTE_E6, 10} ,{NOTE_E6, 10} ,{NOTE_REST, 10} ,{NOTE_E6, 10} , + {NOTE_REST, 10} ,{NOTE_C6, 10} ,{NOTE_E6, 10} ,{NOTE_REST, 10} , + {NOTE_G6, 10} ,{NOTE_REST, 30}, + {NOTE_G5, 10} ,{NOTE_REST, 30} +}; +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +void startup_user() { + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} +void shutdown_user() { + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) { + music_scale_user(); +} +void music_scale_user(void) { + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif + + + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + break; + case GAME: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_game, false, STACCATO); + #endif + persistant_default_layer_set(1UL<<_GAME); + } + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + break; + default: + return true; + break; + } + + return false; +}; -- cgit v1.2.3-24-g4f1b From e8f70389592421c7d7d4dbca2d5851e24a29bec9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 29 Jul 2016 10:02:59 +0900 Subject: Fixed a typo Fixed a typo in line 738 'void martix_init' to 'void matrix_init' --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 3854f4b8d..f717f8e4c 100644 --- a/readme.md +++ b/readme.md @@ -735,7 +735,7 @@ Enable the backlight from the Makefile. All of these functions are available in the `*_kb()` or `*_user()` variety. `kb` ones should only be used in the `/.c` file, and `user` ones should only be used in the `keymap.c`. The keyboard ones call the user ones - it's necessary to keep these calls to allow the keymap functions to work correctly. -## `void martix_init_*(void)` +## `void matrix_init_*(void)` This function gets called when the matrix is initiated, and can contain start-up code for your keyboard/keymap. -- cgit v1.2.3-24-g4f1b From 61fbb47eb674ee1fab2f8415fe7f43311e51d260 Mon Sep 17 00:00:00 2001 From: coderkun Date: Sun, 22 May 2016 12:56:39 +0200 Subject: fix grave (GRV) and acute (ACUT) accents --- keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c index d25e2b995..958523c8b 100644 --- a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c +++ b/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c @@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [BASE] = KEYMAP( // left hand - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, NEO_GRV, NEO_Y, NEO_X, NEO_V, NEO_L, NEO_C, NEO_W, KC_HOME, NEO_L1_L, NEO_U, NEO_I, NEO_A, NEO_E, NEO_O, KC_LSFT, NEO_UE, NEO_OE, NEO_AE, NEO_P, NEO_Z, TG(PMQ), @@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MINS, KC_SPC, KC_ENT, ALL_T(KC_NO), // right hand - DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + NEO_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R, TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT, -- cgit v1.2.3-24-g4f1b From 08239aadeacabc3c8f2e727aff055a6816bb416e Mon Sep 17 00:00:00 2001 From: coderkun Date: Sun, 22 May 2016 12:58:54 +0200 Subject: use Ergodox EZ’s third LED for “scroll lock†MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c index 958523c8b..b71823e15 100644 --- a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c +++ b/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c @@ -1,7 +1,8 @@ #include "ergodox_ez.h" #include "debug.h" #include "action_layer.h" -#include "keymap_neo2.h" +#include "led.h" +#include "keymap_extras/keymap_neo2.h" // Layer names #define BASE 0 // default layer @@ -267,7 +268,13 @@ void matrix_scan_user(void) ergodox_right_led_3_on(); break; default: - ergodox_board_led_off(); + if(host_keyboard_leds() & (1< Date: Sun, 22 May 2016 13:00:52 +0200 Subject: complete labels for modifiers in keymap schema --- keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c index b71823e15..8a2ba26d2 100644 --- a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c +++ b/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c @@ -141,10 +141,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │ │ ✕ │ │ │ │ │ │ F9 │ F10 │ F11 │ F12 │ │ * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ * │ │ │ │ │ ✓ │ ├─────┤ ├─────┤ │ F5 │ F6 │ F7 │ F8 │ │ - * ├───────┼─────┼─────┼─────╄─────╃─────┤ │ │ ├─────╄─────╃─────┼─────┼─────┼───────┤ + * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ * │ │ │ │ │ │ │ │ │ │ │ F1 │ F2 │ F3 │ F4 │ │ * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ │ │(MO1)│ │ │ │ │ │(MO1)│ │ │ + * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ * │ Ms↠│ Ms↑ │ │ Ms↓ │ Ms→ │ * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠-- cgit v1.2.3-24-g4f1b From 3ace37271baec300d7801b123376692a6b583312 Mon Sep 17 00:00:00 2001 From: coderkun Date: Fri, 29 Jul 2016 11:28:37 +0200 Subject: disable sleep LED --- keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile b/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile index e7b2d0a65..6c0a79b11 100644 --- a/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile +++ b/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile @@ -1 +1,2 @@ -UNICODE_ENABLE = yes \ No newline at end of file +SLEEP_LED_ENABLE = no +UNICODE_ENABLE = yes -- cgit v1.2.3-24-g4f1b From f82437f08eb24c549c8e2ec15d466d6d303f93d8 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 29 Jul 2016 12:24:33 +0200 Subject: ergodox_ez: Upgrade my keymap to v1.4 * When toggling the key logging on or off, the LEDs will do a little dance. * The keylogger is now optional, but enabled by default. Use `KEYLOGGER_ENABLE=no` on the `make` command line to disable it. * The `TAB`/`ARRW` key was turned into a tap-dance key, allowing one to toggle the **ARROW** layer on by double-tapping, and as such, avoid the need to hold the key. * The `-`/`_` key was turned into a tap-dance key too. * There is now a way to travel time with the keyboard, toggle the feature on by hitting `LEAD t`. Signed-off-by: Gergely Nagy --- keyboards/ergodox_ez/keymaps/algernon/Makefile | 8 +- keyboards/ergodox_ez/keymaps/algernon/keymap.c | 165 +++++-- keyboards/ergodox_ez/keymaps/algernon/readme.md | 9 + .../algernon/tools/heatmap-adore-layout.json | 533 +++++++++++++++++++++ 4 files changed, 687 insertions(+), 28 deletions(-) create mode 100644 keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-adore-layout.json diff --git a/keyboards/ergodox_ez/keymaps/algernon/Makefile b/keyboards/ergodox_ez/keymaps/algernon/Makefile index 005f9750c..6bf3976b9 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/Makefile +++ b/keyboards/ergodox_ez/keymaps/algernon/Makefile @@ -4,13 +4,19 @@ SLEEP_LED_ENABLE=no UNICODE_ENABLE=no FORCE_NKRO ?= yes DEBUG_ENABLE = no -CONSOLE_ENABLE = yes +CONSOLE_ENABLE = no TAP_DANCE_ENABLE = yes +KEYLOGGER_ENABLE ?= yes ifeq (${FORCE_NKRO},yes) OPT_DEFS += -DFORCE_NKRO endif +ifeq (${KEYLOGGER_ENABLE},yes) +OPT_DEFS += -DKEYLOGGER_ENABLE +CONSOLE_ENABLE = yes +endif + KEYMAP_VERSION = $(shell \ if [ -d "${KEYMAP_PATH}/.git" ]; then \ cd "${KEYMAP_PATH}" && git describe --abbrev=6 --dirty --always --tags --match 'v*' 2>/dev/null; \ diff --git a/keyboards/ergodox_ez/keymaps/algernon/keymap.c b/keyboards/ergodox_ez/keymaps/algernon/keymap.c index 09d8dffd5..c12087292 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/keymap.c +++ b/keyboards/ergodox_ez/keymaps/algernon/keymap.c @@ -95,7 +95,9 @@ enum { /* Custom keycodes */ enum { - CT_CLN = 0 + CT_CLN = 0, + CT_MNS, + CT_TA, }; /* States & timers */ @@ -115,7 +117,11 @@ uint16_t oh_left_blink_timer = 0; uint8_t oh_right_blink = 0; uint16_t oh_right_blink_timer = 0; +#if KEYLOGGER_ENABLE bool log_enable = false; +#endif + +bool time_travel = false; /* The Keymap */ @@ -146,7 +152,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) ,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,LT(ARRW,KC_TAB) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I ,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) @@ -155,11 +161,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_BSPC,F(F_SFT),M(A_ESC) // right hand - ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS - ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,LT(ARRW, KC_EQL) - ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP - ,KC_MINS,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS + ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL + ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP + ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO ,OSL(NMDIA),M(OH_LEFT) ,KC_LEAD @@ -191,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) ,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC -,LT(ARRW, KC_TAB) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U ,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) @@ -200,11 +206,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_BSPC,F(F_SFT),M(A_ESC) // right hand - ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS - ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,LT(ARRW, KC_EQL) - ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP - ,KC_MINS,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS + ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL + ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP + ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO ,OSL(NMDIA),M(OH_LEFT) ,KC_LEAD @@ -892,24 +898,92 @@ void ang_tap (uint16_t codes[]) { register_code (code); \ unregister_code (code) -void ang_tap_dance (qk_tap_dance_state_t *state) { - switch (state->keycode) { - case TD(CT_CLN): - if (state->count == 1) { - register_code (KC_RSFT); - register_code (KC_SCLN); - unregister_code (KC_SCLN); - unregister_code (KC_RSFT); - } else if (state->count == 2) { - register_code (KC_SCLN); - unregister_code (KC_SCLN); - reset_tap_dance (state); - } +void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_RSFT); + register_code (KC_SCLN); + } else if (state->count == 2) { + register_code (KC_SCLN); + } +} + +void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_SCLN); + unregister_code (KC_RSFT); + } else if (state->count == 2) { + unregister_code (KC_SCLN); } } +void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_MINS); + } else if (state->count == 2) { + register_code (KC_RSFT); + register_code (KC_MINS); + } +} + +void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_MINS); + } else if (state->count == 2) { + unregister_code (KC_RSFT); + unregister_code (KC_MINS); + } +} + +typedef struct { + bool layer_toggle; + bool sticky; + bool finished_once; +} td_ta_state_t; + +void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (td_ta->finished_once) { + return; + } + + if (td_ta->sticky) { + td_ta->sticky = false; + td_ta->layer_toggle = false; + layer_off (ARRW); + return; + } + + td_ta->finished_once = true; + if (state->count == 1 && !state->pressed) { + register_code (KC_TAB); + td_ta->sticky = false; + td_ta->layer_toggle = false; + } else { + td_ta->layer_toggle = true; + layer_on (ARRW); + td_ta->sticky = (state->count == 2); + } +} + +void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (!td_ta->layer_toggle) + unregister_code (KC_TAB); + if (!td_ta->sticky) + layer_off (ARRW); + + td_ta->finished_once = false; +} + const qk_tap_dance_action_t tap_dance_actions[] = { - [CT_CLN] = ACTION_TAP_DANCE_FN (ang_tap_dance) + [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) + ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) + ,[CT_TA] = { + .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, + .user_data = (void *)&((td_ta_state_t) { false, false, false }) + } }; // Runs constantly in the background, in a loop. @@ -1002,9 +1076,18 @@ void matrix_scan_user(void) { leading = false; leader_end (); +#if KEYLOGGER_ENABLE SEQ_ONE_KEY (KC_D) { + ergodox_led_all_on(); + _delay_ms(100); + ergodox_led_all_off(); log_enable = !log_enable; } +#endif + + SEQ_ONE_KEY (KC_T) { + time_travel = !time_travel; + } SEQ_ONE_KEY (KC_U) { ang_do_unicode (); @@ -1093,13 +1176,41 @@ void matrix_scan_user(void) { } } +static uint16_t last4[4]; + bool process_record_user (uint16_t keycode, keyrecord_t *record) { +#if KEYLOGGER_ENABLE uint8_t layer = biton32(layer_state); if (log_enable && layer == BASE) { xprintf ("KL: col=%d, row=%d\n", record->event.key.col, record->event.key.row); } +#endif + + if (time_travel && !record->event.pressed) { + uint8_t p; + + // shift cache one to the left + for (p = 0; p < 3; p++) { + last4[p] = last4[p + 1]; + } + last4[3] = keycode; + + if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { + uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; + ang_tap (codes); + register_code (KC_RSFT); + register_code (KC_EQL); + unregister_code (KC_EQL); + unregister_code (KC_RSFT); + + uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; + ang_tap (codes2); + + return false; + } + } return true; } diff --git a/keyboards/ergodox_ez/keymaps/algernon/readme.md b/keyboards/ergodox_ez/keymaps/algernon/readme.md index 2312dc59e..6fe177511 100644 --- a/keyboards/ergodox_ez/keymaps/algernon/readme.md +++ b/keyboards/ergodox_ez/keymaps/algernon/readme.md @@ -50,6 +50,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest - `LEAD a` makes the [ADORE layer](#adore-layer) the default. - `LEAD v` prints the firmware version, the keyboard and the keymap. - `LEAD d` toggles logging keypress positions to the HID console. + - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. ## ADORE layer @@ -148,6 +149,14 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the # Changelog +## v1.4 - 2016-07-29 + +* When toggling the key logging on or off, the LEDs will do a little dance. +* The keylogger is now optional, but enabled by default. Use `KEYLOGGER_ENABLE=no` on the `make` command line to disable it. +* The `TAB`/`ARRW` key was turned into a tap-dance key, allowing one to toggle the **ARROW** layer on by double-tapping, and as such, avoid the need to hold the key. +* The `-`/`_` key was turned into a tap-dance key too. +* There is now a way to travel time with the keyboard, toggle the feature on by hitting `LEAD t`. + ## v1.3 - 2016-07-06 * Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a [heatmap](#heatmap) out of the logs. diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-adore-layout.json b/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-adore-layout.json new file mode 100644 index 000000000..544f61ce8 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-adore-layout.json @@ -0,0 +1,533 @@ +[ + { + "backcolor": "#ffffff", + "name": "ErgoDox - algernon's layout: Heatmap", + "author": "Gergely Nagy ", + "notes": "See [here](https://github.com/algernon/ergodox-layout#readme) for the QMK keymap source.", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea", + "pcb": true, + "css": ".keyborder { -webkit-filter: blur(5px); filter: blur(5px); } .keytop { -webkit-filter: blur(10px); } .keylabels { border: 1px solid black; }" + }, + [ + { + "x": 3.5, + "c": "#a7d0db", + "fa": [ + 0, + 0, + 2 + ] + }, + "#\n3\nF3", + { + "x": 10.5, + "c": "#a7d0db", + "t": "#000000", + "a": 4, + "fa": [ + 0, + 0, + 2 + ] + }, + "*\n8\nF8" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "@\n2\nF2", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "$\n4\nF4", + { + "x": 8.5 + }, + "&\n7\nF7", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "(\n9\nF9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "%\n5\nF5", + { + "c": "#f9cd31", + "a": 7, + "f": 2 + }, + "STENO", + { + "x": 4.5, + "f": 6 + }, + "", + { + "c": "#7adabd", + "a": 4, + "f": 3, + "fa": [ + 0, + 0, + 2 + ] + }, + "^\n6\nF6" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "f": 3, + "w": 1.5 + }, + "\n\n~\n`", + { + "t": "#0d0d0b" + }, + "!\n1\nF1", + { + "x": 14.5 + }, + ")\n0\nF10", + { + "a": 7, + "w": 1.5 + }, + "F11" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 6 + }, + "L", + { + "x": 10.5 + }, + "C" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b", + "a": 4 + }, + ">\n.", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "a": 6 + }, + "W", + { + "x": 8.5 + }, + "H", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "P" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "M", + { + "c": "#93c9b7", + "a": 4, + "h": 1.5 + }, + "{\n[", + { + "x": 4.5, + "h": 1.5 + }, + "}\n]", + { + "c": "#7adabd", + "a": 6 + }, + "F" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "t": "#0d0d0b", + "f": 6, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "a": 4, + "f": 3 + }, + "<\n,", + { + "x": 14.5, + "a": 6 + }, + "Y", + { + "a": 4, + "w": 1.5 + }, + "|\n\\" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 6 + }, + "E", + { + "x": 10.5 + }, + "T" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "O", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "n": true + }, + "I", + { + "x": 8.5, + "n": true + }, + "R", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "N" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "U", + { + "x": 6.5 + }, + "D" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "t": "#0d0d0b", + "fa": [ + 6 + ], + "w": 1.5 + }, + "\n\nTab", + { + "f": 3 + }, + "A", + { + "x": 14.5, + "f": 3 + }, + "S", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 6 + ], + "w": 1.5 + }, + "+\n=" + ], + [ + { + "y": -0.625, + "x": 6.5, + "c": "#93c9b7", + "t": "#000000", + "a": 7, + "h": 1.5 + }, + "(", + { + "x": 4.5, + "h": 1.5 + }, + ")" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#a7d0db", + "a": 4, + "f": 3 + }, + "\"\n'", + { + "x": 10.5 + }, + "V" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "Z", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "K", + { + "x": 8.5 + }, + "G", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "J" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "X", + { + "x": 6.5 + }, + "B" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "f": 9, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "t": "#0d0d0b", + "a": 4, + "f": 3 + }, + "?\n/", + { + "x": 14.5, + "a": 6 + }, + "Q", + { + "c": "#ffb07b", + "t": "#000000", + "f": 9, + "w": 1.5 + }, + "" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#d9dae0", + "g": true, + "a": 7, + "f": 3 + }, + "", + { + "x": 10.5 + }, + "" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "", + { + "x": 1, + "c": "#d4872a", + "g": false, + "a": 5 + }, + ";\n:", + { + "x": 8.5 + }, + "_\n-", + { + "x": 1, + "c": "#d9dae0", + "g": true, + "a": 7 + }, + "" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "", + {}, + "", + { + "x": 14.5 + }, + "", + {}, + "" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#f9cd31", + "g": false + }, + "Alt", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 9 + ] + }, + "\n\n\n" + ], + [ + { + "c": "#d4872a", + "a": 7, + "f": 9, + "h": 2 + }, + "", + { + "h": 2 + }, + "", + { + "c": "#f9cd31", + "f": 3 + }, + "Ctrl" + ], + [ + { + "x": 2, + "c": "#e26757" + }, + "ESC" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "MEDIA", + {}, + "1HAND" + ], + [ + { + "x": -3 + }, + "LEAD", + { + "c": "#d4872a", + "f": 9, + "h": 2 + }, + "", + { + "f": 3, + "h": 2 + }, + "SPC" + ], + [ + { + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "HUN" + ] +] -- cgit v1.2.3-24-g4f1b 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/Makefile | 34 + keyboards/ergodox/ergodox.c | 8 + keyboards/ergodox/ergodox.h | 11 + keyboards/ergodox/ez/190hotfix.sh | 19 + keyboards/ergodox/ez/Makefile | 76 ++ keyboards/ergodox/ez/config.h | 84 ++ keyboards/ergodox/ez/ez.c | 85 ++ keyboards/ergodox/ez/ez.h | 122 ++ keyboards/ergodox/ez/i2cmaster.h | 178 +++ keyboards/ergodox/ez/matrix.c | 382 ++++++ keyboards/ergodox/ez/readme.md | 44 + keyboards/ergodox/ez/twimaster.c | 208 ++++ keyboards/ergodox/ez/util/compile_keymap.py | 710 ++++++++++++ keyboards/ergodox/ez/util/readme.md | 3 + keyboards/ergodox/infinity/MEMO.txt | 385 +++++++ keyboards/ergodox/infinity/Makefile | 77 ++ keyboards/ergodox/infinity/bootloader_defs.h | 1 + keyboards/ergodox/infinity/chconf.h | 524 +++++++++ keyboards/ergodox/infinity/config.h | 80 ++ .../drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h | 113 ++ .../infinity/drivers/gdisp/IS31FL3731C/driver.mk | 2 + .../drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 333 ++++++ .../drivers/gdisp/IS31FL3731C/gdisp_lld_config.h | 36 + .../infinity/drivers/gdisp/emulator_lcd/driver.mk | 2 + .../drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 + .../infinity/drivers/gdisp/emulator_led/driver.mk | 2 + .../drivers/gdisp/emulator_led/emulator_led.c | 10 + .../drivers/gdisp/st7565ergodox/board_ST7565.h | 127 ++ .../infinity/drivers/gdisp/st7565ergodox/driver.mk | 2 + .../drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c | 292 +++++ .../drivers/gdisp/st7565ergodox/gdisp_lld_config.h | 26 + .../infinity/drivers/gdisp/st7565ergodox/st7565.h | 37 + keyboards/ergodox/infinity/gfxconf.h | 331 ++++++ keyboards/ergodox/infinity/halconf.h | 353 ++++++ keyboards/ergodox/infinity/infinity.c | 76 ++ keyboards/ergodox/infinity/infinity.h | 44 + .../ergodox/infinity/keymaps/default/keymap.c | 114 ++ .../ergodox/infinity/keymaps/default/visualizer.c | 168 +++ keyboards/ergodox/infinity/led.c | 49 + keyboards/ergodox/infinity/matrix.c | 169 +++ keyboards/ergodox/infinity/mcuconf.h | 74 ++ keyboards/ergodox/keymaps/ab/Makefile | 9 + keyboards/ergodox/keymaps/ab/keyboard-layout.json | 387 +++++++ keyboards/ergodox/keymaps/ab/keyboard-layout.png | Bin 0 -> 80776 bytes keyboards/ergodox/keymaps/ab/keymap.c | 155 +++ keyboards/ergodox/keymaps/ab/readme.md | 21 + keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c | 185 +++ keyboards/ergodox/keymaps/adnw_k_o_y/readme.md | 7 + keyboards/ergodox/keymaps/alexjj/keymap.c | 238 ++++ keyboards/ergodox/keymaps/alexjj/readme.md | 179 +++ keyboards/ergodox/keymaps/alexjj/rl-layout.jpg | Bin 0 -> 833107 bytes keyboards/ergodox/keymaps/algernon/COPYING | 674 +++++++++++ keyboards/ergodox/keymaps/algernon/Makefile | 35 + keyboards/ergodox/keymaps/algernon/config.h | 27 + .../keymaps/algernon/images/adore-layer.png | Bin 0 -> 95615 bytes .../ergodox/keymaps/algernon/images/base-layer.png | Bin 0 -> 95654 bytes .../ergodox/keymaps/algernon/images/heatmap.png | Bin 0 -> 137912 bytes .../ergodox/keymaps/algernon/images/hun-layer.png | Bin 0 -> 67924 bytes .../keymaps/algernon/images/nav-n-media-layer.png | Bin 0 -> 94837 bytes .../keymaps/algernon/images/one-handed-layer.png | Bin 0 -> 91140 bytes .../keymaps/algernon/images/steno-layer.png | Bin 0 -> 69557 bytes keyboards/ergodox/keymaps/algernon/keymap.c | 1216 ++++++++++++++++++++ keyboards/ergodox/keymaps/algernon/readme.md | 198 ++++ .../algernon/tools/heatmap-adore-layout.json | 533 +++++++++ .../algernon/tools/heatmap-base-layout.json | 533 +++++++++ .../keymaps/algernon/tools/log-to-heatmap.py | 145 +++ .../ergodox/keymaps/algernon/tools/max-focused | 5 + keyboards/ergodox/keymaps/andrew_osx/keymap.c | 187 +++ keyboards/ergodox/keymaps/bepo/bepo.png | Bin 0 -> 79747 bytes keyboards/ergodox/keymaps/bepo/keymap.c | 311 +++++ keyboards/ergodox/keymaps/bepo/readme.md | 34 + keyboards/ergodox/keymaps/coderkun_neo2/Makefile | 2 + keyboards/ergodox/keymaps/coderkun_neo2/keymap.c | 281 +++++ keyboards/ergodox/keymaps/coderkun_neo2/readme.md | 31 + keyboards/ergodox/keymaps/colemak/keymap.c | 184 +++ keyboards/ergodox/keymaps/colemak/readme.md | 4 + .../keymaps/colemak_osx_pc_no/keyboard-layout.png | Bin 0 -> 103158 bytes .../ergodox/keymaps/colemak_osx_pc_no/keymap.c | 264 +++++ .../ergodox/keymaps/colemak_osx_pc_no/readme.md | 23 + .../ergodox/keymaps/csharp_dev/csharp_dev.png | Bin 0 -> 97642 bytes .../keymaps/csharp_dev/csharp_dev_legend.png | Bin 0 -> 387797 bytes keyboards/ergodox/keymaps/csharp_dev/keymap.c | 239 ++++ keyboards/ergodox/keymaps/csharp_dev/readme.md | 47 + keyboards/ergodox/keymaps/dave/keymap.c | 199 ++++ keyboards/ergodox/keymaps/dave/readme.md | 38 + keyboards/ergodox/keymaps/default/default.png | Bin 0 -> 193672 bytes .../ergodox/keymaps/default/default_highres.png | Bin 0 -> 1459389 bytes keyboards/ergodox/keymaps/default/keymap.c | 182 +++ keyboards/ergodox/keymaps/default/readme.md | 10 + .../keymaps/default_osx/default_osx_highres.png | Bin 0 -> 772418 bytes keyboards/ergodox/keymaps/default_osx/keymap.c | 187 +++ keyboards/ergodox/keymaps/default_osx/readme.md | 8 + keyboards/ergodox/keymaps/dragon788/keymap.c | 229 ++++ keyboards/ergodox/keymaps/dvorak/dvorak.png | Bin 0 -> 87314 bytes keyboards/ergodox/keymaps/dvorak/keymap.c | 184 +++ .../dvorak_intl_squisher/keyboard-layout0.png | Bin 0 -> 73585 bytes .../dvorak_intl_squisher/keyboard-layout1.png | Bin 0 -> 59122 bytes .../dvorak_intl_squisher/keyboard-layout2.png | Bin 0 -> 53319 bytes .../ergodox/keymaps/dvorak_intl_squisher/keymap.c | 185 +++ .../ergodox/keymaps/dvorak_intl_squisher/readme.md | 29 + keyboards/ergodox/keymaps/dvorak_spanish/keymap.c | 284 +++++ keyboards/ergodox/keymaps/dvorak_spanish/readme.md | 99 ++ .../keymaps/emacs_osx_dk/default_highres.png | Bin 0 -> 142146 bytes keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c | 184 +++ keyboards/ergodox/keymaps/emacs_osx_dk/readme.md | 10 + .../ergodox/keymaps/erez_experimental/Makefile | 9 + .../ergodox/keymaps/erez_experimental/config.h | 12 + .../ergodox/keymaps/erez_experimental/keymap.c | 199 ++++ .../ergodox/keymaps/erez_experimental/readme.md | 51 + keyboards/ergodox/keymaps/german-kinergo/keymap.c | 210 ++++ .../ergodox/keymaps/german-kinergo/layout-code.png | Bin 0 -> 55386 bytes .../keymaps/german-kinergo/layout-media.png | Bin 0 -> 67634 bytes .../ergodox/keymaps/german-kinergo/layout.png | Bin 0 -> 71175 bytes keyboards/ergodox/keymaps/german-kinergo/readme.md | 35 + .../keymaps/german-manuneo/compile_keymap.py | 710 ++++++++++++ keyboards/ergodox/keymaps/german-manuneo/keymap.c | 783 +++++++++++++ keyboards/ergodox/keymaps/german-manuneo/keymap.md | 188 +++ keyboards/ergodox/keymaps/german/keymap.c | 185 +++ keyboards/ergodox/keymaps/j3rn/keymap.c | 187 +++ keyboards/ergodox/keymaps/j3rn/readme.md | 29 + keyboards/ergodox/keymaps/jack/keymap.c | 118 ++ .../keymaps/jacobono/img/colemak-default-layer.png | Bin 0 -> 70434 bytes .../keymaps/jacobono/img/number-dpad-layer.png | Bin 0 -> 46225 bytes .../ergodox/keymaps/jacobono/img/symbol-layer.png | Bin 0 -> 49615 bytes keyboards/ergodox/keymaps/jacobono/keymap.c | 273 +++++ keyboards/ergodox/keymaps/jacobono/readme.md | 34 + keyboards/ergodox/keymaps/jgarr/keymap.c | 184 +++ keyboards/ergodox/keymaps/josh/keymap.c | 205 ++++ keyboards/ergodox/keymaps/josh/readme.md | 8 + keyboards/ergodox/keymaps/kastyle/keymap.c | 184 +++ keyboards/ergodox/keymaps/kines-ish/keymap.c | 184 +++ keyboards/ergodox/keymaps/kines-ish/readme.md | 19 + keyboards/ergodox/keymaps/maz/keymap.c | 229 ++++ keyboards/ergodox/keymaps/maz/readme.md | 121 ++ keyboards/ergodox/keymaps/mpiechotka/keymap.c | 276 +++++ keyboards/ergodox/keymaps/mpiechotka/readme.md | 6 + keyboards/ergodox/keymaps/msc/img/code_layer.png | Bin 0 -> 71266 bytes keyboards/ergodox/keymaps/msc/img/main_layer.png | Bin 0 -> 90624 bytes keyboards/ergodox/keymaps/msc/img/media_layer.png | Bin 0 -> 75750 bytes keyboards/ergodox/keymaps/msc/keymap.c | 184 +++ keyboards/ergodox/keymaps/msc/readme.md | 32 + keyboards/ergodox/keymaps/naps62/keymap.c | 187 +++ keyboards/ergodox/keymaps/naps62/readme.md | 29 + keyboards/ergodox/keymaps/ordinary/keymap.c | 454 ++++++++ .../ergodox/keymaps/ordinary/ordinary-base.png | Bin 0 -> 99605 bytes .../ergodox/keymaps/ordinary/ordinary-base.txt | 27 + .../ergodox/keymaps/ordinary/ordinary-media.png | Bin 0 -> 124144 bytes .../ergodox/keymaps/ordinary/ordinary-media.txt | 27 + .../ergodox/keymaps/ordinary/ordinary-special.png | Bin 0 -> 63065 bytes .../ergodox/keymaps/ordinary/ordinary-special.txt | 27 + .../ergodox/keymaps/ordinary/ordinary-symbol.png | Bin 0 -> 103735 bytes .../ergodox/keymaps/ordinary/ordinary-symbol.txt | 27 + keyboards/ergodox/keymaps/ordinary/readme.md | 103 ++ keyboards/ergodox/keymaps/osx_de/keymap.c | 364 ++++++ .../ergodox/keymaps/osx_de/osx_de_highres.png | Bin 0 -> 298446 bytes keyboards/ergodox/keymaps/osx_de/readme.md | 41 + keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c | 174 +++ .../osx_de_adnw_koy/osx_de_adnw_koy_highres.png | Bin 0 -> 183892 bytes .../ergodox/keymaps/osx_de_experimental/keymap.c | 597 ++++++++++ .../osx_de_experimental_highres.png | Bin 0 -> 303904 bytes .../ergodox/keymaps/osx_de_experimental/readme.md | 22 + keyboards/ergodox/keymaps/osx_fr/keymap.c | 187 +++ .../ergodox/keymaps/osx_kinesis_pnut/keymap.c | 191 +++ keyboards/ergodox/keymaps/plover/keymap.c | 228 ++++ keyboards/ergodox/keymaps/plums/keymap.c | 229 ++++ keyboards/ergodox/keymaps/plums/plums.png | Bin 0 -> 223300 bytes keyboards/ergodox/keymaps/plums/readme.md | 11 + .../keymaps/romanzolotarev-norman-osx/keymap.c | 46 + .../keymaps/romanzolotarev-norman-osx/readme.md | 28 + .../romanzolotarev-norman-osx.png | Bin 0 -> 96954 bytes .../romanzolotarev-norman-plover-osx-hjkl/keymap.c | 134 +++ .../readme.md | 50 + .../romanzolotarev-norman-plover-osx-hjkl.png | Bin 0 -> 130692 bytes .../romanzolotarev-norman-plover-osx/keymap.c | 134 +++ .../romanzolotarev-norman-plover-osx/readme.md | 50 + .../romanzolotarev-norman-plover-osx.png | Bin 0 -> 130464 bytes .../romanzolotarev-norman-qwerty-osx/keymap.c | 74 ++ .../romanzolotarev-norman-qwerty-osx/readme.md | 34 + .../romanzolotarev-norman-qwerty-osx.png | Bin 0 -> 100627 bytes keyboards/ergodox/keymaps/sneako/keymap.c | 187 +++ keyboards/ergodox/keymaps/sneako/readme.md | 6 + keyboards/ergodox/keymaps/software_neo2/keymap.c | 139 +++ keyboards/ergodox/keymaps/supercoder/config_user.h | 9 + .../ergodox/keymaps/supercoder/images/layout.png | Bin 0 -> 65607 bytes .../keymaps/supercoder/images/supercoder_2000.jpg | Bin 0 -> 75444 bytes keyboards/ergodox/keymaps/supercoder/keymap.c | 75 ++ keyboards/ergodox/keymaps/supercoder/makefile.mk | 6 + keyboards/ergodox/keymaps/supercoder/readme.md | 29 + keyboards/ergodox/keymaps/techtomas/keymap.c | 231 ++++ keyboards/ergodox/keymaps/techtomas/readme.md | 57 + keyboards/ergodox/keymaps/teckinesis/keymap.c | 455 ++++++++ .../keymaps/teckinesis/ordinary-special.png | Bin 0 -> 63065 bytes .../keymaps/teckinesis/ordinary-special.txt | 27 + keyboards/ergodox/keymaps/teckinesis/readme.md | 45 + .../keymaps/teckinesis/teckinesis-base.json | 434 +++++++ .../ergodox/keymaps/teckinesis/teckinesis-base.png | Bin 0 -> 93743 bytes .../keymaps/teckinesis/teckinesis-media.json | 436 +++++++ .../keymaps/teckinesis/teckinesis-media.png | Bin 0 -> 112216 bytes .../keymaps/teckinesis/teckinesis-symbol.json | 422 +++++++ .../keymaps/teckinesis/teckinesis-symbol.png | Bin 0 -> 97350 bytes keyboards/ergodox/keymaps/tkuichooseyou/README.md | 13 + .../ergodox/keymaps/tkuichooseyou/compiled.hex | 1137 ++++++++++++++++++ keyboards/ergodox/keymaps/tkuichooseyou/keymap.c | 184 +++ keyboards/ergodox/keymaps/tm2030/keymap.c | 242 ++++ keyboards/ergodox/keymaps/tm2030/readme.md | 136 +++ keyboards/ergodox/keymaps/tonyabra_osx/keymap.c | 184 +++ keyboards/ergodox/keymaps/tonyabra_osx/readme.md | 5 + keyboards/ergodox/keymaps/townk_osx/config.h | 92 ++ keyboards/ergodox/keymaps/townk_osx/keymap.c | 285 +++++ keyboards/ergodox/keymaps/townk_osx/makefile.mk | 4 + keyboards/ergodox/keymaps/townk_osx/readme.md | 77 ++ .../ergodox/keymaps/townk_osx/townk_osx_base.png | Bin 0 -> 785859 bytes .../ergodox/keymaps/townk_osx/townk_osx_fn.png | Bin 0 -> 390041 bytes .../ergodox/keymaps/townk_osx/townk_osx_keypad.png | Bin 0 -> 424425 bytes keyboards/ergodox/keymaps/twey/keymap.c | 221 ++++ keyboards/ergodox/keymaps/twey/readme.md | 17 + keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c | 366 ++++++ keyboards/ergodox/keymaps/zweihander-osx/keymap.c | 233 ++++ .../ergodox/keymaps/zweihander-osx/readme.markdown | 45 + keyboards/ergodox_ez/190hotfix.sh | 19 - keyboards/ergodox_ez/Makefile | 86 -- keyboards/ergodox_ez/config.h | 84 -- keyboards/ergodox_ez/ergodox_ez.c | 85 -- keyboards/ergodox_ez/ergodox_ez.h | 122 -- keyboards/ergodox_ez/i2cmaster.h | 178 --- keyboards/ergodox_ez/keymaps/ab/Makefile | 9 - .../ergodox_ez/keymaps/ab/keyboard-layout.json | 387 ------- .../ergodox_ez/keymaps/ab/keyboard-layout.png | Bin 80776 -> 0 bytes keyboards/ergodox_ez/keymaps/ab/keymap.c | 155 --- keyboards/ergodox_ez/keymaps/ab/readme.md | 21 - keyboards/ergodox_ez/keymaps/adnw_k_o_y/keymap.c | 185 --- keyboards/ergodox_ez/keymaps/adnw_k_o_y/readme.md | 7 - keyboards/ergodox_ez/keymaps/alexjj/keymap.c | 238 ---- keyboards/ergodox_ez/keymaps/alexjj/readme.md | 179 --- keyboards/ergodox_ez/keymaps/alexjj/rl-layout.jpg | Bin 833107 -> 0 bytes keyboards/ergodox_ez/keymaps/algernon/COPYING | 674 ----------- keyboards/ergodox_ez/keymaps/algernon/Makefile | 35 - keyboards/ergodox_ez/keymaps/algernon/config.h | 27 - .../keymaps/algernon/images/adore-layer.png | Bin 95615 -> 0 bytes .../keymaps/algernon/images/base-layer.png | Bin 95654 -> 0 bytes .../ergodox_ez/keymaps/algernon/images/heatmap.png | Bin 137912 -> 0 bytes .../keymaps/algernon/images/hun-layer.png | Bin 67924 -> 0 bytes .../keymaps/algernon/images/nav-n-media-layer.png | Bin 94837 -> 0 bytes .../keymaps/algernon/images/one-handed-layer.png | Bin 91140 -> 0 bytes .../keymaps/algernon/images/steno-layer.png | Bin 69557 -> 0 bytes keyboards/ergodox_ez/keymaps/algernon/keymap.c | 1216 -------------------- keyboards/ergodox_ez/keymaps/algernon/readme.md | 198 ---- .../algernon/tools/heatmap-adore-layout.json | 533 --------- .../algernon/tools/heatmap-base-layout.json | 533 --------- .../keymaps/algernon/tools/log-to-heatmap.py | 145 --- .../ergodox_ez/keymaps/algernon/tools/max-focused | 5 - keyboards/ergodox_ez/keymaps/andrew_osx/keymap.c | 187 --- keyboards/ergodox_ez/keymaps/bepo/bepo.png | Bin 79747 -> 0 bytes keyboards/ergodox_ez/keymaps/bepo/keymap.c | 311 ----- keyboards/ergodox_ez/keymaps/bepo/readme.md | 34 - .../ergodox_ez/keymaps/coderkun_neo2/Makefile | 2 - .../ergodox_ez/keymaps/coderkun_neo2/keymap.c | 281 ----- .../ergodox_ez/keymaps/coderkun_neo2/readme.md | 31 - keyboards/ergodox_ez/keymaps/colemak/keymap.c | 184 --- keyboards/ergodox_ez/keymaps/colemak/readme.md | 4 - .../keymaps/colemak_osx_pc_no/keyboard-layout.png | Bin 103158 -> 0 bytes .../ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c | 264 ----- .../ergodox_ez/keymaps/colemak_osx_pc_no/readme.md | 23 - .../ergodox_ez/keymaps/csharp_dev/csharp_dev.png | Bin 97642 -> 0 bytes .../keymaps/csharp_dev/csharp_dev_legend.png | Bin 387797 -> 0 bytes keyboards/ergodox_ez/keymaps/csharp_dev/keymap.c | 239 ---- keyboards/ergodox_ez/keymaps/csharp_dev/readme.md | 47 - keyboards/ergodox_ez/keymaps/dave/keymap.c | 199 ---- keyboards/ergodox_ez/keymaps/dave/readme.md | 38 - keyboards/ergodox_ez/keymaps/default/default.png | Bin 193672 -> 0 bytes .../ergodox_ez/keymaps/default/default_highres.png | Bin 1459389 -> 0 bytes keyboards/ergodox_ez/keymaps/default/keymap.c | 182 --- keyboards/ergodox_ez/keymaps/default/readme.md | 10 - .../keymaps/default_osx/default_osx_highres.png | Bin 772418 -> 0 bytes keyboards/ergodox_ez/keymaps/default_osx/keymap.c | 187 --- keyboards/ergodox_ez/keymaps/default_osx/readme.md | 8 - keyboards/ergodox_ez/keymaps/dragon788/keymap.c | 229 ---- keyboards/ergodox_ez/keymaps/dvorak/dvorak.png | Bin 87314 -> 0 bytes keyboards/ergodox_ez/keymaps/dvorak/keymap.c | 184 --- .../dvorak_intl_squisher/keyboard-layout0.png | Bin 73585 -> 0 bytes .../dvorak_intl_squisher/keyboard-layout1.png | Bin 59122 -> 0 bytes .../dvorak_intl_squisher/keyboard-layout2.png | Bin 53319 -> 0 bytes .../keymaps/dvorak_intl_squisher/keymap.c | 185 --- .../keymaps/dvorak_intl_squisher/readme.md | 29 - .../ergodox_ez/keymaps/dvorak_spanish/keymap.c | 284 ----- .../ergodox_ez/keymaps/dvorak_spanish/readme.md | 99 -- .../keymaps/emacs_osx_dk/default_highres.png | Bin 142146 -> 0 bytes keyboards/ergodox_ez/keymaps/emacs_osx_dk/keymap.c | 184 --- .../ergodox_ez/keymaps/emacs_osx_dk/readme.md | 10 - .../ergodox_ez/keymaps/erez_experimental/Makefile | 9 - .../ergodox_ez/keymaps/erez_experimental/config.h | 12 - .../ergodox_ez/keymaps/erez_experimental/keymap.c | 199 ---- .../ergodox_ez/keymaps/erez_experimental/readme.md | 51 - .../ergodox_ez/keymaps/german-kinergo/keymap.c | 210 ---- .../keymaps/german-kinergo/layout-code.png | Bin 55386 -> 0 bytes .../keymaps/german-kinergo/layout-media.png | Bin 67634 -> 0 bytes .../ergodox_ez/keymaps/german-kinergo/layout.png | Bin 71175 -> 0 bytes .../ergodox_ez/keymaps/german-kinergo/readme.md | 35 - .../keymaps/german-manuneo/compile_keymap.py | 710 ------------ .../ergodox_ez/keymaps/german-manuneo/keymap.c | 783 ------------- .../ergodox_ez/keymaps/german-manuneo/keymap.md | 188 --- keyboards/ergodox_ez/keymaps/german/keymap.c | 185 --- keyboards/ergodox_ez/keymaps/j3rn/keymap.c | 187 --- keyboards/ergodox_ez/keymaps/j3rn/readme.md | 29 - keyboards/ergodox_ez/keymaps/jack/keymap.c | 118 -- .../keymaps/jacobono/img/colemak-default-layer.png | Bin 70434 -> 0 bytes .../keymaps/jacobono/img/number-dpad-layer.png | Bin 46225 -> 0 bytes .../keymaps/jacobono/img/symbol-layer.png | Bin 49615 -> 0 bytes keyboards/ergodox_ez/keymaps/jacobono/keymap.c | 273 ----- keyboards/ergodox_ez/keymaps/jacobono/readme.md | 34 - keyboards/ergodox_ez/keymaps/jgarr/keymap.c | 184 --- keyboards/ergodox_ez/keymaps/josh/keymap.c | 205 ---- keyboards/ergodox_ez/keymaps/josh/readme.md | 8 - keyboards/ergodox_ez/keymaps/kastyle/keymap.c | 184 --- keyboards/ergodox_ez/keymaps/kines-ish/keymap.c | 184 --- keyboards/ergodox_ez/keymaps/kines-ish/readme.md | 19 - keyboards/ergodox_ez/keymaps/maz/keymap.c | 229 ---- keyboards/ergodox_ez/keymaps/maz/readme.md | 121 -- keyboards/ergodox_ez/keymaps/mpiechotka/keymap.c | 276 ----- keyboards/ergodox_ez/keymaps/mpiechotka/readme.md | 6 - .../ergodox_ez/keymaps/msc/img/code_layer.png | Bin 71266 -> 0 bytes .../ergodox_ez/keymaps/msc/img/main_layer.png | Bin 90624 -> 0 bytes .../ergodox_ez/keymaps/msc/img/media_layer.png | Bin 75750 -> 0 bytes keyboards/ergodox_ez/keymaps/msc/keymap.c | 184 --- keyboards/ergodox_ez/keymaps/msc/readme.md | 32 - keyboards/ergodox_ez/keymaps/naps62/keymap.c | 187 --- keyboards/ergodox_ez/keymaps/naps62/readme.md | 29 - keyboards/ergodox_ez/keymaps/ordinary/keymap.c | 454 -------- .../ergodox_ez/keymaps/ordinary/ordinary-base.png | Bin 99605 -> 0 bytes .../ergodox_ez/keymaps/ordinary/ordinary-base.txt | 27 - .../ergodox_ez/keymaps/ordinary/ordinary-media.png | Bin 124144 -> 0 bytes .../ergodox_ez/keymaps/ordinary/ordinary-media.txt | 27 - .../keymaps/ordinary/ordinary-special.png | Bin 63065 -> 0 bytes .../keymaps/ordinary/ordinary-special.txt | 27 - .../keymaps/ordinary/ordinary-symbol.png | Bin 103735 -> 0 bytes .../keymaps/ordinary/ordinary-symbol.txt | 27 - keyboards/ergodox_ez/keymaps/ordinary/readme.md | 103 -- keyboards/ergodox_ez/keymaps/osx_de/keymap.c | 364 ------ .../ergodox_ez/keymaps/osx_de/osx_de_highres.png | Bin 298446 -> 0 bytes keyboards/ergodox_ez/keymaps/osx_de/readme.md | 41 - .../ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c | 174 --- .../osx_de_adnw_koy/osx_de_adnw_koy_highres.png | Bin 183892 -> 0 bytes .../keymaps/osx_de_experimental/keymap.c | 597 ---------- .../osx_de_experimental_highres.png | Bin 303904 -> 0 bytes .../keymaps/osx_de_experimental/readme.md | 22 - keyboards/ergodox_ez/keymaps/osx_fr/keymap.c | 187 --- .../ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c | 191 --- keyboards/ergodox_ez/keymaps/plover/keymap.c | 228 ---- keyboards/ergodox_ez/keymaps/plums/keymap.c | 229 ---- keyboards/ergodox_ez/keymaps/plums/plums.png | Bin 223300 -> 0 bytes keyboards/ergodox_ez/keymaps/plums/readme.md | 11 - .../keymaps/romanzolotarev-norman-osx/keymap.c | 46 - .../keymaps/romanzolotarev-norman-osx/readme.md | 28 - .../romanzolotarev-norman-osx.png | Bin 96954 -> 0 bytes .../romanzolotarev-norman-plover-osx-hjkl/keymap.c | 134 --- .../readme.md | 50 - .../romanzolotarev-norman-plover-osx-hjkl.png | Bin 130692 -> 0 bytes .../romanzolotarev-norman-plover-osx/keymap.c | 134 --- .../romanzolotarev-norman-plover-osx/readme.md | 50 - .../romanzolotarev-norman-plover-osx.png | Bin 130464 -> 0 bytes .../romanzolotarev-norman-qwerty-osx/keymap.c | 74 -- .../romanzolotarev-norman-qwerty-osx/readme.md | 34 - .../romanzolotarev-norman-qwerty-osx.png | Bin 100627 -> 0 bytes keyboards/ergodox_ez/keymaps/sneako/keymap.c | 187 --- keyboards/ergodox_ez/keymaps/sneako/readme.md | 6 - .../ergodox_ez/keymaps/software_neo2/keymap.c | 139 --- .../ergodox_ez/keymaps/supercoder/config_user.h | 9 - .../keymaps/supercoder/images/layout.png | Bin 65607 -> 0 bytes .../keymaps/supercoder/images/supercoder_2000.jpg | Bin 75444 -> 0 bytes keyboards/ergodox_ez/keymaps/supercoder/keymap.c | 75 -- .../ergodox_ez/keymaps/supercoder/makefile.mk | 6 - keyboards/ergodox_ez/keymaps/supercoder/readme.md | 29 - keyboards/ergodox_ez/keymaps/techtomas/keymap.c | 231 ---- keyboards/ergodox_ez/keymaps/techtomas/readme.md | 57 - keyboards/ergodox_ez/keymaps/teckinesis/keymap.c | 455 -------- .../keymaps/teckinesis/ordinary-special.png | Bin 63065 -> 0 bytes .../keymaps/teckinesis/ordinary-special.txt | 27 - keyboards/ergodox_ez/keymaps/teckinesis/readme.md | 45 - .../keymaps/teckinesis/teckinesis-base.json | 434 ------- .../keymaps/teckinesis/teckinesis-base.png | Bin 93743 -> 0 bytes .../keymaps/teckinesis/teckinesis-media.json | 436 ------- .../keymaps/teckinesis/teckinesis-media.png | Bin 112216 -> 0 bytes .../keymaps/teckinesis/teckinesis-symbol.json | 422 ------- .../keymaps/teckinesis/teckinesis-symbol.png | Bin 97350 -> 0 bytes .../ergodox_ez/keymaps/tkuichooseyou/README.md | 13 - .../ergodox_ez/keymaps/tkuichooseyou/compiled.hex | 1137 ------------------ .../ergodox_ez/keymaps/tkuichooseyou/keymap.c | 184 --- keyboards/ergodox_ez/keymaps/tm2030/keymap.c | 242 ---- keyboards/ergodox_ez/keymaps/tm2030/readme.md | 136 --- keyboards/ergodox_ez/keymaps/tonyabra_osx/keymap.c | 184 --- .../ergodox_ez/keymaps/tonyabra_osx/readme.md | 5 - keyboards/ergodox_ez/keymaps/townk_osx/config.h | 92 -- keyboards/ergodox_ez/keymaps/townk_osx/keymap.c | 285 ----- keyboards/ergodox_ez/keymaps/townk_osx/makefile.mk | 4 - keyboards/ergodox_ez/keymaps/townk_osx/readme.md | 77 -- .../keymaps/townk_osx/townk_osx_base.png | Bin 785859 -> 0 bytes .../ergodox_ez/keymaps/townk_osx/townk_osx_fn.png | Bin 390041 -> 0 bytes .../keymaps/townk_osx/townk_osx_keypad.png | Bin 424425 -> 0 bytes keyboards/ergodox_ez/keymaps/twey/keymap.c | 221 ---- keyboards/ergodox_ez/keymaps/twey/readme.md | 17 - .../ergodox_ez/keymaps/workman_osx_mdw/keymap.c | 366 ------ .../ergodox_ez/keymaps/zweihander-osx/keymap.c | 233 ---- .../keymaps/zweihander-osx/readme.markdown | 45 - keyboards/ergodox_ez/matrix.c | 382 ------ keyboards/ergodox_ez/readme.md | 44 - keyboards/ergodox_ez/twimaster.c | 208 ---- keyboards/ergodox_ez/util/compile_keymap.py | 710 ------------ keyboards/ergodox_ez/util/readme.md | 3 - keyboards/infinity_ergodox/MEMO.txt | 385 ------- keyboards/infinity_ergodox/Makefile | 85 -- keyboards/infinity_ergodox/bootloader_defs.h | 1 - keyboards/infinity_ergodox/chconf.h | 524 --------- keyboards/infinity_ergodox/config.h | 80 -- .../drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h | 113 -- .../drivers/gdisp/IS31FL3731C/driver.mk | 2 - .../drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 333 ------ .../drivers/gdisp/IS31FL3731C/gdisp_lld_config.h | 36 - .../drivers/gdisp/emulator_lcd/driver.mk | 2 - .../drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 - .../drivers/gdisp/emulator_led/driver.mk | 2 - .../drivers/gdisp/emulator_led/emulator_led.c | 10 - .../drivers/gdisp/st7565ergodox/board_ST7565.h | 127 -- .../drivers/gdisp/st7565ergodox/driver.mk | 2 - .../drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c | 292 ----- .../drivers/gdisp/st7565ergodox/gdisp_lld_config.h | 26 - .../drivers/gdisp/st7565ergodox/st7565.h | 37 - keyboards/infinity_ergodox/gfxconf.h | 331 ------ keyboards/infinity_ergodox/halconf.h | 353 ------ keyboards/infinity_ergodox/infinity_ergodox.c | 76 -- keyboards/infinity_ergodox/infinity_ergodox.h | 44 - .../infinity_ergodox/keymaps/default/keymap.c | 114 -- .../infinity_ergodox/keymaps/default/visualizer.c | 168 --- keyboards/infinity_ergodox/led.c | 49 - keyboards/infinity_ergodox/matrix.c | 169 --- keyboards/infinity_ergodox/mcuconf.h | 74 -- 435 files changed, 27312 insertions(+), 27277 deletions(-) create mode 100644 keyboards/ergodox/Makefile create mode 100644 keyboards/ergodox/ergodox.c create mode 100644 keyboards/ergodox/ergodox.h create mode 100755 keyboards/ergodox/ez/190hotfix.sh create mode 100644 keyboards/ergodox/ez/Makefile create mode 100644 keyboards/ergodox/ez/config.h create mode 100644 keyboards/ergodox/ez/ez.c create mode 100644 keyboards/ergodox/ez/ez.h create mode 100644 keyboards/ergodox/ez/i2cmaster.h create mode 100644 keyboards/ergodox/ez/matrix.c create mode 100644 keyboards/ergodox/ez/readme.md create mode 100644 keyboards/ergodox/ez/twimaster.c create mode 100644 keyboards/ergodox/ez/util/compile_keymap.py create mode 100644 keyboards/ergodox/ez/util/readme.md create mode 100644 keyboards/ergodox/infinity/MEMO.txt create mode 100644 keyboards/ergodox/infinity/Makefile create mode 100644 keyboards/ergodox/infinity/bootloader_defs.h create mode 100644 keyboards/ergodox/infinity/chconf.h create mode 100644 keyboards/ergodox/infinity/config.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h create mode 100644 keyboards/ergodox/infinity/gfxconf.h create mode 100644 keyboards/ergodox/infinity/halconf.h create mode 100644 keyboards/ergodox/infinity/infinity.c create mode 100644 keyboards/ergodox/infinity/infinity.h create mode 100644 keyboards/ergodox/infinity/keymaps/default/keymap.c create mode 100644 keyboards/ergodox/infinity/keymaps/default/visualizer.c create mode 100644 keyboards/ergodox/infinity/led.c create mode 100644 keyboards/ergodox/infinity/matrix.c create mode 100644 keyboards/ergodox/infinity/mcuconf.h create mode 100644 keyboards/ergodox/keymaps/ab/Makefile create mode 100644 keyboards/ergodox/keymaps/ab/keyboard-layout.json create mode 100644 keyboards/ergodox/keymaps/ab/keyboard-layout.png create mode 100644 keyboards/ergodox/keymaps/ab/keymap.c create mode 100644 keyboards/ergodox/keymaps/ab/readme.md create mode 100644 keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c create mode 100644 keyboards/ergodox/keymaps/adnw_k_o_y/readme.md create mode 100644 keyboards/ergodox/keymaps/alexjj/keymap.c create mode 100644 keyboards/ergodox/keymaps/alexjj/readme.md create mode 100644 keyboards/ergodox/keymaps/alexjj/rl-layout.jpg create mode 100644 keyboards/ergodox/keymaps/algernon/COPYING create mode 100644 keyboards/ergodox/keymaps/algernon/Makefile create mode 100644 keyboards/ergodox/keymaps/algernon/config.h create mode 100644 keyboards/ergodox/keymaps/algernon/images/adore-layer.png create mode 100644 keyboards/ergodox/keymaps/algernon/images/base-layer.png create mode 100644 keyboards/ergodox/keymaps/algernon/images/heatmap.png create mode 100644 keyboards/ergodox/keymaps/algernon/images/hun-layer.png create mode 100644 keyboards/ergodox/keymaps/algernon/images/nav-n-media-layer.png create mode 100644 keyboards/ergodox/keymaps/algernon/images/one-handed-layer.png create mode 100644 keyboards/ergodox/keymaps/algernon/images/steno-layer.png create mode 100644 keyboards/ergodox/keymaps/algernon/keymap.c create mode 100644 keyboards/ergodox/keymaps/algernon/readme.md create mode 100644 keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json create mode 100644 keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json create mode 100755 keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py create mode 100755 keyboards/ergodox/keymaps/algernon/tools/max-focused create mode 100644 keyboards/ergodox/keymaps/andrew_osx/keymap.c create mode 100644 keyboards/ergodox/keymaps/bepo/bepo.png create mode 100644 keyboards/ergodox/keymaps/bepo/keymap.c create mode 100644 keyboards/ergodox/keymaps/bepo/readme.md create mode 100644 keyboards/ergodox/keymaps/coderkun_neo2/Makefile create mode 100644 keyboards/ergodox/keymaps/coderkun_neo2/keymap.c create mode 100644 keyboards/ergodox/keymaps/coderkun_neo2/readme.md create mode 100644 keyboards/ergodox/keymaps/colemak/keymap.c create mode 100644 keyboards/ergodox/keymaps/colemak/readme.md create mode 100644 keyboards/ergodox/keymaps/colemak_osx_pc_no/keyboard-layout.png create mode 100644 keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c create mode 100644 keyboards/ergodox/keymaps/colemak_osx_pc_no/readme.md create mode 100644 keyboards/ergodox/keymaps/csharp_dev/csharp_dev.png create mode 100644 keyboards/ergodox/keymaps/csharp_dev/csharp_dev_legend.png create mode 100644 keyboards/ergodox/keymaps/csharp_dev/keymap.c create mode 100644 keyboards/ergodox/keymaps/csharp_dev/readme.md create mode 100644 keyboards/ergodox/keymaps/dave/keymap.c create mode 100644 keyboards/ergodox/keymaps/dave/readme.md create mode 100644 keyboards/ergodox/keymaps/default/default.png create mode 100644 keyboards/ergodox/keymaps/default/default_highres.png create mode 100644 keyboards/ergodox/keymaps/default/keymap.c create mode 100644 keyboards/ergodox/keymaps/default/readme.md create mode 100644 keyboards/ergodox/keymaps/default_osx/default_osx_highres.png create mode 100644 keyboards/ergodox/keymaps/default_osx/keymap.c create mode 100644 keyboards/ergodox/keymaps/default_osx/readme.md create mode 100644 keyboards/ergodox/keymaps/dragon788/keymap.c create mode 100644 keyboards/ergodox/keymaps/dvorak/dvorak.png create mode 100644 keyboards/ergodox/keymaps/dvorak/keymap.c create mode 100644 keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout0.png create mode 100644 keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout1.png create mode 100644 keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout2.png create mode 100644 keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c create mode 100644 keyboards/ergodox/keymaps/dvorak_intl_squisher/readme.md create mode 100755 keyboards/ergodox/keymaps/dvorak_spanish/keymap.c create mode 100644 keyboards/ergodox/keymaps/dvorak_spanish/readme.md create mode 100644 keyboards/ergodox/keymaps/emacs_osx_dk/default_highres.png create mode 100644 keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c create mode 100644 keyboards/ergodox/keymaps/emacs_osx_dk/readme.md create mode 100644 keyboards/ergodox/keymaps/erez_experimental/Makefile create mode 100644 keyboards/ergodox/keymaps/erez_experimental/config.h create mode 100644 keyboards/ergodox/keymaps/erez_experimental/keymap.c create mode 100644 keyboards/ergodox/keymaps/erez_experimental/readme.md create mode 100644 keyboards/ergodox/keymaps/german-kinergo/keymap.c create mode 100644 keyboards/ergodox/keymaps/german-kinergo/layout-code.png create mode 100644 keyboards/ergodox/keymaps/german-kinergo/layout-media.png create mode 100644 keyboards/ergodox/keymaps/german-kinergo/layout.png create mode 100644 keyboards/ergodox/keymaps/german-kinergo/readme.md create mode 100644 keyboards/ergodox/keymaps/german-manuneo/compile_keymap.py create mode 100644 keyboards/ergodox/keymaps/german-manuneo/keymap.c create mode 100644 keyboards/ergodox/keymaps/german-manuneo/keymap.md create mode 100644 keyboards/ergodox/keymaps/german/keymap.c create mode 100644 keyboards/ergodox/keymaps/j3rn/keymap.c create mode 100644 keyboards/ergodox/keymaps/j3rn/readme.md create mode 100644 keyboards/ergodox/keymaps/jack/keymap.c create mode 100644 keyboards/ergodox/keymaps/jacobono/img/colemak-default-layer.png create mode 100644 keyboards/ergodox/keymaps/jacobono/img/number-dpad-layer.png create mode 100644 keyboards/ergodox/keymaps/jacobono/img/symbol-layer.png create mode 100644 keyboards/ergodox/keymaps/jacobono/keymap.c create mode 100644 keyboards/ergodox/keymaps/jacobono/readme.md create mode 100644 keyboards/ergodox/keymaps/jgarr/keymap.c create mode 100644 keyboards/ergodox/keymaps/josh/keymap.c create mode 100644 keyboards/ergodox/keymaps/josh/readme.md create mode 100644 keyboards/ergodox/keymaps/kastyle/keymap.c create mode 100644 keyboards/ergodox/keymaps/kines-ish/keymap.c create mode 100644 keyboards/ergodox/keymaps/kines-ish/readme.md create mode 100644 keyboards/ergodox/keymaps/maz/keymap.c create mode 100644 keyboards/ergodox/keymaps/maz/readme.md create mode 100644 keyboards/ergodox/keymaps/mpiechotka/keymap.c create mode 100644 keyboards/ergodox/keymaps/mpiechotka/readme.md create mode 100644 keyboards/ergodox/keymaps/msc/img/code_layer.png create mode 100644 keyboards/ergodox/keymaps/msc/img/main_layer.png create mode 100644 keyboards/ergodox/keymaps/msc/img/media_layer.png create mode 100644 keyboards/ergodox/keymaps/msc/keymap.c create mode 100644 keyboards/ergodox/keymaps/msc/readme.md create mode 100644 keyboards/ergodox/keymaps/naps62/keymap.c create mode 100644 keyboards/ergodox/keymaps/naps62/readme.md create mode 100644 keyboards/ergodox/keymaps/ordinary/keymap.c create mode 100644 keyboards/ergodox/keymaps/ordinary/ordinary-base.png create mode 100644 keyboards/ergodox/keymaps/ordinary/ordinary-base.txt create mode 100644 keyboards/ergodox/keymaps/ordinary/ordinary-media.png create mode 100644 keyboards/ergodox/keymaps/ordinary/ordinary-media.txt create mode 100644 keyboards/ergodox/keymaps/ordinary/ordinary-special.png create mode 100644 keyboards/ergodox/keymaps/ordinary/ordinary-special.txt create mode 100644 keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png create mode 100644 keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt create mode 100644 keyboards/ergodox/keymaps/ordinary/readme.md create mode 100644 keyboards/ergodox/keymaps/osx_de/keymap.c create mode 100644 keyboards/ergodox/keymaps/osx_de/osx_de_highres.png create mode 100644 keyboards/ergodox/keymaps/osx_de/readme.md create mode 100644 keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c create mode 100644 keyboards/ergodox/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png create mode 100644 keyboards/ergodox/keymaps/osx_de_experimental/keymap.c create mode 100644 keyboards/ergodox/keymaps/osx_de_experimental/osx_de_experimental_highres.png create mode 100644 keyboards/ergodox/keymaps/osx_de_experimental/readme.md create mode 100644 keyboards/ergodox/keymaps/osx_fr/keymap.c create mode 100644 keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c create mode 100644 keyboards/ergodox/keymaps/plover/keymap.c create mode 100644 keyboards/ergodox/keymaps/plums/keymap.c create mode 100644 keyboards/ergodox/keymaps/plums/plums.png create mode 100644 keyboards/ergodox/keymaps/plums/readme.md create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-osx/readme.md create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/readme.md create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/readme.md create mode 100644 keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png create mode 100644 keyboards/ergodox/keymaps/sneako/keymap.c create mode 100644 keyboards/ergodox/keymaps/sneako/readme.md create mode 100644 keyboards/ergodox/keymaps/software_neo2/keymap.c create mode 100644 keyboards/ergodox/keymaps/supercoder/config_user.h create mode 100644 keyboards/ergodox/keymaps/supercoder/images/layout.png create mode 100644 keyboards/ergodox/keymaps/supercoder/images/supercoder_2000.jpg create mode 100644 keyboards/ergodox/keymaps/supercoder/keymap.c create mode 100644 keyboards/ergodox/keymaps/supercoder/makefile.mk create mode 100644 keyboards/ergodox/keymaps/supercoder/readme.md create mode 100644 keyboards/ergodox/keymaps/techtomas/keymap.c create mode 100644 keyboards/ergodox/keymaps/techtomas/readme.md create mode 100644 keyboards/ergodox/keymaps/teckinesis/keymap.c create mode 100644 keyboards/ergodox/keymaps/teckinesis/ordinary-special.png create mode 100644 keyboards/ergodox/keymaps/teckinesis/ordinary-special.txt create mode 100644 keyboards/ergodox/keymaps/teckinesis/readme.md create mode 100644 keyboards/ergodox/keymaps/teckinesis/teckinesis-base.json create mode 100644 keyboards/ergodox/keymaps/teckinesis/teckinesis-base.png create mode 100644 keyboards/ergodox/keymaps/teckinesis/teckinesis-media.json create mode 100644 keyboards/ergodox/keymaps/teckinesis/teckinesis-media.png create mode 100644 keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.json create mode 100644 keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.png create mode 100644 keyboards/ergodox/keymaps/tkuichooseyou/README.md create mode 100644 keyboards/ergodox/keymaps/tkuichooseyou/compiled.hex create mode 100644 keyboards/ergodox/keymaps/tkuichooseyou/keymap.c create mode 100644 keyboards/ergodox/keymaps/tm2030/keymap.c create mode 100644 keyboards/ergodox/keymaps/tm2030/readme.md create mode 100644 keyboards/ergodox/keymaps/tonyabra_osx/keymap.c create mode 100644 keyboards/ergodox/keymaps/tonyabra_osx/readme.md create mode 100644 keyboards/ergodox/keymaps/townk_osx/config.h create mode 100644 keyboards/ergodox/keymaps/townk_osx/keymap.c create mode 100644 keyboards/ergodox/keymaps/townk_osx/makefile.mk create mode 100644 keyboards/ergodox/keymaps/townk_osx/readme.md create mode 100644 keyboards/ergodox/keymaps/townk_osx/townk_osx_base.png create mode 100644 keyboards/ergodox/keymaps/townk_osx/townk_osx_fn.png create mode 100644 keyboards/ergodox/keymaps/townk_osx/townk_osx_keypad.png create mode 100644 keyboards/ergodox/keymaps/twey/keymap.c create mode 100644 keyboards/ergodox/keymaps/twey/readme.md create mode 100644 keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c create mode 100644 keyboards/ergodox/keymaps/zweihander-osx/keymap.c create mode 100644 keyboards/ergodox/keymaps/zweihander-osx/readme.markdown delete mode 100755 keyboards/ergodox_ez/190hotfix.sh delete mode 100644 keyboards/ergodox_ez/Makefile delete mode 100644 keyboards/ergodox_ez/config.h delete mode 100644 keyboards/ergodox_ez/ergodox_ez.c delete mode 100644 keyboards/ergodox_ez/ergodox_ez.h delete mode 100644 keyboards/ergodox_ez/i2cmaster.h delete mode 100644 keyboards/ergodox_ez/keymaps/ab/Makefile delete mode 100644 keyboards/ergodox_ez/keymaps/ab/keyboard-layout.json delete mode 100644 keyboards/ergodox_ez/keymaps/ab/keyboard-layout.png delete mode 100644 keyboards/ergodox_ez/keymaps/ab/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/ab/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/adnw_k_o_y/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/adnw_k_o_y/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/alexjj/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/alexjj/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/alexjj/rl-layout.jpg delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/COPYING delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/Makefile delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/config.h delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/hun-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/nav-n-media-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/one-handed-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/images/steno-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-adore-layout.json delete mode 100644 keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json delete mode 100755 keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py delete mode 100755 keyboards/ergodox_ez/keymaps/algernon/tools/max-focused delete mode 100644 keyboards/ergodox_ez/keymaps/andrew_osx/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/bepo/bepo.png delete mode 100644 keyboards/ergodox_ez/keymaps/bepo/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/bepo/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile delete mode 100644 keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/coderkun_neo2/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/colemak/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/colemak/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keyboard-layout.png delete mode 100644 keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/csharp_dev/csharp_dev.png delete mode 100644 keyboards/ergodox_ez/keymaps/csharp_dev/csharp_dev_legend.png delete mode 100644 keyboards/ergodox_ez/keymaps/csharp_dev/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/csharp_dev/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/dave/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/dave/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/default/default.png delete mode 100644 keyboards/ergodox_ez/keymaps/default/default_highres.png delete mode 100644 keyboards/ergodox_ez/keymaps/default/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/default/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/default_osx/default_osx_highres.png delete mode 100644 keyboards/ergodox_ez/keymaps/default_osx/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/default_osx/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/dragon788/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/dvorak/dvorak.png delete mode 100644 keyboards/ergodox_ez/keymaps/dvorak/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout0.png delete mode 100644 keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout1.png delete mode 100644 keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout2.png delete mode 100644 keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/readme.md delete mode 100755 keyboards/ergodox_ez/keymaps/dvorak_spanish/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/dvorak_spanish/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/emacs_osx_dk/default_highres.png delete mode 100644 keyboards/ergodox_ez/keymaps/emacs_osx_dk/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/emacs_osx_dk/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/erez_experimental/Makefile delete mode 100644 keyboards/ergodox_ez/keymaps/erez_experimental/config.h delete mode 100644 keyboards/ergodox_ez/keymaps/erez_experimental/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/erez_experimental/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/german-kinergo/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/german-kinergo/layout-code.png delete mode 100644 keyboards/ergodox_ez/keymaps/german-kinergo/layout-media.png delete mode 100644 keyboards/ergodox_ez/keymaps/german-kinergo/layout.png delete mode 100644 keyboards/ergodox_ez/keymaps/german-kinergo/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/german-manuneo/compile_keymap.py delete mode 100644 keyboards/ergodox_ez/keymaps/german-manuneo/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/german-manuneo/keymap.md delete mode 100644 keyboards/ergodox_ez/keymaps/german/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/j3rn/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/j3rn/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/jack/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/jacobono/img/colemak-default-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/jacobono/img/number-dpad-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/jacobono/img/symbol-layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/jacobono/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/jacobono/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/jgarr/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/josh/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/josh/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/kastyle/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/kines-ish/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/kines-ish/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/maz/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/maz/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/mpiechotka/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/mpiechotka/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/msc/img/code_layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/msc/img/main_layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/msc/img/media_layer.png delete mode 100644 keyboards/ergodox_ez/keymaps/msc/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/msc/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/naps62/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/naps62/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/ordinary-base.png delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/ordinary-base.txt delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.png delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.txt delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.png delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.txt delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.png delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt delete mode 100644 keyboards/ergodox_ez/keymaps/ordinary/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/osx_de/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/osx_de/osx_de_highres.png delete mode 100644 keyboards/ergodox_ez/keymaps/osx_de/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png delete mode 100644 keyboards/ergodox_ez/keymaps/osx_de_experimental/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental_highres.png delete mode 100644 keyboards/ergodox_ez/keymaps/osx_de_experimental/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/osx_fr/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/plover/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/plums/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/plums/plums.png delete mode 100644 keyboards/ergodox_ez/keymaps/plums/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png delete mode 100644 keyboards/ergodox_ez/keymaps/sneako/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/sneako/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/software_neo2/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/supercoder/config_user.h delete mode 100644 keyboards/ergodox_ez/keymaps/supercoder/images/layout.png delete mode 100644 keyboards/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg delete mode 100644 keyboards/ergodox_ez/keymaps/supercoder/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/supercoder/makefile.mk delete mode 100644 keyboards/ergodox_ez/keymaps/supercoder/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/techtomas/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/techtomas/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.png delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/ordinary-special.txt delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.json delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json delete mode 100644 keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png delete mode 100644 keyboards/ergodox_ez/keymaps/tkuichooseyou/README.md delete mode 100644 keyboards/ergodox_ez/keymaps/tkuichooseyou/compiled.hex delete mode 100644 keyboards/ergodox_ez/keymaps/tkuichooseyou/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/tm2030/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/tm2030/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/tonyabra_osx/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/tonyabra_osx/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/townk_osx/config.h delete mode 100644 keyboards/ergodox_ez/keymaps/townk_osx/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/townk_osx/makefile.mk delete mode 100644 keyboards/ergodox_ez/keymaps/townk_osx/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_base.png delete mode 100644 keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_fn.png delete mode 100644 keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_keypad.png delete mode 100644 keyboards/ergodox_ez/keymaps/twey/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/twey/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/workman_osx_mdw/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/zweihander-osx/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/zweihander-osx/readme.markdown delete mode 100644 keyboards/ergodox_ez/matrix.c delete mode 100644 keyboards/ergodox_ez/readme.md delete mode 100644 keyboards/ergodox_ez/twimaster.c delete mode 100644 keyboards/ergodox_ez/util/compile_keymap.py delete mode 100644 keyboards/ergodox_ez/util/readme.md delete mode 100644 keyboards/infinity_ergodox/MEMO.txt delete mode 100644 keyboards/infinity_ergodox/Makefile delete mode 100644 keyboards/infinity_ergodox/bootloader_defs.h delete mode 100644 keyboards/infinity_ergodox/chconf.h delete mode 100644 keyboards/infinity_ergodox/config.h delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h delete mode 100644 keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h delete mode 100644 keyboards/infinity_ergodox/gfxconf.h delete mode 100644 keyboards/infinity_ergodox/halconf.h delete mode 100644 keyboards/infinity_ergodox/infinity_ergodox.c delete mode 100644 keyboards/infinity_ergodox/infinity_ergodox.h delete mode 100644 keyboards/infinity_ergodox/keymaps/default/keymap.c delete mode 100644 keyboards/infinity_ergodox/keymaps/default/visualizer.c delete mode 100644 keyboards/infinity_ergodox/led.c delete mode 100644 keyboards/infinity_ergodox/matrix.c delete mode 100644 keyboards/infinity_ergodox/mcuconf.h diff --git a/keyboards/ergodox/Makefile b/keyboards/ergodox/Makefile new file mode 100644 index 000000000..05fb588d1 --- /dev/null +++ b/keyboards/ergodox/Makefile @@ -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 diff --git a/keyboards/ergodox/ergodox.c b/keyboards/ergodox/ergodox.c new file mode 100644 index 000000000..992e95d81 --- /dev/null +++ b/keyboards/ergodox/ergodox.c @@ -0,0 +1,8 @@ +/* + * ergodox.c + * + * Created on: 7 jul 2016 + * Author: Fred Wales + */ + + diff --git a/keyboards/ergodox/ergodox.h b/keyboards/ergodox/ergodox.h new file mode 100644 index 000000000..fe54e3260 --- /dev/null +++ b/keyboards/ergodox/ergodox.h @@ -0,0 +1,11 @@ +#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_ */ diff --git a/keyboards/ergodox/ez/190hotfix.sh b/keyboards/ergodox/ez/190hotfix.sh new file mode 100755 index 000000000..bdc3adce2 --- /dev/null +++ b/keyboards/ergodox/ez/190hotfix.sh @@ -0,0 +1,19 @@ +#!/bin/bash +#a tool to fix broken keymaps as a result of pull request #190 +#changing the declaration of matrix_scan_user() and matrix_init_user() +# +#This script will save a copy of the specified keymap as keymap.c.bak +#and then create a new keymap.c with the definion corrected. +#this script must be run from the ergodox_ez directory +if [ $# -ne 1 ]; then + echo $0: usage: ./190hotfix keymap_name + exit 1 +fi + +echo Saving backup as ./keymaps/$1/keymap.c.bak ... +mv ./keymaps/$1/keymap.c ./keymaps/$1/keymap.c.bak + +echo Modifying ./keymaps/$1/keymap.c ... +cat ./keymaps/$1/keymap.c.bak | sed -r 's/^void \* matrix_/void matrix_/'>./keymaps/$1/keymap.c + +echo Complete! diff --git a/keyboards/ergodox/ez/Makefile b/keyboards/ergodox/ez/Makefile new file mode 100644 index 000000000..37e554b30 --- /dev/null +++ b/keyboards/ergodox/ez/Makefile @@ -0,0 +1,76 @@ +#---------------------------------------------------------------------------- +# 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). +# +#---------------------------------------------------------------------------- + +# # project specific files +SRC = twimaster.c \ + matrix.c + +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# comment out to disable the options. +# + +ifndef QUANTUM_DIR + include ../../../Makefile +endif 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 diff --git a/keyboards/ergodox/ez/ez.c b/keyboards/ergodox/ez/ez.c new file mode 100644 index 000000000..e7afc9859 --- /dev/null +++ b/keyboards/ergodox/ez/ez.c @@ -0,0 +1,85 @@ +#include "ez.h" +#include "i2cmaster.h" + +bool i2c_initialized = 0; +uint8_t mcp23018_status = 0x20; + +void matrix_init_kb(void) { + // keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md") + TCCR1A = 0b10101001; // set and configure fast PWM + TCCR1B = 0b00001001; // set and configure fast PWM + + // (tied to Vcc for hardware convenience) + DDRB &= ~(1<<4); // set B(4) as input + PORTB &= ~(1<<4); // set B(4) internal pull-up disabled + + // unused pins - C7, D4, D5, D7, E6 + // set as input with internal pull-ip enabled + DDRC &= ~(1<<7); + DDRD &= ~(1<<7 | 1<<5 | 1<<4); + DDRE &= ~(1<<6); + PORTC |= (1<<7); + PORTD |= (1<<7 | 1<<5 | 1<<4); + PORTE |= (1<<6); + + ergodox_blink_all_leds(); + + matrix_init_user(); +} + +void ergodox_blink_all_leds(void) +{ + ergodox_led_all_off(); + ergodox_led_all_set(LED_BRIGHTNESS_HI); + ergodox_right_led_1_on(); + _delay_ms(50); + ergodox_right_led_2_on(); + _delay_ms(50); + ergodox_right_led_3_on(); + _delay_ms(50); + ergodox_right_led_1_off(); + _delay_ms(50); + ergodox_right_led_2_off(); + _delay_ms(50); + ergodox_right_led_3_off(); + //ergodox_led_all_on(); + //_delay_ms(333); + ergodox_led_all_off(); +} + +uint8_t init_mcp23018(void) { + mcp23018_status = 0x20; + + // I2C subsystem + if (i2c_initialized == 0) { + i2c_init(); // on pins D(1,0) + i2c_initialized++; + _delay_ms(1000); + } + + // set pin direction + // - unused : input : 1 + // - input : input : 1 + // - driving : output : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; + i2c_stop(); + + // set pull-up + // - unused : on : 1 + // - input : on : 1 + // - driving : off : 0 + mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; + +out: + i2c_stop(); + + return mcp23018_status; +} + + diff --git a/keyboards/ergodox/ez/ez.h b/keyboards/ergodox/ez/ez.h new file mode 100644 index 000000000..db4ec867b --- /dev/null +++ b/keyboards/ergodox/ez/ez.h @@ -0,0 +1,122 @@ +#ifndef ERGODOX_EZ_H +#define ERGODOX_EZ_H + +#include "quantum.h" +#include +#include +#include "i2cmaster.h" +#include + +#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) +#define CPU_16MHz 0x00 + +// I2C aliases and register addresses (see "mcp23018.md") +#define I2C_ADDR 0b0100000 +#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) +#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) +#define IODIRA 0x00 // i/o direction register +#define IODIRB 0x01 +#define GPPUA 0x0C // GPIO pull-up resistor register +#define GPPUB 0x0D +#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) +#define GPIOB 0x13 +#define OLATA 0x14 // output latch register +#define OLATB 0x15 + +extern uint8_t mcp23018_status; + +void init_ergodox(void); +void ergodox_blink_all_leds(void); +uint8_t init_mcp23018(void); +uint8_t ergodox_left_leds_update(void); + +#define LED_BRIGHTNESS_LO 15 +#define LED_BRIGHTNESS_HI 255 + + +inline void ergodox_board_led_on(void) { DDRD |= (1<<6); PORTD |= (1<<6); } +inline void ergodox_right_led_1_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); } +inline void ergodox_right_led_2_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } +inline void ergodox_right_led_3_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } +inline void ergodox_right_led_on(uint8_t led) { DDRB |= (1<<(led+4)); PORTB |= (1<<(led+4)); } + +inline void ergodox_board_led_off(void) { DDRD &= ~(1<<6); PORTD &= ~(1<<6); } +inline void ergodox_right_led_1_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); } +inline void ergodox_right_led_2_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); } +inline void ergodox_right_led_3_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); } +inline void ergodox_right_led_off(uint8_t led) { DDRB &= ~(1<<(led+4)); PORTB &= ~(1<<(led+4)); } + +inline void ergodox_led_all_on(void) +{ + ergodox_board_led_on(); + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); +} + +inline void ergodox_led_all_off(void) +{ + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); +} + +inline void ergodox_right_led_1_set(uint8_t n) { OCR1A = n; } +inline void ergodox_right_led_2_set(uint8_t n) { OCR1B = n; } +inline void ergodox_right_led_3_set(uint8_t n) { OCR1C = n; } +inline void ergodox_right_led_set(uint8_t led, uint8_t n) { + (led == 1) ? (OCR1A = n) : + (led == 2) ? (OCR1B = n) : + (OCR1C = n); +} + +inline void ergodox_led_all_set(uint8_t n) +{ + ergodox_right_led_1_set(n); + ergodox_right_led_2_set(n); + ergodox_right_led_3_set(n); +} + +#define KEYMAP( \ + \ + /* left hand, spatial positions */ \ + k00,k01,k02,k03,k04,k05,k06, \ + k10,k11,k12,k13,k14,k15,k16, \ + k20,k21,k22,k23,k24,k25, \ + k30,k31,k32,k33,k34,k35,k36, \ + k40,k41,k42,k43,k44, \ + k55,k56, \ + k54, \ + k53,k52,k51, \ + \ + /* right hand, spatial positions */ \ + k07,k08,k09,k0A,k0B,k0C,k0D, \ + k17,k18,k19,k1A,k1B,k1C,k1D, \ + k28,k29,k2A,k2B,k2C,k2D, \ + k37,k38,k39,k3A,k3B,k3C,k3D, \ + k49,k4A,k4B,k4C,k4D, \ + k57,k58, \ + k59, \ + k5C,k5B,k5A ) \ + \ + /* matrix positions */ \ + { \ + { k00, k10, k20, k30, k40, KC_NO }, \ + { k01, k11, k21, k31, k41, k51 }, \ + { k02, k12, k22, k32, k42, k52 }, \ + { k03, k13, k23, k33, k43, k53 }, \ + { k04, k14, k24, k34, k44, k54 }, \ + { k05, k15, k25, k35, KC_NO, k55 }, \ + { k06, k16, KC_NO, k36, KC_NO, k56 }, \ + \ + { k07, k17, KC_NO, k37,KC_NO, k57 }, \ + { k08, k18, k28, k38,KC_NO, k58 }, \ + { k09, k19, k29, k39, k49, k59 }, \ + { k0A, k1A, k2A, k3A, k4A, k5A }, \ + { k0B, k1B, k2B, k3B, k4B, k5B }, \ + { k0C, k1C, k2C, k3C, k4C, k5C }, \ + { k0D, k1D, k2D, k3D, k4D, KC_NO } \ + } + +#endif diff --git a/keyboards/ergodox/ez/i2cmaster.h b/keyboards/ergodox/ez/i2cmaster.h new file mode 100644 index 000000000..3917b9e6c --- /dev/null +++ b/keyboards/ergodox/ez/i2cmaster.h @@ -0,0 +1,178 @@ +#ifndef _I2CMASTER_H +#define _I2CMASTER_H 1 +/************************************************************************* +* Title: C include file for the I2C master interface +* (i2cmaster.S or twimaster.c) +* Author: Peter Fleury http://jump.to/fleury +* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ +* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 +* Target: any AVR device +* Usage: see Doxygen manual +**************************************************************************/ + +#ifdef DOXYGEN +/** + @defgroup pfleury_ic2master I2C Master library + @code #include @endcode + + @brief I2C (TWI) Master Software Library + + Basic routines for communicating with I2C slave devices. This single master + implementation is limited to one bus master on the I2C bus. + + This I2c library is implemented as a compact assembler software implementation of the I2C protocol + which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). + Since the API for these two implementations is exactly the same, an application can be linked either against the + software I2C implementation or the hardware I2C implementation. + + Use 4.7k pull-up resistor on the SDA and SCL pin. + + Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module + i2cmaster.S to your target when using the software I2C implementation ! + + Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. + + @note + The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted + to GNU assembler and AVR-GCC C call interface. + Replaced the incorrect quarter period delays found in AVR300 with + half period delays. + + @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury + + @par API Usage Example + The following code shows typical usage of this library, see example test_i2cmaster.c + + @code + + #include + + + #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet + + int main(void) + { + unsigned char ret; + + i2c_init(); // initialize I2C library + + // write 0x75 to EEPROM address 5 (Byte Write) + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + i2c_write(0x05); // write address = 5 + i2c_write(0x75); // write value 0x75 to EEPROM + i2c_stop(); // set stop conditon = release bus + + + // read previously written value back from EEPROM address 5 + i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode + + i2c_write(0x05); // write address = 5 + i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode + + ret = i2c_readNak(); // read one byte from EEPROM + i2c_stop(); + + for(;;); + } + @endcode + +*/ +#endif /* DOXYGEN */ + +/**@{*/ + +#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 +#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" +#endif + +#include + +/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_READ 1 + +/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ +#define I2C_WRITE 0 + + +/** + @brief initialize the I2C master interace. Need to be called only once + @param void + @return none + */ +extern void i2c_init(void); + + +/** + @brief Terminates the data transfer and releases the I2C bus + @param void + @return none + */ +extern void i2c_stop(void); + + +/** + @brief Issues a start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_start(unsigned char addr); + + +/** + @brief Issues a repeated start condition and sends address and transfer direction + + @param addr address and transfer direction of I2C device + @retval 0 device accessible + @retval 1 failed to access device + */ +extern unsigned char i2c_rep_start(unsigned char addr); + + +/** + @brief Issues a start condition and sends address and transfer direction + + If device is busy, use ack polling to wait until device ready + @param addr address and transfer direction of I2C device + @return none + */ +extern void i2c_start_wait(unsigned char addr); + + +/** + @brief Send one byte to I2C device + @param data byte to be transfered + @retval 0 write successful + @retval 1 write failed + */ +extern unsigned char i2c_write(unsigned char data); + + +/** + @brief read one byte from the I2C device, request more data from device + @return byte read from I2C device + */ +extern unsigned char i2c_readAck(void); + +/** + @brief read one byte from the I2C device, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_readNak(void); + +/** + @brief read one byte from the I2C device + + Implemented as a macro, which calls either i2c_readAck or i2c_readNak + + @param ack 1 send ack, request more data from device
+ 0 send nak, read is followed by a stop condition + @return byte read from I2C device + */ +extern unsigned char i2c_read(unsigned char ack); +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + + +/**@}*/ +#endif diff --git a/keyboards/ergodox/ez/matrix.c b/keyboards/ergodox/ez/matrix.c new file mode 100644 index 000000000..a19bab90b --- /dev/null +++ b/keyboards/ergodox/ez/matrix.c @@ -0,0 +1,382 @@ +/* + +Note for ErgoDox EZ customizers: Here be dragons! +This is not a file you want to be messing with. +All of the interesting stuff for you is under keymaps/ :) +Love, Erez + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "ez.h" +#include "i2cmaster.h" +#ifdef DEBUG_MATRIX_SCAN_RATE +#include "timer.h" +#endif + +/* + * This constant define not debouncing time in msecs, but amount of matrix + * scan loops which should be made to get stable debounced results. + * + * On Ergodox matrix scan rate is relatively low, because of slow I2C. + * Now it's only 317 scans/second, or about 3.15 msec/scan. + * According to Cherry specs, debouncing time is 5 msec. + * + * And so, there is no sense to have DEBOUNCE higher than 2. + */ + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(uint8_t row); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +static uint8_t mcp23018_reset_loop; + +#ifdef DEBUG_MATRIX_SCAN_RATE +uint32_t matrix_timer; +uint32_t matrix_scan_count; +#endif + + +__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(); +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // initialize row and col + + mcp23018_status = init_mcp23018(); + + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + + matrix_init_kb(); + +} + +void matrix_power_up(void) { + mcp23018_status = init_mcp23018(); + + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_timer = timer_read32(); + matrix_scan_count = 0; +#endif + +} + +uint8_t matrix_scan(void) +{ + if (mcp23018_status) { // if there was an error + if (++mcp23018_reset_loop == 0) { + // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans + // this will be approx bit more frequent than once per second + print("trying to reset mcp23018\n"); + mcp23018_status = init_mcp23018(); + if (mcp23018_status) { + print("left side not responding\n"); + } else { + print("left side attached\n"); + ergodox_blink_all_leds(); + } + } + } + +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_scan_count++; + + uint32_t timer_now = timer_read32(); + if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { + print("matrix scan frequency: "); + pdec(matrix_scan_count); + print("\n"); + + matrix_timer = timer_now; + matrix_scan_count = 0; + } +#endif + + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(i); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + wait_us(1); + // this should be wait_ms(1) but has been left as-is at EZ's request + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1< http://jump.to/fleury +* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $ +* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 +* Target: any AVR device with hardware TWI +* Usage: API compatible with I2C Software Library i2cmaster.h +**************************************************************************/ +#include +#include + +#include + + +/* define CPU frequency in Mhz here if not defined in Makefile */ +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +/* I2C clock in Hz */ +#define SCL_CLOCK 400000L + + +/************************************************************************* + Initialization of the I2C bus interface. Need to be called only once +*************************************************************************/ +void i2c_init(void) +{ + /* initialize TWI clock + * minimal values in Bit Rate Register (TWBR) and minimal Prescaler + * bits in the TWI Status Register should give us maximal possible + * I2C bus speed - about 444 kHz + * + * for more details, see 20.5.2 in ATmega16/32 secification + */ + + TWSR = 0; /* no prescaler */ + TWBR = 10; /* must be >= 10 for stable operation */ + +}/* i2c_init */ + + +/************************************************************************* + Issues a start condition and sends address and transfer direction. + return 0 = device accessible, 1= failed to access device +*************************************************************************/ +unsigned char i2c_start(unsigned char address) +{ + uint8_t twst; + + // send START condition + TWCR = (1<= 0: + if section['name'] == 'layout_config': + config.update(loads("\n".join( + section['code_lines'] + ))) + elif section['sub_name'].startswith('layer'): + layer_name = section['sub_name'] + config['layer_lines'][layer_name] = section['code_lines'] + + reset_section() + + def amend_section(line_index, line): + section['end_line'] = line_index + section['code_lines'].append(line) + + config = DEFAULT_CONFIG.copy() + config.update({ + 'layer_lines': collections.OrderedDict(), + 'macro_ids': {'UM'}, + 'unicode_macros': {}, + }) + + section = {} + reset_section() + + with io.open(path, encoding="utf-8") as fh: + for i, line in enumerate(fh): + if line.startswith("#"): + start_section(i, line) + elif line.startswith(" "): + amend_section(i, line[4:]) + else: + # TODO: maybe parse description + pass + + end_section() + assert 'layout' in config + return config + +# header file parsing + +IF0_RE = re.compile(r""" + ^ + #if 0 + $.*? + #endif +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +COMMENT_RE = re.compile(r""" + /\* + .*? + \*/" +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +def read_header_file(path): + with io.open(path, encoding="utf-8") as fh: + data = fh.read() + data, _ = COMMENT_RE.subn("", data) + data, _ = IF0_RE.subn("", data) + return data + + +def regex_partial(re_str_fmt, flags): + def partial(*args, **kwargs): + re_str = re_str_fmt.format(*args, **kwargs) + return re.compile(re_str, flags) + return partial + + +KEYDEF_REP = regex_partial(r""" + #define + \s + ( + (?:{}) # the prefixes + (?:\w+) # the key name + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +ENUM_RE = re.compile(r""" + ( + enum + \s\w+\s + \{ + .*? # the enum content + \} + ; + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +ENUM_KEY_REP = regex_partial(r""" + ( + {} # the prefixes + \w+ # the key name + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +def parse_keydefs(config, data): + prefix_options = "|".join(config['key_prefixes']) + keydef_re = KEYDEF_REP(prefix_options) + enum_key_re = ENUM_KEY_REP(prefix_options) + for match in keydef_re.finditer(data): + yield match.groups()[0] + + for enum_match in ENUM_RE.finditer(data): + enum = enum_match.groups()[0] + for key_match in enum_key_re.finditer(enum): + yield key_match.groups()[0] + + +def parse_valid_keys(config, out_path): + basepath = os.path.abspath(os.path.join(os.path.dirname(out_path))) + dirpaths = [] + subpaths = [] + while len(subpaths) < 6: + path = os.path.join(basepath, *subpaths) + dirpaths.append(path) + dirpaths.append(os.path.join(path, "tmk_core", "common")) + dirpaths.append(os.path.join(path, "quantum")) + subpaths.append('..') + + includes = set(config['keymaps_includes']) + includes.add("keycode.h") + + valid_keycodes = set() + for dirpath, include in it.product(dirpaths, includes): + include_path = os.path.join(dirpath, include) + if os.path.exists(include_path): + header_data = read_header_file(include_path) + valid_keycodes.update( + parse_keydefs(config, header_data) + ) + return valid_keycodes + + +# Keymap Parsing + +def iter_raw_codes(layer_lines, filler, separator): + filler_re = re.compile("[" + filler + " ]") + for line in layer_lines: + line, _ = filler_re.subn("", line.strip()) + if not line: + continue + codes = line.split(separator) + for code in codes[1:-1]: + yield code + + +def iter_indexed_codes(raw_codes, key_indexes): + key_rows = {} + key_indexes_flat = [] + + for row_index, key_indexes in enumerate(key_indexes): + for key_index in key_indexes: + key_rows[key_index] = row_index + key_indexes_flat.extend(key_indexes) + assert len(raw_codes) == len(key_indexes_flat) + for raw_code, key_index in zip(raw_codes, key_indexes_flat): + # we keep track of the row mostly for layout purposes + yield raw_code, key_index, key_rows[key_index] + + +LAYER_CHANGE_RE = re.compile(r""" + (DF|TG|MO)\(\d+\) +""", re.VERBOSE) + + +MACRO_RE = re.compile(r""" + M\(\w+\) +""", re.VERBOSE) + + +UNICODE_RE = re.compile(r""" + U[0-9A-F]{4} +""", re.VERBOSE) + + +NON_CODE = re.compile(r""" + ^[^A-Z0-9_]$ +""", re.VERBOSE) + + +def parse_uni_code(raw_code): + macro_id = "UC_" + ( + unicodedata.name(raw_code) + .replace(" ", "_") + .replace("-", "_") + ) + code = "M({})".format(macro_id) + uc_hex = "{:04X}".format(ord(raw_code)) + return code, macro_id, uc_hex + + +def parse_key_code(raw_code, key_prefixes, valid_keycodes): + if raw_code in valid_keycodes: + return raw_code + + for prefix in key_prefixes: + code = prefix + raw_code + if code in valid_keycodes: + return code + + +def parse_code(raw_code, key_prefixes, valid_keycodes): + if not raw_code: + return 'KC_TRNS', None, None + + if LAYER_CHANGE_RE.match(raw_code): + return raw_code, None, None + + if MACRO_RE.match(raw_code): + macro_id = raw_code[2:-1] + return raw_code, macro_id, None + + if UNICODE_RE.match(raw_code): + hex_code = raw_code[1:] + return parse_uni_code(chr(int(hex_code, 16))) + + if NON_CODE.match(raw_code): + return parse_uni_code(raw_code) + + code = parse_key_code(raw_code, key_prefixes, valid_keycodes) + return code, None, None + + +def parse_keymap(config, key_indexes, layer_lines, valid_keycodes): + keymap = {} + raw_codes = list(iter_raw_codes( + layer_lines, config['filler'], config['separator'] + )) + indexed_codes = iter_indexed_codes(raw_codes, key_indexes) + key_prefixes = config['key_prefixes'] + for raw_code, key_index, row_index in indexed_codes: + code, macro_id, uc_hex = parse_code( + raw_code, key_prefixes, valid_keycodes + ) + # TODO: line numbers for invalid codes + err_msg = "Could not parse key '{}' on row {}".format( + raw_code, row_index + ) + assert code is not None, err_msg + # print(repr(raw_code), repr(code), macro_id, uc_hex) + if macro_id: + config['macro_ids'].add(macro_id) + if uc_hex: + config['unicode_macros'][macro_id] = uc_hex + keymap[key_index] = (code, row_index) + return keymap + + +def parse_keymaps(config, valid_keycodes): + keymaps = collections.OrderedDict() + key_indexes = config.get( + 'key_indexes', KEYBOARD_LAYOUTS[config['layout']] + ) + # TODO: maybe validate key_indexes + + for layer_name, layer_lines, in config['layer_lines'].items(): + keymaps[layer_name] = parse_keymap( + config, key_indexes, layer_lines, valid_keycodes + ) + return keymaps + +# keymap.c output + +USERCODE = """ +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case L1: + ergodox_right_led_1_on(); + break; + case L2: + ergodox_right_led_2_on(); + break; + case L3: + ergodox_right_led_3_on(); + break; + case L4: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + break; + case L5: + ergodox_right_led_1_on(); + ergodox_right_led_3_on(); + break; + // case L6: + // ergodox_right_led_2_on(); + // ergodox_right_led_3_on(); + // break; + // case L7: + // ergodox_right_led_1_on(); + // ergodox_right_led_2_on(); + // ergodox_right_led_3_on(); + // break; + default: + ergodox_board_led_off(); + break; + } +}; +""" + +MACROCODE = """ +#define UC_MODE_WIN 0 +#define UC_MODE_LINUX 1 +#define UC_MODE_OSX 2 + +// TODO: allow default mode to be configured +static uint16_t unicode_mode = UC_MODE_WIN; + +uint16_t hextokeycode(uint8_t hex) {{ + if (hex == 0x0) {{ + return KC_P0; + }} + if (hex < 0xA) {{ + return KC_P1 + (hex - 0x1); + }} + return KC_A + (hex - 0xA); +}} + +void unicode_action_function(uint16_t hi, uint16_t lo) {{ + switch (unicode_mode) {{ + case UC_MODE_WIN: + register_code(KC_LALT); + + register_code(KC_PPLS); + unregister_code(KC_PPLS); + + register_code(hextokeycode((hi & 0xF0) >> 4)); + unregister_code(hextokeycode((hi & 0xF0) >> 4)); + register_code(hextokeycode((hi & 0x0F))); + unregister_code(hextokeycode((hi & 0x0F))); + register_code(hextokeycode((lo & 0xF0) >> 4)); + unregister_code(hextokeycode((lo & 0xF0) >> 4)); + register_code(hextokeycode((lo & 0x0F))); + unregister_code(hextokeycode((lo & 0x0F))); + + unregister_code(KC_LALT); + break; + case UC_MODE_LINUX: + register_code(KC_LCTL); + register_code(KC_LSFT); + + register_code(KC_U); + unregister_code(KC_U); + + register_code(hextokeycode((hi & 0xF0) >> 4)); + unregister_code(hextokeycode((hi & 0xF0) >> 4)); + register_code(hextokeycode((hi & 0x0F))); + unregister_code(hextokeycode((hi & 0x0F))); + register_code(hextokeycode((lo & 0xF0) >> 4)); + unregister_code(hextokeycode((lo & 0xF0) >> 4)); + register_code(hextokeycode((lo & 0x0F))); + unregister_code(hextokeycode((lo & 0x0F))); + + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + break; + case UC_MODE_OSX: + break; + }} +}} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {{ + if (!record->event.pressed) {{ + return MACRO_NONE; + }} + // MACRODOWN only works in this function + switch(id) {{ + case UM: + unicode_mode = (unicode_mode + 1) % 2; + break; +{macro_cases} +{unicode_macro_cases} + default: + break; + }} + return MACRO_NONE; +}}; +""" + + +UNICODE_MACRO_TEMPLATE = """ +case {macro_id}: + unicode_action_function(0x{hi:02x}, 0x{lo:02x}); + break; +""".strip() + + +def unicode_macro_cases(config): + for macro_id, uc_hex in config['unicode_macros'].items(): + hi = int(uc_hex, 16) >> 8 + lo = int(uc_hex, 16) & 0xFF + unimacro_keys = ", ".join( + "T({})".format( + "KP_" + digit if digit.isdigit() else digit + ) for digit in uc_hex + ) + yield UNICODE_MACRO_TEMPLATE.format( + macro_id=macro_id, hi=hi, lo=lo + ) + + +def iter_keymap_lines(keymap, row_indents=None): + col_widths = {} + col = 0 + # first pass, figure out the column widths + prev_row_index = None + for code, row_index in keymap.values(): + if row_index != prev_row_index: + col = 0 + if row_indents: + col = row_indents[row_index] + col_widths[col] = max(len(code), col_widths.get(col, 0)) + prev_row_index = row_index + col += 1 + + # second pass, yield the cell values + col = 0 + prev_row_index = None + for key_index in sorted(keymap): + code, row_index = keymap[key_index] + if row_index != prev_row_index: + col = 0 + yield "\n" + if row_indents: + for indent_col in range(row_indents[row_index]): + pad = " " * (col_widths[indent_col] - 4) + yield (" /*-*/" + pad) + col = row_indents[row_index] + else: + yield pad + yield " {}".format(code) + if key_index < len(keymap) - 1: + yield "," + # This will be yielded on the next iteration when + # we know that we're not at the end of a line. + pad = " " * (col_widths[col] - len(code)) + prev_row_index = row_index + col += 1 + + +def iter_keymap_parts(config, keymaps): + # includes + for include_path in config['keymaps_includes']: + yield '#include "{}"\n'.format(include_path) + + yield "\n" + + # definitions + for i, macro_id in enumerate(sorted(config['macro_ids'])): + yield "#define {} {}\n".format(macro_id, i) + + yield "\n" + + for i, layer_name in enumerate(config['layer_lines']): + yield '#define L{0:<3} {0:<5} // {1}\n'.format(i, layer_name) + + yield "\n" + + # keymaps + yield "const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n" + + for i, layer_name in enumerate(config['layer_lines']): + # comment + layer_lines = config['layer_lines'][layer_name] + prefixed_lines = " * " + " * ".join(layer_lines) + yield "/*\n{} */\n".format(prefixed_lines) + + # keymap codes + keymap = keymaps[layer_name] + row_indents = ROW_INDENTS.get(config['layout']) + keymap_lines = "".join(iter_keymap_lines(keymap, row_indents)) + yield "[L{0}] = KEYMAP({1}\n),\n".format(i, keymap_lines) + + yield "};\n\n" + + # no idea what this is for + yield "const uint16_t PROGMEM fn_actions[] = {};\n" + + # macros + yield MACROCODE.format( + macro_cases="", + unicode_macro_cases="\n".join(unicode_macro_cases(config)), + ) + + # TODO: dynamically create blinking lights + yield USERCODE + + +def main(argv=sys.argv[1:]): + if not argv or '-h' in argv or '--help' in argv: + print(__doc__) + return 0 + + in_path = os.path.abspath(argv[0]) + if not os.path.exists(in_path): + print("No such file '{}'".format(in_path)) + return 1 + + if len(argv) > 1: + out_path = os.path.abspath(argv[1]) + else: + dirname = os.path.dirname(in_path) + out_path = os.path.join(dirname, "keymap.c") + + config = parse_config(in_path) + valid_keys = parse_valid_keys(config, out_path) + keymaps = parse_keymaps(config, valid_keys) + + with io.open(out_path, mode="w", encoding="utf-8") as fh: + for part in iter_keymap_parts(config, keymaps): + fh.write(part) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/keyboards/ergodox/ez/util/readme.md b/keyboards/ergodox/ez/util/readme.md new file mode 100644 index 000000000..26c5e5d99 --- /dev/null +++ b/keyboards/ergodox/ez/util/readme.md @@ -0,0 +1,3 @@ +# ErgoDox EZ Utilities + +The Python script in this directory, by [mbarkhau](https://github.com/mbarkhau) allows you to write out a basic ErgoDox EZ keymap using Markdown notation, and then transpile it to C, which you can then compile. It's experimental, but if you're not comfortable using C, it's a nice option. diff --git a/keyboards/ergodox/infinity/MEMO.txt b/keyboards/ergodox/infinity/MEMO.txt new file mode 100644 index 000000000..e2886aa00 --- /dev/null +++ b/keyboards/ergodox/infinity/MEMO.txt @@ -0,0 +1,385 @@ +flabbergast's TMK/ChibiOS port +============================== +2015/10/16 + + +Build +----- +$ git clone -b chibios https://github.com/flabbergast/tmk_keyboard.git + +$ cd tmk_keyboard +$ git submodule add -f -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios +or +$ cd tmk_keyboard/tmk_core/tool/chibios +$ git clone -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios + +$ cd tmk_keyboard/keyboard/infinity_chibios +$ make + + + + +Chibios Configuration +--------------------- +halconf.h: for HAL configuration + placed in project directory + read in chibios/os/hal/hal.mk + included in chibios/os/hal/include/hal.h +mcuconf.h: for MCU configuration + placed in project directory + included in halconf.h + + +Chibios Term +------------ +PAL = Port Abstraction Layer + palWritePad + palReadPad + palSetPad + chibios/os/hal/include/pal.h + +LLD = Low Level Driver + + +Makefile +-------- + # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) + MCU_FAMILY = KINETIS + MCU_SERIES = KL2x + + # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ + # or /ld/ + MCU_LDSCRIPT = MKL26Z64 + + # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ + MCU_STARTUP = kl2x + + # Board: it should exist either in /os/hal/boards/ + # or /boards + BOARD = PJRC_TEENSY_LC + + MCU = cortex-m0 + + # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 + ARMV = 6 + + +halconf.h +--------- + + +mcuconf.h +--------- + + +chconf.h +-------- + + +ld script +--------- +--- ../../tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/ld/MKL26Z64.ld 2015-10-15 09:08:58.732904304 +0900 ++++ ld/MKL26Z64.ld 2015-10-15 08:48:06.430215496 +0900 +@@ -27,7 +27,8 @@ + { + flash0 : org = 0x00000000, len = 0xc0 + flashcfg : org = 0x00000400, len = 0x10 +- flash : org = 0x00000410, len = 64k - 0x410 ++ flash : org = 0x00000410, len = 62k - 0x410 ++ eeprom_emu : org = 0x0000F800, len = 2k + ram : org = 0x1FFFF800, len = 8k + } + +@@ -35,6 +36,10 @@ + __ram_size__ = LENGTH(ram); + __ram_end__ = __ram_start__ + __ram_size__; + ++__eeprom_workarea_start__ = ORIGIN(eeprom_emu); ++__eeprom_workarea_size__ = LENGTH(eeprom_emu); ++__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; ++ + SECTIONS + { + . = 0; + + + +Configuration/Startup for Infinity 60% +-------------------------------------- +Configuration: + + +Clock: +Inifinity + FEI(FLL Engaged Internal) mode with core clock:48MHz, bus clock:48MHz, flash clock:24MHz + Clock dividor: + SIM_CLKDIV1[OUTDIV1] = 0 divide-by-1 for core clock + SIM_CLKDIV1[OUTDIV2] = 0 divide-by-1 for bus clock + SIM_CLKDIV1[OUTDIV4] = 1 divide-by-2 for flash clock + Internal reference clock: + MCG_C1[IREFS] = 1 Internal Reference Select for clock source for FLL + MCG_C1[IRCLKEN] = 1 Internal Reference Clock Enable + FLL multipilication: + MCG_C4[DMX32] = 1 + MCG_C4[DRST_DRS] = 01 FLL factor 1464 * 32.768kHz = 48MHz + +chibios/os/hal/ports/KINETIS/K20x/hal_lld.c + k20x_clock_init(): called in __early_init() defined in board.c + disable watchdog and configure clock + + configurable macros: + KINETIS_NO_INIT: whether init or not + KINETIS_MCG_MODE: clock mode + KINETIS_MCG_MODE_FEI + KINETIS_MCG_MODE_PEE + hal/ports/KINETIS/K20x/hal_lld.h + + +chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.h + PALConfig pal_default_config + boardInit() + __early_init() + macro definitions for board infos, freq and mcu type + +chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.c + +USB + + +Startup +------- + common/ports/ARMCMx/GCC/crt0_v[67]m.s + Reset_Handler: startup code + common/ports/ARMCMx/GCC/crt1.c + __core_init(): weak + __early_init(): weak + __late_init(): weak + __default_exit(): weak + called from Reset_Handler of crt0 + common/ports/ARMCMx/GCC/vector.c + common/ports/ARMCMx/GCC/ld/*.ld + +chibios/os/common/ports/ARMCMx/compilers/GCC/ +├── crt0_v6m.s +├── crt0_v7m.s +├── crt1.c +├── ld +│   ├── MK20DX128BLDR3.ld +│   ├── MK20DX128BLDR4.ld +│   ├── MK20DX128.ld +│   ├── MK20DX256.ld +│   ├── MKL25Z128.ld +│   ├── MKL26Z128.ld +│   ├── MKL26Z64.ld +│   └── STM32L476xG.ld +├── mk +│   ├── startup_k20x5.mk +│   ├── startup_k20x7.mk +│   ├── startup_k20x.mk +│   ├── startup_kl2x.mk +│   └── startup_stm32l4xx.mk +├── rules.ld +├── rules.mk +└── vectors.c + +chibios/os/hal/ +├── boards +│   ├── FREESCALE_FREEDOM_K20D50M +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── MCHCK_K20 +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── PJRC_TEENSY_3 +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── PJRC_TEENSY_3_1 +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── PJRC_TEENSY_LC +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── readme.txt +│   ├── simulator +│   │   ├── board.c +│   │   ├── board.h +│   │   └── board.mk +│   ├── ST_NUCLEO_F030R8 +│   │   ├── board.c +│   │   ├── board.h +│   │   ├── board.mk +│   │   └── cfg +│   │   └── board.chcfg +├── hal.mk +├── include +│   ├── adc.h +│   ├── can.h +│   ├── dac.h +│   ├── ext.h +│   ├── gpt.h +│   ├── hal_channels.h +│   ├── hal_files.h +│   ├── hal.h +│   ├── hal_ioblock.h +│   ├── hal_mmcsd.h +│   ├── hal_queues.h +│   ├── hal_streams.h +│   ├── i2c.h +│   ├── i2s.h +│   ├── icu.h +│   ├── mac.h +│   ├── mii.h +│   ├── mmc_spi.h +│   ├── pal.h +│   ├── pwm.h +│   ├── rtc.h +│   ├── sdc.h +│   ├── serial.h +│   ├── serial_usb.h +│   ├── spi.h +│   ├── st.h +│   ├── uart.h +│   └── usb.h +├── lib +│   └── streams +│   ├── chprintf.c +│   ├── chprintf.h +│   ├── memstreams.c +│   ├── memstreams.h +│   ├── nullstreams.c +│   └── nullstreams.h +├── osal +│   ├── nil +│   │   ├── osal.c +│   │   ├── osal.h +│   │   └── osal.mk +│   ├── os-less +│   │   └── ARMCMx +│   │   ├── osal.c +│   │   ├── osal.h +│   │   └── osal.mk +│   └── rt +│   ├── osal.c +│   ├── osal.h +│   └── osal.mk +├── ports +│   ├── AVR +│   ├── common +│   │   └── ARMCMx +│   │   ├── mpu.h +│   │   ├── nvic.c +│   │   └── nvic.h +│   ├── KINETIS +│   │   ├── K20x +│   │   │   ├── hal_lld.c +│   │   │   ├── hal_lld.h +│   │   │   ├── kinetis_registry.h +│   │   │   ├── platform.dox +│   │   │   ├── platform.mk +│   │   │   ├── pwm_lld.c +│   │   │   ├── pwm_lld.h +│   │   │   ├── spi_lld.c +│   │   │   └── spi_lld.h +│   │   ├── KL2x +│   │   │   ├── hal_lld.c +│   │   │   ├── hal_lld.h +│   │   │   ├── kinetis_registry.h +│   │   │   ├── platform.mk +│   │   │   ├── pwm_lld.c +│   │   │   └── pwm_lld.h +│   │   ├── LLD +│   │   │   ├── adc_lld.c +│   │   │   ├── adc_lld.h +│   │   │   ├── ext_lld.c +│   │   │   ├── ext_lld.h +│   │   │   ├── gpt_lld.c +│   │   │   ├── gpt_lld.h +│   │   │   ├── i2c_lld.c +│   │   │   ├── i2c_lld.h +│   │   │   ├── pal_lld.c +│   │   │   ├── pal_lld.h +│   │   │   ├── serial_lld.c +│   │   │   ├── serial_lld.h +│   │   │   ├── st_lld.c +│   │   │   ├── st_lld.h +│   │   │   ├── usb_lld.c +│   │   │   └── usb_lld.h +│   │   └── README.md +│   ├── LPC +│   ├── simulator +│   └── STM32 +├── src +│   ├── adc.c +│   ├── can.c +│   ├── dac.c +│   ├── ext.c +│   ├── gpt.c +│   ├── hal.c +│   ├── hal_mmcsd.c +│   ├── hal_queues.c +│   ├── i2c.c +│   ├── i2s.c +│   ├── icu.c +│   ├── mac.c +│   ├── mmc_spi.c +│   ├── pal.c +│   ├── pwm.c +│   ├── rtc.c +│   ├── sdc.c +│   ├── serial.c +│   ├── serial_usb.c +│   ├── spi.c +│   ├── st.c +│   ├── uart.c +│   └── usb.c +└── templates + ├── adc_lld.c + ├── adc_lld.h + ├── can_lld.c + ├── can_lld.h + ├── dac_lld.c + ├── dac_lld.h + ├── ext_lld.c + ├── ext_lld.h + ├── gpt_lld.c + ├── gpt_lld.h + ├── halconf.h + ├── hal_lld.c + ├── hal_lld.h + ├── i2c_lld.c + ├── i2c_lld.h + ├── i2s_lld.c + ├── i2s_lld.h + ├── icu_lld.c + ├── icu_lld.h + ├── mac_lld.c + ├── mac_lld.h + ├── mcuconf.h + ├── osal + │   ├── osal.c + │   ├── osal.h + │   └── osal.mk + ├── pal_lld.c + ├── pal_lld.h + ├── platform.mk + ├── pwm_lld.c + ├── pwm_lld.h + ├── rtc_lld.c + ├── rtc_lld.h + ├── sdc_lld.c + ├── sdc_lld.h + ├── serial_lld.c + ├── serial_lld.h + ├── spi_lld.c + ├── spi_lld.h + ├── st_lld.c + ├── st_lld.h + ├── uart_lld.c + ├── uart_lld.h + ├── usb_lld.c + └── usb_lld.h diff --git a/keyboards/ergodox/infinity/Makefile b/keyboards/ergodox/infinity/Makefile new file mode 100644 index 000000000..942032f83 --- /dev/null +++ b/keyboards/ergodox/infinity/Makefile @@ -0,0 +1,77 @@ +# project specific files +SRC = matrix.c \ + led.c + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +# - For Teensies, FAMILY = KINETIS and SERIES is either +# KL2x (LC) or K20x (3.0,3.1,3.2). +# - For Infinity KB, SERIES = K20x +MCU_FAMILY = KINETIS +MCU_SERIES = K20x + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# - NOTE: a custom ld script is needed for EEPROM on Teensy LC +# - LDSCRIPT = +# - MKL26Z64 for Teensy LC +# - MK20DX128 for Teensy 3.0 +# - MK20DX256 for Teensy 3.1 and 3.2 +# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader +# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader +MCU_LDSCRIPT = MK20DX256BLDR8 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +# - STARTUP = +# - kl2x for Teensy LC +# - k20x5 for Teensy 3.0 and Infinity 60% +# - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox +MCU_STARTUP = k20x7 + +# Board: it should exist either in /os/hal/boards/ +# or /boards +# - BOARD = +# - PJRC_TEENSY_LC for Teensy LC +# - PJRC_TEENSY_3 for Teensy 3.0 +# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 +# - MCHCK_K20 for Infinity KB +#BOARD = MCHCK_K20 +BOARD = PJRC_TEENSY_3_1 + +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +# I.e. 6 for Teensy LC; 7 for Teensy 3.x +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 + +# Build Options +# comment out to disable the options. +# +CUSTOM_MATRIX ?= yes # Custom matrix file +SERIAL_LINK_ENABLE = yes +VISUALIZER_ENABLE ?= yes +LCD_ENABLE ?= yes +LED_ENABLE ?= yes +LCD_BACKLIGHT_ENABLE ?= yes + +ifdef LCD_ENABLE +include drivers/gdisp/st7565ergodox/driver.mk +endif + +ifdef LED_ENABLE +include drivers/gdisp/IS31FL3731C/driver.mk +endif + +ifndef QUANTUM_DIR + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/ergodox/infinity/bootloader_defs.h b/keyboards/ergodox/infinity/bootloader_defs.h new file mode 100644 index 000000000..c67153be6 --- /dev/null +++ b/keyboards/ergodox/infinity/bootloader_defs.h @@ -0,0 +1 @@ +#define KIIBOHD_BOOTLOADER diff --git a/keyboards/ergodox/infinity/chconf.h b/keyboards/ergodox/infinity/chconf.h new file mode 100644 index 000000000..d59c35eb6 --- /dev/null +++ b/keyboards/ergodox/infinity/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef _CHCONF_H_ +#define _CHCONF_H_ + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 20 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief I/O Queues APIs. + * @details If enabled then the I/O queues APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_QUEUES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the context switch circular trace buffer is + * activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_TRACE FALSE + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + * + * @note It is inserted into lock zone. + * @note It is also invoked when the threads simply return in order to + * terminate. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* _CHCONF_H_ */ + +/** @} */ diff --git a/keyboards/ergodox/infinity/config.h b/keyboards/ergodox/infinity/config.h new file mode 100644 index 000000000..d24ee0f05 --- /dev/null +++ b/keyboards/ergodox/infinity/config.h @@ -0,0 +1,80 @@ +/* +Copyright 2015 Jun Wako + +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 + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER "TMK" +#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00' +#define PRODUCT "Infinity keyboard/TMK" +#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00' + +/* key matrix size */ +#define MATRIX_ROWS 18 +#define MATRIX_COLS 5 +#define LOCAL_MATRIX_ROWS 9 + +/* 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 +#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2) + +/* + * 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 + +#endif diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h new file mode 100644 index 000000000..2ea73f1fb --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h @@ -0,0 +1,113 @@ +/* +Copyright 2016 Fred Sundvik + +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 _GDISP_LLD_BOARD_H +#define _GDISP_LLD_BOARD_H + +static const I2CConfig i2ccfg = { + 400000 // clock speed (Hz); 400kHz max for IS31 +}; + +#define GDISP_SCREEN_WIDTH 7 +#define GDISP_SCREEN_HEIGHT 7 + +static const uint8_t led_mask[] = { + 0xFF, 0x00, /* C1-1 -> C1-16 */ + 0xFF, 0x00, /* C2-1 -> C2-16 */ + 0xFF, 0x00, /* C3-1 -> C3-16 */ + 0xFF, 0x00, /* C4-1 -> C4-16 */ + 0x3F, 0x00, /* C5-1 -> C5-16 */ + 0x00, 0x00, /* C6-1 -> C6-16 */ + 0x00, 0x00, /* C7-1 -> C7-16 */ + 0x00, 0x00, /* C8-1 -> C8-16 */ + 0x00, 0x00, /* C9-1 -> C9-16 */ +}; + +// The address of the LED +#define LA(c, r) (c + r * 16 ) +// Need to be an address that is not mapped, but inside the range of the controller matrix +#define NA LA(8, 8) + +// The numbers in the comments are the led numbers DXX on the PCB +// The mapping is taken from the schematic of left hand side +static const uint8_t led_mapping[GDISP_SCREEN_HEIGHT][GDISP_SCREEN_WIDTH] = { +// 45 44 43 42 41 40 39 + { LA(1, 1), LA(1, 0), LA(0, 4), LA(0, 3), LA(0, 2), LA(0, 1), LA(0, 0)}, +// 52 51 50 49 48 47 46 + { LA(2, 3), LA(2, 2), LA(2, 1), LA(2, 0), LA(1, 4), LA(1, 3), LA(1, 2) }, +// 58 57 56 55 54 53 N/A + { LA(3, 4), LA(3, 3), LA(3, 2), LA(3, 1), LA(3, 0), LA(2, 4), NA }, +// 67 66 65 64 63 62 61 + { LA(5, 3), LA(5, 2), LA(5, 1), LA(5, 0), LA(4, 4), LA(4, 3), LA(4, 2) }, +// 76 75 74 73 72 60 59 + { LA(7, 3), LA(7, 2), LA(7, 1), LA(7, 0), LA(6, 3), LA(4, 1), LA(4, 0) }, +// N/A N/A N/A N/A N/A N/A 68 + { NA, NA, NA, NA, NA, NA, LA(5, 4) }, +// N/A N/A N/A N/A 71 70 69 + { NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0) }, +}; + + +#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND +#define IS31_TIMEOUT 5000 + +static GFXINLINE void init_board(GDisplay *g) { + (void) g; + /* I2C pins */ + palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATIVE_2); // PTB0/I2C0/SCL + palSetPadMode(GPIOB, 1, PAL_MODE_ALTERNATIVE_2); // PTB1/I2C0/SDA + palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL); + palClearPad(GPIOB, 16); + /* start I2C */ + i2cStart(&I2CD1, &i2ccfg); + // try high drive (from kiibohd) + I2CD1.i2c->C2 |= I2Cx_C2_HDRS; + // try glitch fixing (from kiibohd) + I2CD1.i2c->FLT = 4; +} + +static GFXINLINE void post_init_board(GDisplay *g) { + (void) g; +} + +static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) { + (void) g; + return led_mask; +} + +static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y) +{ + (void) g; + return led_mapping[y][x]; +} + +static GFXINLINE void set_hardware_shutdown(GDisplay* g, bool shutdown) { + (void) g; + if(!shutdown) { + palSetPad(GPIOB, 16); + } + else { + palClearPad(GPIOB, 16); + } +} + +static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { + (void) g; + i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, data, length, 0, 0, US2ST(IS31_TIMEOUT)); +} + +#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk new file mode 100644 index 000000000..f32d0d868 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/IS31FL3731C +GFXSRC += drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c new file mode 100644 index 000000000..1d21f0c49 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c @@ -0,0 +1,333 @@ +/* +Copyright 2016 Fred Sundvik + +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 . +*/ + +#include "gfx.h" + +#if GFX_USE_GDISP + +#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX +#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h" +#include "src/gdisp/gdisp_driver.h" + +#include "board_IS31FL3731C.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 9 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 16 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 0 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) + +#define IS31_ADDR_DEFAULT 0x74 + +#define IS31_REG_CONFIG 0x00 +// bits in reg +#define IS31_REG_CONFIG_PICTUREMODE 0x00 +#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08 +#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18 +// D2:D0 bits are starting frame for autoplay mode + +#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode + +#define IS31_REG_AUTOPLAYCTRL1 0x02 +// D6:D4 number of loops (000=infty) +// D2:D0 number of frames to be used + +#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms) + +#define IS31_REG_DISPLAYOPT 0x05 +#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames +#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x8 +// D2:D0 bits blink period time (*0.27s) + +#define IS31_REG_AUDIOSYNC 0x06 +#define IS31_REG_AUDIOSYNC_ENABLE 0x1 + +#define IS31_REG_FRAMESTATE 0x07 + +#define IS31_REG_BREATHCTRL1 0x08 +// D6:D4 fade out time (26ms*2^i) +// D2:D0 fade in time (26ms*2^i) + +#define IS31_REG_BREATHCTRL2 0x09 +#define IS31_REG_BREATHCTRL2_ENABLE 0x10 +// D2:D0 extinguish time (3.5ms*2^i) + +#define IS31_REG_SHUTDOWN 0x0A +#define IS31_REG_SHUTDOWN_OFF 0x0 +#define IS31_REG_SHUTDOWN_ON 0x1 + +#define IS31_REG_AGCCTRL 0x0B +#define IS31_REG_ADCRATE 0x0C + +#define IS31_COMMANDREGISTER 0xFD +#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine' +#define IS31_FUNCTIONREG_SIZE 0xD + +#define IS31_FRAME_SIZE 0xB4 + +#define IS31_PWM_REG 0x24 +#define IS31_PWM_SIZE 0x90 + +#define IS31_LED_MASK_SIZE 0x12 +#define IS31_SCREEN_WIDTH 16 + +#define IS31 + +//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm +const unsigned char cie[256] = { + 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, + 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, + 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, + 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, + 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, + 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, + 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, + 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, + 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, + 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, + 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, + 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, + 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, + 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, + 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, + 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, + 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, + 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, + 242, 245, 247, 250, 252, 255, +}; + + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +typedef struct{ + uint8_t write_buffer_offset; + uint8_t write_buffer[IS31_FRAME_SIZE]; + uint8_t frame_buffer[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH]; + uint8_t page; +}__attribute__((__packed__)) PrivData; + +// Some common routines and macros +#define PRIV(g) ((PrivData*)g->priv) + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +static GFXINLINE void write_page(GDisplay* g, uint8_t page) { + uint8_t tx[2] __attribute__((aligned(2))); + tx[0] = IS31_COMMANDREGISTER; + tx[1] = page; + write_data(g, tx, 2); +} + +static GFXINLINE void write_register(GDisplay* g, uint8_t page, uint8_t reg, uint8_t data) { + uint8_t tx[2] __attribute__((aligned(2))); + tx[0] = reg; + tx[1] = data; + write_page(g, page); + write_data(g, tx, 2); +} + +static GFXINLINE void write_ram(GDisplay *g, uint8_t page, uint16_t offset, uint16_t length) { + PRIV(g)->write_buffer_offset = offset; + write_page(g, page); + write_data(g, (uint8_t*)PRIV(g), length + 1); +} + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // The private area is the display surface. + g->priv = gfxAlloc(sizeof(PrivData)); + __builtin_memset(PRIV(g), 0, sizeof(PrivData)); + PRIV(g)->page = 0; + + // Initialise the board interface + init_board(g); + gfxSleepMilliseconds(10); + + // zero function page, all registers (assuming full_page is all zeroes) + write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); + set_hardware_shutdown(g, false); + gfxSleepMilliseconds(10); + // software shutdown + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); + gfxSleepMilliseconds(10); + // zero function page, all registers + write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); + gfxSleepMilliseconds(10); + + + // zero all LED registers on all 8 pages, and enable the mask + __builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE); + for(uint8_t i=0; i<8; i++) { + write_ram(g, i, 0, IS31_FRAME_SIZE); + gfxSleepMilliseconds(1); + } + + // software shutdown disable (i.e. turn stuff on) + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + gfxSleepMilliseconds(10); + + // Finish Init + post_init_board(g); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + return TRUE; +} + +#if GDISP_HARDWARE_FLUSH + LLDSPEC void gdisp_lld_flush(GDisplay *g) { + // Don't flush if we don't need it. + if (!(g->flags & GDISP_FLG_NEEDFLUSH)) + return; + + PRIV(g)->page++; + PRIV(g)->page %= 2; + // TODO: some smarter algorithm for this + // We should run only one physical page at a time + // This way we don't need to send so much data, and + // we could use slightly less memory + uint8_t* src = PRIV(g)->frame_buffer; + for (int y=0;ywrite_buffer[get_led_address(g, x, y)]=cie[*src]; + ++src; + } + } + write_ram(g, PRIV(g)->page, IS31_PWM_REG, IS31_PWM_SIZE); + gfxSleepMilliseconds(1); + write_register(g, IS31_FUNCTIONREG, IS31_REG_PICTDISP, PRIV(g)->page); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_DRAWPIXEL + LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = g->p.y; + break; + } + PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x] = gdispColor2Native(g->p.color); + g->flags |= GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = g->p.y; + break; + } + return gdispNative2Color(PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x]); + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + case powerSleep: + case powerDeepSleep: + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); + break; + case powerOn: + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + break; + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + /* Rotation is handled by the drawing routines */ + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + default: + return; + } + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_CONTRAST: + return; + } + } +#endif // GDISP_NEED_CONTROL + +#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h new file mode 100644 index 000000000..bb28ad775 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h @@ -0,0 +1,36 @@ +/* +Copyright 2016 Fred Sundvik + +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 _GDISP_LLD_CONFIG_H +#define _GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_GRAY256 + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk new file mode 100644 index 000000000..16c3f80f5 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/emulator_lcd +GFXSRC += drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c new file mode 100644 index 000000000..babfe2b36 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c @@ -0,0 +1,10 @@ +#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LCD_ERGODOX +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO +#define GDISP_SCREEN_WIDTH 128 +#define GDISP_SCREEN_HEIGHT 32 +#define ROTATE_180_IS_FLIP + +#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk new file mode 100644 index 000000000..255434432 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/emulator_led +GFXSRC += drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c new file mode 100644 index 000000000..b0ebcdc47 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c @@ -0,0 +1,10 @@ +#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LED_ERGODOX +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO +#define GDISP_SCREEN_WIDTH 7 +#define GDISP_SCREEN_HEIGHT 7 +#define ROTATE_180_IS_FLIP + +#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h new file mode 100644 index 000000000..290571ce5 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h @@ -0,0 +1,127 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _GDISP_LLD_BOARD_H +#define _GDISP_LLD_BOARD_H + +#include "print.h" + +#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 +#define ST7565_ADC ST7565_ADC_NORMAL +#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC +#define ST7565_PAGE_ORDER 0,1,2,3 +/* + * Custom page order for several LCD boards, e.g. HEM12864-99 + * #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3 + */ + +#define ST7565_GPIOPORT GPIOC +#define ST7565_PORT PORTC +#define ST7565_A0_PIN 7 +#define ST7565_RST_PIN 8 +#define ST7565_MOSI_PIN 6 +#define ST7565_SLCK_PIN 5 +#define ST7565_SS_PIN 4 + +#define palSetPadModeRaw(portname, bits) \ + ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits + +#define palSetPadModeNamed(portname, portmode) \ + palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode) + +#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2) +// DSPI Clock and Transfer Attributes +// Frame Size: 8 bits +// MSB First +// CLK Low by default +static const SPIConfig spi1config = { + NULL, + /* HW dependent part.*/ + ST7565_GPIOPORT, + ST7565_SS_PIN, + SPIx_CTARn_FMSZ(7) + | SPIx_CTARn_ASC(7) + | SPIx_CTARn_DT(7) + | SPIx_CTARn_CSSCK(7) + | SPIx_CTARn_PBR(0) + | SPIx_CTARn_BR(7) + //SPI_CR1_BR_0 +}; + +static bool_t st7565_is_data_mode = 1; + +static GFXINLINE void init_board(GDisplay *g) { + (void) g; + palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); + st7565_is_data_mode = 1; + palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); + palSetPadModeRaw(MOSI, ST7565_SPI_MODE); + palSetPadModeRaw(SLCK, ST7565_SPI_MODE); + palSetPadModeRaw(SS, ST7565_SPI_MODE); + + spiInit(); + spiStart(&SPID1, &spi1config); + spiSelect(&SPID1); +} + +static GFXINLINE void post_init_board(GDisplay *g) { + (void) g; +} + +static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { + (void) g; + if (state) { + palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN); + } + else { + palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); + } +} + +static GFXINLINE void acquire_bus(GDisplay *g) { + (void) g; + // Only the LCD is using the SPI bus, so no need to acquire + // spiAcquireBus(&SPID1); +} + +static GFXINLINE void release_bus(GDisplay *g) { + (void) g; + // Only the LCD is using the SPI bus, so no need to release + //spiReleaseBus(&SPID1); +} + +static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { + (void) g; + if (st7565_is_data_mode) { + // The sleeps need to be at lest 10 vs 25 ns respectively + // So let's sleep two ticks, one tick might not be enough + // if we are at the end of the tick + chThdSleep(2); + palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); + chThdSleep(2); + st7565_is_data_mode = 0; + } + spiSend(&SPID1, 1, &cmd); +} + +static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { + (void) g; + if (!st7565_is_data_mode) { + // The sleeps need to be at lest 10 vs 25 ns respectively + // So let's sleep two ticks, one tick might not be enough + // if we are at the end of the tick + chThdSleep(2); + palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); + chThdSleep(2); + st7565_is_data_mode = 1; + } + spiSend(&SPID1, length, data); +} + +#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk new file mode 100644 index 000000000..889a1a031 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/st7565ergodox +GFXSRC += drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c new file mode 100644 index 000000000..c33aea81a --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c @@ -0,0 +1,292 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#include "gfx.h" + +#if GFX_USE_GDISP + +#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX +#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h" +#include "src/gdisp/gdisp_driver.h" + +#include "board_ST7565.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 32 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 128 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 0 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) + +#include "drivers/gdisp/st7565ergodox/st7565.h" + +/*===========================================================================*/ +/* Driver config defaults for backward compatibility. */ +/*===========================================================================*/ +#ifndef ST7565_LCD_BIAS + #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 +#endif +#ifndef ST7565_ADC + #define ST7565_ADC ST7565_ADC_NORMAL +#endif +#ifndef ST7565_COM_SCAN + #define ST7565_COM_SCAN ST7565_COM_SCAN_INC +#endif +#ifndef ST7565_PAGE_ORDER + #define ST7565_PAGE_ORDER 0,1,2,3 +#endif + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +typedef struct{ + bool_t buffer2; + uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; +}PrivData; + +// Some common routines and macros +#define PRIV(g) ((PrivData*)g->priv) +#define RAM(g) (PRIV(g)->ram) +#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } +#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } + +// Some common routines and macros +#define delay(us) gfxSleepMicroseconds(us) +#define delay_ms(ms) gfxSleepMilliseconds(ms) + +#define xyaddr(x, y) ((x) + ((y)>>3)*GDISP_SCREEN_WIDTH) +#define xybit(y) (1<<((y)&7)) + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/* + * As this controller can't update on a pixel boundary we need to maintain the + * the entire display surface in memory so that we can do the necessary bit + * operations. Fortunately it is a small display in monochrome. + * 64 * 128 / 8 = 1024 bytes. + */ + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // The private area is the display surface. + g->priv = gfxAlloc(sizeof(PrivData)); + PRIV(g)->buffer2 = false; + + // Initialise the board interface + init_board(g); + + // Hardware reset + setpin_reset(g, TRUE); + gfxSleepMilliseconds(20); + setpin_reset(g, FALSE); + gfxSleepMilliseconds(20); + + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_OFF); + write_cmd(g, ST7565_LCD_BIAS); + write_cmd(g, ST7565_ADC); + write_cmd(g, ST7565_COM_SCAN); + + write_cmd(g, ST7565_START_LINE | 0); + + write_cmd(g, ST7565_RESISTOR_RATIO | 0x6); + + // turn on voltage converter (VC=1, VR=0, VF=0) + write_cmd(g, ST7565_POWER_CONTROL | 0x04); + delay_ms(50); + + // turn on voltage regulator (VC=1, VR=1, VF=0) + write_cmd(g, ST7565_POWER_CONTROL | 0x06); + delay_ms(50); + + // turn on voltage follower (VC=1, VR=1, VF=1) + write_cmd(g, ST7565_POWER_CONTROL | 0x07); + delay_ms(50); + + write_cmd(g, 0xE2); + write_cmd(g, ST7565_COM_SCAN); + write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101); + //write_cmd2(g, ST7565_CONTRAST, 0); + write_cmd(g, ST7565_DISPLAY_ON); + write_cmd(g, ST7565_ALLON_NORMAL); + write_cmd(g, ST7565_INVERT_DISPLAY); + + write_cmd(g, ST7565_RMW); + + // Finish Init + post_init_board(g); + + // Release the bus + release_bus(g); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + return TRUE; +} + +#if GDISP_HARDWARE_FLUSH + LLDSPEC void gdisp_lld_flush(GDisplay *g) { + unsigned p; + + // Don't flush if we don't need it. + if (!(g->flags & GDISP_FLG_NEEDFLUSH)) + return; + + acquire_bus(g); + unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); + for (p = 0; p < 4; p++) { + write_cmd(g, ST7565_PAGE | (p + dstOffset)); + write_cmd(g, ST7565_COLUMN_MSB | 0); + write_cmd(g, ST7565_COLUMN_LSB | 0); + write_cmd(g, ST7565_RMW); + write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); + } + unsigned line = (PRIV(g)->buffer2 ? 32 : 0); + write_cmd(g, ST7565_START_LINE | line); + PRIV(g)->buffer2 = !PRIV(g)->buffer2; + release_bus(g); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_DRAWPIXEL + LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_HEIGHT-1 - g->p.y; + y = g->p.x; + break; + } + if (gdispColor2Native(g->p.color) != Black) + RAM(g)[xyaddr(x, y)] |= xybit(y); + else + RAM(g)[xyaddr(x, y)] &= ~xybit(y); + g->flags |= GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_HEIGHT-1 - g->p.y; + y = g->p.x; + break; + } + return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + case powerSleep: + case powerDeepSleep: + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_OFF); + release_bus(g); + break; + case powerOn: + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_ON); + release_bus(g); + break; + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + /* Rotation is handled by the drawing routines */ + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + default: + return; + } + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_CONTRAST: + if ((unsigned)g->p.ptr > 100) + g->p.ptr = (void *)100; + acquire_bus(g); + write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); + release_bus(g); + g->g.Contrast = (unsigned)g->p.ptr; + return; + } + } +#endif // GDISP_NEED_CONTROL + +#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h new file mode 100644 index 000000000..48587b9e1 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h @@ -0,0 +1,26 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _GDISP_LLD_CONFIG_H +#define _GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h new file mode 100644 index 000000000..48636b33d --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h @@ -0,0 +1,37 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _ST7565_H +#define _ST7565_H + +#define ST7565_CONTRAST 0x81 +#define ST7565_ALLON_NORMAL 0xA4 +#define ST7565_ALLON 0xA5 +#define ST7565_POSITIVE_DISPLAY 0xA6 +#define ST7565_INVERT_DISPLAY 0xA7 +#define ST7565_DISPLAY_OFF 0xAE +#define ST7565_DISPLAY_ON 0xAF + +#define ST7565_LCD_BIAS_7 0xA3 +#define ST7565_LCD_BIAS_9 0xA2 + +#define ST7565_ADC_NORMAL 0xA0 +#define ST7565_ADC_REVERSE 0xA1 + +#define ST7565_COM_SCAN_INC 0xC0 +#define ST7565_COM_SCAN_DEC 0xC8 + +#define ST7565_START_LINE 0x40 +#define ST7565_PAGE 0xB0 +#define ST7565_COLUMN_MSB 0x10 +#define ST7565_COLUMN_LSB 0x00 +#define ST7565_RMW 0xE0 + +#define ST7565_RESISTOR_RATIO 0x20 +#define ST7565_POWER_CONTROL 0x28 + +#endif /* _ST7565_H */ diff --git a/keyboards/ergodox/infinity/gfxconf.h b/keyboards/ergodox/infinity/gfxconf.h new file mode 100644 index 000000000..8caa577b7 --- /dev/null +++ b/keyboards/ergodox/infinity/gfxconf.h @@ -0,0 +1,331 @@ +/** + * This file has a different license to the rest of the uGFX system. + * You can copy, modify and distribute this file as you see fit. + * You do not need to publish your source modifications to this file. + * The only thing you are not permitted to do is to relicense it + * under a different license. + */ + +/** + * Copy this file into your project directory and rename it as gfxconf.h + * Edit your copy to turn on the uGFX features you want to use. + * The values below are the defaults. + * + * Only remove the comments from lines where you want to change the + * default value. This allows definitions to be included from + * driver makefiles when required and provides the best future + * compatibility for your project. + * + * Please use spaces instead of tabs in this file. + */ + +#ifndef _GFXCONF_H +#define _GFXCONF_H + + +/////////////////////////////////////////////////////////////////////////// +// GOS - One of these must be defined, preferably in your Makefile // +/////////////////////////////////////////////////////////////////////////// +//#define GFX_USE_OS_CHIBIOS TRUE +//#define GFX_USE_OS_FREERTOS FALSE +// #define GFX_FREERTOS_USE_TRACE FALSE +//#define GFX_USE_OS_WIN32 FALSE +//#define GFX_USE_OS_LINUX FALSE +//#define GFX_USE_OS_OSX FALSE +//#define GFX_USE_OS_ECOS FALSE +//#define GFX_USE_OS_RAWRTOS FALSE +//#define GFX_USE_OS_ARDUINO FALSE +//#define GFX_USE_OS_KEIL FALSE +//#define GFX_USE_OS_CMSIS FALSE +//#define GFX_USE_OS_RAW32 FALSE +// #define INTERRUPTS_OFF() optional_code +// #define INTERRUPTS_ON() optional_code +// These are not defined by default for some reason +#define GOS_NEED_X_THREADS FALSE +#define GOS_NEED_X_HEAP FALSE + +// Options that (should where relevant) apply to all operating systems + #define GFX_NO_INLINE FALSE +// #define GFX_COMPILER GFX_COMPILER_UNKNOWN +// #define GFX_CPU GFX_CPU_UNKNOWN +// #define GFX_OS_HEAP_SIZE 0 +// #define GFX_OS_NO_INIT FALSE +// #define GFX_OS_INIT_NO_WARNING FALSE +// #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine +// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine +// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine + + +/////////////////////////////////////////////////////////////////////////// +// GDISP // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GDISP TRUE + +//#define GDISP_NEED_AUTOFLUSH FALSE +//#define GDISP_NEED_TIMERFLUSH FALSE +//#define GDISP_NEED_VALIDATION TRUE +//#define GDISP_NEED_CLIP TRUE +#define GDISP_NEED_CIRCLE TRUE +#define GDISP_NEED_ELLIPSE TRUE +#define GDISP_NEED_ARC TRUE +#define GDISP_NEED_ARCSECTORS TRUE +#define GDISP_NEED_CONVEX_POLYGON TRUE +//#define GDISP_NEED_SCROLL FALSE +#define GDISP_NEED_PIXELREAD TRUE +#define GDISP_NEED_CONTROL TRUE +//#define GDISP_NEED_QUERY FALSE +//#define GDISP_NEED_MULTITHREAD FALSE +//#define GDISP_NEED_STREAMING FALSE +#define GDISP_NEED_TEXT TRUE +// #define GDISP_NEED_TEXT_WORDWRAP FALSE +// #define GDISP_NEED_ANTIALIAS FALSE +// #define GDISP_NEED_UTF8 FALSE + #define GDISP_NEED_TEXT_KERNING TRUE +// #define GDISP_INCLUDE_FONT_UI1 FALSE +// #define GDISP_INCLUDE_FONT_UI2 FALSE // The smallest preferred font. +// #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS20 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE + #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 TRUE +// #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE +// #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE + #define GDISP_INCLUDE_FONT_FIXED_5X8 TRUE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS20_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE +// #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE +// #define GDISP_INCLUDE_USER_FONTS FALSE + +//#define GDISP_NEED_IMAGE FALSE +// #define GDISP_NEED_IMAGE_NATIVE FALSE +// #define GDISP_NEED_IMAGE_GIF FALSE +// #define GDISP_NEED_IMAGE_BMP FALSE +// #define GDISP_NEED_IMAGE_BMP_1 FALSE +// #define GDISP_NEED_IMAGE_BMP_4 FALSE +// #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE +// #define GDISP_NEED_IMAGE_BMP_8 FALSE +// #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE +// #define GDISP_NEED_IMAGE_BMP_16 FALSE +// #define GDISP_NEED_IMAGE_BMP_24 FALSE +// #define GDISP_NEED_IMAGE_BMP_32 FALSE +// #define GDISP_NEED_IMAGE_JPG FALSE +// #define GDISP_NEED_IMAGE_PNG FALSE +// #define GDISP_NEED_IMAGE_ACCOUNTING FALSE +#ifdef EMULATOR +#define GDISP_NEED_PIXMAP TRUE +#endif +// #define GDISP_NEED_PIXMAP_IMAGE FALSE + +//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used. +//#define GDISP_LINEBUF_SIZE 128 +//#define GDISP_STARTUP_COLOR Black +#define GDISP_NEED_STARTUP_LOGO FALSE + +//#define GDISP_TOTAL_DISPLAYS 2 + +#ifndef EMULATOR +#define GDISP_DRIVER_LIST GDISPVMT_ST7565_ERGODOX, GDISPVMT_IS31FL3731C_ERGODOX +#else +#define GDISP_DRIVER_LIST GDISPVMT_EMULATOR_LCD_ERGODOX, GDISPVMT_EMULATOR_LED_ERGODOX +#endif + + #ifdef GDISP_DRIVER_LIST + // For code and speed optimization define as TRUE or FALSE if all controllers have the same capability + #define GDISP_HARDWARE_STREAM_WRITE FALSE + #define GDISP_HARDWARE_STREAM_READ FALSE + #define GDISP_HARDWARE_STREAM_POS FALSE + #define GDISP_HARDWARE_DRAWPIXEL TRUE + #define GDISP_HARDWARE_CLEARS FALSE + #define GDISP_HARDWARE_FILLS FALSE + #define GDISP_HARDWARE_BITFILLS FALSE + #define GDISP_HARDWARE_SCROLL FALSE + #define GDISP_HARDWARE_PIXELREAD TRUE + #define GDISP_HARDWARE_CONTROL TRUE + #define GDISP_HARDWARE_QUERY FALSE + #define GDISP_HARDWARE_CLIP FALSE + + #define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 + #endif + +// The custom format is not defined for some reason, so define it as error +// so we don't get compiler warnings +#define GDISP_PIXELFORMAT_CUSTOM GDISP_PIXELFORMAT_ERROR + +#define GDISP_USE_GFXNET FALSE +// #define GDISP_GFXNET_PORT 13001 +// #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE +// #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE +// #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GWIN // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GWIN FALSE + +//#define GWIN_NEED_WINDOWMANAGER FALSE +// #define GWIN_REDRAW_IMMEDIATE FALSE +// #define GWIN_REDRAW_SINGLEOP FALSE +// #define GWIN_NEED_FLASHING FALSE +// #define GWIN_FLASHING_PERIOD 250 + +//#define GWIN_NEED_CONSOLE FALSE +// #define GWIN_CONSOLE_USE_HISTORY FALSE +// #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE +// #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE +// #define GWIN_CONSOLE_ESCSEQ FALSE +// #define GWIN_CONSOLE_USE_BASESTREAM FALSE +// #define GWIN_CONSOLE_USE_FLOAT FALSE +//#define GWIN_NEED_GRAPH FALSE +//#define GWIN_NEED_GL3D FALSE + +//#define GWIN_NEED_WIDGET FALSE +//#define GWIN_FOCUS_HIGHLIGHT_WIDTH 1 +// #define GWIN_NEED_LABEL FALSE +// #define GWIN_LABEL_ATTRIBUTE FALSE +// #define GWIN_NEED_BUTTON FALSE +// #define GWIN_BUTTON_LAZY_RELEASE FALSE +// #define GWIN_NEED_SLIDER FALSE +// #define GWIN_SLIDER_NOSNAP FALSE +// #define GWIN_SLIDER_DEAD_BAND 5 +// #define GWIN_SLIDER_TOGGLE_INC 20 +// #define GWIN_NEED_CHECKBOX FALSE +// #define GWIN_NEED_IMAGE FALSE +// #define GWIN_NEED_IMAGE_ANIMATION FALSE +// #define GWIN_NEED_RADIO FALSE +// #define GWIN_NEED_LIST FALSE +// #define GWIN_NEED_LIST_IMAGES FALSE +// #define GWIN_NEED_PROGRESSBAR FALSE +// #define GWIN_PROGRESSBAR_AUTO FALSE +// #define GWIN_NEED_KEYBOARD FALSE +// #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_English1 +// #define GWIN_NEED_KEYBOARD_ENGLISH1 TRUE +// #define GWIN_NEED_TEXTEDIT FALSE +// #define GWIN_FLAT_STYLING FALSE +// #define GWIN_WIDGET_TAGS FALSE + +//#define GWIN_NEED_CONTAINERS FALSE +// #define GWIN_NEED_CONTAINER FALSE +// #define GWIN_NEED_FRAME FALSE +// #define GWIN_NEED_TABSET FALSE +// #define GWIN_TABSET_TABHEIGHT 18 + + +/////////////////////////////////////////////////////////////////////////// +// GEVENT // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GEVENT TRUE + +//#define GEVENT_ASSERT_NO_RESOURCE FALSE +//#define GEVENT_MAXIMUM_SIZE 32 +//#define GEVENT_MAX_SOURCE_LISTENERS 32 + + +/////////////////////////////////////////////////////////////////////////// +// GTIMER // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GTIMER FALSE + +//#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY +//#define GTIMER_THREAD_WORKAREA_SIZE 2048 + + +/////////////////////////////////////////////////////////////////////////// +// GQUEUE // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GQUEUE FALSE + +//#define GQUEUE_NEED_ASYNC FALSE +//#define GQUEUE_NEED_GSYNC FALSE +//#define GQUEUE_NEED_FSYNC FALSE +//#define GQUEUE_NEED_BUFFERS FALSE + +/////////////////////////////////////////////////////////////////////////// +// GINPUT // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GINPUT FALSE + +//#define GINPUT_NEED_MOUSE FALSE +// #define GINPUT_TOUCH_STARTRAW FALSE +// #define GINPUT_TOUCH_NOTOUCH FALSE +// #define GINPUT_TOUCH_NOCALIBRATE FALSE +// #define GINPUT_TOUCH_NOCALIBRATE_GUI FALSE +// #define GINPUT_MOUSE_POLL_PERIOD 25 +// #define GINPUT_MOUSE_CLICK_TIME 300 +// #define GINPUT_TOUCH_CXTCLICK_TIME 700 +// #define GINPUT_TOUCH_USER_CALIBRATION_LOAD FALSE +// #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE +// #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32 +//#define GINPUT_NEED_KEYBOARD FALSE +// #define GINPUT_KEYBOARD_POLL_PERIOD 200 +// #define GKEYBOARD_DRIVER_LIST GKEYBOARDVMT_Win32, GKEYBOARDVMT_Win32 +// #define GKEYBOARD_LAYOUT_OFF FALSE +// #define GKEYBOARD_LAYOUT_SCANCODE2_US FALSE +//#define GINPUT_NEED_TOGGLE FALSE +//#define GINPUT_NEED_DIAL FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GFILE // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GFILE FALSE + +//#define GFILE_NEED_PRINTG FALSE +//#define GFILE_NEED_SCANG FALSE +//#define GFILE_NEED_STRINGS FALSE +//#define GFILE_NEED_FILELISTS FALSE +//#define GFILE_NEED_STDIO FALSE +//#define GFILE_NEED_NOAUTOMOUNT FALSE +//#define GFILE_NEED_NOAUTOSYNC FALSE + +//#define GFILE_NEED_MEMFS FALSE +//#define GFILE_NEED_ROMFS FALSE +//#define GFILE_NEED_RAMFS FALSE +//#define GFILE_NEED_FATFS FALSE +//#define GFILE_NEED_NATIVEFS FALSE +//#define GFILE_NEED_CHBIOSFS FALSE + +//#define GFILE_ALLOW_FLOATS FALSE +//#define GFILE_ALLOW_DEVICESPECIFIC FALSE +//#define GFILE_MAX_GFILES 3 + +/////////////////////////////////////////////////////////////////////////// +// GADC // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GADC FALSE + +//#define GADC_MAX_LOWSPEED_DEVICES 4 + + +/////////////////////////////////////////////////////////////////////////// +// GAUDIO // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GAUDIO FALSE +// There seems to be a bug in the ugfx code, the wrong define is used +// So define it in order to avoid warnings +#define GFX_USE_GAUDIN GFX_USE_GAUDIO +// #define GAUDIO_NEED_PLAY FALSE +// #define GAUDIO_NEED_RECORD FALSE + + +/////////////////////////////////////////////////////////////////////////// +// GMISC // +/////////////////////////////////////////////////////////////////////////// +#define GFX_USE_GMISC TRUE + +//#define GMISC_NEED_ARRAYOPS FALSE +//#define GMISC_NEED_FASTTRIG FALSE +//#define GMISC_NEED_FIXEDTRIG FALSE +//#define GMISC_NEED_INVSQRT FALSE +// #define GMISC_INVSQRT_MIXED_ENDIAN FALSE +// #define GMISC_INVSQRT_REAL_SLOW FALSE +#define GMISC_NEED_MATRIXFLOAT2D TRUE +#define GMISC_NEED_MATRIXFIXED2D FALSE + +#endif /* _GFXCONF_H */ diff --git a/keyboards/ergodox/infinity/halconf.h b/keyboards/ergodox/infinity/halconf.h new file mode 100644 index 000000000..55dd5e88d --- /dev/null +++ b/keyboards/ergodox/infinity/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL TRUE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 128 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 256 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c new file mode 100644 index 000000000..87ed40fab --- /dev/null +++ b/keyboards/ergodox/infinity/infinity.c @@ -0,0 +1,76 @@ +#include "infinity_ergodox.h" +#include "ch.h" +#include "hal.h" +#include "serial_link/system/serial_link.h" +#include "lcd_backlight.h" + +void init_serial_link_hal(void) { + PORTA->PCR[1] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(2); + PORTA->PCR[2] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(2); + PORTE->PCR[0] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(3); + PORTE->PCR[1] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(3); +} + +#define RED_PIN 1 +#define GREEN_PIN 2 +#define BLUE_PIN 3 +#define CHANNEL_RED FTM0->CHANNEL[0] +#define CHANNEL_GREEN FTM0->CHANNEL[1] +#define CHANNEL_BLUE FTM0->CHANNEL[2] + +#define RGB_PORT PORTC +#define RGB_PORT_GPIO GPIOC + +// Base FTM clock selection (72 MHz system clock) +// @ 0xFFFF period, 72 MHz / (0xFFFF * 2) = Actual period +// Higher pre-scalar will use the most power (also look the best) +// Pre-scalar calculations +// 0 - 72 MHz -> 549 Hz +// 1 - 36 MHz -> 275 Hz +// 2 - 18 MHz -> 137 Hz +// 3 - 9 MHz -> 69 Hz (Slightly visible flicker) +// 4 - 4 500 kHz -> 34 Hz (Visible flickering) +// 5 - 2 250 kHz -> 17 Hz +// 6 - 1 125 kHz -> 9 Hz +// 7 - 562 500 Hz -> 4 Hz +// 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 + +void lcd_backlight_hal_init(void) { + // Setup Backlight + SIM->SCGC6 |= SIM_SCGC6_FTM0; + FTM0->CNT = 0; // Reset counter + + // PWM Period + // 16-bit maximum + FTM0->MOD = 0xFFFF; + + // Set FTM to PWM output - Edge Aligned, Low-true pulses +#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0) + CHANNEL_RED.CnSC = CNSC_MODE; + CHANNEL_GREEN.CnSC = CNSC_MODE; + CHANNEL_BLUE.CnSC = CNSC_MODE; + + // System clock, /w prescalar setting + FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE); + + CHANNEL_RED.CnV = 0; + CHANNEL_GREEN.CnV = 0; + CHANNEL_BLUE.CnV = 0; + + RGB_PORT_GPIO->PDDR |= (1 << RED_PIN); + RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN); + RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN); + +#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4) + RGB_PORT->PCR[RED_PIN] = RGB_MODE; + RGB_PORT->PCR[GREEN_PIN] = RGB_MODE; + RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; +} + +void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { + CHANNEL_RED.CnV = r; + CHANNEL_GREEN.CnV = g; + CHANNEL_BLUE.CnV = b; +} diff --git a/keyboards/ergodox/infinity/infinity.h b/keyboards/ergodox/infinity/infinity.h new file mode 100644 index 000000000..de7267594 --- /dev/null +++ b/keyboards/ergodox/infinity/infinity.h @@ -0,0 +1,44 @@ +#ifndef KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ +#define KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ + +#include "quantum.h" + +#define KEYMAP( \ + A80, A70, A60, A50, A40, A30, A20, \ + A81, A71, A61, A51, A41, A31, A21, \ + A82, A72, A62, A52, A42, A32, \ + A83, A73, A63, A53, A43, A33, A23, \ + A84, A74, A64, A54, A44, \ + A13, A03, \ + A04, \ + A34, A24, A14, \ + B20, B30, B40, B50, B60, B70, B80, \ + B21, B31, B41, B51, B61, B71, B81, \ + B32, B42, B52, B62, B72, B82, \ + B23, B33, B43, B53, B63, B73, B83, \ + B44, B54, B64, B74, B84, \ + B03, B13, \ + 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 } \ +} + +#endif /* KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ */ diff --git a/keyboards/ergodox/infinity/keymaps/default/keymap.c b/keyboards/ergodox/infinity/keymaps/default/keymap.c new file mode 100644 index 000000000..f1e6b1c8a --- /dev/null +++ b/keyboards/ergodox/infinity/keymaps/default/keymap.c @@ -0,0 +1,114 @@ +/* +Copyright 2016 Fred Sundvik +Jun Wako + +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 . +*/ + +#include "infinity_ergodox.h" + +// Workaround for old keymap format +#define KC_RESET RESET + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + KEYMAP( // layer 0 : default + // left hand + EQL, 1, 2, 3, 4, 5, ESC, + BSLS,Q, W, E, R, T, FN1, + TAB, A, S, D, F, G, + LSFT,Z, X, C, V, B, FN0, + LGUI,GRV, BSLS,LEFT,RGHT, + LCTL,LALT, + HOME, + BSPC,DEL, END, + // right hand + FN2, 6, 7, 8, 9, 0, MINS, + LBRC,Y, U, I, O, P, RBRC, + H, J, K, L, SCLN,QUOT, + FN0, N, M, COMM,DOT, SLSH,RSFT, + LEFT,DOWN,UP, RGHT,RGUI, + RALT,RCTL, + PGUP, + PGDN,ENT, SPC + ), + + KEYMAP( // layer 1 : function and symbol keys + // left hand + TRNS,F1, F2, F3, F4, F5, F11, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS, + // right hand + F12, F6, F7, F8, F9, F10, TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS + ), + + KEYMAP( // layer 2 : keyboard functions + // left hand + RESET,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS, + // right hand + TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS + ), + + KEYMAP( // layer 3: numpad + // left hand + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS,TRNS,TRNS,TRNS, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS, + // right hand + TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC, + TRNS,NO, P7, P8, P9, PMNS,BSPC, + NO, P4, P5, P6, PPLS,PENT, + TRNS,NO, P1, P2, P3, PPLS,PENT, + P0, PDOT,SLSH,PENT,PENT, + TRNS,TRNS, + TRNS, + TRNS,TRNS,TRNS + ), +}; +const uint16_t fn_actions[] = { + ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1 + ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2 + ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer + ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0 +}; diff --git a/keyboards/ergodox/infinity/keymaps/default/visualizer.c b/keyboards/ergodox/infinity/keymaps/default/visualizer.c new file mode 100644 index 000000000..c0d335ce6 --- /dev/null +++ b/keyboards/ergodox/infinity/keymaps/default/visualizer.c @@ -0,0 +1,168 @@ +/* +Copyright 2016 Fred Sundvik + +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 . +*/ + +// Currently we are assuming that both the backlight and LCD are enabled +// But it's entirely possible to write a custom visualizer that use only +// one of them +#ifndef LCD_BACKLIGHT_ENABLE +#error This visualizer needs that LCD backlight is enabled +#endif + +#ifndef LCD_ENABLE +#error This visualizer needs that LCD is enabled +#endif + +#include "visualizer.h" +#include "led_test.h" + +static const char* welcome_text[] = {"TMK", "Infinity Ergodox"}; + +// Just an example how to write custom keyframe functions, we could have moved +// all this into the init function +bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) { + (void)animation; + // Read the uGFX documentation for information how to use the displays + // http://wiki.ugfx.org/index.php/Main_Page + gdispClear(White); + // You can use static variables for things that can't be found in the animation + // or state structs + gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black); + gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black); + // Always remember to flush the display + gdispFlush(); + // you could set the backlight color as well, but we won't do it here, since + // it's part of the following animation + // lcd_backlight_color(hue, saturation, intensity); + // We don't need constant updates, just drawing the screen once is enough + return false; +} + +// Feel free to modify the animations below, or even add new ones if needed + +// Don't worry, if the startup animation is long, you can use the keyboard like normal +// during that time +static keyframe_animation_t startup_animation = { + .num_frames = 4, + .loop = false, + .frame_lengths = {0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, + .frame_functions = { + display_welcome, + keyframe_animate_backlight_color, + keyframe_no_operation, + enable_visualization + }, +}; + +// The color animation animates the LCD color when you change layers +static keyframe_animation_t color_animation = { + .num_frames = 2, + .loop = false, + // Note that there's a 200 ms no-operation frame, + // this prevents the color from changing when activating the layer + // momentarily + .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)}, + .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color}, +}; + +// The LCD animation alternates between the layer name display and a +// bitmap that displays all active layers +static keyframe_animation_t lcd_animation = { + .num_frames = 2, + .loop = true, + .frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)}, + .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap}, +}; + +static keyframe_animation_t suspend_animation = { + .num_frames = 3, + .loop = false, + .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0}, + .frame_functions = { + keyframe_display_layer_text, + keyframe_animate_backlight_color, + keyframe_disable_lcd_and_backlight, + }, +}; + +static keyframe_animation_t resume_animation = { + .num_frames = 5, + .loop = false, + .frame_lengths = {0, 0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, + .frame_functions = { + keyframe_enable_lcd_and_backlight, + display_welcome, + keyframe_animate_backlight_color, + keyframe_no_operation, + enable_visualization, + }, +}; + +void initialize_user_visualizer(visualizer_state_t* state) { + // The brightness will be dynamically adjustable in the future + // But for now, change it here. + lcd_backlight_brightness(0x50); + state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF); + state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); + start_keyframe_animation(&startup_animation); + start_keyframe_animation(&led_test_animation); +} + +void update_user_visualizer_state(visualizer_state_t* state) { + // Add more tests, change the colors and layer texts here + // Usually you want to check the high bits (higher layers first) + // because that's the order layers are processed for keypresses + // You can for check for example: + // state->status.layer + // state->status.default_layer + // state->status.leds (see led.h for available statuses) + if (state->status.layer & 0x8) { + state->target_lcd_color = LCD_COLOR(0xC0, 0xB0, 0xFF); + state->layer_text = "Numpad"; + } + else if (state->status.layer & 0x4) { + state->target_lcd_color = LCD_COLOR(0, 0xB0, 0xFF); + state->layer_text = "KBD functions"; + } + else if (state->status.layer & 0x2) { + state->target_lcd_color = LCD_COLOR(0x80, 0xB0, 0xFF); + state->layer_text = "Function keys"; + } + else { + state->target_lcd_color = LCD_COLOR(0x40, 0xB0, 0xFF); + state->layer_text = "Default"; + } + // You can also stop existing animations, and start your custom ones here + // remember that you should normally have only one animation for the LCD + // and one for the background. But you can also combine them if you want. + start_keyframe_animation(&lcd_animation); + start_keyframe_animation(&color_animation); +} + +void user_visualizer_suspend(visualizer_state_t* state) { + state->layer_text = "Suspending..."; + uint8_t hue = LCD_HUE(state->current_lcd_color); + uint8_t sat = LCD_SAT(state->current_lcd_color); + state->target_lcd_color = LCD_COLOR(hue, sat, 0); + start_keyframe_animation(&suspend_animation); +} + +void user_visualizer_resume(visualizer_state_t* state) { + state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0x00); + state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); + start_keyframe_animation(&resume_animation); + start_keyframe_animation(&led_test_animation); +} diff --git a/keyboards/ergodox/infinity/led.c b/keyboards/ergodox/infinity/led.c new file mode 100644 index 000000000..77195bb35 --- /dev/null +++ b/keyboards/ergodox/infinity/led.c @@ -0,0 +1,49 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include "hal.h" + +#include "led.h" + + +void led_set(uint8_t usb_led) { +// The LCD backlight functionality conflicts with this simple +// red backlight +#if !defined(LCD_BACKLIGHT_ENABLE) && defined(STATUS_LED_ENABLE) + // PTC1: LCD Backlight Red(0:on/1:off) + GPIOC->PDDR |= (1<<1); + PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); + if (usb_led & (1<PCOR |= (1<<1); + } else { + GPIOC->PSOR |= (1<<1); + } +#elif !defined(LCD_BACKLIGHT_ENABLE) + (void)usb_led; + GPIOC->PDDR |= (1<<1); + PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); + GPIOC->PSOR |= (1<<1); + GPIOC->PDDR |= (1<<2); + PORTC->PCR[2] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); + GPIOC->PSOR |= (1<<2); + GPIOC->PDDR |= (1<<3); + PORTC->PCR[3] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); + GPIOC->PSOR |= (1<<3); +#else + (void)usb_led; +#endif +} diff --git a/keyboards/ergodox/infinity/matrix.c b/keyboards/ergodox/infinity/matrix.c new file mode 100644 index 000000000..2b806cd64 --- /dev/null +++ b/keyboards/ergodox/infinity/matrix.c @@ -0,0 +1,169 @@ +/* +Copyright 2016 Fred Sundvik +Jun Wako + +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 . +*/ +#include +#include +#include +#include "hal.h" +#include "timer.h" +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "matrix.h" + + +/* + * Infinity ErgoDox Pinusage: + * Column pins are input with internal pull-down. Row pins are output and strobe with high. + * Key is high or 1 when it turns on. + * + * col: { PTD1, PTD4, PTD5, PTD6, PTD7 } + * row: { PTB2, PTB3, PTB18, PTB19, PTC0, PTC9, PTC10, PTC11, PTD0 } + */ +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[LOCAL_MATRIX_ROWS]; +static bool debouncing = false; +static uint16_t debouncing_time = 0; + + +void matrix_init(void) +{ + /* Column(sense) */ + palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN); + + /* Row(strobe) */ + palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 19, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 9, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); + + memset(matrix, 0, MATRIX_ROWS); + memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS); +} + +uint8_t matrix_scan(void) +{ + for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { + matrix_row_t data = 0; + + // strobe row + switch (row) { + case 0: palSetPad(GPIOB, 2); break; + case 1: palSetPad(GPIOB, 3); break; + case 2: palSetPad(GPIOB, 18); break; + case 3: palSetPad(GPIOB, 19); break; + case 4: palSetPad(GPIOC, 0); break; + case 5: palSetPad(GPIOC, 9); break; + case 6: palSetPad(GPIOC, 10); break; + case 7: palSetPad(GPIOC, 11); break; + case 8: palSetPad(GPIOD, 0); break; + } + + // need wait to settle pin state + // if you wait too short, or have a too high update rate + // the keyboard might freeze, or there might not be enough + // processing power to update the LCD screen properly. + // 20us, or two ticks at 100000Hz seems to be OK + wait_us(20); + + // read col data: { PTD1, PTD4, PTD5, PTD6, PTD7 } + data = ((palReadPort(GPIOD) & 0xF0) >> 3) | + ((palReadPort(GPIOD) & 0x02) >> 1); + + // un-strobe row + switch (row) { + case 0: palClearPad(GPIOB, 2); break; + case 1: palClearPad(GPIOB, 3); break; + case 2: palClearPad(GPIOB, 18); break; + case 3: palClearPad(GPIOB, 19); break; + case 4: palClearPad(GPIOC, 0); break; + case 5: palClearPad(GPIOC, 9); break; + case 6: palClearPad(GPIOC, 10); break; + case 7: palClearPad(GPIOC, 11); break; + case 8: palClearPad(GPIOD, 0); break; + } + + if (matrix_debouncing[row] != data) { + matrix_debouncing[row] = data; + debouncing = true; + debouncing_time = timer_read(); + } + } + + uint8_t offset = 0; +#ifdef MASTER_IS_ON_RIGHT + if (is_serial_link_master()) { + offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS; + } +#endif + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { + matrix[offset + row] = matrix_debouncing[row]; + } + debouncing = false; + } + return 1; +} + +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & (1<", + { + "x": 10.5 + }, + "I" + ], + [ + { + "y": -0.8799999999999999, + "x": 2.5 + }, + "W" + ], + [ + { + "y": -0.9950000000000001, + "x": 4.5, + "a": 4 + }, + "R", + { + "x": 8.5, + "a": 7 + }, + "U", + { + "x": 1 + }, + "O" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "T", + { + "h": 1.5 + }, + "", + { + "x": 4.5, + "h": 1.5 + }, + "", + "Y" + ], + [ + { + "y": -0.875, + "a": 6, + "w": 1.5 + }, + "Tab", + { + "a": 7 + }, + "Q", + { + "x": 14.5 + }, + "P", + { + "a": 4, + "w": 1.5 + }, + "|\n\\" + ], + [ + { + "y": -0.375, + "x": 3.5, + "a": 7 + }, + "D\n\n\n\n", + { + "x": 10.5 + }, + "K" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "S\n\n\n\n", + { + "x": 1, + "c": "#c4bcbc" + }, + "F\n\n\n\n", + { + "x": 8.5 + }, + "J", + { + "x": 1, + "c": "#cccccc" + }, + "L" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "G", + { + "x": 6.5 + }, + "H" + ], + [ + { + "y": -0.875, + "a": 4, + "fa": [ + 0, + 0, + 0, + 2 + ], + "w": 1.5 + }, + "\n\n\nCtrl\n\n\nCaps", + { + "a": 7 + }, + "A", + { + "x": 14.5, + "a": 4 + }, + ":\n;", + { + "a": 7, + "w": 1.5 + }, + "Enter" + ], + [ + { + "y": -0.625, + "x": 6.5, + "h": 1.5 + }, + "PgDn", + { + "x": 4.5, + "h": 1.5 + }, + "PgUp" + ], + [ + { + "y": -0.75, + "x": 3.5 + }, + "C\n\n\n\n", + { + "x": 10.5, + "a": 4 + }, + "<\n," + ], + [ + { + "y": -0.875, + "x": 2.5, + "a": 7 + }, + "X\n\n\n\n", + { + "x": 1 + }, + "V\n\n\n\n", + { + "x": 8.5 + }, + "M", + { + "x": 1, + "a": 4 + }, + ">\n." + ], + [ + { + "y": -0.875, + "x": 5.5, + "a": 7 + }, + "B", + { + "x": 6.5 + }, + "N" + ], + [ + { + "y": -0.875, + "w": 1.5 + }, + "Shift", + "Z", + { + "x": 14.5, + "a": 4 + }, + "?\n/", + { + "w": 1.5 + }, + "\"\n'" + ], + [ + { + "y": -0.375, + "x": 3.5, + "a": 7 + }, + "Alt\n\n\n\n", + { + "x": 10.5 + }, + "\n\n\n\n" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "\n\n\n\n", + { + "x": 1 + }, + "Alt\n\n\n\n", + { + "x": 8.5 + }, + "\n\n\n\n", + { + "x": 1 + }, + "\n\n\n\n" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "Ctrl\n\n\n\n", + "Esc", + { + "x": 14.5 + }, + "\n\n\n\n", + "Fn" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1 + }, + "", + "(" + ], + [ + { + "h": 2 + }, + "Space", + { + "h": 2 + }, + "Del", + "[" + ], + [ + { + "x": 2 + }, + "{" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3 + }, + ")", + "" + ], + [ + { + "x": -3 + }, + "]", + { + "h": 2 + }, + "Enter", + { + "h": 2 + }, + "" + ], + [ + { + "x": -3 + }, + "}" + ] +] \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/ab/keyboard-layout.png b/keyboards/ergodox/keymaps/ab/keyboard-layout.png new file mode 100644 index 000000000..740684461 Binary files /dev/null and b/keyboards/ergodox/keymaps/ab/keyboard-layout.png differ diff --git a/keyboards/ergodox/keymaps/ab/keymap.c b/keyboards/ergodox/keymaps/ab/keymap.c new file mode 100644 index 000000000..df6f33460 --- /dev/null +++ b/keyboards/ergodox/keymaps/ab/keymap.c @@ -0,0 +1,155 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define FN1 1 // media layer + +#define CAPS_CTL CTL_T(KC_CAPS) // Caps on tap, Ctrl on hold. +#define COPY LCTL(KC_V) // C-c Copy +#define PASTE LCTL(KC_V) // C-v Paste +#define ZM_NRM LCTL(KC_0) // C-0 Zoom Normal +#define ZM_OUT LCTL(KC_MINS) // C-- Zoom Out +#define ZM_IN LCTL(KC_PLUS) // C-+ Zoom In +#define EM_UNDO LCTL(KC_UNDS) // C-_ Emacs Undo + +#define _MOB 1 // Mobile# +#define _CUS1 2 // Custom macro 1 +#define _CUS2 3 // Custom macro 2 + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BSpace | + * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | Fwd | | Back | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Caps/Ctl| A | S | D | F | G |------| |------| H | J | K | L | ; | Enter | + * |--------+------+------+------+------+------| PgDn | | PgUp |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | ' | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Ctrl | Esc | LGui | Alt | Alt | | Left | Dn | Up | Right| Fn | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Copy | ( | | ) | Paste| + * ,------|------+------| |------+------+------. + * | | | [ | | ] | | | + * |Space | Del |------| |------| Enter|BSpace| + * | | | { | | } | | | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* + [BASE] = KEYMAP( // layer 0 : default + // Left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_WBAK, + CAPS_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, + KC_LCTL, KC_ESC, KC_LGUI, KC_LALT, KC_LALT, + COPY, KC_LCBR, + KC_LPRN, + KC_SPC, KC_DEL, KC_LBRC, + // Right hand + KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_WFWD, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_PGUP, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(FN1), + KC_RCBR, PASTE, + KC_RPRN, + KC_RBRC, KC_ENT, KC_BSPC), +/* Keymap 1: Fn Keys, media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | BSpace | + * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | LClk | MClk | RClk | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Teensy| | ZmNrm| ZmOut| ZmIn | | Undo |VolDn |VolUp | Mute | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------+------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// FN1 Layer + [FN1] = KEYMAP( + // Left hand + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN3, KC_BTN2, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, ZM_NRM, ZM_OUT, ZM_IN, + KC_TRNS, KC_TRNS, + KC_TRNS, + RESET, KC_TRNS, KC_TRNS, + // Right hand + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, M(_MOB), KC_TRNS, M(_CUS1),M(_CUS2),KC_TRNS, KC_TRNS, + EM_UNDO, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case _MOB: // Your mobile# here. + return MACRODOWN(T(1), T(2), T(3), T(MINS), + T(1), T(2), T(3), T(MINS), + T(1), T(2), T(3), T(4), + END); + case _CUS1: // Your custom macro 1 + return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(SPC), END); + case _CUS2: // Your custom macro 2 + return MACRODOWN(T(L), T(S), T(SPC), T(MINS), T(L), T(ENT), END); + }; + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/ab/readme.md b/keyboards/ergodox/keymaps/ab/readme.md new file mode 100644 index 000000000..6b1ac2be3 --- /dev/null +++ b/keyboards/ergodox/keymaps/ab/readme.md @@ -0,0 +1,21 @@ +# Beginner's keymap for Ergodox-EZ +Beginner's keymap emulates standard QWERTY keyboard for beginners. Once you get comfortable with the Ergodox-EZ, you may fork this keymap and customize it for your own needs or find a suitable one from the community contributed keymaps. + +![Beginner's Keymap](keyboard-layout.png) + +#### Pros +* Easier to switch between regular keyboards and Ergodox-EZ. +* Easy on beginners. It has everything you need for your day to day usage. + +#### Cons +* Keys are not ergonomically placed to take full advantage of Ergodox-EZ. Take a look at this [Default Keymap](https://github.com/jackhumbert/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/default/readme.md) +* While multiple layers are possible, beginner's keymap only uses one additional layer for mouse, function and volume keys. + +#### Notes +* Ideally number key [6] should have started from the right-hand side of the keyboard. Doing so breaks the familiar QWERTY layout. +* Quote key ['] should have been placed between [:] and [Enter]. Due to lack of key space, it is placed below [Enter]. +* Double [Alt] keys are placed adjacent to each other for convenience. +* [CapsLock] also acts as [Ctrl] key when you press and hold. It is convenient for GNU Emacs users. +* Additional bracket keys are placed in the center of the keyboard for programmer's convenience. + + diff --git a/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c b/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c new file mode 100644 index 000000000..052517d70 --- /dev/null +++ b/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c @@ -0,0 +1,185 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_german.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | K | . | O | , | Y | L1 | | L1 | V | G | C | L | ß | Z | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | H | A | E | I | U |------| |------| D | T | R | N | S | F | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |X/Ctrl| Q | Ä | Ü | Ö | | | | B | P | W | M | J | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Enter |------| |------| Tab |RShift| + * | | | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, DE_K, DE_DOT, DE_O, DE_COMM,DE_Y, TG(SYMB), + KC_BSPC, DE_H, DE_A, DE_E, DE_I, DE_U, + KC_LSFT, CTL_T(DE_X), DE_Q, DE_AE, DE_UE, DE_OE, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_ENT ,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), DE_V, DE_G, DE_C, DE_L, DE_SS, DE_Z, + DE_D, DE_T, DE_R, DE_N, LT(MDIA, DE_S), GUI_T(KC_F), + MEH_T(KC_NO),KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_RSFT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/adnw_k_o_y/readme.md b/keyboards/ergodox/keymaps/adnw_k_o_y/readme.md new file mode 100644 index 000000000..f0dd3815c --- /dev/null +++ b/keyboards/ergodox/keymaps/adnw_k_o_y/readme.md @@ -0,0 +1,7 @@ +# Basic implementation for k.o,y variant of the adnw layout + +adnw is a layout optimised for usage with german and english language +k.o,y is a variant of this layout +http://www.adnw.de/index.php?n=Main.SeitlicheNachbaranschl%C3%A4ge + +The os must use the de_DE layout diff --git a/keyboards/ergodox/keymaps/alexjj/keymap.c b/keyboards/ergodox/keymaps/alexjj/keymap.c new file mode 100644 index 000000000..448f62da0 --- /dev/null +++ b/keyboards/ergodox/keymaps/alexjj/keymap.c @@ -0,0 +1,238 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys +#define UNIC 3 // unicode entry layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | 1! | 2@ | 3# | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | -_ | += | BkSp | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | { | | } | Y | U | I | O | P | |\ | + * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| + * | Win | A | S | D | F | G |------| |------| H | J | K | L | :; | '" | + * |--------+------+------+------+------+------| Home | | End |------+------+------+------+------+--------| + * | LShift |Z/Alt | X | C | V | B | | | | N | M | , | . | Alt | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCtrl | COPY | PASTE| Left | Right| | Down | Up |Hyper | `~ | RCtrl | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * Hyper = Ctrl+Super+Alt+Shift | ~L3 | F5 | | F2 | ~L2 | + * ,------|------|------| |------+------+------. + * | | | PgUp | | Ins | | | + * | Enter| BkSp |------| |------| ~L1 |Space | + * | | | PgDn | | Del | | | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, + KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_HOME, + KC_LCTRL, LCTL(KC_C), LCTL(KC_V), KC_LEFT,KC_RGHT, + KC_FN3, KC_F5, + KC_PGUP, + KC_ENT,KC_BSPC,KC_PGDN, + // right hand + KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, + KC_END, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_DOWN,KC_UP, ALL_T(KC_NO),KC_GRV, KC_RCTRL, + KC_F2, KC_FN2, + KC_INS, + KC_DELT,KC_FN1, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |PrintScr| + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | £ | | | | | | . | 0 | = |Alt+F4| + * `----------------------------------' `----------------------------------' + * ↑ ,-------------. ,-------------. + * THERE! | | | | | | + * ,------|------|------| |------+------+------. + * CAD = Ctrl + Alt + Delete | | | | | | | | + * | | |------| |------| | | + * | | | | | CAD | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,M(3),KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, LALT(KC_F4), + KC_TRNS, KC_TRNS, + KC_TRNS, + LCTL(LALT(KC_DEL)), KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | TEENSY | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolDn |VolUp | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +/* Keymap 3: Unicode Entry + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Alt | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | + | + | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Alt | | | E | | | | | | | 7 | 8 | 9 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Alt | A | | D | F | |------| |------| | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Alt | | | C | | B | | | | | 1 | 2 | 3 | + | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Alt | Alt | Alt | | | | 0 | 0 | 0 | + | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * WINDOWS ONLY SETUP!! | ~L3 | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | Alt | Alt |------| |------| Alt | Alt | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[UNIC] = KEYMAP( // layer 3 : Unicode Entry + // left hand + KC_LALT, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, + KC_LALT, KC_TRNS, KC_TRNS, KC_E, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LALT, KC_A, KC_TRNS, KC_D, KC_F, KC_TRNS, + KC_LALT, KC_TRNS, KC_TRNS, KC_C, KC_TRNS, KC_B, KC_TRNS, + KC_LALT, KC_LALT, KC_LALT, KC_TRNS,KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_LALT,KC_LALT, KC_TRNS, + // right hand + KC_P7, KC_P8, KC_P9, KC_P0, KC_PPLS,KC_PPLS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TRNS, + KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_TRNS, + KC_P0, KC_P0, KC_P0, KC_PPLS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS,KC_LALT, KC_LALT + ), +}; + + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) + [2] = ACTION_LAYER_TAP_TOGGLE(MDIA), // FN2 - Momentary Layer 2 (Media) + [3] = ACTION_LAYER_TAP_TOGGLE(UNIC) // FN3 - Momentary Layer 3 (Unicode entry) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + case 3: // this would trigger when you hit a key mapped as M(3) + if (record->event.pressed) { + return MACRO( I(255), D(LALT), T(P1), T(P5), T(P6), U(LALT), END ); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/alexjj/readme.md b/keyboards/ergodox/keymaps/alexjj/readme.md new file mode 100644 index 000000000..239e32d39 --- /dev/null +++ b/keyboards/ergodox/keymaps/alexjj/readme.md @@ -0,0 +1,179 @@ +Englishman in New York +=========================== + +:microphone: :tea: + +About +------ + +After using the massdrop configurator to get the basics, I wanted to add a +little extra to my ergodox. Notably the Hyper hotkey, the press and hold, +and a way to have my beloved £ :pound: symbol available[1](#unicode). Why not switch to a GB +layout? Well the computers I use are US keymap'd and I can't always change +that. Plus I've got used to 2/@ and 3/# and moving to the ergodox was hard +enough. :sweat_smile: + +I started from the default and edited from there as I needed. It's somewhat +similar to a regular layout, particularly R1 and shift/controls. I ended up +with a few keys that were blank, so I'm testing out some shortcuts. Alt+F4 for +quitting things in Windows, is one example, but I felt it was better placed on +the 1st layer - in case of fat fingers. + +Layout +------- + +![Layout](rl-layout.jpg "Isn't it lovely") + +### Base Layer + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ESC | 1! | 2@ | 3# | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | -_ | += | BkSp | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | E | R | T | { | | } | Y | U | I | O | P | |\ | +|--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| +| Win | A | S | D | F | G |------| |------| H | J | K | L | :; | '" | +|--------+------+------+------+------+------| Home | | End |------+------+------+------+------+--------| +| LShift |Z/Alt | X | C | V | B | | | | N | M | , | . | Alt | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + |LCtrl | COPY | PASTE| Left | Right| | Down | Up |Hyper | `~ | RCtrl | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + Hyper = Ctrl+Super+Alt+Shift | ~L3 | F5 | | F2 | ~L2 | + ,------|------|------| |------+------+------. + | | | PgUp | | Ins | | | + | Enter| BkSp |------| |------| ~L1 |Space | + | | | PgDn | | Del | | | + `--------------------' `--------------------' +``` + +### Symbol Layer + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |PrintScr| +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | £ | | | | | | . | 0 | = |Alt+F4| + `----------------------------------' `----------------------------------' + ↑ ,-------------. ,-------------. + THERE! | | | | | | + ,------|------|------| |------+------+------. + CAD = Ctrl + Alt + Delete | | | | | | | | + | | |------| |------| | | + | | | | | CAD | | | + `--------------------' `--------------------' +``` +### Media Layer + +Not touched this, not used either. + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| TEENSY | | | | | | | | | | | | | | | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| | | | MsUp | | | | | | | | | | | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | | | | | | | | | Prev | Next | | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | Lclk | Rclk | |VolDn |VolUp | Mute | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | |Brwser| + | | |------| |------| |Back | + | | | | | | | | + `--------------------' `--------------------' +``` +### Unicode Layer + +Used to enter/test unicode input on Windows. All numbers are numpad keys. + +``` +,--------------------------------------------------. ,--------------------------------------------------. +| Alt | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | + | + | | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Alt | | | E | | | | | | | 7 | 8 | 9 | + | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| Alt | A | | D | F | |------| |------| | 4 | 5 | 6 | + | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| Alt | | | C | | B | | | | | 1 | 2 | 3 | + | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | Alt | Alt | Alt | | | | 0 | 0 | 0 | + | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + WINDOWS ONLY SETUP!! | ~L3 | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | Alt | Alt |------| |------| Alt | Alt | + | | | | | | | | + `--------------------' `--------------------' +``` + + +Usage +------ + +~L1 / L2 / L3 will momentarily switch to a layer if held and another key is pressed. +If pressed and released will remain on layer until pressed again. + +### Unicode + +This layout is for Windows only. To enter a character Press and Hold Alt, type + and hex code then release Alt. + +Changelog +----------- + +### [0.2.1] - 2016-04-05 + +* Changed £ to alt code in Windows. Windows sucks at unicode. + +### [0.2.0] - 2016-03-27 + +* Added unicode layer +* Moved Copy/Paste to left hand side +* Switched Enter and Space (again) +* Added L3 (unicode layer) toggle +* Removed Press and Hold for Alt on right hand size (/) +* Swapped Volume Up/Down to match arrows +* Tried fixing £ macro +* Removed * in the matrix function things (upstream change) + +### [0.1.1] - 2016-03-23 + +* Changed £ input to a macro + + +### [0.1.0] - 2016-03-22 + +After actually using the keyboard, I've made some changes: + +* Swapped Enter and Space +* Moved backspace to thumb keys (top right still remains) +* Added Ctrl+Alt+Delete +* Added Teensy Reset on 2nd layer +* Switched Up and Down +* Changed copy/paste to be Ctrl+c and Ctrl+v as KC_COPY/PASTE didn't work (in Windows) +* Moved ~L2 to replace +L1 after learning how the function works (notes above) +* Hopefully fixed GBP symbol (unicode enabled in MakeFile) + +### [0.0.1] - 2016-03-21 + +First version + + +Issues +------- + +Space for feedback and notes for future improvements + +---- +1: For Windows only, and you have to edit the [registry](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input). diff --git a/keyboards/ergodox/keymaps/alexjj/rl-layout.jpg b/keyboards/ergodox/keymaps/alexjj/rl-layout.jpg new file mode 100644 index 000000000..e4e92bf46 Binary files /dev/null and b/keyboards/ergodox/keymaps/alexjj/rl-layout.jpg differ diff --git a/keyboards/ergodox/keymaps/algernon/COPYING b/keyboards/ergodox/keymaps/algernon/COPYING new file mode 100644 index 000000000..94a9ed024 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 3 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 . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/keyboards/ergodox/keymaps/algernon/Makefile b/keyboards/ergodox/keymaps/algernon/Makefile new file mode 100644 index 000000000..6bf3976b9 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/Makefile @@ -0,0 +1,35 @@ +BOOTMAGIC_ENABLE=no +COMMAND_ENABLE=no +SLEEP_LED_ENABLE=no +UNICODE_ENABLE=no +FORCE_NKRO ?= yes +DEBUG_ENABLE = no +CONSOLE_ENABLE = no +TAP_DANCE_ENABLE = yes +KEYLOGGER_ENABLE ?= yes + +ifeq (${FORCE_NKRO},yes) +OPT_DEFS += -DFORCE_NKRO +endif + +ifeq (${KEYLOGGER_ENABLE},yes) +OPT_DEFS += -DKEYLOGGER_ENABLE +CONSOLE_ENABLE = yes +endif + +KEYMAP_VERSION = $(shell \ + if [ -d "${KEYMAP_PATH}/.git" ]; then \ + cd "${KEYMAP_PATH}" && git describe --abbrev=6 --dirty --always --tags --match 'v*' 2>/dev/null; \ + else echo QMK; fi) + +KEYMAP_BRANCH = $(shell \ + if [ -d "${KEYMAP_PATH}/.git" ]; then \ + cd "${KEYMAP_PATH}"; \ + fi; \ + git rev-parse --abbrev-ref HEAD 2>/dev/null) + +OPT_DEFS += -DKEYMAP_VERSION=\"$(KEYMAP_VERSION)\\\#$(KEYMAP_BRANCH)\" + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/ergodox/keymaps/algernon/config.h b/keyboards/ergodox/keymaps/algernon/config.h new file mode 100644 index 000000000..9bb1025be --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/config.h @@ -0,0 +1,27 @@ +#ifndef CONFIG_ALGERNON_H +#define CONFIG_ALGERNON_H + +#include "../../config.h" + +#undef MOUSEKEY_TIME_TO_MAX +#undef MOUSEKEY_MAX_SPEED + +#define MOUSEKEY_TIME_TO_MAX 1 +#define MOUSEKEY_MAX_SPEED 2 + +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 0 + +#undef MOUSEKEY_WHEEL_DELAY +#define MOUSEKEY_WHEEL_DELAY 0 + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 3000 + +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE + +#undef LEADER_TIMEOUT +#define LEADER_TIMEOUT 1000 + +#endif diff --git a/keyboards/ergodox/keymaps/algernon/images/adore-layer.png b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png new file mode 100644 index 000000000..3df68ea53 Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/base-layer.png b/keyboards/ergodox/keymaps/algernon/images/base-layer.png new file mode 100644 index 000000000..7b25a05b3 Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/base-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/heatmap.png b/keyboards/ergodox/keymaps/algernon/images/heatmap.png new file mode 100644 index 000000000..356035e0a Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/heatmap.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/hun-layer.png b/keyboards/ergodox/keymaps/algernon/images/hun-layer.png new file mode 100644 index 000000000..104a9544d Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/hun-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/nav-n-media-layer.png b/keyboards/ergodox/keymaps/algernon/images/nav-n-media-layer.png new file mode 100644 index 000000000..16d29e124 Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/nav-n-media-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/one-handed-layer.png b/keyboards/ergodox/keymaps/algernon/images/one-handed-layer.png new file mode 100644 index 000000000..698d11e5f Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/one-handed-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/steno-layer.png b/keyboards/ergodox/keymaps/algernon/images/steno-layer.png new file mode 100644 index 000000000..fe3c03c93 Binary files /dev/null and b/keyboards/ergodox/keymaps/algernon/images/steno-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c new file mode 100644 index 000000000..c12087292 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/keymap.c @@ -0,0 +1,1216 @@ +/* + * algernon's ErgoDox EZ layout, please see the readme.md file! + */ + +#include "ergodox_ez.h" +#include "led.h" +#include "debug.h" +#include "action_layer.h" +#include "action_util.h" +#include "mousekey.h" +#include "timer.h" +#include "keymap_plover.h" +#include "eeconfig.h" + +/* Layers */ + +enum { + BASE = 0, + ADORE, + ARRW, + APPSEL, + HUN, + NMDIA, + OHLFT, + OHRGT, + PLVR, +}; + +/* Macros */ + +enum { + NONE = 0, + // Buttons that do extra stuff + A_GUI, + A_PLVR, + A_ESC, + A_MPN, + + // Function / number keys + KF_1, // 1, F1 + KF_2, // 2, F2 + KF_3, // ... + KF_4, + KF_5, + KF_6, + KF_7, + KF_8, + KF_9, + KF_10, + KF_11, // =, F11 + + // Application select keys + APP_SLK, // Slack + APP_EMCS, // Emacs + APP_TERM, // Terminal + APP_CHRM, // Chrome + APP_MSIC, // Music + + // Diagonal mouse movement + A_MUL, + A_MUR, + A_MDL, + A_MDR, + + // Hungarian layer keys + HU_AA, // à + HU_OO, // Ó + HU_EE, // É + HU_UU, // Ú + HU_II, // à + HU_OE, // Ö + HU_UE, // Ü + HU_OEE, // Š+ HU_UEE, // Ű + + // One-handed layout specials + OH_BSSPC, + OH_ENTSFT, + OH_BASE, + OH_LEFT, + OH_RIGHT, +}; + +/* Fn keys */ + +enum { + F_BSE = 0, + F_HUN, + F_GUI, + F_SFT, + F_ALT, + F_CTRL +}; + +/* Custom keycodes */ + +enum { + CT_CLN = 0, + CT_MNS, + CT_TA, +}; + +/* States & timers */ + +uint16_t gui_timer = 0; + +uint16_t kf_timers[12]; + +uint16_t oh_base_timer = 0; +uint16_t oh_bsspc_timer = 0; +uint16_t oh_entsft_timer = 0; + +#define OH_BLINK_INTERVAL 500 + +uint8_t oh_left_blink = 0; +uint16_t oh_left_blink_timer = 0; +uint8_t oh_right_blink = 0; +uint16_t oh_right_blink_timer = 0; + +#if KEYLOGGER_ENABLE +bool log_enable = false; +#endif + +bool time_travel = false; + +/* The Keymap */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Keymap 0: Base Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | + * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| + * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | : | | - | | | | | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | LAlt | GUI | | MDIA | 1HND | + * ,------|------|------| |------+------+------. + * | | | Ctrl | | LEAD | | | + * |Backsp|LShift|------| |------| Enter| Space| + * | | | ESC | | HUN | | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) + + ,F(F_ALT),F(F_GUI) + ,F(F_CTRL) + ,KC_BSPC,F(F_SFT),M(A_ESC) + + // right hand + ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS + ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL + ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP + ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,OSL(NMDIA),M(OH_LEFT) + ,KC_LEAD + ,F(F_HUN) ,KC_ENT ,KC_SPC + ), + +/* Keymap 1: Adore layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | Next/Prev | , | . | L | W | M | [ | | ] | F | H | C | P | Y | \ | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = / Arrow | + * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| + * | Play/Pause| / | Z | ' | K | X | | | | B | G | V | J | Q | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | : | | - | | | | | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | LAlt | GUI | | MDIA | 1HND | + * ,------|------|------| |------+------+------. + * | | | Ctrl | | LEAD | | | + * |Backsp|LShift|------| |------| Enter| Space| + * | | | ESC | | HUN | | | + * `--------------------' `--------------------' + */ +[ADORE] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U +,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) + + ,F(F_ALT),F(F_GUI) + ,F(F_CTRL) + ,KC_BSPC,F(F_SFT),M(A_ESC) + + // right hand + ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS + ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL + ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP + ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,OSL(NMDIA),M(OH_LEFT) + ,KC_LEAD + ,F(F_HUN) ,KC_ENT ,KC_SPC + ), + +/* Keymap 2: Arrow layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | Home | Up | End | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | Left | Down | Rght | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| PgUp | PgDn | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[ARRW] = KEYMAP( +// left hand + KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_HOME ,KC_UP ,KC_END ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_PGUP ,KC_PGDN + ), + +/* Keymap 3: Application select layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | |Music |Slack |Emacs |Term |Chrome| | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[APPSEL] = KEYMAP( +// left hand + KC_TRNS ,M(APP_MSIC),M(APP_SLK),M(APP_EMCS),M(APP_TERM),M(APP_CHRM),KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + ), + + +/* Keymap 4: Hungarian Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | Š| | Ű | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | à | Ó | É | Ú | à |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | Ö | | Ü | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | BASE | | | + * `--------------------' `--------------------' + */ + +[HUN] = KEYMAP( +// left hand + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,M(HU_OEE),KC_NO ,M(HU_UEE),KC_NO ,KC_NO +,KC_NO ,M(HU_AA),M(HU_OO) ,M(HU_EE),M(HU_UU) ,M(HU_II) +,KC_NO ,KC_NO ,M(HU_OE) ,KC_NO ,M(HU_UE) ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,F(F_BSE),KC_TRNS ,KC_TRNS + ), + +/* Keymap 5: Navigation & Media layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | MS Slow | | | | | |ScrLCK| |ScrLCK| | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | MS Normal | | Home | Up | PgUp | | | |Scroll| |MsUpL | MsUp |MsUpR | |PrintScreen| + * |-----------+------+------+------+------+------| | | Up |------+------+------+------+------+-----------| + * | MS Fast | | Left | Down | Right| |------| |------| |MsLeft| MsDn |MsRght| | | + * |-----------+------+------+------+------+------| | |Scroll|------+------+------+------+------+-----------| + * | Play/Pause| | End | Down | PgDn | | | | Down | |MsDnL | MsDn |MsDnR | | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Mute | VlUp | | BASE | MClk | + * ,------|------|------| |------+------+------. + * | | | VlDn | | Prev |Left |Right | + * | SPC | Enter|------| |------| Click| Click| + * | | | ESC | | Next | | | + * `--------------------' `--------------------' + */ +[NMDIA] = KEYMAP( +// left hand + KC_ACL0 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LGUI(KC_L) +,KC_ACL1 ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_NO +,KC_ACL2 ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO +,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_MUTE ,KC_VOLU + ,KC_VOLD + ,KC_SPC,KC_ENTER,M(A_ESC) + + // right hand + ,LGUI(KC_L),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_WH_U ,KC_NO ,M(A_MUL),KC_MS_U ,M(A_MUR),KC_NO ,KC_PSCR + ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO + ,KC_WH_D ,KC_NO ,M(A_MDL),KC_MS_D ,M(A_MDR),KC_NO ,KC_MSTP + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_TRNS ,KC_MS_BTN3 + ,KC_MPRV + ,KC_MNXT ,KC_BTN1 ,KC_BTN2 + ), + +/* Keymap 6: One-handed, left side + * + * ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |A BSE| + * |-----------+------+------+------+------+-------------| + * | Tab | ' | , | . | P | Y | [ | + * |-----------+------+------+------+------+------| | + * | - | A | O | E | U | I |------| + * |-----------+------+------+------+------+------| ( | + * | Play/Pause| ; | Q | J | K | X | | + * `-----------+------+------+------+------+-------------' + * | Home | End | Down | Up | ESC | + * `-----------------------------------' + * ,-------------. + * | LAlt | GUI | + * ,------|------|------| + * |BackSp|LShift| Ctrl | + * | | |------| + * |Space |Enter |OTHER | + * `--------------------' + */ +[OHLFT] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,M(OH_BASE) +,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN +,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_ESC) + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_RIGHT) + + // right hand + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_NO ,KC_NO + ), + +/* Keymap 7: One-handed, right side + * + * ,-----------------------------------------------------. + * | = F11 | 0 F10| 9 F9 | 8 F8 | 7 F7 | 6 F6 |A BSE| + * |-----------+------+------+------+------+-------------| + * | / | L | R | C | G | F | ] | + * |-----------+------+------+------+------+------| | + * | \ | S | N | T | H | D |------| + * |-----------+------+------+------+------+------| ) | + * | Stop | Z | V | W | M | B | | + * `-----------+------+------+------+------+-------------' + * | PgDn | PgUp | Right| Left | ESC | + * `-----------------------------------' + * ,-------------. + * | LAlt | GUI | + * ,------|------|------| + * |BackSp|LShift| Ctrl | + * | | |------| + * |Space |Enter |OTHER | + * `--------------------' + */ +[OHRGT] = KEYMAP( +// left hand + M(KF_11) ,M(KF_10) ,M(KF_9) ,M(KF_8) ,M(KF_7) ,M(KF_6) ,M(OH_BASE) +,KC_SLSH ,KC_L ,KC_R ,KC_C ,KC_G ,KC_F ,KC_RBRC +,KC_BSLS ,KC_S ,KC_N ,KC_T ,KC_H ,KC_D +,KC_MSTP ,KC_Z ,KC_V ,KC_W ,KC_M ,KC_B ,KC_RPRN +,KC_PGDN ,KC_PGUP ,KC_RGHT ,KC_LEFT ,M(A_ESC) + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_LEFT) + + // right hand + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_NO ,KC_NO + ), + +/* Keymap 8: Steno for Plover + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | BASE | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | # | # | # | # | # | # | | # | # | # | # | # | # | # | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | T | P | H | |------| |------| | F | P | L | T | D | + * |--------+ S +------+------+------+ * | * | | * | * +------+------+------+------+--------| + * | | | K | W | R | | | | | | R | B | G | S | Z | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | A | O |------| |------| E | U | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( +// left hand +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(A_PLVR), +KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, +KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, +KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + PV_A, PV_O, KC_NO, + + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, + PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, + PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO,PV_E, PV_U + ), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [F_BSE] = ACTION_LAYER_CLEAR(ON_PRESS) + ,[F_HUN] = ACTION_LAYER_INVERT(HUN, ON_PRESS) + ,[F_GUI] = ACTION_MACRO_TAP(A_GUI) + ,[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT) + ,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT) + ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) +}; + +void toggle_steno(int pressed) +{ + uint8_t layer = biton32(layer_state); + + if (pressed) { + if (layer != PLVR) layer_on(PLVR); else layer_off(PLVR); + + register_code(PV_LP); + register_code(PV_LH); + register_code(PV_LR); + register_code(PV_O); + register_code(PV_RL); + register_code(PV_RG); + } else { + unregister_code(PV_LP); + unregister_code(PV_LH); + unregister_code(PV_LR); + unregister_code(PV_O); + unregister_code(PV_RL); + unregister_code(PV_RG); + } +} + +macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) +{ + uint8_t need_shift = 0; + uint8_t hold_shift = 0; + + if (!record->event.pressed) + return MACRO_NONE; + + layer_off (HUN); + + if (keyboard_report->mods & MOD_BIT (KC_LSFT)) { + hold_shift = 1; + need_shift = 1; + unregister_code (KC_LSFT); + } + if ((get_oneshot_mods () & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out ()) { + need_shift = 1; + hold_shift = 0; + unregister_code (KC_LSFT); + } + + clear_oneshot_mods (); + + register_code (KC_RALT); + unregister_code (KC_RALT); + if (accent == (KC_DQT)) { + register_code (KC_RSFT); + } + register_code (accent); + unregister_code (accent); + if (need_shift && accent != (KC_DQT)) { + register_code (KC_RSFT); + } else if (accent == (KC_DQT) && !need_shift) { + unregister_code (KC_RSFT); + } + register_code (hun_char); + unregister_code (hun_char); + if (need_shift || accent == (KC_DQT)) + unregister_code (KC_RSFT); + if (hold_shift) + register_code (KC_LSFT); + + return MACRO_NONE; +} + +void ang_handle_kf (keyrecord_t *record, uint8_t id) +{ + uint8_t code = id - KF_1; + + if (record->event.pressed) { + kf_timers[code] = timer_read (); + } else { + uint8_t kc; + + if (timer_elapsed (kf_timers[code]) > TAPPING_TERM) { + // Long press + kc = KC_F1 + code; + } else { + if (id == KF_11) + kc = KC_EQL; + else + kc = KC_1 + code; + } + + register_code (kc); + unregister_code (kc); + } +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case A_ESC: + if (record->event.pressed) { + if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) { + clear_oneshot_mods (); + } else { + register_code (KC_ESC); + } + layer_off (HUN); + } else { + unregister_code (KC_ESC); + } + break; + + case A_MPN: + if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + int oneshot = ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out()); + + if (oneshot) + clear_oneshot_mods (); + unregister_code (KC_LSFT); + + register_code (KC_MPRV); + unregister_code (KC_MPRV); + + if (!oneshot) + register_code (KC_LSFT); + } else { + return MACRO (T(MNXT), END); + } + } + break; + + /* Hungarian layer */ + case HU_AA: + return ang_do_hun (record, KC_QUOT, KC_A); + case HU_OO: + return ang_do_hun (record, KC_QUOT, KC_O); + case HU_EE: + return ang_do_hun (record, KC_QUOT, KC_E); + case HU_UU: + return ang_do_hun (record, KC_QUOT, KC_U); + case HU_II: + return ang_do_hun (record, KC_QUOT, KC_I); + case HU_OE: + return ang_do_hun (record, KC_DQT, KC_O); + case HU_UE: + return ang_do_hun (record, KC_DQT, KC_U); + case HU_OEE: + return ang_do_hun (record, KC_EQL, KC_O); + case HU_UEE: + return ang_do_hun (record, KC_EQL, KC_U); + + /* Mouse movement */ + case A_MUL: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MUR: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + case A_MDL: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MDR: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + /* Plover base */ + case A_PLVR: + toggle_steno(record->event.pressed); + break; + + /* GUI & AppSel */ + case A_GUI: + if (record->event.pressed) { + register_code (KC_LGUI); + if (record->tap.count && !record->tap.interrupted) { + if (record->tap.count >= 2) { + register_code (KC_W); + layer_on (APPSEL); + set_oneshot_layer (APPSEL, ONESHOT_START); + } + } else { + record->tap.count = 0; + } + gui_timer = 0; + } else { + if (record->tap.count >= 2) + { + unregister_code (KC_W); + clear_oneshot_layer_state (ONESHOT_PRESSED); + } + gui_timer = timer_read (); + } + break; + + case APP_SLK: + return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); + + case APP_EMCS: + return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(ENT), END); + + case APP_TERM: + return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); + + case APP_CHRM: + return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END); + + case APP_MSIC: + return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); + + /* Function keys */ + case KF_1 ... KF_11: + ang_handle_kf (record, id); + break; + + /* 1HAND layout */ + case OH_BASE: + if (record->event.pressed) { + oh_base_timer = timer_read (); + } else { + if (timer_elapsed (oh_base_timer) > TAPPING_TERM) { + layer_clear (); + } else { + return MACRO (T(APP), END); + } + } + break; + + case OH_BSSPC: + if (record->event.pressed) { + oh_bsspc_timer = timer_read (); + } else { + if (timer_elapsed (oh_bsspc_timer) > TAPPING_TERM) { + return MACRO (T(BSPC), END); + } else { + return MACRO (T(SPC), END); + } + } + break; + + case OH_ENTSFT: + if (record->event.pressed) { + oh_entsft_timer = timer_read (); + } else { + if (timer_elapsed (oh_entsft_timer) > TAPPING_TERM) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT)) + unregister_code (KC_LSFT); + else + register_code (KC_LSFT); + } else { + return MACRO (T(ENT), END); + } + } + break; + + case OH_LEFT: + if (record->event.pressed) { + layer_move (OHLFT); + oh_left_blink = 1; + oh_left_blink_timer = timer_read (); + ergodox_right_led_1_on (); + } + break; + + case OH_RIGHT: + if (record->event.pressed) { + layer_move (OHRGT); + oh_right_blink = 1; + oh_right_blink_timer = timer_read (); + ergodox_right_led_3_on (); + } + break; + } + return MACRO_NONE; +}; + +uint8_t is_adore = 0; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + uint8_t dl; + + ergodox_led_all_on(); + for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { + ergodox_led_all_set (i); + _delay_ms (5); + } + _delay_ms(1000); + for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { + ergodox_led_all_set (i); + _delay_ms (10); + } + ergodox_led_all_off(); + + if (!eeconfig_is_enabled()) + eeconfig_init(); + dl = eeconfig_read_default_layer (); + if (dl == (1UL << ADORE)) + is_adore = 1; +}; + +LEADER_EXTERNS(); + +void ang_do_unicode (void) { + register_code (KC_RCTL); + register_code (KC_RSFT); + register_code (KC_U); + unregister_code (KC_U); + unregister_code (KC_RSFT); + unregister_code (KC_RCTL); + _delay_ms (100); +} + +void ang_tap (uint16_t codes[]) { + for (int i = 0; codes[i] != 0; i++) { + register_code (codes[i]); + unregister_code (codes[i]); + _delay_ms (50); + } +} + +#define TAP_ONCE(code) \ + register_code (code); \ + unregister_code (code) + +void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_RSFT); + register_code (KC_SCLN); + } else if (state->count == 2) { + register_code (KC_SCLN); + } +} + +void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_SCLN); + unregister_code (KC_RSFT); + } else if (state->count == 2) { + unregister_code (KC_SCLN); + } +} + +void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_MINS); + } else if (state->count == 2) { + register_code (KC_RSFT); + register_code (KC_MINS); + } +} + +void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_MINS); + } else if (state->count == 2) { + unregister_code (KC_RSFT); + unregister_code (KC_MINS); + } +} + +typedef struct { + bool layer_toggle; + bool sticky; + bool finished_once; +} td_ta_state_t; + +void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (td_ta->finished_once) { + return; + } + + if (td_ta->sticky) { + td_ta->sticky = false; + td_ta->layer_toggle = false; + layer_off (ARRW); + return; + } + + td_ta->finished_once = true; + if (state->count == 1 && !state->pressed) { + register_code (KC_TAB); + td_ta->sticky = false; + td_ta->layer_toggle = false; + } else { + td_ta->layer_toggle = true; + layer_on (ARRW); + td_ta->sticky = (state->count == 2); + } +} + +void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (!td_ta->layer_toggle) + unregister_code (KC_TAB); + if (!td_ta->sticky) + layer_off (ARRW); + + td_ta->finished_once = false; +} + +const qk_tap_dance_action_t tap_dance_actions[] = { + [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) + ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) + ,[CT_TA] = { + .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, + .user_data = (void *)&((td_ta_state_t) { false, false, false }) + } +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) + unregister_code (KC_LGUI); + + if (layer != OHLFT) + oh_left_blink = 0; + if (layer != OHRGT) + oh_right_blink = 0; + + if (layer == HUN) { + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + } else if (layer == NMDIA) { + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + } else if (layer == PLVR) { + ergodox_right_led_1_on (); + ergodox_right_led_2_on (); + ergodox_right_led_3_on (); + } else if (layer == ADORE) { + ergodox_right_led_1_on (); + ergodox_right_led_2_on (); + ergodox_right_led_3_on (); + + ergodox_right_led_2_set (LED_BRIGHTNESS_HI); + } + + if (layer == OHLFT || layer == OHRGT) { + ergodox_right_led_2_on(); + + if (oh_left_blink) { + if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL) { + if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) == 0) + ergodox_right_led_1_off (); + } + if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL * 2) { + ergodox_right_led_1_on (); + oh_left_blink_timer = timer_read (); + } + } + + if (oh_right_blink) { + if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL) { + if ((keyboard_report->mods & MOD_BIT(KC_LCTRL)) == 0) + ergodox_right_led_3_off (); + } + if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL * 2) { + ergodox_right_led_3_on (); + oh_right_blink_timer = timer_read (); + } + } + } + + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_1_set (LED_BRIGHTNESS_HI); + ergodox_right_led_1_on (); + } else { + ergodox_right_led_1_set (LED_BRIGHTNESS_LO); + if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) + ergodox_right_led_1_off (); + } + + if (keyboard_report->mods & MOD_BIT(KC_LALT) || + ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_2_set (LED_BRIGHTNESS_HI); + ergodox_right_led_2_on (); + } else { + ergodox_right_led_2_set (LED_BRIGHTNESS_LO); + if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) + ergodox_right_led_2_off (); + } + + if (keyboard_report->mods & MOD_BIT(KC_LCTRL) || + ((get_oneshot_mods() & MOD_BIT(KC_LCTRL)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_3_set (LED_BRIGHTNESS_HI); + ergodox_right_led_3_on (); + } else { + ergodox_right_led_3_set (LED_BRIGHTNESS_LO); + if (layer != OHRGT && layer != HUN && layer != PLVR && layer != ADORE) + ergodox_right_led_3_off (); + } + + LEADER_DICTIONARY() { + leading = false; + leader_end (); + +#if KEYLOGGER_ENABLE + SEQ_ONE_KEY (KC_D) { + ergodox_led_all_on(); + _delay_ms(100); + ergodox_led_all_off(); + log_enable = !log_enable; + } +#endif + + SEQ_ONE_KEY (KC_T) { + time_travel = !time_travel; + } + + SEQ_ONE_KEY (KC_U) { + ang_do_unicode (); + } + + SEQ_ONE_KEY (KC_V) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")"); + } + + SEQ_ONE_KEY (KC_L) { + /* λ */ + ang_do_unicode (); + + uint16_t codes[] = {KC_0, KC_3, KC_B, KC_B, KC_ENT, 0}; + ang_tap (codes); + } + + SEQ_ONE_KEY (KC_Y) { + uint16_t codes[] = {KC_BSLS, KC_O, KC_SLSH, 0}; + ang_tap (codes); + } + + SEQ_ONE_KEY (KC_S) { + ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); + TAP_ONCE (KC_BSLS); + register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + ang_do_unicode (); TAP_ONCE (KC_3); TAP_ONCE (KC_0); TAP_ONCE (KC_C); TAP_ONCE (KC_4); TAP_ONCE (KC_SPC); + register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); + TAP_ONCE (KC_SLSH); + ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); + } + + SEQ_TWO_KEYS (KC_W, KC_M) { + register_code (KC_LALT); + register_code (KC_F2); + unregister_code (KC_F2); + unregister_code (KC_LALT); + + _delay_ms (1000); + + uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; + ang_tap (codes); + register_code (KC_LGUI); + register_code (KC_UP); + unregister_code (KC_UP); + unregister_code (KC_LGUI); + } + + SEQ_ONE_KEY (KC_A) { + if (is_adore == 0) { + default_layer_and (0); + default_layer_or ((1UL << ADORE)); + eeconfig_update_default_layer ((1UL << ADORE)); + is_adore = 1; + + ergodox_led_all_off (); + ergodox_right_led_3_on (); + _delay_ms (100); + ergodox_right_led_2_on (); + _delay_ms (100); + ergodox_right_led_3_off (); + ergodox_right_led_1_on (); + _delay_ms (100); + ergodox_right_led_2_off (); + _delay_ms (100); + ergodox_right_led_1_off (); + } else { + is_adore = 0; + default_layer_and (0); + default_layer_or (1UL << BASE); + eeconfig_update_default_layer ((1UL << BASE)); + + ergodox_led_all_off (); + ergodox_right_led_1_on (); + _delay_ms (100); + ergodox_right_led_2_on (); + _delay_ms (100); + ergodox_right_led_1_off (); + ergodox_right_led_3_on (); + _delay_ms (100); + ergodox_right_led_2_off (); + _delay_ms (100); + ergodox_right_led_3_off (); + } + } + } +} + +static uint16_t last4[4]; + +bool process_record_user (uint16_t keycode, keyrecord_t *record) { +#if KEYLOGGER_ENABLE + uint8_t layer = biton32(layer_state); + + if (log_enable && layer == BASE) { + xprintf ("KL: col=%d, row=%d\n", record->event.key.col, + record->event.key.row); + } +#endif + + if (time_travel && !record->event.pressed) { + uint8_t p; + + // shift cache one to the left + for (p = 0; p < 3; p++) { + last4[p] = last4[p + 1]; + } + last4[3] = keycode; + + if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { + uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; + ang_tap (codes); + register_code (KC_RSFT); + register_code (KC_EQL); + unregister_code (KC_EQL); + unregister_code (KC_RSFT); + + uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; + ang_tap (codes2); + + return false; + } + } + + return true; +} diff --git a/keyboards/ergodox/keymaps/algernon/readme.md b/keyboards/ergodox/keymaps/algernon/readme.md new file mode 100644 index 000000000..6fe177511 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/readme.md @@ -0,0 +1,198 @@ + + +algernon's layout +======================= + +This is an unconventional layout for the ErgoDox EZ. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox]. + + [blog-ergodox]: https://asylum.madhouse-project.org/blog/tags/ergodox/ + +Some of the things in the layout only work when one uses Spacemacs and GNOME under Linux. Your mileage may vary. + +## Table of Contents + +* [Layouts](#layouts) + - [Base layer](#base-layer) + - [ADORE layer](#adore-layer) + - [Hungarian layer](#hungarian-layer) + - [Navigation and media layer](#navigation-and-media-layer) + - [One-handed layer](#one-handed-layer) + - [Steno layer](#steno-layer) + - [LED states](#led-states) +* [Tools](#tools) + - [Heatmap](#heatmap) +* [Building](#building) + - [Using on Windows](#using-on-windows) +* [Changelog](#changelog) +* [License](#license) + +# Layouts + +## Base layer + +[![Base layer](images/base-layer.png)](http://www.keyboard-layout-editor.com/#/gists/28f7eb305fdbff943613e1dc7aa9e82b) + +At its core, this is a Dvorak layout, with some minor changes. The more interesting parts are how certain keys behave: + +* The keys on the number row double as function keys, when held for a bit longer than an usual tap. This allows me to use the function keys without having to switch layers. +* The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they are considered active for the next key press only. When double tapped, they toggle on, until a third, single tap sometime later. When held, they act as expected. My usual pattern is that I use these for the next keypress only, so this behaviour is perfect. If I need them held, I'll just double-tap. +* The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout. +* The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode. +* The **Media** and **Hun** layer keys are one-shot, the **1Hand** and **STENO** keys are toggles. +* When holding any of the **Arrow** layer keys, the arrow layer activates while the layer key is held. Tapping the key produces the normal key. +* Tapping the `:` key once yields `:`, tapping it twice yields `;`. +* The **Lead** key allows me to type in a sequence of keys, and trigger some actions: + - `LEAD u` enters unicode input mode, by sending the GTK+ key sequence that does this. + - `LEAD l` uses the unicode input method to enter a `λ`. + - `LEAD s` does a lot of magic to type in a shruggie: `¯\_(ツ)_/¯` + - `LEAD y` types `\o/`. + - `LEAD w m` maximises the currently focused window. + - `LEAD a` makes the [ADORE layer](#adore-layer) the default. + - `LEAD v` prints the firmware version, the keyboard and the keymap. + - `LEAD d` toggles logging keypress positions to the HID console. + - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. + +## ADORE layer + +[![ADORE layer](images/adore-layer.png)](http://www.keyboard-layout-editor.com/#/gists/45681a17453d235925b6028dd83bf12a) + +While using the standard Dvorak layout, I encountered a number of inconveniences, and on this layer, I am playing with ideas to make the layout feel better. Initially, it was based on [Capewell-Dvorak][cpd], but that too, had shortcomings I was not happy with. So now this is something inbetween, with own observations thrown in. How it works out in the long run remains to be seen. + + [cpd]: http://www.michaelcapewell.com/projects/keyboard/layout_capewell-dvorak.htm + +Based on a week and a half of typing, the keys were rearranged, and the home row neatly spelled out **ADORE**, that gave the layout its name. + +## Hungarian layer + +[![Hungarian layer](images/hun-layer.png)](http://www.keyboard-layout-editor.com/#/gists/b160f6ec90d58c127c114c89f66e9dc9) + +On this layer, the accented characters are at the same position as their base variant. For some, which can have other diatribes, the long one is on top, short's on bottom. Tapping any of the accented characters takes us back to the base layer. + +## Navigation and media layer + +[![Navigation and media layer](images/nav-n-media-layer.png)](http://www.keyboard-layout-editor.com/#/gists/c59c453f9fe1a3238ba1494e7e5c6892) + +This layer is primarily for navigating with the cursor or the mouse, and some media things. + +## One-handed layer + +[![One-handed layer](images/one-handed-layer.png)](http://www.keyboard-layout-editor.com/#/gists/edff2495135955b8963198dace7f7ece) + +The one-handed layer is used in situations where the right hand is occupied, by mousing around, for example. Tapping the `OTHER` key switches which side is active. For the most part, keys remain in their usual position. When the right half is active, keys are mirrored to the left half. + +The differences are as follows: + +* The `ESC` key has been moved to the bottom row, so the `OTHER` key is easier to tap. +* Most keys on the thumb cluster now have dual uses, and these do not change when switching sides: + - The `Space`/`Backspace` key sends `Space` on tap, `Backspace` when held for longer than a normal tap. + - The `Enter`/`Shift` key sends `Enter` on short-tap, `Shift` on long-tap. +* The `Apps`/`BASE` key can be used to go back to the base layer, by long-tapping it. A short-tap will send the `App` key, as usual. + +## Steno layer + +[![Steno layer for Plover](images/steno-layer.png)](http://www.keyboard-layout-editor.com/#/gists/401ef9a84369e47c57f9aedcf0a0d667) + +This is to be used with [Plover](http://www.openstenoproject.org/plover/), nothing really fancy here. The **STENO** key toggles the layer on and off, and sends the toggle command to Plover too. + +## LED states + +The primary purpose of the LEDs is to show the modifier status, a secondary, to show which layer is active. Each modifier, `Shift`, `Alt` and `Control` each have their designated LEDs: the *red*, *green* and *blue*, respectively. When a modifier is in a one-shot state, the respective LED will turn on with a dimmer light. If the modifier is toggled on, the brightness of the LED turns full. + +For the layers, the following rules apply: + +* When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active. +* When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on. +* When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on. +* When the [One-handed layer](#one-handed-layer) is active, the *green* LED is on and bright, and either the *red* or the *blue* one is going to slowly blink, depending on the currently active side. +* For the [Steno layer](#steno-layer), all LEDs will be turned on. + +Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on. + +# Tools + +## Heatmap + +When the keypress logging functionality is enabled (by `LEAD d`), the keyboard will output a line every time a key is pressed, containing the position of the key in the matrix. This allows one to collect this information, and build analytics over it, such as a heat map, including dead keys too. + +Included with the firmware is a small tool that can parse these logs, and create a heatmap that one can import into [KLE][kle]. To use it, simply point `tools/log-to-heatmap.py` to a base layout file (one is included in the `tools/` directory), and the key position log. The latter one can create by running `hid-listen`, and redirecting its output to a file. + + [kle]: http://www.keyboard-layout-editor.com/ + +The generated heatmap looks somewhat like this: + + ![Heatmap](images/heatmap.png) + +# Building + +To make my workflow easier, this layout is maintained in [its own repository][algernon:ez-layout]. To build it, you will need the [QMK][qmk] firmware checked out, and this repo either checked out to something like `keyboards/ergodox_ez/algernon-master`. One way to achieve that is this: + + [algernon:ez-layout]: https://github.com/algernon/ergodox-layout + [qmk]: https://github.com/jackhumbert/qmk_firmware + +``` +$ git clone https://github.com/jackhumbert/qmk_firmware.git +$ cd qmk_firmware +$ git clone https://github.com/algernon/ergodox-layout.git \ + keyboards/ergodox_ez/keymaps/algernon-master +$ make KEYBOARD=ergodox_ez KEYMAP=algernon-master +``` + +From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware): + +``` +$ make KEYBOARD=ergodox_ez KEYMAP=algernon +``` + +## Using on Windows + +The keymap default to forcing NKRO, which seems to upset Windows, and except the modifiers, none of them work. If you experience this problem, recompile the firmware with `FORCE_NKRO=no` added to the `make` command line. + +# Changelog + +## v1.4 - 2016-07-29 + +* When toggling the key logging on or off, the LEDs will do a little dance. +* The keylogger is now optional, but enabled by default. Use `KEYLOGGER_ENABLE=no` on the `make` command line to disable it. +* The `TAB`/`ARRW` key was turned into a tap-dance key, allowing one to toggle the **ARROW** layer on by double-tapping, and as such, avoid the need to hold the key. +* The `-`/`_` key was turned into a tap-dance key too. +* There is now a way to travel time with the keyboard, toggle the feature on by hitting `LEAD t`. + +## v1.3 - 2016-07-06 + +* Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a [heatmap](#heatmap) out of the logs. +* The arrow and navigation keys were rearranged again, and now require an additional key being held to activate. See the [base layer](#base-layer) for an image that shows where arrows are. +* The **experimental** layer has been redone, and is now called [ADORE](#adore-layer), and as such, can be enabled by `LEAD a` now. +* Switching between Dvorak and ADORE is now persisted into EEPROM, and survives a reboot. + +## v1.2 - 2016-06-22 + +* The forced NKRO mode can be easily toggled off at compile-time, to make the firmware compatible with [certain operating systems](#using-on-windows). +* The `:;` key has changed behaviour: to access the `;` symbol, the key needs to be double-tapped, instead of shifted. +* The `=` and `\` keys were swapped, `=` moved to the home row, on both the [base](#base-layer) and the **experimental** layers. +* The arrow and navigation keys were redone, they are now more accessible, but the navigation keys require an extra tap to access. +* The **Emacs** layer is gone, replaced by a simplified [navigation and media](#navigation-and-media-layer) layer. +* `LEAD v` types the firmware version, and the keymap version. +* On the **experimental** layer, the `L` and `Q`, and the `K` and `G` keys were swapped. +* The [Steno](#steno-layer) layer gained a few more `#` and `*` keys, to make it easier on my fingers. + +## v1.1 - 2016-06-14 + +* The keyboard starts in NKRO mode, bootmagic and other things are disabled. +* A [Steno](#steno-layer) layer was added, to be used with Plover. +* An **experimental** layer was added, something halfway between Dvorak and Capewell-Dvorak. A work in progress. +* `LEAD y` types `\o/`. +* Some keys on the [Base](#base-layer) layer have been moved around: + - `?` moved to the left pinky, left of `Q`. + - `=` shifted one row down, but `F11` stayed where it was. + - `-` on the left half was replaced by `Tab`. + - `Tab`'s original position is taken by a `Media Next`/`Media Prev` key. + - `:` now inputs `;` when shifted. +* `ESC` cancels the [Hungarian](#hungarian-layer) layer too, not just modifiers. + +## v1.0 - 2016-05-26 + +Initial version. + +# License + +The layout, being a derivative of the original TMK firmware which is under the GPL-2+, this layout is under the GPL as well, but GPL-3+, rather than the older version. diff --git a/keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json b/keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json new file mode 100644 index 000000000..544f61ce8 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/tools/heatmap-adore-layout.json @@ -0,0 +1,533 @@ +[ + { + "backcolor": "#ffffff", + "name": "ErgoDox - algernon's layout: Heatmap", + "author": "Gergely Nagy ", + "notes": "See [here](https://github.com/algernon/ergodox-layout#readme) for the QMK keymap source.", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea", + "pcb": true, + "css": ".keyborder { -webkit-filter: blur(5px); filter: blur(5px); } .keytop { -webkit-filter: blur(10px); } .keylabels { border: 1px solid black; }" + }, + [ + { + "x": 3.5, + "c": "#a7d0db", + "fa": [ + 0, + 0, + 2 + ] + }, + "#\n3\nF3", + { + "x": 10.5, + "c": "#a7d0db", + "t": "#000000", + "a": 4, + "fa": [ + 0, + 0, + 2 + ] + }, + "*\n8\nF8" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "@\n2\nF2", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "$\n4\nF4", + { + "x": 8.5 + }, + "&\n7\nF7", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "(\n9\nF9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "%\n5\nF5", + { + "c": "#f9cd31", + "a": 7, + "f": 2 + }, + "STENO", + { + "x": 4.5, + "f": 6 + }, + "", + { + "c": "#7adabd", + "a": 4, + "f": 3, + "fa": [ + 0, + 0, + 2 + ] + }, + "^\n6\nF6" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "f": 3, + "w": 1.5 + }, + "\n\n~\n`", + { + "t": "#0d0d0b" + }, + "!\n1\nF1", + { + "x": 14.5 + }, + ")\n0\nF10", + { + "a": 7, + "w": 1.5 + }, + "F11" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 6 + }, + "L", + { + "x": 10.5 + }, + "C" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b", + "a": 4 + }, + ">\n.", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "a": 6 + }, + "W", + { + "x": 8.5 + }, + "H", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "P" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "M", + { + "c": "#93c9b7", + "a": 4, + "h": 1.5 + }, + "{\n[", + { + "x": 4.5, + "h": 1.5 + }, + "}\n]", + { + "c": "#7adabd", + "a": 6 + }, + "F" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "t": "#0d0d0b", + "f": 6, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "a": 4, + "f": 3 + }, + "<\n,", + { + "x": 14.5, + "a": 6 + }, + "Y", + { + "a": 4, + "w": 1.5 + }, + "|\n\\" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 6 + }, + "E", + { + "x": 10.5 + }, + "T" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "O", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "n": true + }, + "I", + { + "x": 8.5, + "n": true + }, + "R", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "N" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "U", + { + "x": 6.5 + }, + "D" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "t": "#0d0d0b", + "fa": [ + 6 + ], + "w": 1.5 + }, + "\n\nTab", + { + "f": 3 + }, + "A", + { + "x": 14.5, + "f": 3 + }, + "S", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 6 + ], + "w": 1.5 + }, + "+\n=" + ], + [ + { + "y": -0.625, + "x": 6.5, + "c": "#93c9b7", + "t": "#000000", + "a": 7, + "h": 1.5 + }, + "(", + { + "x": 4.5, + "h": 1.5 + }, + ")" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#a7d0db", + "a": 4, + "f": 3 + }, + "\"\n'", + { + "x": 10.5 + }, + "V" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "Z", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "K", + { + "x": 8.5 + }, + "G", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "J" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "X", + { + "x": 6.5 + }, + "B" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "f": 9, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "t": "#0d0d0b", + "a": 4, + "f": 3 + }, + "?\n/", + { + "x": 14.5, + "a": 6 + }, + "Q", + { + "c": "#ffb07b", + "t": "#000000", + "f": 9, + "w": 1.5 + }, + "" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#d9dae0", + "g": true, + "a": 7, + "f": 3 + }, + "", + { + "x": 10.5 + }, + "" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "", + { + "x": 1, + "c": "#d4872a", + "g": false, + "a": 5 + }, + ";\n:", + { + "x": 8.5 + }, + "_\n-", + { + "x": 1, + "c": "#d9dae0", + "g": true, + "a": 7 + }, + "" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "", + {}, + "", + { + "x": 14.5 + }, + "", + {}, + "" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#f9cd31", + "g": false + }, + "Alt", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 9 + ] + }, + "\n\n\n" + ], + [ + { + "c": "#d4872a", + "a": 7, + "f": 9, + "h": 2 + }, + "", + { + "h": 2 + }, + "", + { + "c": "#f9cd31", + "f": 3 + }, + "Ctrl" + ], + [ + { + "x": 2, + "c": "#e26757" + }, + "ESC" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "MEDIA", + {}, + "1HAND" + ], + [ + { + "x": -3 + }, + "LEAD", + { + "c": "#d4872a", + "f": 9, + "h": 2 + }, + "", + { + "f": 3, + "h": 2 + }, + "SPC" + ], + [ + { + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "HUN" + ] +] diff --git a/keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json b/keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json new file mode 100644 index 000000000..148bb1f23 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/tools/heatmap-base-layout.json @@ -0,0 +1,533 @@ +[ + { + "backcolor": "#ffffff", + "name": "ErgoDox - algernon's layout: Heatmap", + "author": "Gergely Nagy ", + "notes": "See [here](https://github.com/algernon/ergodox-layout#readme) for the QMK keymap source.", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea", + "pcb": true, + "css": ".keyborder { -webkit-filter: blur(5px); filter: blur(5px); } .keytop { -webkit-filter: blur(10px); } .keylabels { border: 1px solid black; }" + }, + [ + { + "x": 3.5, + "c": "#a7d0db", + "fa": [ + 0, + 0, + 2 + ] + }, + "#\n3\nF3", + { + "x": 10.5, + "c": "#a7d0db", + "t": "#000000", + "a": 4, + "fa": [ + 0, + 0, + 2 + ] + }, + "*\n8\nF8" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "@\n2\nF2", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "$\n4\nF4", + { + "x": 8.5 + }, + "&\n7\nF7", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "(\n9\nF9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "%\n5\nF5", + { + "c": "#f9cd31", + "a": 7, + "f": 2 + }, + "STENO", + { + "x": 4.5, + "f": 6 + }, + "", + { + "c": "#7adabd", + "a": 4, + "f": 3, + "fa": [ + 0, + 0, + 2 + ] + }, + "^\n6\nF6" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "f": 3, + "w": 1.5 + }, + "\n\n~\n`", + { + "t": "#0d0d0b" + }, + "!\n1\nF1", + { + "x": 14.5 + }, + ")\n0\nF10", + { + "a": 7, + "w": 1.5 + }, + "F11" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 4 + }, + ">\n.", + { + "x": 10.5, + "a": 6 + }, + "C" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b", + "a": 4 + }, + "<\n,", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "a": 6 + }, + "P", + { + "x": 8.5 + }, + "G", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "R" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "Y", + { + "c": "#93c9b7", + "a": 4, + "h": 1.5 + }, + "{\n[", + { + "x": 4.5, + "h": 1.5 + }, + "}\n]", + { + "c": "#7adabd", + "a": 6 + }, + "F" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "t": "#0d0d0b", + "f": 6, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "a": 4, + "f": 3 + }, + "\"\n'", + { + "x": 14.5, + "a": 6 + }, + "L", + { + "a": 4, + "w": 1.5 + }, + "|\n\\" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#a7d0db", + "t": "#000000", + "a": 6 + }, + "E", + { + "x": 10.5 + }, + "T" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "O", + { + "x": 1, + "c": "#7adabd", + "t": "#000000", + "n": true + }, + "U", + { + "x": 8.5, + "n": true + }, + "H", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "N" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "I", + { + "x": 6.5 + }, + "D" + ], + [ + { + "y": -0.875, + "c": "#ffb2d2", + "t": "#0d0d0b", + "fa": [ + 6 + ], + "w": 1.5 + }, + "\n\nTab", + { + "f": 3 + }, + "A", + { + "x": 14.5, + "f": 3 + }, + "S", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 6 + ], + "w": 1.5 + }, + "+\n=" + ], + [ + { + "y": -0.625, + "x": 6.5, + "c": "#93c9b7", + "t": "#000000", + "a": 7, + "h": 1.5 + }, + "(", + { + "x": 4.5, + "h": 1.5 + }, + ")" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#a7d0db", + "a": 6 + }, + "J", + { + "x": 10.5 + }, + "W" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "Q", + { + "x": 1, + "c": "#7adabd", + "t": "#000000" + }, + "K", + { + "x": 8.5 + }, + "M", + { + "x": 1, + "c": "#bfbad1", + "t": "#0d0d0b" + }, + "V" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#7adabd", + "t": "#000000" + }, + "X", + { + "x": 6.5 + }, + "B" + ], + [ + { + "y": -0.875, + "c": "#ffb07b", + "f": 9, + "w": 1.5 + }, + "\n\n", + { + "c": "#ffb2d2", + "t": "#0d0d0b", + "a": 4, + "f": 3 + }, + "?\n/", + { + "x": 14.5, + "a": 6 + }, + "Z", + { + "c": "#ffb07b", + "t": "#000000", + "f": 9, + "w": 1.5 + }, + "" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#d9dae0", + "g": true, + "a": 7, + "f": 3 + }, + "", + { + "x": 10.5 + }, + "" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "", + { + "x": 1, + "c": "#d4872a", + "g": false, + "a": 5 + }, + ";\n:", + { + "x": 8.5 + }, + "_\n-", + { + "x": 1, + "c": "#d9dae0", + "g": true, + "a": 7 + }, + "" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "", + {}, + "", + { + "x": 14.5 + }, + "", + {}, + "" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#f9cd31", + "g": false + }, + "Alt", + { + "a": 4, + "fa": [ + 0, + 0, + 0, + 9 + ] + }, + "\n\n\n" + ], + [ + { + "c": "#d4872a", + "a": 7, + "f": 9, + "h": 2 + }, + "", + { + "h": 2 + }, + "", + { + "c": "#f9cd31", + "f": 3 + }, + "Ctrl" + ], + [ + { + "x": 2, + "c": "#e26757" + }, + "ESC" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "MEDIA", + {}, + "1HAND" + ], + [ + { + "x": -3 + }, + "LEAD", + { + "c": "#d4872a", + "f": 9, + "h": 2 + }, + "", + { + "f": 3, + "h": 2 + }, + "SPC" + ], + [ + { + "x": -3, + "c": "#f9cd31", + "f": 2 + }, + "HUN" + ] +] diff --git a/keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py b/keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py new file mode 100755 index 000000000..a13d12e81 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/tools/log-to-heatmap.py @@ -0,0 +1,145 @@ +#! /usr/bin/env python +import json +import os +import sys +import re + +from math import floor + +cr_coord_map = [ + [ + # Row 0 + [ 4, 0], [ 4, 2], [ 2, 0], [ 1, 0], [ 2, 2], [ 3, 0], [ 3, 2], + [ 3, 4], [ 3, 6], [ 2, 4], [ 1, 2], [ 2, 6], [ 4, 4], [ 4, 6], + ], + [ + # Row 1 + [ 8, 0], [ 8, 2], [ 6, 0], [ 5, 0], [ 6, 2], [ 7, 0], [ 7, 2], + [ 7, 4], [ 7, 6], [ 6, 4], [ 5, 2], [ 6, 6], [ 8, 4], [ 8, 6], + ], + [ + # Row 2 + [12, 0], [12, 2], [10, 0], [ 9, 0], [10, 2], [11, 0], [ ], + [ ], [11, 2], [10, 4], [ 9, 2], [10, 6], [12, 4], [12, 6], + ], + [ + # Row 3 + [17, 0], [17, 2], [15, 0], [14, 0], [15, 2], [16, 0], [13, 0], + [13, 2], [16, 2], [15, 4], [14, 2], [15, 6], [17, 4], [17, 6], + ], + [ + # Row 4 + [20, 0], [20, 2], [19, 0], [18, 0], [19, 2], [], [], [], [], + [19, 4], [18, 2], [19, 6], [20, 4], [20, 6], + ], + [ + # Row 5 + [ ], [23, 0], [22, 2], [22, 0], [22, 4], [21, 0], [21, 2], + [24, 0], [24, 2], [25, 0], [25, 4], [25, 2], [26, 0], [ ], + ], +] + +def set_attr_at(j, b, n, attr, fn, val): + blk = j[b][n] + if attr in blk: + blk[attr] = fn(blk[attr], val) + else: + blk[attr] = fn(None, val) + +def coord(col, row): + return cr_coord_map[row][col] + +def set_attr(orig, new): + return new + +def set_bg(j, (b, n), color): + set_attr_at(j, b, n, "c", set_attr, color) + #set_attr_at(j, b, n, "g", set_attr, False) + +def _set_tap_info(o, count, cap): + ns = 4 - o.count ("\n") + return o + "\n" * ns + "%.02f%%" % (float(count) / float(cap) * 100) + +def set_tap_info(j, (b, n), count, cap): + j[b][n + 1] = _set_tap_info (j[b][n + 1], count, cap) + +def heatmap_color (v): + colors = [ [0.3, 0.3, 1], [0.3, 1, 0.3], [1, 1, 0.3], [1, 0.3, 0.3]] + fb = 0 + if v <= 0: + idx1, idx2 = 0, 0 + elif v >= 1: + idx1, idx2 = len(colors) - 1, len(colors) - 1 + else: + val = v * (len(colors) - 1) + idx1 = int(floor(val)) + idx2 = idx1 + 1 + fb = val - float(idx1) + + r = (colors[idx2][0] - colors[idx1][0]) * fb + colors[idx1][0] + g = (colors[idx2][1] - colors[idx1][1]) * fb + colors[idx1][1] + b = (colors[idx2][2] - colors[idx1][2]) * fb + colors[idx1][2] + + r, g, b = [x * 255 for x in r, g, b] + return "#%02x%02x%02x" % (r, g, b) + +# Load the keylog +def load_keylog(fname, restrict_row): + keylog = {} + total = 0 + with open(fname, "r") as f: + lines = f.readlines() + for line in lines: + m = re.search ('KL: col=(\d+), row=(\d+)', line) + if not m: + continue + (c, r) = (int(m.group (2)), int(m.group (1))) + if restrict_row != None and r != int(restrict_row): + continue + if (c, r) in keylog: + keylog[(c, r)] = keylog[(c, r)] + 1 + else: + keylog[(c, r)] = 1 + total = total + 1 + return total / 2, keylog + +def l_flat(s): + f = s.split("\n") + return ", ".join (f) + +def main(base_fn, log_fn, restrict_row = None): + + with open(base_fn, "r") as f: + layout = json.load (f) + + ## Reset colors + for row in cr_coord_map: + for col in row: + if col != []: + set_bg (layout, col, "#d9dae0") + #set_attr_at (layout, col[0], col[1], "g", set_attr, True) + + total, log = load_keylog (log_fn, restrict_row) + max_cnt = 0 + for (c, r) in log: + max_cnt = max(max_cnt, log[(c, r)]) + + # Create the heatmap + for (c, r) in log: + coords = coord(c, r) + b, n = coords + cap = max_cnt + v = float(log[(c, r)]) / cap + print >> sys.stderr, "%s => %d/%d => %f = %s" % (l_flat(layout[b][n+1]), log[(c,r)], cap, v, heatmap_color(v)) + set_bg (layout, coord(c, r), heatmap_color (v)) + set_tap_info (layout, coord (c, r), log[(c, r)], total) + + print json.dumps(layout) + +if __name__ == "__main__": + if len(sys.argv) < 3: + print """Log to Heatmap -- creates a heatmap out of keyboard logs + +Usage: log-to-heatmap.py base-layout.json logfile [row] >layout.json""" + sys.exit (1) + main(*sys.argv[1:]) diff --git a/keyboards/ergodox/keymaps/algernon/tools/max-focused b/keyboards/ergodox/keymaps/algernon/tools/max-focused new file mode 100755 index 000000000..4d5220aa8 --- /dev/null +++ b/keyboards/ergodox/keymaps/algernon/tools/max-focused @@ -0,0 +1,5 @@ +#! /bin/sh +WIN="$(xdotool getactivewindow)" +wmctrl -i -r ${WIN} -b remove,maximized_vert,maximized_horz +xdotool windowsize ${WIN} 100% 100% +wmctrl -i -r ${WIN} -b add,maximized_vert,maximized_horz diff --git a/keyboards/ergodox/keymaps/andrew_osx/keymap.c b/keyboards/ergodox/keymaps/andrew_osx/keymap.c new file mode 100644 index 000000000..48257d23a --- /dev/null +++ b/keyboards/ergodox/keymaps/andrew_osx/keymap.c @@ -0,0 +1,187 @@ +// Netable differences vs. the default firmware for the ErgoDox EZ: +// 1. The Cmd key is now on the right side, making Cmd+Space easier. +// 2. The media keys work on OSX (But not on Windows). +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | '" | | '" | 6 | 7 | 8 | 9 | 0 | BkSp | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | - | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| / | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| Alt |AltShf| Left | Right| | Up | Down | [ | ] | L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Esc |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | ( | | { | | | + * | Space| LGui |------| |------| RGui |Enter | + * | | | ) | | } | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_QUOT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_FN1, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_LPRN, + KC_SPC,KC_LGUI,KC_RPRN, + // right hand + KC_QUOT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_FN1, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_BSLS, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TG(1), + KC_ESC, CTL_T(KC_ESC), + KC_LCBR, + KC_RCBR,KC_RGUI, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/bepo/bepo.png b/keyboards/ergodox/keymaps/bepo/bepo.png new file mode 100644 index 000000000..3df7aa609 Binary files /dev/null and b/keyboards/ergodox/keymaps/bepo/bepo.png differ diff --git a/keyboards/ergodox/keymaps/bepo/keymap.c b/keyboards/ergodox/keymaps/bepo/keymap.c new file mode 100644 index 000000000..921a94d63 --- /dev/null +++ b/keyboards/ergodox/keymaps/bepo/keymap.c @@ -0,0 +1,311 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_bepo.h" + +#define BASE 0 // default layer +#define QWER 1 // qwerty compat layer +#define SQWER 2 // shifted qwerty compat layer +#define AQWER 3 // alted qwerty compat layer +#define FNAV 4 // function / navigation keys +#define NUM 5 // numeric keypad keys +#define MSE 6 // mouse keys + +#define KP_00 0 +#define CA_Fx 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Base layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | B |E_ACUT| P | O |E_GRAV|Backsp| |CapsLo| ^ | V | D | L | J | Z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | W | A | U | I | E | , |------| |------| C | T | S | R | N | M | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | E_CIRC |A_GRAV| Y | X | . | K | | | | ' | Q | G | H | F | C_CEDIL| + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * |QWERTY| |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | L_Num| | CA_Fx| | | + * | Space|LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// Left hand +BP_DOLLAR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, KC_DEL, +BP_PERCENT, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_E_GRAVE, KC_BSPC, +BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMMA, +BP_ECRC, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TAB, +TG(QWER), KC_NO, KC_LGUI, KC_LCTL, KC_LALT, + KC_ESC, MO(MSE), + MO(NUM), + KC_SPC, KC_LSHIFT, MO(FNAV), +// Right hand + KC_SLCK, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL, + KC_CAPSLOCK, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, + BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, + KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, + BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_NO, KC_INS, +M(CA_Fx), +MO(FNAV), KC_RSHIFT, KC_ENTER), +/* Keymap 1: QWERTY system compatibility layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | b | e | p | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | w | a | u | i | e | , |------| |------| c | t | s | r | n | m | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | e | a | y | x | . | k | | | | ' | q | g | h | f | c | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | L_Num| | | | | + * | Space|LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[QWER] = KEYMAP( +// Left hand +KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LPRN, KC_RPRN, KC_DEL, +KC_PERCENT, KC_B, KC_E, KC_P, KC_O, KC_E, KC_BSPC, +KC_W, KC_A, KC_U, KC_I, KC_E, KC_COMMA, +KC_E, KC_A, KC_Y, KC_X, KC_DOT, KC_K, KC_TAB, +KC_TRNS, KC_NO, KC_LGUI, KC_LCTL, KC_LALT, + KC_ESC, MO(MSE), + MO(NUM), + KC_SPC, MO(SQWER), MO(FNAV), +// Right hand + KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, + KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, + KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, + KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, + MO(AQWER), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_NO, KC_INS, +KC_TRNS, +MO(FNAV), MO(SQWER), KC_ENTER), +/* Keymap 2: QWERTY shifted system compatibility layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ` | B | E | P | O | E |Backsp| |CapsLo| ! | V | D | L | J | Z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | W | A | U | I | E | ; |------| |------| C | T | S | R | N | M | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | L_Num| | | | | + * | Space|LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[SQWER] = KEYMAP( +// Left hand +KC_HASH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, +KC_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS, +S(KC_W), S(KC_A), S(KC_U), S(KC_I), S(KC_E), KC_SCOLON, +S(KC_E), S(KC_A), S(KC_Y), S(KC_X), KC_COLON, S(KC_K), S(KC_TAB), +KC_TRNS, KC_TRNS, S(KC_LGUI), S(KC_LCTL), S(KC_LALT), + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, +// Right hand + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_EXLM, S(KC_V), S(KC_D), S(KC_L), S(KC_J), S(KC_Z), + S(KC_C), S(KC_T), S(KC_S), S(KC_R), S(KC_N), S(KC_M), + KC_TRNS, S(KC_SLASH), S(KC_Q), S(KC_G), S(KC_H), S(KC_F), S(KC_C), + S(KC_RALT), S(KC_RCTL), S(KC_RGUI), KC_TRNS, KC_TRNS, +KC_TRNS, KC_TRNS, +KC_TRNS, +KC_TRNS, KC_TRNS, KC_TRNS), +/* Keymap 3: QWERTY alted system compatibility layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | + * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| + * | w | a | u | i | € | , |------| |------| c | t | s | r | n | m | + * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| + * | e | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | L_Num| | | | | + * | _ |LShift|------| |------|RShift|Enter | + * | | |L_FNav| |L_FNav| | | + * `--------------------' `--------------------' + */ +[AQWER] = KEYMAP( +// Left hand +KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LBRC, KC_RBRC, KC_DEL, +KC_PERCENT, KC_PIPE, KC_E, KC_AMPR, KC_O, KC_E, KC_BSPC, +KC_W, KC_A, KC_U, KC_I, RALT(KC_5), KC_COMMA, +KC_E, KC_BSLASH, KC_LCBR, KC_RCBR, KC_DOT, KC_TILDE, KC_TAB, +KC_TRNS, KC_NO, KC_LGUI, KC_LCTL, KC_LALT, + KC_ESC, MO(MSE), + MO(NUM), + KC_UNDS, MO(SQWER), MO(FNAV), +// Right hand + KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, + KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, + KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, + KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, + KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, +KC_NO, KC_INS, +KC_TRNS, +MO(FNAV), MO(SQWER), KC_ENTER), +/* Keymap 4: function / navigation layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 |VolMut| | | F6 | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | |VolDwn| | | PgUp | Home | Up | End | F11 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| PgDn | Left | Down | Right| F12 | | + * |--------+------+------+------+------+------| VolUp| | |------+------+------+------+------+--------| + * | | Undo | Cut | Copy | Paste| | | | | | | | | | | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | | | | | | | | | | | | | | | | | | + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[FNAV] = KEYMAP( +// Left hand +KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MUTE, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_VOLD, +KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_TRNS, KC_TRNS, +// Right hand + KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, + KC_NO, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_F11, KC_NO, + KC_PGDOWN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_F12, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, +KC_NO, KC_NO, +KC_TRNS, +KC_TRNS, KC_TRNS, KC_NO), +/* Keymap 5: numeric layer, sends keypad codes + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | + | - | / | * | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | 7 | 8 | 9 | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | 4 | 5 | 6 | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | 1 | 2 | 3 | | | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | | | | | | | | | | | | | 0 | 00 | . | | | + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | | | | | | + * | | |------| |------| | Enter| + * | | | | | | | | + * `--------------------' `--------------------' + */ +[NUM] = KEYMAP( +// Left hand +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, + KC_NO, KC_NO, + KC_TRNS, + KC_NO, KC_TRNS, KC_NO, +// Right hand + KC_NO, KC_NO, KC_KP_PLUS, KC_KP_MINUS, KC_KP_SLASH, KC_KP_ASTERISK, KC_NO, + KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_NO, KC_NO, + KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_NO, KC_NO, + KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_NO, KC_NO, + KC_KP_0, M(KP_00), KC_KP_COMMA, KC_NO, KC_NO, +KC_NO, KC_NO, +KC_NO, +KC_NO, KC_TRNS, KC_KP_ENTER), +/* Keymap 6: mouse layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | |LClick| Up |RClick| WhUp | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | Left | Down | Right|WhDown| | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' + * | | | | | | | | | | | | | | | | | | + * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[MSE] = KEYMAP( +// Left hand +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, + KC_NO, KC_TRNS, + KC_NO, + KC_NO, KC_TRNS, KC_NO, +// Right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_MS_WH_UP, KC_NO, + KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, +KC_NO, KC_NO, +KC_NO, +KC_NO, KC_TRNS, KC_NO) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case KP_00: + if (record->event.pressed) { + return MACRO( T(KP_0), D(KP_0), END ); + } else { + return MACRO( U(KP_0), END ); + } + break; + case CA_Fx: + if (record->event.pressed) { + layer_on(FNAV); + return MACRO( D(LALT), D(LCTL), END ); + } else { + layer_off(FNAV); + return MACRO( U(LCTL), U(LALT), END ); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; diff --git a/keyboards/ergodox/keymaps/bepo/readme.md b/keyboards/ergodox/keymaps/bepo/readme.md new file mode 100644 index 000000000..4a18cd80f --- /dev/null +++ b/keyboards/ergodox/keymaps/bepo/readme.md @@ -0,0 +1,34 @@ +# BEPO keymap for the ErgoDox + +This keymap has been made for the BEPO layout (http://bepo.fr), which is an ergonomic french keyboard layout based on Dvorak rules. As it's made for french people, the following of this readme will be in french. + +# Disposition BÉPO pour l'ErgoDox + +Cette keymap a été pensée pour la disposition BÉPO (http://bepo.fr), qui est une disposition de clavier francophone, ergonomique et libre, élaborée selon la méthode Dvorak. L'adaptation de cette disposition à l'ErgoDox a été réalisée en conservant les points forts du clavier TypeMatrix 2030 (très répandu dans la communauté bépo, avec un excellent rapport ergonomie / prix) voir en réglant certains de ses défauts (3 colonnes pour l'auriculaire droit et touche "Ê") et en apportant son lot de nouveautés (compatibilité avec les systèmes azerty et qwerty). + +Particularités +-------------- + +Touches de repos des pouces : "espace" à gauche et "entrée" à droite. + +Placement des touches de combinaison ("Shift", "Alt", "Ctrl"...) adapté aux pouces, et permettant de conserver chaque doigt pour les rangées de lettres auxquelles ils sont assignés sans avoir à changer la touche de combinaison de côté (exemple : "A" majuscule puis "M" majuscule avec les auriculaires et un seul appui d'une touche "Shift"). + +Les touches "Alt" et "Alt Gr" sont accessibles avec les pouces sur la rangée du bas comme sur la TypeMatrix 2030, avec une symétrie gauche / droite. + +Les touches "Ctrl" sont placées sur la même ligne que les touche "Alt" et "Alt Gr" comme sur un clavier clasique, elles sont accessibles aux pouces sur la rangée du bas (moins éloigné que le groupe de touches de pouces pour des petites mains). + +Les touches "Backspace" et "Delete" sont placées comme sur la TypeMatrix 2030, du côté gauche uniquement (pour laisser celles de la main droite servir de {caps,num,scroll}lock puisqu'elles ont des LED). + +La touche "Tab" est placée comme sur la TypeMatrix 2020. + +Meilleure symétrie et accessibilité que la TypeMatrix 2030 : les touches "W" et "%" ont dû être déplacées du côté gauche en raison du nombre de touches de l'ErgoDox, mais l'auriculaire droit ne gère maintenant que deux colonnes de touches au lieu de trois. La touche "Ê" redevient accessible sur la même rangée que les autres lettres, comme sur un clavier classique en disposition bépo. Les lettres, chiffres et symboles sont tous regroupés sur 4 lignes et 6 colonnes pour chaque main, et la première rangée de lettres à la main gauche conserve une identité visuelle "BÉPO". + +Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à F10 sont placées de façon logique par rapport aux chiffres 1 à 0. Cette même touche permet l'accès aux touches directionnelles sans déplacer la main droite. Les touches "Home" et "End" sont placées de la même façon que sur une TypeMatrix 2030 par rapport aux touches directionnelles. Les touches "Page Up" et "Page Down" sont également accessibles facilement sans déplacer la main droite. Les fonctions "VolUp" et "VolDown" sont placées comme sur la TypeMatrix 2030, avec la fonction "Mute" juste au dessus. Les fonctions "Undo", "Cut", "Copy" et "Paste" sont placées côte à côte comme elles le seraient sur un clavier QWERTY en combinaison avec la touche "Ctrl" (à l'emplacement des lettres "Z", "X", "C" et "V"). Par rapport au layout "SpaceFN", l'utilisation d'une touche de fonction dédiée au pouce permet de ne pas ajouter de latence, et la touche espace reste compatible avec les jeux (action au moment de l'appui et possibilité d'appui long). + +Touche de fonction permettant l'accès au pavé numérique comme sur la TypeMatrix 2030, mais sans avoir à déplacer la main droite : avec les doigts sur la rangée de repos, possibilité de saisir les chiffres "4", "5" et "6" comme sur un pavé numérique classique. Le double "0" de la TypeMatrix a été conservé, et gagne une possibilité de répétition en simples "0". + +L'appui sur une touche permet de basculer en mode BEPO sur un système configuré pour un clavier QWERTY. Cette compatibilité n'est pas parfaite (pas encore de gestion des accents mais ça devrait être faisable avec une disposition en qwerty international, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle. + +TODO : couche de compatibilité pour utiliser la disposition BÉPO sur un système configuré pour un clavier AZERTY. + +> Olivier Smedts diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/Makefile b/keyboards/ergodox/keymaps/coderkun_neo2/Makefile new file mode 100644 index 000000000..6c0a79b11 --- /dev/null +++ b/keyboards/ergodox/keymaps/coderkun_neo2/Makefile @@ -0,0 +1,2 @@ +SLEEP_LED_ENABLE = no +UNICODE_ENABLE = yes diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c new file mode 100644 index 000000000..8a2ba26d2 --- /dev/null +++ b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c @@ -0,0 +1,281 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "led.h" +#include "keymap_extras/keymap_neo2.h" + +// Layer names +#define BASE 0 // default layer +#define PMQ 1 // poor man’s QWERTZ +#define PMN 2 // poor man’s Neo +#define FMU 3 // FMU layer +#define NHL 4 // Neo’s software layer 4 rebuilt in Hardware + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Layer 0: default + * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠+ * │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ + * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + * │ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │ + * ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + * │ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │ + * ├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤ + * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ + * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + * │ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ Alt │ CTL │ + * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ + * │ ↠│ ↑ │ │ ↓ │ → │ + * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠+ * │ │ │ ─ │ │ ─ │ │ │ + * │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ + * │ │ │ HYP │ │ MEH │ │ │ + * └─────┴─────┴─────┘ └─────┴─────┴─────┘ + */ +[BASE] = KEYMAP( + // left hand + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, NEO_GRV, + NEO_Y, NEO_X, NEO_V, NEO_L, NEO_C, NEO_W, KC_HOME, + NEO_L1_L, NEO_U, NEO_I, NEO_A, NEO_E, NEO_O, + KC_LSFT, NEO_UE, NEO_OE, NEO_AE, NEO_P, NEO_Z, TG(PMQ), + KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,NEO_L2_L, + KC_LEFT, KC_UP, + KC_MINS, + KC_SPC, KC_ENT, ALL_T(KC_NO), + // right hand + NEO_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, + NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R, + TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT, + NEO_L2_R,KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, + KC_DOWN, KC_RGHT, + KC_MINS, + MEH_T(KC_NO),KC_ENT,KC_SPC + ), + +/* Layer 1: poor man’s QWERTZ + * based on kaimi’s layout + * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠+ * │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ + * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + * │ C │ P │ T │ F │ K │ L │ HOM │ │ END │ B │ A │ S │ G │ V │ Y │ + * ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + * │ Mod3 │ D │ H │ Ö │ O │ I ├─────┤ ├─────┤ U │ - │ Z │ E │ X │ Mod3 │ + * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ + * │ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │ + * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ + * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ + * │ ↠│ ↑ │ │ ↓ │ → │ + * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠+ * │ │ │ ─ │ │ ─ │ │ │ + * │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ + * │ │ │ HYP │ │ MEH │ │ │ + * └─────┴─────┴─────┘ └─────┴─────┴─────┘ + */ +[PMQ] = KEYMAP( + // left hand + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, + DE_C, DE_P, DE_T, DE_F, DE_K, DE_L, KC_HOME, + NEO_L1_L, DE_D, DE_H, DE_OE, DE_O, DE_I, + KC_LSFT, DE_AE, DE_Q, DE_R, DE_W, DE_N, KC_TRNS, + KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,MO(NHL), + KC_LEFT, KC_UP, + KC_MINS, + KC_SPC, KC_ENT, ALL_T(KC_NO), + // right hand + DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y, + DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R, + KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT, + MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, + KC_DOWN, KC_RGHT, + KC_MINS, + MEH_T(KC_NO),KC_ENT,KC_SPC + ), + +/* Layer 2: poor man’s Neo + * based on kaimi’s layout + * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠+ * │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ + * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + * │ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │ + * ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + * │ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │ + * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ + * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ + * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ + * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ + * │ ↠│ ↑ │ │ ↓ │ → │ + * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠+ * │ │ │ ─ │ │ ─ │ │ │ + * │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ + * │ │ │ HYP │ │ MEH │ │ │ + * └─────┴─────┴─────┘ └─────┴─────┴─────┘ + */ +[PMN] = KEYMAP( + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, + DE_Y, DE_X, DE_V, DE_L, DE_C, DE_W, KC_HOME, + KC_NO, DE_U, DE_I, DE_A, DE_E, DE_O, + KC_LSFT, DE_UE, DE_OE, DE_AE, DE_P, DE_Z, KC_TRNS, + KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,MO(NHL), + KC_LEFT, KC_UP, + KC_MINS, + KC_SPC, KC_ENT, ALL_T(KC_NO), + // right hand + DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS, + DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO, + KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT, + MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, + KC_DOWN, KC_RGHT, + KC_MINS, + MEH_T(KC_NO),KC_ENT,KC_SPC + ), + +/* Layer 3: F-keys, Mouse and Unicode + * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠+ * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + * │ │ │ │ │ ✕ │ │ │ │ │ │ F9 │ F10 │ F11 │ F12 │ │ + * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + * │ │ │ │ │ ✓ │ ├─────┤ ├─────┤ │ F5 │ F6 │ F7 │ F8 │ │ + * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ + * │ │ │ │ │ │ │ │ │ │ │ F1 │ F2 │ F3 │ F4 │ │ + * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ + * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ + * │ Ms↠│ Ms↑ │ │ Ms↓ │ Ms→ │ + * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠+ * │ │ │ MLC │ │ MRC │ │ │ + * │ │ ├─────┤ ├─────┤ │ │ + * │ │ │ │ │ │ │ │ + * └─────┴─────┴─────┘ └─────┴─────┴─────┘ + */ +[FMU] = KEYMAP( + // left hand + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,UC(0x2713),KC_TRNS,KC_TRNS, + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,UC(0x2715),KC_TRNS, + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_MS_L, KC_MS_U, + KC_BTN1, + KC_TRNS,KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS, KC_TRNS,KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + KC_TRNS,KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, + KC_TRNS, KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_MS_D, KC_MS_R, + KC_BTN2, + KC_TRNS, KC_TRNS,KC_TRNS + ), + +/* Layer 4: Neo’s software layer 4 rebuilt in Hardware + * based on kaimi’s layout + * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠+ * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ + * │ │ PgUp│ BSpc│ ↑ │ Del │ PgDn│ │ │ │ │ 7 │ 8 │ 9 │ + │ − │ + * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ + * │ │ Home│ ↠│ ↓ │ → │ End ├─────┤ ├─────┤ │ 4 │ 5 │ 6 │ , │ . │ + * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ + * │ │ Esc │ Tab │ Ins │ Ret │ Undo│ │ │ │ │ 1 │ 2 │ 3 │ │ │ + * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ + * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ + * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ + * │ │ │ │ │ │ + * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠+ * │ │ │ │ │ │ │ │ + * │ │ ├─────┤ ├─────┤ │ │ + * │ │ │ │ │ │ │ │ + * └─────┴─────┴─────┘ └─────┴─────┴─────┘ + */ +[NHL] = KEYMAP( + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_PGUP,KC_BSPC,KC_UP, KC_DELT,KC_PGDN,KC_NO, + KC_NO, KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_END, + KC_NO, KC_ESC, KC_TAB, KC_INS, KC_ENT, KC_UNDO,KC_TRNS, + KC_NO, KC_NO, KC_TRNS,KC_NO, KC_TRNS, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO, + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_7, KC_8, KC_9, DE_PLUS,DE_MINS, + KC_NO, KC_4, KC_5, KC_6, KC_COMM,KC_DOT, + KC_TRNS, KC_NO, KC_1, KC_2, KC_3, KC_NO, KC_NO, + KC_TRNS,KC_NO, KC_TRNS,KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [BASE] = ACTION_FUNCTION(BASE), + [PMQ] = ACTION_FUNCTION(PMQ), + [PMN] = ACTION_FUNCTION(PMN), + [FMU] = ACTION_LAYER_TAP_TOGGLE(FMU), + [NHL] = ACTION_LAYER_TAP_TOGGLE(NHL) +}; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } + else { + unregister_code(KC_RSFT); + } + break; + } + + return MACRO_NONE; +}; + + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) +{ + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case FMU: + ergodox_right_led_1_on(); + break; + case PMQ: + ergodox_right_led_2_on(); + break; + case PMN: + ergodox_right_led_3_on(); + break; + default: + if(host_keyboard_leds() & (1<event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/colemak/readme.md b/keyboards/ergodox/keymaps/colemak/readme.md new file mode 100644 index 000000000..e28b2f085 --- /dev/null +++ b/keyboards/ergodox/keymaps/colemak/readme.md @@ -0,0 +1,4 @@ +# ErgoDox EZ Colemak Configuration + +Colemak layout with same layers as default ergodox ez keymap. + diff --git a/keyboards/ergodox/keymaps/colemak_osx_pc_no/keyboard-layout.png b/keyboards/ergodox/keymaps/colemak_osx_pc_no/keyboard-layout.png new file mode 100644 index 000000000..57df5a1f9 Binary files /dev/null and b/keyboards/ergodox/keymaps/colemak_osx_pc_no/keyboard-layout.png differ diff --git a/keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c b/keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c new file mode 100644 index 000000000..a909ed3a4 --- /dev/null +++ b/keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c @@ -0,0 +1,264 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_norwegian.h" + +#define BASE 0 // default layer +#define BASE_MAC 1 // default layer mac +#define NUMB_SYMB 2 // numbers and symbols +#define NUMB_SYMB_MAC 3 // numbers and symbols mac +#define FUNCTION 4 // function keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Keymap 0: Basic layer PC + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | \ | [ | ] | { | } | * |Mac/PC| | ^ | $ | ( | ) | < | > | @ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ? | Q | W | F | P | G | " | | ' | J | L | U | Y | Å | Æ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | : | A | R | S | T | D |------| |------| H | N | E | I | O | Ø | + * |--------+------+------+------+------+------| ; | | = |------+------+------+------+------+--------| + * | ! | Z | X | C | V | B | | | | K | M | RIGHT| DOWN | UP | _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Func | Lclk | Rclk | TAB |,/CTRL| | LEFT | Esc | ` | # | Num | + * `----------------------------------' `----------------------------------' + * ,-------------. ,--------------. + * | & | | | |Insert| / | + * ,------|------|------| |------+-------+------. + * | | | + | | Del | | | + * | Shift| ./Spc|------| |------| Enter |Space| + * | | |-/Alt | | Bspc | | | + * `--------------------' `---------------------' + */ +[BASE] = KEYMAP( + // left hand + NO_BSLS, NO_LBRC, NO_RBRC, NO_LCBR, NO_RCBR, NO_ASTR, TG(1), + NO_QUES, KC_Q, KC_W, KC_F, KC_P, KC_G, NO_QUO2, + NO_COLN, KC_A, KC_R, KC_S, KC_T, KC_D, + KC_EXLM, KC_Z, KC_X, KC_C, KC_V, KC_B, NO_SCLN, + MO(4), KC_BTN1, KC_BTN2, KC_TAB,GUI_T(KC_COMMA), + NO_AMPR, NO_PIPE, + NO_PLUS, + KC_FN1,CTL_T(KC_DOT),ALT_T(NO_MINS), + // right hand + KC_FN5, NO_DLR, NO_LPRN, NO_RPRN ,KC_FN3, KC_FN4,NO_AT, + NO_APOS, KC_J, KC_L, KC_U, KC_Y, NO_AA, NO_AE , + KC_H, KC_N, KC_E, KC_I, KC_O, NO_OSLH, + NO_EQL, KC_K, KC_M, KC_RIGHT, KC_DOWN, KC_UP, NO_UNDS, + KC_LEFT, KC_ESC, KC_FN7, KC_HASH, MO(2), + KC_INSERT, NO_SLSH, + KC_DELT, + KC_BSPC,KC_ENT,KC_SPC + ), +/* Keymap 1: Basic layer MACS (Same as pc, except for cmd/ctrl, which are swapped) + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | \ | | | { | } | | | | | $ | | | < | > | @ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | ' |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Func | | | |,/Ctrl| | | | ` | | Num | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | |./Cmd |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[BASE_MAC] = KEYMAP( + NO_BSLS_MAC, KC_TRNS,KC_TRNS, NO_LCBR_MAC,NO_RCBR_MAC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CTL_T(KC_COMMA), + KC_TRNS, NO_PIPE_MAC, + KC_TRNS, + KC_TRNS,GUI_T(KC_DOT) , KC_TRNS, + // right hand + KC_TRNS, NO_DLR_MAC, KC_TRNS,KC_TRNS,KC_FN8, KC_FN9,NO_AT_MAC, + NO_APOS_MAC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, NO_GRV_MAC, KC_TRNS, MO(3), + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + +/* Keymap 2: Number ++ layer pc + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | % | | | | | | ~ | ´ | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | 3 | 2 | 1 | 0 | |------| |------| | 5 | 6 | 7 | 8 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | 4 | | | | | | 9 | END | PGDWN| PGUP | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | HOME | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[NUMB_SYMB] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_PERC, KC_TRNS , KC_TRNS, + KC_TRNS, KC_3 , KC_2 , KC_1 , KC_0 , KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_FN2, KC_FN6 , KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_5, KC_6, KC_7, KC_8, KC_TRNS, + KC_TRNS, KC_HOME, KC_9, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, + KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + +/* Keymap 3: Number ++ layer mac. Some keys have to be repeated from the pc symbol layer, since transient keys inherit from the layer we jump from, not the layer above. + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | % | | | | | | ~ | ´ | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | 3 | 2 | 1 | 0 | |------| |------| | 5 | 6 | 7 | 8 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | 4 | | | | | | 9 | END | PGDWN| PGUP | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | HOME | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[NUMB_SYMB_MAC] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_PERC, KC_TRNS , KC_TRNS, + KC_TRNS, KC_3 , KC_2 , KC_1 , KC_0 , KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_FN2, KC_FN10, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_5, KC_6, KC_7, KC_8, KC_TRNS, + KC_TRNS, KC_HOME, KC_9, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, + KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + +/* Keymap 4: Function layer mac + pc + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | F3 | F2 | F1 | | |------| |------| | F5 | F6 | F7 | F8 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | F4 | | | | | | F9 | F10 | F11 | F12 | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[FUNCTION] = KEYMAP( + KC_5, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, + KC_TRNS, KC_F3 , KC_F2 , KC_F1 , KC_TRNS , KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F4, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, + KC_TRNS, NO_TILD, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +) +}; + +enum macro_id { + TILDE_NO, LESS_NO, GRTR_NO, CIRC_NO, ACUT_NO, GRV_NO, LESS_NO_MAC, GRTR_NO_MAC, ACUT_NO_MAC +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_MODS_ONESHOT(MOD_LSFT), // Sticky shift light. Tap for the next keypress to be shifted. Hold for regular shift. + [2] = ACTION_MACRO(TILDE_NO), // Completed ~ character(pc and mac), no space needed. + [3] = ACTION_MACRO(LESS_NO), // < completed on keypress down, to avoid shifting the next character if it is not released first. + [4] = ACTION_MACRO(GRTR_NO), // > completed on keypress down, to avoid shifting the next character if it is not released first. + [5] = ACTION_MACRO(CIRC_NO), // Completed ^ character, no space needed. + [6] = ACTION_MACRO(ACUT_NO), // Completed ´ character, no space needed. + [7] = ACTION_MACRO(GRV_NO), // Completed ` character, no space needed. + [8] = ACTION_MACRO(LESS_NO_MAC), // < completed on keypress down, to avoid same button problem when typing <> quickly + [9] = ACTION_MACRO(GRTR_NO_MAC), // > completed on keypress down, to avoid same button problem when typing <> quickly + [10] = ACTION_MACRO(ACUT_NO_MAC), // Completed ´ character, no space needed +}; + + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + keyevent_t event = record->event; + + switch (id) { + case TILDE_NO: + return (event.pressed ? MACRO( D(RALT), T(RBRC), U(RALT), T(SPC), END ) : MACRO_NONE); + case LESS_NO: + return (event.pressed ? MACRO( T(NUBS), END ) : MACRO_NONE); + case GRTR_NO: + return (event.pressed ? MACRO( D(LSFT), T(NUBS), U(LSFT), END ) : MACRO_NONE); + case CIRC_NO: + return (event.pressed ? MACRO( D(LSFT), T(RBRC), U(LSFT), T(SPC), END ) : MACRO_NONE); + case ACUT_NO: + return (event.pressed ? MACRO( D(RALT), T(EQL), U(RALT), T(SPC), END ) : MACRO_NONE); + case GRV_NO: + return (event.pressed ? MACRO( D(LSFT), T(EQL), T(SPC), U(LSFT), END ) : MACRO_NONE); + case LESS_NO_MAC: + return (event.pressed ? MACRO( T(GRV), END ) : MACRO_NONE); + case GRTR_NO_MAC: + return (event.pressed ? MACRO( D(LSFT), T(GRV), U(LSFT), END ) : MACRO_NONE); + case ACUT_NO_MAC: + return (event.pressed ? MACRO( T(EQL), T(SPC), END ) : MACRO_NONE); + } + return MACRO_NONE; +}; diff --git a/keyboards/ergodox/keymaps/colemak_osx_pc_no/readme.md b/keyboards/ergodox/keymaps/colemak_osx_pc_no/readme.md new file mode 100644 index 000000000..48f095cae --- /dev/null +++ b/keyboards/ergodox/keymaps/colemak_osx_pc_no/readme.md @@ -0,0 +1,23 @@ +# Norwegian Colemak setup with osx/pc toggle + +## Motivation +I wanted a Norwegian Colemak setup that worked in a similar way on both my Mac and PC. I also wanted it to translate from a standard Norwegian keyboard OS setup. + +## Overview +The setup is created to be programmer friendly. +- Most of the symbols used in code can be activated without using layers or shift key. +- You can reach the IDE/OS shortcut activators(Ctrl, Win/Cmd, Alt, Shift) with the thumb. +- Navigation is prioritized, arrows are right below the home row. + +## PC/Mac toggle +The default setup is for Norwegian keyboard setting(not colemak variants) on a PC(Windows or Linux). Use the Mac/PC toggle button to switch between OSX and PC setup. The settings will be reverted to PC setup each time you restart/connect the keyboard. + +## Layers +Numbers and function buttons are on their own layers. The easiest way to switch layers(at least with my hands) in this setup, is to push your hand right below the little finger, on the layer switches. You will then have all your fingers free to type numbers or press function buttons. + +## Shift-key +Tap for the next character to be shifted, hold down for regular shift functionality + +## Layout + +![keyboard-layout](keyboard-layout.png) diff --git a/keyboards/ergodox/keymaps/csharp_dev/csharp_dev.png b/keyboards/ergodox/keymaps/csharp_dev/csharp_dev.png new file mode 100644 index 000000000..6fba568fc Binary files /dev/null and b/keyboards/ergodox/keymaps/csharp_dev/csharp_dev.png differ diff --git a/keyboards/ergodox/keymaps/csharp_dev/csharp_dev_legend.png b/keyboards/ergodox/keymaps/csharp_dev/csharp_dev_legend.png new file mode 100644 index 000000000..b0a1c513c Binary files /dev/null and b/keyboards/ergodox/keymaps/csharp_dev/csharp_dev_legend.png differ diff --git a/keyboards/ergodox/keymaps/csharp_dev/keymap.c b/keyboards/ergodox/keymaps/csharp_dev/keymap.c new file mode 100644 index 000000000..e9648ede7 --- /dev/null +++ b/keyboards/ergodox/keymaps/csharp_dev/keymap.c @@ -0,0 +1,239 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define FKEYS 1 // F keys + macros + +#define MACRO_PUBLIC 10 +#define MACRO_PRIVATE 11 + +#define MACRO_STATIC 12 +#define MACRO_CONST 13 + +#define MACRO_VOID 14 +#define MACRO_VAR 15 +#define MACRO_STRING 16 + +#define MACRO_INT 17 +#define MACRO_FLOAT 18 +#define MACRO_BOOL 19 + +#define MACRO_RETURN 20 +#define MACRO_NULL 21 +#define MACRO_BREAK 22 + +#define MACRO_TODO 23 +#define MACRO_NEW 24 +#define MACRO_PARENTHESE 25 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ( | 1 | 2 | 3 | 4 | 5 | " | | Save | 6 | 7 | 8 | 9 | 0 | [ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ) | Q | W | E | R | T |Bkspa | | Del | Y | U | I | O | P | ] | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | { | A | S | D | F | G |------| |------| H | J | K | L | _ | Redo | + * |--------+------+------+------+------+------| / | | ; |------+------+------+------+------+--------| + * | } |Z~Alt | X | C | V | B | | | | N | M | ' | ! | ? | Undo | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Tab~CL| < | > | | | & | | = | + | - | * | L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |. ~L1 | , | |Home |End~L1| + * ,------|------|------| |------+------+------. + * | | | Copy | | UP | | | + * | Enter| Space|------| |------| Space|Enter | + * | ~WIN | ~LSFT| Past | | DOWN | ~LSFT| ~WIN | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_LPRN, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_QUOTE), + KC_RPRN, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPACE, + KC_LCBR, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_RCBR, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_SLASH, + CTL_T(KC_TAB), LSFT(KC_COMMA),LSFT(KC_DOT),KC_PIPE,KC_AMPR, + LT(1,KC_DOT), KC_COMM, + LCTL(KC_C), + GUI_T(KC_ENTER),SFT_T(KC_SPACE),LCTL(KC_V), + // right hand + LCTL(KC_S) , KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRACKET, + KC_DELETE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET, + KC_H, KC_J, KC_K, KC_L, KC_UNDS,LCTL(KC_Y), + KC_SCOLON,KC_N, KC_M, KC_QUOTE ,KC_EXLM , LSFT(KC_SLASH), LCTL(KC_Z), + KC_EQUAL,KC_PLUS , KC_MINUS,KC_ASTR , TG(1), + KC_HOME, LT(1,KC_END), + KC_UP, + KC_DOWN,SFT_T(KC_SPACE), GUI_T(KC_ENTER) + ), + +/* Keymap 1: F keys + macros + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | F1 | F2 | F3 | F4 | F5 | ` | | Calc | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab |Public|Static|string|int |return| | | |//TODO| | | | | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |Privat|Const |var |float |null |------| |------|new | | | | | | + * |--------+------+------+------+------+------| \ | | ~ |------+------+------+------+------+--------| + * | | | |void |bool |break;| | | |(); | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | WIN | Alt | | | | PgUp | PgDw | Ins | PtSc | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | Cut | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| Left | Right| + * | | | | | | | | + * `--------------------' `--------------------' + */ +// FKEYS + MACROS +[FKEYS] = KEYMAP( + // left hand + KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_GRAVE, + KC_TAB,M(MACRO_PUBLIC),M(MACRO_STATIC), M(MACRO_STRING),M(MACRO_INT),M(MACRO_RETURN),KC_TRNS, + KC_TRNS,M(MACRO_PRIVATE),M(MACRO_CONST), M(MACRO_VAR),M(MACRO_FLOAT),M(MACRO_NULL), + KC_TRNS,KC_TRNS,KC_TRNS,M(MACRO_VOID),M(MACRO_BOOL),M(MACRO_BREAK),KC_BSLASH, + KC_TRNS,KC_LGUI,KC_LALT,KC_TRNS,KC_TRNS, + KC_TRNS,LCTL(KC_X), + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_CALCULATOR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, M(MACRO_TODO), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, + M(MACRO_NEW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TILD, M(MACRO_PARENTHESE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_PGUP,KC_PGDOWN, KC_INSERT, KC_PSCREEN, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_LEFT, KC_RIGHT +), + + +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(FKEYS) // FN1 - Momentary Layer 1 +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case MACRO_PUBLIC: + if (record->event.pressed) { + return MACRO( T(P), T(U), T(B), T(L), T(I), T(C), T(SPACE),END); + } + break; + case MACRO_PRIVATE: + if (record->event.pressed) { + return MACRO( T(P), T(R), T(I), T(V), T(A), T(T), T(E), T(SPACE),END); + } + break; + case MACRO_STATIC: + if (record->event.pressed) { + return MACRO( T(S), T(T), T(A), T(T), T(I), T(C), T(SPACE), END); + } + break; + case MACRO_CONST: + if (record->event.pressed) { + return MACRO( T(C), T(O), T(N), T(S), T(T), T(SPACE), END); + } + break; + case MACRO_VOID: + if (record->event.pressed) { + return MACRO( T(V), T(O), T(I), T(D), T(SPACE), END); + } + break; + case MACRO_VAR: + if (record->event.pressed) { + return MACRO( T(V), T(A), T(R), T(SPACE), END); + } + break; + case MACRO_STRING: + if (record->event.pressed) { + return MACRO( T(S), T(T), T(R), T(I), T(N), T(G), T(SPACE), END); + } + break; + case MACRO_BOOL: + if (record->event.pressed) { + return MACRO( T(B), T(O), T(O), T(L), T(SPACE), END); + } + break; + case MACRO_INT: + if (record->event.pressed) { + return MACRO( T(I), T(N), T(T), T(SPACE), END); + } + break; + case MACRO_FLOAT: + if (record->event.pressed) { + return MACRO( T(F), T(L), T(O), T(A),T(T),T(SPACE), END); + } + break; + case MACRO_RETURN: + if (record->event.pressed) { + return MACRO( T(R), T(E), T(T), T(U),T(R),T(N), END); + } + break; + case MACRO_NULL: + if (record->event.pressed) { + return MACRO( T(N), T(U), T(L), T(L), END); + } + case MACRO_BREAK: + if (record->event.pressed) { + return MACRO( T(B), T(R), T(E), T(A), T(K), T(SCOLON), END); + } + break; + case MACRO_TODO: + if (record->event.pressed) { + return MACRO( T(SLASH), T(SLASH), D(LSHIFT) ,T(T), T(O), T(D), T(O),U(LSHIFT), T(SPACE),END); + } + break; + case MACRO_NEW: + if (record->event.pressed) { + return MACRO( T(N), T(E), T(W), T(SPACE), END); + } + break; + case MACRO_PARENTHESE: + if (record->event.pressed) { + return MACRO( D(LSHIFT),T(9), T(0),U(LSHIFT), T(SCOLON), END); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/csharp_dev/readme.md b/keyboards/ergodox/keymaps/csharp_dev/readme.md new file mode 100644 index 000000000..96af077ad --- /dev/null +++ b/keyboards/ergodox/keymaps/csharp_dev/readme.md @@ -0,0 +1,47 @@ +# ErgoDox EZ C# Developer configuration + +## Changelog + +* Feb 12, 2016 (V1): + * First version commit +* Mar 20, 2016 (V2): + * Removed "Classic QWERTY" layer, inverted GUI and SHIFT on Hold for Space and Enter + +## About +This layout was conceived in an attempt to optimise keyboard layout for developers (C# more specifically, but it can work with most of other languages), and limit the keys required to perform the most frequent actions. + +I came to the realization that my main tool as a developer, the qwerty keyboard was something that did not evolved at its core in almost 150 years. +There are a lot of reasons to this, and it would be a massive entreprise to change a standard so strongly anchored, but I wanted to give it a try and see how would look an input device dedicated to developers, more specifically a C# developer in my case. +The biggest flaw in standard QWERTY keyboards was that I always needed to perform key combination to access commonly used characters or actions. Think about it a minute, how many times a day do you press a modifier key such as Ctrl or Shift, it's insane and could be so easily optimized to require only one key press. + +Then I came across the ErgoDox EZ project, that allowed a full customization of its firmware, and a unique 2 parts design. + +![CSharpDev](csharp_dev_legend.png) + +## Layout design principles +* No key combination required for the most common input characters ( (),[],{},<> ... ) +* No key combination required for the most common actions (copy/paste/undo/save) +* Regroup characters by usage ( + - * = ...) +* Easy access to the most commonly used characters: ; / " . , +* Preregistered macro for the most common C# langage instructions: public / private / string / int / float ... + +## Why is it specific to C Sharp +I defined the characters priority based on their usage in C# language, most of this characters are also used in other coding languages but it may require some tweaking. +For example there is no direct access to ~ or $ keys which can be very common in some languages. +Note it is also specific to Windows environement as the shortcut used in action keys would not work on Mac Os + +## In usage +It was relatively easy to get used to the layout, but it's hard for me to define how easy it was as I was getting used to a blank Ergodox keyboard at the same time. +Still it's extremely satisfying to Save your file with just one easily accessible key or to have one big key to end your code line ( ; ) + +## Improvements +This layout was shared after a bunch of iterations and only once I was happy with it. +Still there are many way to improve or iterate on this: +* Make it language agnostic +* Check and compile language's keyboard's heatmaps to statistically define keys priority (e.g. https://dzone.com/articles/most-pressed-keys-various ) +* QWERTY is still not the most efficient typing layout, I would like to create a Dvorak based similar layout in a near futur + +## Issues +One of the issues encountered while creating this layout was that I did not find a way to have a key to send a modifier on hold, and a key combination while pressed (e.g. I can't set a Key to do Save (Ctrl + S) when pressed and Shift modifier when hold ) + + diff --git a/keyboards/ergodox/keymaps/dave/keymap.c b/keyboards/ergodox/keymaps/dave/keymap.c new file mode 100644 index 000000000..e9480af3e --- /dev/null +++ b/keyboards/ergodox/keymaps/dave/keymap.c @@ -0,0 +1,199 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define PROG 1 // programming +#define NAVI 2 // navigation + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | | 6 | 7 | 8 | 9 | 0 | - | BkSpce | + * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | Y | | G | Y | U | I | O | P | Enter | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L | ; | Enter | + * |--------+------+------+------+------+------| H | | B |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |`/Ctrl| \ | | | LAlt | | RAlt | [ | ] | |'/Ctrl| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | PrtS | PrtS | | CtAl | CtAl | + * ,------+------+------| |------+------+------. + * | | | L1 | | L1 | | | + * | Spce | ~L2 +------| |------+ ~L1 | Spce | + * | | | LGui | | RGui | | | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_H, + CTL_T(KC_GRV),KC_NUBS,KC_NO, KC_NO, KC_LALT, + KC_PSCREEN, KC_PSCREEN, + TO(PROG, ON_PRESS), + KC_SPC, MO(NAVI), KC_LGUI, + // right hand + KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, + KC_G, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENTER, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, + KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_RALT,KC_LBRC,KC_RBRC,KC_NO, CTL_T(KC_QUOT), + MT(0x5, KC_NO), MT(0x5, KC_NO), + TO(PROG, ON_PRESS), + KC_RGUI, MO(PROG), KC_SPC + ), + +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | K/ | K* | K- | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | ( | ) | | | | | | | K7 | K8 | K9 | K+ | # | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | { | } | ` |------| |------| | K4 | K5 | K6 | K+ | ' | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | | K1 | K2 | K3 | K= | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | K0 | K0 | K. | K= | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | L2 | | L2 | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// PROGRAMMING +[PROG] = KEYMAP( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + TO(NAVI, ON_PRESS), + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_NO, KC_PSLS, KC_PAST, KC_PMNS, KC_EQUAL, + KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_NUHS, + KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_QUOT, + KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PENT, KC_TRNS, + KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_TRNS, + KC_TRNS, KC_TRNS, + TO(NAVI, ON_PRESS), + KC_TRNS, KC_TRNS, KC_TRNS +), + +/* Keymap 2: Navigation and system keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | Home | Up | End | Ins | PgUp | | | | | | Ins | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Left | Down | Rght | Del | PgDn |------| |------| | Back | Del | Fwrd | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Lclk | MsUp | Rclk | | | | | | | Prev | Play | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | MsLt | MsDn | MsRt | | |VolDn | Mute |VolUp | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | L0 | | L0 | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// NAVIGATION +[NAVI] = KEYMAP( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_TRNS, KC_HOME, KC_UP, KC_END, KC_INS, KC_PGUP, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DELT, KC_PGDN, + KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, + TO(BASE, ON_PRESS), + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_WBAK, KC_DELT, KC_WFWD, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + TO(BASE, ON_PRESS), + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + //[1] = ACTION_LAYER_TAP_TOGGLE(PROG), // FN1 - Momentary Layer 1 (Symbols) + //[2] = ACTION_LAYER_TAP_TOGGLE(NAVI) // FN2 - Momentary Layer 2 (Navigation) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + /* leds is a static array holding the current brightness of each of the + * three keyboard LEDs. It's 4 long simply to avoid the ugliness of +1s and + * -1s in the code below, and because wasting a byte really doesn't matter + * that much (no, it *doesn't*, stop whinging!). Note that because it's + * static it'll maintain state across invocations of this routine. + */ + static uint8_t leds[4]; + uint8_t led; + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + + /* Loop over each LED/layer */ + for (led = 1; led <= 3; ++led) { + /* If the current layer matches the current LED, increment its + * brightness by 1 up to a maximum of 255. If the current layer doesn't + * match, decrement its brightness by 1 down to a minimum of zero. + */ + leds[led] += (layer == led) ? + (leds[led] < 255 ? 1 : 0): + (leds[led] > 0 ? -1 : 0); + /* Set LED state according to the new brightness */ + if (leds[led]) { + ergodox_right_led_on(led); + ergodox_right_led_set(led, leds[led]); + } + else { + ergodox_right_led_off(led); + } + } + + +}; diff --git a/keyboards/ergodox/keymaps/dave/readme.md b/keyboards/ergodox/keymaps/dave/readme.md new file mode 100644 index 000000000..aa0f9bd19 --- /dev/null +++ b/keyboards/ergodox/keymaps/dave/readme.md @@ -0,0 +1,38 @@ +This keymap is my preferred layout (after a certain amount of experimentation). +The rationale behind the design is as follows: + +I grew up typing from a very early age and thus never learned the "correct" way +to touch type (essentially, I'm self-taught). As a, result my fingers don't +tend to stay on the "home keys" and occasionally my right hand wants to type +keys that are on the left of the keyboard, and vice versa. + +Hence, despite liking the idea of split keyboards in principle, I've never been +able to get on with them because the split simply doesn't work with my style of +typing. The Ergodox solves this neatly by virtue of having a few extra keys in +the "middle" of the keyboard which I can utilise for deliberate redundancy. +Thus in this keymap there are two "6" keys (one on the left, one on the right) +and likewise Y, H, G, and B are all duplicated to enable one-handed patterns +that I use frequently (e.g. "byobu" with the right hand, "yes" with the left, +etc.). + +I occasionally use the numeric pad for data entry, thus this is duplicated +under the natural home position of the right hand in layer 1 (activated by +holding one of the right thumb buttons), while the cursor keys are duplicated +under the classic WASD gaming layout of the left hand in layer 2 (activated by +holding one of the left thumb buttons). Various other useful keys also appear +in these layers (brackets and symbols for coding in layer 1, navigation and +F-keys in layer 2, etc.). + +Finally, modifier keys like Ctrl, Shift, and Alt, along with Backspace and +Enter are all in traditional locations in an effort to reuse existing muscle +memory as much as possible (keys like =, #, and ' are in layer 1). The layout +maps are in the comments of keymap_dave.c so I won't bother duplicating them +here. + +Oh, and the LEDs are rather pimped ... because I could! + +Anyway, although I'm sure this keymap won't be to many people's taste you might +find some interesting ideas in here for your own layouts. Do tweet me +(@waveform80) if you have any questions / suggestions / bugs. + +Dave. diff --git a/keyboards/ergodox/keymaps/default/default.png b/keyboards/ergodox/keymaps/default/default.png new file mode 100644 index 000000000..6575f7b5e Binary files /dev/null and b/keyboards/ergodox/keymaps/default/default.png differ diff --git a/keyboards/ergodox/keymaps/default/default_highres.png b/keyboards/ergodox/keymaps/default/default_highres.png new file mode 100644 index 000000000..7d9f045f4 Binary files /dev/null and b/keyboards/ergodox/keymaps/default/default_highres.png differ diff --git a/keyboards/ergodox/keymaps/default/keymap.c b/keyboards/ergodox/keymaps/default/keymap.c new file mode 100644 index 000000000..f1a83f4e7 --- /dev/null +++ b/keyboards/ergodox/keymaps/default/keymap.c @@ -0,0 +1,182 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/default/readme.md b/keyboards/ergodox/keymaps/default/readme.md new file mode 100644 index 000000000..8f6dba45e --- /dev/null +++ b/keyboards/ergodox/keymaps/default/readme.md @@ -0,0 +1,10 @@ +# ErgoDox EZ Default Configuration + +## Changelog + +* Feb 2, 2016 (V1.1): + * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). + +This is what we ship with out of the factory. :) The image says it all: + +![Default](default_highres.png) diff --git a/keyboards/ergodox/keymaps/default_osx/default_osx_highres.png b/keyboards/ergodox/keymaps/default_osx/default_osx_highres.png new file mode 100644 index 000000000..04f46bbd5 Binary files /dev/null and b/keyboards/ergodox/keymaps/default_osx/default_osx_highres.png differ diff --git a/keyboards/ergodox/keymaps/default_osx/keymap.c b/keyboards/ergodox/keymaps/default_osx/keymap.c new file mode 100644 index 000000000..c57ffbb88 --- /dev/null +++ b/keyboards/ergodox/keymaps/default_osx/keymap.c @@ -0,0 +1,187 @@ +// Netable differences vs. the default firmware for the ErgoDox EZ: +// 1. The Cmd key is now on the right side, making Cmd+Space easier. +// 2. The media keys work on OSX (But not on Windows). +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/default_osx/readme.md b/keyboards/ergodox/keymaps/default_osx/readme.md new file mode 100644 index 000000000..aa749aac9 --- /dev/null +++ b/keyboards/ergodox/keymaps/default_osx/readme.md @@ -0,0 +1,8 @@ +# The OSX Friendly Version of the Default Firmware + +So, I took the default firmware and just made a couple of tweaks that make it easier to use with OS X: + +1. The Cmd key is now on the right side, making Cmd+Space easier. +2. The media keys work on OSX (But not on Windows). + +![default osx](default_osx_highres.png) diff --git a/keyboards/ergodox/keymaps/dragon788/keymap.c b/keyboards/ergodox/keymaps/dragon788/keymap.c new file mode 100644 index 000000000..3aec8c6cf --- /dev/null +++ b/keyboards/ergodox/keymaps/dragon788/keymap.c @@ -0,0 +1,229 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys +#define PLVR 3 // Plover layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LGui | |Plover| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | ; | '"/Ctrl| + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | ~L1 | Grv | '" | Left |Rgt/L2| | Up/L2| Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | Home | | PgUp |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | End | | PgDn | | | + * |Backsp|Delete|------| |------| Enter |Space | + * | ace | | LAlt | |TabCtl| | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_FN1, KC_GRV, KC_QUOT,KC_LEFT, LT(MDIA, KC_RGHT), + KC_APP, KC_HOME, + KC_END, + KC_BSPC,KC_DELT,KC_LALT, + // right hand + TG(3), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + LT(MDIA, KC_UP), KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_PGUP, CTL_T(KC_ESC), + KC_PGDN, + CTL_T(KC_TAB),KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | Calc | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_CALC, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | Rclk | Lclk | | | | | | Lclk | Rclk | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft| MsUp |MsDown|MsRght|------| |------|MsLeft|MsDown| MsUp |MsRght| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | Prev | |VolUp | | + * ,------|------|------| |------+------+------. + * | | | Play | | Mute |Brwser|Brwser| + * | Lclk | Rclk |------| |------|Fwd |Back | + * | | | Next | |VolDn | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_MPRV, + KC_MPLY, + KC_BTN1, KC_BTN2, KC_MNXT, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_TRNS, + KC_MUTE, + KC_VOLD, KC_WBAK, KC_WFWD +), + +/* Keymap 4: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | c | v |------| |------| n | m | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( // layout: layer 4: Steno for Plover + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_FN4, KC_NO, + KC_NO, + KC_C, KC_V, KC_NO, + // right hand + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M +), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/dvorak/dvorak.png b/keyboards/ergodox/keymaps/dvorak/dvorak.png new file mode 100644 index 000000000..cb8316309 Binary files /dev/null and b/keyboards/ergodox/keymaps/dvorak/dvorak.png differ diff --git a/keyboards/ergodox/keymaps/dvorak/keymap.c b/keyboards/ergodox/keymaps/dvorak/keymap.c new file mode 100644 index 000000000..22947327d --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | \ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | O | E | U | I |------| |------| D | H | T | N |S / L2| - | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(1), + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, + MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout0.png b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout0.png new file mode 100644 index 000000000..6a36f9bfa Binary files /dev/null and b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout0.png differ diff --git a/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout1.png b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout1.png new file mode 100644 index 000000000..c6e6d913c Binary files /dev/null and b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout1.png differ diff --git a/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout2.png b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout2.png new file mode 100644 index 000000000..23f56ff4c Binary files /dev/null and b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keyboard-layout2.png differ diff --git a/keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c new file mode 100644 index 000000000..82f55b4bc --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c @@ -0,0 +1,185 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | BrBck| | Play | 6 | 7 | 8 | 9 | 0 | \ / L2 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Esc | ' | , | . | P | Y | Del | | Ins | F | G | C | R | L | / | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | O | E | U | I |------| |------| D | H | T | N | S | - | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| LAlt | LGui | Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | App | L1 | | L2 |PrntScr | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space| Tab |------| |------| AltShf |Enter | + * | | | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_WBAK, + KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_DELT, + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_LALT, KC_LGUI, KC_LEFT,KC_RGHT, + CTL_T(KC_APP), TG(1), + KC_HOME, + KC_SPC,KC_TAB,KC_END, + // right hand + KC_MPLY, KC_6, KC_7, KC_8, KC_9, KC_0, LT(MDIA, KC_BSLS), + KC_INS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + TG(2), KC_PSCREEN, + KC_PGUP, + KC_PGDN,RALT(KC_RSFT), KC_ENT + ), +/* Keymap 1: Symbol & Media Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Prev | Next | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | |VolUp | | | + * | | |------| |------| Mute | | + * | | | | |VolDn | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_MPRV,KC_MNXT, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_VOLU, + KC_VOLD, KC_MUTE, KC_TRNS +), +/* Keymap 2: QWERTY Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | Q | W | E | R | T | | | | Y | U | I | O | P | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | A | S | D | F | G |------| |------| H | J | K | L | ; | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( // layer 0 : default + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, + KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_TRNS, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, + KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_TRNS, + KC_TRNS, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/dvorak_intl_squisher/readme.md b/keyboards/ergodox/keymaps/dvorak_intl_squisher/readme.md new file mode 100644 index 000000000..984106ff4 --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_intl_squisher/readme.md @@ -0,0 +1,29 @@ +# ErgoDox EZ Dvorak International Squisher + +Dvorak layout adjusted with several (linux) applications in mind: + +* Easier Escape for VIM +* Windows/Super key for awesome WM +* Alt+Shift for international characters +* PrintScreen for sys-rq +* Insert for the X11 clip-board + +Major layer changes: + +* Common multimedia keys are integrated into layer 0, less common into layer 1 +* No mouse keys +* Layer 2 is qwerty (for easier gaming & less fortunate keyboard users) + +Known issues: + +* Alt+Shift does not work reliably (depends on the X11 kb layout? Not + entirely clear...) + +![layer0](keyboard-layout0.png) +![layer1](keyboard-layout1.png) +![layer2](keyboard-layout2.png) + +## Changelog + +* 2016-03-29 + * Initial release diff --git a/keyboards/ergodox/keymaps/dvorak_spanish/keymap.c b/keyboards/ergodox/keymaps/dvorak_spanish/keymap.c new file mode 100755 index 000000000..6eb864b44 --- /dev/null +++ b/keyboards/ergodox/keymaps/dvorak_spanish/keymap.c @@ -0,0 +1,284 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +/****************************************************************************************** + * SPANISH DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/) + * Layer 1: auxiliary keys + * Layer 2: full qwerty layout + ****************************************************************************************** + * IMPORTANT: Software layout must be set to SPANISH QWERTY to work properly + *****************************************************************************************/ + +// LAYERS +#define BASE 0 // dvorak layout (default) +#define AUX 1 // auxiliary keys +#define QWERTY 2 // qwerty layout + +// MACROS +#define OBRACE 0 // key { or shift +#define CBRACE 1 // key } or shift +#define OBRACK 2 // key [ or left alt +#define CBRACK 3 // key ] or left alt +#define CAPS 4 // caps lock + +// LEDS +#define USB_LED_NUM_LOCK 0 +#define USB_LED_CAPS_LOCK 1 +#define USB_LED_SCROLL_LOCK 2 +#define USB_LED_COMPOSE 3 +#define USB_LED_KANA 4 + +// TIMERS +#define KEY_TAP_FAST 85 +#define KEY_TAP_SLOW 95 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Base layer + * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | F1/~L1 | . | , | Ñ | P | Y |MEH_T | | L1 | F | G | C | H | L |ALL_T/+ | + * |--------+------+------+------+------+------| DEL | | ~L1 |------+------+------+------+------+--------| + * |Esc/Ctrl| A | O | E | U | I |------| |------| D | R | T | N | S |'/RCtrl | + * |--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| + * | {/LSft | - | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |F5/CAG|F6/~L1| |F7/~L1|F8/CAG| + * ,------|------|------| |------+--------+------. + * | | |F4/CA | |F11/CA| | | + * | ENTER| TAB |------| |------| BSPC | SPACE| + * | | |F3/SA | |F12/SA| | | + * `--------------------' `----------------------' + * CAG = CTRL-ALT-GUI + * CA = CTRL-ALT + * SA = SHIFT-ALT + * + */ +[BASE] = KEYMAP( + // left hand + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NONUS_BSLASH, + LT(AUX, KC_F1), KC_DOT, KC_COMM,KC_SCLN,KC_P, KC_Y, MEH_T(KC_DEL), + CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, + M(OBRACE), KC_SLSH,KC_Q, KC_J, KC_K, KC_X, KC_LGUI, + M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, + LCAG_T(KC_F5), LT(AUX, KC_F6), + MT((MOD_LALT | MOD_LCTL), KC_F4), + KC_ENT,KC_TAB,MT((MOD_LALT | MOD_LSFT), KC_F3), + // right hand + KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + KC_FN1, KC_F, KC_G, KC_C, KC_H, KC_L, ALL_T(KC_RBRACKET), + KC_D, KC_R, KC_T, KC_N, KC_S, CTL_T(KC_QUOTE), + KC_RALT, KC_B, KC_M, KC_W, KC_V, KC_Z, M(CBRACE), + KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), + LT(AUX, KC_F7), LCAG_T(KC_F8), + MT((MOD_LALT | MOD_LCTL), KC_F11), + MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC + ), +/* Keymap 1: Aux layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | SLEEP | PWR | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | < | > | MsUp | | | | | ~L0 | | 7 | 8 | 9 | * | `^ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | 4 | 5 | 6 | + | Ç | + * |--------+------+------+------+------+------| | |PSCR |------+------+------+------+------+--------| + * |CAPSLOCK| | | | | | | | | | 1 | 2 | 3 | / | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |CTRL-S|CTRL-Z|CTRL-X|CTRL-C|CTRL-V| | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | Play | + * ,------|------|------| |------+------+------. + * | | | | | VolUp| | | + * | Lclk | Rclk |------| |------| Prev | Next | + * | | | L2 | | VolDn| | | + * `--------------------' `--------------------' + */ +[AUX] = KEYMAP( + // left hand + KC_NO , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_SLEP, + KC_TRNS, KC_NONUS_BSLASH, LSFT(KC_NONUS_BSLASH), KC_MS_U, KC_NO, KC_NO, KC_NO, + KC_NO , KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO , + M(CAPS), KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, + LCTL(KC_S), LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), + KC_NO , KC_TRNS, + KC_NO, + KC_BTN1, KC_BTN2, TG(QWERTY), + // right hand + KC_PWR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_LBRACKET, + KC_NO, KC_4, KC_5, KC_6, KC_PPLS, KC_BSLASH, + KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_NO, + KC_NO ,KC_DOT, KC_0, KC_PEQL, KC_NO, + KC_TRNS, KC_MPLY, + KC_VOLU, + KC_VOLD, KC_MPRV, KC_MNXT +), +/* Keymap 2: QWERTY layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TRANS | Q | W | E | R | T |MEH_T | | TRANS| Y | U | I | O | P |ALL_T/+ | + * |--------+------+------+------+------+------| DEL | | |------+------+------+------+------+--------| + * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | Ñ |'/RCtrl | + * |--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| + * | {/LSft | Z | X | C | V | B | | | | N | M | , | . | - | }/RSft | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |F5/CAG| TRANS| | TRANS|F8/CAG| + * ,------|------|------| |------+--------+------. + * | | |F4/CA | |F11/CA| | | + * | ENTER| TAB |------| |------| BSPC | SPACE| + * | | | TRANS| |F12/SA| | | + * `--------------------' `----------------------' + * CAG = CTRL-ALT-GUI + * CA = CTRL-ALT + * SA = SHIFT-ALT + * + */ +[QWERTY] = KEYMAP( + // left hand + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NONUS_BSLASH, + KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_DEL), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + M(OBRACE), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, + M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, + LCAG_T(KC_F5), KC_TRNS, + MT((MOD_LALT | MOD_LCTL), KC_F4), + KC_ENT,KC_TAB,KC_TRNS, + // right hand + KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, ALL_T(KC_RBRACKET), + KC_H, KC_J, KC_K, KC_L, KC_SCLN,CTL_T(KC_QUOTE), + KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,M(CBRACE), + KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), + KC_TRNS, LCAG_T(KC_F8), + MT((MOD_LALT | MOD_LCTL), KC_F11), + MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(AUX) // FN1 - Momentary Layer 1 (Aux) +}; + +static uint16_t key_timer; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case OBRACE: { + if (record->event.pressed) { + key_timer = timer_read(); + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_QUOTE); + unregister_code(KC_QUOTE); + unregister_code(KC_RALT); + } + } + break; + } + case CBRACE: { + if (record->event.pressed) { + key_timer = timer_read(); + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_BSLS); + unregister_code(KC_BSLS); + unregister_code(KC_RALT); + } + } + break; + } + case OBRACK: { + if (record->event.pressed) { + key_timer = timer_read(); + register_code(KC_LALT); + } else { + unregister_code(KC_LALT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_LBRACKET); + unregister_code(KC_LBRACKET); + unregister_code(KC_RALT); + } + } + break; + } + case CBRACK: { + if (record->event.pressed) { + key_timer = timer_read(); + register_code(KC_LALT); + } else { + unregister_code(KC_LALT); + if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { + register_code(KC_RALT); + register_code(KC_RBRACKET); + unregister_code(KC_RBRACKET); + unregister_code(KC_RALT); + } + } + break; + } + case CAPS: { + if (record->event.pressed) { + register_code(KC_CAPSLOCK); + } else { + unregister_code(KC_CAPSLOCK); + } + break; + } + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_right_led_3_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + + // Turn the caps lock led on + if (host_keyboard_leds() & (1< + +,--------------------------------------------------. ,--------------------------------------------------. +| \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| F1/~L1 | . | , | Ñ | P | Y |MEH_T | | L1 | F | G | C | H | L |ALL_T/+ | +|--------+------+------+------+------+------| DEL | | ~L1 |------+------+------+------+------+--------| +|Esc/Ctrl| A | O | E | U | I |------| |------| D | R | T | N | S |'/RCtrl | +|--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| +| {/LSft | - | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | +'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' + |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| + '----------------------------------' '----------------------------------' + ,-------------. ,-------------. + |F5/CAG|F6/~L1| |F7/~L1|F8/CAG| + ,------|------|------| |------+--------+------. + | | |F4/CA | |F11/CA| | | + | ENTER| TAB |------| |------| BSPC | SPACE| + | | |F3/SA | |F12/SA| | | + '--------------------' '----------------------' + CAG = CTRL-ALT-GUI + CA = CTRL-ALT + SA = SHIFT-ALT + + + +### Keymap 1: Aux layer + +

+
+,--------------------------------------------------.           ,--------------------------------------------------.
+|        |  F1  |  F2  |  F3  |  F4  |  F5  | SLEEP|           | PWR  |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
+|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+|        |  <   |  >   | MsUp |      |      |      |           | ~L0  |      |   7  |   8  |   9  |   *  |  '^    |
+|--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
+|        |      |MsLeft|MsDown|MsRght|      |------|           |------|      |   4  |   5  |   6  |   +  |   Ç    |
+|--------+------+------+------+------+------|      |           |PSCR  |------+------+------+------+------+--------|
+|CAPSLOCK|      |      |      |      |      |      |           |      |      |   1  |   2  |   3  |   /  |        |
+'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
+  |CTRL-S|CTRL-Z|CTRL-X|CTRL-C|CTRL-V|                                       |      |    . |   0  |   =  |      |
+  '----------------------------------'                                       '----------------------------------'
+                                       ,-------------.       ,-------------.
+                                       |      |      |       |      | Play |
+                                ,------|------|------|       |------+------+------.
+                                |      |      |      |       | VolUp|      |      |
+                                | Lclk | Rclk |------|       |------| Prev | Next |
+                                |      |      |  L2  |       | VolDn|      |      |
+                                '--------------------'       '--------------------'
+
+
+ +### Keymap 2: QWERTY layer + +

+
+,--------------------------------------------------.           ,--------------------------------------------------.
+|   \    |   1  |   2  |   3  |   4  |   5  |  <>  |           |   ¡  |   6  |   7  |   8  |   9  |   0  |   '    |
+|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
+|  TRANS |   Q  |   W  |   E  |   R  |   T  |MEH_T |           | TRANS|   Y  |   U  |   I  |   O  |   P  |ALL_T/+ |
+|--------+------+------+------+------+------| DEL  |           |      |------+------+------+------+------+--------|
+|Esc/Ctrl|   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   Ñ  |'/RCtrl |
+|--------+------+------+------+------+------| LGUI |           | RALT |------+------+------+------+------+--------|
+| {/LSft |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   -  | }/RSft |
+'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
+  |[/LALT| HOME |PGDOWN| PGUP | END  |                                       | LEFT | DOWN |  UP  |RIGHT |]/LALT|
+  '----------------------------------'                                       '----------------------------------'
+                                       ,-------------.       ,-------------.
+                                       |F5/CAG| TRANS|       | TRANS|F8/CAG|
+                                ,------|------|------|       |------+--------+------.
+                                |      |      |F4/CA |       |F11/CA|        |      |
+                                | ENTER| TAB  |------|       |------|  BSPC  | SPACE|
+                                |      |      | TRANS|       |F12/SA|        |      |
+                                '--------------------'       '----------------------'
+ CAG = CTRL-ALT-GUI
+  CA = CTRL-ALT
+  SA = SHIFT-ALT
+
+
+ + +## Generation of .hex file +> [Download scripts from here](https://github.com/johgh/keyboard/tree/master/ergodox) + +> Execute install.sh and generate.sh scripts. + +> Flash with `teensy_loader` binary (should be installed from previous step) diff --git a/keyboards/ergodox/keymaps/emacs_osx_dk/default_highres.png b/keyboards/ergodox/keymaps/emacs_osx_dk/default_highres.png new file mode 100644 index 000000000..1d2583740 Binary files /dev/null and b/keyboards/ergodox/keymaps/emacs_osx_dk/default_highres.png differ diff --git a/keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c b/keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c new file mode 100644 index 000000000..1d8e66a08 --- /dev/null +++ b/keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Grv | 1 | 2 | 3 | 4 | 5 | L1 | | L2 | 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | - | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | \/LCtrl| A | S | D | F | G |------| |------| H | J | K | L | ; |'/RCtrl | + * |--------+------+------+------+------+------| RAlt | | RAlt |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | ~L1 | LCtrl| Left| Right| LAlt | | LAlt | Up | Down | RCtrl| ~L2 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Del | Ins | | Esc | App | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| LGui |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, + CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_RALT, + MO(SYMB), KC_LCTRL, KC_LEFT,KC_RGHT,KC_LALT, + KC_DELT,KC_INS, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + TG(MDIA), KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), + KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_LALT,KC_UP, KC_DOWN,KC_RCTRL, MO(MDIA), + KC_ESC, KC_APP, + KC_PGUP, + KC_PGDN, KC_LGUI, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | 0 | 0 | . | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/emacs_osx_dk/readme.md b/keyboards/ergodox/keymaps/emacs_osx_dk/readme.md new file mode 100644 index 000000000..4839988d9 --- /dev/null +++ b/keyboards/ergodox/keymaps/emacs_osx_dk/readme.md @@ -0,0 +1,10 @@ +# ErgoDox EZ Emacs-OSX-DeadKeys Configuration + +Since I'm an Emacs user, ctrl keys are very important and gets a placement where the usual caps_lock is. There +are an extra pair of ctrls, just in case there where problems with the holding one's, but not as comfortable. + +Gui button takes a predominant place on the thumb cluster, as I'm using a mac os x and it relies heavily on it. + +Finally there is also two Right Alts to easily access to accented letters of the spanish alphabet. + +![Default](default_highres.png) diff --git a/keyboards/ergodox/keymaps/erez_experimental/Makefile b/keyboards/ergodox/keymaps/erez_experimental/Makefile new file mode 100644 index 000000000..b673c5ce5 --- /dev/null +++ b/keyboards/ergodox/keymaps/erez_experimental/Makefile @@ -0,0 +1,9 @@ +# Having a file like this allows you to override Makefile definitions +# for your own particular keymap + +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +COMMAND_ENABLE = no # Commands for debug and configuration + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/ergodox/keymaps/erez_experimental/config.h b/keyboards/ergodox/keymaps/erez_experimental/config.h new file mode 100644 index 000000000..e5d7fe188 --- /dev/null +++ b/keyboards/ergodox/keymaps/erez_experimental/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 300 + +#undef LEADER_TIMEOUT +#define LEADER_TIMEOUT 300 + +#endif diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c new file mode 100644 index 000000000..04ad2a816 --- /dev/null +++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c @@ -0,0 +1,199 @@ +#include +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | Alt/J| K | L |; / L2| LGui/' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * |LShift/(|Z/Ctrl| X | C | V | B | [ | | ] | N | M | , | . |//Ctrl|RShift/)| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | -/L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Leader|------| |------| Tab/L1 |Enter | + * | | | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_LBRC), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_LEAD,KC_END, + // right hand + KC_RGHT, KC_6,KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y,KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H,ALT_T(KC_J),KC_K, KC_L, LT(MDIA,KC_SCLN),GUI_T(KC_QUOT), + MEH_T(KC_RBRC),KC_N,KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSPC, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_MINS), + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,LT(SYMB, KC_TAB), KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | 1 | 2 | 3 | 4 | 5 |------| |------| & | _ | - | ; | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | 6 | 7 | 8 | 9 | 0 | | | | | | @ | = | % | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | |NxtTab|PrvTab| | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_TRNS,KC_TRNS,LCTL(KC_PGUP), LCTL(KC_PGDN), + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, + KC_AMPR, KC_UNDS, KC_MINS, CM_SCLN, KC_PLUS, KC_TRNS, + KC_TRNS, KC_PIPE, KC_AT, KC_EQL, KC_PERC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | PgUp | Home | End | PgDn | |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_PGUP, KC_HOME, KC_END, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) + [2] = ACTION_MACRO_TAP(0), // Eric Tang's Famous Macro! + [3] = ACTION_MACRO_TAP(1) // Eric Tang's Famous Macro! +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +LEADER_EXTERNS(); + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY(KC_W) { + register_code(KC_LALT); + register_code(KC_F4); + unregister_code(KC_F4); + unregister_code(KC_LALT); + } + SEQ_ONE_KEY(KC_O) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_O); + unregister_code(KC_O); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } + } +} + diff --git a/keyboards/ergodox/keymaps/erez_experimental/readme.md b/keyboards/ergodox/keymaps/erez_experimental/readme.md new file mode 100644 index 000000000..66acfa187 --- /dev/null +++ b/keyboards/ergodox/keymaps/erez_experimental/readme.md @@ -0,0 +1,51 @@ +# Erez's experimental layout + +This is my personal layout which I use to test out ideas which may or may not make it onto the default layout we ship with. It's based off the default layout, with various tweaks. + +Changelog: + +## May 24, 2016: + +* Implements Leader key example + * Leader, W sends Alt-F4 + * Leader, O sends Ctrl-shift-o (a shortcut I use in FrontApp) + +## May 8, 2016: + +* Makes bottom-right key send minus/underscore when tapped, L1 temporary toggle when held +* Tweaked the positions of the numbers on the symbol layer. Basically, 12345 are now directly under their number-row counterparts in layer 0. You can imagine pulling the number row down to the home row. And 67890 are directly under 12345 - so it's a matter of just adding 5 and going to the next row (1+5 = 6, 2+5 = 7 and so on). +* Tweaks media/nav layer + * Removes mouse control, as I don't use it + * Makes left home row keys PgUp, Home, End, PgDn + +## Apr 29, 2016: + +* Tweaks the Hyper and Meh key to send brackets when tapped +* Turns bottom-right key into a minus/underscore (easy to reach with the right pinky) + +## Apr 25, 2016: + +* Made it so that the right and left Shift keys send opening and closing parens ( ) when tapped + +## Feb 11, 2016: + +* Updated ASCII legend for thumb clusters +* Made it so outer left-hand thumb key is L1 momentary toggle +* Added % and @ to L1 +* Swapped positions for _ and - on L1 + +## Feb 5, 2016: + +* A whole new design for the symbol layer. Specifically: + * Put the minus, underscore, and semicolon right in the homerow for the right hand + * Parens are in better places for me + * The arrow keys now send Ctrl-PgUp and Ctrl-PgDn, for switching browser tabs with the arrows when in symbol layer + * Tab (right-hand outer thumb key) now does double duty to toggle symbol layer when held down + * Backspace (left-hand outer thumb key) now just toggles symbol layer (I wasn't using it as a backspace) + + +## Jan 19, 2016: + +* Made J into dual-action key (Alt when held down), to make Alt-tab more ergonomic. +* Made ' into dual-action key (Win/Cmd when held down). + diff --git a/keyboards/ergodox/keymaps/german-kinergo/keymap.c b/keyboards/ergodox/keymaps/german-kinergo/keymap.c new file mode 100644 index 000000000..b1cecf0dd --- /dev/null +++ b/keyboards/ergodox/keymaps/german-kinergo/keymap.c @@ -0,0 +1,210 @@ +// German keymap derived from "german", but more closely resembling the German layout of the Kinesis Ergo Elan. +// +// chschmitz, 2016-01-27 +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_german.h" + +// Layer names +#define BASE 0 // default layer +#define SYMB 1 // symbol layer +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * X'es mark the spots where this is different from the "german" layout which it is based on. + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * |X Esc X| 1 | 2 | 3 | 4 | 5 |X ` X| |XPRSCX| 6 | 7 | 8 | 9 | 0 | ß | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * |X Tab X| Q | W | E | R | T |X L1 X| |X L1 X| Z | U | I | O | P | Ãœ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä/L2 | + * |--------+------+------+------+------+------|X L2 X| |X L2 X|------+------+------+------+------+--------| + * | LShift | Y | X | C | V | B | | | | N | M | , | . |X - X| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |XLGuiX|X ^ X|X < X|XLEFTX|XRIGHT| |XDownX|X Up X|X # X|X + X|XRGuiX| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |XCTRLX|XALTX | | Alt |Ctrl/Esc| + * ,------+------+------| |------+--------+------. + * |XXX |XXX | Home | | PgUp |XXX |XXX | + * | Bkspc|Del |------| |------| Enter | Space| + * | | | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, DE_ACUT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(1), + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, MO(2), + KC_LGUI, DE_CIRC, DE_LESS, KC_LEFT, KC_RIGHT, + KC_LCTRL, KC_LALT, + KC_HOME, + KC_BSPC,KC_DELT,KC_END, + // right hand + KC_PSCREEN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + MO(1), DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, + KC_H, KC_J, KC_K, KC_L, DE_OE, LT(MDIA,DE_AE), + MO(2), KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, + KC_DOWN, KC_UP, DE_HASH, DE_PLUS, KC_RGUI, + KC_RALT, KC_RCTRL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), +// [BASE] = KEYMAP( // layer 0 : default +// // left hand +// KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MPLY, +// KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), +// KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, +// KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), +// LT(SYMB,DE_LESS),CTL_T(DE_HASH), DE_ACUT, DE_MINS, DE_PLUS, +// ALT_T(KC_APP), KC_LGUI, +// KC_HOME, +// KC_SPC,KC_BSPC,KC_END, +// // right hand +// KC_MNXT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, +// TG(2), DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, +// KC_H, KC_J, KC_K, KC_L, DE_OE, LT(MDIA,DE_AE), +// MEH_T(KC_NO),KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(DE_MINS), KC_RSFT, +// KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_FN1, +// KC_LALT,CTL_T(KC_ESC), +// KC_PGUP, +// KC_PGDN,KC_TAB, KC_ENT +// ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,DE_EXLM,DE_AT, DE_LCBR,DE_RCBR,DE_PIPE,KC_TRNS, + KC_TRNS,DE_HASH,DE_DLR, DE_LPRN,DE_RPRN,DE_GRV, + KC_TRNS,DE_PERC,DE_CIRC,DE_LBRC,DE_RBRC,DE_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, DE_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, DE_PLUS, KC_TRNS, + KC_TRNS, DE_AMPR, KC_1, KC_2, KC_3, DE_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, DE_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | Lclk | MsUp | Rclk | | | | | |VolDwn| Mute |VolUp | | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Btn4 |MsLeft|MsDown|MsRght| Btn5 |------| |------| | Prev | Stop | Play | Next | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |WhRght|WhDown| WhUp |WhLeft|WhClk | | | |BwSrch|BwBack|BwHome|BwRefr|BwFwd | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | |MsAcl0|MsAcl1|MsAcl2| | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | |Brwser|Brwser| + * | Lclk | Rclk |------| |------|Back |Forwd | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, + KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN3, KC_TRNS, + KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_BTN1, KC_BTN2, KC_TRNS, + // right hand + KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11, + KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_F12, + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, + KC_TRNS, KC_WSCH, KC_WBAK, KC_WHOM, KC_WREF, KC_WFWD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_WBAK, KC_WFWD +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case SYMB: + ergodox_right_led_1_on(); + break; + case MDIA: + ergodox_right_led_2_on(); + break; + default: + ergodox_board_led_off(); + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/german-kinergo/layout-code.png b/keyboards/ergodox/keymaps/german-kinergo/layout-code.png new file mode 100644 index 000000000..a0ef551e1 Binary files /dev/null and b/keyboards/ergodox/keymaps/german-kinergo/layout-code.png differ diff --git a/keyboards/ergodox/keymaps/german-kinergo/layout-media.png b/keyboards/ergodox/keymaps/german-kinergo/layout-media.png new file mode 100644 index 000000000..56aea1dca Binary files /dev/null and b/keyboards/ergodox/keymaps/german-kinergo/layout-media.png differ diff --git a/keyboards/ergodox/keymaps/german-kinergo/layout.png b/keyboards/ergodox/keymaps/german-kinergo/layout.png new file mode 100644 index 000000000..76a1aa5d7 Binary files /dev/null and b/keyboards/ergodox/keymaps/german-kinergo/layout.png differ diff --git a/keyboards/ergodox/keymaps/german-kinergo/readme.md b/keyboards/ergodox/keymaps/german-kinergo/readme.md new file mode 100644 index 000000000..557d85a8a --- /dev/null +++ b/keyboards/ergodox/keymaps/german-kinergo/readme.md @@ -0,0 +1,35 @@ +# German Layout for the ErgoDox + +This layout is inspired by the "kinesis-qwerty-mod" from benblazak's +[ergodox-firmware](https://github.com/benblazak/ergodox-firmware), as well as by the "german" layout from the +[qmk_firmware](https://github.com/jackhumbert/qmk_firmware). +The goal was to have a layout that is pretty close to an ordinary German +keyboard, so I don't have to make adjustments on the operating system level +and I keep some of the muscle memory to use a regular keyboard. + +Modifications I made with regard to the aforementioned layouts: + +* The key layout is pretty close to the layout of a German Kinesis Ergo Elan. + The only exception I made is that I reversed the "up" and "down" cursor keys, + since that feels more natural to me. + +* All layer changes are "momentary", i.e. they only last as long as the respective key is pressed. + +* I sacrificed the Hyper and Meh keys, which I don't use, and put layer change keys in their place. + +* I added a PrintScreen key which I use quite regularly for screenshots. + +## Default Layer + +![Layout of the default layer](layout.png "Layout of the default layer") + +## Code Layer + +![Layout of the code layer](layout-code.png "Layout of the code layer") + +## Media Layer + +![Layout of the media layer](layout-media.png "Layout of the media layer") + +Christoph Schmitz <schm4704 at web dot de> +2016-01-28 diff --git a/keyboards/ergodox/keymaps/german-manuneo/compile_keymap.py b/keyboards/ergodox/keymaps/german-manuneo/compile_keymap.py new file mode 100644 index 000000000..7076a6ecb --- /dev/null +++ b/keyboards/ergodox/keymaps/german-manuneo/compile_keymap.py @@ -0,0 +1,710 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +"""Compiler for keymap.c files + +This scrip will generate a keymap.c file from a simple +markdown file with a specific layout. + +Usage: + python compile_keymap.py INPUT_PATH [OUTPUT_PATH] +""" +from __future__ import division +from __future__ import print_function +from __future__ import absolute_import +from __future__ import unicode_literals + +import os +import io +import re +import sys +import json +import unicodedata +import collections +import itertools as it + +PY2 = sys.version_info.major == 2 + +if PY2: + chr = unichr + + +KEYBOARD_LAYOUTS = { + # These map positions in the parsed layout to + # positions in the KEYMAP MATRIX + 'ergodox_ez': [ + [ 0, 1, 2, 3, 4, 5, 6], [38, 39, 40, 41, 42, 43, 44], + [ 7, 8, 9, 10, 11, 12, 13], [45, 46, 47, 48, 49, 50, 51], + [14, 15, 16, 17, 18, 19 ], [ 52, 53, 54, 55, 56, 57], + [20, 21, 22, 23, 24, 25, 26], [58, 59, 60, 61, 62, 63, 64], + [27, 28, 29, 30, 31 ], [ 65, 66, 67, 68, 69], + [ 32, 33], [70, 71 ], + [ 34], [72 ], + [ 35, 36, 37], [73, 74, 75 ], + ] +} + +ROW_INDENTS = { + 'ergodox_ez': [0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 5, 0, 6, 0, 4, 0] +} + +BLANK_LAYOUTS = [ +# Compact Layout +""" +.------------------------------------.------------------------------------. +| | | | | | | | | | | | | | | +!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! +| | | | | | | | | | | | | | | +!-----+----+----+----x----x----! ! !----x----x----+----+----+-----! +| | | | | | |-----!-----! | | | | | | +!-----+----+----+----x----x----! ! !----x----x----+----+----+-----! +| | | | | | | | | | | | | | | +'-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | | | | | ! | | | | | + '------------------------' '------------------------' + .-----------. .-----------. + | | | ! | | + .-----+-----+-----! !-----+-----+-----. + ! ! | | ! | ! ! + ! ! !-----! !-----! ! ! + | | | | ! | | | + '-----------------' '-----------------' +""", + +# Wide Layout +""" +.---------------------------------------------. .---------------------------------------------. +| | | | | | | | ! | | | | | | | +!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! +| | | | | | | | ! | | | | | | | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| | | | | | |-------! !-------! | | | | | | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| | | | | | | | ! | | | | | | | +'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | | | | | ! | | | | | + '------------------------------' '------------------------------' + .---------------. .---------------. + | | | ! | | + .-------+-------+-------! !-------+-------+-------. + ! ! | | ! | ! ! + ! ! !-------! !-------! ! ! + | | | | ! | | | + '-----------------------' '-----------------------' +""", +] + + +DEFAULT_CONFIG = { + "keymaps_includes": [ + "keymap_common.h", + ], + 'filler': "-+.'!:x", + 'separator': "|", + 'default_key_prefix': ["KC_"], +} + + +SECTIONS = [ + 'layout_config', + 'layers', +] + + +# Markdown Parsing + +ONELINE_COMMENT_RE = re.compile(r""" + ^ # comment must be at the start of the line + \s* # arbitrary whitespace + // # start of the comment + (.*) # the comment + $ # until the end of line +""", re.MULTILINE | re.VERBOSE +) + +INLINE_COMMENT_RE = re.compile(r""" + ([\,\"\[\]\{\}\d]) # anythig that might end a expression + \s+ # comment must be preceded by whitespace + // # start of the comment + \s # and succeded by whitespace + (?:[^\"\]\}\{\[]*) # the comment (except things which might be json) + $ # until the end of line +""", re.MULTILINE | re.VERBOSE) + +TRAILING_COMMA_RE = re.compile(r""" + , # the comma + (?:\s*) # arbitrary whitespace + $ # only works if the trailing comma is followed by newline + (\s*) # arbitrary whitespace + ([\]\}]) # end of an array or object +""", re.MULTILINE | re.VERBOSE) + + +def loads(raw_data): + if isinstance(raw_data, bytes): + raw_data = raw_data.decode('utf-8') + + raw_data = ONELINE_COMMENT_RE.sub(r"", raw_data) + raw_data = INLINE_COMMENT_RE.sub(r"\1", raw_data) + raw_data = TRAILING_COMMA_RE.sub(r"\1\2", raw_data) + return json.loads(raw_data) + + +def parse_config(path): + def reset_section(): + section.update({ + 'name': section.get('name', ""), + 'sub_name': "", + 'start_line': -1, + 'end_line': -1, + 'code_lines': [], + }) + + def start_section(line_index, line): + end_section() + if line.startswith("# "): + name = line[2:] + elif line.startswith("## "): + name = line[3:] + else: + name = "" + + name = name.strip().replace(" ", "_").lower() + if name in SECTIONS: + section['name'] = name + else: + section['sub_name'] = name + section['start_line'] = line_index + + def end_section(): + if section['start_line'] >= 0: + if section['name'] == 'layout_config': + config.update(loads("\n".join( + section['code_lines'] + ))) + elif section['sub_name'].startswith('layer'): + layer_name = section['sub_name'] + config['layer_lines'][layer_name] = section['code_lines'] + + reset_section() + + def amend_section(line_index, line): + section['end_line'] = line_index + section['code_lines'].append(line) + + config = DEFAULT_CONFIG.copy() + config.update({ + 'layer_lines': collections.OrderedDict(), + 'macro_ids': {'UM'}, + 'unicode_macros': {}, + }) + + section = {} + reset_section() + + with io.open(path, encoding="utf-8") as fh: + for i, line in enumerate(fh): + if line.startswith("#"): + start_section(i, line) + elif line.startswith(" "): + amend_section(i, line[4:]) + else: + # TODO: maybe parse description + pass + + end_section() + assert 'layout' in config + return config + +# header file parsing + +IF0_RE = re.compile(r""" + ^ + #if 0 + $.*? + #endif +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +COMMENT_RE = re.compile(r""" + /\* + .*? + \*/" +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +def read_header_file(path): + with io.open(path, encoding="utf-8") as fh: + data = fh.read() + data, _ = COMMENT_RE.subn("", data) + data, _ = IF0_RE.subn("", data) + return data + + +def regex_partial(re_str_fmt, flags): + def partial(*args, **kwargs): + re_str = re_str_fmt.format(*args, **kwargs) + return re.compile(re_str, flags) + return partial + + +KEYDEF_REP = regex_partial(r""" + #define + \s + ( + (?:{}) # the prefixes + (?:\w+) # the key name + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +ENUM_RE = re.compile(r""" + ( + enum + \s\w+\s + \{ + .*? # the enum content + \} + ; + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +ENUM_KEY_REP = regex_partial(r""" + ( + {} # the prefixes + \w+ # the key name + ) # capture group end +""", re.MULTILINE | re.DOTALL | re.VERBOSE) + + +def parse_keydefs(config, data): + prefix_options = "|".join(config['key_prefixes']) + keydef_re = KEYDEF_REP(prefix_options) + enum_key_re = ENUM_KEY_REP(prefix_options) + for match in keydef_re.finditer(data): + yield match.groups()[0] + + for enum_match in ENUM_RE.finditer(data): + enum = enum_match.groups()[0] + for key_match in enum_key_re.finditer(enum): + yield key_match.groups()[0] + + +def parse_valid_keys(config, out_path): + basepath = os.path.abspath(os.path.join(os.path.dirname(out_path))) + dirpaths = [] + subpaths = [] + while len(subpaths) < 6: + path = os.path.join(basepath, *subpaths) + dirpaths.append(path) + dirpaths.append(os.path.join(path, "tmk_core", "common")) + dirpaths.append(os.path.join(path, "quantum")) + subpaths.append('..') + + includes = set(config['keymaps_includes']) + includes.add("keycode.h") + + valid_keycodes = set() + for dirpath, include in it.product(dirpaths, includes): + include_path = os.path.join(dirpath, include) + if os.path.exists(include_path): + header_data = read_header_file(include_path) + valid_keycodes.update( + parse_keydefs(config, header_data) + ) + return valid_keycodes + + +# Keymap Parsing + +def iter_raw_codes(layer_lines, filler, separator): + filler_re = re.compile("[" + filler + " ]") + for line in layer_lines: + line, _ = filler_re.subn("", line.strip()) + if not line: + continue + codes = line.split(separator) + for code in codes[1:-1]: + yield code + + +def iter_indexed_codes(raw_codes, key_indexes): + key_rows = {} + key_indexes_flat = [] + + for row_index, key_indexes in enumerate(key_indexes): + for key_index in key_indexes: + key_rows[key_index] = row_index + key_indexes_flat.extend(key_indexes) + assert len(raw_codes) == len(key_indexes_flat) + for raw_code, key_index in zip(raw_codes, key_indexes_flat): + # we keep track of the row mostly for layout purposes + yield raw_code, key_index, key_rows[key_index] + + +LAYER_CHANGE_RE = re.compile(r""" + (DF|TG|MO)\(\d+\) +""", re.VERBOSE) + + +MACRO_RE = re.compile(r""" + M\(\w+\) +""", re.VERBOSE) + + +UNICODE_RE = re.compile(r""" + U[0-9A-F]{4} +""", re.VERBOSE) + + +NON_CODE = re.compile(r""" + ^[^A-Z0-9_]$ +""", re.VERBOSE) + + +def parse_uni_code(raw_code): + macro_id = "UC_" + ( + unicodedata.name(raw_code) + .replace(" ", "_") + .replace("-", "_") + ) + code = "M({})".format(macro_id) + uc_hex = "{:04X}".format(ord(raw_code)) + return code, macro_id, uc_hex + + +def parse_key_code(raw_code, key_prefixes, valid_keycodes): + if raw_code in valid_keycodes: + return raw_code + + for prefix in key_prefixes: + code = prefix + raw_code + if code in valid_keycodes: + return code + + +def parse_code(raw_code, key_prefixes, valid_keycodes): + if not raw_code: + return 'KC_TRNS', None, None + + if LAYER_CHANGE_RE.match(raw_code): + return raw_code, None, None + + if MACRO_RE.match(raw_code): + macro_id = raw_code[2:-1] + return raw_code, macro_id, None + + if UNICODE_RE.match(raw_code): + hex_code = raw_code[1:] + return parse_uni_code(chr(int(hex_code, 16))) + + if NON_CODE.match(raw_code): + return parse_uni_code(raw_code) + + code = parse_key_code(raw_code, key_prefixes, valid_keycodes) + return code, None, None + + +def parse_keymap(config, key_indexes, layer_lines, valid_keycodes): + keymap = {} + raw_codes = list(iter_raw_codes( + layer_lines, config['filler'], config['separator'] + )) + indexed_codes = iter_indexed_codes(raw_codes, key_indexes) + key_prefixes = config['key_prefixes'] + for raw_code, key_index, row_index in indexed_codes: + code, macro_id, uc_hex = parse_code( + raw_code, key_prefixes, valid_keycodes + ) + # TODO: line numbers for invalid codes + err_msg = "Could not parse key '{}' on row {}".format( + raw_code, row_index + ) + assert code is not None, err_msg + # print(repr(raw_code), repr(code), macro_id, uc_hex) + if macro_id: + config['macro_ids'].add(macro_id) + if uc_hex: + config['unicode_macros'][macro_id] = uc_hex + keymap[key_index] = (code, row_index) + return keymap + + +def parse_keymaps(config, valid_keycodes): + keymaps = collections.OrderedDict() + key_indexes = config.get( + 'key_indexes', KEYBOARD_LAYOUTS[config['layout']] + ) + # TODO: maybe validate key_indexes + + for layer_name, layer_lines, in config['layer_lines'].items(): + keymaps[layer_name] = parse_keymap( + config, key_indexes, layer_lines, valid_keycodes + ) + return keymaps + +# keymap.c output + +USERCODE = """ +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case L1: + ergodox_right_led_1_on(); + break; + case L2: + ergodox_right_led_2_on(); + break; + case L3: + ergodox_right_led_3_on(); + break; + case L4: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + break; + case L5: + ergodox_right_led_1_on(); + ergodox_right_led_3_on(); + break; + // case L6: + // ergodox_right_led_2_on(); + // ergodox_right_led_3_on(); + // break; + // case L7: + // ergodox_right_led_1_on(); + // ergodox_right_led_2_on(); + // ergodox_right_led_3_on(); + // break; + default: + ergodox_board_led_off(); + break; + } +}; +""" + +MACROCODE = """ +#define UC_MODE_WIN 0 +#define UC_MODE_LINUX 1 +#define UC_MODE_OSX 2 + +// TODO: allow default mode to be configured +static uint16_t unicode_mode = UC_MODE_WIN; + +uint16_t hextokeycode(uint8_t hex) {{ + if (hex == 0x0) {{ + return KC_P0; + }} + if (hex < 0xA) {{ + return KC_P1 + (hex - 0x1); + }} + return KC_A + (hex - 0xA); +}} + +void unicode_action_function(uint16_t hi, uint16_t lo) {{ + switch (unicode_mode) {{ + case UC_MODE_WIN: + register_code(KC_LALT); + + register_code(KC_PPLS); + unregister_code(KC_PPLS); + + register_code(hextokeycode((hi & 0xF0) >> 4)); + unregister_code(hextokeycode((hi & 0xF0) >> 4)); + register_code(hextokeycode((hi & 0x0F))); + unregister_code(hextokeycode((hi & 0x0F))); + register_code(hextokeycode((lo & 0xF0) >> 4)); + unregister_code(hextokeycode((lo & 0xF0) >> 4)); + register_code(hextokeycode((lo & 0x0F))); + unregister_code(hextokeycode((lo & 0x0F))); + + unregister_code(KC_LALT); + break; + case UC_MODE_LINUX: + register_code(KC_LCTL); + register_code(KC_LSFT); + + register_code(KC_U); + unregister_code(KC_U); + + register_code(hextokeycode((hi & 0xF0) >> 4)); + unregister_code(hextokeycode((hi & 0xF0) >> 4)); + register_code(hextokeycode((hi & 0x0F))); + unregister_code(hextokeycode((hi & 0x0F))); + register_code(hextokeycode((lo & 0xF0) >> 4)); + unregister_code(hextokeycode((lo & 0xF0) >> 4)); + register_code(hextokeycode((lo & 0x0F))); + unregister_code(hextokeycode((lo & 0x0F))); + + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + break; + case UC_MODE_OSX: + break; + }} +}} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {{ + if (!record->event.pressed) {{ + return MACRO_NONE; + }} + // MACRODOWN only works in this function + switch(id) {{ + case UM: + unicode_mode = (unicode_mode + 1) % 2; + break; +{macro_cases} +{unicode_macro_cases} + default: + break; + }} + return MACRO_NONE; +}}; +""" + + +UNICODE_MACRO_TEMPLATE = """ +case {macro_id}: + unicode_action_function(0x{hi:02x}, 0x{lo:02x}); + break; +""".strip() + + +def unicode_macro_cases(config): + for macro_id, uc_hex in config['unicode_macros'].items(): + hi = int(uc_hex, 16) >> 8 + lo = int(uc_hex, 16) & 0xFF + unimacro_keys = ", ".join( + "T({})".format( + "KP_" + digit if digit.isdigit() else digit + ) for digit in uc_hex + ) + yield UNICODE_MACRO_TEMPLATE.format( + macro_id=macro_id, hi=hi, lo=lo + ) + + +def iter_keymap_lines(keymap, row_indents=None): + col_widths = {} + col = 0 + # first pass, figure out the column widths + prev_row_index = None + for code, row_index in keymap.values(): + if row_index != prev_row_index: + col = 0 + if row_indents: + col = row_indents[row_index] + col_widths[col] = max(len(code), col_widths.get(col, 0)) + prev_row_index = row_index + col += 1 + + # second pass, yield the cell values + col = 0 + prev_row_index = None + for key_index in sorted(keymap): + code, row_index = keymap[key_index] + if row_index != prev_row_index: + col = 0 + yield "\n" + if row_indents: + for indent_col in range(row_indents[row_index]): + pad = " " * (col_widths[indent_col] - 4) + yield (" /*-*/" + pad) + col = row_indents[row_index] + else: + yield pad + yield " {}".format(code) + if key_index < len(keymap) - 1: + yield "," + # This will be yielded on the next iteration when + # we know that we're not at the end of a line. + pad = " " * (col_widths[col] - len(code)) + prev_row_index = row_index + col += 1 + + +def iter_keymap_parts(config, keymaps): + # includes + for include_path in config['keymaps_includes']: + yield '#include "{}"\n'.format(include_path) + + yield "\n" + + # definitions + for i, macro_id in enumerate(sorted(config['macro_ids'])): + yield "#define {} {}\n".format(macro_id, i) + + yield "\n" + + for i, layer_name in enumerate(config['layer_lines']): + yield '#define L{0:<3} {0:<5} // {1}\n'.format(i, layer_name) + + yield "\n" + + # keymaps + yield "const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n" + + for i, layer_name in enumerate(config['layer_lines']): + # comment + layer_lines = config['layer_lines'][layer_name] + prefixed_lines = " * " + " * ".join(layer_lines) + yield "/*\n{} */\n".format(prefixed_lines) + + # keymap codes + keymap = keymaps[layer_name] + row_indents = ROW_INDENTS.get(config['layout']) + keymap_lines = "".join(iter_keymap_lines(keymap, row_indents)) + yield "[L{0}] = KEYMAP({1}\n),\n".format(i, keymap_lines) + + yield "};\n\n" + + # no idea what this is for + yield "const uint16_t PROGMEM fn_actions[] = {};\n" + + # macros + yield MACROCODE.format( + macro_cases="", + unicode_macro_cases="\n".join(unicode_macro_cases(config)), + ) + + # TODO: dynamically create blinking lights + yield USERCODE + + +def main(argv=sys.argv[1:]): + if not argv or '-h' in argv or '--help' in argv: + print(__doc__) + return 0 + + in_path = os.path.abspath(argv[0]) + if not os.path.exists(in_path): + print("No such file '{}'".format(in_path)) + return 1 + + if len(argv) > 1: + out_path = os.path.abspath(argv[1]) + else: + dirname = os.path.dirname(in_path) + out_path = os.path.join(dirname, "keymap.c") + + config = parse_config(in_path) + valid_keys = parse_valid_keys(config, out_path) + keymaps = parse_keymaps(config, valid_keys) + + with io.open(out_path, mode="w", encoding="utf-8") as fh: + for part in iter_keymap_parts(config, keymaps): + fh.write(part) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/keyboards/ergodox/keymaps/german-manuneo/keymap.c b/keyboards/ergodox/keymaps/german-manuneo/keymap.c new file mode 100644 index 000000000..5fcc14d51 --- /dev/null +++ b/keyboards/ergodox/keymaps/german-manuneo/keymap.c @@ -0,0 +1,783 @@ +#include "ergodox_ez.h" +#include "action_layer.h" +#include "keymap.h" +#include "keymap_german.h" + +#define UC_ASYMPTOTICALLY_EQUAL_TO 0 +#define UC_DIVISION_SIGN 1 +#define UC_DOWNWARDS_ARROW 2 +#define UC_ELEMENT_OF 3 +#define UC_EMPTY_SET 4 +#define UC_FOR_ALL 5 +#define UC_GREEK_CAPITAL_LETTER_ALPHA 6 +#define UC_GREEK_CAPITAL_LETTER_BETA 7 +#define UC_GREEK_CAPITAL_LETTER_CHI 8 +#define UC_GREEK_CAPITAL_LETTER_DELTA 9 +#define UC_GREEK_CAPITAL_LETTER_EPSILON 10 +#define UC_GREEK_CAPITAL_LETTER_ETA 11 +#define UC_GREEK_CAPITAL_LETTER_GAMMA 12 +#define UC_GREEK_CAPITAL_LETTER_IOTA 13 +#define UC_GREEK_CAPITAL_LETTER_KAPPA 14 +#define UC_GREEK_CAPITAL_LETTER_LAMDA 15 +#define UC_GREEK_CAPITAL_LETTER_MU 16 +#define UC_GREEK_CAPITAL_LETTER_NU 17 +#define UC_GREEK_CAPITAL_LETTER_OMEGA 18 +#define UC_GREEK_CAPITAL_LETTER_OMICRON 19 +#define UC_GREEK_CAPITAL_LETTER_PHI 20 +#define UC_GREEK_CAPITAL_LETTER_PI 21 +#define UC_GREEK_CAPITAL_LETTER_PSI 22 +#define UC_GREEK_CAPITAL_LETTER_RHO 23 +#define UC_GREEK_CAPITAL_LETTER_SIGMA 24 +#define UC_GREEK_CAPITAL_LETTER_TAU 25 +#define UC_GREEK_CAPITAL_LETTER_THETA 26 +#define UC_GREEK_CAPITAL_LETTER_UPSILON 27 +#define UC_GREEK_CAPITAL_LETTER_XI 28 +#define UC_GREEK_CAPITAL_LETTER_ZETA 29 +#define UC_GREEK_SMALL_LETTER_ALPHA 30 +#define UC_GREEK_SMALL_LETTER_BETA 31 +#define UC_GREEK_SMALL_LETTER_CHI 32 +#define UC_GREEK_SMALL_LETTER_DELTA 33 +#define UC_GREEK_SMALL_LETTER_EPSILON 34 +#define UC_GREEK_SMALL_LETTER_ETA 35 +#define UC_GREEK_SMALL_LETTER_FINAL_SIGMA 36 +#define UC_GREEK_SMALL_LETTER_GAMMA 37 +#define UC_GREEK_SMALL_LETTER_IOTA 38 +#define UC_GREEK_SMALL_LETTER_KAPPA 39 +#define UC_GREEK_SMALL_LETTER_LAMDA 40 +#define UC_GREEK_SMALL_LETTER_MU 41 +#define UC_GREEK_SMALL_LETTER_NU 42 +#define UC_GREEK_SMALL_LETTER_OMEGA 43 +#define UC_GREEK_SMALL_LETTER_OMICRON 44 +#define UC_GREEK_SMALL_LETTER_PHI 45 +#define UC_GREEK_SMALL_LETTER_PI 46 +#define UC_GREEK_SMALL_LETTER_PSI 47 +#define UC_GREEK_SMALL_LETTER_RHO 48 +#define UC_GREEK_SMALL_LETTER_SIGMA 49 +#define UC_GREEK_SMALL_LETTER_TAU 50 +#define UC_GREEK_SMALL_LETTER_THETA 51 +#define UC_GREEK_SMALL_LETTER_UPSILON 52 +#define UC_GREEK_SMALL_LETTER_XI 53 +#define UC_GREEK_SMALL_LETTER_ZETA 54 +#define UC_INFINITY 55 +#define UC_LEFTWARDS_ARROW 56 +#define UC_MULTIPLICATION_SIGN 57 +#define UC_NOT_AN_ELEMENT_OF 58 +#define UC_NOT_EQUAL_TO 59 +#define UC_PLUS_MINUS_SIGN 60 +#define UC_RIGHTWARDS_ARROW 61 +#define UC_SUBSCRIPT_EIGHT 62 +#define UC_SUBSCRIPT_FIVE 63 +#define UC_SUBSCRIPT_FOUR 64 +#define UC_SUBSCRIPT_NINE 65 +#define UC_SUBSCRIPT_ONE 66 +#define UC_SUBSCRIPT_SEVEN 67 +#define UC_SUBSCRIPT_SIX 68 +#define UC_SUBSCRIPT_THREE 69 +#define UC_SUBSCRIPT_TWO 70 +#define UC_SUBSCRIPT_ZERO 71 +#define UC_SUPERSCRIPT_EIGHT 72 +#define UC_SUPERSCRIPT_FIVE 73 +#define UC_SUPERSCRIPT_FOUR 74 +#define UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N 75 +#define UC_SUPERSCRIPT_NINE 76 +#define UC_SUPERSCRIPT_ONE 77 +#define UC_SUPERSCRIPT_SEVEN 78 +#define UC_SUPERSCRIPT_SIX 79 +#define UC_SUPERSCRIPT_THREE 80 +#define UC_SUPERSCRIPT_TWO 81 +#define UC_SUPERSCRIPT_ZERO 82 +#define UC_THERE_DOES_NOT_EXIST 83 +#define UC_THERE_EXISTS 84 +#define UC_UPWARDS_ARROW 85 +#define UC_VULGAR_FRACTION_ONE_EIGHTH 86 +#define UC_VULGAR_FRACTION_ONE_FIFTH 87 +#define UC_VULGAR_FRACTION_ONE_HALF 88 +#define UC_VULGAR_FRACTION_ONE_QUARTER 89 +#define UC_VULGAR_FRACTION_ONE_SIXTH 90 +#define UC_VULGAR_FRACTION_ONE_THIRD 91 +#define UC_VULGAR_FRACTION_THREE_QUARTERS 92 +#define UC_VULGAR_FRACTION_TWO_THIRDS 93 +#define UM 94 + +#define L0 0 // layer_0 +#define L1 1 // layer_1 +#define L2 2 // layer_2 +#define L3 3 // layer_3 +#define L4 4 // layer_4 +#define L5 5 // layer_5 +#define L6 6 // layer_6 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * .------------------------------------.------------------------------------. + * |MO(5)| 1 | 2 | 3 | 4 | 5 |ACUT | GRV | 6 | 7 | 8 | 9 | 0 |CIRC | + * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + * |MO(4)| X | P | F | W | G |HOME |TG(2)| H | J | K | L | Q | Z | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | SS | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * |MO(3)| UE | OE | AE | C | V |END | TAB | B | M |COMM| DOT| UP | Y | + * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + * | | |LGUI|LALT|LCTL| !RCTL|RALT|LEFT|DOWN|RGHT| + * '------------------------' '------------------------' + * .-----------. .-----------. + * |INS |TG(2)| !M(UM)|DELT | + * .-----+-----+-----! !-----+-----+-----. + * ! ! | APP | ! PGUP| ! ! + * ! ! !-----! !-----! ! ! + * |BSPC |LSFT | ESC | ! PGDN|ENTER|SPACE| + * '-----------------' '-----------------' + */ +[L0] = KEYMAP( + MO(5), DE_1, DE_2, DE_3, DE_4, DE_5, DE_ACUT, + MO(4), DE_X, DE_P, DE_F, DE_W, DE_G, KC_HOME, + MO(1), DE_U, DE_I, DE_A, DE_E, DE_O, + MO(3), DE_UE, DE_OE, DE_AE, DE_C, DE_V, KC_END, + KC_TRNS, KC_TRNS, KC_LGUI, KC_LALT, KC_LCTL, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_INS, TG(2), + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_APP, + /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, KC_LSFT, KC_ESC, + DE_GRV, DE_6, DE_7, DE_8, DE_9, DE_0, DE_CIRC, + TG(2), DE_H, DE_J, DE_K, DE_L, DE_Q, DE_Z, + /*-*/ DE_S, DE_N, DE_R, DE_T, DE_D, DE_SS, + KC_TAB, DE_B, DE_M, DE_COMM, DE_DOT, KC_UP, DE_Y, + /*-*/ /*-*/ KC_RCTL, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT, + M(UM), KC_DELT, + KC_PGUP, + KC_PGDN, KC_ENTER, KC_SPACE +), +/* + * .------------------------------------.------------------------------------. + * | |EXLM|DQOT|PARA| | | | | | | | |RING| | + * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + * | |ASTR|PIPE|SLSH|LCBR|RCBR| | |HASH|LESS|MORE| |DQOT| | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | |UNDS|MINS|AMPR|LBRC|RBRC|-----!-----!DLR |LPRN|RPRN|TILD|QUOT| QST | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | |PLUS|EQL | | | | |BSLS|PERC|SCLN|COLN| ↑ | | + * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + * | | | | | | ! | | ↠| ↓ | → | + * '------------------------' '------------------------' + * .-----------. .-----------. + * | | | ! | | + * .-----+-----+-----! !-----+-----+-----. + * ! ! | | ! | ! ! + * ! ! !-----! !-----! ! ! + * | | | | ! | | | + * '-----------------' '-----------------' + */ +[L1] = KEYMAP( + KC_TRNS, DE_EXLM, DE_DQOT, DE_PARA, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, DE_ASTR, DE_PIPE, DE_SLSH, DE_LCBR, DE_RCBR, KC_TRNS, + KC_TRNS, DE_UNDS, DE_MINS, DE_AMPR, DE_LBRC, DE_RBRC, + KC_TRNS, KC_TRNS, DE_PLUS, DE_EQL, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_RING, KC_TRNS, + KC_TRNS, DE_HASH, DE_LESS, DE_MORE, KC_TRNS, DE_DQOT, KC_TRNS, + /*-*/ DE_DLR, DE_LPRN, DE_RPRN, DE_TILD, DE_QUOT, DE_QST, + KC_TRNS, DE_BSLS, DE_PERC, DE_SCLN, DE_COLN, M(UC_UPWARDS_ARROW), KC_TRNS, + /*-*/ /*-*/ KC_TRNS, KC_TRNS, M(UC_LEFTWARDS_ARROW), M(UC_DOWNWARDS_ARROW), M(UC_RIGHTWARDS_ARROW), + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* + * .------------------------------------.------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 |F10 |PEQL | + * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + * | | | | | | | | | | P7 | P8 | P9 |PAST|PSLS | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | | | | | |-----!-----! | P4 | P5 | P6 |PMNS|PMNS | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | | | | | | | NLCK| | P1 | P2 | P3 |PPLS|PPLS | + * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + * | | | | | | ! P0 |PCMM|PDOT|PENT|PENT| + * '------------------------' '------------------------' + * .-----------. .-----------. + * | | | ! | | + * .-----+-----+-----! !-----+-----+-----. + * ! ! | | ! | ! ! + * ! ! !-----! !-----! ! ! + * | | | | ! | | | + * '-----------------' '-----------------' + */ +[L2] = KEYMAP( + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_PEQL, + KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, + /*-*/ KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PMNS, + KC_NLCK, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PPLS, + /*-*/ /*-*/ KC_P0, KC_PCMM, KC_PDOT, KC_PENT, KC_PENT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* + * .------------------------------------.------------------------------------. + * | | ¹ | ² | ³ | â´ | âµ | ∀ | | ⶠ| â· | ⸠| â¹ | â° | | + * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + * | | × | ½ | ÷ | ¼ | â…• | | | â…™ | | â…› | | | | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | | ± | AT |EURO| ∅ |-----!-----! ∞ | â¿ | ∃ | ∈ | | | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | â…“ | ≠ | â…” | ¾ | ≃ | | |EXLM| | ∄ | ∉ | | | + * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + * | | | | | | ! | | | | | + * '------------------------' '------------------------' + * .-----------. .-----------. + * | | | ! | | + * .-----+-----+-----! !-----+-----+-----. + * ! ! | | ! | ! ! + * ! ! !-----! !-----! ! ! + * | | | | ! | | | + * '-----------------' '-----------------' + */ +[L3] = KEYMAP( + KC_TRNS, M(UC_SUPERSCRIPT_ONE), M(UC_SUPERSCRIPT_TWO), M(UC_SUPERSCRIPT_THREE), M(UC_SUPERSCRIPT_FOUR), M(UC_SUPERSCRIPT_FIVE), M(UC_FOR_ALL), + KC_TRNS, M(UC_MULTIPLICATION_SIGN), M(UC_VULGAR_FRACTION_ONE_HALF), M(UC_DIVISION_SIGN), M(UC_VULGAR_FRACTION_ONE_QUARTER), M(UC_VULGAR_FRACTION_ONE_FIFTH), KC_TRNS, + KC_TRNS, KC_TRNS, M(UC_PLUS_MINUS_SIGN), DE_AT, DE_EURO, M(UC_EMPTY_SET), + KC_TRNS, M(UC_VULGAR_FRACTION_ONE_THIRD), M(UC_NOT_EQUAL_TO), M(UC_VULGAR_FRACTION_TWO_THIRDS), M(UC_VULGAR_FRACTION_THREE_QUARTERS), M(UC_ASYMPTOTICALLY_EQUAL_TO), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(UC_SUPERSCRIPT_SIX), M(UC_SUPERSCRIPT_SEVEN), M(UC_SUPERSCRIPT_EIGHT), M(UC_SUPERSCRIPT_NINE), M(UC_SUPERSCRIPT_ZERO), KC_TRNS, + KC_TRNS, M(UC_VULGAR_FRACTION_ONE_SIXTH), KC_TRNS, M(UC_VULGAR_FRACTION_ONE_EIGHTH), KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ M(UC_INFINITY), M(UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N), M(UC_THERE_EXISTS), M(UC_ELEMENT_OF), KC_TRNS, KC_TRNS, + KC_TRNS, DE_EXLM, KC_TRNS, M(UC_THERE_DOES_NOT_EXIST), M(UC_NOT_AN_ELEMENT_OF), KC_TRNS, KC_TRNS, + /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* + * .------------------------------------.------------------------------------. + * | | â‚ | â‚‚ | ₃ | â‚„ | â‚… | | | ₆ | ₇ | ₈ | ₉ | â‚€ | | + * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + * | | χ | Ï€ | φ | ω | γ | | | η | ξ | κ | λ | | ζ | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | Ï… | ι | α | ε | ο |-----!-----! σ | ν | Ï | Ï„ | δ | Ï‚ | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | | θ | | | | | | β | μ | | | | ψ | + * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + * | | | | | | ! | | | | | + * '------------------------' '------------------------' + * .-----------. .-----------. + * | | | ! | | + * .-----+-----+-----! !-----+-----+-----. + * ! ! | | ! | ! ! + * ! ! !-----! !-----! ! ! + * | | | | ! | | | + * '-----------------' '-----------------' + */ +[L4] = KEYMAP( + KC_TRNS, M(UC_SUBSCRIPT_ONE), M(UC_SUBSCRIPT_TWO), M(UC_SUBSCRIPT_THREE), M(UC_SUBSCRIPT_FOUR), M(UC_SUBSCRIPT_FIVE), KC_TRNS, + KC_TRNS, M(UC_GREEK_SMALL_LETTER_CHI), M(UC_GREEK_SMALL_LETTER_PI), M(UC_GREEK_SMALL_LETTER_PHI), M(UC_GREEK_SMALL_LETTER_OMEGA), M(UC_GREEK_SMALL_LETTER_GAMMA), KC_TRNS, + KC_TRNS, M(UC_GREEK_SMALL_LETTER_UPSILON), M(UC_GREEK_SMALL_LETTER_IOTA), M(UC_GREEK_SMALL_LETTER_ALPHA), M(UC_GREEK_SMALL_LETTER_EPSILON), M(UC_GREEK_SMALL_LETTER_OMICRON), + KC_TRNS, KC_TRNS, M(UC_GREEK_SMALL_LETTER_THETA), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(UC_SUBSCRIPT_SIX), M(UC_SUBSCRIPT_SEVEN), M(UC_SUBSCRIPT_EIGHT), M(UC_SUBSCRIPT_NINE), M(UC_SUBSCRIPT_ZERO), KC_TRNS, + KC_TRNS, M(UC_GREEK_SMALL_LETTER_ETA), M(UC_GREEK_SMALL_LETTER_XI), M(UC_GREEK_SMALL_LETTER_KAPPA), M(UC_GREEK_SMALL_LETTER_LAMDA), KC_TRNS, M(UC_GREEK_SMALL_LETTER_ZETA), + /*-*/ M(UC_GREEK_SMALL_LETTER_SIGMA), M(UC_GREEK_SMALL_LETTER_NU), M(UC_GREEK_SMALL_LETTER_RHO), M(UC_GREEK_SMALL_LETTER_TAU), M(UC_GREEK_SMALL_LETTER_DELTA), M(UC_GREEK_SMALL_LETTER_FINAL_SIGMA), + KC_TRNS, M(UC_GREEK_SMALL_LETTER_BETA), M(UC_GREEK_SMALL_LETTER_MU), KC_TRNS, KC_TRNS, KC_TRNS, M(UC_GREEK_SMALL_LETTER_PSI), + /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* + * .------------------------------------.------------------------------------. + * | | | | | | | | | | | | | | | + * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + * | | Χ | Π | Φ | Ω | Γ | | | Η | Ξ | Κ | Λ | | Ζ | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | Î¥ | Ι | Α | Ε | Ο |-----!-----! Σ | Î | Ρ | Τ | Δ | | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | | Θ | | | | | | Î’ | Îœ | | | | Ψ | + * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + * | | | | | | ! | | | | | + * '------------------------' '------------------------' + * .-----------. .-----------. + * | | | ! | | + * .-----+-----+-----! !-----+-----+-----. + * ! ! | | ! | ! ! + * ! ! !-----! !-----! ! ! + * | | | | ! | | | + * '-----------------' '-----------------' + */ +[L5] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_CHI), M(UC_GREEK_CAPITAL_LETTER_PI), M(UC_GREEK_CAPITAL_LETTER_PHI), M(UC_GREEK_CAPITAL_LETTER_OMEGA), M(UC_GREEK_CAPITAL_LETTER_GAMMA), KC_TRNS, + KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_UPSILON), M(UC_GREEK_CAPITAL_LETTER_IOTA), M(UC_GREEK_CAPITAL_LETTER_ALPHA), M(UC_GREEK_CAPITAL_LETTER_EPSILON), M(UC_GREEK_CAPITAL_LETTER_OMICRON), + KC_TRNS, KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_THETA), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_ETA), M(UC_GREEK_CAPITAL_LETTER_XI), M(UC_GREEK_CAPITAL_LETTER_KAPPA), M(UC_GREEK_CAPITAL_LETTER_LAMDA), KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_ZETA), + /*-*/ M(UC_GREEK_CAPITAL_LETTER_SIGMA), M(UC_GREEK_CAPITAL_LETTER_NU), M(UC_GREEK_CAPITAL_LETTER_RHO), M(UC_GREEK_CAPITAL_LETTER_TAU), M(UC_GREEK_CAPITAL_LETTER_DELTA), KC_TRNS, + KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_BETA), M(UC_GREEK_CAPITAL_LETTER_MU), KC_TRNS, KC_TRNS, KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_PSI), + /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* + * .------------------------------------.------------------------------------. + * | | | | | | | | | | | | | | | + * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + * | | | | | | | | | | | | | | | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | | | | | |-----!-----! | | | | | | + * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + * | | | | | | | | | | | | | | | + * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + * | | | | | | ! | | | | | + * '------------------------' '------------------------' + * .-----------. .-----------. + * | | | ! | | + * .-----+-----+-----! !-----+-----+-----. + * ! ! | | ! | ! ! + * ! ! !-----! !-----! ! ! + * | | | | ! | | | + * '-----------------' '-----------------' + */ +[L6] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = {}; + +#define UC_MODE_WIN 0 +#define UC_MODE_LINUX 1 +#define UC_MODE_OSX 2 + +// TODO: allow default mode to be configured +static uint16_t unicode_mode = UC_MODE_WIN; + +uint16_t hextokeycode(uint8_t hex) { + if (hex == 0x0) { + return KC_P0; + } + if (hex < 0xA) { + return KC_P1 + (hex - 0x1); + } + return KC_A + (hex - 0xA); +} + +void unicode_action_function(uint16_t hi, uint16_t lo) { + switch (unicode_mode) { + case UC_MODE_WIN: + register_code(KC_LALT); + + register_code(KC_PPLS); + unregister_code(KC_PPLS); + + register_code(hextokeycode((hi & 0xF0) >> 4)); + unregister_code(hextokeycode((hi & 0xF0) >> 4)); + register_code(hextokeycode((hi & 0x0F))); + unregister_code(hextokeycode((hi & 0x0F))); + register_code(hextokeycode((lo & 0xF0) >> 4)); + unregister_code(hextokeycode((lo & 0xF0) >> 4)); + register_code(hextokeycode((lo & 0x0F))); + unregister_code(hextokeycode((lo & 0x0F))); + + unregister_code(KC_LALT); + break; + case UC_MODE_LINUX: + register_code(KC_LCTL); + register_code(KC_LSFT); + + register_code(KC_U); + unregister_code(KC_U); + + register_code(hextokeycode((hi & 0xF0) >> 4)); + unregister_code(hextokeycode((hi & 0xF0) >> 4)); + register_code(hextokeycode((hi & 0x0F))); + unregister_code(hextokeycode((hi & 0x0F))); + register_code(hextokeycode((lo & 0xF0) >> 4)); + unregister_code(hextokeycode((lo & 0xF0) >> 4)); + register_code(hextokeycode((lo & 0x0F))); + unregister_code(hextokeycode((lo & 0x0F))); + + unregister_code(KC_LCTL); + unregister_code(KC_LSFT); + break; + case UC_MODE_OSX: + break; + } +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + if (!record->event.pressed) { + return MACRO_NONE; + } + // MACRODOWN only works in this function + switch(id) { + case UM: + unicode_mode = (unicode_mode + 1) % 2; + break; + +case UC_GREEK_SMALL_LETTER_OMICRON: + unicode_action_function(0x03, 0xbf); + break; +case UC_LEFTWARDS_ARROW: + unicode_action_function(0x21, 0x90); + break; +case UC_GREEK_CAPITAL_LETTER_RHO: + unicode_action_function(0x03, 0xa1); + break; +case UC_SUBSCRIPT_THREE: + unicode_action_function(0x20, 0x83); + break; +case UC_VULGAR_FRACTION_ONE_EIGHTH: + unicode_action_function(0x21, 0x5b); + break; +case UC_GREEK_SMALL_LETTER_LAMDA: + unicode_action_function(0x03, 0xbb); + break; +case UC_VULGAR_FRACTION_ONE_THIRD: + unicode_action_function(0x21, 0x53); + break; +case UC_GREEK_SMALL_LETTER_XI: + unicode_action_function(0x03, 0xbe); + break; +case UC_THERE_DOES_NOT_EXIST: + unicode_action_function(0x22, 0x04); + break; +case UC_SUPERSCRIPT_ONE: + unicode_action_function(0x00, 0xb9); + break; +case UC_GREEK_SMALL_LETTER_BETA: + unicode_action_function(0x03, 0xb2); + break; +case UC_SUBSCRIPT_FIVE: + unicode_action_function(0x20, 0x85); + break; +case UC_GREEK_CAPITAL_LETTER_IOTA: + unicode_action_function(0x03, 0x99); + break; +case UC_VULGAR_FRACTION_ONE_FIFTH: + unicode_action_function(0x21, 0x55); + break; +case UC_GREEK_SMALL_LETTER_PSI: + unicode_action_function(0x03, 0xc8); + break; +case UC_SUBSCRIPT_NINE: + unicode_action_function(0x20, 0x89); + break; +case UC_SUPERSCRIPT_FOUR: + unicode_action_function(0x20, 0x74); + break; +case UC_RIGHTWARDS_ARROW: + unicode_action_function(0x21, 0x92); + break; +case UC_SUPERSCRIPT_SIX: + unicode_action_function(0x20, 0x76); + break; +case UC_DOWNWARDS_ARROW: + unicode_action_function(0x21, 0x93); + break; +case UC_GREEK_SMALL_LETTER_PI: + unicode_action_function(0x03, 0xc0); + break; +case UC_SUPERSCRIPT_TWO: + unicode_action_function(0x00, 0xb2); + break; +case UC_GREEK_CAPITAL_LETTER_OMEGA: + unicode_action_function(0x03, 0xa9); + break; +case UC_GREEK_CAPITAL_LETTER_PSI: + unicode_action_function(0x03, 0xa8); + break; +case UC_SUBSCRIPT_FOUR: + unicode_action_function(0x20, 0x84); + break; +case UC_GREEK_CAPITAL_LETTER_NU: + unicode_action_function(0x03, 0x9d); + break; +case UC_DIVISION_SIGN: + unicode_action_function(0x00, 0xf7); + break; +case UC_GREEK_SMALL_LETTER_SIGMA: + unicode_action_function(0x03, 0xc3); + break; +case UC_GREEK_SMALL_LETTER_RHO: + unicode_action_function(0x03, 0xc1); + break; +case UC_VULGAR_FRACTION_ONE_SIXTH: + unicode_action_function(0x21, 0x59); + break; +case UC_GREEK_SMALL_LETTER_GAMMA: + unicode_action_function(0x03, 0xb3); + break; +case UC_VULGAR_FRACTION_TWO_THIRDS: + unicode_action_function(0x21, 0x54); + break; +case UC_GREEK_SMALL_LETTER_NU: + unicode_action_function(0x03, 0xbd); + break; +case UC_GREEK_SMALL_LETTER_ZETA: + unicode_action_function(0x03, 0xb6); + break; +case UC_GREEK_SMALL_LETTER_EPSILON: + unicode_action_function(0x03, 0xb5); + break; +case UC_GREEK_SMALL_LETTER_KAPPA: + unicode_action_function(0x03, 0xba); + break; +case UC_SUPERSCRIPT_SEVEN: + unicode_action_function(0x20, 0x77); + break; +case UC_GREEK_CAPITAL_LETTER_PI: + unicode_action_function(0x03, 0xa0); + break; +case UC_GREEK_SMALL_LETTER_FINAL_SIGMA: + unicode_action_function(0x03, 0xc2); + break; +case UC_GREEK_CAPITAL_LETTER_XI: + unicode_action_function(0x03, 0x9e); + break; +case UC_GREEK_SMALL_LETTER_THETA: + unicode_action_function(0x03, 0xb8); + break; +case UC_GREEK_SMALL_LETTER_ETA: + unicode_action_function(0x03, 0xb7); + break; +case UC_SUBSCRIPT_TWO: + unicode_action_function(0x20, 0x82); + break; +case UC_ASYMPTOTICALLY_EQUAL_TO: + unicode_action_function(0x22, 0x43); + break; +case UC_GREEK_SMALL_LETTER_ALPHA: + unicode_action_function(0x03, 0xb1); + break; +case UC_GREEK_CAPITAL_LETTER_PHI: + unicode_action_function(0x03, 0xa6); + break; +case UC_GREEK_SMALL_LETTER_PHI: + unicode_action_function(0x03, 0xc6); + break; +case UC_INFINITY: + unicode_action_function(0x22, 0x1e); + break; +case UC_GREEK_CAPITAL_LETTER_OMICRON: + unicode_action_function(0x03, 0x9f); + break; +case UC_ELEMENT_OF: + unicode_action_function(0x22, 0x08); + break; +case UC_MULTIPLICATION_SIGN: + unicode_action_function(0x00, 0xd7); + break; +case UC_SUBSCRIPT_ZERO: + unicode_action_function(0x20, 0x80); + break; +case UC_GREEK_CAPITAL_LETTER_SIGMA: + unicode_action_function(0x03, 0xa3); + break; +case UC_GREEK_SMALL_LETTER_OMEGA: + unicode_action_function(0x03, 0xc9); + break; +case UC_SUBSCRIPT_ONE: + unicode_action_function(0x20, 0x81); + break; +case UC_GREEK_CAPITAL_LETTER_ZETA: + unicode_action_function(0x03, 0x96); + break; +case UC_GREEK_SMALL_LETTER_TAU: + unicode_action_function(0x03, 0xc4); + break; +case UC_SUPERSCRIPT_FIVE: + unicode_action_function(0x20, 0x75); + break; +case UC_THERE_EXISTS: + unicode_action_function(0x22, 0x03); + break; +case UC_PLUS_MINUS_SIGN: + unicode_action_function(0x00, 0xb1); + break; +case UC_VULGAR_FRACTION_THREE_QUARTERS: + unicode_action_function(0x00, 0xbe); + break; +case UC_SUPERSCRIPT_THREE: + unicode_action_function(0x00, 0xb3); + break; +case UC_EMPTY_SET: + unicode_action_function(0x22, 0x05); + break; +case UC_UPWARDS_ARROW: + unicode_action_function(0x21, 0x91); + break; +case UC_SUPERSCRIPT_NINE: + unicode_action_function(0x20, 0x79); + break; +case UC_GREEK_SMALL_LETTER_DELTA: + unicode_action_function(0x03, 0xb4); + break; +case UC_GREEK_SMALL_LETTER_MU: + unicode_action_function(0x03, 0xbc); + break; +case UC_GREEK_CAPITAL_LETTER_KAPPA: + unicode_action_function(0x03, 0x9a); + break; +case UC_SUBSCRIPT_EIGHT: + unicode_action_function(0x20, 0x88); + break; +case UC_GREEK_CAPITAL_LETTER_ALPHA: + unicode_action_function(0x03, 0x91); + break; +case UC_SUBSCRIPT_SEVEN: + unicode_action_function(0x20, 0x87); + break; +case UC_GREEK_CAPITAL_LETTER_BETA: + unicode_action_function(0x03, 0x92); + break; +case UC_GREEK_CAPITAL_LETTER_ETA: + unicode_action_function(0x03, 0x97); + break; +case UC_SUPERSCRIPT_EIGHT: + unicode_action_function(0x20, 0x78); + break; +case UC_SUPERSCRIPT_ZERO: + unicode_action_function(0x20, 0x70); + break; +case UC_NOT_AN_ELEMENT_OF: + unicode_action_function(0x22, 0x09); + break; +case UC_GREEK_SMALL_LETTER_UPSILON: + unicode_action_function(0x03, 0xc5); + break; +case UC_NOT_EQUAL_TO: + unicode_action_function(0x22, 0x60); + break; +case UC_GREEK_CAPITAL_LETTER_CHI: + unicode_action_function(0x03, 0xa7); + break; +case UC_FOR_ALL: + unicode_action_function(0x22, 0x00); + break; +case UC_GREEK_CAPITAL_LETTER_TAU: + unicode_action_function(0x03, 0xa4); + break; +case UC_VULGAR_FRACTION_ONE_QUARTER: + unicode_action_function(0x00, 0xbc); + break; +case UC_GREEK_SMALL_LETTER_CHI: + unicode_action_function(0x03, 0xc7); + break; +case UC_GREEK_CAPITAL_LETTER_THETA: + unicode_action_function(0x03, 0x98); + break; +case UC_GREEK_SMALL_LETTER_IOTA: + unicode_action_function(0x03, 0xb9); + break; +case UC_GREEK_CAPITAL_LETTER_LAMDA: + unicode_action_function(0x03, 0x9b); + break; +case UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N: + unicode_action_function(0x20, 0x7f); + break; +case UC_GREEK_CAPITAL_LETTER_UPSILON: + unicode_action_function(0x03, 0xa5); + break; +case UC_GREEK_CAPITAL_LETTER_MU: + unicode_action_function(0x03, 0x9c); + break; +case UC_GREEK_CAPITAL_LETTER_EPSILON: + unicode_action_function(0x03, 0x95); + break; +case UC_GREEK_CAPITAL_LETTER_GAMMA: + unicode_action_function(0x03, 0x93); + break; +case UC_SUBSCRIPT_SIX: + unicode_action_function(0x20, 0x86); + break; +case UC_GREEK_CAPITAL_LETTER_DELTA: + unicode_action_function(0x03, 0x94); + break; +case UC_VULGAR_FRACTION_ONE_HALF: + unicode_action_function(0x00, 0xbd); + break; + default: + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case L1: + ergodox_right_led_1_on(); + break; + case L2: + ergodox_right_led_2_on(); + break; + case L3: + ergodox_right_led_3_on(); + break; + case L4: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + break; + case L5: + ergodox_right_led_1_on(); + ergodox_right_led_3_on(); + break; + // case L6: + // ergodox_right_led_2_on(); + // ergodox_right_led_3_on(); + // break; + // case L7: + // ergodox_right_led_1_on(); + // ergodox_right_led_2_on(); + // ergodox_right_led_3_on(); + // break; + default: + ergodox_board_led_off(); + break; + } +}; diff --git a/keyboards/ergodox/keymaps/german-manuneo/keymap.md b/keyboards/ergodox/keymaps/german-manuneo/keymap.md new file mode 100644 index 000000000..2c9e0a837 --- /dev/null +++ b/keyboards/ergodox/keymaps/german-manuneo/keymap.md @@ -0,0 +1,188 @@ +# ManuNeo Ergodox Keyboard Layout + +Compile this file to a `keymap.c` file using `compile_keymap.py` + + python compile_keymap.py keymaps/german-manuneo/keymap.md + +Tested with python 2.7 and python 3.4 + + +# Layout Config + + { + "layout": "ergodox_ez", + "keymaps_includes": [ + "ergodox_ez.h", + "action_layer.h", + "keymap_common.h", + "keymap_extras/keymap_german.h", + ], + "key_prefixes": ["DE_", "KC_"], + "macros": { + // TODO: implement macros + // "MUC": "", + }, + // TODO: implement default unicode mode + } + + +# Layers + + +## Layer 0 + + .------------------------------------.------------------------------------. + |MO(5)| 1 | 2 | 3 | 4 | 5 |ACUT | GRV | 6 | 7 | 8 | 9 | 0 |CIRC | + !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + |MO(4)| X | P | F | W | G |HOME |TG(2)| H | J | K | L | Q | Z | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | SS | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + |MO(3)| UE | OE | AE | C | V |END | TAB | B | M |COMM| DOT| UP | Y | + '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | |LGUI|LALT|LCTL| !RCTL|RALT|LEFT|DOWN|RGHT| + '------------------------' '------------------------' + .-----------. .-----------. + |INS |TG(2)| !M(UM)|DELT | + .-----+-----+-----! !-----+-----+-----. + ! ! | APP | ! PGUP| ! ! + ! ! !-----! !-----! ! ! + |BSPC |LSFT | ESC | ! PGDN|ENTER|SPACE| + '-----------------' '-----------------' + + +## Layer 1 + + .------------------------------------.------------------------------------. + | |EXLM|DQOT|PARA| | | | | | | | |RING| | + !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + | |ASTR|PIPE|SLSH|LCBR|RCBR| | |HASH|LESS|MORE| |DQOT| | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | |UNDS|MINS|AMPR|LBRC|RBRC|-----!-----!DLR |LPRN|RPRN|TILD|QUOT| QST | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | |PLUS|EQL | | | | |BSLS|PERC|SCLN|COLN| ↑ | | + '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | | | | | ! | | ↠| ↓ | → | + '------------------------' '------------------------' + .-----------. .-----------. + | | | ! | | + .-----+-----+-----! !-----+-----+-----. + ! ! | | ! | ! ! + ! ! !-----! !-----! ! ! + | | | | ! | | | + '-----------------' '-----------------' + + +## Layer 2 + + .------------------------------------.------------------------------------. + | | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 |F10 |PEQL | + !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + | | | | | | | | | | P7 | P8 | P9 |PAST|PSLS | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | | | | | |-----!-----! | P4 | P5 | P6 |PMNS|PMNS | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | | | | | | | NLCK| | P1 | P2 | P3 |PPLS|PPLS | + '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | | | | | ! P0 |PCMM|PDOT|PENT|PENT| + '------------------------' '------------------------' + .-----------. .-----------. + | | | ! | | + .-----+-----+-----! !-----+-----+-----. + ! ! | | ! | ! ! + ! ! !-----! !-----! ! ! + | | | | ! | | | + '-----------------' '-----------------' + + + +## Layer 3 + +http://symbolcodes.tlt.psu.edu/bylanguage/mathchart.html + + .------------------------------------.------------------------------------. + | | ¹ | ² | ³ | â´ | âµ | ∀ | | ⶠ| â· | ⸠| â¹ | â° | | + !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + | | × | ½ | ÷ | ¼ | â…• | | | â…™ | | â…› | | | | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | | ± | AT |EURO| ∅ |-----!-----! ∞ | â¿ | ∃ | ∈ | | | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | â…“ | ≠ | â…” | ¾ | ≃ | | |EXLM| | ∄ | ∉ | | | + '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | | | | | ! | | | | | + '------------------------' '------------------------' + .-----------. .-----------. + | | | ! | | + .-----+-----+-----! !-----+-----+-----. + ! ! | | ! | ! ! + ! ! !-----! !-----! ! ! + | | | | ! | | | + '-----------------' '-----------------' + + +## Layer 4 + + + .------------------------------------.------------------------------------. + | | â‚ | â‚‚ | ₃ | â‚„ | â‚… | | | ₆ | ₇ | ₈ | ₉ | â‚€ | | + !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + | | χ | Ï€ | φ | ω | γ | | | η | ξ | κ | λ | | ζ | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | Ï… | ι | α | ε | ο |-----!-----! σ | ν | Ï | Ï„ | δ | Ï‚ | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | | θ | | | | | | β | μ | | | | ψ | + '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | | | | | ! | | | | | + '------------------------' '------------------------' + .-----------. .-----------. + | | | ! | | + .-----+-----+-----! !-----+-----+-----. + ! ! | | ! | ! ! + ! ! !-----! !-----! ! ! + | | | | ! | | | + '-----------------' '-----------------' + + +## Layer 5 + + .------------------------------------.------------------------------------. + | | | | | | | | | | | | | | | + !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + | | Χ | Π | Φ | Ω | Γ | | | Η | Ξ | Κ | Λ | | Ζ | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | Î¥ | Ι | Α | Ε | Ο |-----!-----! Σ | Î | Ρ | Τ | Δ | | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | | Θ | | | | | | Î’ | Îœ | | | | Ψ | + '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | | | | | ! | | | | | + '------------------------' '------------------------' + .-----------. .-----------. + | | | ! | | + .-----+-----+-----! !-----+-----+-----. + ! ! | | ! | ! ! + ! ! !-----! !-----! ! ! + | | | | ! | | | + '-----------------' '-----------------' + + +## Layer 6 + + .------------------------------------.------------------------------------. + | | | | | | | | | | | | | | | + !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! + | | | | | | | | | | | | | | | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | | | | | |-----!-----! | | | | | | + !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! + | | | | | | | | | | | | | | | + '-----+----+----+----+----+----------'----------+----+----+----+----+-----' + | | | | | | ! | | | | | + '------------------------' '------------------------' + .-----------. .-----------. + | | | ! | | + .-----+-----+-----! !-----+-----+-----. + ! ! | | ! | ! ! + ! ! !-----! !-----! ! ! + | | | | ! | | | + '-----------------' '-----------------' + diff --git a/keyboards/ergodox/keymaps/german/keymap.c b/keyboards/ergodox/keymaps/german/keymap.c new file mode 100644 index 000000000..3eab51f0e --- /dev/null +++ b/keyboards/ergodox/keymaps/german/keymap.c @@ -0,0 +1,185 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_german.h" + +// Layer names +#define BASE 0 // default layer +#define SYMB 1 // symbol layer +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ^ | 1 | 2 | 3 | 4 | 5 | Play | | Next | 6 | 7 | 8 | 9 | 0 | ß | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L2 | Z | U | I | O | P | Ãœ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä/L2 | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Y | X | C | V | B | | | | N | M | , | . |-/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case SYMB: + ergodox_right_led_1_on(); + break; + case MDIA: + ergodox_right_led_2_on(); + break; + default: + ergodox_board_led_off(); + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/j3rn/keymap.c b/keyboards/ergodox/keymaps/j3rn/keymap.c new file mode 100644 index 000000000..6e271321d --- /dev/null +++ b/keyboards/ergodox/keymaps/j3rn/keymap.c @@ -0,0 +1,187 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Grv | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 | BkSp | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Ctrl/Esc|A / L2| S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | ~L1 | ~L2 |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | Home | | PgUp |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | End | | PgDn | | | + * |Space | LGui |------| |------| Tab |Enter | + * | | |Shift | | Alt | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, + CTL_T(KC_ESC), LT(MDIA, KC_A),KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_FN1, KC_FN2, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + + ALT_T(KC_APP), KC_HOME, + KC_END, + KC_SPC, KC_LGUI, KC_LSHIFT, + // right hand + KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + + KC_PGUP, CTL_T(KC_ESC), + KC_PGDN, + KC_LALT, KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | Lclk | Rclk | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, + KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) + [2] = ACTION_LAYER_TAP_TOGGLE(MDIA) // FN2 - Momentary Layer 2 (Media) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/j3rn/readme.md b/keyboards/ergodox/keymaps/j3rn/readme.md new file mode 100644 index 000000000..fc4b64042 --- /dev/null +++ b/keyboards/ergodox/keymaps/j3rn/readme.md @@ -0,0 +1,29 @@ +# J3RN's Mac-centric ErgoDox EZ keymap + +## Motivation + +Essentially, I wanted to switch to a layout that was less jarring than the default ErgoDox EZ layout, and did not require finger gymnastics to perform common OS X shortcuts (most of which involve the CMD (LGui) key). + +## How is it different from the default ErgoDox EZ layout? + +This layout more closely resembles that of the Mac keyboard, and has some other goodness baked in. Here is a rundown of what that means: + +### Mac-like changes + +- **The key to the left of "1" is "~" instead of "=".** +- **The key to the right of "0" is Backspace instead of "-"** (misleadingly labeled "delete" on the Mac's keyboard). There was no room to fit in "-" and "=" between "0" and Backspace, unfortunately. +- **The key to the left of "Q" is Tab instead of Delete.** +- **The rightmost big key on the left thumb is CMD (LGui) instead of Backspace.** + +### Other changes + +- **The button to the left of "A" is Ctrl/Esc instead of Backspace.** This is actually how I have the keyboard on my Macbook set up to be, since it's loads more convenient than a CAPS LOCK key. This is the Ctrl key I find myself using most. +- **Mouse uses Vim-style navigation**. To activate "Media mode," hold the 'a' key. This allows you to move the mouse around with hjkl just like in Vim. Additionally, right and left click are the conveniently placed 'i' and 'o' keys. +- **The key to the right of "5" and the key to left of "6" are "[" and "]", respectively, instead of Left and Right.** There is a more convenient set of Left and Right already present. Truth be told, I don't really use these keys, as they are a stretch to reach. +- **The Toggle L1 keys have been replaced by the otherwise displaced "-" and "=".** They are laid out, left-to-right, in the same order as on the Mac keyboard. Honestly, they are not terribly conveniently placed, and their placement might change in a later version. I found that I did not toggle L1 frequently at all, and found using the momentary keys to access L1 to fit my workflow better. +- **The "~"/L1 key in the bottom-left is now just momentary L1.** The "~" key was moved to the top-left as mentioned before, and I like to keep my multi-use keys to a minimum due to the latency for them to switch from "press" to "hold." +- **The Home and End buttons have been shifted up on the left thumb, and Shift inserted below them.** This makes doing Shift-5 and other such combinations less painful. +- **The Page Up and Page Down buttons have been shifted up on the right thumb, and Alt was moved from above them to below them.** I use Alt more than Page Up or Page Down (mostly in terminal applications), and thought that it deserved a more accessible location. + + +**I'm always open to feedback and/or suggestions!** diff --git a/keyboards/ergodox/keymaps/jack/keymap.c b/keyboards/ergodox/keymaps/jack/keymap.c new file mode 100644 index 000000000..80bf9d535 --- /dev/null +++ b/keyboards/ergodox/keymaps/jack/keymap.c @@ -0,0 +1,118 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +// TODO: Define layer names that make sense for the ErgoDox EZ. +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO, + KC_NO, KC_LCTL, KC_LALT,KC_LGUI, MO(2), + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_SPC,KC_END, + // right hand + KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, + KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_NO, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_ENT, + MO(1), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, + KC_NO, KC_NO, + KC_PGUP, + KC_PGDN, KC_SPC,KC_SPC + ), +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TRNS, KC_F12, KC_NO, KC_NO, KC_NO, RESET, KC_TRNS, + KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_TRNS, KC_F12, KC_NO, KC_NO, KC_NO, RESET, KC_TRNS, + KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/jacobono/img/colemak-default-layer.png b/keyboards/ergodox/keymaps/jacobono/img/colemak-default-layer.png new file mode 100644 index 000000000..06f63c496 Binary files /dev/null and b/keyboards/ergodox/keymaps/jacobono/img/colemak-default-layer.png differ diff --git a/keyboards/ergodox/keymaps/jacobono/img/number-dpad-layer.png b/keyboards/ergodox/keymaps/jacobono/img/number-dpad-layer.png new file mode 100644 index 000000000..4dd718278 Binary files /dev/null and b/keyboards/ergodox/keymaps/jacobono/img/number-dpad-layer.png differ diff --git a/keyboards/ergodox/keymaps/jacobono/img/symbol-layer.png b/keyboards/ergodox/keymaps/jacobono/img/symbol-layer.png new file mode 100644 index 000000000..ee224cf0c Binary files /dev/null and b/keyboards/ergodox/keymaps/jacobono/img/symbol-layer.png differ diff --git a/keyboards/ergodox/keymaps/jacobono/keymap.c b/keyboards/ergodox/keymaps/jacobono/keymap.c new file mode 100644 index 000000000..6b19800af --- /dev/null +++ b/keyboards/ergodox/keymaps/jacobono/keymap.c @@ -0,0 +1,273 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define COLEMAK 0 // new colemak layout +#define QWERTY 1 // default layer +#define SYMB 2 // symbols +#define NUMPAD 3 // number pad +#define MDIA 4 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Basic COLEMAK layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | TAB | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | R | S | T | D |------| |------| H | N | E | I | O | DEL | + * |--------+------+------+------+------+------| | LGUI(TAB)------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | L1 | | | UP |MO(L2)| |MO(L2)| Down | | ALT | RGUI | + * `----------------------------------' `------------------------------------' + * ,-------------. ,---------------. + * | LGUI | App | |Ctrl/Esc| Alt | + * ,------|------|------| |--------+--------+------. + * | | |QUKSL | | QUKSL | | | + * |Space |ENTER |------| |--------| ENTER |Space | + * | | |MO(L3)| | MO(L3) | | | + * `--------------------' `------------------------' + */ + + // If it accepts an argument (i.e, is a function), it doesn't need KC_. + // Otherwise, it needs KC_* + [COLEMAK] = KEYMAP( // layer 0 : Colemak layout default layer + // left hand + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_TRNS, + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_TRNS, + TG(QWERTY), KC_TRNS, KC_TRNS,KC_UP, MO(SYMB), + KC_LGUI, KC_APP, + LGUI(S(KC_SPC)), + KC_SPC,KC_ENT,MO(NUMPAD), + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT, + KC_TRNS, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_TAB, + KC_H, KC_N, KC_E, KC_I, KC_O, KC_DEL, + LGUI(KC_TAB), KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + MO(SYMB), KC_DOWN, KC_TRNS, KC_RALT, KC_RGUI, + CTL_T(KC_ESC), KC_LALT, + LGUI(S(KC_SPC)), + MO(NUMPAD), KC_ENT, KC_SPC), + + /* Keymap 1: Basic QWERTY layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | BkSp | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | DEL | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L0 | | L0 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L |; / L4| CTRL | + * |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L3| '" |AltShf| Left |MO(L2)| |MO(L2)| Down | [ | ] | ~L3 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | Tab | BkSp | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space| LGUI |------| |------| RGUI |Enter | + * | | | End | | PgDn | | | + * `--------------------' `----------------------' + */ + // If it accepts an argument (i.e, is a function), it doesn't need KC_. + // Otherwise, it needs KC_* + [QWERTY] = KEYMAP( // layer 1 + // left hand + KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LALT, + KC_TRNS, KC_QUOT, LALT(KC_LSFT), KC_LEFT, MO(SYMB), + KC_TAB, KC_DELT, + KC_HOME, + KC_SPC, KC_LGUI, KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT, + KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_RCTRL, + KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + MO(SYMB), KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN, KC_RGUI, KC_ENT), + + + /* Keymap 2: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | @ | * | = | _ | | | | ~ | { | } | # | : | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | ! | + | - | " |------| |------| " | ( | ) | ' | ` | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | % | ^ | $ | & | | | | ; | [ | ] | \ | / | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + // SYMBOL + [SYMB] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_TRNS, KC_AT, KC_ASTR, KC_EQL, KC_UNDS, KC_TRNS, + KC_TRNS, KC_PIPE, KC_EXLM, KC_PLUS, KC_MINS, S(KC_QUOTE), + KC_TRNS, KC_TRNS, KC_PERC, KC_CIRC, KC_DLR, KC_AMPR, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_TILD, KC_LCBR, KC_RCBR, KC_HASH, S(KC_SCLN), KC_F12, + S(KC_QUOTE),KC_LPRN, KC_RPRN, KC_QUOTE, KC_GRV, KC_TRNS, + KC_TRNS, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_SLSH, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), + + /* Keymap 3: Numpad Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | UP | | | | | | $ | 7 | 8 | 9 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | LEFT | DOWN | RIGHT| |------| |------| = | 4 | 5 | 6 | - | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | 1 | 2 | 3 | * | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | , | 0 | . | / | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + // Numpad + [NUMPAD] = KEYMAP( + // left hand + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_RIGHT,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_DLR, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS, + KC_EQL, KC_4, KC_5, KC_6, KC_MINS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_ASTR, KC_TRNS, + KC_COMMA,KC_0, KC_DOT, KC_SLSH, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), + + /* Keymap 4: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ + // MEDIA AND MOUSE + KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/jacobono/readme.md b/keyboards/ergodox/keymaps/jacobono/readme.md new file mode 100644 index 000000000..48de0509f --- /dev/null +++ b/keyboards/ergodox/keymaps/jacobono/readme.md @@ -0,0 +1,34 @@ +# Default Layer # + +I'm using the colemak layer -- customized a bit to work a bit better when using spacemacs as my editor. + +![default-layer](img/colemak-default-layer.png) + +## Special Keys ## + +`SC1` => `LGUI + TAB` + +`SC2` => `LGUI + SPACE + TAB` + +`L1` => Switch to QWERTY Layout + +`T(L2)` => Toggle Symbol Layer + +`T(L3)` => Toggle Number and D-Pad Layer + +# QWERTY # + +Nothing special here -- just need this layer tucked away for the `WASD`. Which is literally the only reason I use it. +Just have the same button to toggle back to colemak. + +# Symbol Layer # + +![symbol-layer](img/symbol-layer.png) + +This is just putting matching closing symbols next to each other -- useful when editing lisp. + +# Number and D-Pad Layer # + +Just a basic number layer with a D-PAD on the other side. + +![number-dpad-layer](img/number-dpad-layer.png) diff --git a/keyboards/ergodox/keymaps/jgarr/keymap.c b/keyboards/ergodox/keymaps/jgarr/keymap.c new file mode 100644 index 000000000..a3ad2040f --- /dev/null +++ b/keyboards/ergodox/keymaps/jgarr/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,-----------------------------------------------------. + * | Grv | 1 | 2 | 3 | 4 | 5 | Del | |Backspace| 6 | 7 | 8 | 9 | 0 | \ | + * |--------+------+------+------+------+-------------| |---------+------+------+------+------+------+--------| + * | Tab | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Ctrl/Esc| A | O | E | U | I |------| |---------| D | H | T | N |S / L2| - | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `----------------+------+------+------+------+--------' + * | Ctrl | LGui | Alt | Left | Right| | Up | Down | [ | ] | = | + * `----------------------------------' `----------------------------------' + * ,--------------. ,-------------. + * | AltShf| LGui | | Alt | ~L1 | + * ,------|-------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp |------| |------| Enter |Space | + * | |ace | End | | PgDn | | | + * `---------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(1), + CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), + KC_LCTL, KC_LGUI, KC_LALT, KC_LEFT, KC_RGHT, + LALT(KC_LSFT), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_BSPC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, + MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_EQL, + KC_LALT, KC_FN1, + KC_PGUP, + KC_PGDN,KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/josh/keymap.c b/keyboards/ergodox/keymaps/josh/keymap.c new file mode 100644 index 000000000..de5664a25 --- /dev/null +++ b/keyboards/ergodox/keymaps/josh/keymap.c @@ -0,0 +1,205 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +//macros +#define CTL_SFT_T 100 +#define CTL_SFT_G 101 +#define CTL_ALT_H 102 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | M 100| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * |TAB /Alt| Q | W | E | R | T | Meh | | Meh | Y | U | I | O | P |\ / ALT | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LCTL | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / CTL | + * |--------+------+------+------+------+------| ~L1 | | ~L1 |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | WIN | ` | M 102| M 101|AltShf| |AltShf| Left | Down | Up | Right | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LALT | | Alt | CAPS | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Delete |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + ALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(SYMB), + KC_LGUI, KC_GRV, M(CTL_ALT_H),M(CTL_SFT_G),LALT(KC_LSFT), + CTL_T(KC_APP), KC_LALT, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + M(CTL_SFT_T),KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + MEH_T(KC_NO),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), + MO(SYMB), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + LALT(KC_LSFT),KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, + KC_LALT, KC_CAPS, + KC_PGUP, + KC_PGDN,KC_DEL, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | CALC | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Left | Down | Up | Right| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_CALC, + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN,KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + case CTL_SFT_T: + if (record->event.pressed) { + return MACRO(D(LCTL), D(LSFT), T(T), END); + } + return MACRO(U(LCTL), U(LSFT), END); + break; + case CTL_SFT_G: + if (record->event.pressed) { + return MACRO(D(LCTL), D(LSFT), T(G), END); + } + return MACRO(U(LCTL), U(LSFT), END); + break; + case CTL_ALT_H: + if (record->event.pressed) { + return MACRO(D(LCTL), D(LALT), T(H), END); + } + return MACRO(U(LCTL), U(LALT), END); + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/josh/readme.md b/keyboards/ergodox/keymaps/josh/readme.md new file mode 100644 index 000000000..cee19d47e --- /dev/null +++ b/keyboards/ergodox/keymaps/josh/readme.md @@ -0,0 +1,8 @@ +Layout is based on the default layout that comes on the ergodox infinity. Focused mostly on making ctl and alt easy to reach. I spend most my day working in Eclipse which has just so many 3 key shortcuts. + +* Removed numpad keys from symbol layer (I don't use them) +* Added arrow keys under h, j, k, l on symbol layer. vi movement keys! +* Added a few macros for eclipse hotkeys that I used all the time +* Added calc button on symbol layer +* tap vs hold on tab and \. Gives alt, ctl and shift on both sides of the keyboard + diff --git a/keyboards/ergodox/keymaps/kastyle/keymap.c b/keyboards/ergodox/keymaps/kastyle/keymap.c new file mode 100644 index 000000000..3982e0a19 --- /dev/null +++ b/keyboards/ergodox/keymaps/kastyle/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LGUI | | App | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,---------------. ,---------------. + * |Ctrl/Esc| Alt | | Alt |Ctrl/Esc| + * ,------|--------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * |Backsp| Del |------| |------| Enter | Space| + * | | | End | | PgDn | | | + * `----------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + CTL_T(KC_ESC), ALT_T(KC_APP), + KC_HOME, + KC_BSPC,KC_DEL,KC_END, + // right hand + KC_APP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/kines-ish/keymap.c b/keyboards/ergodox/keymaps/kines-ish/keymap.c new file mode 100644 index 000000000..5063c99f2 --- /dev/null +++ b/keyboards/ergodox/keymaps/kines-ish/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Esc | Grv |Insert| Left | Right| | Up | Down | [ | ] | L2 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Ctrl | Alt | | LGui | Ctrl | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * |Backsp| Del |------| |------| Enter| Space| + * |ace | | End | | PgDn | | | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_ESC, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, + KC_LCTL,KC_LALT, + KC_HOME, + KC_BSPC,KC_DEL,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN2, + KC_LGUI, KC_RCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | PrScr | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ScrLk | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Pause | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_PSCR,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_SLCK,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_PAUS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/kines-ish/readme.md b/keyboards/ergodox/keymaps/kines-ish/readme.md new file mode 100644 index 000000000..5d39a0590 --- /dev/null +++ b/keyboards/ergodox/keymaps/kines-ish/readme.md @@ -0,0 +1,19 @@ +This keymap attempts to match the Kinesis Contoured (aka Advantage) default +layout as closely as possible. See +http://www.kinesis-ergo.com/wp-content/uploads/2013/06/advantage_layout_win.pdf + +Apart from the obvious mappings, this keymap also: + +* removes the dual-purpose momentary layer/normal keys: Z, /, and Grv; + because the author--coming from a Kinesis keyboard--finds the delays and + accidental modifiers to be more disconcerting than helpful. + +* puts Esc in the bottom left since there's no place for it in the top + left to match the Kinesis. + +* changes the bottom-right key into an L2 toggle since there's otherwise no + way to get to L2. + +* adds PrScr, ScrLk and Pause to the L1 keymap, down the left side, since + they're present on the Kinesis but not available in the default + ergodox_ez keymap. diff --git a/keyboards/ergodox/keymaps/maz/keymap.c b/keyboards/ergodox/keymaps/maz/keymap.c new file mode 100644 index 000000000..7b8f0df74 --- /dev/null +++ b/keyboards/ergodox/keymaps/maz/keymap.c @@ -0,0 +1,229 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define ARRW 2 // arrow keys +#define MDIA 3 // media keys, including mouse + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+--------+------. + * | | | | | | | | + * | Space| Bksp |------| |------| Tab |Enter | + * | ctrl | gui | Alt | | Alt | gui | ctrl | + * `--------------------' `----------------------' + */ + // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue + // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_TRNS, KC_GRV, KC_TRNS,MO(SYMB),MO(ARRW), + KC_TRNS, KC_TRNS, + KC_TRNS, + CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, + // right hand + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_CAPSLOCK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_DOT, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_TRNS, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Arrow keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | |PGDOWN| PGUP | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | HOME | END | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[ARRW] = KEYMAP( + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_PGDOWN, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 3: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |Mute |VolDn | VolUp| | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | Prev | Play | Next | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * |Brwser| | | | | | | + * |Back | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_WBAK, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/maz/readme.md b/keyboards/ergodox/keymaps/maz/readme.md new file mode 100644 index 000000000..000a8d000 --- /dev/null +++ b/keyboards/ergodox/keymaps/maz/readme.md @@ -0,0 +1,121 @@ +# Introduction + +## Motivation +I created this keymap in an attempt to optimize my typing experience in text editors (vim and emacs) and the command-line. + +More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. + +## Changes +There are some miscellaneous changes that I kind of forgot I made, such as moving the tilde key, but you can check out the visual layouts below, which I **have** kept up to date. +### Modifier Keys +The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. You must hold each key down for a certain amount of time (forgot where this is specified) in order for the modifier key to activate. + +### Layers +* an arrow layer (ARRW) has been created because the default arrow keys suck. Beware, these do use vim bindings because they're the best. +* the keys in the media layer have been moved around for a better experience (imo), especially with respect to the mouse +* the three layers (SYMB, MDIA, and ARRW) now have their own dedicated keys accessible by the thumbs in the basic layer +* caps lock has been put in place of the right-side `L1` toggle key because there was really no need to have two keys to toggle one layer, and caps lock is useful when writing queries +** unfortunatley, caps lock is not indicated by an LED, so be careful. I use caps lock just like I do insert in vim; for a short burst of text. I always turn off caps lock when I change my focus + +### Removal Of Keys +I also removed a bunch of unnecessary keys that I wasn't going to use anyway. You'll see such keys are blank in the basic layer. I will probably add some more keys in place of these, but I'm fine for now; I just didn't want the distraction of extra keys I barely use. + +## Caveats +### Thumb Cluster Range +I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: +* I use DCS keycaps with SA Row 3 keycaps where the Alt keys are +* I have relatively large hands (I guarantee you there's no problem - I guarantee you) + +### Dangerous positioning +I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtations in which disaster could occur with one fell swoop of a keypress. + +# Keymap +## Keymap 0: Basic layer +``` +,--------------------------------------------------. ,--------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | +|--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| +| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+--------+------. + | | | | | | | | + | Space| Bksp |------| |------| Tab |Enter | + | ctrl | gui | Alt | | Alt | gui | ctrl | + `--------------------' `----------------------' + +``` + +## Keymap 1: Symbol Layer +The only change here is the *dot* (`.`) character moving from next to `0` next to `+` in order to move the layer keys in the correct position +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | 0 | = | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Keymap 2: Arrow Layer +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | | | | | | | | | | | | | | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | | | | | | | | |PGDOWN| PGUP | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | | | | | | HOME | END | | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` + +## Keymap 3: Media and mouse keys +``` + ,--------------------------------------------------. ,--------------------------------------------------. + | | | | | | | | | | | | | | | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | | MsUp | | | | | | | | | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | |Mute |VolDn | VolUp| | | | | | | | | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | Prev | Play | Next | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + |Brwser| | | | | | | + |Back | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` diff --git a/keyboards/ergodox/keymaps/mpiechotka/keymap.c b/keyboards/ergodox/keymaps/mpiechotka/keymap.c new file mode 100644 index 000000000..5bfef5995 --- /dev/null +++ b/keyboards/ergodox/keymaps/mpiechotka/keymap.c @@ -0,0 +1,276 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_colemak.h" + +enum { + BASE = 0, + BASE_CM, + SYMB, + MACR +}; + +enum { + LWIN = 1, + PC1, + PC2, + PC3, + PC4, + DL_BASE, + DL_BASE_CM, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0a: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | + * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LAlt | LGui | | LAlt | RAlt | + * ,------|------|------| |------+--------+------. + * | |Backsp| Home | | PgUp | | | + * | Space|ace/ |------| |------| Tab/ |Enter/| + * | /Shft|Ctrl | 1) | | 2) | Ctrl |Shift | + * `--------------------' `----------------------' + * + * 1) End/L1 + * 2) PgDown/L2 + */ +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(SYMB), + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL, + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, + KC_LALT, F(LWIN), + KC_HOME, + SFT_T(KC_SPC),CTL_T(KC_BSPC),LT(SYMB, KC_END), + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_MINS, KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), + KC_LALT, KC_RALT, + KC_PGUP, + LT(MACR,KC_PGDN),CTL_T(KC_TAB), SFT_T(KC_ENT) + ), +/* Keymap 0b: Basic layer (Colemak keycodes or QWERTY) + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | + * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LAlt | LGui | | LAlt | RAlt | + * ,------|------|------| |------+--------+------. + * | |Backsp| Home | | PgUp | | | + * | Space|ace/ |------| |------| Tab/ |Enter/| + * | /Shft|Ctrl | 1) | | 2) | Ctrl |Shift | + * `--------------------' `----------------------' + * + * 1) End/L1 + * 2) PgDown/L2 + */ +[BASE_CM] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, CM_Q, CM_W, CM_F, CM_P, CM_G, TG(SYMB), + KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D, + KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, KC_EQL, + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, + KC_LALT, F(LWIN), + KC_HOME, + SFT_T(KC_SPC),CTL_T(KC_BSPC),LT(SYMB, KC_END), + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), CM_J, CM_L, CM_U, CM_Y, KC_P, /*CM_SCLN*/ KC_BSLS, + CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT, + KC_MINS, CM_K, CM_M, CM_COMM,CM_DOT, CTL_T(CM_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), + KC_LALT, KC_RALT, + KC_PGUP, + LT(MACR,KC_PGDN),CTL_T(KC_TAB), SFT_T(KC_ENT) + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Macros + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | DLa | DLb | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | PC1 | PC2 | PC3 | PC4 | |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MACROS +[MACR] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, F(DL_BASE),F(DL_BASE_CM),KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, F(PC1), F(PC2), F(PC3), F(PC4), KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [LWIN] = ACTION_MACRO(LWIN), + [PC1] = ACTION_MACRO(PC1), + [PC2] = ACTION_MACRO(PC2), + [PC3] = ACTION_MACRO(PC3), + [PC4] = ACTION_MACRO(PC4), + [DL_BASE] = ACTION_DEFAULT_LAYER_SET(BASE), + [DL_BASE_CM] = ACTION_DEFAULT_LAYER_SET(BASE_CM) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + case LWIN: + if (record->event.pressed) { + register_code(KC_RSFT); + unregister_code(KC_RSFT); + register_code(KC_LGUI); + } else { + unregister_code(KC_LGUI); + } + break; + case PC1: + if (!record->event.pressed) { + return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(1), W(50), T(ENT), END); + } + break; + case PC2: + if (!record->event.pressed) { + return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(2), W(50), T(ENT), END); + } + break; + case PC3: + if (!record->event.pressed) { + return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(3), W(50), T(ENT), END); + } + break; + case PC4: + if (!record->event.pressed) { + return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(4), W(50), T(ENT), END); + } + break; + } + return MACRO_NONE; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case SYMB: + ergodox_right_led_1_on(); + break; + case MACR: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } +}; diff --git a/keyboards/ergodox/keymaps/mpiechotka/readme.md b/keyboards/ergodox/keymaps/mpiechotka/readme.md new file mode 100644 index 000000000..785400d1d --- /dev/null +++ b/keyboards/ergodox/keymaps/mpiechotka/readme.md @@ -0,0 +1,6 @@ +# ErgoDox EZ mpiechotka Configuration + +Modification of ErgoDox EZ Colemak layout with additional QWERTY/software Colemak layer and change of the special keys. + + + diff --git a/keyboards/ergodox/keymaps/msc/img/code_layer.png b/keyboards/ergodox/keymaps/msc/img/code_layer.png new file mode 100644 index 000000000..7b5efaae7 Binary files /dev/null and b/keyboards/ergodox/keymaps/msc/img/code_layer.png differ diff --git a/keyboards/ergodox/keymaps/msc/img/main_layer.png b/keyboards/ergodox/keymaps/msc/img/main_layer.png new file mode 100644 index 000000000..65f92dda1 Binary files /dev/null and b/keyboards/ergodox/keymaps/msc/img/main_layer.png differ diff --git a/keyboards/ergodox/keymaps/msc/img/media_layer.png b/keyboards/ergodox/keymaps/msc/img/media_layer.png new file mode 100644 index 000000000..a69799b07 Binary files /dev/null and b/keyboards/ergodox/keymaps/msc/img/media_layer.png differ diff --git a/keyboards/ergodox/keymaps/msc/keymap.c b/keyboards/ergodox/keymaps/msc/keymap.c new file mode 100644 index 000000000..e567e513f --- /dev/null +++ b/keyboards/ergodox/keymaps/msc/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |' / Cmd | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Cmd | Alt |AltShf| Left | Right| | Left | Down | Up |Right | L2 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + KC_LGUI,KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN,GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(MDIA), + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | Mute | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | Prev |VolDn |VolUp | Next | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | Lclk | Rclk |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_BTN1, KC_BTN2, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/msc/readme.md b/keyboards/ergodox/keymaps/msc/readme.md new file mode 100644 index 000000000..0d14fcbd2 --- /dev/null +++ b/keyboards/ergodox/keymaps/msc/readme.md @@ -0,0 +1,32 @@ +# MSC Configuration + +### Based mostly on the ErgoDox EZ default layout with optimizations for coding on osx. + +#### Expecting the user to rely on Coder Layer this keymap removes some of the duplicate symbol keys in the lower portions of the board and replaces them with arrow keys and modifiers. The Media Layer is also updated to match the change in the arrow keys and the left and right click buttons are moved under the thumb position. The Media layer is now reached with toggle button in the lower right. + +### Main Layer + +![Main Layer](img/main_layer.png) + +### Code Layer + +![Code Layer](img/code_layer.png) + +### Media Layer + +![Media Layer](img/media_layer.png) + +## Changelog + +Version 1.0 + +- Changed the temp code layer key in the bottom right to toggle media layer +- Changed the temp media key to only be ";" +- Changed right hand bottom row to match vim home row nav directions +- Changed media keys to match arrow key changes +- Changed media left and right click to spacebar and backspace locations +- Changed bottom left to Cmd +- Changed single quote on left bottom row to alt + +#### Coming Soon: +- A new layer for Blender editing with a focus on left hand shortcut and a righthand num pad to control the view in Blender. diff --git a/keyboards/ergodox/keymaps/naps62/keymap.c b/keyboards/ergodox/keymaps/naps62/keymap.c new file mode 100644 index 000000000..d8c28423c --- /dev/null +++ b/keyboards/ergodox/keymaps/naps62/keymap.c @@ -0,0 +1,187 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 ! | 2 @ | 3 # | 4 $ | 5 % | Lang | | Esc | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | Bckspc | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------| L1 | | L1 |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , < | . > | / ? | - _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | L1 | ` ~ | ' " | \ | | L2 | | { | } | [ { | ] } | L1 | + * `----------------------------------' `----------------------------------' + * ,--------------. ,---------------. + * | Home | End | | PgUp |Insert | + * ,------|-------|------| |-------+-------+------. + * | | | LGui | | Del | | | + * | Space| Alt |------| |-------| Enter |Space | + * | | | LGui | | Bcsp | | | + * `---------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(2), + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(1), + MO(1), KC_GRV, KC_QUOT, KC_BSLS, MO(2), + + KC_HOME, KC_END, + KC_LGUI, + KC_SPC, KC_LALT, KC_LGUI, + + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + MO(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MO(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, MO(1), + + KC_PGUP, KC_INS, + KC_DEL, + KC_BSPC, KC_ENT, KC_SPC +), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | = | . | 0 | - | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_EQL,KC_DOT, KC_0, KC_MINS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | |GuiUp | Expl | | Term | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |GuiLft|GuiDwn|GuiRgt| | |------| |------| Left | Down | Up |Right | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | |Browsr| | | | |VolDwn|VolUp | Mute | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | | Play | Prev | Next | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | |Brwser|Brwser| + * | Lclk | Rclk |------| |------|Fwd |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, LGUI(KC_W), LGUI(KC_E), KC_BTN1, LGUI(KC_T), KC_TRNS, + KC_TRNS, LGUI(KC_A), LGUI(KC_S), LGUI(KC_D), KC_MS_D, KC_MS_R, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_BTN1, KC_BTN2, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, + KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_WBAK, KC_WFWD +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/naps62/readme.md b/keyboards/ergodox/keymaps/naps62/readme.md new file mode 100644 index 000000000..14728e4cc --- /dev/null +++ b/keyboards/ergodox/keymaps/naps62/readme.md @@ -0,0 +1,29 @@ +# ErgoDox EZ naps62 Configuration + +## Motivation + +I wanted a layout that suited my Linux & Vim usage. I also didn't like the lack of efficient access to some of the more common special characters used in programming. + +## Key features / changes + +### Base Layer (L1) + +* **No `MT(mod, kc)` keys (modifier when pressed, key when tapped).** Those keys work with a global timeout. When a key press is shorter than the timeout, it's considered a tap, otherwise it's a hold. I couldn't find any particular timeout that would work for me. I need to use mods extremely fast, but also want the confort of using them more slowly in other occasions. So I gave up on this feature altogether. +* **Direct access to `{}[]`.** When programming, these are used extremely often. I was still getting used to the coder layer, and I prefer the arrows on the home row, so I used the bottom-right keys for this. +* **Layer keys everywhere.** I either use my little finger or my index finger to go to L1, whichever is more confortable in any given situation. L2 is not used while coding/writing, so I don't need an extremely-optimized access to it. +* **Lang key.** This is nothing more than `Super-Space` combo, which in my systems (both Linux & Windows) is the shortcut to change the keyboard language. I'm Portuguese, so I often cycle between US layout for coding, and PT layout for writing. +* **Special chars on the right-most column.** I only use Ctrl & Shift keys on the left side, so I used the right keys to include some of the more useful special characters as well. + +### Coder Layer (L2) + +* The `=` and `-` signs where nowhere to be found. `-` was already on the base layer, but it's still useful to have a fully-featured NumPad on the coder layer. + +### Media Layer (L3) + +* **Better media keys**. Why was Play/Pause so far away? And where was Mute? I put all my media keys close to each other, including the missing ones +* **Arrow keys on home row.** I use vim, so I'm always on my home row. I use this sometimes to get around, but not as often as to need them on the base row. I'm fine with them here +* I don't use mouse keys. They're still set up, and I made some changes as an experiment, but I mostly forgot they exist by now. + +## Author + +[Miguel Palhas](https://github.com/naps62) diff --git a/keyboards/ergodox/keymaps/ordinary/keymap.c b/keyboards/ergodox/keymaps/ordinary/keymap.c new file mode 100644 index 000000000..778cbc63c --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/keymap.c @@ -0,0 +1,454 @@ +#include "ergodox_ez.h" +#include "led.h" +#include "debug.h" +#include "action_layer.h" +#include "action_util.h" +#include "mousekey.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols layer +#define MDIA 2 // media layer +#define SPEC 3 // special layer + +#define LCaps 10 // left caps-shift key +#define LSymb 11 // left symbol-shift key +#define LMdia 12 // left media-shift key +#define LSpec 13 // left special-shift key +#define RCaps 14 // right caps-shift key +#define RSymb 15 // right symbol-shift key +#define RMdia 16 // right media-shift key +#define RSpec 17 // right special-shift key + +#define MUL 20 // mouse up left +#define MUR 21 // mouse up right +#define MDL 22 // mouse down left +#define MDR 23 // mouse down right + +/* + * The Ordinary Layout for the Ergodox EZ keyboard, v4 + * + * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com + * + * No rights reserved. This software is in the public domain. + * Credit me if you are friendly but if you're a jerk don't bother. + * + * Details: readme.md + * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/******* Base Layer ******************************************************************************************************** + * + * ,------------------------------------------------------. ,------------------------------------------------------. + * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | + * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| + * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | + * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| + * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | + * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| + * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | + * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' + * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | Home | End | | Left | Right| + * ,------|------|------| |------+------+------. + * | | | PgUp | | Up | | | + * |Backsp| Del |------| |------| Enter| Space| + * | | | PgDn | | Down | | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// left hand + F(LSpec),KC_1,KC_2,KC_3 ,KC_4 ,KC_5 ,KC_ESC +,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC +,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G +,M(LCaps) ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) +,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT,KC_LGUI + ,KC_HOME,KC_END + ,KC_PGUP + ,KC_BSPC,KC_DEL ,KC_PGDN + // right hand + ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) + ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) + ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) + ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) + ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL + ,KC_LEFT ,KC_RGHT + ,KC_UP + ,KC_DOWN ,KC_ENT ,KC_SPC + ), + +/******* Symbols Layer ***************************************************************************************************** + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | + * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| + * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | LCtrl | Meh |Hyper | LAlt | LGui | |RGui/0|RAlt/.|Hypr/=|Meh/+ |RCtrl/Ent| + * `-----------------------------------' `-------------------------------------' + * ,-------------. ,-------------. + * | Left | Right| | Home | End | + * ,------|------|------| |------+------+------. + * | | | Up | | PgUp | | | + * |Space |Enter |------| |------|BackSp| Del | + * | | | Down | | PgDn | | | + * `--------------------' `--------------------' + */ +[SYMB] = KEYMAP( +// left hand + KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC +,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) +,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV +,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB +,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT ,KC_LGUI + ,KC_LEFT ,KC_RGHT + ,KC_UP + ,KC_SPC ,KC_ENT ,KC_DOWN + // right hand + ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS + ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS + ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS + ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS + ,GUI_T(KC_0),ALT_T(KC_DOT),ALL_T(KC_EQL),MEH_T(KC_PLUS),CTL_T(KC_ENT) + ,KC_HOME ,KC_END + ,KC_PGUP + ,KC_PGDN ,KC_BSPC ,KC_DEL +), + +/******* Media Layer ******************************************************************************************************* + * + * ,---------------------------------------------------------------. ,---------------------------------------------------------------. + * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | + * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| + * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | + * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| + * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | + * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| + * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | + * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' + * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| + * `---------------------------------------------' `---------------------------------------------' + * ,-------------. ,-------------. + * | Stop |Refrsh| | Prev | Next | + * ,------|------|------| |------+------+------. + * |Brwser|Brwser|Search| |VolUp | | | + * |Back | Fwd |------| |------| Stop | Play-| + * | | | Home | |VolDn | | Pause| + * `--------------------' `--------------------' + */ +[MDIA] = KEYMAP( +// left hand + KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC +,KC_TRNS ,KC_POWER ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U +,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD +,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D +,KC_LCTL ,KC_MEH ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 + ,KC_WSTP ,KC_WREF + ,KC_WSCH + ,KC_WBAK ,KC_NO ,KC_WHOM + // right hand + ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS + ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS + ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS + ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS + ,GUI_T(KC_INS),ALT_T(KC_DEL),KC_HYPR ,KC_MEH ,KC_RCTL + ,KC_MPRV ,KC_MNXT + ,KC_VOLU + ,KC_VOLD ,KC_MSTP ,KC_MPLY +), + +/******* Special Layer ***************************************************************************************************** + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | Esc | | | | | | | | | | | | Bspc | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | RShift | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[SPEC] = KEYMAP( +// left hand + KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS,KC_TRNS ,KC_TRNS + // right hand + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_BSPC ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_RSFT + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + // the faux shift keys are implemented as macro taps + [LCaps] = ACTION_MACRO_TAP(LCaps) + ,[LSymb] = ACTION_MACRO_TAP(LSymb) + ,[LMdia] = ACTION_MACRO_TAP(LMdia) + ,[LSpec] = ACTION_MACRO_TAP(LSpec) + ,[RCaps] = ACTION_MACRO_TAP(RCaps) + ,[RSymb] = ACTION_MACRO_TAP(RSymb) + ,[RMdia] = ACTION_MACRO_TAP(RMdia) + ,[RSpec] = ACTION_MACRO_TAP(RSpec) +}; + +uint16_t caps_shift = 0; +uint16_t symb_shift = 0; +uint16_t mdia_shift = 0; + +bool symb_lock = false; +bool mdia_lock = false; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + // There are two shift keys for each layer so we increment a layer_shift var when one + // is pressed and decrement when one is released. If both are pressed at the same time + // then the layer is locked (or unlocked). The shift counts are bound between 0 and 2 + // only because sometimes rapid pressing led to irregular events; this way the states + // are self healing during use. + + case LCaps: // both caps-shift keys trigger Left Shift + case RCaps: // so they don't interfere with the magic combo + if (record->event.pressed && !record->tap.count) { + if(++caps_shift > 2) caps_shift = 2; + if(caps_shift == 2) { + register_code(KC_CAPS); + unregister_code(KC_CAPS); + } else if(caps_shift == 1) { + register_code(KC_LSFT); + } + } else { + if(--caps_shift < 0) caps_shift = 0; + if(caps_shift == 0) unregister_code(KC_LSFT); + } + break; + + case LSymb: + if (record->event.pressed) { + if(++symb_shift > 2) symb_shift = 2; + if(symb_shift == 2) { + symb_lock = !symb_lock; + } else if(symb_shift == 1) { + layer_on(SYMB); + } + } else { + if(--symb_shift < 0) symb_shift = 0; + if((symb_shift == 0) && (!symb_lock)) layer_off(SYMB); + } + break; + + case LMdia: + if (record->event.pressed) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + register_code(KC_TAB); + } else { + if(++mdia_shift > 2) mdia_shift = 2; + if(mdia_shift == 2) { + mdia_lock = !mdia_lock; + } else if(mdia_shift == 1) { + layer_on(MDIA); + } + } + } else { + if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + unregister_code(KC_TAB); + } else { + if(--mdia_shift < 0) mdia_shift = 0; + if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); + } + } + break; + + case LSpec: + if (record->event.pressed) { + if (record->tap.count && !record->tap.interrupted) { + register_code(KC_GRV); + } else { + layer_on(SPEC); + } + } else { + if(record->tap.count && !record->tap.interrupted) { + unregister_code(KC_GRV); + } else { + layer_off(SPEC); + } + } + break; + + case RSymb: + if (record->event.pressed) { + if (record->tap.count && (!symb_shift) && (!symb_lock)) { + register_code(KC_QUOT); + } else { + if(++symb_shift > 2) symb_shift = 2; + if(symb_shift == 2) { + symb_lock = !symb_lock; + } else if(symb_shift == 1) { + layer_on(SYMB); + } + } + } else { + if(record->tap.count && symb_shift == 0) { + unregister_code(KC_QUOT); + } else { + if(--symb_shift < 0) symb_shift = 0; + if((!symb_shift) && (!symb_lock)) layer_off(SYMB); + } + } + break; + + case RMdia: + if (record->event.pressed) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + register_code(KC_BSLS); + } else { + if(++mdia_shift > 2) mdia_shift = 2; + if(mdia_shift == 2) { + mdia_lock = !mdia_lock; + } else if(mdia_shift == 1) { + layer_on(MDIA); + } + } + } else { + if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + unregister_code(KC_BSLS); + } else { + if(--mdia_shift < 0) mdia_shift = 0; + if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); + } + } + break; + + case RSpec: + if (record->event.pressed) { + if (record->tap.count && !record->tap.interrupted) { + register_code(KC_EQL); + } else { + layer_on(SPEC); + } + } else { + if(record->tap.count && !record->tap.interrupted) { + unregister_code(KC_EQL); + } else { + layer_off(SPEC); + } + } + break; + + // mouse diagonals + + case MUL: // mouse up left + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + mousekey_send(); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + mousekey_send(); + } + break; + + case MUR: // mouse up right + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + mousekey_send(); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + mousekey_send(); + } + break; + + case MDL: // mouse down left + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + mousekey_send(); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + mousekey_send(); + } + break; + + case MDR: // mouse down right + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + mousekey_send(); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + mousekey_send(); + } + break; + + default: + // none + break; + } + + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + // shift or caps lock turns on red light + if(caps_shift || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<\n\n\nTab"], +[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], +[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], +[{y:-0.875,x:5.5},"B",{x:6.5},"N"], +[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc"},"Z",{x:14.5},"?\n/",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], +[{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], +[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Home","End"], +[{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], +[{x:2},"Page\n\n\n\n\n\nDown"], +[{r:-30,rx:13,y:-1,x:-3},"Left","Right"], +[{x:-3},"Up",{h:2},"Enter",{h:2},"Space"], +[{x:-3},"Down"] + diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.png b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png new file mode 100644 index 000000000..99e5ed80b Binary files /dev/null and b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt new file mode 100644 index 000000000..4eccc9f35 --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt @@ -0,0 +1,27 @@ +[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], +[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], +[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], +[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#ffb063"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], +[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#e6e067"},"Print\n\n\n\n\n\nScreen"], +[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#e6e067",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#ff0000",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#ff8500",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], +[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], +[{y:-0.875,c:"#2277ff",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#e6e067"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#2277ff",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], +[{y:-0.75,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#ffb063"},"End",{x:1},"Page\n\n\n\n\n\nDown"], +[{y:-0.875,x:5.5,c:"#e6e067"},"Mute",{x:6.5,c:"#737373",a:7},""], +[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#ff8500"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#ffb063",fa:[0,0,0,1]},"Delete\n\n\nOption"], +[{y:-0.875,x:2.5,c:"#ff8500"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#ffb063"},"Insert\n\n\nCmd",{x:1,c:"#77aaff"},"Hyper"], +[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Crtl\n\n\nRCtrl"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ccbb00"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], +[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], +[{x:2},"Home\n\n\nBrowser"], +[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], +[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ccbb00",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], +[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nDown"] + diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-special.png b/keyboards/ergodox/keymaps/ordinary/ordinary-special.png new file mode 100644 index 000000000..6eecf447e Binary files /dev/null and b/keyboards/ergodox/keymaps/ordinary/ordinary-special.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt new file mode 100644 index 000000000..a08827c6d --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt @@ -0,0 +1,27 @@ +[{x:3.5,a:7},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], +[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#54d6de"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{h:1.5},"",{x:4.5,h:1.5},"",""], +[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], +[{y:-0.375,x:3.5},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{x:6.5},""], +[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], +[{y:-0.625,x:6.5,h:1.5},"",{x:4.5,h:1.5},""], +[{y:-0.75,x:3.5},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.875,x:5.5},"",{x:6.5},""], +[{y:-0.875,w:1.5},"","",{x:14.5},"",{c:"#2277ff",w:1.5},"RShift"], +[{y:-0.375,x:3.5,c:"#cccccc"},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], +[{y:-0.75,x:0.5},"","",{x:14.5},"",""], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], +[{h:2},"",{h:2},"",""], +[{x:2},""], +[{r:-30,rx:13,y:-1,x:-3},"",""], +[{x:-3},"",{h:2},"",{h:2},""], +[{x:-3},""] + diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png new file mode 100644 index 000000000..e4de64a96 Binary files /dev/null and b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt new file mode 100644 index 000000000..e199f5c59 --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt @@ -0,0 +1,27 @@ +[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], +[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], +[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], +[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], +[{y:-0.875,c:"#2277ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb"},"!",{x:14.5,c:"#89b087"},"/",{c:"#2277ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#bbddbb"},"(",{x:10.5,c:"#89b087"},"5"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], +[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#54d6de",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], +[{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], +[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], +[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], +[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb"},"%",{x:14.5,c:"#89b087"},"-",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},".\n\n\nOption"], +[{y:-0.875,x:2.5,c:"#77aaff"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0\n\n\nCmd",{x:1},"=\n\n\nHyper"], +[{y:-0.75,x:0.5,c:"#77aaff"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+\n\n\nMeh","Enter\n\n\nCtrl"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Left","Right"], +[{h:2},"Space",{h:2},"Enter","Up"], +[{x:2},"Down"], +[{r:-30,rx:13,y:-1,x:-3},"Home","End"], +[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"], +[{x:-3},"Page\n\n\n\n\n\nDown"] + diff --git a/keyboards/ergodox/keymaps/ordinary/readme.md b/keyboards/ergodox/keymaps/ordinary/readme.md new file mode 100644 index 000000000..6465cd79e --- /dev/null +++ b/keyboards/ergodox/keymaps/ordinary/readme.md @@ -0,0 +1,103 @@ +# The Ordinary Layout, a familiar and powerful layout # + +The Ordinary Layout is intended to be unremarkably mundane and remarkably useful. This layout maintains most key positions from common QWERTY keyboards, and it features enhanced Symbol and Media layers compared to the default Ergodox EZ layout. + +The Ordinary Layout is supposed to look mostly like a normal keyboard, except in the ways that the Ergodox key arrangement is unique. The thumbs are responsible for space, enter, plus both forward and backward delete; with only a couple exceptions, all other keys are in the same place they are found on traditional keyboards. + +Nicholas Keene +ordinarylayout@nicholaskeene.com +no rights reserved, use for any purposes, credit me if you are a nice person + +## The Base Layout ## + +* The light blue keys are modifiers: traditional Control, Option, and Command keys, plus Hyper and Meh +* The dark blue keys are Shift keys: Capitals Shift (traditional shift), Symbol Shift, and Media Shift; plus a Shift Lock key +* Several dark blue keys double for entry of characters which would typically be in those locations +* The turquoise keys are text navigation and manipulation +* The red keys is Escape and it is always found in that location no matter what + +![Ordinary base layout](ordinary-base.png) + +This layout puts the modifier keys along the bottom of the keyboard where they are on most keyboards. They are in the regular order, with the addition of Hyper and Meh keys. The modifier keys are all in the same place on all layers, although some layers also assign symbols on those buttons. On the outside edges are the Shift keys. The traditional shift key is called Capitals Shift and it is in the normal location. Above that are Symbols Shift and Media Shift. Each Shift key momentarily switches the layout to that layer, and if you use the Shift Lock button you can lock the layout to that layer. + +Touch typists will also find tilde, tab, equals/plus, slash/pipe, and quote/double-quote sharing space on those Shift keys where they would probably be on a common keyboard. Other than the turquoise keys the only buttons which move to new locations are the Brackets and Dash and Escape. Most touch typists dont touch-type brackets or dash anyway so only Escape really requires retraining of muscle memory, and see below for the Special Escape Sequence. + +The four big turquoise keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. + +The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. + +## The Symbols Layer ## + +* The light green keys are the eponymous symbols +* The bright green keys are F-Keys +* The dark green keys constitute a number pad +* The turquoise keys are the *reverse* of the turquoise keys on the base layer + +![Ordinary symbol layout](ordinary-symbol.png) + +The Ergodox EZ ships with the "Coder Layer" which I like to call the Symbols layer. There are some significant improvements in The Ordinary Layout over the default layout. + +The symbol keys are mostly the same as on the default layout, which did a good job in this regard, but with a few enhancements: + +* Angle brackets on this layer mean that curly, square, and angle brackets are all available on different layers of the same two buttons. Also, they mean that all kinds of brackets, including parentheses, are available on both the Base and Symbols layers. +* The slash, backslash, and pipe characters are grouped together as a memory aid. +* The & and | symbols are juxtaposed as a memory aid + +The number pad area here, in green, includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads, because this layout does not use a Num Lock key to switch the buttons between numeric keycodes and navigational keycodes. See the explanation in The Media Layout section about navigation using these same buttons. + +Finally, consider the turquoise text-nav keys. Here in the Symbols layer, these are *reversed* from the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. + +## The Media Layer ## + +* The dark orange keys on the left move the mouse cursor +* The dark orange keys on the right move the text cursor +* The light orange keys are for scrolling and paging +* The bright green keys are more F-keys +* The dark yellow keys signal Web and Audio applications +* The light yellow keys signal the operating system +* The dark gray keys do nothing in case you bump them by accident + +![Ordinary media layout](ordinary-media.png) + +This layer was inspired by the Media layer on the Ergodox EZ but takes it farther. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. + +Moreover, the orange keys on the right overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. + +Alas, the yellow keys have at best spotty success with common software. Good luck with those but don't expect too much. + +## Switching Between Layers ## + +In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. + +Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. If you press both of a pair of shift keys, the layer will lock on until you press both shift keys again. For instance, the widely and rightly loathed Caps Lock is engaged by pressing both Capitals Shift buttons. All the Shift keys work this way. + +Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. + +## Special Sequences ## + +![Ordinary special layout](ordinary-special.png) + +### Escape ### + +The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, whnich is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. + +The Ordinary layout offers as a consolation prize a Special sequence for Escape: Special Shift + 1. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. + +### Backspace ### + +At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence, using the 0 key, to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. + +### RShift ### + +The Ordinary Layout locks layers by pressing both of a pair of shift keys. This interferes with the QMK firmware magic sequence, which is LShift+RShift. To work around this, both of the Capitals Shift keys produce a *Left Shift* keystroke. If for some reason a person needs *Right Shift* they can find it by pressing a Special Shift key, then the Capitals Shift key on the right side of the keyboard. + +**** + +The Ordinary Layout for the Ergodox EZ keyboard, v4 + +Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com + +No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. + +Details: readme.md + https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary diff --git a/keyboards/ergodox/keymaps/osx_de/keymap.c b/keyboards/ergodox/keymaps/osx_de/keymap.c new file mode 100644 index 000000000..554813d7e --- /dev/null +++ b/keyboards/ergodox/keymaps/osx_de/keymap.c @@ -0,0 +1,364 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_german_osx.h" + +#define BASE 0 +#define SYMB 1 +#define MDIA 2 +#define SMLY 3 +#define NUMB 4 +#define EGOS 5 + +#define M_CTRL_CMDV 0 +#define M_CTRL_CMDC 1 +#define M_MEH_SH_ACUT 2 +#define M_LGUI_SHFT 3 +#define M_CTL_SFT_HASH 4 +#define M_DE_OSX_CIRC_CTRLCMD 5 +#define M_DE_OSX_PLUS_CTRLALT 6 +#define SM_SMILE 7 +#define SM_SMIRK 8 +#define SM_CRY 9 +#define SM_SAD 10 +#define SM_HEART 11 +#define SM_LAUGH 12 +#define SM_KISS 13 +#define SM_FROWN 14 +#define M_TOGGLE_5 15 + +//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE]=KEYMAP( +//left half + KC_ESC, DE_OSX_1, DE_OSX_2, DE_OSX_3, DE_OSX_4, DE_OSX_5, M(M_CTL_SFT_HASH), + KC_TAB, DE_OSX_Q, DE_OSX_W, DE_OSX_E, DE_OSX_R, DE_OSX_T, KC_LGUI, + KC_LALT, DE_OSX_A, DE_OSX_S, DE_OSX_D, DE_OSX_F, DE_OSX_G, + KC_LSFT, CTL_T(DE_OSX_Y), DE_OSX_X, DE_OSX_C, DE_OSX_V, DE_OSX_B, KC_LALT, + LT(SYMB,DE_OSX_LESS), M(M_DE_OSX_CIRC_CTRLCMD), M(M_DE_OSX_PLUS_CTRLALT), KC_UP, KC_DOWN, + M(M_MEH_SH_ACUT), TG(MDIA), + KC_HOME, + KC_BSPC, KC_DEL, LT(SMLY,KC_END), + //right half + M(M_CTL_SFT_HASH), DE_OSX_6, DE_OSX_7, DE_OSX_8, DE_OSX_9, DE_OSX_0, DE_OSX_SS, + KC_RGUI, DE_OSX_Z, DE_OSX_U, DE_OSX_I, DE_OSX_O, DE_OSX_P, DE_OSX_UE, + DE_OSX_H, DE_OSX_J, DE_OSX_K, DE_OSX_L, DE_OSX_OE, ALT_T(DE_OSX_AE), + KC_RALT, DE_OSX_N, DE_OSX_M, DE_OSX_COMM, DE_OSX_DOT, CTL_T(DE_OSX_MINS), KC_RSFT, + KC_LEFT, KC_RIGHT, LGUI(KC_LSFT), LALT(KC_LSFT), LT(SYMB,DE_OSX_PLUS), + TG(NUMB), ALL_T(DE_OSX_ACUT), + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC), +[SYMB]=KEYMAP( +//left half + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, DE_OSX_QST, KC_TRNS, KC_TRNS, + KC_TRNS, DE_OSX_HASH, DE_OSX_DLR, DE_OSX_BSLS, DE_OSX_SLSH, KC_DOT, + KC_TRNS, KC_TRNS, DE_OSX_LESS, DE_OSX_PERC, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_DEL, KC_TRNS, + //right half + M(M_TOGGLE_5), KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, + DE_OSX_SLSH, DE_OSX_LPRN, DE_OSX_RPRN, LALT(KC_8), LALT(KC_9), DE_OSX_HASH, + KC_TRNS, DE_OSX_PIPE, DE_OSX_TILD, DE_OSX_CIRC, KC_UP, DE_OSX_MINS, LSFT(KC_4), + DE_OSX_QUOT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, + KC_F13, KC_F12, + KC_F14, + KC_F15, KC_TRNS, KC_TRNS), +[MDIA]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + //right half + KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_TRNS, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK), +[SMLY]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + //right half + M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS, + M(SM_HEART), M(SM_KISS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), +[NUMB]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + //right half + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, DE_OSX_MINS, + KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS, + KC_0, KC_DOT, KC_COMM, DE_OSX_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), +[EGOS]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_F1, KC_F2, + KC_F3, + KC_SPC, KC_LCTL, KC_F4, + //right half + M(M_TOGGLE_5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ +static uint16_t start; +switch(id) { +case M_TOGGLE_5: +//Macro: M_TOGGLE_5//----------------------- + if (record->event.pressed){ + layer_state ^= (1<<5); + layer_state &= (1<<5); + } + +break; +case M_CTRL_CMDC: +//Macro: M_CTRL_CMDC//----------------------- +if (record->event.pressed) { + start = timer_read(); + return MACRO(D(LCTRL),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),END); + } else { + return MACRO(U(LCTRL),D(LGUI),T(C),U(LGUI),END); + } + } + +break; +case M_DE_OSX_PLUS_CTRLALT: +//Macro: M_DE_OSX_PLUS_CTRLALT//----------------------- +if (record->event.pressed) { + start = timer_read(); + return MACRO(D(LCTRL),D(LALT),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),U(LALT),END); + } else { + return MACRO(U(LCTRL),U(LALT),T(RBRC),END); + } + } + +break; +case SM_KISS: +//Macro: SM_KISS//----------------------- +if (record->event.pressed) { + return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(RBRC),U(LSFT),END); + } + +break; +case SM_FROWN: +//Macro: SM_FROWN//----------------------- +if (record->event.pressed) { + return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LALT),T(8),U(LALT),END); + } + +break; +case SM_CRY: +//Macro: SM_CRY//----------------------- +if (record->event.pressed) { + return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END); + } + +break; +case SM_SMILE: +//Macro: SM_SMILE//----------------------- +if (record->event.pressed) { + return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END); + } + +break; +case SM_SMIRK: +//Macro: SM_SMIRK//----------------------- +if (record->event.pressed) { + return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END); + } + +break; +case M_LGUI_SHFT: +//Macro: M_LGUI_SHFT//----------------------- +if (record->event.pressed){ + return MACRO(D(LGUI),D(LSFT),END); + }else{ + return MACRO(U(LGUI),U(LSFT),END); + } + +break; +case SM_HEART: +//Macro: SM_HEART//----------------------- +if (record->event.pressed) { + return MACRO(T(GRV),T(3),END); + } + +break; +case SM_LAUGH: +//Macro: SM_LAUGH//----------------------- +if (record->event.pressed) { + return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(D),U(LSFT),END); + } + +break; +case M_CTL_SFT_HASH: +//Macro: M_CTL_SFT_HASH//----------------------- +if (record->event.pressed) { + start = timer_read(); + return MACRO(D(LCTRL),D(LSFT),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),U(LSFT),END); + } else { + return MACRO(U(LCTRL),U(LSFT),T(BSLS),END); + } + } + +break; +case SM_SAD: +//Macro: SM_SAD//----------------------- +if (record->event.pressed) { + return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END); + } + +break; +case M_DE_OSX_CIRC_CTRLCMD: +//Macro: M_DE_OSX_CIRC_CTRLCMD//----------------------- +if (record->event.pressed) { + start = timer_read(); + return MACRO(D(LCTRL),D(LGUI),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),U(LGUI),END); + } else { + return MACRO(U(LCTRL),U(LGUI),T(NUBS),END); + } + } + +break; +case M_CTRL_CMDV: +//Macro: M_CTRL_CMDV//----------------------- +if (record->event.pressed) { + start = timer_read(); + return MACRO(D(LCTRL),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),END); + } else { + return MACRO(U(LCTRL),D(LGUI),T(V),U(LGUI),END); + } + } + +break; +case M_MEH_SH_ACUT: +//Macro: M_MEH_SH_ACUT//----------------------- +if (record->event.pressed) { + start = timer_read(); + return MACRO(D(LCTRL),D(LSFT),D(LALT),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),U(LSFT),U(LALT),END); + } else { + return MACRO(U(LCTRL),U(LALT),T(EQL),U(LSFT),END); + } + } + +break; +} +return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + +uint8_t layer = biton32(layer_state); + +ergodox_board_led_off(); +ergodox_right_led_1_off(); +ergodox_right_led_2_off(); +ergodox_right_led_3_off(); +switch (layer) { + + case SYMB: + ergodox_right_led_1_on(); + + + break; + case MDIA: + + ergodox_right_led_2_on(); + + break; + case SMLY: + + + ergodox_right_led_3_on(); + break; + case NUMB: + ergodox_right_led_1_on(); + + ergodox_right_led_3_on(); + break; + case EGOS: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; +default: +// none +break; +} + +}; + diff --git a/keyboards/ergodox/keymaps/osx_de/osx_de_highres.png b/keyboards/ergodox/keymaps/osx_de/osx_de_highres.png new file mode 100644 index 000000000..d442a992c Binary files /dev/null and b/keyboards/ergodox/keymaps/osx_de/osx_de_highres.png differ diff --git a/keyboards/ergodox/keymaps/osx_de/readme.md b/keyboards/ergodox/keymaps/osx_de/readme.md new file mode 100644 index 000000000..5011a9dd6 --- /dev/null +++ b/keyboards/ergodox/keymaps/osx_de/readme.md @@ -0,0 +1,41 @@ +#Ergodox EZ für OSX + +Dies ist nur ein kleiner Tweak der bestehenden firmware für das ErgoDox-EZ-Keyboard. Leider passte das layout nicht wirklich für OSX, deswegen habe ich einige Anpassungen gemacht. Dabei wurden folgende features umgesetzt: + +- Die Umlaute sollten an einigermassen sinnvollen Plätzen liegen +- der Umstieg sollte dadurch erleichtert werden, dass einige Tasten an ihren "normalen" Platz zurückgewandert sind. Z.B. ESC, Tab,... +- die Leertaste ist jetzt auf der rechten seite, neben Enter. Dafür hat der linke Daumen nun Backspace und Delete. +- die CMD- und Alt-Tasten sind in der Mitte einfach erreichbar. +- es gibt eine neue Layer die für Spiele genutzt werden kann (egosooter wie Counter Strike). Dort liegen die wichtigsten Tasten auf der linken Seite, im Daumenblock z.B. space und ctrl sowie die F-Tasten 1-4. Diese Layer ist über die Symbollayer erreichbar. +- Die Symbollayer wurde dahingehend angepasst, dass die klammern, etc nun auf beiden hälften der Tastatur zu finden sind +- der Zehnerblock wurde in eine eigene Layer umgezogen +- die Meh und Hyper-Tasten wurden in die Daumenblöcke umgezogen + +# Erstellt Mit Dem ErgodoxLayoutGenerator + +Der ErgodoxLayoutGenerator ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein. +Die Dokumentation für den ELG kann man [hier](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/) nachlesen (momentan leider nur in Englisch verfügbar). + + + +------------------------------ + +# ErgoDox EZ for OSX + +This is only a little tweak of the existing default layout for the ErgoDox keyboard. Unfortunately the default layout did not work well with german OSX, so I created som adjustments. These were the features added and changed: + +- the umlaut-keys should be at their useful place more or less +- the switching should be made more easy so some other keys (like tab, esc) were moved to their default place +- the space key can now be used with both hands +- the CMD- and ALT-Keys moved to the middle, can be reached more easily. +- there is a new layer for using the cursor-keys, placed like on the default keyboard. This makes them useable for games also +- the symbollayer now has only symbols +- the number block was moved to a special layer +- meh and hyper went down to the thumb block + +# Created Using the ErgodoxLayoutGenerator + +The ErgodoxLayoutGenerator (ELG) is a little tool, which makes the creation and maintenance of keycaps a lot easier. It was written in Java and can be downloaded [here](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases). To use the tool, you need to have a current version of Oracles JDK installed. + +The documentation of the ELG can be viewed [here](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/). + diff --git a/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c b/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c new file mode 100644 index 000000000..687a5cb8b --- /dev/null +++ b/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c @@ -0,0 +1,174 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#include "keymap_neo2.h" +#include "keymap_uk.h" +#include "keymap_colemak.h" +#include "keymap_french_osx.h" +#include "keymap_nordic.h" +#include "keymap_dvorak.h" +#include "keymap_german.h" +#include "keymap_norwegian.h" +#include "keymap_fr_ch.h" +#include "keymap_german_osx.h" +#include "keymap_spanish.h" +#include "keymap_bepo.h" + +#define BASE 0 +#define SYMB 1 +#define MDIA 2 +#define QWERTZ 3 +#define NUMB 4 + +#define UNUSED 0 + +//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE]=KEYMAP( +//left half + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LCTL, + KC_TAB, KC_K, KC_DOT, KC_O, KC_COMM, KC_Z, KC_LGUI, + TG(QWERTZ), KC_H, KC_A, KC_E, KC_I, KC_U, + KC_LSFT, CTL_T(KC_X), KC_Q, DE_AE, DE_UE, DE_OE, KC_LALT, + LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT, KC_RGHT, + TG(MDIA), MEH_T(LSFT(DE_ACUT)), + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + //right half + KC_RCTL, KC_6, KC_7, KC_8, KC_9, KC_0, DE_OSX_MINS, + KC_RGUI, KC_V, KC_G, KC_C, KC_L, KC_MINS, KC_Y, + KC_D, KC_T, KC_R, KC_N, KC_S, LT(MDIA,KC_F), + KC_RALT, KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_RSFT, + KC_UP, KC_DOWN, LGUI(KC_LSFT), KC_RBRC, LT(SYMB,KC_BSLS), + ALL_T(DE_ACUT), TG(NUMB), + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC), +[SYMB]=KEYMAP( +//left half + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_GRV, LSFT(KC_GRV), DE_EXLM, DE_QST, KC_TRNS, KC_TRNS, + KC_TRNS, DE_HASH, DE_DLR, LALT(LSFT(KC_7)), DE_SLSH, KC_DOT, + KC_TRNS, KC_TRNS, DE_LESS, DE_PERC, LALT(KC_7), LALT(KC_N), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_DEL, KC_TRNS, + //right half + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), LALT(KC_7), DE_HASH, KC_F12, + DE_SLSH, DE_LPRN, DE_RPRN, LALT(KC_8), LALT(KC_9), KC_TRNS, + KC_TRNS, DE_AMPR, KC_GRV, LSFT(KC_GRV), DE_DQOT, DE_QUOT, DE_QST, + KC_TRNS, KC_DOT, KC_EXLM, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), +[MDIA]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_WH_L, KC_WH_U, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + //right half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MUTE, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS, + KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_RIGHT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK), +[QWERTZ]=KEYMAP( +//left half + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_V), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI, + KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LALT, + LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT, KC_RGHT, + KC_TRNS, MEH_T(LSFT(DE_ACUT)), + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + //right half + LGUI(KC_C), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_RGUI, KC_Y, KC_U, KC_I, KC_O, KC_P, DE_UE, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(MDIA,DE_AE), + KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN, LGUI(KC_LSFT), KC_RBRC, LT(SYMB,KC_BSLS), + ALL_T(DE_ACUT), KC_TRNS, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC), +[NUMB]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + //right half + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, KC_TRNS, + KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS, + KC_0, KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ +switch(id) { +case UNUSED: +//Macro: UNUSED//----------------------- + + + + + + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + + + +break; +} +return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + +uint8_t layer = biton32(layer_state); + +ergodox_board_led_off(); +ergodox_right_led_1_off(); +ergodox_right_led_2_off(); +ergodox_right_led_3_off(); +switch (layer) { + +default: +// none +break; +} + +}; + diff --git a/keyboards/ergodox/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png b/keyboards/ergodox/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png new file mode 100644 index 000000000..193aa339e Binary files /dev/null and b/keyboards/ergodox/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png differ diff --git a/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c b/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c new file mode 100644 index 000000000..21d695894 --- /dev/null +++ b/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c @@ -0,0 +1,597 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_neo2.h" +#include "keymap_uk.h" +#include "keymap_colemak.h" +#include "keymap_nordic.h" +#include "keymap_dvorak.h" +#include "keymap_german.h" +#include "keymap_norwegian.h" +#include "keymap_fr_ch.h" +#include "keymap_german_osx.h" +#include "keymap_spanish.h" +#include "keymap_bepo.h" + + +/** +* This layout was generated using the ErgodoxLayoutGenerator (ELG). You can download it from https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases +* documentation about it can be found here https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/ +* Thanks to the team of Erez Zukerman for building the great Ergodox-EZ! +* +* use at own risk! +**/ + +#define BASE 0 +#define SYMB 1 +#define MDIA 2 +#define SMLY 3 +#define NUMB 4 +#define EGOS 5 + +#define SMLY_TOG_QUOT 0 + +#define M_TOGGLE_5 1 + +#define TGH_NUM 2 + +#define M_DE_OSX_PLUS_CTRLALT 3 + +#define SM_KISS 4 + +#define SM_FROWN 5 + +#define SM_CRY 6 + +#define SM_SMILE 7 + +#define SM_SMIRK 8 + +#define M_LGUI_SHFT 9 + +#define SM_HEART 10 + +#define TOG_HLD_MDIA 11 + +#define SM_LAUGH 12 + +#define SM_SAD 13 + +#define M_DE_OSX_CIRC_CTRLCMD 14 + +#define M_MEH_SH_ACUT 15 + + +//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/** +* Layer: BASE +* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ +* | ESC | 1 | 2 | 3 | 4 | 5 | Hold or toggle | | Hold or toggle | 6 | 7 | 8 | 9 | 0 | ß | +* | | | | | | | Layer NUMB | | Layer MDIA | | | | | | | +* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ +* | TAB | Q | W | E | R | T | Cmd | | Cmd | Z | U | I | O | P | Ãœ | +* | | | | | | | | | | | | | | | | +* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/\-------------------\ \-------------------\/-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ +* | Alt | A | S | D | F | G | | H | J | K | L | Ö | Ä | +* | | | | | | | | | | | | | ALT | +* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ +* | Shift | Y | X | C | V | B | Alt | | Alt | N | M | , | . | - | Shift | +* | | Ctrl | | | | | | | | | | | | Ctrl | | +* \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ +* +* +* /-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------/ +* | < | LongPress / Type | LongPress / Type | Shift+Ctrl | Type | | # | ACUT | CMD+Shift | ALT+Shift | + | +* | SYMB | DE_OSX_CIRC_CTRLCMD| DE_OSX_PLUS_CTRAlt | | Toggle SMLY | | Meh | Hyper | | | SYMB | +* \-------------------\\-------------------\\-------------------\\-------------------\/-------------------//-------------------/ /-------------------//-------------------/ \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ +* | HOME | END | | LEFT | RIGHT | +* | | | | | | +* \-------------------\/-------------------/ /-------------------/\-------------------\ +* | PGUP | | UP | +* | | | | +* /-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------/ +* | BSPC | DEL | PGDN | | DOWN | ENT | SPC | +* | | | | | | | | +* \-------------------\\-------------------\\-------------------\ \-------------------\\-------------------\\-------------------\ +* +* +**/ +[BASE]=KEYMAP( +//left half + KC_ESC, DE_OSX_1, DE_OSX_2, DE_OSX_3, DE_OSX_4, DE_OSX_5, M(TGH_NUM), + KC_TAB, DE_OSX_Q, DE_OSX_W, DE_OSX_E, DE_OSX_R, DE_OSX_T, KC_LGUI, + KC_LALT, DE_OSX_A, DE_OSX_S, DE_OSX_D, DE_OSX_F, DE_OSX_G, + KC_LSFT, CTL_T(DE_OSX_Y), DE_OSX_X, DE_OSX_C, DE_OSX_V, DE_OSX_B, KC_LALT, + LT(SYMB,DE_OSX_LESS), M(M_DE_OSX_CIRC_CTRLCMD), M(M_DE_OSX_PLUS_CTRLALT), LSFT(KC_LCTRL), M(SMLY_TOG_QUOT), + KC_HOME, KC_END, + KC_PGUP, + KC_BSPC, KC_DEL, KC_PGDN, + //right half + M(TOG_HLD_MDIA), DE_OSX_6, DE_OSX_7, DE_OSX_8, DE_OSX_9, DE_OSX_0, DE_OSX_SS, + KC_RGUI, DE_OSX_Z, DE_OSX_U, DE_OSX_I, DE_OSX_O, DE_OSX_P, DE_OSX_UE, + DE_OSX_H, DE_OSX_J, DE_OSX_K, DE_OSX_L, DE_OSX_OE, ALT_T(DE_OSX_AE), + KC_RALT, DE_OSX_N, DE_OSX_M, DE_OSX_COMM, DE_OSX_DOT, CTL_T(DE_OSX_MINS), KC_RSFT, + MEH_T(DE_OSX_HASH), ALL_T(DE_OSX_ACUT), LGUI(KC_LSFT), LALT(KC_LSFT), LT(SYMB,DE_OSX_PLUS), + KC_LEFT, KC_RIGHT, + KC_UP, + KC_DOWN, KC_ENT, KC_SPC), +/** +* Layer: SYMB +* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ +* | APPLICATION| F1 | F2 | F3 | F4 | F5 | F5 | | F6 | F6 | F7 | F8 | F9 | F10 | F11 | +* | | | | | | | | | | | | | | | | +* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ +* | | < | > | ! | ? | | | | | \ | [ | ] | < | > | ! | +* | | | | | | | | | | | | | | | | +* /-----------//-----------//-----------//-----------//-----------//-----------/\-----------\ \-----------\/-----------//-----------//-----------//-----------//-----------//-----------/ +* | | # | $ | \ | / | . | | / | ( | ) | { | } | # | +* | | | | | | | | | | | | | | +* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ +* | | | < | % | | | ~ | | | | | | ~ | | | | | +* | | | | | | | | | | | | | | | | +* \-----------\\-----------\\-----------\\-----------\\-----------\\-----------\\-----------\ \-----------\\-----------\\-----------\\-----------\\-----------\\-----------\\-----------\ +* +* +* /-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------/ +* | | | | | | | ' | DQOT | | Toggle 5 | | +* | | | | | | | | | | | | +* \-----------\\-----------\\-----------\\-----------\/-----------//-----------/ /-----------//-----------/ \-----------\\-----------\\-----------\\-----------\\-----------\ +* | | | | F13 | F12 | +* | | | | | | +* \-----------\/-----------/ /-----------/\-----------\ +* | | | F14 | +* | | | | +* /-----------//-----------//-----------/ /-----------//-----------//-----------/ +* | | DEL | | | F15 | | | +* | | | | | | | | +* \-----------\\-----------\\-----------\ \-----------\\-----------\\-----------\ +* +* +**/ +[SYMB]=KEYMAP( +//left half + KC_APPLICATION, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F5, + KC_TRNS, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, DE_OSX_QST, KC_TRNS, KC_TRNS, + KC_TRNS, DE_OSX_HASH, DE_OSX_DLR, DE_OSX_BSLS, DE_OSX_SLSH, KC_DOT, + KC_TRNS, KC_TRNS, DE_OSX_LESS, DE_OSX_PERC, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_DEL, KC_TRNS, + //right half + KC_F6, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, DE_OSX_BSLS, DE_OSX_LBRC, DE_OSX_RBRC, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, + DE_OSX_SLSH, DE_OSX_LPRN, DE_OSX_RPRN, DE_OSX_LCBR, DE_OSX_RCBR, DE_OSX_HASH, + KC_TRNS, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + DE_OSX_QUOT, DE_OSX_DQOT, KC_TRNS, M(M_TOGGLE_5), KC_TRNS, + KC_F13, KC_F12, + KC_F14, + KC_F15, KC_TRNS, KC_TRNS), +/** +* Layer: MDIA +* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ +* | | | | | | | | | | | | | | | | +* | | | | | | | | | | | | | | | | +* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ +* | | | BTN1 | U | BTN2 | U | | | | | | | | | | +* | | | | | | | | | | | | | | | | +* /-----//-----//-----//-----//-----//-----/\-----\ \-----\/-----//-----//-----//-----//-----//-----/ +* | | | L | D | R | D | | | | | | | | +* | | | | | | | | | | | | | | +* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ +* | | | L | D | R | BTN3 | | | | | | | | UP | | +* | | | | | | | | | | | | | | | | +* \-----\\-----\\-----\\-----\\-----\\-----\\-----\ \-----\\-----\\-----\\-----\\-----\\-----\\-----\ +* +* +* /-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----/ +* | | | | | | | | | LEFT | DOWN | RIGHT| +* | | | | | | | | | | | | +* \-----\\-----\\-----\\-----\/-----//-----/ /-----//-----/ \-----\\-----\\-----\\-----\\-----\ +* | | | | MPRV | MNXT | +* | | | | | | +* \-----\/-----/ /-----/\-----\ +* | | | VOLU | +* | | | | +* /-----//-----//-----/ /-----//-----//-----/ +* | | | | | VOLD | MUTE | MPLY | +* | | | | | | | | +* \-----\\-----\\-----\ \-----\\-----\\-----\ +* +* +**/ +[MDIA]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, + KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + //right half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, + KC_MPRV, KC_MNXT, + KC_VOLU, + KC_VOLD, KC_MUTE, KC_MPLY), +/** +* Layer: SMLY +* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ +* | | | | | | | | | Typing | Typing | Typing | | | | | +* | | | | | | | | | SM_SMILE| SM_SMIRK| SM_LAUGH| | | | | +* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ +* | | | | | | | | | | Typing | Typing | Typing | | | | +* | | | | | | | | | | SM_FROWN| SM_SAD | SM_CRY | | | | +* /--------//--------//--------//--------//--------//--------/\--------\ \--------\/--------//--------//--------//--------//--------//--------/ +* | | | | | | | | Typing | Typing | | | | | +* | | | | | | | | SM_HEART| SM_KISS | | | | | +* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ +* | | | | | | | | | | | | | | | | +* | | | | | | | | | | | | | | | | +* \--------\\--------\\--------\\--------\\--------\\--------\\--------\ \--------\\--------\\--------\\--------\\--------\\--------\\--------\ +* +* +* /--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------/ +* | | | | | | | | | | | | +* | | | | | | | | | | | | +* \--------\\--------\\--------\\--------\/--------//--------/ /--------//--------/ \--------\\--------\\--------\\--------\\--------\ +* | | | | | | +* | | | | | | +* \--------\/--------/ /--------/\--------\ +* | | | | +* | | | | +* /--------//--------//--------/ /--------//--------//--------/ +* | | | | | | | | +* | | | | | | | | +* \--------\\--------\\--------\ \--------\\--------\\--------\ +* +* +**/ +[SMLY]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + //right half + M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS, + M(SM_HEART), M(SM_KISS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), +/** +* Layer: NUMB +* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ +* | | | | | | | | | | F6 | F7 | F8 | F9 | F10 | F11 | +* | | | | | | | | | | | | | | | | +* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ +* | | | | UP | | | | | | / | 7 | 8 | 9 | * | F12 | +* | | | | | | | | | | | | | | | | +* /----//----//----//----//----//----/\----\ \----\/----//----//----//----//----//----/ +* | | | LEFT| DOWN| RGHT| | | / | 4 | 5 | 6 | + | - | +* | | | | | | | | | | | | | | +* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ +* | | | | | | | | | | % | 1 | 2 | 3 | | | +* | | | | | | | | | | | | | | | | +* \----\\----\\----\\----\\----\\----\\----\ \----\\----\\----\\----\\----\\----\\----\ +* +* +* /----//----//----//----//----/ /----//----//----//----//----/ +* | | | | | | | 0 | . | , | = | | +* | | | | | | | | | | | | +* \----\\----\\----\\----\/----//----/ /----//----/ \----\\----\\----\\----\\----\ +* | | | | | | +* | | | | | | +* \----\/----/ /----/\----\ +* | | | | +* | | | | +* /----//----//----/ /----//----//----/ +* | | | | | | | | +* | | | | | | | | +* \----\\----\\----\ \----\\----\\----\ +* +* +**/ +[NUMB]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + //right half + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, DE_OSX_SLSH, KC_7, KC_8, KC_9, DE_OSX_ASTR, KC_F12, + DE_OSX_SLSH, KC_4, KC_5, KC_6, DE_OSX_PLUS, DE_OSX_MINS, + KC_TRNS, DE_OSX_PERC, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, + KC_0, KC_DOT, KC_COMM, DE_OSX_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), +/** +* Layer: EGOS +* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ +* | | | | | | | | | | | | | | | | +* | | | | | | | | | | | | | | | | +* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ +* | | | | | | | | | | | | | | | | +* | | | | | | | | | | | | | | | | +* /--------//--------//--------//--------//--------//--------/\--------\ \--------\/--------//--------//--------//--------//--------//--------/ +* | Shift | | | | | | | | | | | | | +* | | | | | | | | | | | | | | +* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ +* | | | | | | | | | | | | | | | | +* | | | | | | | | | | | | | | | | +* \--------\\--------\\--------\\--------\\--------\\--------\\--------\ \--------\\--------\\--------\\--------\\--------\\--------\\--------\ +* +* +* /--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------/ +* | Ctrl | | | | | | | | | Toggle 5| | +* | | | | | | | | | | | | +* \--------\\--------\\--------\\--------\/--------//--------/ /--------//--------/ \--------\\--------\\--------\\--------\\--------\ +* | F1 | F2 | | | | +* | | | | | | +* \--------\/--------/ /--------/\--------\ +* | F3 | | | +* | | | | +* /--------//--------//--------/ /--------//--------//--------/ +* | SPC | Ctrl | F4 | | | | | +* | | | | | | | | +* \--------\\--------\\--------\ \--------\\--------\\--------\ +* +* +**/ +[EGOS]=KEYMAP( +//left half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_F1, KC_F2, + KC_F3, + KC_SPC, KC_LCTL, KC_F4, + //right half + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, M(M_TOGGLE_5), KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ +static uint16_t start; +switch(id) { +case SMLY_TOG_QUOT: +//Macro: SMLY_TOG_QUOT//----------------------- +if (record->event.pressed) { + start = timer_read(); + layer_state ^= (1<150) { + return MACRO_NONE; + } else { + return MACRO(DOWN(KC_LSFT),TYPE(DE_OSX_HASH),UP(KC_LSFT),END); + } + } + +break; +case M_TOGGLE_5: +//Macro: M_TOGGLE_5//----------------------- + if (record->event.pressed){ + layer_state ^= (1<<5); + layer_state &= (1<<5); + } + +break; +case TGH_NUM: +//Macro: TGH_NUM//----------------------- +if (record->event.pressed){ + start = timer_read(); + layer_state ^=(1< 150) { + layer_state^=(1<event.pressed) { + start = timer_read(); + return MACRO(DOWN(KC_LCTRL),DOWN(KC_LALT),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),U(LALT),END); + } else { + return MACRO(UP(KC_LCTRL),UP(KC_LALT),TYPE(KC_RBRC),END); + } + } + +break; +case SM_KISS: +//Macro: SM_KISS//----------------------- +if (record->event.pressed) { + return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_RBRC),UP(KC_LSFT),END); + } + +break; +case SM_FROWN: +//Macro: SM_FROWN//----------------------- +if (record->event.pressed) { + return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LALT),TYPE(KC_8),UP(KC_LALT),END); + } + +break; +case SM_CRY: +//Macro: SM_CRY//----------------------- +if (record->event.pressed) { + return MACRO(DOWN(KC_LSFT),TYPE(KC_COMM),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_8),UP(KC_LSFT),END); + } + +break; +case SM_SMILE: +//Macro: SM_SMILE//----------------------- +if (record->event.pressed) { + return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_9),UP(KC_LSFT),END); + } + +break; +case SM_SMIRK: +//Macro: SM_SMIRK//----------------------- +if (record->event.pressed) { + return MACRO(DOWN(KC_LSFT),TYPE(KC_COMM),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_9),UP(KC_LSFT),END); + } + +break; +case M_LGUI_SHFT: +//Macro: M_LGUI_SHFT//----------------------- +if (record->event.pressed){ + return MACRO(DOWN(KC_LGUI),DOWN(KC_LSFT),END); + }else{ + return MACRO(UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),U(LGUI),U(LSFT),END); + } + +break; +case SM_HEART: +//Macro: SM_HEART//----------------------- +if (record->event.pressed) { + return MACRO(TYPE(KC_GRV),TYPE(KC_3),END); + } + +break; +case TOG_HLD_MDIA: +//Macro: TOG_HLD_MDIA//----------------------- +if (record->event.pressed){ + start = timer_read(); + layer_state ^=(1< 150) { + layer_state^=(1<event.pressed) { + return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_D),UP(KC_LSFT),END); + } + +break; +case SM_SAD: +//Macro: SM_SAD//----------------------- +if (record->event.pressed) { + return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_8),UP(KC_LSFT),END); + } + +break; +case M_DE_OSX_CIRC_CTRLCMD: +//Macro: M_DE_OSX_CIRC_CTRLCMD//----------------------- +if (record->event.pressed) { + start = timer_read(); + return MACRO(DOWN(KC_LCTRL),DOWN(KC_LGUI),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),U(LGUI),END); + } else { + return MACRO(UP(KC_LCTRL),UP(KC_LGUI),TYPE(KC_NUBS),END); + } + } + +break; +case M_MEH_SH_ACUT: +//Macro: M_MEH_SH_ACUT//----------------------- +if (record->event.pressed) { + start = timer_read(); + return MACRO(DOWN(KC_LCTRL),DOWN(KC_LSFT),DOWN(KC_LALT),END); + } else { + if (timer_elapsed(start) >150) { + return MACRO(U(LCTRL),U(LSFT),U(LALT),END); + } else { + return MACRO(UP(KC_LCTRL),UP(KC_LALT),TYPE(DE_OSX_ACUT),UP(KC_LSFT),END); + } + } + +break; +} +return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + +uint8_t layer = biton32(layer_state); + +ergodox_board_led_off(); +ergodox_right_led_1_off(); +ergodox_right_led_2_off(); +ergodox_right_led_3_off(); +switch (layer) { + + case SYMB: + ergodox_right_led_1_on(); + + + break; + case MDIA: + + ergodox_right_led_2_on(); + + break; + case NUMB: + + + ergodox_right_led_3_on(); + break; + case EGOS: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; +default: +// none +break; +} + +}; + diff --git a/keyboards/ergodox/keymaps/osx_de_experimental/osx_de_experimental_highres.png b/keyboards/ergodox/keymaps/osx_de_experimental/osx_de_experimental_highres.png new file mode 100644 index 000000000..031d874a7 Binary files /dev/null and b/keyboards/ergodox/keymaps/osx_de_experimental/osx_de_experimental_highres.png differ diff --git a/keyboards/ergodox/keymaps/osx_de_experimental/readme.md b/keyboards/ergodox/keymaps/osx_de_experimental/readme.md new file mode 100644 index 000000000..e6a101841 --- /dev/null +++ b/keyboards/ergodox/keymaps/osx_de_experimental/readme.md @@ -0,0 +1,22 @@ + +# Ergodox und Ergodox-EZ experimentelles Layout + +dieses layout ist experimentell und wird im Lufe der Zeit viele Änderungen und Verbesserungen durchlaufen. Falls diese sich als vorteilhaft erweisen, werden sie evtl. auch in das `osx_de` layout übernommen. + + + +# Erstellt Mit Dem ErgodoxLayoutGenerator + +Der ErgodoxLayoutGenerator (ELG) ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein. +Die Dokumentation für den ELG kann man [hier](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/) nachlesen (momentan leider nur in Englisch verfügbar). +--------------------------------------------------------------------------------------------------------------------- + +# Ergodox and Ergodox-EZ experimental layout + +This is an experimental layout which will undergo heavy changes over time. If changes prove to be good, they might also move into the `osx_de` layout. + +Created Using the ErgodoxLayoutGenerator + +The ErgodoxLayoutGenerator (ELG) is a little tool, which makes the creation and maintenance of keycaps a lot easier. It was written in Java and can be downloaded [here](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases). To use the tool, you need to have a current version of Oracles JDK installed. + +The documentation of the ELG can be viewed [here](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/). \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/osx_fr/keymap.c b/keyboards/ergodox/keymaps/osx_fr/keymap.c new file mode 100644 index 000000000..de951666d --- /dev/null +++ b/keyboards/ergodox/keymaps/osx_fr/keymap.c @@ -0,0 +1,187 @@ +// French AZERTY version of the default_osx file +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_french_osx.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | - | & | é | " | ' | ( | LEFT | | RIGHT| § | è | ! | ç | à | ) | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | A | Z | E | R | T | L1 | | L1 | Y | U | I | O | P | ` | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | Q | S | D | F | G |------| |------| H | J | K | L | M | LGui | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |W/Ctrl| X | C | V | B | | | | N | , |; / L2| : |=/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | ù /L1| < |AltShf| Left | Right| | Up | Down | ^ | $ | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + FR_MINS, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_LEFT, + KC_DELT, FR_A, FR_Z, KC_E, KC_R, KC_T, TG(1), + KC_BSPC, FR_Q, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(FR_W), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,FR_UGRV), FR_LESS, LALT(KC_LSFT), KC_LEFT, KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + + // right hand + KC_RGHT, FR_SECT, FR_EGRV, FR_EXLM, FR_CCED, FR_AGRV, FR_RPRN, + TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, FR_GRV, + KC_H, KC_J, KC_K, KC_L, FR_M, KC_LGUI, + MEH_T(KC_NO), KC_N, FR_COMM, LT(MDIA, FR_SCLN), FR_COLN, CTL_T(FR_EQL), KC_RSFT, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN, KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | , | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,FR_EXLM,FR_AT, FR_LCBR,FR_RCBR,FR_PIPE,KC_TRNS, + KC_TRNS,FR_HASH,FR_DLR, FR_LPRN,FR_RPRN,FR_GRV, + KC_TRNS,FR_PERC,FR_CIRC,FR_LBRC,FR_RBRC,FR_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, FR_7, FR_8, FR_9, FR_ASTR, KC_F12, + KC_DOWN, FR_4, FR_5, FR_6, FR_PLUS, KC_TRNS, + KC_TRNS, FR_AMP, FR_1, FR_2, FR_3, FR_BSLS, KC_TRNS, + KC_TRNS,FR_COMM, FR_0, FR_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c b/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c new file mode 100644 index 000000000..1032be549 --- /dev/null +++ b/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c @@ -0,0 +1,191 @@ +// Netable differences vs. the default firmware for the ErgoDox EZ: +// 1. The Cmd key is now on the right side, making Cmd+Space easier. +// 2. The media keys work on OSX (But not on Windows). +// Wanted to map default layer of my EZ to my existing Kinesis Mapping. +// Only default layer was remapped all others layers are standard Ergodox EZ +// Very personal mapping of-course, but who knows a starting point for others. + +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | CapsL | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ESC | A | S | D | F | G |------| |------| H | J | K | L |; / L2| '" | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |AltShf|Grv/L1| '" | Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LGui | App | | Ctrl/Esc | RGui | + * ,------|------|------| |------+--------+------. + * | | | Home | | = | | | + * | Backs|Delete|------| |------| Enter |Space | + * | pace | | End | | TAB | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_CAPSLOCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LALT(KC_LSFT), LT(SYMB,KC_GRV),KC_QUOT,KC_LEFT,KC_RGHT, + KC_LGUI, ALT_T(KC_APP), + KC_HOME, + KC_BSPC,KC_DELT,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOTE, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + CTL_T(KC_ESC), KC_LGUI, + KC_EQL, + KC_TAB, KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/plover/keymap.c b/keyboards/ergodox/keymaps/plover/keymap.c new file mode 100644 index 000000000..8a58a37f6 --- /dev/null +++ b/keyboards/ergodox/keymaps/plover/keymap.c @@ -0,0 +1,228 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys +#define PLVR 3 // Plover layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LGui | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L1 | |Plover| Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | Home | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | End | | PgUp | | | + * |Backsp|Delete|------| |------| Enter |Space | + * | ace | | LAlt | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_HOME, + KC_END, + KC_BSPC,KC_DELT,KC_LALT, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(3), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | |Brwser|Brwser| + * | Lclk | Rclk |------| |------|Fwd |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_BTN1, KC_BTN2, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_WBAK, KC_WFWD +), + +/* Keymap 4: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | c | v |------| |------| n | m | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( // layout: layer 4: Steno for Plover + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_FN4, KC_NO, + KC_NO, + KC_C, KC_V, KC_NO, + // right hand + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/plums/keymap.c b/keyboards/ergodox/keymaps/plums/keymap.c new file mode 100644 index 000000000..46eb2e42b --- /dev/null +++ b/keyboards/ergodox/keymaps/plums/keymap.c @@ -0,0 +1,229 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | F5 | |Hypr+M| 6 | 7 | 8 | 9 | 0 | Mute | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LGui | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| SYMB | | MDIA |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Ca/Ctl| { | ( | | | : | | - | = | ) | } |C`/Ctl| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LGA | LAlt | | RAlt | Play | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * |Backsp| Esc |------| |------|Enter |Space | + * |ace | | End | | PgDn | | | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, + KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(SYMB), + F(0), KC_LCBR, KC_LPRN,KC_PIPE,KC_COLN, + LGUI(KC_LALT), KC_LALT, + KC_HOME, + KC_BSPC, KC_ESC, KC_END, + // right hand + HYPR(KC_M), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MUTE, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + TG(MDIA), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_MINS, KC_EQL, KC_RPRN, KC_RCBR, F(1), + KC_RALT, KC_MPLY, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | | | | | | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Left | Down | Up | Right| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |VolUp |VolDn | Prev | Next | | | LClk | RClk | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MPRV, KC_MNXT, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_MACRO_TAP(0), // FN0 - Ctrl + a (For screen/tmux) + [1] = ACTION_MACRO_TAP(1) // FN1 - Ctrl + ` (For quake style console) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. +{ + switch(id) { + case 0: + if (record->event.pressed) { + if (record->tap.count) { + if (record->tap.interrupted) { + record->tap.count = 0; + // hold press action + register_code(KC_LCTL); + } else { + // tap press action + return MACRO( D(LCTL), T(A), U(LCTL), END ); + } + } else { + // hold press action + register_code(KC_LCTL); + } + } else { + if (record->tap.count) { + // tap release action + } else { + // hold release action + unregister_code(KC_LCTL); + } + record->tap.count = 0; + } + break; + case 1: + if (record->event.pressed) { + if (record->tap.count) { + if (record->tap.interrupted) { + record->tap.count = 0; + // hold press action + register_code(KC_RCTL); + } else { + // tap press action + return MACRO( DOWN(KC_RCTL), TYPE(KC_GRV), UP(KC_RCTL), END ); + } + } else { + // hold press action + register_code(KC_RCTL); + } + } else { + if (record->tap.count) { + // tap release action + } else { + // hold release action + unregister_code(KC_RCTL); + } + record->tap.count = 0; + } + break; + } + return MACRO_NONE; +}; + + + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/plums/plums.png b/keyboards/ergodox/keymaps/plums/plums.png new file mode 100644 index 000000000..2f127c4ca Binary files /dev/null and b/keyboards/ergodox/keymaps/plums/plums.png differ diff --git a/keyboards/ergodox/keymaps/plums/readme.md b/keyboards/ergodox/keymaps/plums/readme.md new file mode 100644 index 000000000..b72329eef --- /dev/null +++ b/keyboards/ergodox/keymaps/plums/readme.md @@ -0,0 +1,11 @@ +# ErgoDox EZ Plums Configuration + +## Changelog + +* Apr 23, 2016 (v0.1.0): + * Shortcut for iTerm2 quake style dropdown (Ctrl+`) + * Shortcut for screen/tmux (Ctrl+a) + * Shortcut for shush (Hyper+m) + * Combo modifier for LGUI + LALT + +![Plums](plums.png) diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c new file mode 100644 index 000000000..a66971bef --- /dev/null +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c @@ -0,0 +1,46 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = KEYMAP( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, + KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_BSLS, + CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, + KC_F1, KC_F2, KC_F3, KC_F4, KC_LGUI, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_LALT, + // + /*-*/ KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + /*-*/ KC_NO, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, + /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, + /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + /*-*/ /*-*/ /*-*/ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + KC_MPLY, KC_MNXT, + KC_MPRV, + KC_RALT, KC_QUOT, KC_SPC + ) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/readme.md b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/readme.md new file mode 100644 index 000000000..80475ab21 --- /dev/null +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/readme.md @@ -0,0 +1,28 @@ +# Roman's Layout + +There is only one layer based on [Norman layout](https://normanlayout.info/). + +Looking for multiple-layer layouts? + +- [Symbols, arrows, plover, HJKL arrows](../romanzolotarev-norman-plover-osx-hjkl/) +- [Same with IJKL arrows](../romanzolotarev-norman-plover-osx/) + +[![keyboard-layout](romanzolotarev-norman-osx.png)](http://www.keyboard-layout-editor.com/#/gists/9e89d54f1ea6eeeb7dab1b2d19d28195) + +## Functional Keys + +- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). +- Tap `F2` to copy screenshot to the clipboard. +- Hold `SHIFT` and tap `F2` to save screenshot as a file. +- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). + +## CTRL/ESC + +CTRL and ESC are frequently used in Vim. + +- Tap `CTRL/ESC` to send `ESC`. +- Hold `CTRL/ESC` to use as `CTRL`. + +## Activate N-rollover + +- Hold left `SHIFT` and right `SHIRT` and then tap `N`. diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png new file mode 100644 index 000000000..4b9433be2 Binary files /dev/null and b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png differ diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c new file mode 100644 index 000000000..7c9f67381 --- /dev/null +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c @@ -0,0 +1,134 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 +#define SYMB 1 +#define PLVR 2 +#define ARRW 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = KEYMAP( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14, + KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, TG(PLVR), + CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, + KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_FN1, + // + /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, + /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, + /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, + KC_MPLY, KC_MNXT, + KC_MPRV, + KC_FN3, KC_QUOT, KC_SPC + ), + [SYMB] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + // + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + /*-*/ /*-*/ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + [PLVR] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_C, KC_V, KC_NO, + // + /*-*/ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + /*-*/ KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, + /*-*/ /*-*/ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + /*-*/ KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + /*-*/ /*-*/ /*-*/ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M + ), + [ARRW] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + // + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [SYMB] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Symbols Layer + [PLVR] = ACTION_LAYER_TAP_TOGGLE(PLVR), // FN2 - Momentary Plover Layer + [ARRW] = ACTION_LAYER_TAP_TOGGLE(ARRW), // FN3 - Momentary Arrows Layer +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case SYMB: + ergodox_right_led_1_on(); + break; + case PLVR: + ergodox_right_led_2_on(); + break; + case ARRW: + ergodox_right_led_3_on(); + break; + default: + break; + } +}; diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md new file mode 100644 index 000000000..16cebd091 --- /dev/null +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md @@ -0,0 +1,50 @@ +# Roman's Layout + +There are four layers: + +- **BASE** is [Norman layout](https://normanlayout.info/). +- **SYMB** for numbers and symbols. +- **PLVR** is optimized for [Plover](http://www.openstenoproject.org). +- **ARRW** for navigation (same fingers for arrows as HJKL on QWERTY). + +Looking for IJKL arrows? [Here we +go](../romanzolotarev-norman-plover-osx/). + +[![keyboard-layout](romanzolotarev-norman-plover-osx-hjkl.png)](http://www.keyboard-layout-editor.com/#/gists/56ffedceb0668dda47c993e7271563e0) + +## Switching + +- Tap `SYMB` to toggle **SYMB**. +- Tap `ARRW` to toggle **ARRW**. +- Hold `SYMB` (or `ARRW`) to activate **SYMB** (or **ARRW**) while holding. +- Tap `PLVR` to toggle **PLVR**. + +## LEDs + +- Red: SYMB is on. +- Green: PLVR is on. +- Blue: ARRW is on. + +## Functional Keys + +- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). +- Tap `F2` to copy screenshot to the clipboard. +- Hold `SHIFT` and tap `F2` to save screenshot as a file. +- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). +- Tap `F14`, `F15` to adjust display brightness. + +**IMPORTANT**: If you have another keyboard connected via Bluetooth, then +`F14` and `F15` will not work. Turn off that Bluetooth keyboard. Re-plug +you ErgoDox. Enjoy! + +## CTRL/ESC + +Both of those keys are frequently used in Vim. + +- Tap `CTRL/ESC` to send `ESC`. +- Hold `CTRL/ESC` to use as `CTRL`. + +## Activate N-rollover + +- While in **BASE** hold left `SHIFT` and right `SHIRT` and then tap `N`. +- Then you can activate **PLVR** and use ErgoDox EZ for steno. diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png new file mode 100644 index 000000000..cdc535f79 Binary files /dev/null and b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png differ diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c new file mode 100644 index 000000000..9971b834c --- /dev/null +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c @@ -0,0 +1,134 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 +#define SYMB 1 +#define PLVR 2 +#define ARRW 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = KEYMAP( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14, + KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, TG(PLVR), + CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, + KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_FN1, + // + /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, + /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, + /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, + KC_MPLY, KC_MNXT, + KC_MPRV, + KC_FN3, KC_QUOT, KC_SPC + ), + [SYMB] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + // + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + /*-*/ /*-*/ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + [PLVR] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_C, KC_V, KC_NO, + // + /*-*/ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + /*-*/ KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, + /*-*/ /*-*/ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + /*-*/ KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + /*-*/ /*-*/ /*-*/ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M + ), + [ARRW] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + // + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + [SYMB] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Symbols Layer + [PLVR] = ACTION_LAYER_TAP_TOGGLE(PLVR), // FN2 - Momentary Plover Layer + [ARRW] = ACTION_LAYER_TAP_TOGGLE(ARRW), // FN3 - Momentary Arrows Layer +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case SYMB: + ergodox_right_led_1_on(); + break; + case PLVR: + ergodox_right_led_2_on(); + break; + case ARRW: + ergodox_right_led_3_on(); + break; + default: + break; + } +}; diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/readme.md b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/readme.md new file mode 100644 index 000000000..804c52a76 --- /dev/null +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/readme.md @@ -0,0 +1,50 @@ +# Roman's Layout + +There are four layers: + +- **BASE** is [Norman layout](https://normanlayout.info/). +- **SYMB** for numbers and symbols. +- **PLVR** is optimized for [Plover](http://www.openstenoproject.org). +- **ARRW** for navigation (same fingers for arrows as IJKL on QWERTY). + +Looking for HJKL arrows? [Here we +go](../romanzolotarev-norman-plover-osx-hjkl/). + +[![keyboard-layout](romanzolotarev-norman-plover-osx.png)](http://www.keyboard-layout-editor.com/#/gists/8ebcb701ecb763944417) + +## Switching + +- Tap `SYMB` to toggle **SYMB**. +- Tap `ARRW` to toggle **ARRW**. +- Hold `SYMB` (or `ARRW`) to activate **SYMB** (or **ARRW**) while holding. +- Tap `PLVR` to toggle **PLVR**. + +## LEDs + +- Red: SYMB is on. +- Green: PLVR is on. +- Blue: ARRW is on. + +## Functional Keys + +- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). +- Tap `F2` to copy screenshot to the clipboard. +- Hold `SHIFT` and tap `F2` to save screenshot as a file. +- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). +- Tap `F14`, `F15` to adjust display brightness. + +**IMPORTANT**: If you have another keyboard connected via Bluetooth, then +`F14` and `F15` will not work. Turn off that Bluetooth keyboard. Re-plug +you ErgoDox. Enjoy! + +## CTRL/ESC + +Both of those keys are frequently used in Vim. + +- Tap `CTRL/ESC` to send `ESC`. +- Hold `CTRL/ESC` to use as `CTRL`. + +## Activate N-rollover + +- While in **BASE** hold left `SHIFT` and right `SHIRT` and then tap `N`. +- Then you can activate **PLVR** and use ErgoDox EZ for steno. diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png new file mode 100644 index 000000000..10b0752be Binary files /dev/null and b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png differ diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c new file mode 100644 index 000000000..dedac694e --- /dev/null +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c @@ -0,0 +1,74 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 +#define QWRT 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = KEYMAP( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, + KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_BSLS, + KC_LCTL, KC_A, KC_S, KC_E, KC_T, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, + KC_F1, KC_F2, KC_F3, KC_F4, KC_LGUI, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_LALT, + // + /*-*/ KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + /*-*/ TG(QWRT), KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, + /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, + /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + /*-*/ /*-*/ /*-*/ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + KC_MPLY, KC_MNXT, + KC_MPRV, + KC_RALT, KC_QUOT, KC_SPC + ), + [QWRT] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_E, KC_R, KC_T, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_D, KC_F, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, + /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, + // + /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, + /*-*/ /*-*/ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_TRNS, + /*-*/ KC_TRNS, KC_N, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case QWRT: + ergodox_right_led_1_on(); + break; + default: + break; + } +}; diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/readme.md b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/readme.md new file mode 100644 index 000000000..0e78c130b --- /dev/null +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/readme.md @@ -0,0 +1,34 @@ +# Roman's Layout + +There are two layers: + +- **BASE** is [Norman layout](https://normanlayout.info/). +- **QWRT** is QWERTY. + +[![keyboard-layout](romanzolotarev-norman-qwerty-osx.png)](http://www.keyboard-layout-editor.com/#/gists/3b236f450da474dc506a5a80390c3cc7) + +## Switching + +- Tap `QWRT` to toggle **QWRT**. + +## LEDs + +- Red: QWRT is on. + +## Functional Keys + +- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). +- Tap `F2` to copy screenshot to the clipboard. +- Hold `SHIFT` and tap `F2` to save screenshot as a file. +- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). + +## CTRL/ESC + +Both CTRL and ESC are frequently used in Vim. + +- Tap `CTRL/ESC` to send `ESC`. +- Hold `CTRL/ESC` to use as `CTRL`. + +## Activate N-rollover + +- Hold left `SHIFT` and right `SHIRT` and then tap `N`. diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png new file mode 100644 index 000000000..34762ecb7 Binary files /dev/null and b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png differ diff --git a/keyboards/ergodox/keymaps/sneako/keymap.c b/keyboards/ergodox/keymaps/sneako/keymap.c new file mode 100644 index 000000000..0c6863102 --- /dev/null +++ b/keyboards/ergodox/keymaps/sneako/keymap.c @@ -0,0 +1,187 @@ +// Based on `default_osx` +// Replace left Bksp with Ctrl/Esc +// Remove the Ctrl from Z and / +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/sneako/readme.md b/keyboards/ergodox/keymaps/sneako/readme.md new file mode 100644 index 000000000..8dd110ee6 --- /dev/null +++ b/keyboards/ergodox/keymaps/sneako/readme.md @@ -0,0 +1,6 @@ +# ergodox_keymap + +Based on the default Ergodox EZ firmware + +Replaced the left side Bksp with a Crtl/Esc, this really helps in vim. +Removed the Ctrls from the Z and / keys. diff --git a/keyboards/ergodox/keymaps/software_neo2/keymap.c b/keyboards/ergodox/keymaps/software_neo2/keymap.c new file mode 100644 index 000000000..2eaba0d7d --- /dev/null +++ b/keyboards/ergodox/keymaps/software_neo2/keymap.c @@ -0,0 +1,139 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_neo2.h" + +// Layer names +#define BASE 0 // default layer +#define MDIA 1 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ^ | 1 | 2 | 3 | 4 | 5 | Play | | Next | 6 | 7 | 8 | 9 | 0 |BackSpce| + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | X | V | L | C | W | L1 | | L1 | K | H | G | F | Q | ß | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | U | I | A | E | O |------| |------| S | N | R | T | D | Y | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Ãœ/Ctrl| Ö/C-S| Ä/Alt| P | Z | | | | B | M | , | . | J | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | L1 | Home | PgDn | PgUp | End | | Right| Down | Up | Left | Esc | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------+------+------| |------+--------+------. + * | | |NeoL2 | |NeoL2 | | | + * | Tab |Backsp|------| |------| Space |Enter | + * | |ace |NeoL1 | |NeoL1 | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MPLY, + KC_DELT, NEO_X, NEO_V, NEO_L, NEO_C, NEO_W, TG(1), + KC_CAPS, NEO_U, NEO_I, NEO_A, NEO_E, NEO_O, + KC_LSFT, CTL_T(NEO_UE), C_S_T(NEO_OE), ALT_T(NEO_AE), NEO_P, NEO_Z, ALL_T(KC_NO), + DE_LESS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, + ALT_T(KC_APP),KC_LGUI, + NEO_L2_L, + KC_TAB,KC_BSPC,NEO_L1_L, + // right hand + KC_MNXT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(1), NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, + NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_Y, + MEH_T(KC_NO),NEO_B, NEO_M, KC_COMM, KC_DOT, NEO_J, KC_RSFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ESC, + KC_LALT,CTL_T(KC_ESC), + NEO_L2_R, + NEO_L1_R,KC_SPC, KC_ENT + ), +/* Keymap 1: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | Lclk | MsUp | Rclk | | | | | |VolDwn| Mute |VolUp | | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Btn4 |MsLeft|MsDown|MsRght| Btn5 |------| |------| | Prev | Stop | Play | Next | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |WhRght|WhDown| WhUp |WhLeft|WhClk | | | |BwSrch|BwBack|BwHome|BwRefr|BwFwd | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | |MsAcl0|MsAcl1|MsAcl2| | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | |Brwser|Brwser| + * | Lclk | Rclk |------| |------|Back |Forwd | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, + KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, + KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN3, KC_TRNS, + KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_BTN1, KC_BTN2, KC_TRNS, + // right hand + KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11, + KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_F12, + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, + KC_TRNS, KC_WSCH, KC_WBAK, KC_WHOM, KC_WREF, KC_WFWD, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_WBAK, KC_WFWD +), +}; + +const uint16_t PROGMEM fn_actions[] = { + /* [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) */ +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case MDIA: + ergodox_right_led_2_on(); + break; + default: + ergodox_board_led_off(); + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/supercoder/config_user.h b/keyboards/ergodox/keymaps/supercoder/config_user.h new file mode 100644 index 000000000..8da138372 --- /dev/null +++ b/keyboards/ergodox/keymaps/supercoder/config_user.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H 1 + +#include "config.h" + +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE + +#endif diff --git a/keyboards/ergodox/keymaps/supercoder/images/layout.png b/keyboards/ergodox/keymaps/supercoder/images/layout.png new file mode 100644 index 000000000..c72958c6e Binary files /dev/null and b/keyboards/ergodox/keymaps/supercoder/images/layout.png differ diff --git a/keyboards/ergodox/keymaps/supercoder/images/supercoder_2000.jpg b/keyboards/ergodox/keymaps/supercoder/images/supercoder_2000.jpg new file mode 100644 index 000000000..d690eaf02 Binary files /dev/null and b/keyboards/ergodox/keymaps/supercoder/images/supercoder_2000.jpg differ diff --git a/keyboards/ergodox/keymaps/supercoder/keymap.c b/keyboards/ergodox/keymaps/supercoder/keymap.c new file mode 100644 index 000000000..ca21d30fd --- /dev/null +++ b/keyboards/ergodox/keymaps/supercoder/keymap.c @@ -0,0 +1,75 @@ +/* + * SuperCoder 2000 layout + */ + +#include "ergodox_ez.h" + +/* Layers */ + +#define SC2K 0 // default layer + +/* The Keymap */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Keymap 0: Base Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | 0 | 0 | 0 | 0 | 0 | 0 |------| |------| 1 | 1 | 1 | 1 | 1 | 1 | + * |-----------+------+------+------+------+------| 0 | | 1 |------+------+------+------+------+-----------| + * | 0 | 0 | 0 | 0 | 0 | 0 | | | | 1 | 1 | 1 | 1 | 1 | 1 | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | DONE | DONE | | DONE | DONE | + * ,------|------|------| |------+------+------. + * | | | DONE | | DONE | | | + * | DONE | DONE |------| |------| DONE | DONE | + * | | | DONE | | DONE | | | + * `--------------------' `--------------------' + */ +[SC2K] = KEYMAP( + // left hand + KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 +,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 +,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 +,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 +,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 + + ,KC_ENT ,KC_ENT + ,KC_ENT + ,KC_ENT ,KC_ENT ,KC_ENT + + // right hand + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 + + ,KC_ENT ,KC_ENT + ,KC_ENT + ,KC_ENT ,KC_ENT ,KC_ENT + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +} diff --git a/keyboards/ergodox/keymaps/supercoder/makefile.mk b/keyboards/ergodox/keymaps/supercoder/makefile.mk new file mode 100644 index 000000000..41a195d9c --- /dev/null +++ b/keyboards/ergodox/keymaps/supercoder/makefile.mk @@ -0,0 +1,6 @@ +BOOTMAGIC_ENABLE=no +COMMAND_ENABLE=no +SLEEP_LED_ENABLE=no +UNICODE_ENABLE=no +MOUSEKEY_ENABLE=no +EXTRAKEY_ENABLE=no diff --git a/keyboards/ergodox/keymaps/supercoder/readme.md b/keyboards/ergodox/keymaps/supercoder/readme.md new file mode 100644 index 000000000..97bf7f583 --- /dev/null +++ b/keyboards/ergodox/keymaps/supercoder/readme.md @@ -0,0 +1,29 @@ +SuperCoder 2000 layout for the ErgoDox +================================================== + +![SuperCoder 2000](images/supercoder_2000.jpg) + +Ever found yourself in need of entering binary codes rapidly? Ever wanted to use +all ten fingers to do so? Ever felt your SuperCoder 2000 too limiting, by only +having three buttons? We heard you! With this layout for the ErgoDox EZ, you +will be able to tap in binary at an unparalleled speed and accuracy! Efficiency +never seen before! + +Behold the Ultimate SuperCoder 2000 layout! + +![SuperCoder layout](images/layout.png) + +### To use it... + +To use this piece of top quality engineering, you can either +[download the hex file][hex] we have prepared for you, or you can compile it on +your own: + + [hex]: https://raw.githubusercontent.com/algernon/ergodox-supercoder/master/supercoder.hex + +``` +$ git clone https://github.com/jackhumbert/qmk_firmware.git +$ cd qmk_firmware/keyboards/ergodox_ez +$ git clone https://github.com/algernon/ergodox-supercoder.git keymaps/supercoder +$ make KEYMAP=supercoder +``` diff --git a/keyboards/ergodox/keymaps/techtomas/keymap.c b/keyboards/ergodox/keymaps/techtomas/keymap.c new file mode 100644 index 000000000..1ff6618b9 --- /dev/null +++ b/keyboards/ergodox/keymaps/techtomas/keymap.c @@ -0,0 +1,231 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define APP 2 // app layer +#define CNTL 3 // control layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | L2/` | 1 | 2 | 3 | 4 | 5 |CmdSpc| | - | 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | MEH/Tab| Q | W | E | R | T | [ | | ] | Y | U | I | O | P | MEH/\ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Hyp/Esc | A | S | D | F | G |------| |------| H | J | K | L | L2/; | Hyp/' | + * |--------+------+------+------+------+------| Tab | | STab |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | L2// | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |L1/Lft|L3/Rht| LCtl | LAlt | LGui | | Rgui | Up | Dn | L3 | L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCtl | LGui | |AltGui|ShfGui| + * ,-------|------|------| |------+--------+------. + * | | |L1/Hom| |L2/PUp| | | + * | Backsp|Delete|------| |------| Enter | Space | + * | | |L3/End| |L1/PDn| | | + * `--------------------' `-----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + LT(APP,KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), + MEH_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, + ALL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TAB, + LT(SYMB,KC_LEFT), LT(CNTL,KC_RIGHT), KC_LCTL, KC_LALT, KC_LGUI, + KC_LCTL, KC_LGUI, + LT(SYMB,KC_HOME), + KC_BSPC, KC_DELETE, LT(CNTL,KC_END), + // right hand + KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, MEH_T(KC_BSLS), + KC_H, KC_J, KC_K, KC_L, LT(APP,KC_SCLN), ALL_T(KC_QUOT), + S(KC_TAB), KC_N, KC_M, KC_COMM, KC_DOT, LT(APP,KC_SLSH), KC_RSFT, + KC_RGUI, KC_UP, KC_DOWN, KC_FN3, KC_FN1, + LALT(KC_LGUI), S(KC_LGUI), + LT(APP,KC_PGUP), + LT(SYMB,KC_PGDN), KC_ENT, KC_SPC + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | Tab | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | < | | > | : | 7 | 8 | 9 | / | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| ; | 4 | 5 | 6 | * | | + * |--------+------+------+------+------+------| F14 | | F15 |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | - | Entr | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | 0 | . | = | + | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,S(KC_COMM), + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_F14, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TAB, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + S(KC_DOT), KC_COLN, KC_7, KC_8, KC_9, KC_BSLS, KC_F12, + KC_SCLN, KC_4, KC_5, KC_6, KC_ASTR, KC_TRNS, + KC_F15, KC_AMPR, KC_1, KC_2, KC_3, KC_MINS, KC_ENT, + KC_0, KC_DOT, KC_EQL, KC_PLUS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: App Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | CmdQ | CmdW | | | | Stab | | Play | Prev | Next | | |PrtSc | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| VolDn|VolUp | | | | | + * |--------+------+------+------+------+------| | | Mute |------+------+------+------+------+--------| + * | | CmdZ | CmdX | CmdC | CmdY | CtrlC| | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// Control +[APP] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, LGUI(KC_Q), LGUI(KC_W), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_TAB), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), LCTL(KC_C), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, + KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 3: Control Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Pwr | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| Lclk |------| |------| Lft | Down | Up | Right| | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | Rclk | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Shift| | | Home | End | + * ,------|------|------| |------+------+------. + * | | | LAtl | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// Control +[CNTL] = KEYMAP( + KC_PWR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LSFT, KC_TRNS, + KC_LALT, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_HOME, KC_END, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), + [2] = ACTION_LAYER_TAP_TOGGLE(APP), + [3] = ACTION_LAYER_TAP_TOGGLE(CNTL) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/techtomas/readme.md b/keyboards/ergodox/keymaps/techtomas/readme.md new file mode 100644 index 000000000..36e0591a8 --- /dev/null +++ b/keyboards/ergodox/keymaps/techtomas/readme.md @@ -0,0 +1,57 @@ +# Techtomas Configuration + +## Base Layer + +The base layer is a merge of what I liked with the default layout and the ordinary layout. The thumb cluster is more like the Kinesis advantage and the top row of the cluster is convient for use on the mac. + +* The Caps Lock postion handles [Hyper/Esc](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) +* The Tab key toggles MEH. +* The top vertical mods on the left and right are [ and ]. +* The bottom vertical mods on the left and right are tab and shift+tab +* The HYPER and MEH key are made in the same location on the right side of the board as well. Using Keyboard Maestro for OS X makes one-handed shortcuts very easy. +* Layer switching is focused around the thumb clusters plus some additional locations for convience. + +## Symbol Layer +The symbol layer can be tap/toggled with the bottom right key and also toggled on the thumb clusters. + +The bottom two vertical mods are set to F14 and F15 which is the default for changing screen brightness on the mac + +## App Layer +The app layer is used to control media playback and also some application shortcuts (OS X Focused). +It can be toggled on the left board in the top left corner (tilde/grave) or using your pinky on the right side of the board using either ; or /. +There is one additional toggle on the right thumb cluster for quick access to play and mute key combos. + +### Current App shortcuts defined +* Q = CMD+Q +* W = CMD+W +* Z = CMD+Z +* X = CMD+X +* C = CMD+C +* V = CMD+V +* B = CTRL+C +* P = Print Screen + +## Control Layer +The control layer is meant to help easily navigate and select text. It can also be stacked ontop of the Symbol layer when needed. + +The right arrow key and End key toggle the control layer on the left board. There is also a tap toggle for the layer in the same position on the right side of the board. + +On the left board you have mouse control with left & right click in the location of the G and B keys. +On the right board you have vim-style arrow keys using hjkl + +The left thumb cluster moves shift and alt within easy reach while holding the toggle (end). So far I've found this convient to navigate and skip around text when using the hjkl arrow keys. I found that it was easy to get the alt key stuck on depending on what key you released first so I added the PREVENT_STUCK_MODIFIERS to the config.h to help with that. + +## Changelog + +* May 4th, 2016 (v1.2): + * Moved layer toggles around to match my habbits of typing + * Enabled Prevent Stuck Modifers in my config.h (L3 + Alt on cluster would get stuck) + * Changed media layer to be more like an app layer with some quick shortcuts (mac centric) + * Moved around the base layer arrow keys so mod keys were more accesible + +* Apr 29, 2016 (V1.1): + * Added F14 and F15 to symbol layer + * Added control layer toggle to A key. + +* Apr 28, 2016 (V1.0): + * Modified config based on the default layout plus inspiration from the ordinary layout diff --git a/keyboards/ergodox/keymaps/teckinesis/keymap.c b/keyboards/ergodox/keymaps/teckinesis/keymap.c new file mode 100644 index 000000000..ec6ceb96b --- /dev/null +++ b/keyboards/ergodox/keymaps/teckinesis/keymap.c @@ -0,0 +1,455 @@ +#include "ergodox_ez.h" +#include "led.h" +#include "debug.h" +#include "action_layer.h" +#include "action_util.h" +#include "mousekey.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols layer +#define MDIA 2 // media layer +#define SPEC 3 // special layer + +#define LCaps 10 // left caps-shift key +#define LSymb 11 // left symbol-shift key +#define LMdia 12 // left media-shift key +#define LSpec 13 // left special-shift key +#define RCaps 14 // right caps-shift key +#define RSymb 15 // right symbol-shift key +#define RMdia 16 // right media-shift key +#define RSpec 17 // right special-shift key + +#define MUL 20 // mouse up left +#define MUR 21 // mouse up right +#define MDL 22 // mouse down left +#define MDR 23 // mouse down right + +/* + * teckinesis layout for ErgoDox (EZ) + * + * Modifications from The Ordinary Layout v4 by Will Wolff-Myren willwm@gmail.com + * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com + * + * No rights reserved. This software is in the public domain. + * Credit me if you are friendly but if you're a jerk don't bother. + * + * Details: readme.md + * https://github.com/willwm/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/teckinesis + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/******* Base Layer ******************************************************************************************************** + * + * ,------------------------------------------------------. ,------------------------------------------------------. + * | Special =+ | 1 | 2 | 3 | 4 | 5 | ESC | | ` | 6 | 7 | 8 | 9 | 0 | -_ Special | + * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| + * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | + * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| + * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | + * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| + * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | + * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' + * | LCtrl |Meh/\ |Hypr//| LAlt | LGui | | RGui | RAlt |Hypr/[|Meh/] | RCtrl | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | Home | End | | Left | Right| + * ,------|------|------| |------+------+------. + * | | | PgUp | | Up | | | + * |Backsp| Del |------| |------| Enter| Space| + * | | | PgDn | | Down | | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// left hand + F(LSpec),KC_1,KC_2,KC_3 ,KC_4 ,KC_5 ,KC_ESC +,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC +,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G +,M(LCaps) ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) +,KC_LCTL,MEH_T(KC_BSLS),ALL_T(KC_SLSH),KC_LALT,KC_LGUI + ,KC_HOME,KC_END + ,KC_PGUP + ,KC_BSPC,KC_DEL ,KC_PGDN + // right hand + ,KC_GRV ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) + ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) + ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) + ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) + ,KC_RGUI,KC_RALT,ALL_T(KC_LBRC),MEH_T(KC_RBRC),KC_RCTL + ,KC_LEFT ,KC_RGHT + ,KC_UP + ,KC_DOWN ,KC_ENT ,KC_SPC + ), + +/******* Symbols Layer ***************************************************************************************************** + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | + * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| + * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | LCtrl | Meh |Hyper | LAlt | LGui | |RGui/0|RAlt/.|Hypr/=|Meh/+ |RCtrl/Ent| + * `-----------------------------------' `-------------------------------------' + * ,-------------. ,-------------. + * | Left | Right| | Home | End | + * ,------|------|------| |------+------+------. + * | | | Up | | PgUp | | | + * |Space |Enter |------| |------|BackSp| Del | + * | | | Down | | PgDn | | | + * `--------------------' `--------------------' + */ +[SYMB] = KEYMAP( +// left hand + KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC +,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) +,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV +,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB +,KC_LCTL ,KC_MEH ,KC_HYPR ,KC_LALT ,KC_LGUI + ,KC_LEFT ,KC_RGHT + ,KC_UP + ,KC_SPC ,KC_ENT ,KC_DOWN + // right hand + ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS + ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS + ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS + ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS + ,GUI_T(KC_0),ALT_T(KC_DOT),ALL_T(KC_EQL),MEH_T(KC_PLUS),CTL_T(KC_ENT) + ,KC_HOME ,KC_END + ,KC_PGUP + ,KC_PGDN ,KC_BSPC ,KC_DEL +), + +/******* Media Layer ******************************************************************************************************* + * + * ,---------------------------------------------------------------. ,---------------------------------------------------------------. + * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | + * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| + * | | |MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | | | + * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| + * | | |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | | | + * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| + * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | + * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' + * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| + * `---------------------------------------------' `---------------------------------------------' + * ,-------------. ,-------------. + * | Stop |Refrsh| | Prev | Next | + * ,------|------|------| |------+------+------. + * |Brwser|Brwser|Search| |VolUp | | | + * |Back | Fwd |------| |------| Stop | Play-| + * | | | Home | |VolDn | | Pause| + * `--------------------' `--------------------' + */ +[MDIA] = KEYMAP( +// left hand + KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC +,KC_TRNS ,KC_NO ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U +,KC_TRNS ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD +,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D +,KC_LCTL ,KC_MEH ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 + ,KC_WSTP ,KC_WREF + ,KC_WSCH + ,KC_WBAK ,KC_NO ,KC_WHOM + // right hand + ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS + ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_TRNS + ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO ,KC_TRNS + ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS + ,GUI_T(KC_INS),ALT_T(KC_DEL),KC_HYPR ,KC_MEH ,KC_RCTL + ,KC_MPRV ,KC_MNXT + ,KC_VOLU + ,KC_VOLD ,KC_MSTP ,KC_MPLY +), + +/******* Special Layer ***************************************************************************************************** + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | Esc | | | | | | | | | | | | Bspc | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | RShift | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[SPEC] = KEYMAP( +// left hand + KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS,KC_TRNS ,KC_TRNS + // right hand + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_BSPC ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_RSFT + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + // the faux shift keys are implemented as macro taps + [LCaps] = ACTION_MACRO_TAP(LCaps) + ,[LSymb] = ACTION_MACRO_TAP(LSymb) + ,[LMdia] = ACTION_MACRO_TAP(LMdia) + ,[LSpec] = ACTION_MACRO_TAP(LSpec) + ,[RCaps] = ACTION_MACRO_TAP(RCaps) + ,[RSymb] = ACTION_MACRO_TAP(RSymb) + ,[RMdia] = ACTION_MACRO_TAP(RMdia) + ,[RSpec] = ACTION_MACRO_TAP(RSpec) +}; + +uint16_t caps_shift = 0; +uint16_t symb_shift = 0; +uint16_t mdia_shift = 0; + +bool symb_lock = false; +bool mdia_lock = false; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + // There are two shift keys for each layer so we increment a layer_shift var when one + // is pressed and decrement when one is released. If both are pressed at the same time + // then the layer is locked (or unlocked). The shift counts are bound between 0 and 2 + // only because sometimes rapid pressing led to irregular events; this way the states + // are self healing during use. + + case LCaps: // both caps-shift keys trigger Left Shift + case RCaps: // so they don't interfere with the magic combo + if (record->event.pressed && !record->tap.count) { + if(++caps_shift > 2) caps_shift = 2; + if(caps_shift == 2) { + register_code(KC_CAPS); + unregister_code(KC_CAPS); + } else if(caps_shift == 1) { + register_code(KC_LSFT); + } + } else { + if(--caps_shift < 0) caps_shift = 0; + if(caps_shift == 0) unregister_code(KC_LSFT); + } + break; + + case LSymb: + if (record->event.pressed) { + if(++symb_shift > 2) symb_shift = 2; + if(symb_shift == 2) { + symb_lock = !symb_lock; + } else if(symb_shift == 1) { + layer_on(SYMB); + } + } else { + if(--symb_shift < 0) symb_shift = 0; + if((symb_shift == 0) && (!symb_lock)) layer_off(SYMB); + } + break; + + case LMdia: + if (record->event.pressed) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + register_code(KC_TAB); + } else { + if(++mdia_shift > 2) mdia_shift = 2; + if(mdia_shift == 2) { + mdia_lock = !mdia_lock; + } else if(mdia_shift == 1) { + layer_on(MDIA); + } + } + } else { + if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + unregister_code(KC_TAB); + } else { + if(--mdia_shift < 0) mdia_shift = 0; + if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); + } + } + break; + + case LSpec: + if (record->event.pressed) { + if (record->tap.count && !record->tap.interrupted) { + register_code(KC_EQL); + } else { + layer_on(SPEC); + } + } else { + if(record->tap.count && !record->tap.interrupted) { + unregister_code(KC_EQL); + } else { + layer_off(SPEC); + } + } + break; + + case RSymb: + if (record->event.pressed) { + if (record->tap.count && (!symb_shift) && (!symb_lock)) { + register_code(KC_QUOT); + } else { + if(++symb_shift > 2) symb_shift = 2; + if(symb_shift == 2) { + symb_lock = !symb_lock; + } else if(symb_shift == 1) { + layer_on(SYMB); + } + } + } else { + if(record->tap.count && symb_shift == 0) { + unregister_code(KC_QUOT); + } else { + if(--symb_shift < 0) symb_shift = 0; + if((!symb_shift) && (!symb_lock)) layer_off(SYMB); + } + } + break; + + case RMdia: + if (record->event.pressed) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + register_code(KC_BSLS); + } else { + if(++mdia_shift > 2) mdia_shift = 2; + if(mdia_shift == 2) { + mdia_lock = !mdia_lock; + } else if(mdia_shift == 1) { + layer_on(MDIA); + } + } + } else { + if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + unregister_code(KC_BSLS); + } else { + if(--mdia_shift < 0) mdia_shift = 0; + if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); + } + } + break; + + case RSpec: + if (record->event.pressed) { + if (record->tap.count && !record->tap.interrupted) { + register_code(KC_MINS); + } else { + layer_on(SPEC); + } + } else { + if(record->tap.count && !record->tap.interrupted) { + unregister_code(KC_MINS); + } else { + layer_off(SPEC); + } + } + break; + + // mouse diagonals + + case MUL: // mouse up left + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + mousekey_send(); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + mousekey_send(); + } + break; + + case MUR: // mouse up right + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + mousekey_send(); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + mousekey_send(); + } + break; + + case MDL: // mouse down left + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + mousekey_send(); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + mousekey_send(); + } + break; + + case MDR: // mouse down right + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + mousekey_send(); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + mousekey_send(); + } + break; + + default: + // none + break; + } + + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + // shift or caps lock turns on red light + if(caps_shift || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<\n\n\n\nShift", + { + "c": "#cccccc" + }, + "Q", + { + "x": 14.5 + }, + "P", + { + "c": "#2277ff", + "f": 3, + "w": 1.5 + }, + "|\n\\\nMedia\n\n\n\n\nShift" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#cccccc" + }, + "D", + { + "x": 10.5 + }, + "K" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "S", + { + "x": 1 + }, + "F", + { + "x": 8.5 + }, + "J", + { + "x": 1 + }, + "L" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "G", + { + "x": 6.5 + }, + "H" + ], + [ + { + "y": -0.875, + "c": "#2277ff", + "w": 1.5 + }, + "Symbols\n\n\n\n\n\nShift", + { + "c": "#cccccc" + }, + "A", + { + "x": 14.5 + }, + ":\n;", + { + "c": "#2277ff", + "f": 3, + "w": 1.5 + }, + "\"\n'\nSymbols\n\n\n\n\nShift" + ], + [ + { + "y": -0.625, + "x": 6.5, + "c": "#54d6de", + "fa": [ + 0, + 0, + 4, + 1 + ], + "h": 1.5 + }, + "< Tab\n\n\nShift Tab", + { + "x": 4.5, + "h": 1.5 + }, + "Tab >\n\n\nTab" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#cccccc" + }, + "C", + { + "x": 10.5 + }, + "<\n," + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "X", + { + "x": 1 + }, + "V", + { + "x": 8.5 + }, + "M", + { + "x": 1 + }, + ">\n." + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "B", + { + "x": 6.5 + }, + "N" + ], + [ + { + "y": -0.875, + "c": "#2277ff", + "w": 1.5 + }, + "Capitals\n\n\n\n\n\nShift", + { + "c": "#cccccc" + }, + "Z", + { + "x": 14.5 + }, + "?\n/", + { + "c": "#2277ff", + "f": 3, + "w": 1.5 + }, + "\n\nCapitals\n\n\n\n\nShift" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#77aaff", + "fa": [ + 5, + 0, + 4, + 1 + ] + }, + "\n\n\nLAlt", + { + "x": 10.5 + }, + "\n\n\nRAlt" + ], + [ + { + "y": -0.875, + "x": 2.5, + "fa": [ + 5, + 1 + ] + }, + "\nHyper\n?\n/", + { + "x": 1, + "fa": [ + 5, + 1, + 0, + 1 + ] + }, + "\n\n\nSuper", + { + "x": 8.5 + }, + "\n\n\nSuper", + { + "x": 1, + "fa": [ + 0, + 0, + 0, + 1 + ] + }, + "{\n[\n\nHyper" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "Ctrl\n\n\nLCtrl", + { + "f2": 1 + }, + "\nMeh\n|\n\\", + { + "x": 14.5, + "fa": [ + 0, + 0, + 1, + 1 + ] + }, + "}\n]\n\nMeh", + "Ctrl\n\n\nRCtrl" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#54d6de" + }, + "Home", + "End" + ], + [ + { + "h": 2 + }, + "< Del\n\n\nBackspace", + { + "h": 2 + }, + "Del >\n\n\nDelete", + "Page\n\n\n\n\n\nUp" + ], + [ + { + "x": 2 + }, + "Page\n\n\n\n\n\nDown" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3 + }, + "Left", + "Right" + ], + [ + { + "x": -3 + }, + "Up", + { + "h": 2 + }, + "Enter", + { + "h": 2 + }, + "Space" + ], + [ + { + "x": -3 + }, + "Down" + ] +] \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/teckinesis/teckinesis-base.png b/keyboards/ergodox/keymaps/teckinesis/teckinesis-base.png new file mode 100644 index 000000000..7c4584e9f Binary files /dev/null and b/keyboards/ergodox/keymaps/teckinesis/teckinesis-base.png differ diff --git a/keyboards/ergodox/keymaps/teckinesis/teckinesis-media.json b/keyboards/ergodox/keymaps/teckinesis/teckinesis-media.json new file mode 100644 index 000000000..65fe394e8 --- /dev/null +++ b/keyboards/ergodox/keymaps/teckinesis/teckinesis-media.json @@ -0,0 +1,436 @@ +[ + { + "name": "teckinesis (MediaLayer)", + "author": "Will Wolff-Myren", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea" + }, + [ + { + "x": 3.5, + "c": "#99de2a" + }, + "F13", + { + "x": 10.5 + }, + "F18" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "F12", + { + "x": 1 + }, + "F14", + { + "x": 8.5 + }, + "F17", + { + "x": 1 + }, + "F19" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "F15", + { + "c": "#ff4444" + }, + "Esc", + { + "x": 4.5 + }, + "Esc", + { + "c": "#99de2a" + }, + "F16" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "F11", + { + "x": 14.5 + }, + "F20" + ], + [ + { + "y": -0.995, + "c": "#000000", + "t": "#ff0000", + "w": 1.5 + }, + "Media\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nMedia\n\n\n\n\nShift" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#ff8500", + "t": "#000000" + }, + "Mouse\n\n\n\n\n\nUp", + { + "x": 10.5 + }, + "Cursor\n\n\n\n\n\nUp" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "Mouse\n\n\n\n\n\nUpLeft", + { + "x": 1 + }, + "Mouse\n\n\n\n\n\nUpRgt", + { + "x": 8.5, + "c": "#ffb063" + }, + "Home", + { + "x": 1 + }, + "Page\n\n\n\n\n\nUp" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#e6e067" + }, + "Vol\n\n\n\n\n\nUp", + { + "c": "#ffb063", + "h": 1.5 + }, + "Scroll\n\n\n\n\n\nUp", + { + "x": 4.5, + "h": 1.5 + }, + "Scroll\n\n\n\n\n\nUp", + { + "c": "#e6e067" + }, + "Print\n\n\n\n\n\nScreen" + ], + [ + { + "y": -0.875, + "x": 1.5, + "c": "#737373", + "a": 7 + }, + "", + { + "x": 14.5 + }, + "" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "a": 4, + "w": 1.5 + }, + "Symbols\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nSymbols\n\n\n\n\nShift" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#ff8500" + }, + "Mouse\n\n\n\n\n\nDown", + { + "x": 10.5 + }, + "Cursor\n\n\n\n\n\nDown" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "Mouse\n\n\n\n\n\nLeft", + { + "x": 1 + }, + "Mouse\n\n\n\n\n\nRight", + { + "x": 8.5 + }, + "Cursor\n\n\n\n\n\nLeft", + { + "x": 1 + }, + "Cursor\n\n\n\n\n\nRight" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#e6e067" + }, + "Vol\n\n\n\n\n\nDown", + { + "x": 6.5 + }, + "Num\n\n\n\n\n\nLock" + ], + [ + { + "y": -0.875, + "x": 1.5, + "c": "#737373", + "a": 7 + }, + "", + { + "x": 14.5 + }, + "" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "a": 4, + "w": 1.5 + }, + "Capitals\n\n\n\n\n\nShift", + { + "x": 16.5, + "w": 1.5 + }, + "\n\nCapitals\n\n\n\n\nShift" + ], + [ + { + "y": -0.6299999999999999, + "x": 6.5, + "c": "#ffb063", + "h": 1.5 + }, + "Scroll\n\n\n\n\n\nDown", + { + "x": 4.5, + "h": 1.5 + }, + "Scroll\n\n\n\n\n\nDown" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#ff8500" + }, + "Mouse\n\n\n\n\n\nDown", + { + "x": 10.5 + }, + "Cursor\n\n\n\n\n\nDown" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "Mouse\n\n\n\n\n\nDnLeft", + { + "x": 1 + }, + "Mouse\n\n\n\n\n\nDnRgt", + { + "x": 8.5, + "c": "#ffb063" + }, + "End", + { + "x": 1 + }, + "Page\n\n\n\n\n\nDown" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#e6e067" + }, + "Mute", + { + "x": 6.5, + "c": "#737373", + "a": 7 + }, + "" + ], + [ + { + "y": -0.875, + "x": 1.5 + }, + "", + { + "x": 14.5 + }, + "" + ], + [ + { + "y": -0.9950000000000001, + "c": "#2277ff", + "a": 4, + "w": 1.5 + }, + "Ctrl", + { + "x": 16.5, + "w": 1.5 + }, + "Ctrl" + ], + [ + { + "y": -0.3799999999999999, + "x": 3.5, + "c": "#ff8500" + }, + "Middle\n\n\n\n\n\nClick", + { + "x": 10.5, + "c": "#ffb063", + "fa": [ + 0, + 0, + 0, + 1 + ] + }, + "Delete\n\n\nOption" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#ff8500" + }, + "Left\n\n\n\n\n\nClick", + { + "x": 1 + }, + "Right\n\n\n\n\n\nClick", + { + "x": 8.5, + "c": "#ffb063" + }, + "Insert\n\n\nCmd", + { + "x": 1, + "c": "#77aaff" + }, + "Hyper" + ], + [ + { + "y": -0.75, + "x": 0.5 + }, + "Alt\n\n\nLAlt", + "Meh", + { + "x": 14.5 + }, + "Meh", + "Alt\n\n\nRAlt" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#ccbb00" + }, + "Stop\n\n\nBrowser", + "Reload\n\n\nBrowser" + ], + [ + { + "h": 2 + }, + "< Web\n\n\nBrowser", + { + "h": 2 + }, + "Web >\n\n\nBrowser", + "Search\n\n\nBrowser" + ], + [ + { + "x": 2 + }, + "Home\n\n\nBrowser" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3 + }, + "Prev\n\n\nAudio\n\n\nTrack", + "Next\n\n\nAudio\n\n\nTrack" + ], + [ + { + "x": -3, + "c": "#e6e067" + }, + "Vol\n\n\n\n\n\nUp", + { + "c": "#ccbb00", + "h": 2 + }, + "Stop\n\n\nAudio", + { + "h": 2 + }, + "Play\n\n\nAudio\n\n\nPause" + ], + [ + { + "x": -3, + "c": "#e6e067" + }, + "Vol\n\n\n\n\n\nDown" + ] +] \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/teckinesis/teckinesis-media.png b/keyboards/ergodox/keymaps/teckinesis/teckinesis-media.png new file mode 100644 index 000000000..cc51605f9 Binary files /dev/null and b/keyboards/ergodox/keymaps/teckinesis/teckinesis-media.png differ diff --git a/keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.json b/keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.json new file mode 100644 index 000000000..439d0128e --- /dev/null +++ b/keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.json @@ -0,0 +1,422 @@ +[ + { + "name": "teckinesis (Symbol Layer)", + "author": "Will Wolff-Myren", + "switchMount": "cherry", + "switchBrand": "gateron", + "switchType": "KS-3-Tea" + }, + [ + { + "x": 3.5, + "c": "#99de2a" + }, + "F3", + { + "x": 10.5 + }, + "F8" + ], + [ + { + "y": -0.875, + "x": 2.5 + }, + "F2", + { + "x": 1 + }, + "F4", + { + "x": 8.5 + }, + "F7", + { + "x": 1 + }, + "F9" + ], + [ + { + "y": -0.875, + "x": 5.5 + }, + "F5", + { + "c": "#ff4444" + }, + "Esc", + { + "x": 4.5, + "c": "#bbddbb" + }, + "_\n\n\n\n\n\n-", + { + "c": "#99de2a" + }, + "F6" + ], + [ + { + "y": -0.875, + "c": "#2277ff", + "w": 1.5 + }, + "Special\n\n\n\n\n\nShift", + { + "c": "#99de2a" + }, + "F1", + { + "x": 14.5 + }, + "F10", + { + "c": "#2277ff", + "w": 1.5 + }, + "\n\nSpecial\n\n\n\n\nShift" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#bbddbb" + }, + "{", + { + "x": 10.5, + "c": "#89b087" + }, + "8" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bbddbb" + }, + "@", + { + "x": 1 + }, + "}", + { + "x": 8.5, + "c": "#89b087" + }, + "7", + { + "x": 1 + }, + "9" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#bbddbb" + }, + "&", + { + "h": 1.5 + }, + "<", + { + "x": 4.5, + "h": 1.5 + }, + ">", + "|" + ], + [ + { + "y": -0.875, + "c": "#2277ff", + "w": 1.5 + }, + "Media\n\n\n\n\n\nShift", + { + "c": "#bbddbb" + }, + "!", + { + "x": 14.5, + "c": "#89b087" + }, + "/", + { + "c": "#2277ff", + "w": 1.5 + }, + "\n\nMedia\n\n\n\n\nShift" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#bbddbb" + }, + "(", + { + "x": 10.5, + "c": "#89b087" + }, + "5" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bbddbb" + }, + "$", + { + "x": 1 + }, + ")", + { + "x": 8.5, + "c": "#89b087" + }, + "4", + { + "x": 1 + }, + "6" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#bbddbb" + }, + "`", + { + "x": 6.5 + }, + "/" + ], + [ + { + "y": -0.875, + "c": "#000000", + "t": "#ff0000", + "w": 1.5 + }, + "Symbols\n\n\n\n\n\nShift", + { + "c": "#bbddbb", + "t": "#000000" + }, + "#", + { + "x": 14.5, + "c": "#89b087" + }, + "*", + { + "c": "#000000", + "t": "#ff0000", + "w": 1.5 + }, + "\n\nSymbols\n\n\n\n\nShift" + ], + [ + { + "y": -0.625, + "x": 6.5, + "c": "#54d6de", + "t": "#000000", + "fa": [ + 0, + 0, + 0, + 1 + ], + "h": 1.5 + }, + "Tab >\n\n\nTab", + { + "x": 4.5, + "h": 1.5 + }, + "< Tab\n\n\nShift Tab" + ], + [ + { + "y": -0.75, + "x": 3.5, + "c": "#bbddbb" + }, + "[", + { + "x": 10.5, + "c": "#89b087" + }, + "2" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#bbddbb" + }, + "^", + { + "x": 1 + }, + "]", + { + "x": 8.5, + "c": "#89b087" + }, + "1", + { + "x": 1 + }, + "3" + ], + [ + { + "y": -0.875, + "x": 5.5, + "c": "#bbddbb" + }, + "~", + { + "x": 6.5 + }, + "\\" + ], + [ + { + "y": -0.875, + "c": "#2277ff", + "w": 1.5 + }, + "Capitals\n\n\n\n\n\nShift", + { + "c": "#bbddbb" + }, + "%", + { + "x": 14.5, + "c": "#89b087" + }, + "-", + { + "c": "#2277ff", + "w": 1.5 + }, + "\n\nCapitals\n\n\n\n\nShift" + ], + [ + { + "y": -0.375, + "x": 3.5, + "c": "#77aaff" + }, + "\n\n\nLAlt", + { + "x": 10.5, + "c": "#89b087" + }, + ".\n\n\nOption" + ], + [ + { + "y": -0.875, + "x": 2.5, + "c": "#77aaff" + }, + "Hyper", + { + "x": 1 + }, + "\n\n\nSuper", + { + "x": 8.5, + "c": "#89b087" + }, + "0\n\n\nCmd", + { + "x": 1 + }, + "=\n\n\nHyper" + ], + [ + { + "y": -0.75, + "x": 0.5, + "c": "#77aaff" + }, + "Ctrl\n\n\nLCtrl", + "Meh", + { + "x": 14.5, + "c": "#89b087" + }, + "+\n\n\nMeh", + "Enter\n\n\nCtrl" + ], + [ + { + "r": 30, + "rx": 6.5, + "ry": 4.25, + "y": -1, + "x": 1, + "c": "#54d6de" + }, + "Left", + "Right" + ], + [ + { + "h": 2 + }, + "Space", + { + "h": 2 + }, + "Enter", + "Up" + ], + [ + { + "x": 2 + }, + "Down" + ], + [ + { + "r": -30, + "rx": 13, + "y": -1, + "x": -3 + }, + "Home", + "End" + ], + [ + { + "x": -3 + }, + "Page\n\n\n\n\n\nUp", + { + "h": 2 + }, + "< Del\n\n\nBackspace", + { + "h": 2 + }, + "Del >\n\n\nDelete" + ], + [ + { + "x": -3 + }, + "Page\n\n\n\n\n\nDown" + ] +] \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.png b/keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.png new file mode 100644 index 000000000..7ca86cf47 Binary files /dev/null and b/keyboards/ergodox/keymaps/teckinesis/teckinesis-symbol.png differ diff --git a/keyboards/ergodox/keymaps/tkuichooseyou/README.md b/keyboards/ergodox/keymaps/tkuichooseyou/README.md new file mode 100644 index 000000000..ab02fac2c --- /dev/null +++ b/keyboards/ergodox/keymaps/tkuichooseyou/README.md @@ -0,0 +1,13 @@ +# Based on Default OSX +I'm a vim and OSX user + +- Moved Hyper and Meh up, replaced with CMD + - Because I'm used to having symmetrical CMD keys on both hands +- Changed left delete to Tab to match OSX +- Changed left Backspace to CTRL/ESC for vim +- Changed top left and top right arrow to `CMD+{` and `CMD+}` + - Useful for switching tabs in Safari, Xcode, etc. +- Remove the Ctrl from Z and / +- Remove CMD from right quote +- Changed right Alt to Delete + diff --git a/keyboards/ergodox/keymaps/tkuichooseyou/compiled.hex b/keyboards/ergodox/keymaps/tkuichooseyou/compiled.hex new file mode 100644 index 000000000..a8cf4527a --- /dev/null +++ b/keyboards/ergodox/keymaps/tkuichooseyou/compiled.hex @@ -0,0 +1,1137 @@ +:100000000C947B020C94C2020C94C2020C94C202A7 +:100010000C94C2020C94C2020C94C2020C94C20250 +:100020000C94C2020C94C2020C94F70D0C94C90EED +:100030000C94C2020C94C2020C94C2020C94C20230 +:100040000C94C2020C9486210C94C2020C94C2023D +:100050000C94C2020C94681C0C94C2020C94C20250 +:100060000C94C2020C94C2020C94C2020C94C20200 +:100070000C94C2020C94C2020C94C2020C94C202F0 +:100080000C94C2020C94C2020C94C2020C94C202E0 +:100090000C94C2020C94C2020C94C2020C94C202D0 +:1000A0000C94C2020C94C2020C94C202360F580F78 +:1000B0004610580F46109D0FC00F461015102810FF +:1000C000F712F712261326135C137C13AD14AD142C +:1000D0008713AD14371437149E14AD14AD14A71440 +:1000E0004414441444144414441444144414441450 +:1000F0004414441444144414441444144414441440 +:10010000561463146A1471147B140000F0A12E00BD +:100110002B002961E100354100001E00140004009D +:100120001D0034004D001F001A0016001B00E104E2 +:100130002A00200008000700060050002C002100C3 +:100140001500090019004F004A00220017000A009C +:100150000500000065642F0A006F0000E300000046 +:10016000E300300A00670000E30000004C002300B9 +:100170001C000B00110000002961240018000D0074 +:10018000100052004B0025000C000E0036005100FC +:100190002800260012000F0037002F002B00270038 +:1001A00013003342380030004E002D00310034007F +:1001B000E500C10000000100010001000100010094 +:1001C00000003A001E0220022202010001003B0052 +:1001D0001F0221022302010001003C002F0226021F +:1001E0002F00010001003D00300227023000010015 +:1001F00001003E003102350035020000010001001F +:1002000001000000010000000100010001000000E9 +:100210000100000001003F005200510024020000D4 +:1002200001004000240021001E00010001004100E7 +:10023000250022001F003700010042002600230095 +:10024000200027000100430025022E0231002E006D +:100250000100440045000100010001000000010010 +:100260000100010001000100000001000100010087 +:1002700001000100010001000100F2000100010085 +:1002800001000100F000F1000100F4000100010094 +:100290000100F3000100F500010001000100010070 +:1002A0000100000001000100010000000100000049 +:1002B0000100010001000000010000000100010038 +:1002C0000100010001000000010001000100010027 +:1002D0000100A9000100010001000100AC00AA001A +:1002E000B600010001000100AB00A8000100010000 +:1002F0000100010001000100010001000100AE0049 +:1003000001000100000016034500720067006F0045 +:1003100044006F007800200045005A0000001603DA +:100320004500720067006F0044006F0078002000F5 +:1003300045005A0000000403090409026D0004018D +:1003400000A0FA09040000010301010009211101C4 +:1003500000012240000705810308000A090401008A +:100360000103010200092111010001224D000705CE +:10037000820308000A0904020001030000000921A9 +:10038000110100012236000705830308000A090451 +:1003900003000103000000092111010001223900BE +:1003A000070584031000011201100100000008ED90 +:1003B000FE071301000102000105010906A1010564 +:1003C0000719E029E7150025019508750181020547 +:1003D000081901290595057501910295017503918B +:1003E0000105071900297715002501957875018108 +:1003F00002C005010980A101850216010026B7008F +:100400001A01002AB700751095018100C0050C097A +:1004100001A1018503160100269C021A01002A9CF5 +:1004200002751095018100C005010902A1010901B1 +:10043000A10005091901290515002501950575017A +:10044000810295017503810105010930093115818A +:10045000257F95027508810609381581257F95014C +:1004600075088106050C0A38021581257F950175EE +:10047000088106C0C005010906A101050719E02988 +:10048000E715002501950875018102950175088120 +:100490000105081901290595057501910295017558 +:1004A0000391010507190029FF150026FF00950695 +:1004B00075088100C000000000000000000000007E +:1004C000010204060A0F17202C3A4A5D71879DB37A +:1004D000C7DAE9F5FCFFFCF5E9DAC7B39D87715D82 +:1004E0004A3A2C20170F0A060402010000000000FF +:1004F00000000000000011241FBECFEFDAE0DEBFD5 +:10050000CDBF04B603FE27C0809101029091020284 +:10051000A0910302B09104028730904BA740B04BEA +:10052000D1F4109201021092020210920302109272 +:10053000040214BE84B7877F84BF0FB6F894A895D1 +:1005400080916000886180936000109260000FBE0F +:10055000E0E0FFE3099511E0A0E0B1E0E6EBF6E4AE +:1005600002C005900D92A433B107D9F712E0A4E3BD +:10057000B1E001C01D92A130B107E1F70E943C0B30 +:100580000C9459230C9400001092B9008AE08093D7 +:10059000B800089594EA9093BC009091BC0097FF36 +:1005A000FCCF9091B900987F983021F0903111F0F4 +:1005B00081E008958093BB0084E88093BC00809123 +:1005C000BC0087FFFCCF8091B900887F883111F093 +:1005D000803471F780E0089584E98093BC008091B5 +:1005E000BC0084FDFCCF08958093BB0084E8809319 +:1005F000BC008091BC0087FFFCCF9091B900987F30 +:1006000081E0983209F480E0089584E88093BC008A +:100610008091BC0087FFFCCF8091BB00089580B320 +:100620008C7080BB81B3836F81BB08958091010181 +:10063000811115C080E40E94CA02809301018111DA +:100640000CC082E10E94F40280930101811105C077 +:100650008FEF0E94F402809301010E94EC0284B1AA +:10066000807F84B985B1807F85B98AB1837F8AB95B +:100670008BB1837F8BB93E98469808950E94E00421 +:10068000809301010E9416030E940F03A5E3B1E0CD +:10069000E3E4F1E08EE08E0F11921D928E13FCCFF9 +:1006A0000C94CA040E94E004809301010E94160386 +:1006B0000E940F03A5E3B1E0E3E4F1E08EE08E0FCA +:1006C00011921D928E13FCCF0895BF92CF92DF92AC +:1006D000EF92FF920F931F93CF93DF9380910101CD +:1006E000882379F0809134018F5F809334018111E8 +:1006F00008C00E94E00480930101811102C00E94A1 +:10070000720405E311E0C0E0D0E0DD24D39482E080 +:10071000C82EEE24E394F12CC730D10500F580916A +:100720000101811164C080E40E94CA02809301012A +:10073000811112C082E10E94F402809301018111B3 +:100740000BC0C7010C2E01C0880F0A94EAF78095F0 +:100750000E94F402809301010E94EC0248C0CA305A +:10076000A1F028F4C83059F0C93061F005C0CC3090 +:1007700089F070F0CD3089F0209A289810C0219A25 +:1007800029980DC0229A2A980AC0239A2B9807C04C +:10079000529A01C0539A5B9802C03E9A469890EADA +:1007A0009A95F1F79FB1799902C082E001C080E08B +:1007B00091709D25982B7C9902C084E001C080E057 +:1007C000892B7D9902C038E001C030E0832B7E99EF +:1007D00002C020E101C020E0822B9FB19095991FBB +:1007E0009927991F9295990F907E892B0FC0809120 +:1007F0000101811149C080E40E94CA028093010175 +:10080000882379F1B12C0E94EC028B2DF8019081A4 +:10081000981719F08083C09200010E941603219658 +:100820000F5F1F4FCE30D10509F076CF80910001C8 +:10083000882361F1815080930001882339F08FE98A +:100840009FE00197F1F700C0000020C0A3E4B1E0F1 +:10085000E5E3F1E0CF01825F91919D938E13FCCF90 +:1008600015C083E10E94F402809301018111CACF77 +:1008700081E40E94CA02809301018111C3CF0E94CA +:100880000503B82EB094BFCF80E0C0CF0E947004A3 +:1008900081E0DF91CF911F910F91FF90EF90DF905A +:1008A000CF90BF900895E82FF0E0ED5BFE4F808180 +:1008B000089508950F931F93CF93DF93C3E4D1E07E +:1008C00010E00C2F025F899190E00E948C1B180FA2 +:1008D0000C13F9CF812FDF91CF911F910F910895C4 +:1008E0000C94400556985E9825982D9826982E9839 +:1008F00027982F988FEF90E090938900809388003D +:1009000090938B0080938A0090938D0080938C004D +:10091000259A2D9A2FEF80E792E021508040904059 +:10092000E1F700C00000269A2E9A2FEF80E792E0B0 +:10093000215080409040E1F700C00000279A2F9A94 +:100940002FEF80E792E0215080409040E1F700C017 +:10095000000025982D982FEF80E792E021508040ED +:100960009040E1F700C0000026982E982FEF80E716 +:1009700092E0215080409040E1F700C000002798AD +:100980002F9856985E9825982D9826982E982798F7 +:100990002F98089589EA8093800089E080938100F0 +:1009A00024982C983F988AB18F748AB96E98479A88 +:1009B0008BB1806B8BB9769A0E9472040C943F05C0 +:1009C00080E2809301018091510181110EC00E944B +:1009D000C40281E0809351012FEF83ED90E3215019 +:1009E00080409040E1F700C0000080E40E94CA020D +:1009F0008093010181112EC00E94F40280930101B5 +:100A0000811128C00E94F40280930101811122C04B +:100A10008FE30E94F4028093010181111BC00E94A8 +:100A2000EC0280E40E94CA0280930101811112C08D +:100A30008CE00E94F4028093010181110BC00E949E +:100A4000F40280930101811105C08FE30E94F4023A +:100A5000809301010E94EC028091010108956111CF +:100A60000BC0FC018281882321F085EE0E949B113E +:100A700003C085EE0E94631280E090E0089508951F +:100A80006091C2017091C3018091C4019091C50130 +:100A90000E94981B56985E9825982D9826982E9817 +:100AA00027982F98813019F0823021F00895259AE7 +:100AB0002D9A0895269A2E9A089581E0089581E04E +:100AC00008950C945F050895282F882339F090E04D +:100AD0002A3010F44D9608950697089587E290E025 +:100AE0000895AF92BF92DF92EF92FF920F931F9300 +:100AF000CF93DF938C01FC01C081D181CE010E9494 +:100B0000111ABE010E94E908EC01B8010E946105BA +:100B1000882309F4D1C1F8018281882309F4C6C071 +:100B200080916201811127C0C431F0E7DF0709F02D +:100B3000BDC10E94630581E0809362010E94321C66 +:100B400090936101809360011092550110925701BA +:100B500010925601109259011092580110925B01A7 +:100B600010925A0110925D0110925C0110925F0187 +:100B700010925E01A1C180916001909161010E947B +:100B80003E1C883C910570F480915501E82FF0E0FF +:100B9000EE0FFF1FEA5AFE4FD183C0838F5F809311 +:100BA00055018AC1C13020E8D20708F451C0F801CC +:100BB0008281882309F47EC05E01E894B7F88091B1 +:100BC0005401813079F050F08230C1F482EE0E94FD +:100BD0009B1187E50E949B1187E50EC082EE0E9463 +:100BE0009B110CC080EE0E949B1181EE0E949B1114 +:100BF00088E10E949B1188E10E9463128CE0E82E3C +:100C0000F12CC5010E2C02C0969587950A94E2F747 +:100C10008F700E946405D82E0E949B118D2D0E941A +:100C20006312F4E0EF1AF1082CEFE2162FEFF20650 +:100C300041F780915401813029F010F0823041F465 +:100C400082EE04C080EE0E94631281EE0E94631265 +:100C5000C43180E7D80768F4C23090E7D90708F0BC +:100C600046C0C115E0E7DE0771F0C130D047A1F101 +:100C70000CC1C33320E7D20709F4D8C0C433D0472E +:100C800009F4EBC002C1F8018281882309F402C192 +:100C90000E941815FFEF24E38CE0F15020408040C3 +:100CA000E1F700C000000E948D1C06C1C13080E841 +:100CB000D80770F2C43120E7D20708F0B3C0C230C1 +:100CC00080E7D807A0F4C11590E7D90709F4E2C07E +:100CD000C130D04709F0D9C0F8018281882309F4D6 +:100CE000D9C08091DF0181608093DF01E5C0F80108 +:100CF0008281882309F4CEC00E94E71C811102C0C2 +:100D00000E94CD1C0E94FA1C90E09093F301809306 +:100D1000F201C230F0E7DF0721F48091F201816037 +:100D20007AC0C33020E7D20721F48091F2018260BB +:100D300072C0C43080E7D80721F48091F20184604A +:100D40006AC0C53090E7D90719F48091F20127C035 +:100D5000C630E0E7DE0721F48091F20180615BC0DC +:100D6000C730F0E7DF0721F48091F201806253C0C1 +:100D7000C83020E7D20721F48091F20180644BC093 +:100D8000C93080E7D80721F48091F201806843C020 +:100D9000CA3090E7D90729F48091F2018460886015 +:100DA0003AC0CB30E0E7DE0721F48091F2018E7F7C +:100DB00032C0CC30F0E7DF0721F48091F2018D7F63 +:100DC0002AC0CD3020E7D20721F48091F2018B7F39 +:100DD00022C0CE3080E7D80719F48091F2011AC002 +:100DE0008091F201CF3090E7D90711F48F7E13C0C4 +:100DF000C031E0E7DE0711F48F7D0DC0C131F0E7AF +:100E0000DF0711F48F7B07C0C231D04711F48F7711 +:100E100002C08B7F877F8093F2018091F2010E9454 +:100E2000FE1C4AC0C333F0E7DF07A1F4F80182815A +:100E3000882321F01092520182E016C08091520165 +:100E4000811106C086E20E949B1186E20E94631215 +:100E500082E018C0C433D047C1F4F80182818823EE +:100E600031F01092530180E20E94B21225C08091AD +:100E70005301811106C087E20E949B1187E20E9404 +:100E8000631280E20E94B91217C081E08093520180 +:100E900080935301C801DF91CF911F910F91FF9073 +:100EA000EF90DF90BF90AF900C945D05C130F0E8FB +:100EB000DF0708F081CECCCE80E0DF91CF911F918B +:100EC0000F91FF90EF90DF90BF90AF90089526E0D4 +:100ED000729FF001112444E5849FE00DF11D11245F +:100EE000E60FF11DEE0FFF1FE25FFE4F859194911B +:100EF0000E94FB08811560E49607B0F5811570E348 +:100F0000970708F0DEC0803E9105D8F4803C91053B +:100F100008F06CC0883A910578F4853A910508F09C +:100F20006BC08130910509F452C108F40FC18430BF +:100F3000910508F04CC10AC18B3B910508F467C0CC +:100F400005C18F3F910509F048F4803F910508F0F5 +:100F5000ADC0883E910508F43AC1F8C0811520E281 +:100F6000920708F0A5C00895811543E5940790F411 +:100F7000811562E5960708F0C8C0811571E59707ED +:100F800008F0BEC0811520E5920708F09DC09F7053 +:100F9000906A0895811545E59407D8F4811564E5B4 +:100FA000960708F0C8C0482F4695469570E2479FBF +:100FB000A00111248370992721E030E0B90102C01B +:100FC000660F771F8A95E2F7CB01842B952B9A68E1 +:100FD0000895811576E5970708F4B2C09C01305654 +:100FE0002115304108F0B2C09F70AEC0FC01EE0F79 +:100FF000FF1FE657F04062C0853A910509F4A9C089 +:10100000863A910509F0A8C082E890E40895883AEC +:10101000910509F4A4C0893A910509F4A3C08A3A5C +:10102000910509F4A2C08B3A910509F4A1C08C3A4C +:10103000910509F4A0C08D3A910509F49FC0803B49 +:10104000910509F49EC08E3A910509F49DC08F3A2E +:10105000910509F49CC0813B910509F49BC0823B3A +:10106000910509F49AC0833B910509F499C0843B2A +:10107000910509F498C0853B910509F497C0863B1A +:10108000910509F496C0873B910509F495C0883B0A +:10109000910509F494C0893B910509F493C08A3BFA +:1010A000910509F492C080E094E408959065089554 +:1010B000FC01FF70EE0FFF1FE65FFE4F85919491DC +:1010C00008959927906C0895482F437021E030E0EF +:1010D00002C0220F331F4A95E2F73C68AC0164E07E +:1010E000569547956A95E1F74370342B8F70869536 +:1010F000869560E2869FC0011124822B932B089570 +:10110000982F8827816F906A0895482F46954695B5 +:1011100070E2479FA00111248370992721E030E0FD +:10112000B90102C0660F771F8A95E2F7CB01842BC5 +:10113000952B9C680895982F8827846F906A08954E +:101140008F719927982F88279062089580E090E00A +:10115000089581E890E4089583E890E4089582EE8C +:1011600094E4089589EE94E408958AEE94E4089551 +:1011700085EB94E4089586EB94E4089587EB94E47A +:1011800008958CEC94E408958DEC94E4089583E83C +:1011900095E408958AE895E4089582E995E4089530 +:1011A00084E995E4089581E296E4089583E296E463 +:1011B000089584E296E4089585E296E4089586E22F +:1011C00096E4089587E296E408958AE296E4089505 +:1011D000089596E0799FF001112494E5899FE00D30 +:1011E000F11D1124E60FF11DEE0FFF1FE25FFE4F10 +:1011F0008591949108958238910549F1B0F4813335 +:10120000910509F458C048F48932910509F44EC09B +:101210008A32910509F454C008958533910509F483 +:1012200040C08933910599F00895833E910529F1D5 +:1012300038F4803E910591F0823E9105A1F0089529 +:10124000863E9105F9F0873E910531F10895209190 +:10125000F20120FD3AC021FD38C008958091F201CD +:1012600080FD35C032C08091F20182FF32C0809192 +:10127000F20184FD30C083EE39C08091F20182FD1D +:1012800028C0F5CF8091F20183FF27C08091F20141 +:1012900084FD21C087EE2AC08091F20183FD1DC02C +:1012A000F5CF8091F20185FD1AC01BC08091F2013B +:1012B00085FD17C014C08091F20186FD14C015C0D1 +:1012C0008091F20186FD11C00EC080EE0FC089E34F +:1012D0000DC082EE0BC080E009C086EE07C089E237 +:1012E00005C085E303C08AE201C081E390E0089570 +:1012F00008950C947809809173010895CF93DF933A +:1013000000D01F92CDB7DEB79C018091F8018430E8 +:1013100019F593E099833B832A839093E9008FEF3B +:101320009091E800815095FD06C095ED9A95F1F7F2 +:1013300000008111F5CF8091E80085FF0DC040E0ED +:1013400050E063E070E0CE0101960E94E70B8091CF +:10135000E8008E778093E8000F900F900F90DF9158 +:10136000CF910895CF93DF9300D01F92CDB7DEB712 +:101370002091F801243021F522E029839B838A8380 +:1013800083E08093E9008FEF9091E800815095FD14 +:1013900006C095ED9A95F1F700008111F5CF809187 +:1013A000E80085FF0DC040E050E063E070E0CE0152 +:1013B00001960E94E70B8091E8008E778093E80009 +:1013C0000F900F900F90DF91CF9108952091F80129 +:1013D0002430F1F422E02093E9002FEF3091E8006F +:1013E000215035FD06C035ED3A95F1F70000211189 +:1013F000F5CF2091E80025FF0BC040E050E065E00C +:1014000070E00E94E70B8091E8008E778093E800FF +:101410000895CF93DF93EC019091F801943009F097 +:1014200046C080910C018823D9F080910D0188235A +:10143000B9F09093E9008FEF9091E800815095FD0D +:1014400006C095E19A95F1F700008111F5CF8091E2 +:10145000E80085FF2CC040E050E060E170E017C07C +:1014600081E08093E9008FEF9091E800815095FD35 +:1014700006C095ED9A95F1F700008111F5CF8091A6 +:10148000E80085FF14C040E050E068E070E0CE0165 +:101490000E94E70B8091E8008E778093E80080E15E +:1014A000FE01A3E6B1E001900D928A95E1F7DF918C +:1014B000CF9108958091F701811109C00E947C0DA0 +:1014C0000E94D90D8091E20084608093E20008952B +:1014D0001092F701089508950C9473210E94231C23 +:1014E0000E9479210E947F100C94790942E061ECFE +:1014F00081E00E94F60C42E061EC82E00E94F60C72 +:1015000042E061EC83E00E94F60C42E161EC84E091 +:101510000C94F60C8091FA01833009F455C030F434 +:10152000813071F0823009F48EC008958A3009F458 +:101530007AC08B3009F460C0893009F09CC020C0AB +:101540008091F901813A09F096C08091E800877F87 +:101550008093E8008091FD019091FE01892B21F498 +:1015600060E183E691E003C060E080E090E070E03D +:101570000E94320C8091E8008B778093E8000895F8 +:101580008091F901813209F076C08091FD0190913E +:10159000FE01009719F0039709F06DC08091E800F3 +:1015A000877F8093E8008091E80082FD05C08091EC +:1015B000F8018111F8CF5FC08091F1008093730131 +:1015C0008091E8008B7753C08091F901813A09F04E +:1015D00052C08091FD019091FE01892B09F04BC012 +:1015E0008091E800877F8093E8008091E80080FF89 +:1015F000FCCF80910C0136C08091F9018132D9F580 +:101600008091FD019091FE01892BA9F58091E80060 +:10161000877F8093E8000E942B0D8091FB018093CF +:101620000C010C9418158091F901813221F58091FB +:10163000E800877F8093E8000E942B0D8091FC01D9 +:101640008093740108958091F901813AA1F4809109 +:10165000E800877F8093E8008091E80080FFFCCF5E +:10166000809174018093F1008091E8008E778093DF +:10167000E8000C942B0D089584B7877F84BF0FB6C4 +:10168000F894A89580916000886180936000109222 +:1016900060000FBE80E880936100109261000E949C +:1016A000CE100E947C0D0E94D90D8091E2008460D2 +:1016B0008093E20078940E945F100E94D01082E034 +:1016C00091E00E947A100E9461218091F80185309A +:1016D00069F40E94E81B8091F6018823B1F30E940F +:1016E000151C882391F30E94D10BEFCF0E94D610D6 +:1016F000ECCF292F332723303105C9F064F4213092 +:10170000310581F02230310509F043C08DE690E0CB +:101710002AE333E042C021323105F1F022323105B3 +:1017200041F137C082E190E027EA33E036C09927E3 +:101730008130910541F08230910541F0892B49F5C6 +:10174000E6E3F3E005C0EEE1F3E002C0E6E0F3E03B +:10175000849190E09F0121C06430D8F4E62FF0E03E +:10176000EE0FFF1FEE5DFE4F2081318189E090E09A +:1017700014C0643070F470E0FB01EE0FFF1FE65EF2 +:10178000FE4F20813181FB01EA5EFE4F808190E0B7 +:1017900004C080E090E020E030E0FA013183208353 +:1017A000089580E189BD82E189BD09B400FEFDCFC5 +:1017B0008091D8008F7D8093D8008091E000826076 +:1017C0008093E0008091E00081FDFCCF0895CF92EE +:1017D000DF92EF92FF920F931F93CF93DF93EC0171 +:1017E0008B016A010E944A0D811133C0C114D104DA +:1017F00039F0F60180819181081B190BC80FD91FA0 +:10180000E12CF12C0115110519F18091E80085FDFD +:1018100016C08091E8008E778093E800C114D1044F +:1018200049F0F60180819181E80EF91EF182E08293 +:1018300085E00FC00E944A0D882321F30AC08991D8 +:101840008093F10001501109FFEFEF1AFF0ADACF80 +:1018500080E0DF91CF911F910F91FF90EF90DF908B +:10186000CF9008952091FF0130910002261737078D +:1018700048F06115710539F42091E8002E77209326 +:10188000E80001C0B90140E061157105A9F120919E +:10189000F801222309F443C0253009F442C0209105 +:1018A000E80023FD40C02091E80022FD32C02091D5 +:1018B000E80020FFE9CF4091F3002091F20030E0F2 +:1018C000342BFC01CF016115710559F02830310529 +:1018D00040F481918093F100615071092F5F3F4F77 +:1018E000F1CF41E02830310509F040E02091E800D7 +:1018F0002E772093E800C8CF4111C9CF0AC080914C +:10190000F801882361F0853061F08091E80083FD63 +:101910000AC08091E80082FFF2CF80E0089582E063 +:10192000089583E0089581E008952091FF013091AA +:1019300000022617370748F06115710539F4209128 +:10194000E8002E772093E80001C0B901FC0120E0F7 +:101950006115710591F18091F801882309F440C067 +:10196000853009F43FC08091E80083FD3DC080913F +:10197000E80082FD2FC08091E80080FFE9CF209130 +:10198000F3008091F20090E0922B6115710559F0FF +:101990008830910540F424912093F10031966150F4 +:1019A00071090196F2CF21E0089709F020E08091BB +:1019B000E8008E778093E800CBCF2111CCCF0AC00E +:1019C0008091F801882361F0853061F08091E80012 +:1019D00083FD0AC08091E80082FFF2CF80E0089585 +:1019E00082E0089583E0089581E00895982F97306C +:1019F00058F59093E900981739F07091EC00209118 +:101A0000ED005091F00003C0242F762F50E021FF0D +:101A100019C03091EB003E7F3093EB003091ED0028 +:101A20003D7F3093ED003091EB0031603093EB005F +:101A30007093EC002093ED005093F0002091EE00A5 +:101A400027FF07C09F5FD3CF8F708093E90081E0AD +:101A5000089580E008958091F90187FF11C0809179 +:101A6000E80082FD05C08091F8018111F8CF11C016 +:101A70008091E8008B770BC08091F801882349F0B2 +:101A80008091E80080FFF8CF8091E8008E77809306 +:101A9000E80008952091E4003091E50095E640913A +:101AA000EC00842F817040FF22C08091E80080FD0F +:101AB0001CC08091F801882391F0853091F08091CD +:101AC000EB0085FD10C04091E4005091E500421705 +:101AD000530729F39A01915011F784E0089582E0A9 +:101AE000089583E0089581E0089580E0089540918D +:101AF000E80042FFDECF08950E94EA0D0E94F20D39 +:101B0000E0EEF0E0808181608083E8EDF0E08081AC +:101B10008F77808319BCA7EDB0E08C918E7F8C937A +:101B200080818F7E80831092F70108950F931F9319 +:101B3000CF93DF930E94EA0D0E94F20DC8EDD0E032 +:101B400088818F77888388818068888388818F7D6A +:101B5000888319BC1092F8011092F4011092F601DA +:101B60001092F50100EE10E0F80180818B7F8083F8 +:101B700088818160888342E060E080E00E94F60C0A +:101B8000E1EEF0E080818E7F8083E2EEF0E0808104 +:101B900081608083808188608083F80180818E7F6E +:101BA0008083888180618883DF91CF911F910F911D +:101BB0000895E8EDF0E080818F7E8083E7EDF0E02E +:101BC00080818160808384E082BF81E08093F7011F +:101BD0000C94960DE8EDF0E080818E7F808310926A +:101BE000E20008951092DA001092E10008951F9229 +:101BF0000F920FB60F9211242F933F934F935F9341 +:101C00006F937F938F939F93AF93BF93EF93FF93C4 +:101C10008091E10082FF0BC08091E20082FF07C04B +:101C20008091E1008B7F8093E1000E945E108091A3 +:101C3000DA0080FF1FC08091D80080FF1BC0809118 +:101C4000DA008E7F8093DA008091D90080FF0DC08A +:101C500080E189BD82E189BD09B400FEFDCF81E04C +:101C60008093F8010E945A0A05C019BC1092F8012D +:101C70000E94680A8091E10080FF19C08091E20013 +:101C800080FF15C08091E2008E7F8093E2008091FA +:101C9000E20080618093E2008091D80080628093AE +:101CA000D80019BC85E08093F8010E946C0A8091ED +:101CB000E10084FF30C08091E20084FF2CC080E10D +:101CC00089BD82E189BD09B400FEFDCF8091D800B5 +:101CD0008F7D8093D8008091E1008F7E8093E1001A +:101CE0008091E2008F7E8093E2008091E20081602B +:101CF0008093E2008091F401882311F084E007C012 +:101D00008091E30087FD02C081E001C083E0809301 +:101D1000F8010E946E0A8091E10083FF29C0809142 +:101D2000E20083FF25C08091E100877F8093E1007E +:101D300082E08093F8011092F4018091E1008E7F9F +:101D40008093E1008091E2008E7F8093E200809199 +:101D5000E20080618093E20042E060E080E00E9467 +:101D6000F60C8091F00088608093F0000E946B0A6E +:101D7000FF91EF91BF91AF919F918F917F916F9163 +:101D80005F914F913F912F910F900FBE0F901F9039 +:101D900018951F920F920FB60F9211242F933F9315 +:101DA0004F935F936F937F938F939F93AF93BF9363 +:101DB000CF93DF93EF93FF93C091E900CF708091B1 +:101DC000EC00D82FD17080FDD0E81092E90080910E +:101DD000F000877F8093F00078940E940D0F10929E +:101DE000E9008091F00088608093F000CD2BCF70E7 +:101DF000C093E900FF91EF91DF91CF91BF91AF9137 +:101E00009F918F917F916F915F914F913F912F9112 +:101E10000F900FBE0F901F9018951F93CF93DF93D5 +:101E2000CDB7DEB7AA970FB6F894DEBF0FBECDBF11 +:101E3000E9EFF1E088E08E0F9091F10091938E131D +:101E4000FBCF0E948A0A8091E80083FF1FC1809126 +:101E5000F9019091FA01492F50E04A30510508F0FC +:101E600015C1FA01EA5AFF4F0C940A23803881F019 +:101E7000823809F00BC18091FD018F708093E900D9 +:101E80008091EB0085FB882780F91092E90006C05D +:101E90008091F5019091F601911182609091E80096 +:101EA000977F9093E8008093F1001092F100C8C0F2 +:101EB000282F2D7F09F0EAC0882319F0823061F0C5 +:101EC000E5C08091FB01813009F0E0C0933009F05A +:101ED00080E08093F6012BC08091FB01811127C027 +:101EE0008091FD018F7009F4D1C08093E9002091A9 +:101EF000EB0020FF1CC0933021F48091EB00806246 +:101F000014C09091EB0090619093EB0021E030E0E1 +:101F1000A90102C0440F551F8A95E2F74093EA00D9 +:101F20001092EA008091EB0088608093EB001092A1 +:101F3000E9008091E800877F86C08111A7C01091D9 +:101F4000FB011F778091E3008078812B8093E30071 +:101F50008091E800877F8093E8000E942B0D80919C +:101F6000E80080FFFCCF8091E30080688093E3006D +:101F7000111102C082E001C083E08093F80186C0A5 +:101F80008058823008F082C08091FB019091FC0162 +:101F90008C3D53E0950779F583E08A838AE2898353 +:101FA0004FB7F894DE01139620E03EE051E2E32FB4 +:101FB000F0E050935700E49120FF03C0E295EF70EA +:101FC0003F5FEF708E2F90E0EA3010F0C79601C0AF +:101FD000C0968D939D932F5F243149F74FBF809119 +:101FE000E800877F8093E8006AE270E0CE01019606 +:101FF0000E94320C14C0AE014F5F5F4F6091FD0133 +:102000000E94790BBC01892B09F440C09091E80033 +:10201000977F9093E80089819A810E94950C809126 +:10202000E8008B778093E80031C0803879F58091A3 +:10203000E800877F8093E8008091F4018093F100AD +:102040008091E8008E778093E8000E942B0D1EC0DF +:1020500081111CC09091FB019230C0F48091E80086 +:10206000877F8093E8009093F4010E942B0D80916C +:10207000F401811106C08091E30087FD02C081E078 +:1020800001C084E08093F8010E94760A8091E80004 +:1020900083FF0AC08091E800877F8093E8008091E9 +:1020A000EB0080628093EB00AA960FB6F894DEBF37 +:1020B0000FBECDBFDF91CF911F9108950895CF93AB +:1020C0008091F8018823A1F0C091E900CF70909130 +:1020D000EC00892F817090FD80E8C82B1092E900F8 +:1020E0008091E80083FD0E940D0FCF70C093E9003E +:1020F000CF91089590937A01809379010895E091AA +:102100007901F0917A01309721F00190F081E02D72 +:10211000099480E00895E0917901F0917A01309777 +:1021200021F00280F381E02D09940895E091790176 +:10213000F0917A01309721F00480F581E02D099427 +:10214000089520917701309178018217930771F0FB +:102150009093780180937701E0917901F0917A0171 +:10216000309721F00680F781E02D099408952091A1 +:102170007501309176018217930771F09093760183 +:1021800080937501E0917901F0917A01309721F007 +:102190000084F185E02D0994089508950C94CD10E4 +:1021A0000E94291C0E943E030C94AF1C9F92AF9288 +:1021B000BF92CF92DF92EF92FF920F931F93CF9334 +:1021C000DF9300D000D000D0CDB7DEB70E9465030A +:1021D0000DE010E0AA24A394B12C902E802F0E9431 +:1021E0005304980124583E4F6901F901F080F82604 +:1021F000A1F40150110988F78FEF89838A831B822C +:102200000E94321C8160782F9D838C8349815A8182 +:102210006B818D810E946D112FC09091DF0191FF24 +:1022200004C08E830E9459048E8125E030E0A50110 +:10223000022E01C0440F0A94EAF7E42E4F21C1F0A8 +:1022400029839A828E2191E009F490E09B830E9479 +:10225000321C8160782F9D838C8349815A816B81E8 +:102260008D810E946D11F6018081E826E08204C014 +:1022700021503109E0F6BDCF0E947D1E10917B01F7 +:102280000E947F101817B9F00E947F1080937B0185 +:1022900026960FB6F894DEBF0FBECDBFDF91CF916B +:1022A0001F910F91FF90EF90DF90CF90BF90AF9074 +:1022B0009F900C94790926960FB6F894DEBF0FBE56 +:1022C000CDBFDF91CF911F910F91FF90EF90DF90E5 +:1022D000CF90BF90AF909F900895CF93DF93CDB7ED +:1022E000DEB72B970FB6F894DEBF0FBECDBF4F837E +:1022F000588769877A878B87DE01119686E0FD0112 +:1023000011928A95E9F785E0FE01379601900D92CA +:102310008A95E1F749815A816B817C818D819E810B +:102320000E94B6172B960FB6F894DEBF0FBECDBF36 +:10233000DF91CF910895CF93882309F4C2C0C82FAD +:10234000823859F40E947F1081FDBBC089E30E944E +:10235000901A0E945D1B89E30CC0833879F40E94B7 +:102360007F1080FDAEC083E50E94901A0E945D1B25 +:1023700083E50E94D21ACF910C945D1B843859F4E6 +:102380000E947F1082FD9DC087E40E94901A0E94E7 +:102390005D1B87E4EECF8CEF8C0F813A48F48C2FD5 +:1023A0000E94C72081118DC08C2F0E94901AE3CF0C +:1023B00080E28C0F883048F4C77081E001C0880F3C +:1023C000CA95EAF70E94161BD6CF8BE58C0F833097 +:1023D00078F4C53A29F0C63A31F083E890E005C0B8 +:1023E00081E890E002C082E890E0CF910C94A110C7 +:1023F00088E58C0F833108F064C0C83A39F1C93AD6 +:1024000041F1CA3A49F1CB3A51F1CC3A59F1CD3ABE +:1024100061F1C03B69F1CE3A71F1CF3A79F1C13B3C +:1024200081F1C23B89F1C33B91F1C43B99F1C53BBA +:10243000A1F1C63BA9F1C73BB1F1C83BB9F1C93B1A +:10244000C1F1CA3BC9F180E090E038C082EE90E073 +:1024500035C089EE90E032C08AEE90E02FC085EB67 +:1024600090E02CC086EB90E029C087EB90E026C07E +:102470008CEC90E023C08DEC90E020C083E891E0EC +:102480001DC08AE891E01AC082E991E017C084E992 +:1024900091E014C081E292E011C083E292E00EC0AC +:1024A00084E292E00BC085E292E008C086E292E00E +:1024B00005C087E292E002C08AE292E0CF910C94DC +:1024C000B710CF910895882309F44BC0823859F48E +:1024D0000E947F1081FF45C089E30E94901A0E94EC +:1024E0005D1B89E30CC0833871F40E947F1080FF6C +:1024F00038C083E50E94901A0E945D1B83E50E940C +:10250000D21A0C945D1B843859F40E947F1082FF0C +:1025100028C087E40E94901A0E945D1B87E4EFCFD9 +:102520009CEF980F913A58F390E2980F983050F43E +:10253000877091E001C0990F8A95EAF7892F0E9470 +:102540001C1BDFCF9BE5980F933020F480E090E0D8 +:102550000C94A110885A833120F480E090E00C9410 +:10256000B7100895882321F00E94161B0C945D1B60 +:102570000895882321F00E941C1B0C945D1B089574 +:102580007F928F929F92AF92BF92CF92DF92EF9203 +:10259000FF920F931F93CF93DF931F92CDB7DEB7B8 +:1025A0007C01C62E772EFC01058102950F701281E9 +:1025B00011110E94331B0E94891A882379F011237C +:1025C00069F080E28C0D883048F082E00E94721A37 +:1025D0000E94891A91E0D82ED92601C0D12CE72D6E +:1025E000E295EF70F0E0E05AFF4F0C940A23872D3C +:1025F000807F072D0F70882311F00295007F112333 +:1026000089F0002309F490C180E28C0D883020F419 +:10261000802F0E94161B03C0802F0E94261B0E9441 +:102620005D1B82C18C2D0E946312002309F495C1A9 +:1026300080E28C0D883020F4802F0E941C1B03C088 +:10264000802F0E942C1B0E945D1B87C1972D907FBD +:10265000872D8F70903211F08295807FCC2021F0F1 +:10266000F1E0CF16B1F01EC0112349F0002309F4A8 +:1026700014C1013009F011C10E94461B6EC1002334 +:1026800019F0013009F469C189830E94491B8981CD +:102690000AC1112321F0023008F05FC1FEC0011110 +:1026A0005CC101C1112321F0002309F4F6C03CC133 +:1026B000002309F4F8C03EC1872D86958695837066 +:1026C00090E0009719F0019761F047C1112321F0C4 +:1026D0008C2D972D937002C080E090E00E94A11095 +:1026E0003CC1112321F08C2D972D937002C080E006 +:1026F00090E00E94B71031C18C2D112319F00E9477 +:10270000851D02C00E94ED1D0E94721E26C1872DEC +:10271000837009F052C0111120C18C2D82958695CD +:102720008770880F880F9C2D9F70892E912CA12C6B +:10273000B12C082E04C0880C991CAA1CBB1C0A943E +:10274000D2F7C4FE14C00FE010E020E030E0B90181 +:10275000A80104C0440F551F661F771F8A95D2F742 +:10276000CB01BA01609570958095909503C060E0AB +:1027700070E0CB01272D26952695237030E022307E +:10278000310569F02330310589F0682979298A29D2 +:102790009B292130310571F00E94FE18DEC06829A6 +:1027A00079298A299B290E941A19D7C00E94FE18EC +:1027B000C501B4010E94E218D0C0112319F0872D81 +:1027C000817001C08695882309F4C7C08C2D82953D +:1027D00086958770880F880F9C2D9F70892E912C6D +:1027E000A12CB12C082E04C0880C991CAA1CBB1C5F +:1027F0000A94D2F7C4FE14C00FE010E020E030E0ED +:10280000B901A80104C0440F551F661F771F8A95A0 +:10281000D2F7CB01BA01609570958095909503C071 +:1028200060E070E0CB01272D269526952370422F7E +:1028300050E04230510569F04330510589F0682974 +:1028400079298A299B294130510571F00E94D819B4 +:1028500084C0682979298A299B290E94F4197DC09E +:102860000E94D819C501B4010E94BC1976C08C2DF4 +:1028700090E0FC01E05EF109E531F10508F050C09F +:10288000E059FF4F0C940A230C2D0F70872D8F7188 +:10289000112331F00E945519802F0E94B2125DC0A1 +:1028A0000E947619802F0E94B91257C0112339F067 +:1028B000011153C0872D8F710E949B194EC00230A9 +:1028C00008F04BC0F7CF112339F0872D8F710E948C +:1028D000551943C01123C9F3872D8F710E947619B2 +:1028E0003CC0112329F0872D8F710E94401935C0FB +:1028F0000E94361932C0112351F0172D1F71812FFC +:102900000E94551963E0812F0E94691A26C081E058 +:102910000E94721A023008F182E00E94721A1DC0F1 +:10292000112331F0002389F28C2D0E949B1115C0D8 +:10293000002391F28C2D0E9463120FC0472D4F701F +:102940006C2DC7010E942F050E945A1806C0472D02 +:102950004F706C2DC7010E94E808DD20F9F00E943D +:10296000651A80FD1BC0F70112820E945F1A0E9447 +:102970005519C7010E94DD140E945F1A0F90DF9164 +:10298000CF911F910F91FF90EF90DF90CF90BF906C +:10299000AF909F908F907F900C9476190F90DF915D +:1029A000CF911F910F91FF90EF90DF90CF90BF904C +:1029B000AF909F908F907F9008950F931F93CF9328 +:1029C000DF93EC01888199812B813C81232BB9F025 +:1029D0009F3F11F48F3F99F0CE010E94710588232B +:1029E00071F0688179818A810E945B1A8C010E9452 +:1029F000101A0E94D718B801CE010E94C012DF91B0 +:102A0000CF911F910F9108950E94331B0E94431B89 +:102A10000E94081B0E945D1B0E94231F0E94721EC1 +:102A200080E090E00E94A11080E090E00C94B7104C +:102A30000E94231B0C9404150E94501A292F2295E2 +:102A40002F7030E02C3031054CF42A3031056CF415 +:102A50002250310922303105A8F407C02C3031054D +:102A600069F02F30310551F00DC0803F69F018F446 +:102A7000803E40F409C0843F29F406C093FB8827B8 +:102A800080F9089580E0089581E00895CF93DF9361 +:102A900000D000D01F92CDB7DEB70F900F900F90EF +:102AA0000F900F90DF91CF910895CF93DF9300D0D7 +:102AB00000D000D0CDB7DEB726960FB6F894DEBFB3 +:102AC0000FBECDBFDF91CF9108951F93CF93DF93BA +:102AD000C0918A0116E080918B01C81799F0D0E06F +:102AE0001C9FF0011D9FF00D1124E457FE4F408103 +:102AF000518162817381848195810E94551521964F +:102B0000C770E9CFDF91CF911F9108954091BC012B +:102B10005091BD016091BE017091BF018091C001D3 +:102B20009091C1010C9455158091C10182958F70CF +:102B300009F054C08091BE01882309F44FC08091F0 +:102B40008A01A0918B016091BC017091BD014091FF +:102B5000BF015091C001B6E08A1709F43FC090E070 +:102B600041155105C1F17F3F11F46F3FA1F1B89FAD +:102B7000F001B99FF00D1124E457FE4F218172132B +:102B80002AC02081621327C02281211124C0238101 +:102B900034812417350710F421503109241B350BDB +:102BA000283C3105C0F42091C1012F702061209391 +:102BB000C10126E0289FF001299FF00D1124EF5656 +:102BC000FE4F80818F70806180838CEB91E00E944A +:102BD000DD140C94651501968770BECF0895CF92D1 +:102BE000DF92EF92FF920F931F93CF93DF93CDB7B6 +:102BF000DEB762970FB6F894DEBF0FBECDBF8C0173 +:102C000085E0F801DE011D9601900D928A95E1F7AD +:102C1000D8014C9111965C91119712966C91129774 +:102C20001396CD90DC9014973091BC017091BD014A +:102C30008091BF019091C001009709F46BC17F3F63 +:102C400019F43F3F09F466C1E090BE01EE2009F49B +:102C5000C0C02091C101C816D90628F0F601E81BB2 +:102C6000F90BCF0104C0809590958C0D9D1DFF241C +:102C7000F394883C910578F0F12C207F09F0C6C0D0 +:102C80007C2DD98AC88A89890E9446158CEB91E0EF +:102C90000E94DD14B1C0822F807F09F046C07513F9 +:102CA00014C0341312C0611110C02F702061209322 +:102CB000C1010E9486158CEB91E00E94DD14809189 +:102CC000C101D80115968C932EC0CD2819F15F3F14 +:102CD00011F44F3FF9F0F62E61111CC080918A016A +:102CE00020918B0136E0821709F45AC090E0389F9A +:102CF000F001399FF00D1124E457FE4F71815713F5 +:102D000006C07081471303C07281711103C0019620 +:102D10008770E9CFF62E662309F418C18091C101AE +:102D200081608093C101F12C11C1751308C0341367 +:102D300006C0611104C08091C101D801C3C04D8794 +:102D40005E878D859E856A8B0E941C156A89882303 +:102D5000E1F16623D1F12091C101822F82958F701C +:102D600090E0029774F08091BC019091BD0198872A +:102D70008F831986DB86CA862C87CE0107960E9430 +:102D8000DD1486E0F801ACEBB1E001900D928A957C +:102D9000E1F70E9494150E948615FF24F394D6C093 +:102DA0004D875E878D859E850E94501A292F22951A +:102DB0002F7030E0223031050CF0BCC09F7009F05C +:102DC000B6C0805E883008F4C1C0C8010E94DD141E +:102DD000E4CFC816D90608F453C0F601E81BF90B76 +:102DE000CF01883C910508F450C0F12C7C2DD98A84 +:102DF000C88A89890E944615ECEBF1E086E0DF0184 +:102E00001D928A95E9F70E948615A0C0751314C01B +:102E1000341312C0611110C08091C101F801858383 +:102E2000C8010E94DD1486E0ECEBF1E0DF011D92A9 +:102E30008A95E9F7FE2C8AC04D875E878D859E8531 +:102E40006A8B0E941C156A89882309F4BECF662309 +:102E500009F4BBCF2091C101822F82958F7090E041 +:102E600002970CF48ECF8091BC019091BD019A83A2 +:102E700089831B82DD82CC822E83CE0101967FCF97 +:102E8000809590958C0D9D1DACCFF62E662309F490 +:102E90009CCF75132EC034132CC02091C10120FD8E +:102EA0001FC0822F82958F70D9F0D80115962C9370 +:102EB00015978F3049F08F5F982F9295907F822FD2 +:102EC0008F70892B15968C93C8010E94DD1486E0C3 +:102ED000F801ACEBB1E001900D928A95E1F793CF48 +:102EE00086E0F801ACEBB1E001900D928A95E1F734 +:102EF0002DC04D875E878D859E850E941C15811192 +:102F000040CF8091C10181608093C101C8010E94BE +:102F1000DD141CC0662309F458CF4D875E878D856C +:102F20009E850E941C15882309F44FCF2ACF81115A +:102F300048CF0CC0243031050CF047CF9F7009F406 +:102F400040CFF8019581907F09F03BCF8F2D62969D +:102F50000FB6F894DEBF0FBECDBFDF91CF911F91AA +:102F60000F91FF90EF90DF90CF9008951F93CF9334 +:102F7000DF93CDB7DEB72C970FB6F894DEBF0FBE48 +:102F8000CDBF4F83588769877A878B879C87CE010F +:102F900007960E94EF15882369F08F8198852A850E +:102FA0003B85232BF1F19F3F09F063C08F3F09F070 +:102FB00060C037C086E0FE013796DE0111960190B1 +:102FC0000D928A95E1F76F817885EA85FB853097C8 +:102FD00041F17F3F11F46F3F21F120918B0130E0EF +:102FE000C90101968770992740918A0150E08417A2 +:102FF000950709F447C069837A83FD83EC8396E0E3 +:10300000929FD001939FB00D1124A457BE4FFE0193 +:10301000319601900D929A95E1F780938B010E9471 +:10302000651516E080918A0190918B018917C1F195 +:10303000189FC001112484579E4F0E94EF158823CA +:1030400079F1E0918A011E9FF0011124E457FE4FAF +:103050004081518162817381848195810E945515DF +:1030600080918A0190E001968770992780938A0168 +:10307000D9CF4F81588569857A858B859C850E943B +:103080005515CFCF0E94181510928B0110928A010E +:10309000ECEBF1E086E0DF011D928A95E9F7C1CF04 +:1030A0002C960FB6F894DEBF0FBECDBFDF91CF9147 +:1030B0001F910895EF92FF920F931F93CF93DF9389 +:1030C0008C01892B09F46CC0F12CEE24E394E80107 +:1030D0002196F8018491843740F4843008F051C07F +:1030E000813081F0823019F15BC0853709F444C02A +:1030F000A8F19CE7980F903708F052C08F770E9494 +:10310000631241C00E5F1F4FFE01C49180E28C0F1D +:10311000883048F4C7708E2D01C0880FCA95EAF731 +:103120000E94361B14C08C2F0E949B112DC00E5F75 +:103130001F4FFE01C49180E28C0F883058F4C77095 +:103140008E2D01C0880FCA95EAF70E943C1B0E9491 +:103150005D1B1AC08C2F0E94631216C00E5F1F4F9A +:10316000FE01C491CC2381F08FE99FE00197F1F734 +:1031700000C00000C150F6CF0E5F1F4FFE01F4905B +:1031800003C00E949B118E018F2D882309F49FCFCD +:10319000EFE9FFE03197F1F700C000008150F5CF73 +:1031A000DF91CF911F910F91FF90EF9008950895B7 +:1031B0006093C6017093C7018093C8019093C901C1 +:1031C0000C9404150F931F930091C6011091C70131 +:1031D0002091C8013091C901DC01CB01802B912BDA +:1031E000A22BB32B8093C6019093C701A093C80173 +:1031F000B093C9011F910F910C9404150F931F9365 +:103200000091C6011091C7012091C8013091C901F8 +:10321000DC01CB0180239123A223B3238093C60139 +:103220009093C701A093C801B093C9011F910F915A +:103230000C9404150F931F930091C6011091C701C0 +:103240002091C8013091C901DC01CB018027912771 +:10325000A227B3278093C6019093C701A093C8010A +:10326000B093C9011F910F910C9404151092C201E3 +:103270001092C3011092C4011092C5010C94041560 +:1032800041E050E060E070E004C0440F551F661F4D +:10329000771F8A95D2F74093C2015093C301609380 +:1032A000C4017093C5010C94041541E050E060E046 +:1032B00070E004C0440F551F661F771F8A95D2F730 +:1032C0008091C2019091C301A091C401B091C50148 +:1032D000482B592B6A2B7B2B4093C2015093C3017F +:1032E0006093C4017093C5010C94041541E050E053 +:1032F00060E070E004C0440F551F661F771F8A9579 +:10330000D2F740955095609570958091C20190914B +:10331000C301A091C401B091C501482359236A2378 +:103320007B234093C2015093C3016093C401709307 +:10333000C5010C94041541E050E060E070E004C069 +:10334000440F551F661F771F8A95D2F78091C201DF +:103350009091C301A091C401B091C501482759279C +:103360006A277B274093C2015093C3016093C40135 +:103370007093C5010C9404150F931F930091C20123 +:103380001091C3012091C4013091C501DC01CB0132 +:10339000802B912BA22BB32B8093C2019093C3015E +:1033A000A093C401B093C5011F910F910C94041513 +:1033B0000F931F930091C2011091C3012091C4018A +:1033C0003091C501DC01CB0180239123A223B323DB +:1033D0008093C2019093C301A093C401B093C5012F +:1033E0001F910F910C9404150F931F930091C2012C +:1033F0001091C3012091C4013091C501DC01CB01C2 +:1034000080279127A227B3278093C2019093C301FD +:10341000A093C401B093C5011F910F910C940415A2 +:103420000895CF92DF92EF92FF920F931F93CF9365 +:10343000DF938C01C090C601D090C701E090C80115 +:10344000F090C9018091C2019091C301A091C40183 +:10345000B091C501C82AD92AEA2AFB2ACFE1D0E0D7 +:10346000D701C6010C2E04C0B695A79597958795F0 +:103470000A94D2F780FF06C0B8018C2F0E9467071C +:10348000019721F4219760F780E001C08C2FDF9134 +:10349000CF911F910F91FF90EF90DF90CF90089503 +:1034A000CF93DF93EC010E94111ABE010E946707BF +:1034B000DF91CF910895CB010E94501A0895809119 +:1034C000CA0185958595859508958091CA01877073 +:1034D000089598E0899F90011124262B2093CA011A +:1034E0000C9455192091CA01809582238093CA01BA +:1034F000982F977069F430E0482F552747FD509575 +:103500002417350729F08595859585950C947619AE +:1035100008959091CA01977081E009F480E00895C0 +:1035200090910C01992321F090910D01911109C006 +:1035300020910E0130910F01F90132969FEF40E08A +:103540001FC0982F9695969596959F3050F5E091CF +:103550000E01F0910F01E90FF11D877021E030E0BD +:10356000A90102C0440F551F8A95E2F7CA01918153 +:10357000892B818308959F3F39F04F5F4E3041F092 +:1035800051915813F8CF0DC05111F7CF942FF5CFAB +:103590009F3F39F0F901E90FF11D97FDFA958283FC +:1035A0000895089590910C01992321F090910D01B7 +:1035B000911109C020910E0130910F01F90132964D +:1035C000205F3F4F1FC0982F9695969596959F30F8 +:1035D000F0F4E0910E01F0910F01E90FF11D8770F9 +:1035E00021E030E0A90102C0440F551F8A95E2F79F +:1035F000CA01809591818923818308953196E217CC +:10360000F30729F090819813F9CF1082F7CF08952E +:1036100081E090E0E0910E01F0910F01E80FF91FB9 +:103620001082019680319105A9F708959091DE01ED +:10363000892B8093DE01089580959091DE01892386 +:103640008093DE0108951092DE0108959091DD01CE +:10365000892B8093DD01089580959091DD01892368 +:103660008093DD0108951092DD0108959091DC01B1 +:10367000892B8093DC01089580959091DC0189234A +:103680008093DC0108951092DC0108958093CB01B2 +:1036900008951092CB01089580910E0190910F0131 +:1036A000FC0131969C01205F3F4F80E09191911188 +:1036B0008F5FE217F307D1F70895E0910E01F091C3 +:1036C0000F018091DE018083E0910E01F0910F01E6 +:1036D00090818091DD01892B8083E0910E01F09132 +:1036E0000F0190818091DC01892B80838091CB0137 +:1036F000882361F0E0910E01F0910F019081892BF8 +:1037000080830E944C1B81111092CB0180910E018D +:1037100090910F010C948B1020E0009739F0AC01D0 +:1037200041505109842395232F5FF7CF822F0895AD +:10373000CF92DF92EF92FF926C01EE24FF24C1142E +:10374000D104E104F10421F0C701B60120E101C078 +:1037500020E0C72ED82EE92EFF24C114D104E104A5 +:10376000F10419F0285FC701B6016B017C0154E038 +:10377000F694E794D794C7945A95D1F7C114D1041D +:10378000E104F10419F02C5FC701B6016B017C0163 +:1037900042E0F694E794D794C7944A95D1F7C114C0 +:1037A000D104E104F10419F02E5FC701B601DC0178 +:1037B000CB01B695A79597958795892B8A2B8B2B4F +:1037C00009F02F5F822FFF90EF90DF90CF90089548 +:1037D0008091F801843039F11092E00120E488E111 +:1037E00090E00FB6F894A895809360000FBE2093E8 +:1037F000600080E00E94790983B7817F846083BF85 +:1038000083B7816083BF7894889583B78E7F83BFA9 +:103810000FB6F894A895809160008861809360004D +:10382000109260000FBE089508950E9452030E94F6 +:1038300065030E94141C0E945A0491E0811101C08A +:1038400090E0892F08950E9418150E947F100C9413 +:10385000790982E084BD93E095BD9AEF97BD80938E +:103860006E0008952FB7F8948091E1019091E201E4 +:10387000A091E301B091E4012FBF0895CF92DF92B0 +:10388000EF92FF920F931F932FB7F8944091E101AD +:103890005091E2016091E3017091E4012FBF6A0150 +:1038A0007B01EE24FF248C0120E030E0C016D1061D +:1038B000E206F30610F4415051099A01281B390B16 +:1038C000C9011F910F91FF90EF90DF90CF90089565 +:1038D0001F920F920FB60F9211248F939F93AF9365 +:1038E000BF938091E1019091E201A091E301B09139 +:1038F000E4010196A11DB11D8093E1019093E201C5 +:10390000A093E301B093E401BF91AF919F918F9198 +:103910000F900FBE0F901F9018950E947C0DF89489 +:103920002FEF87EA91E6215080409040E1F700C0F8 +:10393000000087E090EBDC0180930102909302028B +:10394000A0930302B09304029CE088E10FB6F894C0 +:10395000A895809360000FBE90936000FFCF0E94F7 +:10396000E71C811102C00E94CD1C0E94F21C8093B2 +:10397000DF010E94FA1C90E09093F3018093F20122 +:1039800087FB882780F980930D010E94F61C682F21 +:1039900070E080E090E00C94D8186DEE7EEF80E04F +:1039A00090E00E94432360E082E090E00E94322396 +:1039B00060E083E090E00E94322360E084E090E0E9 +:1039C0000E94322360E085E090E00C94322380E096 +:1039D00090E00E942C2321E08D3E9E4F09F020E0D4 +:1039E000822F089582E090E00C94242383E090E0FD +:1039F0000C94242384E090E00C942423682F84E02A +:103A000090E00C9432238091E70180FF0BC060911D +:103A1000130185E0689FB001112475956795759530 +:103A200067952BC081FF09C06091130185E0689FF5 +:103A3000B00111247595679520C082FF07C0609181 +:103A4000130185E0689FB001112417C09091E8012F +:103A50009923D1F060911201961788F720911301F4 +:103A600085E0289F90011124929FA001939F500D03 +:103A7000112470E0CA010E94F6226038710540F4FA +:103A80006115710539F002C065E070E0862F089578 +:103A90008FE7089581E008958091E70180FF08C0D5 +:103AA0006091110170E0759567957595679521C0D6 +:103AB00081FF06C06091110170E07595679519C08E +:103AC00082FF04C06091110170E010C09091E80184 +:103AD0009923C1F0609110019617A0F78091110110 +:103AE000899FC001112470E00E94F62260387105A0 +:103AF00028F46115710521F0862F08958FE7089548 +:103B000081E0089561E070E0F4CF803F21F40E94ED +:103B1000031D819504C0813F29F40E94031D8093F9 +:103B2000EB010895823F21F40E94031D819504C09A +:103B3000833F29F40E94031D8093EA010895893F81 +:103B400019F40E944C1D05C08A3F31F40E944C1D9F +:103B500081958093EC0108958B3F21F40E944C1DC8 +:103B6000819504C08C3F29F40E944C1D8093ED0187 +:103B70000895843F21F48091E901816017C0853F59 +:103B800021F48091E901826011C0863F21F4809187 +:103B9000E90184600BC0873F21F48091E9018860CE +:103BA00005C0883F31F48091E90180618093E9018B +:103BB00008958D3F21F48091E70181600BC08E3F15 +:103BC00021F48091E701826005C08F3F29F4809144 +:103BD000E70184608093E7010895803F39F4809184 +:103BE000EB0187FF6CC01092EB0169C0813F29F4A3 +:103BF0008091EB011816BCF362C09091EA01823FFC +:103C000029F497FF5CC01092EA0159C0833F19F470 +:103C10001916CCF354C0893F41F48091EC01181679 +:103C20000CF04DC01092EC014AC08A3F29F48091FB +:103C3000EC0187FF44C0F6CF8B3F39F48091ED0152 +:103C400087FF3DC01092ED013AC08C3F29F480916E +:103C5000ED011816BCF333C0843F21F48091E901D3 +:103C60008E7F17C0853F21F48091E9018D7F11C0BF +:103C7000863F21F48091E9018B7F0BC0873F21F4BF +:103C80008091E901877F05C0883F31F48091E90187 +:103C90008F7E8093E90113C08D3F21F48091E7016D +:103CA0008E7F0BC08E3F21F48091E7018D7F05C090 +:103CB0008F3F29F48091E7018B7F8093E70180910A +:103CC000EA0181110EC08091EB0181110AC080913F +:103CD000EC01811106C08091ED01811102C01092AA +:103CE000E801089589EE91E00E9496100E94321C2E +:103CF0009093E6018093E50108951F93CF93DF939E +:103D00008091E5019091E6010E943E1CAC019091EA +:103D1000E801992321F02091140130E006C02091A0 +:103D200015018AE0289F900111244217530708F4D7 +:103D300086C08091EA01C091EB01D091EC01109115 +:103D4000ED01811107C0C11176C0D11174C01111EC +:103D500072C075C09F3F19F09F5F9093E8011816DD +:103D600024F40E94031D8093EA018091EA0187FFF9 +:103D700005C00E94031D81958093EA011C1624F45E +:103D80000E94031D8093EB018091EB0187FF05C02A +:103D90000E94031D81958093EB016091EA016623E7 +:103DA00039F1C091EB01CC2319F1772767FD7095AC +:103DB000872F972F0E94FD2123E333E343E35FE343 +:103DC0000E9461220E94C5216093EA016C2F77272F +:103DD00067FD7095872F972F0E94FD2123E333E322 +:103DE00043E35FE30E9461220E94C5216093EB01DF +:103DF0001D1624F40E944C1D8093EC018091EC016F +:103E000087FF05C00E944C1D81958093EC0111161F +:103E100024F40E944C1D8093ED018091ED0187FFF9 +:103E200005C00E944C1D81958093ED01DF91CF91DB +:103E30001F910C94721E9F3F09F08ECF96CFDF9199 +:103E4000CF911F910895E9EEF1E085E0DF011D9229 +:103E50008A95E9F71092E8011092E70108958330FE +:103E600081F128F4813059F08230D1F00895853005 +:103E700009F449C0B8F1863009F456C0089580911C +:103E80001501262F30E0280F311D2F3F310524F476 +:103E9000680F6093150108958FEF809315010895C1 +:103EA00080911401262F30E0280F311D2F3F31055E +:103EB00024F4680F6093140108958FEF8093140128 +:103EC000089580911301262F30E0280F311D2F3FD8 +:103ED000310524F4680F6093130108958FEF8093E8 +:103EE0001301089580911201262F30E0280F311D13 +:103EF0002F3F310524F4680F6093120108958FEF6E +:103F000080931201089580911101262F30E0280F2F +:103F1000311D2F3F310524F4680F6093110108957E +:103F20008FEF80931101089580911001262F30E0CA +:103F3000280F311D2F3F310524F4680F60931001C5 +:103F400008958FEF809310010895833011F128F4C4 +:103F5000813049F0823091F00895853081F120F16F +:103F60008630C1F1089580911501681720F4861BF1 +:103F70008093150108951092150108958091140100 +:103F8000681720F4861B8093140108951092140181 +:103F9000089580911301681720F4861B8093130104 +:103FA000089510921301089580911201681720F46A +:103FB000861B80931201089510921201089580913A +:103FC0001101681720F4861B809311010895109247 +:103FD0001101089580911001681720F4861B8093C9 +:103FE000100108951092100108950F931F938D31C1 +:103FF00009F471C008F045C0803109F485C008F5A6 +:10400000873009F46FC068F4863009F0ADC0809144 +:10401000DF01817F8E7F8093DF0181E08093EF015C +:10402000A4C08B3009F49EC08E3009F09DC08091F1 +:10403000DF0182FB222720F991E0922790FB82F991 +:104040006CC0863109F48EC060F4813109F08CC0F7 +:104050000E94181590910D0181E0892780930D0130 +:1040600081C0893109F47EC08B3109F07DC0809117 +:10407000DF0181FB222720F991E0922790FB81F953 +:104080004CC0853309F466C048F4873209F462C035 +:1040900008F44FC0893209F45DC066C0833438F437 +:1040A0008A3308F044C0883309F45CC05DC08334AF +:1040B00009F450C0883409F057C00E9418150FEF5A +:1040C00013ED20E3015010402040E1F700C0000054 +:1040D0000E948D1C47C00E947F210E947F100E9479 +:1040E000790940C09091DF01892F8095817080FB14 +:1040F00090F929F0966098609093DF0136C0997F1F +:10410000977F9093DF012EC08091DF0183FB2227F0 +:1041100020F991E0922790FB83F98093DF019923A6 +:1041200009F18091DF0181608093DF011BC0895319 +:1041300001C08D5141E050E060E070E08A019B01D8 +:1041400004C0000F111F221F331F8A95D2F7C90127 +:10415000B80104C061E070E080E090E00E94D818EF +:104160000E94181581E001C080E01F910F91089511 +:1041700080E0089580E008958E518A3030F4E82F71 +:10418000F0E0E65DFE4F8081089580E00895CF93D2 +:10419000C82F8091EF01813079F018F08230E9F179 +:1041A00086C0E0910E01F0910F018081813169F0AC +:1041B000823209F07EC009C0E0910E01F0910F013A +:1041C0008081813111F0823261F48C2F0E94B820FD +:1041D000811104C08C2F0E94F51F1DC081E090E06A +:1041E0001AC08C2F0E94BA20811114C0C43179F0FA +:1041F00048F4CB3079F0C03109F05FC082E08093A1 +:10420000EF0108C0C93219F0C83321F056C010922E +:10421000EF0153C081E0817052C0C93281F110F5C5 +:10422000C43169F1A8F4C73009F045C08AE0809331 +:10423000150194E19093140193E0909313018093FE +:10424000120188E08093110188E28093100133C04D +:1042500082EE8C0F863078F58C2F0E94BC208093E4 +:10426000EE0129C0CE34E9F020F4CB3421F56AE028 +:1042700013C0C13579F0C235F1F461E00DC0809111 +:10428000EE01882319F01092EE0115C081E08093B1 +:10429000EF0115C061E006C08091EE010E942F1F62 +:1042A0000AC06AE08091EE010E94A51F04C010922E +:1042B000EF0180E004C081E002C080E0ACCFCF918C +:1042C0000895E1E8F0E080818860808380818160EA +:1042D00080838FB7F89493E09093890090ED90934A +:1042E00088008FBF0895EFE6F0E0808182608083D0 +:1042F0000895EFE6F0E080818D7F80830895EFE6FA +:10430000F0E0908182E08927808308951F920F92C8 +:104310000FB60F9211242F933F934F935F936F9398 +:104320007F938F939F93AF93BF93EF93FF9380916E +:10433000F0019091F10101969093F1018093F001C9 +:10434000811103C082E00E947909E091F101E695B4 +:10435000E695F0E0EB54FB4FE4918091F0018E1371 +:1043600003C080E00E947909FF91EF91BF91AF9166 +:104370009F918F917F916F915F914F913F912F917D +:104380000F900FBE0F901F9018950E94CC2168943B +:10439000B1110C945B2208950E94402288F09F572F +:1043A00098F0B92F9927B751B0F0E1F0660F771F59 +:1043B000881F991F1AF0BA95C9F714C0B13091F04F +:1043C0000E945A22B1E008950C945A22672F782F48 +:1043D0008827B85F39F0B93FCCF386957795679514 +:1043E000B395D9F73EF490958095709561957F4F80 +:1043F0008F4F9F4F0895E89409C097FB3EF4909526 +:104400008095709561957F4F8F4F9F4F9923A9F0AD +:10441000F92F96E9BB279395F6958795779567953C +:10442000B795F111F8CFFAF4BB0F11F460FF1BC080 +:104430006F5F7F4F8F4F9F4F16C0882311F096E913 +:1044400011C0772321F09EE8872F762F05C06623C1 +:1044500071F096E8862F70E060E02AF09A95660F7A +:10446000771F881FDAF7880F9695879597F9089533 +:1044700057FD9058440F551F59F05F3F71F0479515 +:10448000880F97FB991F61F09F3F79F087950895FA +:10449000121613061406551FF2CF4695F1DF08C019 +:1044A000161617061806991FF1CF86957105610536 +:1044B00008940895E894BB2766277727CB0197F9DE +:1044C00008950E9474220C94E5220E94D72238F0AD +:1044D0000E94DE2220F0952311F00C94CE220C9441 +:1044E000D42211240C945B220E94382270F3959FF1 +:1044F000C1F3950F50E0551F629FF001729FBB27DB +:10450000F00DB11D639FAA27F00DB11DAA1F649F76 +:104510006627B00DA11D661F829F2227B00DA11D29 +:10452000621F739FB00DA11D621F839FA00D611DAF +:10453000221F749F3327A00D611D231F849F600DD0 +:10454000211D822F762F6A2F11249F5750409AF0F9 +:10455000F1F088234AF0EE0FFF1FBB1F661F771F85 +:10456000881F91505040A9F79E3F510580F00C9450 +:10457000CE220C945B225F3FE4F3983ED4F3869501 +:1045800077956795B795F795E7959F5FC1F7FE2BF0 +:10459000880F911D9695879597F9089597F99F67CC +:1045A00080E870E060E008959FEF80EC08950024BB +:1045B0000A941616170618060906089500240A9488 +:1045C00012161306140605060895092E0394000C0E +:1045D00011F4882352F0BB0F40F4BF2B11F460FF9D +:1045E00004C06F5F7F4F8F4F9F4F089597FB072E3B +:1045F00016F4009407D077FD09D00E94102307FC21 +:1046000005D03EF4909581959F4F089570956195E2 +:104610007F4F0895EE0FFF1F0590F491E02D099450 +:10462000AA1BBB1B51E107C0AA1FBB1FA617B707D8 +:1046300010F0A61BB70B881F991F5A95A9F78095F4 +:104640009095BC01CD010895F999FECF92BD81BD31 +:10465000F89A992780B50895A8E1B0E042E050E0CB +:104660000C944B23262FF999FECF92BD81BDF89A69 +:10467000019700B4021631F020BD0FB6F894FA9AF3 +:10468000F99A0FBE08950196272F0E9433230C94A8 +:104690003223DC01CB01FC01F999FECF06C0F2BD4B +:1046A000E1BDF89A319600B40D9241505040B8F7F0 +:0646B0000895F894FFCF0D +:1046B60002207B09090AE609B2097E090101CC013B +:1046C60028080A03140A404D363975042804F203F3 +:1046D600B9034C0365037E03970301020304050631 +:0446E60007080900B8 +:00000001FF diff --git a/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c b/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c new file mode 100644 index 000000000..87b77e42e --- /dev/null +++ b/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 |CMD+{ | | CMD+}| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | Hyper| | Meh | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | + * |--------+------+------+------+------+------| LGui | | LGui |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Del |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(LSFT(KC_LBRC)), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + LGUI(LSFT(KC_RBRC)), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + MEH_T(KC_NO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, + KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_DELT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/tm2030/keymap.c b/keyboards/ergodox/keymaps/tm2030/keymap.c new file mode 100644 index 000000000..ca8075226 --- /dev/null +++ b/keyboards/ergodox/keymaps/tm2030/keymap.c @@ -0,0 +1,242 @@ +/* TypeMatrix-2030-like keymap */ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "led.h" + +#define BASE 0 // default layer +#define DVRK 1 // Dvorak layer +#define NUMR 8 // numeric layer +#define FNLR 9 // fn layer + +#define MDBL0 1 +#define MFNLR 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | ] | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T |Backsp| |Backsp| Y | U | I | O | P | [ | + * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| + * | LShift | A | S | D | F | G |------| |------| H | J | K | L | ; | '/Shift| + * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | \/Shift| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | - | Home | = |End/Ctl| + * `-----------------------------------' `-----------------------------------' + * ,--------------. ,-------------. + * |Esc/Alt| num | | Left |Right | + * ,------+-------+------| |------+------+------. + * | | | PgUp | | Up | | | + * |Space |LShift |------| |------|RShift|Space | + * | | | PgDn | | Down | | | + * `---------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT, + KC_LCTL, M(MFNLR), KC_LGUI,KC_MPLY,ALT_T(KC_APP), + + ALT_T(KC_ESC), TG(NUMR), + KC_PGUP, + KC_SPC, KC_LSFT, KC_PGDN, + + // right hand + KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, + KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, SFT_T(KC_QUOT), + KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_BSLS), + KC_RALT, KC_MINS, KC_HOME, KC_EQL, CTL_T(KC_END), + + KC_LEFT, KC_RGHT, + KC_UP, + KC_DOWN, KC_RSFT, KC_SPC + ), +/* Dvorak layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | ' | , | . | P | Y |Backsp| |Backsp| F | G | C | R | L | / | + * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| + * | LShift | A | O | E | U | I |------| |------| D | H | T | N | S | -/Shift| + * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| + * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | \/Shift| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | [ | Home | ] |End/Ctl| + * `-----------------------------------' `-----------------------------------' + * ,--------------. ,-------------. + * |Esc/Alt| num | | Left |Right | + * ,------+-------+------| |------+------+------. + * | | | PgUp | | Up | | | + * |Space |LShift |------| |------|RShift|Space | + * | | | PgDn | | Down | | | + * `---------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[DVRK] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_BSPC, + KC_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_ENT, + KC_LCTL, M(MFNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), + + ALT_T(KC_ESC), TG(NUMR), + KC_PGUP, + KC_SPC, KC_LSFT, KC_PGDN, + + // right hand + KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + KC_BSPC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, KC_S, SFT_T(KC_MINS), + KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_BSLS), + KC_RALT, KC_LBRC, KC_HOME, KC_RBRC, CTL_T(KC_END), + + KC_LEFT, KC_RGHT, + KC_UP, + KC_DOWN, KC_RSFT, KC_SPC + ), +/* Numeric Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | | | Tab | / | * | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | F6 | F7 | F8 | F9 | F10 | | | | | Home | 7 | 8 | 9 | + | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | F11 | F12 | | | |------| |------| Up | End | 4 | 5 | 6 | + | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | Left | Down | Right| 1 | 2 | 3 |KpEnter | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | 0 | 00 | . |Etr/Ctl| + * `----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | | | |n.lock|c.lock| + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[NUMR] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS, + KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_UP, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LEFT, KC_DOWN, KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_TRNS, KC_P0, M(MDBL0),KC_PDOT, CTL_T(KC_PENT), + + KC_NLCK, KC_CAPS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* fn layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | |Insert| |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk| + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | |VolUp | | | | | | | | Pause | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | Calc | Mail |Browsr|------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | cut | copy |paste | Mute |VolDn | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | Next | | | + * | Mute | |------| |------| | | + * | | | | | Prev | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[FNLR] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, + KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_MUTE, KC_TRNS, KC_TRNS, + // right hand + KC_INS, KC_EJCT, KC_PWR, KC_SLEP, KC_WAKE, KC_PSCR, KC_SLCK, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_MPRV, + KC_MNXT, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case MDBL0: + if (record->event.pressed) { + return MACRO( I(25), T(P0), T(P0), END ); + } + break; + case MFNLR: + layer_invert(NUMR); + layer_invert(FNLR); + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + // led 1: numeric layer + if (layer_state & (1 << NUMR)) { + ergodox_right_led_1_on(); + } + // led 2: Dvorak layer + if (default_layer_state == 1 << DVRK) { + ergodox_right_led_2_on(); + } + // led 3: caps lock + if (host_keyboard_leds() & (1<event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/tonyabra_osx/readme.md b/keyboards/ergodox/keymaps/tonyabra_osx/readme.md new file mode 100644 index 000000000..f9d76efc2 --- /dev/null +++ b/keyboards/ergodox/keymaps/tonyabra_osx/readme.md @@ -0,0 +1,5 @@ +# ErgoDox EZ OS X Simplified Configuration + +This keyboard configuration replaces the hyper and meh keys with the command key. It also removes all of the meta keys that require a "hold" because I found that I hesitate when I type, which can accidentally fire those combinations. On the upper left of the left hand, I mimicked the Mac placement of tab and escape, and on the upper right of the right hand, I placed an additional enter key for convenience when breezing through prompts. + +This is my standard working configuration for now, but I can see myself tweaking it as I use it more. I highly recommend you do the same. \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/townk_osx/config.h b/keyboards/ergodox/keymaps/townk_osx/config.h new file mode 100644 index 000000000..58ba690af --- /dev/null +++ b/keyboards/ergodox/keymaps/townk_osx/config.h @@ -0,0 +1,92 @@ +/* +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 t.m.k. keyboard firmware for Ergodox + +/* 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 COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } +#define ROWS (int []){ D0, D5, B5, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* 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 2 +#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 +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 3000 + +#endif diff --git a/keyboards/ergodox/keymaps/townk_osx/keymap.c b/keyboards/ergodox/keymaps/townk_osx/keymap.c new file mode 100644 index 000000000..07e58a491 --- /dev/null +++ b/keyboards/ergodox/keymaps/townk_osx/keymap.c @@ -0,0 +1,285 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "action_util.h" +#include "led.h" +#include "keymap.h" +#include "timer.h" + +/* + +# Why this Layout + +This layout was based on Kinesis layout and other ErgoDox user layouts +available. It's target to be used on a MacOS but I'm pretty sure it can be +addapted to Windows and/or Linux easily. + +## Function Key + +The `fn` key work almost like it would in any other keyboard with the exception +it has a semi-sticky behavior. What does that mean? + +Well, if you press the `fn` and release it, the keyboard will be put on the +_function layout_ and the next key stroke will be processed as if the `fn` key +was pressed. Aftwards, the leyout get back to _normal_. If you hold `fn` and +press any other key, when you release them, the keyboard leyout is back to +_normal_. + +While pressing the `fn` with the left hand and strikeing the other keys on the +right hand is farly easy, the same cannot being said for the other keys on the +left side. So, instead of trying to do contorcionism with my left hand, I +decided to do a semi-sticky version of `fn`. This way, I can press the `fn` +key with my pinky, release it and press the `1` key to issue an `F1` to the +operating system. + +## Key-Pad Key + +The `key pad` key is a layout switch key. If pressed, it will put the keyboard +on the _key pad layout_ and stay there until key is pressed again. + +This is used to make the keyboard behave mostly like a **num pad keyboard**. + +## Notes +- Regardless in which layout you are, keys from other layouts are not + accessible. This means that if you are on the _key pad layout_, the left hand + will be pretty much unusable. + Of course that like anything else, there are exceptions to this rule. + Modifiers should remain accessible throughout the layers. +- The _shift key_ is, like the _function key_, also configured to have a sticky + behavior. +- All sticky keys have a timeout of 3 seconds. + +*/ +#define BASE 0 +#define KEYPAD 1 +#define FN 2 + +#define MACRO_TMUX_ESC 10 +#define MACRO_TMUX_PASTE 11 +#define MACRO_OSX_COPY 12 +#define MACRO_OSX_PASTE 13 + +#define M_TESC M(MACRO_TMUX_ESC) +#define M_TPASTE M(MACRO_TMUX_PASTE) +#define M_OSXCPY M(MACRO_OSX_COPY) +#define M_OSXPST M(MACRO_OSX_PASTE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Base Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | `~ | 1 | 2 | 3 | 4 | 5 | ESC | | Pwr | 6 | 7 | 8 | 9 | 0 | - _ | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | Tab | Q | W | E | R | T | F16 | | F17 | Y | U | I | O | P | = + | + * |-----------+------+------+------+------+------| Meh | | Meh |------+------+------+------+------+-----------| + * | \ (Ctrl) | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " (Ctrl)| + * |-----------+------+------+------+------+------| F18 | | F19 |------+------+------+------+------+-----------| + * | LShift | Z | X | C | V | B | Hyper| | Hyper| N | M | , | . | / | RShift | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | FN | KPAD |LCtrl | LAlt | LGui | | RGui | RAlt | RCtrl| KPAD | FN | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | M(0) | M(1) | | M(2) | M(3) | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * |Backsp| Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' + * + * M(0) = Ctrk+A Esc + * (this is used to issue the Esc key to the Tmux application) + * M(1) = Ctrk+A P + * (this is used to issue the Paste key to the Tmux application) + * M(2) = Cmd+C + * M(3) = Cmd+V + */ +[BASE]=KEYMAP(//left half + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_F16), + CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_FN2, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_F18), + KC_FN1, TG(KEYPAD), KC_LCTRL, KC_LALT, KC_LGUI, + M_TESC, M_TPASTE, + KC_HOME, + KC_BSPC, KC_DELT, KC_END, + //right half + KC_POWER, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + MEH_T(KC_F17), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), + ALL_T(KC_F19), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN2, + KC_RGUI, KC_RALT, CTL_T(KC_LBRC), KC_FN3, KC_FN1, + M_OSXCPY, M_OSXPST, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC), + +/* Keymap 1: KeyPad Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | | LClk | RClk | MClk | | | | BTab | Clear| / | * | ^ | ( | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | M.Accel 2 | |ScrlUp| U |ScrlDn| | | | Tab | 7 | 8 | 9 | + | ) | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | M.Accel 1 | | L | D | R | |------| |------| 4 | 5 | 6 | - | | | + * |-----------+------+------+------+------+------| | |Return|------+------+------+------+------+-----------| + * | M.Accel 0 | |ScrlL | |ScrlR | | | | | 1 | 2 | 3 | = | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | XXXX | | | | | 0 | . | , | XXXX | | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | XXXX | | + * | | |------| |------| XXXX | | + * | | | | | | XXXX | | + * `--------------------' `--------------------' + */ +[KEYPAD]=KEYMAP(//left half + KC_NO, KC_NO, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, KC_NO, KC_NO, + KC_MS_ACCEL2, KC_NO, KC_MS_WH_UP, KC_MS_U, KC_MS_WH_DOWN, KC_NO, KC_NO, + KC_MS_ACCEL1, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, + KC_MS_ACCEL0, KC_NO, KC_MS_WH_LEFT, KC_NO, KC_MS_WH_RIGHT, KC_NO, KC_NO, + KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO, + //right half + LSFT(KC_TAB), KC_CLEAR, KC_KP_SLASH, KC_KP_ASTERISK, KC_CIRCUMFLEX, KC_LPRN, KC_NO, + KC_TAB, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_RPRN, KC_NO, + KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_NO, KC_NO, + KC_KP_ENTER, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_EQUAL, KC_NO, KC_NO, + KC_KP_0, KC_KP_DOT, KC_KP_COMMA, KC_TRNS, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_TRNS, KC_NO), + +/* Keymap 2: Functions Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | Vol. Up | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | Stop | Rw | Rec | FF | | XXXX | | XXXX | | | | | | Vol. Down | + * |-----------+------+------+------+------+------| XXXX | | XXXX |------+------+------+------+------+-----------| + * | CapsLock | Eject| Prev | Play | Next | |------| |------| Left | Down | Up | Right| | Mute | + * |-----------+------+------+------+------+------| XXXX | | XXXX |------+------+------+------+------+-----------| + * | L Shift | | | | | | XXXX | | XXXX | | | | | | R Shift | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | XXXXX | | XXXX | XXXX | XXXX | | XXXX | XXXX | XXXX | | XXXXX | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + * + * XXX = These keys are transparent keys that, when pressed, they issue the key from the previous layer. + */ +[FN]=KEYMAP(//left half + KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_NO, KC_MEDIA_STOP, KC_MEDIA_REWIND, KC_MEDIA_SELECT, KC_MEDIA_FAST_FORWARD, KC_NO, KC_TRNS, + KC_CAPS, KC_MEDIA_EJECT, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_NO, + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO, + //right half + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLU, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLD, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO, KC_MUTE, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO)}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_ONESHOT(FN), + [2] = ACTION_MODS_ONESHOT(MOD_LSFT), // Sticky shift light. Tap for the next keypress to be shifted. Hold for regular shift. + [3] = ACTION_LAYER_TAP_KEY(KEYPAD, KC_RBRC), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + // MACRODOWN only works in this function + switch(id) { + case MACRO_TMUX_ESC: + if (record->event.pressed) { + return MACRO(D(LCTRL), T(A), U(LCTRL), D(ESC), END); + } + return MACRO(U(ESC), END); + case MACRO_TMUX_PASTE: + if (record->event.pressed) { + return MACRO(D(LCTRL), T(A), U(LCTRL), D(P), END); + } + return MACRO(U(P), END); + case MACRO_OSX_COPY: + if (record->event.pressed) { + return MACRO(D(LGUI), D(C), END); + } + return MACRO(U(C), U(LGUI), END); + case MACRO_OSX_PASTE: + if (record->event.pressed) { + return MACRO(D(LGUI), D(V), END); + } + return MACRO(U(V), U(LGUI), END); + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +uint8_t current_layer = BASE; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_led_all_off(); + ergodox_led_all_set(LED_BRIGHTNESS_LO); + + switch (layer) { + case BASE: + current_layer = BASE; + break; + case KEYPAD: + current_layer = KEYPAD; + break; + default: + // none + break; + } + + // layer leds + if (current_layer == KEYPAD) { + ergodox_right_led_3_on(); + } + + // capslock + if (host_keyboard_leds() & (3<mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) && // is shift pressed and there is no other + !(keyboard_report->mods & (~MOD_BIT(KC_LSFT) & ~MOD_BIT(KC_RSFT)))) || // modifier being pressed as well + (get_oneshot_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) && !has_oneshot_mods_timed_out())) { // or the one shot shift didn't timed out + ergodox_right_led_1_set(LED_BRIGHTNESS_HI); + ergodox_right_led_1_on(); + } +}; diff --git a/keyboards/ergodox/keymaps/townk_osx/makefile.mk b/keyboards/ergodox/keymaps/townk_osx/makefile.mk new file mode 100644 index 000000000..e757557bd --- /dev/null +++ b/keyboards/ergodox/keymaps/townk_osx/makefile.mk @@ -0,0 +1,4 @@ +# I don't want my keyboard blinking lights when is suppose to be asleep. +SLEEP_LED_ENABLE = no + +CONFIG_H = keymaps/$(KEYMAP)/config.h diff --git a/keyboards/ergodox/keymaps/townk_osx/readme.md b/keyboards/ergodox/keymaps/townk_osx/readme.md new file mode 100644 index 000000000..c2853ca17 --- /dev/null +++ b/keyboards/ergodox/keymaps/townk_osx/readme.md @@ -0,0 +1,77 @@ +# Townk's Keymap + +Trying to take care of an enjury on my arm I borrow an ergonomic keyboard from +a frient ([Kinesis Advantage](http://www.kinesis-ergo.com/shop/advantage-pro-for-pc-mac/)). + +I really enjoyed my time with it but there were some anoyancies: + +* The curvature on the keys bothered me since I'm a Vim user and using the + motion keys on my editor was awkard. +* I had to spend too much time remapping the keyboard to make some symbol keys + more accessible to me. +* The fact that my hands had to stay close to each other was a bit stressfull + to my sholders. + +After a long research I find out that Ergodox EZ would be perfect for my needs +and purchase one. Before the keyboard even got in my hands I started to think +on the layout I would use on it and soon enough I planed couple adjustments +from the Kinesis I was using so far. + +## The layout + +Here are the layout mapping in images so you can have a glimpse on it: + +![Base Layout](townk_osx_base.png) +![fn Layout](townk_osx_fn.png) +![Keypad & Mouse Layout](townk_osx_keypad.png) + +Notice that, differently from the default behavior, my layer keys are not transparent +by default, which means that if you press any non-labeled white key, nothing will be +handled to the OS. + +### One shot keys + +It all started with the access to the function keys (F1, F2, F3...), since +those keys are located on a different layer I needed a way to press them with +minimal effort without disrupting my flow. + +For me, togglihg a layer to press a button and than toggle it back is a waste +of time (although I admit it's a single tap from what I have), so I decided to +do it as a one shot key. I could press it and the next pressed key would be +handled by the target layer which just after it delivers the key to the OS it +would get back to the previous layer. + +After setting up my layout to do just that I realized that occasionally I +would stop myseld on the middle of the process and the one shot layer would be +still triggered until I press any other key. So to prevent me from tapping +keys I don't want I added a timeout of 3 seconds for the one shot actions. + +Ultimately I tested the shift key as a one shot one and really like it, so +here you have it, all the one shot keys on my layout. + +## Glossary + +If you're not familiar with the Mac symbols used on some keys, here is a +reference to them: + +| Symbol | Description | +| :----: | ------------------- | +| ⌘ | Command | +| ⇪ | Caps Lock | +| ⇧ | Shift | +| ⌥ | Option (alt) | +| ⎋ | Esc | +| ⇥ | Tab forward | +| ⇤ | Tab backward | +| ⌃ | Control | +| ⣠| Space | +| ⌫ | Backspace | +| ⌦ | Delete | +| ⎠| Enter | +| ⌤ | Return | +| ⌽ | Power on/off button | +| ↖ | Home | +| ↘ | End | +| ⇞ | Page up | +| ⇟ | Page down | +| ⌧ | Clear | diff --git a/keyboards/ergodox/keymaps/townk_osx/townk_osx_base.png b/keyboards/ergodox/keymaps/townk_osx/townk_osx_base.png new file mode 100644 index 000000000..f9bc8b443 Binary files /dev/null and b/keyboards/ergodox/keymaps/townk_osx/townk_osx_base.png differ diff --git a/keyboards/ergodox/keymaps/townk_osx/townk_osx_fn.png b/keyboards/ergodox/keymaps/townk_osx/townk_osx_fn.png new file mode 100644 index 000000000..983b72348 Binary files /dev/null and b/keyboards/ergodox/keymaps/townk_osx/townk_osx_fn.png differ diff --git a/keyboards/ergodox/keymaps/townk_osx/townk_osx_keypad.png b/keyboards/ergodox/keymaps/townk_osx/townk_osx_keypad.png new file mode 100644 index 000000000..8f04b4327 Binary files /dev/null and b/keyboards/ergodox/keymaps/townk_osx/townk_osx_keypad.png differ diff --git a/keyboards/ergodox/keymaps/twey/keymap.c b/keyboards/ergodox/keymaps/twey/keymap.c new file mode 100644 index 000000000..019930f2a --- /dev/null +++ b/keyboards/ergodox/keymaps/twey/keymap.c @@ -0,0 +1,221 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +#include "keymap_plover.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define STEN 2 // steno +#define MDIA 3 // media keys + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,---------------------------------------------------. ,---------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | STEN | | NONE | 6 | 7 | 8 | 9 | 0 | \ | + * |--------+------+------+------+-------+-------------| |-------+------+------+------+------+------+--------| + * | Del | ' | , | . | P | Y | Esc | | Caps | F | G | C | R | L | / | + * |--------+------+------+------+-------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | O | E | U | I |------| |-------| D | H | T | N | S | - | + * |--------+------+------+------+-------+------| Tab | | Enter |------+------+------+------+------+--------| + * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | + * `--------+------+------+------+-------+-------------' `--------------+------+------+------+------+--------' + * | L1 | NONE | Grv | Left | Right | | Up | Down | [ | ] | L1 | + * `-----------------------------------' `----------------------------------' + * ,--------------. ,---------------. + * | PgUp | PgDn | | Home | End | + * ,------|-------|------| |-------+-------+------. + * | | | NONE | | AltGr | | | + * | Alt | Enter |------| |-------| Space | Ctrl | + * | | | Supr | | ~MDIA | | | + * `---------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, M(0), + KC_DELT, KC_QUOT, KC_COMM,KC_DOT, KC_P, KC_Y, KC_ESC, + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_TAB, + MO(SYMB), KC_NO, KC_GRV, KC_LEFT,KC_RGHT, + KC_PGUP,KC_PGDN, + KC_NO, + KC_LALT,KC_ENT ,KC_LGUI, + // right hand + KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + KC_CAPS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z , KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, MO(SYMB), + KC_HOME, KC_END, + KC_RALT, + MO(MDIA),KC_SPC,KC_RCTL + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + +[STEN] = KEYMAP( // layout: layer 2: Steno for Plover + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_STAR, + KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, + KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, + KC_TRNS,KC_NO, KC_NO, KC_TRNS, KC_TRNS, + KC_NO, KC_NO, + KC_NO, + PV_A, PV_O, KC_NO, + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + PV_STAR, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, + PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, + PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, + KC_NO, KC_NO, + KC_NO, + KC_TRNS,PV_E, PV_U +), + +/* Keymap 3: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | Back | | Frwd | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | Prev | Play | Next | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK, KC_TRNS, KC_WFWD, KC_TRNS, KC_TRNS, + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(MDIA) // FN1 - Momentary Layer 3 (Media) +}; + +void toggle_steno(int pressed) +{ + uint8_t layer = biton32(layer_state); + + if (pressed) { + if (layer != STEN) layer_on(STEN); else layer_off(STEN); + + register_code(PV_LP); + register_code(PV_LH); + register_code(PV_LR); + register_code(PV_O); + register_code(PV_RL); + register_code(PV_RG); + } else { + unregister_code(PV_LP); + unregister_code(PV_LH); + unregister_code(PV_LR); + unregister_code(PV_O); + unregister_code(PV_RL); + unregister_code(PV_RG); + } +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + toggle_steno(record->event.pressed); + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint32_t layer0 = layer_state & (1UL << 0), + layer1 = layer_state & (1UL << 1), + layer2 = layer_state & (1UL << 2), + layer3 = layer_state & (1UL << 3); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + + if (layer1) ergodox_right_led_1_on(); + if (layer2) ergodox_right_led_2_on(); + if (layer3) ergodox_right_led_3_on(); +}; diff --git a/keyboards/ergodox/keymaps/twey/readme.md b/keyboards/ergodox/keymaps/twey/readme.md new file mode 100644 index 000000000..979e4261e --- /dev/null +++ b/keyboards/ergodox/keymaps/twey/readme.md @@ -0,0 +1,17 @@ +# Twey's Home Configuration +## Layers +- Layer 0: Non-ANSI Dvorak layout, with modified modifiers — all + modifiers on thumb keys, as well as return and space. +- Layer 1: Default symbol layout. +- Layer 2: Plover-oriented stenography layer. +- Layer 3: Extended media/mouse layout. + +## Unusual features +The Plover key (top right key on the left half) also sends my Plover +‘toggle’ chord (SH-FT) when pressed, as well as toggling the steno +layer, so you can toggle between steno and typing modes with a single +keypress. + +If you want to use this feature, you'll need to add the +`commands.json` dictionary to your Plover dictionaries, or define the +toggle stroke (`PHROLG`) yourself. diff --git a/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c b/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c new file mode 100644 index 000000000..8effa53b2 --- /dev/null +++ b/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c @@ -0,0 +1,366 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" +// readme +// This keyboard layout is based on the [Workman Dead layout](https://github.com/ojbucao/Workman/tree/master/mac#workman-dead-for-programmers), which uses the comma as a dead key to trigger a second layer. +// Since I have more keys at my disposal on the ErgoDox, I moved the dead key to the bottom right. There are still a lot of +// blanks so still discovering what I like. +// If you aren't familiar with a dead key, the idea is that you tap the dead key which switches the layout. the next key you hit +// triggers the key you pressed AND switches the layout back to the original. For now I do this with a super kludgey macro and I +// look forward to learning about a more elegant way to do the same thing. Until then, this will have to do. + + +// TODO: Define layer names that make sense for the ErgoDox EZ. +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys +#define DEAD 3 // dead version of the symbols layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | D | R | W | B | L1 | | L1 | J | F | U | P | ; | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Hyper | A | S | H | T | G |------| |------| Y | N | E | O | I | ' | + * |--------+------+------+------+------+------| | | Meh |------+------+------+------+------+--------| + * | LShift | Z | X | M | C | V | | | | K | L | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | CTRL | OPT | CMD | | Left | Down | Up | Right| L3 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * |Bckspc| Space|------| |------| Space |Enter | + * | | | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(1), + ALL_T(KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, + KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_NO, + KC_NO, KC_NO, KC_LCTL,KC_LALT,KC_LGUI, + KC_NO, KC_NO, + KC_HOME, + KC_BSPC,KC_SPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(1), KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, + KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, + MEH_T(KC_NO),KC_K, KC_L, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, KC_FN4, + KC_NO, KC_NO, + KC_PGUP, + KC_PGDN,KC_SPC,KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | % | & | ? | + | @ | | | | $ | _ | [ | ] | ! | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | / | ( | = | 0 | { |------| |------| } | 1 | * | ) | - | " | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | 6 | 7 | 8 | 9 | | | | | | \ | 2 | 3 | 4 | 5 | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_PERC, KC_AMPR, LSFT(KC_SLSH), LSFT(KC_EQL), KC_AT, KC_TRNS, + KC_TRNS, KC_SLSH, KC_LPRN, KC_EQL, KC_0, LSFT(KC_LBRC), + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_PIPE, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_DLR, KC_UNDERSCORE, KC_LBRC, KC_RBRC, KC_EXLM, KC_F12, + KC_RCBR, KC_1, KC_ASTR, KC_RPRN, KC_MINS, KC_QUOT, + KC_TRNS, KC_SLSH, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +/* Keymap 4: Dead Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | % | & | ? | + | @ | | | | $ | _ | [ | ] | ! | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | / | ( | = | 0 | { |------| |------| } | 1 | * | ) | - | " | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | 6 | 7 | 8 | 9 | | | | | | \ | 2 | 3 | 4 | 5 | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[DEAD] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, M(100), M(101), M(102), M(103), M(104), KC_TRNS, + KC_TRNS, M(109), M(110), M(111), M(112), M(113), + KC_TRNS, M(120), M(121), M(122), M(123), M(124), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, M(105), M(106), M(107), M(108), M(130), KC_F12, + M(114), M(115), M(116), M(117), M(118), M(119), + KC_TRNS, M(125), M(126), M(127), M(128), M(129), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) + [2] = ACTION_LAYER_ON(BASE,0), // FN2 - Go back to the base layer + [3] = ACTION_LAYER_ON(DEAD,0), + [4] = ACTION_LAYER_TOGGLE(DEAD), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + case 100: + layer_clear(); + return MACRODOWN(D(LSFT), T(5), U(LSFT), T(FN4), END); + break; + case 101: + layer_clear(); + return MACRODOWN(D(LSFT), T(7), U(LSFT), T(FN4), END); + break; + case 102: + layer_clear(); + return MACRODOWN(D(LSFT), T(SLSH), U(LSFT), T(FN4), END); + break; + case 103: + layer_clear(); + return MACRODOWN(D(LSFT), T(EQL), U(LSFT), T(FN4), END); + break; + case 104: + layer_clear(); + return MACRODOWN(D(LSFT), T(2), U(LSFT), T(FN4), END); + break; + case 105: + layer_clear(); + return MACRODOWN(D(LSFT), T(4), U(LSFT), T(FN4), END); + break; + case 106: + layer_clear(); + return MACRODOWN(D(LSFT), T(MINS), U(LSFT), T(FN4), END); + break; + case 107: + layer_clear(); + return MACRODOWN(T(LBRC), T(FN4), END); + break; + case 108: + layer_clear(); + return MACRODOWN(T(RBRC), T(FN4), END); + break; + case 130: + layer_clear(); + return MACRODOWN(D(LSFT), T(1), U(LSFT), T(FN4), END); + break; + case 109: + layer_clear(); + return MACRODOWN(T(SLSH), T(FN4), END); + break; + case 110: + layer_clear(); + return MACRODOWN(D(LSFT), T(9), U(LSFT), T(FN4), END); + break; + case 111: + layer_clear(); + return MACRODOWN(T(EQL), T(FN4), END); + break; + case 112: + layer_clear(); + return MACRODOWN(T(0), T(FN4), END); + break; + case 113: + layer_clear(); + return MACRODOWN(D(LSFT), T(LBRC), U(LSFT), T(FN4), END); + break; + case 114: + layer_clear(); + return MACRODOWN(D(LSFT), T(RBRC), U(LSFT), T(FN4), END); + break; + case 115: + layer_clear(); + return MACRODOWN(T(1), T(FN4), END); + break; + case 116: + layer_clear(); + return MACRODOWN(D(LSFT), T(8), U(LSFT), T(FN4), END); + break; + case 117: + layer_clear(); + return MACRODOWN(D(LSFT), T(0), U(LSFT), T(FN4), END); + break; + case 118: + layer_clear(); + return MACRODOWN(T(MINS), T(FN4), END); + break; + case 119: + layer_clear(); + return MACRODOWN(D(LSFT), T(QUOT), U(LSFT), T(FN4), END); + break; + case 120: + layer_clear(); + return MACRODOWN(T(6), T(FN4), END); + break; + case 121: + layer_clear(); + return MACRODOWN(T(7), T(FN4), END); + break; + case 122: + layer_clear(); + return MACRODOWN(T(8), T(FN4), END); + break; + case 123: + layer_clear(); + return MACRODOWN(T(9), T(FN4), END); + break; + case 124: + layer_clear(); + return MACRODOWN(D(LSFT), T(BSLS), U(LSFT), T(FN4), END); + break; + case 125: + layer_clear(); + return MACRODOWN(T(BSLS), T(FN4), END); + break; + case 126: + layer_clear(); + return MACRODOWN(T(2), T(FN4), END); + break; + case 127: + layer_clear(); + return MACRODOWN(T(3), T(FN4), END); + break; + case 128: + layer_clear(); + return MACRODOWN(T(4), T(FN4), END); + break; + case 129: + layer_clear(); + return MACRODOWN(T(5), T(FN4), END); + break; + + default: + return MACRO_NONE; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/zweihander-osx/keymap.c b/keyboards/ergodox/keymaps/zweihander-osx/keymap.c new file mode 100644 index 000000000..3444152bc --- /dev/null +++ b/keyboards/ergodox/keymaps/zweihander-osx/keymap.c @@ -0,0 +1,233 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +#define SGWK 0 // "sagewick", ⌘S ⌘⇥ +#define SGWF 1 // "sagewick freshly", ⌘S ⌘⇥ ⌘R +#define BBED 2 // BBEdit +#define TMNL 3 // Terminal +#define SAFA 4 // Safari +#define ALFRED_LEAD_TIME 100 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | L1 | | L1 | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ⌦ | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / L⌘ | + * |--------+------+------+------+------+------| L⌘ | | L⌘ |------+------+------+------+------+--------| + * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / / ⌃| R⇧ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | L⌃ | L⌥ | L⌘ | ↠| → | | ↑ | ↓ | [ | ] | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | `~ | '" | | ⎋ | ⌫ | + * ,------|------|------| |------+--------+------. + * | | | PgUp | | PgDn | | | + * | | ⌫ |------| |------| ⇥ |Enter | + * | | | L⌥ | | L⌃ | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, + KC_LCTL, KC_LALT, KC_LGUI,KC_LEFT,KC_RGHT, + KC_GRV, KC_QUOT, + KC_PGUP, + KC_SPC,KC_BSPC,KC_LALT, + // right hand + TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_SPC , + KC_ESC, KC_BSPC, + KC_PGDN, + KC_LCTL, KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | [ | ] | { | } | " | | | | / | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | & | 1 | 2 | 3 | = | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | 0 | . | ↠| → | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | Home | | | + * | | |------| |------| | | + * | | | | | End | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQUO,KC_TRNS, + KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, + KC_0, KC_DOT, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_HOME, + KC_END , KC_TRNS, KC_TRNS +), +/* Keymap 2: Media keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | Power | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | PgUp |⌘S⌘⇥⌘R| Term | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |Safari| PgDn | | |------| |------| ⌘[ | ↠| ↓ | → | | ⯠| + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | |BBEdit| | | |L⇧+Spc| Spc | â® | â­ | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | Home | | End | | | + * | | |------| |------| ⌘C | ⌘V | + * | | | | | ⌘X | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_F14 , KC_F15 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /* F14 dims screen, F15 brightens */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, M(SGWF), M(TMNL), KC_TRNS, + KC_TRNS, KC_TRNS, M(SAFA), KC_PGDN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(BBED), KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_HOME, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR, + KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, + LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY, + KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + LGUI(KC_X), LGUI(KC_C), LGUI(KC_V) +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case SGWK: + if (record->event.pressed) { + return MACRO( + I(10), + D(LGUI), T(S), U(LGUI), + D(LGUI), T(TAB), U(LGUI), + END); + } + break; + case SGWF: + if (record->event.pressed) { + return MACRO( + I(10), + D(LGUI), T(S), U(LGUI), + D(LGUI), T(TAB), U(LGUI), + D(LGUI), T(R), U(LGUI), + END); + } + break; + case BBED: + if (record->event.pressed) { + return MACRO( + I(10), + D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), + T(B), T(B), T(E), T(D), T(I), T(T), + T(ENT), + END); + } + break; + case TMNL: + if (record->event.pressed) { + return MACRO( + I(10), + D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), + T(T), T(E), T(R), T(M), T(I), T(N), T(A), T(L), + T(ENT), + END); + } + break; + case SAFA: + if (record->event.pressed) { + return MACRO( + I(10), + D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), + T(S), T(A), T(F), T(A), T(R), T(I), + T(ENT), + END); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/zweihander-osx/readme.markdown b/keyboards/ergodox/keymaps/zweihander-osx/readme.markdown new file mode 100644 index 000000000..7bce7c690 --- /dev/null +++ b/keyboards/ergodox/keymaps/zweihander-osx/readme.markdown @@ -0,0 +1,45 @@ +# The Zweihander Layout + +NB: the backtick (\`) is special in Markdown. If I write ⌘\` in this readme, I mean “command-backtickâ€, not “command-backslash-backtickâ€. + +This layout is tuned for people who… + + +## use OS X + +This layout doesn’t make any concessions for Windows use. While it should work fine in Windows, I’m not about to devote precious keyboard space to Windows-specific shortcuts. + + +## mouse left-handed while doing other things with the right hand + +I tend to have my mouse in my left hand, but I like to use my other hand to make things go faster. I’ve added a bunch of buttons to the media layer to speed up browsing in Safari and Finder: + +- Close Window (⌘W) +- Back (⌘[) +- Forward (⌘]) +- Open and Close Parent Folder (⌥⌘↓) +- Go Up and Close Just-Left Folder (⌥⌘↑) +- Cycle through open windows in current application (⌘\` and ⌘⇧\`) +- Cycle through tabs in current window (⌥⇥ and ⌥⇧⇥) +- Space (page down in browsers; Quick Look in the Finder) +- Shift-Space (page up in web browsers) + +Because moving letter-by-letter is way slower than moving word-by-word, I added Option (⌥) to the bottommost button on the left side. This key can be held easily while holding ; (activate media layer) and pressing J and L to move left and right by word. + + +## use lots of modifier keys in OS X menu-item shortcuts + +I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once; this is why the bottom left of the keyboard has shift, control, option, and command in the usual spaces. Further, some common shortcuts I press have a key on the right side of the keyboard. These shortcuts include: + +- Empty Trash Without Asking for Confirmation (⇧⌥⌘⌫) +- Shut Down Without Asking for Confirmation (⇧⌥⌘ power) + + +## use Emacs-style shortcuts + +I press C-a, C-e, and C-k all the time. It’s difficult to press these key combinations with the control key on the bottom left and I’m too quick on the draw for the control function on the / key to work reliably, so the bottommost thumb button on the right side is another control key. + + +## use spreadsheets + +All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. diff --git a/keyboards/ergodox_ez/190hotfix.sh b/keyboards/ergodox_ez/190hotfix.sh deleted file mode 100755 index bdc3adce2..000000000 --- a/keyboards/ergodox_ez/190hotfix.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -#a tool to fix broken keymaps as a result of pull request #190 -#changing the declaration of matrix_scan_user() and matrix_init_user() -# -#This script will save a copy of the specified keymap as keymap.c.bak -#and then create a new keymap.c with the definion corrected. -#this script must be run from the ergodox_ez directory -if [ $# -ne 1 ]; then - echo $0: usage: ./190hotfix keymap_name - exit 1 -fi - -echo Saving backup as ./keymaps/$1/keymap.c.bak ... -mv ./keymaps/$1/keymap.c ./keymaps/$1/keymap.c.bak - -echo Modifying ./keymaps/$1/keymap.c ... -cat ./keymaps/$1/keymap.c.bak | sed -r 's/^void \* matrix_/void matrix_/'>./keymaps/$1/keymap.c - -echo Complete! diff --git a/keyboards/ergodox_ez/Makefile b/keyboards/ergodox_ez/Makefile deleted file mode 100644 index 54edaed6d..000000000 --- a/keyboards/ergodox_ez/Makefile +++ /dev/null @@ -1,86 +0,0 @@ -#---------------------------------------------------------------------------- -# 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). -# -#---------------------------------------------------------------------------- - -# # project specific files -SRC = twimaster.c \ - matrix.c - -# MCU name -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -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 -endif diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h deleted file mode 100644 index 2bb56731b..000000000 --- a/keyboards/ergodox_ez/config.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -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 diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c deleted file mode 100644 index f0558d9f2..000000000 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "ergodox_ez.h" -#include "i2cmaster.h" - -bool i2c_initialized = 0; -uint8_t mcp23018_status = 0x20; - -void matrix_init_kb(void) { - // keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md") - TCCR1A = 0b10101001; // set and configure fast PWM - TCCR1B = 0b00001001; // set and configure fast PWM - - // (tied to Vcc for hardware convenience) - DDRB &= ~(1<<4); // set B(4) as input - PORTB &= ~(1<<4); // set B(4) internal pull-up disabled - - // unused pins - C7, D4, D5, D7, E6 - // set as input with internal pull-ip enabled - DDRC &= ~(1<<7); - DDRD &= ~(1<<7 | 1<<5 | 1<<4); - DDRE &= ~(1<<6); - PORTC |= (1<<7); - PORTD |= (1<<7 | 1<<5 | 1<<4); - PORTE |= (1<<6); - - ergodox_blink_all_leds(); - - matrix_init_user(); -} - -void ergodox_blink_all_leds(void) -{ - ergodox_led_all_off(); - ergodox_led_all_set(LED_BRIGHTNESS_HI); - ergodox_right_led_1_on(); - _delay_ms(50); - ergodox_right_led_2_on(); - _delay_ms(50); - ergodox_right_led_3_on(); - _delay_ms(50); - ergodox_right_led_1_off(); - _delay_ms(50); - ergodox_right_led_2_off(); - _delay_ms(50); - ergodox_right_led_3_off(); - //ergodox_led_all_on(); - //_delay_ms(333); - ergodox_led_all_off(); -} - -uint8_t init_mcp23018(void) { - mcp23018_status = 0x20; - - // I2C subsystem - if (i2c_initialized == 0) { - i2c_init(); // on pins D(1,0) - i2c_initialized++; - _delay_ms(1000); - } - - // set pin direction - // - unused : input : 1 - // - input : input : 1 - // - driving : output : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; - i2c_stop(); - - // set pull-up - // - unused : on : 1 - // - input : on : 1 - // - driving : off : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out; - -out: - i2c_stop(); - - return mcp23018_status; -} - - diff --git a/keyboards/ergodox_ez/ergodox_ez.h b/keyboards/ergodox_ez/ergodox_ez.h deleted file mode 100644 index db4ec867b..000000000 --- a/keyboards/ergodox_ez/ergodox_ez.h +++ /dev/null @@ -1,122 +0,0 @@ -#ifndef ERGODOX_EZ_H -#define ERGODOX_EZ_H - -#include "quantum.h" -#include -#include -#include "i2cmaster.h" -#include - -#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) -#define CPU_16MHz 0x00 - -// I2C aliases and register addresses (see "mcp23018.md") -#define I2C_ADDR 0b0100000 -#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) -#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ ) -#define IODIRA 0x00 // i/o direction register -#define IODIRB 0x01 -#define GPPUA 0x0C // GPIO pull-up resistor register -#define GPPUB 0x0D -#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT) -#define GPIOB 0x13 -#define OLATA 0x14 // output latch register -#define OLATB 0x15 - -extern uint8_t mcp23018_status; - -void init_ergodox(void); -void ergodox_blink_all_leds(void); -uint8_t init_mcp23018(void); -uint8_t ergodox_left_leds_update(void); - -#define LED_BRIGHTNESS_LO 15 -#define LED_BRIGHTNESS_HI 255 - - -inline void ergodox_board_led_on(void) { DDRD |= (1<<6); PORTD |= (1<<6); } -inline void ergodox_right_led_1_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); } -inline void ergodox_right_led_2_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } -inline void ergodox_right_led_3_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } -inline void ergodox_right_led_on(uint8_t led) { DDRB |= (1<<(led+4)); PORTB |= (1<<(led+4)); } - -inline void ergodox_board_led_off(void) { DDRD &= ~(1<<6); PORTD &= ~(1<<6); } -inline void ergodox_right_led_1_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); } -inline void ergodox_right_led_2_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); } -inline void ergodox_right_led_3_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); } -inline void ergodox_right_led_off(uint8_t led) { DDRB &= ~(1<<(led+4)); PORTB &= ~(1<<(led+4)); } - -inline void ergodox_led_all_on(void) -{ - ergodox_board_led_on(); - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); -} - -inline void ergodox_led_all_off(void) -{ - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); -} - -inline void ergodox_right_led_1_set(uint8_t n) { OCR1A = n; } -inline void ergodox_right_led_2_set(uint8_t n) { OCR1B = n; } -inline void ergodox_right_led_3_set(uint8_t n) { OCR1C = n; } -inline void ergodox_right_led_set(uint8_t led, uint8_t n) { - (led == 1) ? (OCR1A = n) : - (led == 2) ? (OCR1B = n) : - (OCR1C = n); -} - -inline void ergodox_led_all_set(uint8_t n) -{ - ergodox_right_led_1_set(n); - ergodox_right_led_2_set(n); - ergodox_right_led_3_set(n); -} - -#define KEYMAP( \ - \ - /* left hand, spatial positions */ \ - k00,k01,k02,k03,k04,k05,k06, \ - k10,k11,k12,k13,k14,k15,k16, \ - k20,k21,k22,k23,k24,k25, \ - k30,k31,k32,k33,k34,k35,k36, \ - k40,k41,k42,k43,k44, \ - k55,k56, \ - k54, \ - k53,k52,k51, \ - \ - /* right hand, spatial positions */ \ - k07,k08,k09,k0A,k0B,k0C,k0D, \ - k17,k18,k19,k1A,k1B,k1C,k1D, \ - k28,k29,k2A,k2B,k2C,k2D, \ - k37,k38,k39,k3A,k3B,k3C,k3D, \ - k49,k4A,k4B,k4C,k4D, \ - k57,k58, \ - k59, \ - k5C,k5B,k5A ) \ - \ - /* matrix positions */ \ - { \ - { k00, k10, k20, k30, k40, KC_NO }, \ - { k01, k11, k21, k31, k41, k51 }, \ - { k02, k12, k22, k32, k42, k52 }, \ - { k03, k13, k23, k33, k43, k53 }, \ - { k04, k14, k24, k34, k44, k54 }, \ - { k05, k15, k25, k35, KC_NO, k55 }, \ - { k06, k16, KC_NO, k36, KC_NO, k56 }, \ - \ - { k07, k17, KC_NO, k37,KC_NO, k57 }, \ - { k08, k18, k28, k38,KC_NO, k58 }, \ - { k09, k19, k29, k39, k49, k59 }, \ - { k0A, k1A, k2A, k3A, k4A, k5A }, \ - { k0B, k1B, k2B, k3B, k4B, k5B }, \ - { k0C, k1C, k2C, k3C, k4C, k5C }, \ - { k0D, k1D, k2D, k3D, k4D, KC_NO } \ - } - -#endif diff --git a/keyboards/ergodox_ez/i2cmaster.h b/keyboards/ergodox_ez/i2cmaster.h deleted file mode 100644 index 3917b9e6c..000000000 --- a/keyboards/ergodox_ez/i2cmaster.h +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef _I2CMASTER_H -#define _I2CMASTER_H 1 -/************************************************************************* -* Title: C include file for the I2C master interface -* (i2cmaster.S or twimaster.c) -* Author: Peter Fleury http://jump.to/fleury -* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device -* Usage: see Doxygen manual -**************************************************************************/ - -#ifdef DOXYGEN -/** - @defgroup pfleury_ic2master I2C Master library - @code #include @endcode - - @brief I2C (TWI) Master Software Library - - Basic routines for communicating with I2C slave devices. This single master - implementation is limited to one bus master on the I2C bus. - - This I2c library is implemented as a compact assembler software implementation of the I2C protocol - which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). - Since the API for these two implementations is exactly the same, an application can be linked either against the - software I2C implementation or the hardware I2C implementation. - - Use 4.7k pull-up resistor on the SDA and SCL pin. - - Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module - i2cmaster.S to your target when using the software I2C implementation ! - - Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. - - @note - The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted - to GNU assembler and AVR-GCC C call interface. - Replaced the incorrect quarter period delays found in AVR300 with - half period delays. - - @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury - - @par API Usage Example - The following code shows typical usage of this library, see example test_i2cmaster.c - - @code - - #include - - - #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet - - int main(void) - { - unsigned char ret; - - i2c_init(); // initialize I2C library - - // write 0x75 to EEPROM address 5 (Byte Write) - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - i2c_write(0x05); // write address = 5 - i2c_write(0x75); // write value 0x75 to EEPROM - i2c_stop(); // set stop conditon = release bus - - - // read previously written value back from EEPROM address 5 - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - - i2c_write(0x05); // write address = 5 - i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode - - ret = i2c_readNak(); // read one byte from EEPROM - i2c_stop(); - - for(;;); - } - @endcode - -*/ -#endif /* DOXYGEN */ - -/**@{*/ - -#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 -#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" -#endif - -#include - -/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_READ 1 - -/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_WRITE 0 - - -/** - @brief initialize the I2C master interace. Need to be called only once - @param void - @return none - */ -extern void i2c_init(void); - - -/** - @brief Terminates the data transfer and releases the I2C bus - @param void - @return none - */ -extern void i2c_stop(void); - - -/** - @brief Issues a start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_start(unsigned char addr); - - -/** - @brief Issues a repeated start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -extern unsigned char i2c_rep_start(unsigned char addr); - - -/** - @brief Issues a start condition and sends address and transfer direction - - If device is busy, use ack polling to wait until device ready - @param addr address and transfer direction of I2C device - @return none - */ -extern void i2c_start_wait(unsigned char addr); - - -/** - @brief Send one byte to I2C device - @param data byte to be transfered - @retval 0 write successful - @retval 1 write failed - */ -extern unsigned char i2c_write(unsigned char data); - - -/** - @brief read one byte from the I2C device, request more data from device - @return byte read from I2C device - */ -extern unsigned char i2c_readAck(void); - -/** - @brief read one byte from the I2C device, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_readNak(void); - -/** - @brief read one byte from the I2C device - - Implemented as a macro, which calls either i2c_readAck or i2c_readNak - - @param ack 1 send ack, request more data from device
- 0 send nak, read is followed by a stop condition - @return byte read from I2C device - */ -extern unsigned char i2c_read(unsigned char ack); -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - - -/**@}*/ -#endif diff --git a/keyboards/ergodox_ez/keymaps/ab/Makefile b/keyboards/ergodox_ez/keymaps/ab/Makefile deleted file mode 100644 index b673c5ce5..000000000 --- a/keyboards/ergodox_ez/keymaps/ab/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# Having a file like this allows you to override Makefile definitions -# for your own particular keymap - -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = no # Commands for debug and configuration - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergodox_ez/keymaps/ab/keyboard-layout.json b/keyboards/ergodox_ez/keymaps/ab/keyboard-layout.json deleted file mode 100644 index e2badad4d..000000000 --- a/keyboards/ergodox_ez/keymaps/ab/keyboard-layout.json +++ /dev/null @@ -1,387 +0,0 @@ -[ - { - "name": "Beginner's Keymap for Ergodox-EZ", - "author": "Anand Babu Periasamy" - }, - [ - { - "x": 3.5 - }, - "#\n3\n\n\nF3", - { - "x": 10.5 - }, - ")\n0\n\n\nF10" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "@\n2\n\n\nF2", - { - "x": 1 - }, - "$\n4\n\n\nF4", - { - "x": 8.5 - }, - "(\n9\n\n\nF9", - { - "x": 1 - }, - "_\n-\n\n\nF11" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "%\n5\n\n\nF5", - "^\n6\n\n\nF6", - { - "x": 4.5 - }, - "&\n7\n\n\nF7", - "*\n8\n\n\nF8" - ], - [ - { - "y": -0.875, - "w": 1.5 - }, - "~\n`\n\n\nEsc", - "!\n1\n\n\nF1", - { - "x": 14.5 - }, - "+\n=\n\n\nF12", - { - "a": 7, - "w": 1.5 - }, - "Backspace\n\n\n\nBackspace" - ], - [ - { - "y": -0.375, - "x": 3.5 - }, - "E\n\n\n\n", - { - "x": 10.5 - }, - "I" - ], - [ - { - "y": -0.8799999999999999, - "x": 2.5 - }, - "W" - ], - [ - { - "y": -0.9950000000000001, - "x": 4.5, - "a": 4 - }, - "R", - { - "x": 8.5, - "a": 7 - }, - "U", - { - "x": 1 - }, - "O" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "T", - { - "h": 1.5 - }, - "", - { - "x": 4.5, - "h": 1.5 - }, - "", - "Y" - ], - [ - { - "y": -0.875, - "a": 6, - "w": 1.5 - }, - "Tab", - { - "a": 7 - }, - "Q", - { - "x": 14.5 - }, - "P", - { - "a": 4, - "w": 1.5 - }, - "|\n\\" - ], - [ - { - "y": -0.375, - "x": 3.5, - "a": 7 - }, - "D\n\n\n\n", - { - "x": 10.5 - }, - "K" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "S\n\n\n\n", - { - "x": 1, - "c": "#c4bcbc" - }, - "F\n\n\n\n", - { - "x": 8.5 - }, - "J", - { - "x": 1, - "c": "#cccccc" - }, - "L" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "G", - { - "x": 6.5 - }, - "H" - ], - [ - { - "y": -0.875, - "a": 4, - "fa": [ - 0, - 0, - 0, - 2 - ], - "w": 1.5 - }, - "\n\n\nCtrl\n\n\nCaps", - { - "a": 7 - }, - "A", - { - "x": 14.5, - "a": 4 - }, - ":\n;", - { - "a": 7, - "w": 1.5 - }, - "Enter" - ], - [ - { - "y": -0.625, - "x": 6.5, - "h": 1.5 - }, - "PgDn", - { - "x": 4.5, - "h": 1.5 - }, - "PgUp" - ], - [ - { - "y": -0.75, - "x": 3.5 - }, - "C\n\n\n\n", - { - "x": 10.5, - "a": 4 - }, - "<\n," - ], - [ - { - "y": -0.875, - "x": 2.5, - "a": 7 - }, - "X\n\n\n\n", - { - "x": 1 - }, - "V\n\n\n\n", - { - "x": 8.5 - }, - "M", - { - "x": 1, - "a": 4 - }, - ">\n." - ], - [ - { - "y": -0.875, - "x": 5.5, - "a": 7 - }, - "B", - { - "x": 6.5 - }, - "N" - ], - [ - { - "y": -0.875, - "w": 1.5 - }, - "Shift", - "Z", - { - "x": 14.5, - "a": 4 - }, - "?\n/", - { - "w": 1.5 - }, - "\"\n'" - ], - [ - { - "y": -0.375, - "x": 3.5, - "a": 7 - }, - "Alt\n\n\n\n", - { - "x": 10.5 - }, - "\n\n\n\n" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "\n\n\n\n", - { - "x": 1 - }, - "Alt\n\n\n\n", - { - "x": 8.5 - }, - "\n\n\n\n", - { - "x": 1 - }, - "\n\n\n\n" - ], - [ - { - "y": -0.75, - "x": 0.5 - }, - "Ctrl\n\n\n\n", - "Esc", - { - "x": 14.5 - }, - "\n\n\n\n", - "Fn" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1 - }, - "", - "(" - ], - [ - { - "h": 2 - }, - "Space", - { - "h": 2 - }, - "Del", - "[" - ], - [ - { - "x": 2 - }, - "{" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - ")", - "" - ], - [ - { - "x": -3 - }, - "]", - { - "h": 2 - }, - "Enter", - { - "h": 2 - }, - "" - ], - [ - { - "x": -3 - }, - "}" - ] -] \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/ab/keyboard-layout.png b/keyboards/ergodox_ez/keymaps/ab/keyboard-layout.png deleted file mode 100644 index 740684461..000000000 Binary files a/keyboards/ergodox_ez/keymaps/ab/keyboard-layout.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/ab/keymap.c b/keyboards/ergodox_ez/keymaps/ab/keymap.c deleted file mode 100644 index df6f33460..000000000 --- a/keyboards/ergodox_ez/keymaps/ab/keymap.c +++ /dev/null @@ -1,155 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define FN1 1 // media layer - -#define CAPS_CTL CTL_T(KC_CAPS) // Caps on tap, Ctrl on hold. -#define COPY LCTL(KC_V) // C-c Copy -#define PASTE LCTL(KC_V) // C-v Paste -#define ZM_NRM LCTL(KC_0) // C-0 Zoom Normal -#define ZM_OUT LCTL(KC_MINS) // C-- Zoom Out -#define ZM_IN LCTL(KC_PLUS) // C-+ Zoom In -#define EM_UNDO LCTL(KC_UNDS) // C-_ Emacs Undo - -#define _MOB 1 // Mobile# -#define _CUS1 2 // Custom macro 1 -#define _CUS2 3 // Custom macro 2 - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BSpace | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | Fwd | | Back | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Caps/Ctl| A | S | D | F | G |------| |------| H | J | K | L | ; | Enter | - * |--------+------+------+------+------+------| PgDn | | PgUp |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | ' | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Ctrl | Esc | LGui | Alt | Alt | | Left | Dn | Up | Right| Fn | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Copy | ( | | ) | Paste| - * ,------|------+------| |------+------+------. - * | | | [ | | ] | | | - * |Space | Del |------| |------| Enter|BSpace| - * | | | { | | } | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* - [BASE] = KEYMAP( // layer 0 : default - // Left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_WBAK, - CAPS_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_PGDN, - KC_LCTL, KC_ESC, KC_LGUI, KC_LALT, KC_LALT, - COPY, KC_LCBR, - KC_LPRN, - KC_SPC, KC_DEL, KC_LBRC, - // Right hand - KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_WFWD, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, - KC_PGUP, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(FN1), - KC_RCBR, PASTE, - KC_RPRN, - KC_RBRC, KC_ENT, KC_BSPC), -/* Keymap 1: Fn Keys, media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | BSpace | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | LClk | MClk | RClk | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Teensy| | ZmNrm| ZmOut| ZmIn | | Undo |VolDn |VolUp | Mute | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------+------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// FN1 Layer - [FN1] = KEYMAP( - // Left hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN3, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, ZM_NRM, ZM_OUT, ZM_IN, - KC_TRNS, KC_TRNS, - KC_TRNS, - RESET, KC_TRNS, KC_TRNS, - // Right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, M(_MOB), KC_TRNS, M(_CUS1),M(_CUS2),KC_TRNS, KC_TRNS, - EM_UNDO, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case _MOB: // Your mobile# here. - return MACRODOWN(T(1), T(2), T(3), T(MINS), - T(1), T(2), T(3), T(MINS), - T(1), T(2), T(3), T(4), - END); - case _CUS1: // Your custom macro 1 - return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(SPC), END); - case _CUS2: // Your custom macro 2 - return MACRODOWN(T(L), T(S), T(SPC), T(MINS), T(L), T(ENT), END); - }; - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/ab/readme.md b/keyboards/ergodox_ez/keymaps/ab/readme.md deleted file mode 100644 index 6b1ac2be3..000000000 --- a/keyboards/ergodox_ez/keymaps/ab/readme.md +++ /dev/null @@ -1,21 +0,0 @@ -# Beginner's keymap for Ergodox-EZ -Beginner's keymap emulates standard QWERTY keyboard for beginners. Once you get comfortable with the Ergodox-EZ, you may fork this keymap and customize it for your own needs or find a suitable one from the community contributed keymaps. - -![Beginner's Keymap](keyboard-layout.png) - -#### Pros -* Easier to switch between regular keyboards and Ergodox-EZ. -* Easy on beginners. It has everything you need for your day to day usage. - -#### Cons -* Keys are not ergonomically placed to take full advantage of Ergodox-EZ. Take a look at this [Default Keymap](https://github.com/jackhumbert/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/default/readme.md) -* While multiple layers are possible, beginner's keymap only uses one additional layer for mouse, function and volume keys. - -#### Notes -* Ideally number key [6] should have started from the right-hand side of the keyboard. Doing so breaks the familiar QWERTY layout. -* Quote key ['] should have been placed between [:] and [Enter]. Due to lack of key space, it is placed below [Enter]. -* Double [Alt] keys are placed adjacent to each other for convenience. -* [CapsLock] also acts as [Ctrl] key when you press and hold. It is convenient for GNU Emacs users. -* Additional bracket keys are placed in the center of the keyboard for programmer's convenience. - - diff --git a/keyboards/ergodox_ez/keymaps/adnw_k_o_y/keymap.c b/keyboards/ergodox_ez/keymaps/adnw_k_o_y/keymap.c deleted file mode 100644 index 052517d70..000000000 --- a/keyboards/ergodox_ez/keymaps/adnw_k_o_y/keymap.c +++ /dev/null @@ -1,185 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_german.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | K | . | O | , | Y | L1 | | L1 | V | G | C | L | ß | Z | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | H | A | E | I | U |------| |------| D | T | R | N | S | F | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |X/Ctrl| Q | Ä | Ü | Ö | | | | B | P | W | M | J | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Enter |------| |------| Tab |RShift| - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, DE_K, DE_DOT, DE_O, DE_COMM,DE_Y, TG(SYMB), - KC_BSPC, DE_H, DE_A, DE_E, DE_I, DE_U, - KC_LSFT, CTL_T(DE_X), DE_Q, DE_AE, DE_UE, DE_OE, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_ENT ,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), DE_V, DE_G, DE_C, DE_L, DE_SS, DE_Z, - DE_D, DE_T, DE_R, DE_N, LT(MDIA, DE_S), GUI_T(KC_F), - MEH_T(KC_NO),KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_RSFT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/adnw_k_o_y/readme.md b/keyboards/ergodox_ez/keymaps/adnw_k_o_y/readme.md deleted file mode 100644 index f0dd3815c..000000000 --- a/keyboards/ergodox_ez/keymaps/adnw_k_o_y/readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# Basic implementation for k.o,y variant of the adnw layout - -adnw is a layout optimised for usage with german and english language -k.o,y is a variant of this layout -http://www.adnw.de/index.php?n=Main.SeitlicheNachbaranschl%C3%A4ge - -The os must use the de_DE layout diff --git a/keyboards/ergodox_ez/keymaps/alexjj/keymap.c b/keyboards/ergodox_ez/keymaps/alexjj/keymap.c deleted file mode 100644 index 448f62da0..000000000 --- a/keyboards/ergodox_ez/keymaps/alexjj/keymap.c +++ /dev/null @@ -1,238 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys -#define UNIC 3 // unicode entry layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1! | 2@ | 3# | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | -_ | += | BkSp | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | { | | } | Y | U | I | O | P | |\ | - * |--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| - * | Win | A | S | D | F | G |------| |------| H | J | K | L | :; | '" | - * |--------+------+------+------+------+------| Home | | End |------+------+------+------+------+--------| - * | LShift |Z/Alt | X | C | V | B | | | | N | M | , | . | Alt | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | COPY | PASTE| Left | Right| | Down | Up |Hyper | `~ | RCtrl | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * Hyper = Ctrl+Super+Alt+Shift | ~L3 | F5 | | F2 | ~L2 | - * ,------|------|------| |------+------+------. - * | | | PgUp | | Ins | | | - * | Enter| BkSp |------| |------| ~L1 |Space | - * | | | PgDn | | Del | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_HOME, - KC_LCTRL, LCTL(KC_C), LCTL(KC_V), KC_LEFT,KC_RGHT, - KC_FN3, KC_F5, - KC_PGUP, - KC_ENT,KC_BSPC,KC_PGDN, - // right hand - KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, - KC_END, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_DOWN,KC_UP, ALL_T(KC_NO),KC_GRV, KC_RCTRL, - KC_F2, KC_FN2, - KC_INS, - KC_DELT,KC_FN1, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |PrintScr| - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | £ | | | | | | . | 0 | = |Alt+F4| - * `----------------------------------' `----------------------------------' - * ↑ ,-------------. ,-------------. - * THERE! | | | | | | - * ,------|------|------| |------+------+------. - * CAD = Ctrl + Alt + Delete | | | | | | | | - * | | |------| |------| | | - * | | | | | CAD | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,M(3),KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_TRNS, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, LALT(KC_F4), - KC_TRNS, KC_TRNS, - KC_TRNS, - LCTL(LALT(KC_DEL)), KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | TEENSY | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolDn |VolUp | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -/* Keymap 3: Unicode Entry - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Alt | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | + | + | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Alt | | | E | | | | | | | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Alt | A | | D | F | |------| |------| | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Alt | | | C | | B | | | | | 1 | 2 | 3 | + | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Alt | Alt | Alt | | | | 0 | 0 | 0 | + | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * WINDOWS ONLY SETUP!! | ~L3 | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | Alt | Alt |------| |------| Alt | Alt | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[UNIC] = KEYMAP( // layer 3 : Unicode Entry - // left hand - KC_LALT, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, - KC_LALT, KC_TRNS, KC_TRNS, KC_E, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LALT, KC_A, KC_TRNS, KC_D, KC_F, KC_TRNS, - KC_LALT, KC_TRNS, KC_TRNS, KC_C, KC_TRNS, KC_B, KC_TRNS, - KC_LALT, KC_LALT, KC_LALT, KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_LALT,KC_LALT, KC_TRNS, - // right hand - KC_P7, KC_P8, KC_P9, KC_P0, KC_PPLS,KC_PPLS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_TRNS, - KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_TRNS, - KC_P0, KC_P0, KC_P0, KC_PPLS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS,KC_LALT, KC_LALT - ), -}; - - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) - [2] = ACTION_LAYER_TAP_TOGGLE(MDIA), // FN2 - Momentary Layer 2 (Media) - [3] = ACTION_LAYER_TAP_TOGGLE(UNIC) // FN3 - Momentary Layer 3 (Unicode entry) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - case 3: // this would trigger when you hit a key mapped as M(3) - if (record->event.pressed) { - return MACRO( I(255), D(LALT), T(P1), T(P5), T(P6), U(LALT), END ); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/alexjj/readme.md b/keyboards/ergodox_ez/keymaps/alexjj/readme.md deleted file mode 100644 index 239e32d39..000000000 --- a/keyboards/ergodox_ez/keymaps/alexjj/readme.md +++ /dev/null @@ -1,179 +0,0 @@ -Englishman in New York -=========================== - -:microphone: :tea: - -About ------- - -After using the massdrop configurator to get the basics, I wanted to add a -little extra to my ergodox. Notably the Hyper hotkey, the press and hold, -and a way to have my beloved £ :pound: symbol available[1](#unicode). Why not switch to a GB -layout? Well the computers I use are US keymap'd and I can't always change -that. Plus I've got used to 2/@ and 3/# and moving to the ergodox was hard -enough. :sweat_smile: - -I started from the default and edited from there as I needed. It's somewhat -similar to a regular layout, particularly R1 and shift/controls. I ended up -with a few keys that were blank, so I'm testing out some shortcuts. Alt+F4 for -quitting things in Windows, is one example, but I felt it was better placed on -the 1st layer - in case of fat fingers. - -Layout -------- - -![Layout](rl-layout.jpg "Isn't it lovely") - -### Base Layer - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| ESC | 1! | 2@ | 3# | 4$ | 5% | 6^ | | 7& | 8* | 9( | 0) | -_ | += | BkSp | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Tab | Q | W | E | R | T | { | | } | Y | U | I | O | P | |\ | -|--------+------+------+------+------+------| [ | | ] |------+------+------+------+------+--------| -| Win | A | S | D | F | G |------| |------| H | J | K | L | :; | '" | -|--------+------+------+------+------+------| Home | | End |------+------+------+------+------+--------| -| LShift |Z/Alt | X | C | V | B | | | | N | M | , | . | Alt | RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - |LCtrl | COPY | PASTE| Left | Right| | Down | Up |Hyper | `~ | RCtrl | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - Hyper = Ctrl+Super+Alt+Shift | ~L3 | F5 | | F2 | ~L2 | - ,------|------|------| |------+------+------. - | | | PgUp | | Ins | | | - | Enter| BkSp |------| |------| ~L1 |Space | - | | | PgDn | | Del | | | - `--------------------' `--------------------' -``` - -### Symbol Layer - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |PrintScr| -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | £ | | | | | | . | 0 | = |Alt+F4| - `----------------------------------' `----------------------------------' - ↑ ,-------------. ,-------------. - THERE! | | | | | | - ,------|------|------| |------+------+------. - CAD = Ctrl + Alt + Delete | | | | | | | | - | | |------| |------| | | - | | | | | CAD | | | - `--------------------' `--------------------' -``` -### Media Layer - -Not touched this, not used either. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| TEENSY | | | | | | | | | | | | | | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | | MsUp | | | | | | | | | | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | | | | | | | Prev | Next | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | Lclk | Rclk | |VolDn |VolUp | Mute | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | |Brwser| - | | |------| |------| |Back | - | | | | | | | | - `--------------------' `--------------------' -``` -### Unicode Layer - -Used to enter/test unicode input on Windows. All numbers are numpad keys. - -``` -,--------------------------------------------------. ,--------------------------------------------------. -| Alt | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | + | + | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Alt | | | E | | | | | | | 7 | 8 | 9 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Alt | A | | D | F | |------| |------| | 4 | 5 | 6 | + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Alt | | | C | | B | | | | | 1 | 2 | 3 | + | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | Alt | Alt | Alt | | | | 0 | 0 | 0 | + | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - WINDOWS ONLY SETUP!! | ~L3 | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | Alt | Alt |------| |------| Alt | Alt | - | | | | | | | | - `--------------------' `--------------------' -``` - - -Usage ------- - -~L1 / L2 / L3 will momentarily switch to a layer if held and another key is pressed. -If pressed and released will remain on layer until pressed again. - -### Unicode - -This layout is for Windows only. To enter a character Press and Hold Alt, type + and hex code then release Alt. - -Changelog ------------ - -### [0.2.1] - 2016-04-05 - -* Changed £ to alt code in Windows. Windows sucks at unicode. - -### [0.2.0] - 2016-03-27 - -* Added unicode layer -* Moved Copy/Paste to left hand side -* Switched Enter and Space (again) -* Added L3 (unicode layer) toggle -* Removed Press and Hold for Alt on right hand size (/) -* Swapped Volume Up/Down to match arrows -* Tried fixing £ macro -* Removed * in the matrix function things (upstream change) - -### [0.1.1] - 2016-03-23 - -* Changed £ input to a macro - - -### [0.1.0] - 2016-03-22 - -After actually using the keyboard, I've made some changes: - -* Swapped Enter and Space -* Moved backspace to thumb keys (top right still remains) -* Added Ctrl+Alt+Delete -* Added Teensy Reset on 2nd layer -* Switched Up and Down -* Changed copy/paste to be Ctrl+c and Ctrl+v as KC_COPY/PASTE didn't work (in Windows) -* Moved ~L2 to replace +L1 after learning how the function works (notes above) -* Hopefully fixed GBP symbol (unicode enabled in MakeFile) - -### [0.0.1] - 2016-03-21 - -First version - - -Issues -------- - -Space for feedback and notes for future improvements - ----- -1: For Windows only, and you have to edit the [registry](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input). diff --git a/keyboards/ergodox_ez/keymaps/alexjj/rl-layout.jpg b/keyboards/ergodox_ez/keymaps/alexjj/rl-layout.jpg deleted file mode 100644 index e4e92bf46..000000000 Binary files a/keyboards/ergodox_ez/keymaps/alexjj/rl-layout.jpg and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/COPYING b/keyboards/ergodox_ez/keymaps/algernon/COPYING deleted file mode 100644 index 94a9ed024..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 3 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 . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/keyboards/ergodox_ez/keymaps/algernon/Makefile b/keyboards/ergodox_ez/keymaps/algernon/Makefile deleted file mode 100644 index 6bf3976b9..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -BOOTMAGIC_ENABLE=no -COMMAND_ENABLE=no -SLEEP_LED_ENABLE=no -UNICODE_ENABLE=no -FORCE_NKRO ?= yes -DEBUG_ENABLE = no -CONSOLE_ENABLE = no -TAP_DANCE_ENABLE = yes -KEYLOGGER_ENABLE ?= yes - -ifeq (${FORCE_NKRO},yes) -OPT_DEFS += -DFORCE_NKRO -endif - -ifeq (${KEYLOGGER_ENABLE},yes) -OPT_DEFS += -DKEYLOGGER_ENABLE -CONSOLE_ENABLE = yes -endif - -KEYMAP_VERSION = $(shell \ - if [ -d "${KEYMAP_PATH}/.git" ]; then \ - cd "${KEYMAP_PATH}" && git describe --abbrev=6 --dirty --always --tags --match 'v*' 2>/dev/null; \ - else echo QMK; fi) - -KEYMAP_BRANCH = $(shell \ - if [ -d "${KEYMAP_PATH}/.git" ]; then \ - cd "${KEYMAP_PATH}"; \ - fi; \ - git rev-parse --abbrev-ref HEAD 2>/dev/null) - -OPT_DEFS += -DKEYMAP_VERSION=\"$(KEYMAP_VERSION)\\\#$(KEYMAP_BRANCH)\" - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergodox_ez/keymaps/algernon/config.h b/keyboards/ergodox_ez/keymaps/algernon/config.h deleted file mode 100644 index 9bb1025be..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/config.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef CONFIG_ALGERNON_H -#define CONFIG_ALGERNON_H - -#include "../../config.h" - -#undef MOUSEKEY_TIME_TO_MAX -#undef MOUSEKEY_MAX_SPEED - -#define MOUSEKEY_TIME_TO_MAX 1 -#define MOUSEKEY_MAX_SPEED 2 - -#undef MOUSEKEY_DELAY -#define MOUSEKEY_DELAY 0 - -#undef MOUSEKEY_WHEEL_DELAY -#define MOUSEKEY_WHEEL_DELAY 0 - -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 3000 - -#undef LOCKING_SUPPORT_ENABLE -#undef LOCKING_RESYNC_ENABLE - -#undef LEADER_TIMEOUT -#define LEADER_TIMEOUT 1000 - -#endif diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png deleted file mode 100644 index 3df68ea53..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/adore-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png deleted file mode 100644 index 7b25a05b3..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/base-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png b/keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png deleted file mode 100644 index 356035e0a..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/heatmap.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/hun-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/hun-layer.png deleted file mode 100644 index 104a9544d..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/hun-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/nav-n-media-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/nav-n-media-layer.png deleted file mode 100644 index 16d29e124..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/nav-n-media-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/one-handed-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/one-handed-layer.png deleted file mode 100644 index 698d11e5f..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/one-handed-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/images/steno-layer.png b/keyboards/ergodox_ez/keymaps/algernon/images/steno-layer.png deleted file mode 100644 index fe3c03c93..000000000 Binary files a/keyboards/ergodox_ez/keymaps/algernon/images/steno-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/algernon/keymap.c b/keyboards/ergodox_ez/keymaps/algernon/keymap.c deleted file mode 100644 index c12087292..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/keymap.c +++ /dev/null @@ -1,1216 +0,0 @@ -/* - * algernon's ErgoDox EZ layout, please see the readme.md file! - */ - -#include "ergodox_ez.h" -#include "led.h" -#include "debug.h" -#include "action_layer.h" -#include "action_util.h" -#include "mousekey.h" -#include "timer.h" -#include "keymap_plover.h" -#include "eeconfig.h" - -/* Layers */ - -enum { - BASE = 0, - ADORE, - ARRW, - APPSEL, - HUN, - NMDIA, - OHLFT, - OHRGT, - PLVR, -}; - -/* Macros */ - -enum { - NONE = 0, - // Buttons that do extra stuff - A_GUI, - A_PLVR, - A_ESC, - A_MPN, - - // Function / number keys - KF_1, // 1, F1 - KF_2, // 2, F2 - KF_3, // ... - KF_4, - KF_5, - KF_6, - KF_7, - KF_8, - KF_9, - KF_10, - KF_11, // =, F11 - - // Application select keys - APP_SLK, // Slack - APP_EMCS, // Emacs - APP_TERM, // Terminal - APP_CHRM, // Chrome - APP_MSIC, // Music - - // Diagonal mouse movement - A_MUL, - A_MUR, - A_MDL, - A_MDR, - - // Hungarian layer keys - HU_AA, // à - HU_OO, // Ó - HU_EE, // É - HU_UU, // Ú - HU_II, // à - HU_OE, // Ö - HU_UE, // Ü - HU_OEE, // Š- HU_UEE, // Ű - - // One-handed layout specials - OH_BSSPC, - OH_ENTSFT, - OH_BASE, - OH_LEFT, - OH_RIGHT, -}; - -/* Fn keys */ - -enum { - F_BSE = 0, - F_HUN, - F_GUI, - F_SFT, - F_ALT, - F_CTRL -}; - -/* Custom keycodes */ - -enum { - CT_CLN = 0, - CT_MNS, - CT_TA, -}; - -/* States & timers */ - -uint16_t gui_timer = 0; - -uint16_t kf_timers[12]; - -uint16_t oh_base_timer = 0; -uint16_t oh_bsspc_timer = 0; -uint16_t oh_entsft_timer = 0; - -#define OH_BLINK_INTERVAL 500 - -uint8_t oh_left_blink = 0; -uint16_t oh_left_blink_timer = 0; -uint8_t oh_right_blink = 0; -uint16_t oh_right_blink_timer = 0; - -#if KEYLOGGER_ENABLE -bool log_enable = false; -#endif - -bool time_travel = false; - -/* The Keymap */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Base Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | - * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | : | | - | | | | | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | 1HND | - * ,------|------|------| |------+------+------. - * | | | Ctrl | | LEAD | | | - * |Backsp|LShift|------| |------| Enter| Space| - * | | | ESC | | HUN | | | - * `--------------------' `--------------------' - */ -[BASE] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) - - ,F(F_ALT),F(F_GUI) - ,F(F_CTRL) - ,KC_BSPC,F(F_SFT),M(A_ESC) - - // right hand - ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS - ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL - ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP - ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,OSL(NMDIA),M(OH_LEFT) - ,KC_LEAD - ,F(F_HUN) ,KC_ENT ,KC_SPC - ), - -/* Keymap 1: Adore layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | , | . | L | W | M | [ | | ] | F | H | C | P | Y | \ | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = / Arrow | - * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| / | Z | ' | K | X | | | | B | G | V | J | Q | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | : | | - | | | | | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | 1HND | - * ,------|------|------| |------+------+------. - * | | | Ctrl | | LEAD | | | - * |Backsp|LShift|------| |------| Enter| Space| - * | | | ESC | | HUN | | | - * `--------------------' `--------------------' - */ -[ADORE] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC -,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U -,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) - - ,F(F_ALT),F(F_GUI) - ,F(F_CTRL) - ,KC_BSPC,F(F_SFT),M(A_ESC) - - // right hand - ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS - ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL - ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP - ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,OSL(NMDIA),M(OH_LEFT) - ,KC_LEAD - ,F(F_HUN) ,KC_ENT ,KC_SPC - ), - -/* Keymap 2: Arrow layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | Home | Up | End | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | Left | Down | Rght | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| PgUp | PgDn | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[ARRW] = KEYMAP( -// left hand - KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_HOME ,KC_UP ,KC_END ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_PGUP ,KC_PGDN - ), - -/* Keymap 3: Application select layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | |Music |Slack |Emacs |Term |Chrome| | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[APPSEL] = KEYMAP( -// left hand - KC_TRNS ,M(APP_MSIC),M(APP_SLK),M(APP_EMCS),M(APP_TERM),M(APP_CHRM),KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - ), - - -/* Keymap 4: Hungarian Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | Š| | Ű | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | à | Ó | É | Ú | à |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | Ö | | Ü | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | BASE | | | - * `--------------------' `--------------------' - */ - -[HUN] = KEYMAP( -// left hand - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,M(HU_OEE),KC_NO ,M(HU_UEE),KC_NO ,KC_NO -,KC_NO ,M(HU_AA),M(HU_OO) ,M(HU_EE),M(HU_UU) ,M(HU_II) -,KC_NO ,KC_NO ,M(HU_OE) ,KC_NO ,M(HU_UE) ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,F(F_BSE),KC_TRNS ,KC_TRNS - ), - -/* Keymap 5: Navigation & Media layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | MS Slow | | | | | |ScrLCK| |ScrLCK| | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | MS Normal | | Home | Up | PgUp | | | |Scroll| |MsUpL | MsUp |MsUpR | |PrintScreen| - * |-----------+------+------+------+------+------| | | Up |------+------+------+------+------+-----------| - * | MS Fast | | Left | Down | Right| |------| |------| |MsLeft| MsDn |MsRght| | | - * |-----------+------+------+------+------+------| | |Scroll|------+------+------+------+------+-----------| - * | Play/Pause| | End | Down | PgDn | | | | Down | |MsDnL | MsDn |MsDnR | | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Mute | VlUp | | BASE | MClk | - * ,------|------|------| |------+------+------. - * | | | VlDn | | Prev |Left |Right | - * | SPC | Enter|------| |------| Click| Click| - * | | | ESC | | Next | | | - * `--------------------' `--------------------' - */ -[NMDIA] = KEYMAP( -// left hand - KC_ACL0 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LGUI(KC_L) -,KC_ACL1 ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_NO -,KC_ACL2 ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO -,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_MUTE ,KC_VOLU - ,KC_VOLD - ,KC_SPC,KC_ENTER,M(A_ESC) - - // right hand - ,LGUI(KC_L),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_WH_U ,KC_NO ,M(A_MUL),KC_MS_U ,M(A_MUR),KC_NO ,KC_PSCR - ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO - ,KC_WH_D ,KC_NO ,M(A_MDL),KC_MS_D ,M(A_MDR),KC_NO ,KC_MSTP - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_TRNS ,KC_MS_BTN3 - ,KC_MPRV - ,KC_MNXT ,KC_BTN1 ,KC_BTN2 - ), - -/* Keymap 6: One-handed, left side - * - * ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |A BSE| - * |-----------+------+------+------+------+-------------| - * | Tab | ' | , | . | P | Y | [ | - * |-----------+------+------+------+------+------| | - * | - | A | O | E | U | I |------| - * |-----------+------+------+------+------+------| ( | - * | Play/Pause| ; | Q | J | K | X | | - * `-----------+------+------+------+------+-------------' - * | Home | End | Down | Up | ESC | - * `-----------------------------------' - * ,-------------. - * | LAlt | GUI | - * ,------|------|------| - * |BackSp|LShift| Ctrl | - * | | |------| - * |Space |Enter |OTHER | - * `--------------------' - */ -[OHLFT] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,M(OH_BASE) -,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_ESC) - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_RIGHT) - - // right hand - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - ), - -/* Keymap 7: One-handed, right side - * - * ,-----------------------------------------------------. - * | = F11 | 0 F10| 9 F9 | 8 F8 | 7 F7 | 6 F6 |A BSE| - * |-----------+------+------+------+------+-------------| - * | / | L | R | C | G | F | ] | - * |-----------+------+------+------+------+------| | - * | \ | S | N | T | H | D |------| - * |-----------+------+------+------+------+------| ) | - * | Stop | Z | V | W | M | B | | - * `-----------+------+------+------+------+-------------' - * | PgDn | PgUp | Right| Left | ESC | - * `-----------------------------------' - * ,-------------. - * | LAlt | GUI | - * ,------|------|------| - * |BackSp|LShift| Ctrl | - * | | |------| - * |Space |Enter |OTHER | - * `--------------------' - */ -[OHRGT] = KEYMAP( -// left hand - M(KF_11) ,M(KF_10) ,M(KF_9) ,M(KF_8) ,M(KF_7) ,M(KF_6) ,M(OH_BASE) -,KC_SLSH ,KC_L ,KC_R ,KC_C ,KC_G ,KC_F ,KC_RBRC -,KC_BSLS ,KC_S ,KC_N ,KC_T ,KC_H ,KC_D -,KC_MSTP ,KC_Z ,KC_V ,KC_W ,KC_M ,KC_B ,KC_RPRN -,KC_PGDN ,KC_PGUP ,KC_RGHT ,KC_LEFT ,M(A_ESC) - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_LEFT) - - // right hand - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - ), - -/* Keymap 8: Steno for Plover - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | BASE | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | # | # | # | # | # | # | | # | # | # | # | # | # | # | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | T | P | H | |------| |------| | F | P | L | T | D | - * |--------+ S +------+------+------+ * | * | | * | * +------+------+------+------+--------| - * | | | K | W | R | | | | | | R | B | G | S | Z | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | A | O |------| |------| E | U | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[PLVR] = KEYMAP( -// left hand -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(A_PLVR), -KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, -KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, -KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - PV_A, PV_O, KC_NO, - - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, - PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, - PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO,PV_E, PV_U - ), - -}; - -const uint16_t PROGMEM fn_actions[] = { - [F_BSE] = ACTION_LAYER_CLEAR(ON_PRESS) - ,[F_HUN] = ACTION_LAYER_INVERT(HUN, ON_PRESS) - ,[F_GUI] = ACTION_MACRO_TAP(A_GUI) - ,[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT) - ,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT) - ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) -}; - -void toggle_steno(int pressed) -{ - uint8_t layer = biton32(layer_state); - - if (pressed) { - if (layer != PLVR) layer_on(PLVR); else layer_off(PLVR); - - register_code(PV_LP); - register_code(PV_LH); - register_code(PV_LR); - register_code(PV_O); - register_code(PV_RL); - register_code(PV_RG); - } else { - unregister_code(PV_LP); - unregister_code(PV_LH); - unregister_code(PV_LR); - unregister_code(PV_O); - unregister_code(PV_RL); - unregister_code(PV_RG); - } -} - -macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) -{ - uint8_t need_shift = 0; - uint8_t hold_shift = 0; - - if (!record->event.pressed) - return MACRO_NONE; - - layer_off (HUN); - - if (keyboard_report->mods & MOD_BIT (KC_LSFT)) { - hold_shift = 1; - need_shift = 1; - unregister_code (KC_LSFT); - } - if ((get_oneshot_mods () & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out ()) { - need_shift = 1; - hold_shift = 0; - unregister_code (KC_LSFT); - } - - clear_oneshot_mods (); - - register_code (KC_RALT); - unregister_code (KC_RALT); - if (accent == (KC_DQT)) { - register_code (KC_RSFT); - } - register_code (accent); - unregister_code (accent); - if (need_shift && accent != (KC_DQT)) { - register_code (KC_RSFT); - } else if (accent == (KC_DQT) && !need_shift) { - unregister_code (KC_RSFT); - } - register_code (hun_char); - unregister_code (hun_char); - if (need_shift || accent == (KC_DQT)) - unregister_code (KC_RSFT); - if (hold_shift) - register_code (KC_LSFT); - - return MACRO_NONE; -} - -void ang_handle_kf (keyrecord_t *record, uint8_t id) -{ - uint8_t code = id - KF_1; - - if (record->event.pressed) { - kf_timers[code] = timer_read (); - } else { - uint8_t kc; - - if (timer_elapsed (kf_timers[code]) > TAPPING_TERM) { - // Long press - kc = KC_F1 + code; - } else { - if (id == KF_11) - kc = KC_EQL; - else - kc = KC_1 + code; - } - - register_code (kc); - unregister_code (kc); - } -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case A_ESC: - if (record->event.pressed) { - if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) { - clear_oneshot_mods (); - } else { - register_code (KC_ESC); - } - layer_off (HUN); - } else { - unregister_code (KC_ESC); - } - break; - - case A_MPN: - if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || - ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { - int oneshot = ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out()); - - if (oneshot) - clear_oneshot_mods (); - unregister_code (KC_LSFT); - - register_code (KC_MPRV); - unregister_code (KC_MPRV); - - if (!oneshot) - register_code (KC_LSFT); - } else { - return MACRO (T(MNXT), END); - } - } - break; - - /* Hungarian layer */ - case HU_AA: - return ang_do_hun (record, KC_QUOT, KC_A); - case HU_OO: - return ang_do_hun (record, KC_QUOT, KC_O); - case HU_EE: - return ang_do_hun (record, KC_QUOT, KC_E); - case HU_UU: - return ang_do_hun (record, KC_QUOT, KC_U); - case HU_II: - return ang_do_hun (record, KC_QUOT, KC_I); - case HU_OE: - return ang_do_hun (record, KC_DQT, KC_O); - case HU_UE: - return ang_do_hun (record, KC_DQT, KC_U); - case HU_OEE: - return ang_do_hun (record, KC_EQL, KC_O); - case HU_UEE: - return ang_do_hun (record, KC_EQL, KC_U); - - /* Mouse movement */ - case A_MUL: - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_LEFT); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_LEFT); - } - mousekey_send(); - break; - - case A_MUR: - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_RIGHT); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_RIGHT); - } - mousekey_send(); - break; - - case A_MDL: - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_LEFT); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_LEFT); - } - mousekey_send(); - break; - - case A_MDR: - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_RIGHT); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_RIGHT); - } - mousekey_send(); - break; - - /* Plover base */ - case A_PLVR: - toggle_steno(record->event.pressed); - break; - - /* GUI & AppSel */ - case A_GUI: - if (record->event.pressed) { - register_code (KC_LGUI); - if (record->tap.count && !record->tap.interrupted) { - if (record->tap.count >= 2) { - register_code (KC_W); - layer_on (APPSEL); - set_oneshot_layer (APPSEL, ONESHOT_START); - } - } else { - record->tap.count = 0; - } - gui_timer = 0; - } else { - if (record->tap.count >= 2) - { - unregister_code (KC_W); - clear_oneshot_layer_state (ONESHOT_PRESSED); - } - gui_timer = timer_read (); - } - break; - - case APP_SLK: - return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); - - case APP_EMCS: - return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(ENT), END); - - case APP_TERM: - return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); - - case APP_CHRM: - return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END); - - case APP_MSIC: - return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); - - /* Function keys */ - case KF_1 ... KF_11: - ang_handle_kf (record, id); - break; - - /* 1HAND layout */ - case OH_BASE: - if (record->event.pressed) { - oh_base_timer = timer_read (); - } else { - if (timer_elapsed (oh_base_timer) > TAPPING_TERM) { - layer_clear (); - } else { - return MACRO (T(APP), END); - } - } - break; - - case OH_BSSPC: - if (record->event.pressed) { - oh_bsspc_timer = timer_read (); - } else { - if (timer_elapsed (oh_bsspc_timer) > TAPPING_TERM) { - return MACRO (T(BSPC), END); - } else { - return MACRO (T(SPC), END); - } - } - break; - - case OH_ENTSFT: - if (record->event.pressed) { - oh_entsft_timer = timer_read (); - } else { - if (timer_elapsed (oh_entsft_timer) > TAPPING_TERM) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT)) - unregister_code (KC_LSFT); - else - register_code (KC_LSFT); - } else { - return MACRO (T(ENT), END); - } - } - break; - - case OH_LEFT: - if (record->event.pressed) { - layer_move (OHLFT); - oh_left_blink = 1; - oh_left_blink_timer = timer_read (); - ergodox_right_led_1_on (); - } - break; - - case OH_RIGHT: - if (record->event.pressed) { - layer_move (OHRGT); - oh_right_blink = 1; - oh_right_blink_timer = timer_read (); - ergodox_right_led_3_on (); - } - break; - } - return MACRO_NONE; -}; - -uint8_t is_adore = 0; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - uint8_t dl; - - ergodox_led_all_on(); - for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { - ergodox_led_all_set (i); - _delay_ms (5); - } - _delay_ms(1000); - for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { - ergodox_led_all_set (i); - _delay_ms (10); - } - ergodox_led_all_off(); - - if (!eeconfig_is_enabled()) - eeconfig_init(); - dl = eeconfig_read_default_layer (); - if (dl == (1UL << ADORE)) - is_adore = 1; -}; - -LEADER_EXTERNS(); - -void ang_do_unicode (void) { - register_code (KC_RCTL); - register_code (KC_RSFT); - register_code (KC_U); - unregister_code (KC_U); - unregister_code (KC_RSFT); - unregister_code (KC_RCTL); - _delay_ms (100); -} - -void ang_tap (uint16_t codes[]) { - for (int i = 0; codes[i] != 0; i++) { - register_code (codes[i]); - unregister_code (codes[i]); - _delay_ms (50); - } -} - -#define TAP_ONCE(code) \ - register_code (code); \ - unregister_code (code) - -void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_RSFT); - register_code (KC_SCLN); - } else if (state->count == 2) { - register_code (KC_SCLN); - } -} - -void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_SCLN); - unregister_code (KC_RSFT); - } else if (state->count == 2) { - unregister_code (KC_SCLN); - } -} - -void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_MINS); - } else if (state->count == 2) { - register_code (KC_RSFT); - register_code (KC_MINS); - } -} - -void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_MINS); - } else if (state->count == 2) { - unregister_code (KC_RSFT); - unregister_code (KC_MINS); - } -} - -typedef struct { - bool layer_toggle; - bool sticky; - bool finished_once; -} td_ta_state_t; - -void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { - td_ta_state_t *td_ta = (td_ta_state_t *) user_data; - - if (td_ta->finished_once) { - return; - } - - if (td_ta->sticky) { - td_ta->sticky = false; - td_ta->layer_toggle = false; - layer_off (ARRW); - return; - } - - td_ta->finished_once = true; - if (state->count == 1 && !state->pressed) { - register_code (KC_TAB); - td_ta->sticky = false; - td_ta->layer_toggle = false; - } else { - td_ta->layer_toggle = true; - layer_on (ARRW); - td_ta->sticky = (state->count == 2); - } -} - -void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { - td_ta_state_t *td_ta = (td_ta_state_t *) user_data; - - if (!td_ta->layer_toggle) - unregister_code (KC_TAB); - if (!td_ta->sticky) - layer_off (ARRW); - - td_ta->finished_once = false; -} - -const qk_tap_dance_action_t tap_dance_actions[] = { - [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) - ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) - ,[CT_TA] = { - .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, - .user_data = (void *)&((td_ta_state_t) { false, false, false }) - } -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) - unregister_code (KC_LGUI); - - if (layer != OHLFT) - oh_left_blink = 0; - if (layer != OHRGT) - oh_right_blink = 0; - - if (layer == HUN) { - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - } else if (layer == NMDIA) { - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - } else if (layer == PLVR) { - ergodox_right_led_1_on (); - ergodox_right_led_2_on (); - ergodox_right_led_3_on (); - } else if (layer == ADORE) { - ergodox_right_led_1_on (); - ergodox_right_led_2_on (); - ergodox_right_led_3_on (); - - ergodox_right_led_2_set (LED_BRIGHTNESS_HI); - } - - if (layer == OHLFT || layer == OHRGT) { - ergodox_right_led_2_on(); - - if (oh_left_blink) { - if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL) { - if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) == 0) - ergodox_right_led_1_off (); - } - if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL * 2) { - ergodox_right_led_1_on (); - oh_left_blink_timer = timer_read (); - } - } - - if (oh_right_blink) { - if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL) { - if ((keyboard_report->mods & MOD_BIT(KC_LCTRL)) == 0) - ergodox_right_led_3_off (); - } - if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL * 2) { - ergodox_right_led_3_on (); - oh_right_blink_timer = timer_read (); - } - } - } - - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || - ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_1_set (LED_BRIGHTNESS_HI); - ergodox_right_led_1_on (); - } else { - ergodox_right_led_1_set (LED_BRIGHTNESS_LO); - if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) - ergodox_right_led_1_off (); - } - - if (keyboard_report->mods & MOD_BIT(KC_LALT) || - ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_2_set (LED_BRIGHTNESS_HI); - ergodox_right_led_2_on (); - } else { - ergodox_right_led_2_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) - ergodox_right_led_2_off (); - } - - if (keyboard_report->mods & MOD_BIT(KC_LCTRL) || - ((get_oneshot_mods() & MOD_BIT(KC_LCTRL)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_3_set (LED_BRIGHTNESS_HI); - ergodox_right_led_3_on (); - } else { - ergodox_right_led_3_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != PLVR && layer != ADORE) - ergodox_right_led_3_off (); - } - - LEADER_DICTIONARY() { - leading = false; - leader_end (); - -#if KEYLOGGER_ENABLE - SEQ_ONE_KEY (KC_D) { - ergodox_led_all_on(); - _delay_ms(100); - ergodox_led_all_off(); - log_enable = !log_enable; - } -#endif - - SEQ_ONE_KEY (KC_T) { - time_travel = !time_travel; - } - - SEQ_ONE_KEY (KC_U) { - ang_do_unicode (); - } - - SEQ_ONE_KEY (KC_V) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")"); - } - - SEQ_ONE_KEY (KC_L) { - /* λ */ - ang_do_unicode (); - - uint16_t codes[] = {KC_0, KC_3, KC_B, KC_B, KC_ENT, 0}; - ang_tap (codes); - } - - SEQ_ONE_KEY (KC_Y) { - uint16_t codes[] = {KC_BSLS, KC_O, KC_SLSH, 0}; - ang_tap (codes); - } - - SEQ_ONE_KEY (KC_S) { - ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); - TAP_ONCE (KC_BSLS); - register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); - ang_do_unicode (); TAP_ONCE (KC_3); TAP_ONCE (KC_0); TAP_ONCE (KC_C); TAP_ONCE (KC_4); TAP_ONCE (KC_SPC); - register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); - TAP_ONCE (KC_SLSH); - ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); - } - - SEQ_TWO_KEYS (KC_W, KC_M) { - register_code (KC_LALT); - register_code (KC_F2); - unregister_code (KC_F2); - unregister_code (KC_LALT); - - _delay_ms (1000); - - uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; - ang_tap (codes); - register_code (KC_LGUI); - register_code (KC_UP); - unregister_code (KC_UP); - unregister_code (KC_LGUI); - } - - SEQ_ONE_KEY (KC_A) { - if (is_adore == 0) { - default_layer_and (0); - default_layer_or ((1UL << ADORE)); - eeconfig_update_default_layer ((1UL << ADORE)); - is_adore = 1; - - ergodox_led_all_off (); - ergodox_right_led_3_on (); - _delay_ms (100); - ergodox_right_led_2_on (); - _delay_ms (100); - ergodox_right_led_3_off (); - ergodox_right_led_1_on (); - _delay_ms (100); - ergodox_right_led_2_off (); - _delay_ms (100); - ergodox_right_led_1_off (); - } else { - is_adore = 0; - default_layer_and (0); - default_layer_or (1UL << BASE); - eeconfig_update_default_layer ((1UL << BASE)); - - ergodox_led_all_off (); - ergodox_right_led_1_on (); - _delay_ms (100); - ergodox_right_led_2_on (); - _delay_ms (100); - ergodox_right_led_1_off (); - ergodox_right_led_3_on (); - _delay_ms (100); - ergodox_right_led_2_off (); - _delay_ms (100); - ergodox_right_led_3_off (); - } - } - } -} - -static uint16_t last4[4]; - -bool process_record_user (uint16_t keycode, keyrecord_t *record) { -#if KEYLOGGER_ENABLE - uint8_t layer = biton32(layer_state); - - if (log_enable && layer == BASE) { - xprintf ("KL: col=%d, row=%d\n", record->event.key.col, - record->event.key.row); - } -#endif - - if (time_travel && !record->event.pressed) { - uint8_t p; - - // shift cache one to the left - for (p = 0; p < 3; p++) { - last4[p] = last4[p + 1]; - } - last4[3] = keycode; - - if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { - uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; - ang_tap (codes); - register_code (KC_RSFT); - register_code (KC_EQL); - unregister_code (KC_EQL); - unregister_code (KC_RSFT); - - uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; - ang_tap (codes2); - - return false; - } - } - - return true; -} diff --git a/keyboards/ergodox_ez/keymaps/algernon/readme.md b/keyboards/ergodox_ez/keymaps/algernon/readme.md deleted file mode 100644 index 6fe177511..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/readme.md +++ /dev/null @@ -1,198 +0,0 @@ - - -algernon's layout -======================= - -This is an unconventional layout for the ErgoDox EZ. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox]. - - [blog-ergodox]: https://asylum.madhouse-project.org/blog/tags/ergodox/ - -Some of the things in the layout only work when one uses Spacemacs and GNOME under Linux. Your mileage may vary. - -## Table of Contents - -* [Layouts](#layouts) - - [Base layer](#base-layer) - - [ADORE layer](#adore-layer) - - [Hungarian layer](#hungarian-layer) - - [Navigation and media layer](#navigation-and-media-layer) - - [One-handed layer](#one-handed-layer) - - [Steno layer](#steno-layer) - - [LED states](#led-states) -* [Tools](#tools) - - [Heatmap](#heatmap) -* [Building](#building) - - [Using on Windows](#using-on-windows) -* [Changelog](#changelog) -* [License](#license) - -# Layouts - -## Base layer - -[![Base layer](images/base-layer.png)](http://www.keyboard-layout-editor.com/#/gists/28f7eb305fdbff943613e1dc7aa9e82b) - -At its core, this is a Dvorak layout, with some minor changes. The more interesting parts are how certain keys behave: - -* The keys on the number row double as function keys, when held for a bit longer than an usual tap. This allows me to use the function keys without having to switch layers. -* The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they are considered active for the next key press only. When double tapped, they toggle on, until a third, single tap sometime later. When held, they act as expected. My usual pattern is that I use these for the next keypress only, so this behaviour is perfect. If I need them held, I'll just double-tap. -* The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout. -* The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode. -* The **Media** and **Hun** layer keys are one-shot, the **1Hand** and **STENO** keys are toggles. -* When holding any of the **Arrow** layer keys, the arrow layer activates while the layer key is held. Tapping the key produces the normal key. -* Tapping the `:` key once yields `:`, tapping it twice yields `;`. -* The **Lead** key allows me to type in a sequence of keys, and trigger some actions: - - `LEAD u` enters unicode input mode, by sending the GTK+ key sequence that does this. - - `LEAD l` uses the unicode input method to enter a `λ`. - - `LEAD s` does a lot of magic to type in a shruggie: `¯\_(ツ)_/¯` - - `LEAD y` types `\o/`. - - `LEAD w m` maximises the currently focused window. - - `LEAD a` makes the [ADORE layer](#adore-layer) the default. - - `LEAD v` prints the firmware version, the keyboard and the keymap. - - `LEAD d` toggles logging keypress positions to the HID console. - - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. - -## ADORE layer - -[![ADORE layer](images/adore-layer.png)](http://www.keyboard-layout-editor.com/#/gists/45681a17453d235925b6028dd83bf12a) - -While using the standard Dvorak layout, I encountered a number of inconveniences, and on this layer, I am playing with ideas to make the layout feel better. Initially, it was based on [Capewell-Dvorak][cpd], but that too, had shortcomings I was not happy with. So now this is something inbetween, with own observations thrown in. How it works out in the long run remains to be seen. - - [cpd]: http://www.michaelcapewell.com/projects/keyboard/layout_capewell-dvorak.htm - -Based on a week and a half of typing, the keys were rearranged, and the home row neatly spelled out **ADORE**, that gave the layout its name. - -## Hungarian layer - -[![Hungarian layer](images/hun-layer.png)](http://www.keyboard-layout-editor.com/#/gists/b160f6ec90d58c127c114c89f66e9dc9) - -On this layer, the accented characters are at the same position as their base variant. For some, which can have other diatribes, the long one is on top, short's on bottom. Tapping any of the accented characters takes us back to the base layer. - -## Navigation and media layer - -[![Navigation and media layer](images/nav-n-media-layer.png)](http://www.keyboard-layout-editor.com/#/gists/c59c453f9fe1a3238ba1494e7e5c6892) - -This layer is primarily for navigating with the cursor or the mouse, and some media things. - -## One-handed layer - -[![One-handed layer](images/one-handed-layer.png)](http://www.keyboard-layout-editor.com/#/gists/edff2495135955b8963198dace7f7ece) - -The one-handed layer is used in situations where the right hand is occupied, by mousing around, for example. Tapping the `OTHER` key switches which side is active. For the most part, keys remain in their usual position. When the right half is active, keys are mirrored to the left half. - -The differences are as follows: - -* The `ESC` key has been moved to the bottom row, so the `OTHER` key is easier to tap. -* Most keys on the thumb cluster now have dual uses, and these do not change when switching sides: - - The `Space`/`Backspace` key sends `Space` on tap, `Backspace` when held for longer than a normal tap. - - The `Enter`/`Shift` key sends `Enter` on short-tap, `Shift` on long-tap. -* The `Apps`/`BASE` key can be used to go back to the base layer, by long-tapping it. A short-tap will send the `App` key, as usual. - -## Steno layer - -[![Steno layer for Plover](images/steno-layer.png)](http://www.keyboard-layout-editor.com/#/gists/401ef9a84369e47c57f9aedcf0a0d667) - -This is to be used with [Plover](http://www.openstenoproject.org/plover/), nothing really fancy here. The **STENO** key toggles the layer on and off, and sends the toggle command to Plover too. - -## LED states - -The primary purpose of the LEDs is to show the modifier status, a secondary, to show which layer is active. Each modifier, `Shift`, `Alt` and `Control` each have their designated LEDs: the *red*, *green* and *blue*, respectively. When a modifier is in a one-shot state, the respective LED will turn on with a dimmer light. If the modifier is toggled on, the brightness of the LED turns full. - -For the layers, the following rules apply: - -* When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active. -* When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on. -* When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on. -* When the [One-handed layer](#one-handed-layer) is active, the *green* LED is on and bright, and either the *red* or the *blue* one is going to slowly blink, depending on the currently active side. -* For the [Steno layer](#steno-layer), all LEDs will be turned on. - -Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on. - -# Tools - -## Heatmap - -When the keypress logging functionality is enabled (by `LEAD d`), the keyboard will output a line every time a key is pressed, containing the position of the key in the matrix. This allows one to collect this information, and build analytics over it, such as a heat map, including dead keys too. - -Included with the firmware is a small tool that can parse these logs, and create a heatmap that one can import into [KLE][kle]. To use it, simply point `tools/log-to-heatmap.py` to a base layout file (one is included in the `tools/` directory), and the key position log. The latter one can create by running `hid-listen`, and redirecting its output to a file. - - [kle]: http://www.keyboard-layout-editor.com/ - -The generated heatmap looks somewhat like this: - - ![Heatmap](images/heatmap.png) - -# Building - -To make my workflow easier, this layout is maintained in [its own repository][algernon:ez-layout]. To build it, you will need the [QMK][qmk] firmware checked out, and this repo either checked out to something like `keyboards/ergodox_ez/algernon-master`. One way to achieve that is this: - - [algernon:ez-layout]: https://github.com/algernon/ergodox-layout - [qmk]: https://github.com/jackhumbert/qmk_firmware - -``` -$ git clone https://github.com/jackhumbert/qmk_firmware.git -$ cd qmk_firmware -$ git clone https://github.com/algernon/ergodox-layout.git \ - keyboards/ergodox_ez/keymaps/algernon-master -$ make KEYBOARD=ergodox_ez KEYMAP=algernon-master -``` - -From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware): - -``` -$ make KEYBOARD=ergodox_ez KEYMAP=algernon -``` - -## Using on Windows - -The keymap default to forcing NKRO, which seems to upset Windows, and except the modifiers, none of them work. If you experience this problem, recompile the firmware with `FORCE_NKRO=no` added to the `make` command line. - -# Changelog - -## v1.4 - 2016-07-29 - -* When toggling the key logging on or off, the LEDs will do a little dance. -* The keylogger is now optional, but enabled by default. Use `KEYLOGGER_ENABLE=no` on the `make` command line to disable it. -* The `TAB`/`ARRW` key was turned into a tap-dance key, allowing one to toggle the **ARROW** layer on by double-tapping, and as such, avoid the need to hold the key. -* The `-`/`_` key was turned into a tap-dance key too. -* There is now a way to travel time with the keyboard, toggle the feature on by hitting `LEAD t`. - -## v1.3 - 2016-07-06 - -* Added support for logging keys, by pressing `LEAD d`. Also included is a tool to generate a [heatmap](#heatmap) out of the logs. -* The arrow and navigation keys were rearranged again, and now require an additional key being held to activate. See the [base layer](#base-layer) for an image that shows where arrows are. -* The **experimental** layer has been redone, and is now called [ADORE](#adore-layer), and as such, can be enabled by `LEAD a` now. -* Switching between Dvorak and ADORE is now persisted into EEPROM, and survives a reboot. - -## v1.2 - 2016-06-22 - -* The forced NKRO mode can be easily toggled off at compile-time, to make the firmware compatible with [certain operating systems](#using-on-windows). -* The `:;` key has changed behaviour: to access the `;` symbol, the key needs to be double-tapped, instead of shifted. -* The `=` and `\` keys were swapped, `=` moved to the home row, on both the [base](#base-layer) and the **experimental** layers. -* The arrow and navigation keys were redone, they are now more accessible, but the navigation keys require an extra tap to access. -* The **Emacs** layer is gone, replaced by a simplified [navigation and media](#navigation-and-media-layer) layer. -* `LEAD v` types the firmware version, and the keymap version. -* On the **experimental** layer, the `L` and `Q`, and the `K` and `G` keys were swapped. -* The [Steno](#steno-layer) layer gained a few more `#` and `*` keys, to make it easier on my fingers. - -## v1.1 - 2016-06-14 - -* The keyboard starts in NKRO mode, bootmagic and other things are disabled. -* A [Steno](#steno-layer) layer was added, to be used with Plover. -* An **experimental** layer was added, something halfway between Dvorak and Capewell-Dvorak. A work in progress. -* `LEAD y` types `\o/`. -* Some keys on the [Base](#base-layer) layer have been moved around: - - `?` moved to the left pinky, left of `Q`. - - `=` shifted one row down, but `F11` stayed where it was. - - `-` on the left half was replaced by `Tab`. - - `Tab`'s original position is taken by a `Media Next`/`Media Prev` key. - - `:` now inputs `;` when shifted. -* `ESC` cancels the [Hungarian](#hungarian-layer) layer too, not just modifiers. - -## v1.0 - 2016-05-26 - -Initial version. - -# License - -The layout, being a derivative of the original TMK firmware which is under the GPL-2+, this layout is under the GPL as well, but GPL-3+, rather than the older version. diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-adore-layout.json b/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-adore-layout.json deleted file mode 100644 index 544f61ce8..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-adore-layout.json +++ /dev/null @@ -1,533 +0,0 @@ -[ - { - "backcolor": "#ffffff", - "name": "ErgoDox - algernon's layout: Heatmap", - "author": "Gergely Nagy ", - "notes": "See [here](https://github.com/algernon/ergodox-layout#readme) for the QMK keymap source.", - "switchMount": "cherry", - "switchBrand": "gateron", - "switchType": "KS-3-Tea", - "pcb": true, - "css": ".keyborder { -webkit-filter: blur(5px); filter: blur(5px); } .keytop { -webkit-filter: blur(10px); } .keylabels { border: 1px solid black; }" - }, - [ - { - "x": 3.5, - "c": "#a7d0db", - "fa": [ - 0, - 0, - 2 - ] - }, - "#\n3\nF3", - { - "x": 10.5, - "c": "#a7d0db", - "t": "#000000", - "a": 4, - "fa": [ - 0, - 0, - 2 - ] - }, - "*\n8\nF8" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "@\n2\nF2", - { - "x": 1, - "c": "#7adabd", - "t": "#000000" - }, - "$\n4\nF4", - { - "x": 8.5 - }, - "&\n7\nF7", - { - "x": 1, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "(\n9\nF9" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#7adabd", - "t": "#000000" - }, - "%\n5\nF5", - { - "c": "#f9cd31", - "a": 7, - "f": 2 - }, - "STENO", - { - "x": 4.5, - "f": 6 - }, - "", - { - "c": "#7adabd", - "a": 4, - "f": 3, - "fa": [ - 0, - 0, - 2 - ] - }, - "^\n6\nF6" - ], - [ - { - "y": -0.875, - "c": "#ffb2d2", - "f": 3, - "w": 1.5 - }, - "\n\n~\n`", - { - "t": "#0d0d0b" - }, - "!\n1\nF1", - { - "x": 14.5 - }, - ")\n0\nF10", - { - "a": 7, - "w": 1.5 - }, - "F11" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#a7d0db", - "t": "#000000", - "a": 6 - }, - "L", - { - "x": 10.5 - }, - "C" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bfbad1", - "t": "#0d0d0b", - "a": 4 - }, - ">\n.", - { - "x": 1, - "c": "#7adabd", - "t": "#000000", - "a": 6 - }, - "W", - { - "x": 8.5 - }, - "H", - { - "x": 1, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "P" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#7adabd", - "t": "#000000" - }, - "M", - { - "c": "#93c9b7", - "a": 4, - "h": 1.5 - }, - "{\n[", - { - "x": 4.5, - "h": 1.5 - }, - "}\n]", - { - "c": "#7adabd", - "a": 6 - }, - "F" - ], - [ - { - "y": -0.875, - "c": "#ffb07b", - "t": "#0d0d0b", - "f": 6, - "w": 1.5 - }, - "\n\n", - { - "c": "#ffb2d2", - "a": 4, - "f": 3 - }, - "<\n,", - { - "x": 14.5, - "a": 6 - }, - "Y", - { - "a": 4, - "w": 1.5 - }, - "|\n\\" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#a7d0db", - "t": "#000000", - "a": 6 - }, - "E", - { - "x": 10.5 - }, - "T" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "O", - { - "x": 1, - "c": "#7adabd", - "t": "#000000", - "n": true - }, - "I", - { - "x": 8.5, - "n": true - }, - "R", - { - "x": 1, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "N" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#7adabd", - "t": "#000000" - }, - "U", - { - "x": 6.5 - }, - "D" - ], - [ - { - "y": -0.875, - "c": "#ffb2d2", - "t": "#0d0d0b", - "fa": [ - 6 - ], - "w": 1.5 - }, - "\n\nTab", - { - "f": 3 - }, - "A", - { - "x": 14.5, - "f": 3 - }, - "S", - { - "a": 4, - "fa": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 6 - ], - "w": 1.5 - }, - "+\n=" - ], - [ - { - "y": -0.625, - "x": 6.5, - "c": "#93c9b7", - "t": "#000000", - "a": 7, - "h": 1.5 - }, - "(", - { - "x": 4.5, - "h": 1.5 - }, - ")" - ], - [ - { - "y": -0.75, - "x": 3.5, - "c": "#a7d0db", - "a": 4, - "f": 3 - }, - "\"\n'", - { - "x": 10.5 - }, - "V" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "Z", - { - "x": 1, - "c": "#7adabd", - "t": "#000000" - }, - "K", - { - "x": 8.5 - }, - "G", - { - "x": 1, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "J" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#7adabd", - "t": "#000000" - }, - "X", - { - "x": 6.5 - }, - "B" - ], - [ - { - "y": -0.875, - "c": "#ffb07b", - "f": 9, - "w": 1.5 - }, - "\n\n", - { - "c": "#ffb2d2", - "t": "#0d0d0b", - "a": 4, - "f": 3 - }, - "?\n/", - { - "x": 14.5, - "a": 6 - }, - "Q", - { - "c": "#ffb07b", - "t": "#000000", - "f": 9, - "w": 1.5 - }, - "" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#d9dae0", - "g": true, - "a": 7, - "f": 3 - }, - "", - { - "x": 10.5 - }, - "" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "", - { - "x": 1, - "c": "#d4872a", - "g": false, - "a": 5 - }, - ";\n:", - { - "x": 8.5 - }, - "_\n-", - { - "x": 1, - "c": "#d9dae0", - "g": true, - "a": 7 - }, - "" - ], - [ - { - "y": -0.75, - "x": 0.5 - }, - "", - {}, - "", - { - "x": 14.5 - }, - "", - {}, - "" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#f9cd31", - "g": false - }, - "Alt", - { - "a": 4, - "fa": [ - 0, - 0, - 0, - 9 - ] - }, - "\n\n\n" - ], - [ - { - "c": "#d4872a", - "a": 7, - "f": 9, - "h": 2 - }, - "", - { - "h": 2 - }, - "", - { - "c": "#f9cd31", - "f": 3 - }, - "Ctrl" - ], - [ - { - "x": 2, - "c": "#e26757" - }, - "ESC" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3, - "c": "#f9cd31", - "f": 2 - }, - "MEDIA", - {}, - "1HAND" - ], - [ - { - "x": -3 - }, - "LEAD", - { - "c": "#d4872a", - "f": 9, - "h": 2 - }, - "", - { - "f": 3, - "h": 2 - }, - "SPC" - ], - [ - { - "x": -3, - "c": "#f9cd31", - "f": 2 - }, - "HUN" - ] -] diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json b/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json deleted file mode 100644 index 148bb1f23..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/tools/heatmap-base-layout.json +++ /dev/null @@ -1,533 +0,0 @@ -[ - { - "backcolor": "#ffffff", - "name": "ErgoDox - algernon's layout: Heatmap", - "author": "Gergely Nagy ", - "notes": "See [here](https://github.com/algernon/ergodox-layout#readme) for the QMK keymap source.", - "switchMount": "cherry", - "switchBrand": "gateron", - "switchType": "KS-3-Tea", - "pcb": true, - "css": ".keyborder { -webkit-filter: blur(5px); filter: blur(5px); } .keytop { -webkit-filter: blur(10px); } .keylabels { border: 1px solid black; }" - }, - [ - { - "x": 3.5, - "c": "#a7d0db", - "fa": [ - 0, - 0, - 2 - ] - }, - "#\n3\nF3", - { - "x": 10.5, - "c": "#a7d0db", - "t": "#000000", - "a": 4, - "fa": [ - 0, - 0, - 2 - ] - }, - "*\n8\nF8" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "@\n2\nF2", - { - "x": 1, - "c": "#7adabd", - "t": "#000000" - }, - "$\n4\nF4", - { - "x": 8.5 - }, - "&\n7\nF7", - { - "x": 1, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "(\n9\nF9" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#7adabd", - "t": "#000000" - }, - "%\n5\nF5", - { - "c": "#f9cd31", - "a": 7, - "f": 2 - }, - "STENO", - { - "x": 4.5, - "f": 6 - }, - "", - { - "c": "#7adabd", - "a": 4, - "f": 3, - "fa": [ - 0, - 0, - 2 - ] - }, - "^\n6\nF6" - ], - [ - { - "y": -0.875, - "c": "#ffb2d2", - "f": 3, - "w": 1.5 - }, - "\n\n~\n`", - { - "t": "#0d0d0b" - }, - "!\n1\nF1", - { - "x": 14.5 - }, - ")\n0\nF10", - { - "a": 7, - "w": 1.5 - }, - "F11" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#a7d0db", - "t": "#000000", - "a": 4 - }, - ">\n.", - { - "x": 10.5, - "a": 6 - }, - "C" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bfbad1", - "t": "#0d0d0b", - "a": 4 - }, - "<\n,", - { - "x": 1, - "c": "#7adabd", - "t": "#000000", - "a": 6 - }, - "P", - { - "x": 8.5 - }, - "G", - { - "x": 1, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "R" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#7adabd", - "t": "#000000" - }, - "Y", - { - "c": "#93c9b7", - "a": 4, - "h": 1.5 - }, - "{\n[", - { - "x": 4.5, - "h": 1.5 - }, - "}\n]", - { - "c": "#7adabd", - "a": 6 - }, - "F" - ], - [ - { - "y": -0.875, - "c": "#ffb07b", - "t": "#0d0d0b", - "f": 6, - "w": 1.5 - }, - "\n\n", - { - "c": "#ffb2d2", - "a": 4, - "f": 3 - }, - "\"\n'", - { - "x": 14.5, - "a": 6 - }, - "L", - { - "a": 4, - "w": 1.5 - }, - "|\n\\" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#a7d0db", - "t": "#000000", - "a": 6 - }, - "E", - { - "x": 10.5 - }, - "T" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "O", - { - "x": 1, - "c": "#7adabd", - "t": "#000000", - "n": true - }, - "U", - { - "x": 8.5, - "n": true - }, - "H", - { - "x": 1, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "N" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#7adabd", - "t": "#000000" - }, - "I", - { - "x": 6.5 - }, - "D" - ], - [ - { - "y": -0.875, - "c": "#ffb2d2", - "t": "#0d0d0b", - "fa": [ - 6 - ], - "w": 1.5 - }, - "\n\nTab", - { - "f": 3 - }, - "A", - { - "x": 14.5, - "f": 3 - }, - "S", - { - "a": 4, - "fa": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 6 - ], - "w": 1.5 - }, - "+\n=" - ], - [ - { - "y": -0.625, - "x": 6.5, - "c": "#93c9b7", - "t": "#000000", - "a": 7, - "h": 1.5 - }, - "(", - { - "x": 4.5, - "h": 1.5 - }, - ")" - ], - [ - { - "y": -0.75, - "x": 3.5, - "c": "#a7d0db", - "a": 6 - }, - "J", - { - "x": 10.5 - }, - "W" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "Q", - { - "x": 1, - "c": "#7adabd", - "t": "#000000" - }, - "K", - { - "x": 8.5 - }, - "M", - { - "x": 1, - "c": "#bfbad1", - "t": "#0d0d0b" - }, - "V" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#7adabd", - "t": "#000000" - }, - "X", - { - "x": 6.5 - }, - "B" - ], - [ - { - "y": -0.875, - "c": "#ffb07b", - "f": 9, - "w": 1.5 - }, - "\n\n", - { - "c": "#ffb2d2", - "t": "#0d0d0b", - "a": 4, - "f": 3 - }, - "?\n/", - { - "x": 14.5, - "a": 6 - }, - "Z", - { - "c": "#ffb07b", - "t": "#000000", - "f": 9, - "w": 1.5 - }, - "" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#d9dae0", - "g": true, - "a": 7, - "f": 3 - }, - "", - { - "x": 10.5 - }, - "" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "", - { - "x": 1, - "c": "#d4872a", - "g": false, - "a": 5 - }, - ";\n:", - { - "x": 8.5 - }, - "_\n-", - { - "x": 1, - "c": "#d9dae0", - "g": true, - "a": 7 - }, - "" - ], - [ - { - "y": -0.75, - "x": 0.5 - }, - "", - {}, - "", - { - "x": 14.5 - }, - "", - {}, - "" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#f9cd31", - "g": false - }, - "Alt", - { - "a": 4, - "fa": [ - 0, - 0, - 0, - 9 - ] - }, - "\n\n\n" - ], - [ - { - "c": "#d4872a", - "a": 7, - "f": 9, - "h": 2 - }, - "", - { - "h": 2 - }, - "", - { - "c": "#f9cd31", - "f": 3 - }, - "Ctrl" - ], - [ - { - "x": 2, - "c": "#e26757" - }, - "ESC" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3, - "c": "#f9cd31", - "f": 2 - }, - "MEDIA", - {}, - "1HAND" - ], - [ - { - "x": -3 - }, - "LEAD", - { - "c": "#d4872a", - "f": 9, - "h": 2 - }, - "", - { - "f": 3, - "h": 2 - }, - "SPC" - ], - [ - { - "x": -3, - "c": "#f9cd31", - "f": 2 - }, - "HUN" - ] -] diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py b/keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py deleted file mode 100755 index a13d12e81..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/tools/log-to-heatmap.py +++ /dev/null @@ -1,145 +0,0 @@ -#! /usr/bin/env python -import json -import os -import sys -import re - -from math import floor - -cr_coord_map = [ - [ - # Row 0 - [ 4, 0], [ 4, 2], [ 2, 0], [ 1, 0], [ 2, 2], [ 3, 0], [ 3, 2], - [ 3, 4], [ 3, 6], [ 2, 4], [ 1, 2], [ 2, 6], [ 4, 4], [ 4, 6], - ], - [ - # Row 1 - [ 8, 0], [ 8, 2], [ 6, 0], [ 5, 0], [ 6, 2], [ 7, 0], [ 7, 2], - [ 7, 4], [ 7, 6], [ 6, 4], [ 5, 2], [ 6, 6], [ 8, 4], [ 8, 6], - ], - [ - # Row 2 - [12, 0], [12, 2], [10, 0], [ 9, 0], [10, 2], [11, 0], [ ], - [ ], [11, 2], [10, 4], [ 9, 2], [10, 6], [12, 4], [12, 6], - ], - [ - # Row 3 - [17, 0], [17, 2], [15, 0], [14, 0], [15, 2], [16, 0], [13, 0], - [13, 2], [16, 2], [15, 4], [14, 2], [15, 6], [17, 4], [17, 6], - ], - [ - # Row 4 - [20, 0], [20, 2], [19, 0], [18, 0], [19, 2], [], [], [], [], - [19, 4], [18, 2], [19, 6], [20, 4], [20, 6], - ], - [ - # Row 5 - [ ], [23, 0], [22, 2], [22, 0], [22, 4], [21, 0], [21, 2], - [24, 0], [24, 2], [25, 0], [25, 4], [25, 2], [26, 0], [ ], - ], -] - -def set_attr_at(j, b, n, attr, fn, val): - blk = j[b][n] - if attr in blk: - blk[attr] = fn(blk[attr], val) - else: - blk[attr] = fn(None, val) - -def coord(col, row): - return cr_coord_map[row][col] - -def set_attr(orig, new): - return new - -def set_bg(j, (b, n), color): - set_attr_at(j, b, n, "c", set_attr, color) - #set_attr_at(j, b, n, "g", set_attr, False) - -def _set_tap_info(o, count, cap): - ns = 4 - o.count ("\n") - return o + "\n" * ns + "%.02f%%" % (float(count) / float(cap) * 100) - -def set_tap_info(j, (b, n), count, cap): - j[b][n + 1] = _set_tap_info (j[b][n + 1], count, cap) - -def heatmap_color (v): - colors = [ [0.3, 0.3, 1], [0.3, 1, 0.3], [1, 1, 0.3], [1, 0.3, 0.3]] - fb = 0 - if v <= 0: - idx1, idx2 = 0, 0 - elif v >= 1: - idx1, idx2 = len(colors) - 1, len(colors) - 1 - else: - val = v * (len(colors) - 1) - idx1 = int(floor(val)) - idx2 = idx1 + 1 - fb = val - float(idx1) - - r = (colors[idx2][0] - colors[idx1][0]) * fb + colors[idx1][0] - g = (colors[idx2][1] - colors[idx1][1]) * fb + colors[idx1][1] - b = (colors[idx2][2] - colors[idx1][2]) * fb + colors[idx1][2] - - r, g, b = [x * 255 for x in r, g, b] - return "#%02x%02x%02x" % (r, g, b) - -# Load the keylog -def load_keylog(fname, restrict_row): - keylog = {} - total = 0 - with open(fname, "r") as f: - lines = f.readlines() - for line in lines: - m = re.search ('KL: col=(\d+), row=(\d+)', line) - if not m: - continue - (c, r) = (int(m.group (2)), int(m.group (1))) - if restrict_row != None and r != int(restrict_row): - continue - if (c, r) in keylog: - keylog[(c, r)] = keylog[(c, r)] + 1 - else: - keylog[(c, r)] = 1 - total = total + 1 - return total / 2, keylog - -def l_flat(s): - f = s.split("\n") - return ", ".join (f) - -def main(base_fn, log_fn, restrict_row = None): - - with open(base_fn, "r") as f: - layout = json.load (f) - - ## Reset colors - for row in cr_coord_map: - for col in row: - if col != []: - set_bg (layout, col, "#d9dae0") - #set_attr_at (layout, col[0], col[1], "g", set_attr, True) - - total, log = load_keylog (log_fn, restrict_row) - max_cnt = 0 - for (c, r) in log: - max_cnt = max(max_cnt, log[(c, r)]) - - # Create the heatmap - for (c, r) in log: - coords = coord(c, r) - b, n = coords - cap = max_cnt - v = float(log[(c, r)]) / cap - print >> sys.stderr, "%s => %d/%d => %f = %s" % (l_flat(layout[b][n+1]), log[(c,r)], cap, v, heatmap_color(v)) - set_bg (layout, coord(c, r), heatmap_color (v)) - set_tap_info (layout, coord (c, r), log[(c, r)], total) - - print json.dumps(layout) - -if __name__ == "__main__": - if len(sys.argv) < 3: - print """Log to Heatmap -- creates a heatmap out of keyboard logs - -Usage: log-to-heatmap.py base-layout.json logfile [row] >layout.json""" - sys.exit (1) - main(*sys.argv[1:]) diff --git a/keyboards/ergodox_ez/keymaps/algernon/tools/max-focused b/keyboards/ergodox_ez/keymaps/algernon/tools/max-focused deleted file mode 100755 index 4d5220aa8..000000000 --- a/keyboards/ergodox_ez/keymaps/algernon/tools/max-focused +++ /dev/null @@ -1,5 +0,0 @@ -#! /bin/sh -WIN="$(xdotool getactivewindow)" -wmctrl -i -r ${WIN} -b remove,maximized_vert,maximized_horz -xdotool windowsize ${WIN} 100% 100% -wmctrl -i -r ${WIN} -b add,maximized_vert,maximized_horz diff --git a/keyboards/ergodox_ez/keymaps/andrew_osx/keymap.c b/keyboards/ergodox_ez/keymaps/andrew_osx/keymap.c deleted file mode 100644 index 48257d23a..000000000 --- a/keyboards/ergodox_ez/keymaps/andrew_osx/keymap.c +++ /dev/null @@ -1,187 +0,0 @@ -// Netable differences vs. the default firmware for the ErgoDox EZ: -// 1. The Cmd key is now on the right side, making Cmd+Space easier. -// 2. The media keys work on OSX (But not on Windows). -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | '" | | '" | 6 | 7 | 8 | 9 | 0 | BkSp | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | - | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| / | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| Alt |AltShf| Left | Right| | Up | Down | [ | ] | L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Esc |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | ( | | { | | | - * | Space| LGui |------| |------| RGui |Enter | - * | | | ) | | } | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_QUOT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_FN1, - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_LPRN, - KC_SPC,KC_LGUI,KC_RPRN, - // right hand - KC_QUOT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_FN1, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_BSLS, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TG(1), - KC_ESC, CTL_T(KC_ESC), - KC_LCBR, - KC_RCBR,KC_RGUI, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/bepo/bepo.png b/keyboards/ergodox_ez/keymaps/bepo/bepo.png deleted file mode 100644 index 3df7aa609..000000000 Binary files a/keyboards/ergodox_ez/keymaps/bepo/bepo.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/bepo/keymap.c b/keyboards/ergodox_ez/keymaps/bepo/keymap.c deleted file mode 100644 index 921a94d63..000000000 --- a/keyboards/ergodox_ez/keymaps/bepo/keymap.c +++ /dev/null @@ -1,311 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_bepo.h" - -#define BASE 0 // default layer -#define QWER 1 // qwerty compat layer -#define SQWER 2 // shifted qwerty compat layer -#define AQWER 3 // alted qwerty compat layer -#define FNAV 4 // function / navigation keys -#define NUM 5 // numeric keypad keys -#define MSE 6 // mouse keys - -#define KP_00 0 -#define CA_Fx 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | B |E_ACUT| P | O |E_GRAV|Backsp| |CapsLo| ^ | V | D | L | J | Z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | W | A | U | I | E | , |------| |------| C | T | S | R | N | M | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | E_CIRC |A_GRAV| Y | X | . | K | | | | ' | Q | G | H | F | C_CEDIL| - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * |QWERTY| |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | L_Num| | CA_Fx| | | - * | Space|LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[BASE] = KEYMAP( -// Left hand -BP_DOLLAR, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, KC_DEL, -BP_PERCENT, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_E_GRAVE, KC_BSPC, -BP_W, BP_A, BP_U, BP_I, BP_E, BP_COMMA, -BP_ECRC, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TAB, -TG(QWER), KC_NO, KC_LGUI, KC_LCTL, KC_LALT, - KC_ESC, MO(MSE), - MO(NUM), - KC_SPC, KC_LSHIFT, MO(FNAV), -// Right hand - KC_SLCK, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL, - KC_CAPSLOCK, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, - BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, - KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, - BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -KC_NO, KC_INS, -M(CA_Fx), -MO(FNAV), KC_RSHIFT, KC_ENTER), -/* Keymap 1: QWERTY system compatibility layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | ( | ) |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | b | e | p | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | w | a | u | i | e | , |------| |------| c | t | s | r | n | m | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | e | a | y | x | . | k | | | | ' | q | g | h | f | c | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | L_Num| | | | | - * | Space|LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[QWER] = KEYMAP( -// Left hand -KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LPRN, KC_RPRN, KC_DEL, -KC_PERCENT, KC_B, KC_E, KC_P, KC_O, KC_E, KC_BSPC, -KC_W, KC_A, KC_U, KC_I, KC_E, KC_COMMA, -KC_E, KC_A, KC_Y, KC_X, KC_DOT, KC_K, KC_TAB, -KC_TRNS, KC_NO, KC_LGUI, KC_LCTL, KC_LALT, - KC_ESC, MO(MSE), - MO(NUM), - KC_SPC, MO(SQWER), MO(FNAV), -// Right hand - KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, - KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, - KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, - KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, - MO(AQWER), KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -KC_NO, KC_INS, -KC_TRNS, -MO(FNAV), MO(SQWER), KC_ENTER), -/* Keymap 2: QWERTY shifted system compatibility layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | # | 1 | 2 | 3 | 4 | 5 |Delete| |ScroLo| 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ` | B | E | P | O | E |Backsp| |CapsLo| ! | V | D | L | J | Z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | W | A | U | I | E | ; |------| |------| C | T | S | R | N | M | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | E | A | Y | X | : | K | | | | ? | Q | G | H | F | C | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | L_Num| | | | | - * | Space|LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[SQWER] = KEYMAP( -// Left hand -KC_HASH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, -KC_GRV, S(KC_B), S(KC_E), S(KC_P), S(KC_O), S(KC_E), KC_TRNS, -S(KC_W), S(KC_A), S(KC_U), S(KC_I), S(KC_E), KC_SCOLON, -S(KC_E), S(KC_A), S(KC_Y), S(KC_X), KC_COLON, S(KC_K), S(KC_TAB), -KC_TRNS, KC_TRNS, S(KC_LGUI), S(KC_LCTL), S(KC_LALT), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, -// Right hand - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, KC_EXLM, S(KC_V), S(KC_D), S(KC_L), S(KC_J), S(KC_Z), - S(KC_C), S(KC_T), S(KC_S), S(KC_R), S(KC_N), S(KC_M), - KC_TRNS, S(KC_SLASH), S(KC_Q), S(KC_G), S(KC_H), S(KC_F), S(KC_C), - S(KC_RALT), S(KC_RCTL), S(KC_RGUI), KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, -KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS), -/* Keymap 3: QWERTY alted system compatibility layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | $ | " | < | > | [ | ] |Delete| |ScroLo| @ | + | - | / | * | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | % | | | e | & | o | e |Backsp| |CapsLo| ^ | v | d | l | j | z | - * |--------+------+------+------+------+------| ace | | |------+------+------+------+------+--------| - * | w | a | u | i | € | , |------| |------| c | t | s | r | n | m | - * |--------+------+------+------+------+------| Tab | | NumLo|------+------+------+------+------+--------| - * | e | \ | { | } | . | ~ | | | | ' | q | g | h | f | c | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | BEPO | |LSuper| LCtrl| LAlt| |Escape| L_Mse| | |Insert| | AltGr| RCtrl|RSuper|PrntSc| Pause| - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | L_Num| | | | | - * | _ |LShift|------| |------|RShift|Enter | - * | | |L_FNav| |L_FNav| | | - * `--------------------' `--------------------' - */ -[AQWER] = KEYMAP( -// Left hand -KC_DOLLAR, S(KC_QUOT), S(KC_COMM), S(KC_DOT), KC_LBRC, KC_RBRC, KC_DEL, -KC_PERCENT, KC_PIPE, KC_E, KC_AMPR, KC_O, KC_E, KC_BSPC, -KC_W, KC_A, KC_U, KC_I, RALT(KC_5), KC_COMMA, -KC_E, KC_BSLASH, KC_LCBR, KC_RCBR, KC_DOT, KC_TILDE, KC_TAB, -KC_TRNS, KC_NO, KC_LGUI, KC_LCTL, KC_LALT, - KC_ESC, MO(MSE), - MO(NUM), - KC_UNDS, MO(SQWER), MO(FNAV), -// Right hand - KC_SLCK, KC_AT, KC_PLUS, KC_MINUS, KC_SLASH, KC_ASTR, KC_EQUAL, - KC_CAPSLOCK, KC_CIRC, KC_V, KC_D, KC_L, KC_J, KC_Z, - KC_C, KC_T, KC_S, KC_R, KC_N, KC_M, - KC_NUMLOCK, KC_QUOT, KC_Q, KC_G, KC_H, KC_F, KC_C, - KC_TRNS, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, -KC_NO, KC_INS, -KC_TRNS, -MO(FNAV), MO(SQWER), KC_ENTER), -/* Keymap 4: function / navigation layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 |VolMut| | | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | |VolDwn| | | PgUp | Home | Up | End | F11 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| PgDn | Left | Down | Right| F12 | | - * |--------+------+------+------+------+------| VolUp| | |------+------+------+------+------+--------| - * | | Undo | Cut | Copy | Paste| | | | | | | | | | | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | | | | | | | | | | | | | | | | | | - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[FNAV] = KEYMAP( -// Left hand -KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_MUTE, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_NO, KC_VOLD, -KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_TRNS, KC_TRNS, -// Right hand - KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO, - KC_NO, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_F11, KC_NO, - KC_PGDOWN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_F12, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, -KC_NO, KC_NO, -KC_TRNS, -KC_TRNS, KC_TRNS, KC_NO), -/* Keymap 5: numeric layer, sends keypad codes - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | + | - | / | * | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | 7 | 8 | 9 | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | 4 | 5 | 6 | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | | | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | | | | | | | | | | | | | 0 | 00 | . | | | - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | | | | | | - * | | |------| |------| | Enter| - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUM] = KEYMAP( -// Left hand -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, - KC_NO, KC_NO, - KC_TRNS, - KC_NO, KC_TRNS, KC_NO, -// Right hand - KC_NO, KC_NO, KC_KP_PLUS, KC_KP_MINUS, KC_KP_SLASH, KC_KP_ASTERISK, KC_NO, - KC_NO, KC_NO, KC_KP_7, KC_KP_8, KC_KP_9, KC_NO, KC_NO, - KC_NO, KC_KP_4, KC_KP_5, KC_KP_6, KC_NO, KC_NO, - KC_NO, KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_NO, KC_NO, - KC_KP_0, M(KP_00), KC_KP_COMMA, KC_NO, KC_NO, -KC_NO, KC_NO, -KC_NO, -KC_NO, KC_TRNS, KC_KP_ENTER), -/* Keymap 6: mouse layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | |LClick| Up |RClick| WhUp | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| | Left | Down | Right|WhDown| | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------,-------------. ,-------------`-------------+------+------+------+------+--------' - * | | | | | | | | | | | | | | | | | | - * `----------------------------------' ,------|------|------| |------+------+------. `----------------------------------' - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[MSE] = KEYMAP( -// Left hand -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, - KC_NO, KC_TRNS, - KC_NO, - KC_NO, KC_TRNS, KC_NO, -// Right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_MS_WH_UP, KC_NO, - KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, -KC_NO, KC_NO, -KC_NO, -KC_NO, KC_TRNS, KC_NO) -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case KP_00: - if (record->event.pressed) { - return MACRO( T(KP_0), D(KP_0), END ); - } else { - return MACRO( U(KP_0), END ); - } - break; - case CA_Fx: - if (record->event.pressed) { - layer_on(FNAV); - return MACRO( D(LALT), D(LCTL), END ); - } else { - layer_off(FNAV); - return MACRO( U(LCTL), U(LALT), END ); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { -}; diff --git a/keyboards/ergodox_ez/keymaps/bepo/readme.md b/keyboards/ergodox_ez/keymaps/bepo/readme.md deleted file mode 100644 index 4a18cd80f..000000000 --- a/keyboards/ergodox_ez/keymaps/bepo/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# BEPO keymap for the ErgoDox - -This keymap has been made for the BEPO layout (http://bepo.fr), which is an ergonomic french keyboard layout based on Dvorak rules. As it's made for french people, the following of this readme will be in french. - -# Disposition BÉPO pour l'ErgoDox - -Cette keymap a été pensée pour la disposition BÉPO (http://bepo.fr), qui est une disposition de clavier francophone, ergonomique et libre, élaborée selon la méthode Dvorak. L'adaptation de cette disposition à l'ErgoDox a été réalisée en conservant les points forts du clavier TypeMatrix 2030 (très répandu dans la communauté bépo, avec un excellent rapport ergonomie / prix) voir en réglant certains de ses défauts (3 colonnes pour l'auriculaire droit et touche "Ê") et en apportant son lot de nouveautés (compatibilité avec les systèmes azerty et qwerty). - -Particularités --------------- - -Touches de repos des pouces : "espace" à gauche et "entrée" à droite. - -Placement des touches de combinaison ("Shift", "Alt", "Ctrl"...) adapté aux pouces, et permettant de conserver chaque doigt pour les rangées de lettres auxquelles ils sont assignés sans avoir à changer la touche de combinaison de côté (exemple : "A" majuscule puis "M" majuscule avec les auriculaires et un seul appui d'une touche "Shift"). - -Les touches "Alt" et "Alt Gr" sont accessibles avec les pouces sur la rangée du bas comme sur la TypeMatrix 2030, avec une symétrie gauche / droite. - -Les touches "Ctrl" sont placées sur la même ligne que les touche "Alt" et "Alt Gr" comme sur un clavier clasique, elles sont accessibles aux pouces sur la rangée du bas (moins éloigné que le groupe de touches de pouces pour des petites mains). - -Les touches "Backspace" et "Delete" sont placées comme sur la TypeMatrix 2030, du côté gauche uniquement (pour laisser celles de la main droite servir de {caps,num,scroll}lock puisqu'elles ont des LED). - -La touche "Tab" est placée comme sur la TypeMatrix 2020. - -Meilleure symétrie et accessibilité que la TypeMatrix 2030 : les touches "W" et "%" ont dû être déplacées du côté gauche en raison du nombre de touches de l'ErgoDox, mais l'auriculaire droit ne gère maintenant que deux colonnes de touches au lieu de trois. La touche "Ê" redevient accessible sur la même rangée que les autres lettres, comme sur un clavier classique en disposition bépo. Les lettres, chiffres et symboles sont tous regroupés sur 4 lignes et 6 colonnes pour chaque main, et la première rangée de lettres à la main gauche conserve une identité visuelle "BÉPO". - -Touche de fonction permettant de saisir les touches F1 à F12, les touches F1 à F10 sont placées de façon logique par rapport aux chiffres 1 à 0. Cette même touche permet l'accès aux touches directionnelles sans déplacer la main droite. Les touches "Home" et "End" sont placées de la même façon que sur une TypeMatrix 2030 par rapport aux touches directionnelles. Les touches "Page Up" et "Page Down" sont également accessibles facilement sans déplacer la main droite. Les fonctions "VolUp" et "VolDown" sont placées comme sur la TypeMatrix 2030, avec la fonction "Mute" juste au dessus. Les fonctions "Undo", "Cut", "Copy" et "Paste" sont placées côte à côte comme elles le seraient sur un clavier QWERTY en combinaison avec la touche "Ctrl" (à l'emplacement des lettres "Z", "X", "C" et "V"). Par rapport au layout "SpaceFN", l'utilisation d'une touche de fonction dédiée au pouce permet de ne pas ajouter de latence, et la touche espace reste compatible avec les jeux (action au moment de l'appui et possibilité d'appui long). - -Touche de fonction permettant l'accès au pavé numérique comme sur la TypeMatrix 2030, mais sans avoir à déplacer la main droite : avec les doigts sur la rangée de repos, possibilité de saisir les chiffres "4", "5" et "6" comme sur un pavé numérique classique. Le double "0" de la TypeMatrix a été conservé, et gagne une possibilité de répétition en simples "0". - -L'appui sur une touche permet de basculer en mode BEPO sur un système configuré pour un clavier QWERTY. Cette compatibilité n'est pas parfaite (pas encore de gestion des accents mais ça devrait être faisable avec une disposition en qwerty international, et les combinaisons de touches ne sont pas toutes supportées puisque le clavier traduit déjà certaines touches en combinaisons) mais reste pratique pour une saisie de texte occasionnelle. - -TODO : couche de compatibilité pour utiliser la disposition BÉPO sur un système configuré pour un clavier AZERTY. - -> Olivier Smedts diff --git a/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile b/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile deleted file mode 100644 index 6c0a79b11..000000000 --- a/keyboards/ergodox_ez/keymaps/coderkun_neo2/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -SLEEP_LED_ENABLE = no -UNICODE_ENABLE = yes diff --git a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c deleted file mode 100644 index 8a2ba26d2..000000000 --- a/keyboards/ergodox_ez/keymaps/coderkun_neo2/keymap.c +++ /dev/null @@ -1,281 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "led.h" -#include "keymap_extras/keymap_neo2.h" - -// Layer names -#define BASE 0 // default layer -#define PMQ 1 // poor man’s QWERTZ -#define PMN 2 // poor man’s Neo -#define FMU 3 // FMU layer -#define NHL 4 // Neo’s software layer 4 rebuilt in Hardware - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Layer 0: default - * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠- * │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ - * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ - * │ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │ - * ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ - * │ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │ - * ├───────┼─────┼─────┼─────╄─────╃─────┤ TL2 │ │ TL3 ├─────╄─────╃─────┼─────┼─────┼───────┤ - * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ - * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ CTL │ ALT │ MO1 │ Win │ Mod4│ │ Mod4│ Win │ MO1 │ Alt │ CTL │ - * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ - * │ ↠│ ↑ │ │ ↓ │ → │ - * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠- * │ │ │ ─ │ │ ─ │ │ │ - * │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ - * │ │ │ HYP │ │ MEH │ │ │ - * └─────┴─────┴─────┘ └─────┴─────┴─────┘ - */ -[BASE] = KEYMAP( - // left hand - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, NEO_GRV, - NEO_Y, NEO_X, NEO_V, NEO_L, NEO_C, NEO_W, KC_HOME, - NEO_L1_L, NEO_U, NEO_I, NEO_A, NEO_E, NEO_O, - KC_LSFT, NEO_UE, NEO_OE, NEO_AE, NEO_P, NEO_Z, TG(PMQ), - KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,NEO_L2_L, - KC_LEFT, KC_UP, - KC_MINS, - KC_SPC, KC_ENT, ALL_T(KC_NO), - // right hand - NEO_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_END, NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, - NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_L1_R, - TG(PMN), NEO_B, NEO_M, KC_COMM,KC_DOT, NEO_J, KC_RSFT, - NEO_L2_R,KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, - KC_DOWN, KC_RGHT, - KC_MINS, - MEH_T(KC_NO),KC_ENT,KC_SPC - ), - -/* Layer 1: poor man’s QWERTZ - * based on kaimi’s layout - * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠- * │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ - * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ - * │ C │ P │ T │ F │ K │ L │ HOM │ │ END │ B │ A │ S │ G │ V │ Y │ - * ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ - * │ Mod3 │ D │ H │ Ö │ O │ I ├─────┤ ├─────┤ U │ - │ Z │ E │ X │ Mod3 │ - * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ - * │ LSHFT │ Ä │ Q │ R │ W │ N │ │ │ │ J │ M │ , │ . │ ẞ │ Shift │ - * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ - * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ - * │ ↠│ ↑ │ │ ↓ │ → │ - * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠- * │ │ │ ─ │ │ ─ │ │ │ - * │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ - * │ │ │ HYP │ │ MEH │ │ │ - * └─────┴─────┴─────┘ └─────┴─────┴─────┘ - */ -[PMQ] = KEYMAP( - // left hand - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, - DE_C, DE_P, DE_T, DE_F, DE_K, DE_L, KC_HOME, - NEO_L1_L, DE_D, DE_H, DE_OE, DE_O, DE_I, - KC_LSFT, DE_AE, DE_Q, DE_R, DE_W, DE_N, KC_TRNS, - KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,MO(NHL), - KC_LEFT, KC_UP, - KC_MINS, - KC_SPC, KC_ENT, ALL_T(KC_NO), - // right hand - DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_END, DE_B, DE_A, DE_S, DE_G, DE_V, DE_Y, - DE_U, DE_MINS,DE_Z, DE_E, DE_X, NEO_L1_R, - KC_TRNS, DE_J, DE_M, DE_COMM,DE_DOT, DE_SS, KC_RSFT, - MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, - KC_DOWN, KC_RGHT, - KC_MINS, - MEH_T(KC_NO),KC_ENT,KC_SPC - ), - -/* Layer 2: poor man’s Neo - * based on kaimi’s layout - * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠- * │ TAB │ 1 │ 2 │ 3 │ 4 │ 5 │ ` │ │ ´ │ 6 │ 7 │ 8 │ 9 │ 0 │ BKSPC │ - * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ - * │ Y │ X │ V │ L │ C │ W │ HOM │ │ END │ K │ H │ G │ F │ Q │ ß │ - * ├───────┼─────┼─────┼─────╆─────╅─────┤ E │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ - * │ Mod3 │ U │ I │ A │ E │ O ├─────┤ ├─────┤ S │ N │ R │ T │ D │ Mod3 │ - * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ - * │ LSHFT │ Ü │ Ö │ Ä │ P │ Z │ │ │ │ B │ M │ , │ . │ J │ Shift │ - * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ CTL │ ALT │ MO1 │ Win │ MO4 │ │ M04 │ Win │ MO1 │ Alt │ CTL │ - * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ - * │ ↠│ ↑ │ │ ↓ │ → │ - * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠- * │ │ │ ─ │ │ ─ │ │ │ - * │ SPC │ RTN ├─────┤ ├─────┤ RTN │ SPC │ - * │ │ │ HYP │ │ MEH │ │ │ - * └─────┴─────┴─────┘ └─────┴─────┴─────┘ - */ -[PMN] = KEYMAP( - KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, - DE_Y, DE_X, DE_V, DE_L, DE_C, DE_W, KC_HOME, - KC_NO, DE_U, DE_I, DE_A, DE_E, DE_O, - KC_LSFT, DE_UE, DE_OE, DE_AE, DE_P, DE_Z, KC_TRNS, - KC_LCTL, KC_LALT,MO(FMU),KC_LGUI,MO(NHL), - KC_LEFT, KC_UP, - KC_MINS, - KC_SPC, KC_ENT, ALL_T(KC_NO), - // right hand - DE_ACUT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_END, DE_K, DE_H, DE_G, DE_F, DE_Q, DE_SS, - DE_S, DE_N, DE_R, DE_T, DE_D, KC_NO, - KC_TRNS, DE_B, DE_M, KC_COMM,KC_DOT, DE_J, KC_RSFT, - MO(NHL),KC_RGUI,MO(FMU),KC_RALT,KC_RCTL, - KC_DOWN, KC_RGHT, - KC_MINS, - MEH_T(KC_NO),KC_ENT,KC_SPC - ), - -/* Layer 3: F-keys, Mouse and Unicode - * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠- * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ - * │ │ │ │ │ ✕ │ │ │ │ │ │ F9 │ F10 │ F11 │ F12 │ │ - * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ - * │ │ │ │ │ ✓ │ ├─────┤ ├─────┤ │ F5 │ F6 │ F7 │ F8 │ │ - * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ - * │ │ │ │ │ │ │ │ │ │ │ F1 │ F2 │ F3 │ F4 │ │ - * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ - * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ - * │ Ms↠│ Ms↑ │ │ Ms↓ │ Ms→ │ - * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠- * │ │ │ MLC │ │ MRC │ │ │ - * │ │ ├─────┤ ├─────┤ │ │ - * │ │ │ │ │ │ │ │ - * └─────┴─────┴─────┘ └─────┴─────┴─────┘ - */ -[FMU] = KEYMAP( - // left hand - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,UC(0x2713),KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,UC(0x2715),KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_MS_L, KC_MS_U, - KC_BTN1, - KC_TRNS,KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS,KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS,KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, - KC_TRNS, KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_MS_D, KC_MS_R, - KC_BTN2, - KC_TRNS, KC_TRNS,KC_TRNS - ), - -/* Layer 4: Neo’s software layer 4 rebuilt in Hardware - * based on kaimi’s layout - * ┌───────┬─────┬─────┬─────┬─────┬─────┬─────┠┌─────┬─────┬─────┬─────┬─────┬─────┬───────┠- * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───────┼─────┼─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┼─────┼───────┤ - * │ │ PgUp│ BSpc│ ↑ │ Del │ PgDn│ │ │ │ │ 7 │ 8 │ 9 │ + │ − │ - * ├───────┼─────┼─────┼─────╆─────╅─────┤ │ │ ├─────╆─────╅─────┼─────┼─────┼───────┤ - * │ │ Home│ ↠│ ↓ │ → │ End ├─────┤ ├─────┤ │ 4 │ 5 │ 6 │ , │ . │ - * ├───────┼─────┼─────┼─────╄─────╃─────┤(TL2)│ │(TL3)├─────╄─────╃─────┼─────┼─────┼───────┤ - * │ │ Esc │ Tab │ Ins │ Ret │ Undo│ │ │ │ │ 1 │ 2 │ 3 │ │ │ - * └─┬─────┼─────┼─────┼─────┼─────┼─────┴─────┘ └─────┴─────┼─────┼─────┼─────┼─────┼─────┬─┘ - * │ │ │(MO1)│ │(MO4)│ │(MO4)│ │(MO1)│ │ │ - * └─────┴─────┴─────┴─────┴─────┘ ┌─────┬─────┠┌─────┬─────┠└─────┴─────┴─────┴─────┴─────┘ - * │ │ │ │ │ │ - * ┌─────┼─────┼─────┤ ├─────┼─────┼─────┠- * │ │ │ │ │ │ │ │ - * │ │ ├─────┤ ├─────┤ │ │ - * │ │ │ │ │ │ │ │ - * └─────┴─────┴─────┘ └─────┴─────┴─────┘ - */ -[NHL] = KEYMAP( - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_PGUP,KC_BSPC,KC_UP, KC_DELT,KC_PGDN,KC_NO, - KC_NO, KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_END, - KC_NO, KC_ESC, KC_TAB, KC_INS, KC_ENT, KC_UNDO,KC_TRNS, - KC_NO, KC_NO, KC_TRNS,KC_NO, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_7, KC_8, KC_9, DE_PLUS,DE_MINS, - KC_NO, KC_4, KC_5, KC_6, KC_COMM,KC_DOT, - KC_TRNS, KC_NO, KC_1, KC_2, KC_3, KC_NO, KC_NO, - KC_TRNS,KC_NO, KC_TRNS,KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [BASE] = ACTION_FUNCTION(BASE), - [PMQ] = ACTION_FUNCTION(PMQ), - [PMN] = ACTION_FUNCTION(PMN), - [FMU] = ACTION_LAYER_TAP_TOGGLE(FMU), - [NHL] = ACTION_LAYER_TAP_TOGGLE(NHL) -}; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } - else { - unregister_code(KC_RSFT); - } - break; - } - - return MACRO_NONE; -}; - - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) -{ - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case FMU: - ergodox_right_led_1_on(); - break; - case PMQ: - ergodox_right_led_2_on(); - break; - case PMN: - ergodox_right_led_3_on(); - break; - default: - if(host_keyboard_leds() & (1<event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/colemak/readme.md b/keyboards/ergodox_ez/keymaps/colemak/readme.md deleted file mode 100644 index e28b2f085..000000000 --- a/keyboards/ergodox_ez/keymaps/colemak/readme.md +++ /dev/null @@ -1,4 +0,0 @@ -# ErgoDox EZ Colemak Configuration - -Colemak layout with same layers as default ergodox ez keymap. - diff --git a/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keyboard-layout.png b/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keyboard-layout.png deleted file mode 100644 index 57df5a1f9..000000000 Binary files a/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keyboard-layout.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c b/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c deleted file mode 100644 index a909ed3a4..000000000 --- a/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/keymap.c +++ /dev/null @@ -1,264 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_norwegian.h" - -#define BASE 0 // default layer -#define BASE_MAC 1 // default layer mac -#define NUMB_SYMB 2 // numbers and symbols -#define NUMB_SYMB_MAC 3 // numbers and symbols mac -#define FUNCTION 4 // function keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Basic layer PC - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | [ | ] | { | } | * |Mac/PC| | ^ | $ | ( | ) | < | > | @ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ? | Q | W | F | P | G | " | | ' | J | L | U | Y | Å | Æ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | : | A | R | S | T | D |------| |------| H | N | E | I | O | Ø | - * |--------+------+------+------+------+------| ; | | = |------+------+------+------+------+--------| - * | ! | Z | X | C | V | B | | | | K | M | RIGHT| DOWN | UP | _ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Func | Lclk | Rclk | TAB |,/CTRL| | LEFT | Esc | ` | # | Num | - * `----------------------------------' `----------------------------------' - * ,-------------. ,--------------. - * | & | | | |Insert| / | - * ,------|------|------| |------+-------+------. - * | | | + | | Del | | | - * | Shift| ./Spc|------| |------| Enter |Space| - * | | |-/Alt | | Bspc | | | - * `--------------------' `---------------------' - */ -[BASE] = KEYMAP( - // left hand - NO_BSLS, NO_LBRC, NO_RBRC, NO_LCBR, NO_RCBR, NO_ASTR, TG(1), - NO_QUES, KC_Q, KC_W, KC_F, KC_P, KC_G, NO_QUO2, - NO_COLN, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_EXLM, KC_Z, KC_X, KC_C, KC_V, KC_B, NO_SCLN, - MO(4), KC_BTN1, KC_BTN2, KC_TAB,GUI_T(KC_COMMA), - NO_AMPR, NO_PIPE, - NO_PLUS, - KC_FN1,CTL_T(KC_DOT),ALT_T(NO_MINS), - // right hand - KC_FN5, NO_DLR, NO_LPRN, NO_RPRN ,KC_FN3, KC_FN4,NO_AT, - NO_APOS, KC_J, KC_L, KC_U, KC_Y, NO_AA, NO_AE , - KC_H, KC_N, KC_E, KC_I, KC_O, NO_OSLH, - NO_EQL, KC_K, KC_M, KC_RIGHT, KC_DOWN, KC_UP, NO_UNDS, - KC_LEFT, KC_ESC, KC_FN7, KC_HASH, MO(2), - KC_INSERT, NO_SLSH, - KC_DELT, - KC_BSPC,KC_ENT,KC_SPC - ), -/* Keymap 1: Basic layer MACS (Same as pc, except for cmd/ctrl, which are swapped) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | | | { | } | | | | | $ | | | < | > | @ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | ' |------+------+------+------+------+--------| - * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Func | | | |,/Ctrl| | | | ` | | Num | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | |./Cmd |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[BASE_MAC] = KEYMAP( - NO_BSLS_MAC, KC_TRNS,KC_TRNS, NO_LCBR_MAC,NO_RCBR_MAC, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CTL_T(KC_COMMA), - KC_TRNS, NO_PIPE_MAC, - KC_TRNS, - KC_TRNS,GUI_T(KC_DOT) , KC_TRNS, - // right hand - KC_TRNS, NO_DLR_MAC, KC_TRNS,KC_TRNS,KC_FN8, KC_FN9,NO_AT_MAC, - NO_APOS_MAC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, NO_GRV_MAC, KC_TRNS, MO(3), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Number ++ layer pc - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | % | | | | | | ~ | ´ | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 3 | 2 | 1 | 0 | |------| |------| | 5 | 6 | 7 | 8 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | 4 | | | | | | 9 | END | PGDWN| PGUP | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | HOME | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUMB_SYMB] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_PERC, KC_TRNS , KC_TRNS, - KC_TRNS, KC_3 , KC_2 , KC_1 , KC_0 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_FN2, KC_FN6 , KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_5, KC_6, KC_7, KC_8, KC_TRNS, - KC_TRNS, KC_HOME, KC_9, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, - KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 3: Number ++ layer mac. Some keys have to be repeated from the pc symbol layer, since transient keys inherit from the layer we jump from, not the layer above. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | % | | | | | | ~ | ´ | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 3 | 2 | 1 | 0 | |------| |------| | 5 | 6 | 7 | 8 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | 4 | | | | | | 9 | END | PGDWN| PGUP | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | HOME | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[NUMB_SYMB_MAC] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_PERC, KC_TRNS , KC_TRNS, - KC_TRNS, KC_3 , KC_2 , KC_1 , KC_0 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_FN2, KC_FN10, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_5, KC_6, KC_7, KC_8, KC_TRNS, - KC_TRNS, KC_HOME, KC_9, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, - KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 4: Function layer mac + pc - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F3 | F2 | F1 | | |------| |------| | F5 | F6 | F7 | F8 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | F4 | | | | | | F9 | F10 | F11 | F12 | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[FUNCTION] = KEYMAP( - KC_5, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, - KC_TRNS, KC_F3 , KC_F2 , KC_F1 , KC_TRNS , KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F4, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_F5, KC_F6, KC_F7, KC_F8, KC_TRNS, - KC_TRNS, NO_TILD, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -) -}; - -enum macro_id { - TILDE_NO, LESS_NO, GRTR_NO, CIRC_NO, ACUT_NO, GRV_NO, LESS_NO_MAC, GRTR_NO_MAC, ACUT_NO_MAC -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_MODS_ONESHOT(MOD_LSFT), // Sticky shift light. Tap for the next keypress to be shifted. Hold for regular shift. - [2] = ACTION_MACRO(TILDE_NO), // Completed ~ character(pc and mac), no space needed. - [3] = ACTION_MACRO(LESS_NO), // < completed on keypress down, to avoid shifting the next character if it is not released first. - [4] = ACTION_MACRO(GRTR_NO), // > completed on keypress down, to avoid shifting the next character if it is not released first. - [5] = ACTION_MACRO(CIRC_NO), // Completed ^ character, no space needed. - [6] = ACTION_MACRO(ACUT_NO), // Completed ´ character, no space needed. - [7] = ACTION_MACRO(GRV_NO), // Completed ` character, no space needed. - [8] = ACTION_MACRO(LESS_NO_MAC), // < completed on keypress down, to avoid same button problem when typing <> quickly - [9] = ACTION_MACRO(GRTR_NO_MAC), // > completed on keypress down, to avoid same button problem when typing <> quickly - [10] = ACTION_MACRO(ACUT_NO_MAC), // Completed ´ character, no space needed -}; - - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - keyevent_t event = record->event; - - switch (id) { - case TILDE_NO: - return (event.pressed ? MACRO( D(RALT), T(RBRC), U(RALT), T(SPC), END ) : MACRO_NONE); - case LESS_NO: - return (event.pressed ? MACRO( T(NUBS), END ) : MACRO_NONE); - case GRTR_NO: - return (event.pressed ? MACRO( D(LSFT), T(NUBS), U(LSFT), END ) : MACRO_NONE); - case CIRC_NO: - return (event.pressed ? MACRO( D(LSFT), T(RBRC), U(LSFT), T(SPC), END ) : MACRO_NONE); - case ACUT_NO: - return (event.pressed ? MACRO( D(RALT), T(EQL), U(RALT), T(SPC), END ) : MACRO_NONE); - case GRV_NO: - return (event.pressed ? MACRO( D(LSFT), T(EQL), T(SPC), U(LSFT), END ) : MACRO_NONE); - case LESS_NO_MAC: - return (event.pressed ? MACRO( T(GRV), END ) : MACRO_NONE); - case GRTR_NO_MAC: - return (event.pressed ? MACRO( D(LSFT), T(GRV), U(LSFT), END ) : MACRO_NONE); - case ACUT_NO_MAC: - return (event.pressed ? MACRO( T(EQL), T(SPC), END ) : MACRO_NONE); - } - return MACRO_NONE; -}; diff --git a/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/readme.md b/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/readme.md deleted file mode 100644 index 48f095cae..000000000 --- a/keyboards/ergodox_ez/keymaps/colemak_osx_pc_no/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# Norwegian Colemak setup with osx/pc toggle - -## Motivation -I wanted a Norwegian Colemak setup that worked in a similar way on both my Mac and PC. I also wanted it to translate from a standard Norwegian keyboard OS setup. - -## Overview -The setup is created to be programmer friendly. -- Most of the symbols used in code can be activated without using layers or shift key. -- You can reach the IDE/OS shortcut activators(Ctrl, Win/Cmd, Alt, Shift) with the thumb. -- Navigation is prioritized, arrows are right below the home row. - -## PC/Mac toggle -The default setup is for Norwegian keyboard setting(not colemak variants) on a PC(Windows or Linux). Use the Mac/PC toggle button to switch between OSX and PC setup. The settings will be reverted to PC setup each time you restart/connect the keyboard. - -## Layers -Numbers and function buttons are on their own layers. The easiest way to switch layers(at least with my hands) in this setup, is to push your hand right below the little finger, on the layer switches. You will then have all your fingers free to type numbers or press function buttons. - -## Shift-key -Tap for the next character to be shifted, hold down for regular shift functionality - -## Layout - -![keyboard-layout](keyboard-layout.png) diff --git a/keyboards/ergodox_ez/keymaps/csharp_dev/csharp_dev.png b/keyboards/ergodox_ez/keymaps/csharp_dev/csharp_dev.png deleted file mode 100644 index 6fba568fc..000000000 Binary files a/keyboards/ergodox_ez/keymaps/csharp_dev/csharp_dev.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/csharp_dev/csharp_dev_legend.png b/keyboards/ergodox_ez/keymaps/csharp_dev/csharp_dev_legend.png deleted file mode 100644 index b0a1c513c..000000000 Binary files a/keyboards/ergodox_ez/keymaps/csharp_dev/csharp_dev_legend.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/csharp_dev/keymap.c b/keyboards/ergodox_ez/keymaps/csharp_dev/keymap.c deleted file mode 100644 index e9648ede7..000000000 --- a/keyboards/ergodox_ez/keymaps/csharp_dev/keymap.c +++ /dev/null @@ -1,239 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define FKEYS 1 // F keys + macros - -#define MACRO_PUBLIC 10 -#define MACRO_PRIVATE 11 - -#define MACRO_STATIC 12 -#define MACRO_CONST 13 - -#define MACRO_VOID 14 -#define MACRO_VAR 15 -#define MACRO_STRING 16 - -#define MACRO_INT 17 -#define MACRO_FLOAT 18 -#define MACRO_BOOL 19 - -#define MACRO_RETURN 20 -#define MACRO_NULL 21 -#define MACRO_BREAK 22 - -#define MACRO_TODO 23 -#define MACRO_NEW 24 -#define MACRO_PARENTHESE 25 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ( | 1 | 2 | 3 | 4 | 5 | " | | Save | 6 | 7 | 8 | 9 | 0 | [ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ) | Q | W | E | R | T |Bkspa | | Del | Y | U | I | O | P | ] | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | { | A | S | D | F | G |------| |------| H | J | K | L | _ | Redo | - * |--------+------+------+------+------+------| / | | ; |------+------+------+------+------+--------| - * | } |Z~Alt | X | C | V | B | | | | N | M | ' | ! | ? | Undo | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Tab~CL| < | > | | | & | | = | + | - | * | L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |. ~L1 | , | |Home |End~L1| - * ,------|------|------| |------+------+------. - * | | | Copy | | UP | | | - * | Enter| Space|------| |------| Space|Enter | - * | ~WIN | ~LSFT| Past | | DOWN | ~LSFT| ~WIN | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_LPRN, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_QUOTE), - KC_RPRN, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPACE, - KC_LCBR, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_RCBR, ALT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_SLASH, - CTL_T(KC_TAB), LSFT(KC_COMMA),LSFT(KC_DOT),KC_PIPE,KC_AMPR, - LT(1,KC_DOT), KC_COMM, - LCTL(KC_C), - GUI_T(KC_ENTER),SFT_T(KC_SPACE),LCTL(KC_V), - // right hand - LCTL(KC_S) , KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRACKET, - KC_DELETE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRACKET, - KC_H, KC_J, KC_K, KC_L, KC_UNDS,LCTL(KC_Y), - KC_SCOLON,KC_N, KC_M, KC_QUOTE ,KC_EXLM , LSFT(KC_SLASH), LCTL(KC_Z), - KC_EQUAL,KC_PLUS , KC_MINUS,KC_ASTR , TG(1), - KC_HOME, LT(1,KC_END), - KC_UP, - KC_DOWN,SFT_T(KC_SPACE), GUI_T(KC_ENTER) - ), - -/* Keymap 1: F keys + macros - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | F1 | F2 | F3 | F4 | F5 | ` | | Calc | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab |Public|Static|string|int |return| | | |//TODO| | | | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |Privat|Const |var |float |null |------| |------|new | | | | | | - * |--------+------+------+------+------+------| \ | | ~ |------+------+------+------+------+--------| - * | | | |void |bool |break;| | | |(); | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | WIN | Alt | | | | PgUp | PgDw | Ins | PtSc | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | Cut | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| Left | Right| - * | | | | | | | | - * `--------------------' `--------------------' - */ -// FKEYS + MACROS -[FKEYS] = KEYMAP( - // left hand - KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_GRAVE, - KC_TAB,M(MACRO_PUBLIC),M(MACRO_STATIC), M(MACRO_STRING),M(MACRO_INT),M(MACRO_RETURN),KC_TRNS, - KC_TRNS,M(MACRO_PRIVATE),M(MACRO_CONST), M(MACRO_VAR),M(MACRO_FLOAT),M(MACRO_NULL), - KC_TRNS,KC_TRNS,KC_TRNS,M(MACRO_VOID),M(MACRO_BOOL),M(MACRO_BREAK),KC_BSLASH, - KC_TRNS,KC_LGUI,KC_LALT,KC_TRNS,KC_TRNS, - KC_TRNS,LCTL(KC_X), - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_CALCULATOR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, M(MACRO_TODO), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, - M(MACRO_NEW), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TILD, M(MACRO_PARENTHESE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_PGUP,KC_PGDOWN, KC_INSERT, KC_PSCREEN, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_LEFT, KC_RIGHT -), - - -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(FKEYS) // FN1 - Momentary Layer 1 -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case MACRO_PUBLIC: - if (record->event.pressed) { - return MACRO( T(P), T(U), T(B), T(L), T(I), T(C), T(SPACE),END); - } - break; - case MACRO_PRIVATE: - if (record->event.pressed) { - return MACRO( T(P), T(R), T(I), T(V), T(A), T(T), T(E), T(SPACE),END); - } - break; - case MACRO_STATIC: - if (record->event.pressed) { - return MACRO( T(S), T(T), T(A), T(T), T(I), T(C), T(SPACE), END); - } - break; - case MACRO_CONST: - if (record->event.pressed) { - return MACRO( T(C), T(O), T(N), T(S), T(T), T(SPACE), END); - } - break; - case MACRO_VOID: - if (record->event.pressed) { - return MACRO( T(V), T(O), T(I), T(D), T(SPACE), END); - } - break; - case MACRO_VAR: - if (record->event.pressed) { - return MACRO( T(V), T(A), T(R), T(SPACE), END); - } - break; - case MACRO_STRING: - if (record->event.pressed) { - return MACRO( T(S), T(T), T(R), T(I), T(N), T(G), T(SPACE), END); - } - break; - case MACRO_BOOL: - if (record->event.pressed) { - return MACRO( T(B), T(O), T(O), T(L), T(SPACE), END); - } - break; - case MACRO_INT: - if (record->event.pressed) { - return MACRO( T(I), T(N), T(T), T(SPACE), END); - } - break; - case MACRO_FLOAT: - if (record->event.pressed) { - return MACRO( T(F), T(L), T(O), T(A),T(T),T(SPACE), END); - } - break; - case MACRO_RETURN: - if (record->event.pressed) { - return MACRO( T(R), T(E), T(T), T(U),T(R),T(N), END); - } - break; - case MACRO_NULL: - if (record->event.pressed) { - return MACRO( T(N), T(U), T(L), T(L), END); - } - case MACRO_BREAK: - if (record->event.pressed) { - return MACRO( T(B), T(R), T(E), T(A), T(K), T(SCOLON), END); - } - break; - case MACRO_TODO: - if (record->event.pressed) { - return MACRO( T(SLASH), T(SLASH), D(LSHIFT) ,T(T), T(O), T(D), T(O),U(LSHIFT), T(SPACE),END); - } - break; - case MACRO_NEW: - if (record->event.pressed) { - return MACRO( T(N), T(E), T(W), T(SPACE), END); - } - break; - case MACRO_PARENTHESE: - if (record->event.pressed) { - return MACRO( D(LSHIFT),T(9), T(0),U(LSHIFT), T(SCOLON), END); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/csharp_dev/readme.md b/keyboards/ergodox_ez/keymaps/csharp_dev/readme.md deleted file mode 100644 index 96af077ad..000000000 --- a/keyboards/ergodox_ez/keymaps/csharp_dev/readme.md +++ /dev/null @@ -1,47 +0,0 @@ -# ErgoDox EZ C# Developer configuration - -## Changelog - -* Feb 12, 2016 (V1): - * First version commit -* Mar 20, 2016 (V2): - * Removed "Classic QWERTY" layer, inverted GUI and SHIFT on Hold for Space and Enter - -## About -This layout was conceived in an attempt to optimise keyboard layout for developers (C# more specifically, but it can work with most of other languages), and limit the keys required to perform the most frequent actions. - -I came to the realization that my main tool as a developer, the qwerty keyboard was something that did not evolved at its core in almost 150 years. -There are a lot of reasons to this, and it would be a massive entreprise to change a standard so strongly anchored, but I wanted to give it a try and see how would look an input device dedicated to developers, more specifically a C# developer in my case. -The biggest flaw in standard QWERTY keyboards was that I always needed to perform key combination to access commonly used characters or actions. Think about it a minute, how many times a day do you press a modifier key such as Ctrl or Shift, it's insane and could be so easily optimized to require only one key press. - -Then I came across the ErgoDox EZ project, that allowed a full customization of its firmware, and a unique 2 parts design. - -![CSharpDev](csharp_dev_legend.png) - -## Layout design principles -* No key combination required for the most common input characters ( (),[],{},<> ... ) -* No key combination required for the most common actions (copy/paste/undo/save) -* Regroup characters by usage ( + - * = ...) -* Easy access to the most commonly used characters: ; / " . , -* Preregistered macro for the most common C# langage instructions: public / private / string / int / float ... - -## Why is it specific to C Sharp -I defined the characters priority based on their usage in C# language, most of this characters are also used in other coding languages but it may require some tweaking. -For example there is no direct access to ~ or $ keys which can be very common in some languages. -Note it is also specific to Windows environement as the shortcut used in action keys would not work on Mac Os - -## In usage -It was relatively easy to get used to the layout, but it's hard for me to define how easy it was as I was getting used to a blank Ergodox keyboard at the same time. -Still it's extremely satisfying to Save your file with just one easily accessible key or to have one big key to end your code line ( ; ) - -## Improvements -This layout was shared after a bunch of iterations and only once I was happy with it. -Still there are many way to improve or iterate on this: -* Make it language agnostic -* Check and compile language's keyboard's heatmaps to statistically define keys priority (e.g. https://dzone.com/articles/most-pressed-keys-various ) -* QWERTY is still not the most efficient typing layout, I would like to create a Dvorak based similar layout in a near futur - -## Issues -One of the issues encountered while creating this layout was that I did not find a way to have a key to send a modifier on hold, and a key combination while pressed (e.g. I can't set a Key to do Save (Ctrl + S) when pressed and Shift modifier when hold ) - - diff --git a/keyboards/ergodox_ez/keymaps/dave/keymap.c b/keyboards/ergodox_ez/keymaps/dave/keymap.c deleted file mode 100644 index e9480af3e..000000000 --- a/keyboards/ergodox_ez/keymaps/dave/keymap.c +++ /dev/null @@ -1,199 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define PROG 1 // programming -#define NAVI 2 // navigation - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | | 6 | 7 | 8 | 9 | 0 | - | BkSpce | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | Y | | G | Y | U | I | O | P | Enter | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L | ; | Enter | - * |--------+------+------+------+------+------| H | | B |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |`/Ctrl| \ | | | LAlt | | RAlt | [ | ] | |'/Ctrl| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | PrtS | PrtS | | CtAl | CtAl | - * ,------+------+------| |------+------+------. - * | | | L1 | | L1 | | | - * | Spce | ~L2 +------| |------+ ~L1 | Spce | - * | | | LGui | | RGui | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, - KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_H, - CTL_T(KC_GRV),KC_NUBS,KC_NO, KC_NO, KC_LALT, - KC_PSCREEN, KC_PSCREEN, - TO(PROG, ON_PRESS), - KC_SPC, MO(NAVI), KC_LGUI, - // right hand - KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, - KC_G, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENTER, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER, - KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_RALT,KC_LBRC,KC_RBRC,KC_NO, CTL_T(KC_QUOT), - MT(0x5, KC_NO), MT(0x5, KC_NO), - TO(PROG, ON_PRESS), - KC_RGUI, MO(PROG), KC_SPC - ), - -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | K/ | K* | K- | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | ( | ) | | | | | | | K7 | K8 | K9 | K+ | # | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | { | } | ` |------| |------| | K4 | K5 | K6 | K+ | ' | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | | K1 | K2 | K3 | K= | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | K0 | K0 | K. | K= | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | L2 | | L2 | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// PROGRAMMING -[PROG] = KEYMAP( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, - KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, - KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - TO(NAVI, ON_PRESS), - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_NO, KC_PSLS, KC_PAST, KC_PMNS, KC_EQUAL, - KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_NUHS, - KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_QUOT, - KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PENT, KC_TRNS, - KC_P0, KC_P0, KC_PDOT, KC_PENT, KC_TRNS, - KC_TRNS, KC_TRNS, - TO(NAVI, ON_PRESS), - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Keymap 2: Navigation and system keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Home | Up | End | Ins | PgUp | | | | | | Ins | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Left | Down | Rght | Del | PgDn |------| |------| | Back | Del | Fwrd | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Lclk | MsUp | Rclk | | | | | | | Prev | Play | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | MsLt | MsDn | MsRt | | |VolDn | Mute |VolUp | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | L0 | | L0 | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// NAVIGATION -[NAVI] = KEYMAP( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_TRNS, KC_HOME, KC_UP, KC_END, KC_INS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DELT, KC_PGDN, - KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, - TO(BASE, ON_PRESS), - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_WBAK, KC_DELT, KC_WFWD, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - TO(BASE, ON_PRESS), - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { - //[1] = ACTION_LAYER_TAP_TOGGLE(PROG), // FN1 - Momentary Layer 1 (Symbols) - //[2] = ACTION_LAYER_TAP_TOGGLE(NAVI) // FN2 - Momentary Layer 2 (Navigation) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - /* leds is a static array holding the current brightness of each of the - * three keyboard LEDs. It's 4 long simply to avoid the ugliness of +1s and - * -1s in the code below, and because wasting a byte really doesn't matter - * that much (no, it *doesn't*, stop whinging!). Note that because it's - * static it'll maintain state across invocations of this routine. - */ - static uint8_t leds[4]; - uint8_t led; - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - - /* Loop over each LED/layer */ - for (led = 1; led <= 3; ++led) { - /* If the current layer matches the current LED, increment its - * brightness by 1 up to a maximum of 255. If the current layer doesn't - * match, decrement its brightness by 1 down to a minimum of zero. - */ - leds[led] += (layer == led) ? - (leds[led] < 255 ? 1 : 0): - (leds[led] > 0 ? -1 : 0); - /* Set LED state according to the new brightness */ - if (leds[led]) { - ergodox_right_led_on(led); - ergodox_right_led_set(led, leds[led]); - } - else { - ergodox_right_led_off(led); - } - } - - -}; diff --git a/keyboards/ergodox_ez/keymaps/dave/readme.md b/keyboards/ergodox_ez/keymaps/dave/readme.md deleted file mode 100644 index aa0f9bd19..000000000 --- a/keyboards/ergodox_ez/keymaps/dave/readme.md +++ /dev/null @@ -1,38 +0,0 @@ -This keymap is my preferred layout (after a certain amount of experimentation). -The rationale behind the design is as follows: - -I grew up typing from a very early age and thus never learned the "correct" way -to touch type (essentially, I'm self-taught). As a, result my fingers don't -tend to stay on the "home keys" and occasionally my right hand wants to type -keys that are on the left of the keyboard, and vice versa. - -Hence, despite liking the idea of split keyboards in principle, I've never been -able to get on with them because the split simply doesn't work with my style of -typing. The Ergodox solves this neatly by virtue of having a few extra keys in -the "middle" of the keyboard which I can utilise for deliberate redundancy. -Thus in this keymap there are two "6" keys (one on the left, one on the right) -and likewise Y, H, G, and B are all duplicated to enable one-handed patterns -that I use frequently (e.g. "byobu" with the right hand, "yes" with the left, -etc.). - -I occasionally use the numeric pad for data entry, thus this is duplicated -under the natural home position of the right hand in layer 1 (activated by -holding one of the right thumb buttons), while the cursor keys are duplicated -under the classic WASD gaming layout of the left hand in layer 2 (activated by -holding one of the left thumb buttons). Various other useful keys also appear -in these layers (brackets and symbols for coding in layer 1, navigation and -F-keys in layer 2, etc.). - -Finally, modifier keys like Ctrl, Shift, and Alt, along with Backspace and -Enter are all in traditional locations in an effort to reuse existing muscle -memory as much as possible (keys like =, #, and ' are in layer 1). The layout -maps are in the comments of keymap_dave.c so I won't bother duplicating them -here. - -Oh, and the LEDs are rather pimped ... because I could! - -Anyway, although I'm sure this keymap won't be to many people's taste you might -find some interesting ideas in here for your own layouts. Do tweet me -(@waveform80) if you have any questions / suggestions / bugs. - -Dave. diff --git a/keyboards/ergodox_ez/keymaps/default/default.png b/keyboards/ergodox_ez/keymaps/default/default.png deleted file mode 100644 index 6575f7b5e..000000000 Binary files a/keyboards/ergodox_ez/keymaps/default/default.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/default/default_highres.png b/keyboards/ergodox_ez/keymaps/default/default_highres.png deleted file mode 100644 index 7d9f045f4..000000000 Binary files a/keyboards/ergodox_ez/keymaps/default/default_highres.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c deleted file mode 100644 index b48a54a43..000000000 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ /dev/null @@ -1,182 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/default/readme.md b/keyboards/ergodox_ez/keymaps/default/readme.md deleted file mode 100644 index 8f6dba45e..000000000 --- a/keyboards/ergodox_ez/keymaps/default/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# ErgoDox EZ Default Configuration - -## Changelog - -* Feb 2, 2016 (V1.1): - * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). - -This is what we ship with out of the factory. :) The image says it all: - -![Default](default_highres.png) diff --git a/keyboards/ergodox_ez/keymaps/default_osx/default_osx_highres.png b/keyboards/ergodox_ez/keymaps/default_osx/default_osx_highres.png deleted file mode 100644 index 04f46bbd5..000000000 Binary files a/keyboards/ergodox_ez/keymaps/default_osx/default_osx_highres.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/default_osx/keymap.c b/keyboards/ergodox_ez/keymaps/default_osx/keymap.c deleted file mode 100644 index c57ffbb88..000000000 --- a/keyboards/ergodox_ez/keymaps/default_osx/keymap.c +++ /dev/null @@ -1,187 +0,0 @@ -// Netable differences vs. the default firmware for the ErgoDox EZ: -// 1. The Cmd key is now on the right side, making Cmd+Space easier. -// 2. The media keys work on OSX (But not on Windows). -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_LGUI, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/default_osx/readme.md b/keyboards/ergodox_ez/keymaps/default_osx/readme.md deleted file mode 100644 index aa749aac9..000000000 --- a/keyboards/ergodox_ez/keymaps/default_osx/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# The OSX Friendly Version of the Default Firmware - -So, I took the default firmware and just made a couple of tweaks that make it easier to use with OS X: - -1. The Cmd key is now on the right side, making Cmd+Space easier. -2. The media keys work on OSX (But not on Windows). - -![default osx](default_osx_highres.png) diff --git a/keyboards/ergodox_ez/keymaps/dragon788/keymap.c b/keyboards/ergodox_ez/keymaps/dragon788/keymap.c deleted file mode 100644 index 3aec8c6cf..000000000 --- a/keyboards/ergodox_ez/keymaps/dragon788/keymap.c +++ /dev/null @@ -1,229 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys -#define PLVR 3 // Plover layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LGui | |Plover| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | ; | '"/Ctrl| - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ~L1 | Grv | '" | Left |Rgt/L2| | Up/L2| Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | Home | | PgUp |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | End | | PgDn | | | - * |Backsp|Delete|------| |------| Enter |Space | - * | ace | | LAlt | |TabCtl| | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_FN1, KC_GRV, KC_QUOT,KC_LEFT, LT(MDIA, KC_RGHT), - KC_APP, KC_HOME, - KC_END, - KC_BSPC,KC_DELT,KC_LALT, - // right hand - TG(3), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - LT(MDIA, KC_UP), KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_PGUP, CTL_T(KC_ESC), - KC_PGDN, - CTL_T(KC_TAB),KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | Calc | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_CALC, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | Rclk | Lclk | | | | | | Lclk | Rclk | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft| MsUp |MsDown|MsRght|------| |------|MsLeft|MsDown| MsUp |MsRght| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | Prev | |VolUp | | - * ,------|------|------| |------+------+------. - * | | | Play | | Mute |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Fwd |Back | - * | | | Next | |VolDn | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN1, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_MPRV, - KC_MPLY, - KC_BTN1, KC_BTN2, KC_MNXT, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_TRNS, - KC_MUTE, - KC_VOLD, KC_WBAK, KC_WFWD -), - -/* Keymap 4: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | c | v |------| |------| n | m | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[PLVR] = KEYMAP( // layout: layer 4: Steno for Plover - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_FN4, KC_NO, - KC_NO, - KC_C, KC_V, KC_NO, - // right hand - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M -), - -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/dvorak/dvorak.png b/keyboards/ergodox_ez/keymaps/dvorak/dvorak.png deleted file mode 100644 index cb8316309..000000000 Binary files a/keyboards/ergodox_ez/keymaps/dvorak/dvorak.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/dvorak/keymap.c b/keyboards/ergodox_ez/keymaps/dvorak/keymap.c deleted file mode 100644 index 22947327d..000000000 --- a/keyboards/ergodox_ez/keymaps/dvorak/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |------| D | H | T | N |S / L2| - | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(1), - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout0.png b/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout0.png deleted file mode 100644 index 6a36f9bfa..000000000 Binary files a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout0.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout1.png b/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout1.png deleted file mode 100644 index c6e6d913c..000000000 Binary files a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout1.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout2.png b/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout2.png deleted file mode 100644 index 23f56ff4c..000000000 Binary files a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keyboard-layout2.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keymap.c b/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keymap.c deleted file mode 100644 index 82f55b4bc..000000000 --- a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/keymap.c +++ /dev/null @@ -1,185 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | BrBck| | Play | 6 | 7 | 8 | 9 | 0 | \ / L2 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Esc | ' | , | . | P | Y | Del | | Ins | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |------| D | H | T | N | S | - | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| LAlt | LGui | Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | App | L1 | | L2 |PrntScr | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space| Tab |------| |------| AltShf |Enter | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_WBAK, - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_DELT, - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_LALT, KC_LGUI, KC_LEFT,KC_RGHT, - CTL_T(KC_APP), TG(1), - KC_HOME, - KC_SPC,KC_TAB,KC_END, - // right hand - KC_MPLY, KC_6, KC_7, KC_8, KC_9, KC_0, LT(MDIA, KC_BSLS), - KC_INS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - TG(2), KC_PSCREEN, - KC_PGUP, - KC_PGDN,RALT(KC_RSFT), KC_ENT - ), -/* Keymap 1: Symbol & Media Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Prev | Next | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | |VolUp | | | - * | | |------| |------| Mute | | - * | | | | |VolDn | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_MPRV,KC_MNXT, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_VOLU, - KC_VOLD, KC_MUTE, KC_TRNS -), -/* Keymap 2: QWERTY Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | A | S | D | F | G |------| |------| H | J | K | L | ; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( // layer 0 : default - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_TRNS, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_TRNS, - KC_TRNS, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/readme.md b/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/readme.md deleted file mode 100644 index 984106ff4..000000000 --- a/keyboards/ergodox_ez/keymaps/dvorak_intl_squisher/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# ErgoDox EZ Dvorak International Squisher - -Dvorak layout adjusted with several (linux) applications in mind: - -* Easier Escape for VIM -* Windows/Super key for awesome WM -* Alt+Shift for international characters -* PrintScreen for sys-rq -* Insert for the X11 clip-board - -Major layer changes: - -* Common multimedia keys are integrated into layer 0, less common into layer 1 -* No mouse keys -* Layer 2 is qwerty (for easier gaming & less fortunate keyboard users) - -Known issues: - -* Alt+Shift does not work reliably (depends on the X11 kb layout? Not - entirely clear...) - -![layer0](keyboard-layout0.png) -![layer1](keyboard-layout1.png) -![layer2](keyboard-layout2.png) - -## Changelog - -* 2016-03-29 - * Initial release diff --git a/keyboards/ergodox_ez/keymaps/dvorak_spanish/keymap.c b/keyboards/ergodox_ez/keymaps/dvorak_spanish/keymap.c deleted file mode 100755 index 6eb864b44..000000000 --- a/keyboards/ergodox_ez/keymaps/dvorak_spanish/keymap.c +++ /dev/null @@ -1,284 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -/****************************************************************************************** - * SPANISH DVORAK LAYOUT (see http://djelibeibi.unex.es/dvorak/) - * Layer 1: auxiliary keys - * Layer 2: full qwerty layout - ****************************************************************************************** - * IMPORTANT: Software layout must be set to SPANISH QWERTY to work properly - *****************************************************************************************/ - -// LAYERS -#define BASE 0 // dvorak layout (default) -#define AUX 1 // auxiliary keys -#define QWERTY 2 // qwerty layout - -// MACROS -#define OBRACE 0 // key { or shift -#define CBRACE 1 // key } or shift -#define OBRACK 2 // key [ or left alt -#define CBRACK 3 // key ] or left alt -#define CAPS 4 // caps lock - -// LEDS -#define USB_LED_NUM_LOCK 0 -#define USB_LED_CAPS_LOCK 1 -#define USB_LED_SCROLL_LOCK 2 -#define USB_LED_COMPOSE 3 -#define USB_LED_KANA 4 - -// TIMERS -#define KEY_TAP_FAST 85 -#define KEY_TAP_SLOW 95 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base layer - * Keys with double values (like Esc/Ctrl) correspond to the 'tapped' key and the 'held' key, respectively - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | F1/~L1 | . | , | Ñ | P | Y |MEH_T | | L1 | F | G | C | H | L |ALL_T/+ | - * |--------+------+------+------+------+------| DEL | | ~L1 |------+------+------+------+------+--------| - * |Esc/Ctrl| A | O | E | U | I |------| |------| D | R | T | N | S |'/RCtrl | - * |--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| - * | {/LSft | - | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |F5/CAG|F6/~L1| |F7/~L1|F8/CAG| - * ,------|------|------| |------+--------+------. - * | | |F4/CA | |F11/CA| | | - * | ENTER| TAB |------| |------| BSPC | SPACE| - * | | |F3/SA | |F12/SA| | | - * `--------------------' `----------------------' - * CAG = CTRL-ALT-GUI - * CA = CTRL-ALT - * SA = SHIFT-ALT - * - */ -[BASE] = KEYMAP( - // left hand - KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NONUS_BSLASH, - LT(AUX, KC_F1), KC_DOT, KC_COMM,KC_SCLN,KC_P, KC_Y, MEH_T(KC_DEL), - CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, - M(OBRACE), KC_SLSH,KC_Q, KC_J, KC_K, KC_X, KC_LGUI, - M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, - LCAG_T(KC_F5), LT(AUX, KC_F6), - MT((MOD_LALT | MOD_LCTL), KC_F4), - KC_ENT,KC_TAB,MT((MOD_LALT | MOD_LSFT), KC_F3), - // right hand - KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - KC_FN1, KC_F, KC_G, KC_C, KC_H, KC_L, ALL_T(KC_RBRACKET), - KC_D, KC_R, KC_T, KC_N, KC_S, CTL_T(KC_QUOTE), - KC_RALT, KC_B, KC_M, KC_W, KC_V, KC_Z, M(CBRACE), - KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), - LT(AUX, KC_F7), LCAG_T(KC_F8), - MT((MOD_LALT | MOD_LCTL), KC_F11), - MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC - ), -/* Keymap 1: Aux layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | SLEEP | PWR | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | < | > | MsUp | | | | | ~L0 | | 7 | 8 | 9 | * | `^ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | 4 | 5 | 6 | + | Ç | - * |--------+------+------+------+------+------| | |PSCR |------+------+------+------+------+--------| - * |CAPSLOCK| | | | | | | | | | 1 | 2 | 3 | / | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |CTRL-S|CTRL-Z|CTRL-X|CTRL-C|CTRL-V| | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | Play | - * ,------|------|------| |------+------+------. - * | | | | | VolUp| | | - * | Lclk | Rclk |------| |------| Prev | Next | - * | | | L2 | | VolDn| | | - * `--------------------' `--------------------' - */ -[AUX] = KEYMAP( - // left hand - KC_NO , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_SLEP, - KC_TRNS, KC_NONUS_BSLASH, LSFT(KC_NONUS_BSLASH), KC_MS_U, KC_NO, KC_NO, KC_NO, - KC_NO , KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO , - M(CAPS), KC_NO, KC_NO , KC_NO , KC_NO , KC_NO , KC_NO, - LCTL(KC_S), LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), - KC_NO , KC_TRNS, - KC_NO, - KC_BTN1, KC_BTN2, TG(QWERTY), - // right hand - KC_PWR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_NO, KC_7, KC_8, KC_9, KC_PAST, KC_LBRACKET, - KC_NO, KC_4, KC_5, KC_6, KC_PPLS, KC_BSLASH, - KC_PSCR, KC_NO, KC_1, KC_2, KC_3, KC_PSLS, KC_NO, - KC_NO ,KC_DOT, KC_0, KC_PEQL, KC_NO, - KC_TRNS, KC_MPLY, - KC_VOLU, - KC_VOLD, KC_MPRV, KC_MNXT -), -/* Keymap 2: QWERTY layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TRANS | Q | W | E | R | T |MEH_T | | TRANS| Y | U | I | O | P |ALL_T/+ | - * |--------+------+------+------+------+------| DEL | | |------+------+------+------+------+--------| - * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | Ñ |'/RCtrl | - * |--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| - * | {/LSft | Z | X | C | V | B | | | | N | M | , | . | - | }/RSft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |F5/CAG| TRANS| | TRANS|F8/CAG| - * ,------|------|------| |------+--------+------. - * | | |F4/CA | |F11/CA| | | - * | ENTER| TAB |------| |------| BSPC | SPACE| - * | | | TRANS| |F12/SA| | | - * `--------------------' `----------------------' - * CAG = CTRL-ALT-GUI - * CA = CTRL-ALT - * SA = SHIFT-ALT - * - */ -[QWERTY] = KEYMAP( - // left hand - KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NONUS_BSLASH, - KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_DEL), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - M(OBRACE), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, - M(OBRACK), KC_HOME,KC_PGDN,KC_PGUP,KC_END, - LCAG_T(KC_F5), KC_TRNS, - MT((MOD_LALT | MOD_LCTL), KC_F4), - KC_ENT,KC_TAB,KC_TRNS, - // right hand - KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, ALL_T(KC_RBRACKET), - KC_H, KC_J, KC_K, KC_L, KC_SCLN,CTL_T(KC_QUOTE), - KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,M(CBRACE), - KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,M(CBRACK), - KC_TRNS, LCAG_T(KC_F8), - MT((MOD_LALT | MOD_LCTL), KC_F11), - MT((MOD_LALT | MOD_LSFT), KC_F12),KC_BSPC, KC_SPC -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(AUX) // FN1 - Momentary Layer 1 (Aux) -}; - -static uint16_t key_timer; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case OBRACE: { - if (record->event.pressed) { - key_timer = timer_read(); - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_QUOTE); - unregister_code(KC_QUOTE); - unregister_code(KC_RALT); - } - } - break; - } - case CBRACE: { - if (record->event.pressed) { - key_timer = timer_read(); - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_BSLS); - unregister_code(KC_BSLS); - unregister_code(KC_RALT); - } - } - break; - } - case OBRACK: { - if (record->event.pressed) { - key_timer = timer_read(); - register_code(KC_LALT); - } else { - unregister_code(KC_LALT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_LBRACKET); - unregister_code(KC_LBRACKET); - unregister_code(KC_RALT); - } - } - break; - } - case CBRACK: { - if (record->event.pressed) { - key_timer = timer_read(); - register_code(KC_LALT); - } else { - unregister_code(KC_LALT); - if (timer_elapsed(key_timer) < KEY_TAP_SLOW) { - register_code(KC_RALT); - register_code(KC_RBRACKET); - unregister_code(KC_RBRACKET); - unregister_code(KC_RALT); - } - } - break; - } - case CAPS: { - if (record->event.pressed) { - register_code(KC_CAPSLOCK); - } else { - unregister_code(KC_CAPSLOCK); - } - break; - } - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case 1: - ergodox_right_led_3_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - - // Turn the caps lock led on - if (host_keyboard_leds() & (1< - -,--------------------------------------------------. ,--------------------------------------------------. -| \ | 1 | 2 | 3 | 4 | 5 | <> | | ¡ | 6 | 7 | 8 | 9 | 0 | ' | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| F1/~L1 | . | , | Ñ | P | Y |MEH_T | | L1 | F | G | C | H | L |ALL_T/+ | -|--------+------+------+------+------+------| DEL | | ~L1 |------+------+------+------+------+--------| -|Esc/Ctrl| A | O | E | U | I |------| |------| D | R | T | N | S |'/RCtrl | -|--------+------+------+------+------+------| LGUI | | RALT |------+------+------+------+------+--------| -| {/LSft | - | Q | J | K | X | | | | B | M | W | V | Z | }/RSft | -'--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' - |[/LALT| HOME |PGDOWN| PGUP | END | | LEFT | DOWN | UP |RIGHT |]/LALT| - '----------------------------------' '----------------------------------' - ,-------------. ,-------------. - |F5/CAG|F6/~L1| |F7/~L1|F8/CAG| - ,------|------|------| |------+--------+------. - | | |F4/CA | |F11/CA| | | - | ENTER| TAB |------| |------| BSPC | SPACE| - | | |F3/SA | |F12/SA| | | - '--------------------' '----------------------' - CAG = CTRL-ALT-GUI - CA = CTRL-ALT - SA = SHIFT-ALT - - - -### Keymap 1: Aux layer - -

-
-,--------------------------------------------------.           ,--------------------------------------------------.
-|        |  F1  |  F2  |  F3  |  F4  |  F5  | SLEEP|           | PWR  |  F6  |  F7  |  F8  |  F9  |  F10 |   F11  |
-|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-|        |  <   |  >   | MsUp |      |      |      |           | ~L0  |      |   7  |   8  |   9  |   *  |  '^    |
-|--------+------+------+------+------+------|      |           |      |------+------+------+------+------+--------|
-|        |      |MsLeft|MsDown|MsRght|      |------|           |------|      |   4  |   5  |   6  |   +  |   Ç    |
-|--------+------+------+------+------+------|      |           |PSCR  |------+------+------+------+------+--------|
-|CAPSLOCK|      |      |      |      |      |      |           |      |      |   1  |   2  |   3  |   /  |        |
-'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
-  |CTRL-S|CTRL-Z|CTRL-X|CTRL-C|CTRL-V|                                       |      |    . |   0  |   =  |      |
-  '----------------------------------'                                       '----------------------------------'
-                                       ,-------------.       ,-------------.
-                                       |      |      |       |      | Play |
-                                ,------|------|------|       |------+------+------.
-                                |      |      |      |       | VolUp|      |      |
-                                | Lclk | Rclk |------|       |------| Prev | Next |
-                                |      |      |  L2  |       | VolDn|      |      |
-                                '--------------------'       '--------------------'
-
-
- -### Keymap 2: QWERTY layer - -

-
-,--------------------------------------------------.           ,--------------------------------------------------.
-|   \    |   1  |   2  |   3  |   4  |   5  |  <>  |           |   ¡  |   6  |   7  |   8  |   9  |   0  |   '    |
-|--------+------+------+------+------+-------------|           |------+------+------+------+------+------+--------|
-|  TRANS |   Q  |   W  |   E  |   R  |   T  |MEH_T |           | TRANS|   Y  |   U  |   I  |   O  |   P  |ALL_T/+ |
-|--------+------+------+------+------+------| DEL  |           |      |------+------+------+------+------+--------|
-|Esc/Ctrl|   A  |   S  |   D  |   F  |   G  |------|           |------|   H  |   J  |   K  |   L  |   Ñ  |'/RCtrl |
-|--------+------+------+------+------+------| LGUI |           | RALT |------+------+------+------+------+--------|
-| {/LSft |   Z  |   X  |   C  |   V  |   B  |      |           |      |   N  |   M  |   ,  |   .  |   -  | }/RSft |
-'--------+------+------+------+------+-------------'           '-------------+------+------+------+------+--------'
-  |[/LALT| HOME |PGDOWN| PGUP | END  |                                       | LEFT | DOWN |  UP  |RIGHT |]/LALT|
-  '----------------------------------'                                       '----------------------------------'
-                                       ,-------------.       ,-------------.
-                                       |F5/CAG| TRANS|       | TRANS|F8/CAG|
-                                ,------|------|------|       |------+--------+------.
-                                |      |      |F4/CA |       |F11/CA|        |      |
-                                | ENTER| TAB  |------|       |------|  BSPC  | SPACE|
-                                |      |      | TRANS|       |F12/SA|        |      |
-                                '--------------------'       '----------------------'
- CAG = CTRL-ALT-GUI
-  CA = CTRL-ALT
-  SA = SHIFT-ALT
-
-
- - -## Generation of .hex file -> [Download scripts from here](https://github.com/johgh/keyboard/tree/master/ergodox) - -> Execute install.sh and generate.sh scripts. - -> Flash with `teensy_loader` binary (should be installed from previous step) diff --git a/keyboards/ergodox_ez/keymaps/emacs_osx_dk/default_highres.png b/keyboards/ergodox_ez/keymaps/emacs_osx_dk/default_highres.png deleted file mode 100644 index 1d2583740..000000000 Binary files a/keyboards/ergodox_ez/keymaps/emacs_osx_dk/default_highres.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/emacs_osx_dk/keymap.c b/keyboards/ergodox_ez/keymaps/emacs_osx_dk/keymap.c deleted file mode 100644 index 1d8e66a08..000000000 --- a/keyboards/ergodox_ez/keymaps/emacs_osx_dk/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Grv | 1 | 2 | 3 | 4 | 5 | L1 | | L2 | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | - | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | \/LCtrl| A | S | D | F | G |------| |------| H | J | K | L | ; |'/RCtrl | - * |--------+------+------+------+------+------| RAlt | | RAlt |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ~L1 | LCtrl| Left| Right| LAlt | | LAlt | Up | Down | RCtrl| ~L2 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Del | Ins | | Esc | App | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| LGui |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_RALT, - MO(SYMB), KC_LCTRL, KC_LEFT,KC_RGHT,KC_LALT, - KC_DELT,KC_INS, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - TG(MDIA), KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), - KC_RALT, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_LALT,KC_UP, KC_DOWN,KC_RCTRL, MO(MDIA), - KC_ESC, KC_APP, - KC_PGUP, - KC_PGDN, KC_LGUI, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | 0 | . | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/emacs_osx_dk/readme.md b/keyboards/ergodox_ez/keymaps/emacs_osx_dk/readme.md deleted file mode 100644 index 4839988d9..000000000 --- a/keyboards/ergodox_ez/keymaps/emacs_osx_dk/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# ErgoDox EZ Emacs-OSX-DeadKeys Configuration - -Since I'm an Emacs user, ctrl keys are very important and gets a placement where the usual caps_lock is. There -are an extra pair of ctrls, just in case there where problems with the holding one's, but not as comfortable. - -Gui button takes a predominant place on the thumb cluster, as I'm using a mac os x and it relies heavily on it. - -Finally there is also two Right Alts to easily access to accented letters of the spanish alphabet. - -![Default](default_highres.png) diff --git a/keyboards/ergodox_ez/keymaps/erez_experimental/Makefile b/keyboards/ergodox_ez/keymaps/erez_experimental/Makefile deleted file mode 100644 index b673c5ce5..000000000 --- a/keyboards/ergodox_ez/keymaps/erez_experimental/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# Having a file like this allows you to override Makefile definitions -# for your own particular keymap - -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = no # Commands for debug and configuration - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergodox_ez/keymaps/erez_experimental/config.h b/keyboards/ergodox_ez/keymaps/erez_experimental/config.h deleted file mode 100644 index e5d7fe188..000000000 --- a/keyboards/ergodox_ez/keymaps/erez_experimental/config.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 300 - -#undef LEADER_TIMEOUT -#define LEADER_TIMEOUT 300 - -#endif diff --git a/keyboards/ergodox_ez/keymaps/erez_experimental/keymap.c b/keyboards/ergodox_ez/keymaps/erez_experimental/keymap.c deleted file mode 100644 index 04ad2a816..000000000 --- a/keyboards/ergodox_ez/keymaps/erez_experimental/keymap.c +++ /dev/null @@ -1,199 +0,0 @@ -#include -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | Alt/J| K | L |; / L2| LGui/' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * |LShift/(|Z/Ctrl| X | C | V | B | [ | | ] | N | M | , | . |//Ctrl|RShift/)| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | -/L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Leader|------| |------| Tab/L1 |Enter | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_LBRC), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_LEAD,KC_END, - // right hand - KC_RGHT, KC_6,KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y,KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H,ALT_T(KC_J),KC_K, KC_L, LT(MDIA,KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_RBRC),KC_N,KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSPC, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_MINS), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,LT(SYMB, KC_TAB), KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 1 | 2 | 3 | 4 | 5 |------| |------| & | _ | - | ; | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 6 | 7 | 8 | 9 | 0 | | | | | | @ | = | % | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | |NxtTab|PrvTab| | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS,LCTL(KC_PGUP), LCTL(KC_PGDN), - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, - KC_AMPR, KC_UNDS, KC_MINS, CM_SCLN, KC_PLUS, KC_TRNS, - KC_TRNS, KC_PIPE, KC_AT, KC_EQL, KC_PERC, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | PgUp | Home | End | PgDn | |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_PGUP, KC_HOME, KC_END, KC_PGDN, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) - [2] = ACTION_MACRO_TAP(0), // Eric Tang's Famous Macro! - [3] = ACTION_MACRO_TAP(1) // Eric Tang's Famous Macro! -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -LEADER_EXTERNS(); - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_ONE_KEY(KC_W) { - register_code(KC_LALT); - register_code(KC_F4); - unregister_code(KC_F4); - unregister_code(KC_LALT); - } - SEQ_ONE_KEY(KC_O) { - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_O); - unregister_code(KC_O); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - } - } -} - diff --git a/keyboards/ergodox_ez/keymaps/erez_experimental/readme.md b/keyboards/ergodox_ez/keymaps/erez_experimental/readme.md deleted file mode 100644 index 66acfa187..000000000 --- a/keyboards/ergodox_ez/keymaps/erez_experimental/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# Erez's experimental layout - -This is my personal layout which I use to test out ideas which may or may not make it onto the default layout we ship with. It's based off the default layout, with various tweaks. - -Changelog: - -## May 24, 2016: - -* Implements Leader key example - * Leader, W sends Alt-F4 - * Leader, O sends Ctrl-shift-o (a shortcut I use in FrontApp) - -## May 8, 2016: - -* Makes bottom-right key send minus/underscore when tapped, L1 temporary toggle when held -* Tweaked the positions of the numbers on the symbol layer. Basically, 12345 are now directly under their number-row counterparts in layer 0. You can imagine pulling the number row down to the home row. And 67890 are directly under 12345 - so it's a matter of just adding 5 and going to the next row (1+5 = 6, 2+5 = 7 and so on). -* Tweaks media/nav layer - * Removes mouse control, as I don't use it - * Makes left home row keys PgUp, Home, End, PgDn - -## Apr 29, 2016: - -* Tweaks the Hyper and Meh key to send brackets when tapped -* Turns bottom-right key into a minus/underscore (easy to reach with the right pinky) - -## Apr 25, 2016: - -* Made it so that the right and left Shift keys send opening and closing parens ( ) when tapped - -## Feb 11, 2016: - -* Updated ASCII legend for thumb clusters -* Made it so outer left-hand thumb key is L1 momentary toggle -* Added % and @ to L1 -* Swapped positions for _ and - on L1 - -## Feb 5, 2016: - -* A whole new design for the symbol layer. Specifically: - * Put the minus, underscore, and semicolon right in the homerow for the right hand - * Parens are in better places for me - * The arrow keys now send Ctrl-PgUp and Ctrl-PgDn, for switching browser tabs with the arrows when in symbol layer - * Tab (right-hand outer thumb key) now does double duty to toggle symbol layer when held down - * Backspace (left-hand outer thumb key) now just toggles symbol layer (I wasn't using it as a backspace) - - -## Jan 19, 2016: - -* Made J into dual-action key (Alt when held down), to make Alt-tab more ergonomic. -* Made ' into dual-action key (Win/Cmd when held down). - diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/keymap.c b/keyboards/ergodox_ez/keymaps/german-kinergo/keymap.c deleted file mode 100644 index b1cecf0dd..000000000 --- a/keyboards/ergodox_ez/keymaps/german-kinergo/keymap.c +++ /dev/null @@ -1,210 +0,0 @@ -// German keymap derived from "german", but more closely resembling the German layout of the Kinesis Ergo Elan. -// -// chschmitz, 2016-01-27 -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_german.h" - -// Layer names -#define BASE 0 // default layer -#define SYMB 1 // symbol layer -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * X'es mark the spots where this is different from the "german" layout which it is based on. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |X Esc X| 1 | 2 | 3 | 4 | 5 |X ` X| |XPRSCX| 6 | 7 | 8 | 9 | 0 | ß | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * |X Tab X| Q | W | E | R | T |X L1 X| |X L1 X| Z | U | I | O | P | Ãœ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä/L2 | - * |--------+------+------+------+------+------|X L2 X| |X L2 X|------+------+------+------+------+--------| - * | LShift | Y | X | C | V | B | | | | N | M | , | . |X - X| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |XLGuiX|X ^ X|X < X|XLEFTX|XRIGHT| |XDownX|X Up X|X # X|X + X|XRGuiX| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |XCTRLX|XALTX | | Alt |Ctrl/Esc| - * ,------+------+------| |------+--------+------. - * |XXX |XXX | Home | | PgUp |XXX |XXX | - * | Bkspc|Del |------| |------| Enter | Space| - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, DE_ACUT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(1), - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, MO(2), - KC_LGUI, DE_CIRC, DE_LESS, KC_LEFT, KC_RIGHT, - KC_LCTRL, KC_LALT, - KC_HOME, - KC_BSPC,KC_DELT,KC_END, - // right hand - KC_PSCREEN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MO(1), DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, - KC_H, KC_J, KC_K, KC_L, DE_OE, LT(MDIA,DE_AE), - MO(2), KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, - KC_DOWN, KC_UP, DE_HASH, DE_PLUS, KC_RGUI, - KC_RALT, KC_RCTRL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -// [BASE] = KEYMAP( // layer 0 : default -// // left hand -// KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MPLY, -// KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), -// KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, -// KC_LSFT, DE_Y, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), -// LT(SYMB,DE_LESS),CTL_T(DE_HASH), DE_ACUT, DE_MINS, DE_PLUS, -// ALT_T(KC_APP), KC_LGUI, -// KC_HOME, -// KC_SPC,KC_BSPC,KC_END, -// // right hand -// KC_MNXT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, -// TG(2), DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, -// KC_H, KC_J, KC_K, KC_L, DE_OE, LT(MDIA,DE_AE), -// MEH_T(KC_NO),KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(DE_MINS), KC_RSFT, -// KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_FN1, -// KC_LALT,CTL_T(KC_ESC), -// KC_PGUP, -// KC_PGDN,KC_TAB, KC_ENT -// ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,DE_EXLM,DE_AT, DE_LCBR,DE_RCBR,DE_PIPE,KC_TRNS, - KC_TRNS,DE_HASH,DE_DLR, DE_LPRN,DE_RPRN,DE_GRV, - KC_TRNS,DE_PERC,DE_CIRC,DE_LBRC,DE_RBRC,DE_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, DE_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, DE_PLUS, KC_TRNS, - KC_TRNS, DE_AMPR, KC_1, KC_2, KC_3, DE_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, DE_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Lclk | MsUp | Rclk | | | | | |VolDwn| Mute |VolUp | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Btn4 |MsLeft|MsDown|MsRght| Btn5 |------| |------| | Prev | Stop | Play | Next | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |WhRght|WhDown| WhUp |WhLeft|WhClk | | | |BwSrch|BwBack|BwHome|BwRefr|BwFwd | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | |MsAcl0|MsAcl1|MsAcl2| | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Back |Forwd | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, - KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11, - KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_F12, - KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, - KC_TRNS, KC_WSCH, KC_WBAK, KC_WHOM, KC_WREF, KC_WFWD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case MDIA: - ergodox_right_led_2_on(); - break; - default: - ergodox_board_led_off(); - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/layout-code.png b/keyboards/ergodox_ez/keymaps/german-kinergo/layout-code.png deleted file mode 100644 index a0ef551e1..000000000 Binary files a/keyboards/ergodox_ez/keymaps/german-kinergo/layout-code.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/layout-media.png b/keyboards/ergodox_ez/keymaps/german-kinergo/layout-media.png deleted file mode 100644 index 56aea1dca..000000000 Binary files a/keyboards/ergodox_ez/keymaps/german-kinergo/layout-media.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/layout.png b/keyboards/ergodox_ez/keymaps/german-kinergo/layout.png deleted file mode 100644 index 76a1aa5d7..000000000 Binary files a/keyboards/ergodox_ez/keymaps/german-kinergo/layout.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/german-kinergo/readme.md b/keyboards/ergodox_ez/keymaps/german-kinergo/readme.md deleted file mode 100644 index 557d85a8a..000000000 --- a/keyboards/ergodox_ez/keymaps/german-kinergo/readme.md +++ /dev/null @@ -1,35 +0,0 @@ -# German Layout for the ErgoDox - -This layout is inspired by the "kinesis-qwerty-mod" from benblazak's -[ergodox-firmware](https://github.com/benblazak/ergodox-firmware), as well as by the "german" layout from the -[qmk_firmware](https://github.com/jackhumbert/qmk_firmware). -The goal was to have a layout that is pretty close to an ordinary German -keyboard, so I don't have to make adjustments on the operating system level -and I keep some of the muscle memory to use a regular keyboard. - -Modifications I made with regard to the aforementioned layouts: - -* The key layout is pretty close to the layout of a German Kinesis Ergo Elan. - The only exception I made is that I reversed the "up" and "down" cursor keys, - since that feels more natural to me. - -* All layer changes are "momentary", i.e. they only last as long as the respective key is pressed. - -* I sacrificed the Hyper and Meh keys, which I don't use, and put layer change keys in their place. - -* I added a PrintScreen key which I use quite regularly for screenshots. - -## Default Layer - -![Layout of the default layer](layout.png "Layout of the default layer") - -## Code Layer - -![Layout of the code layer](layout-code.png "Layout of the code layer") - -## Media Layer - -![Layout of the media layer](layout-media.png "Layout of the media layer") - -Christoph Schmitz <schm4704 at web dot de> -2016-01-28 diff --git a/keyboards/ergodox_ez/keymaps/german-manuneo/compile_keymap.py b/keyboards/ergodox_ez/keymaps/german-manuneo/compile_keymap.py deleted file mode 100644 index 7076a6ecb..000000000 --- a/keyboards/ergodox_ez/keymaps/german-manuneo/compile_keymap.py +++ /dev/null @@ -1,710 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -"""Compiler for keymap.c files - -This scrip will generate a keymap.c file from a simple -markdown file with a specific layout. - -Usage: - python compile_keymap.py INPUT_PATH [OUTPUT_PATH] -""" -from __future__ import division -from __future__ import print_function -from __future__ import absolute_import -from __future__ import unicode_literals - -import os -import io -import re -import sys -import json -import unicodedata -import collections -import itertools as it - -PY2 = sys.version_info.major == 2 - -if PY2: - chr = unichr - - -KEYBOARD_LAYOUTS = { - # These map positions in the parsed layout to - # positions in the KEYMAP MATRIX - 'ergodox_ez': [ - [ 0, 1, 2, 3, 4, 5, 6], [38, 39, 40, 41, 42, 43, 44], - [ 7, 8, 9, 10, 11, 12, 13], [45, 46, 47, 48, 49, 50, 51], - [14, 15, 16, 17, 18, 19 ], [ 52, 53, 54, 55, 56, 57], - [20, 21, 22, 23, 24, 25, 26], [58, 59, 60, 61, 62, 63, 64], - [27, 28, 29, 30, 31 ], [ 65, 66, 67, 68, 69], - [ 32, 33], [70, 71 ], - [ 34], [72 ], - [ 35, 36, 37], [73, 74, 75 ], - ] -} - -ROW_INDENTS = { - 'ergodox_ez': [0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 5, 0, 6, 0, 4, 0] -} - -BLANK_LAYOUTS = [ -# Compact Layout -""" -.------------------------------------.------------------------------------. -| | | | | | | | | | | | | | | -!-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! -| | | | | | | | | | | | | | | -!-----+----+----+----x----x----! ! !----x----x----+----+----+-----! -| | | | | | |-----!-----! | | | | | | -!-----+----+----+----x----x----! ! !----x----x----+----+----+-----! -| | | | | | | | | | | | | | | -'-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' -""", - -# Wide Layout -""" -.---------------------------------------------. .---------------------------------------------. -| | | | | | | | ! | | | | | | | -!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! -| | | | | | | | ! | | | | | | | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| | | | | | |-------! !-------! | | | | | | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| | | | | | | | ! | | | | | | | -'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | | | | | | ! | | | | | - '------------------------------' '------------------------------' - .---------------. .---------------. - | | | ! | | - .-------+-------+-------! !-------+-------+-------. - ! ! | | ! | ! ! - ! ! !-------! !-------! ! ! - | | | | ! | | | - '-----------------------' '-----------------------' -""", -] - - -DEFAULT_CONFIG = { - "keymaps_includes": [ - "keymap_common.h", - ], - 'filler': "-+.'!:x", - 'separator': "|", - 'default_key_prefix': ["KC_"], -} - - -SECTIONS = [ - 'layout_config', - 'layers', -] - - -# Markdown Parsing - -ONELINE_COMMENT_RE = re.compile(r""" - ^ # comment must be at the start of the line - \s* # arbitrary whitespace - // # start of the comment - (.*) # the comment - $ # until the end of line -""", re.MULTILINE | re.VERBOSE -) - -INLINE_COMMENT_RE = re.compile(r""" - ([\,\"\[\]\{\}\d]) # anythig that might end a expression - \s+ # comment must be preceded by whitespace - // # start of the comment - \s # and succeded by whitespace - (?:[^\"\]\}\{\[]*) # the comment (except things which might be json) - $ # until the end of line -""", re.MULTILINE | re.VERBOSE) - -TRAILING_COMMA_RE = re.compile(r""" - , # the comma - (?:\s*) # arbitrary whitespace - $ # only works if the trailing comma is followed by newline - (\s*) # arbitrary whitespace - ([\]\}]) # end of an array or object -""", re.MULTILINE | re.VERBOSE) - - -def loads(raw_data): - if isinstance(raw_data, bytes): - raw_data = raw_data.decode('utf-8') - - raw_data = ONELINE_COMMENT_RE.sub(r"", raw_data) - raw_data = INLINE_COMMENT_RE.sub(r"\1", raw_data) - raw_data = TRAILING_COMMA_RE.sub(r"\1\2", raw_data) - return json.loads(raw_data) - - -def parse_config(path): - def reset_section(): - section.update({ - 'name': section.get('name', ""), - 'sub_name': "", - 'start_line': -1, - 'end_line': -1, - 'code_lines': [], - }) - - def start_section(line_index, line): - end_section() - if line.startswith("# "): - name = line[2:] - elif line.startswith("## "): - name = line[3:] - else: - name = "" - - name = name.strip().replace(" ", "_").lower() - if name in SECTIONS: - section['name'] = name - else: - section['sub_name'] = name - section['start_line'] = line_index - - def end_section(): - if section['start_line'] >= 0: - if section['name'] == 'layout_config': - config.update(loads("\n".join( - section['code_lines'] - ))) - elif section['sub_name'].startswith('layer'): - layer_name = section['sub_name'] - config['layer_lines'][layer_name] = section['code_lines'] - - reset_section() - - def amend_section(line_index, line): - section['end_line'] = line_index - section['code_lines'].append(line) - - config = DEFAULT_CONFIG.copy() - config.update({ - 'layer_lines': collections.OrderedDict(), - 'macro_ids': {'UM'}, - 'unicode_macros': {}, - }) - - section = {} - reset_section() - - with io.open(path, encoding="utf-8") as fh: - for i, line in enumerate(fh): - if line.startswith("#"): - start_section(i, line) - elif line.startswith(" "): - amend_section(i, line[4:]) - else: - # TODO: maybe parse description - pass - - end_section() - assert 'layout' in config - return config - -# header file parsing - -IF0_RE = re.compile(r""" - ^ - #if 0 - $.*? - #endif -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -COMMENT_RE = re.compile(r""" - /\* - .*? - \*/" -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -def read_header_file(path): - with io.open(path, encoding="utf-8") as fh: - data = fh.read() - data, _ = COMMENT_RE.subn("", data) - data, _ = IF0_RE.subn("", data) - return data - - -def regex_partial(re_str_fmt, flags): - def partial(*args, **kwargs): - re_str = re_str_fmt.format(*args, **kwargs) - return re.compile(re_str, flags) - return partial - - -KEYDEF_REP = regex_partial(r""" - #define - \s - ( - (?:{}) # the prefixes - (?:\w+) # the key name - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -ENUM_RE = re.compile(r""" - ( - enum - \s\w+\s - \{ - .*? # the enum content - \} - ; - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -ENUM_KEY_REP = regex_partial(r""" - ( - {} # the prefixes - \w+ # the key name - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -def parse_keydefs(config, data): - prefix_options = "|".join(config['key_prefixes']) - keydef_re = KEYDEF_REP(prefix_options) - enum_key_re = ENUM_KEY_REP(prefix_options) - for match in keydef_re.finditer(data): - yield match.groups()[0] - - for enum_match in ENUM_RE.finditer(data): - enum = enum_match.groups()[0] - for key_match in enum_key_re.finditer(enum): - yield key_match.groups()[0] - - -def parse_valid_keys(config, out_path): - basepath = os.path.abspath(os.path.join(os.path.dirname(out_path))) - dirpaths = [] - subpaths = [] - while len(subpaths) < 6: - path = os.path.join(basepath, *subpaths) - dirpaths.append(path) - dirpaths.append(os.path.join(path, "tmk_core", "common")) - dirpaths.append(os.path.join(path, "quantum")) - subpaths.append('..') - - includes = set(config['keymaps_includes']) - includes.add("keycode.h") - - valid_keycodes = set() - for dirpath, include in it.product(dirpaths, includes): - include_path = os.path.join(dirpath, include) - if os.path.exists(include_path): - header_data = read_header_file(include_path) - valid_keycodes.update( - parse_keydefs(config, header_data) - ) - return valid_keycodes - - -# Keymap Parsing - -def iter_raw_codes(layer_lines, filler, separator): - filler_re = re.compile("[" + filler + " ]") - for line in layer_lines: - line, _ = filler_re.subn("", line.strip()) - if not line: - continue - codes = line.split(separator) - for code in codes[1:-1]: - yield code - - -def iter_indexed_codes(raw_codes, key_indexes): - key_rows = {} - key_indexes_flat = [] - - for row_index, key_indexes in enumerate(key_indexes): - for key_index in key_indexes: - key_rows[key_index] = row_index - key_indexes_flat.extend(key_indexes) - assert len(raw_codes) == len(key_indexes_flat) - for raw_code, key_index in zip(raw_codes, key_indexes_flat): - # we keep track of the row mostly for layout purposes - yield raw_code, key_index, key_rows[key_index] - - -LAYER_CHANGE_RE = re.compile(r""" - (DF|TG|MO)\(\d+\) -""", re.VERBOSE) - - -MACRO_RE = re.compile(r""" - M\(\w+\) -""", re.VERBOSE) - - -UNICODE_RE = re.compile(r""" - U[0-9A-F]{4} -""", re.VERBOSE) - - -NON_CODE = re.compile(r""" - ^[^A-Z0-9_]$ -""", re.VERBOSE) - - -def parse_uni_code(raw_code): - macro_id = "UC_" + ( - unicodedata.name(raw_code) - .replace(" ", "_") - .replace("-", "_") - ) - code = "M({})".format(macro_id) - uc_hex = "{:04X}".format(ord(raw_code)) - return code, macro_id, uc_hex - - -def parse_key_code(raw_code, key_prefixes, valid_keycodes): - if raw_code in valid_keycodes: - return raw_code - - for prefix in key_prefixes: - code = prefix + raw_code - if code in valid_keycodes: - return code - - -def parse_code(raw_code, key_prefixes, valid_keycodes): - if not raw_code: - return 'KC_TRNS', None, None - - if LAYER_CHANGE_RE.match(raw_code): - return raw_code, None, None - - if MACRO_RE.match(raw_code): - macro_id = raw_code[2:-1] - return raw_code, macro_id, None - - if UNICODE_RE.match(raw_code): - hex_code = raw_code[1:] - return parse_uni_code(chr(int(hex_code, 16))) - - if NON_CODE.match(raw_code): - return parse_uni_code(raw_code) - - code = parse_key_code(raw_code, key_prefixes, valid_keycodes) - return code, None, None - - -def parse_keymap(config, key_indexes, layer_lines, valid_keycodes): - keymap = {} - raw_codes = list(iter_raw_codes( - layer_lines, config['filler'], config['separator'] - )) - indexed_codes = iter_indexed_codes(raw_codes, key_indexes) - key_prefixes = config['key_prefixes'] - for raw_code, key_index, row_index in indexed_codes: - code, macro_id, uc_hex = parse_code( - raw_code, key_prefixes, valid_keycodes - ) - # TODO: line numbers for invalid codes - err_msg = "Could not parse key '{}' on row {}".format( - raw_code, row_index - ) - assert code is not None, err_msg - # print(repr(raw_code), repr(code), macro_id, uc_hex) - if macro_id: - config['macro_ids'].add(macro_id) - if uc_hex: - config['unicode_macros'][macro_id] = uc_hex - keymap[key_index] = (code, row_index) - return keymap - - -def parse_keymaps(config, valid_keycodes): - keymaps = collections.OrderedDict() - key_indexes = config.get( - 'key_indexes', KEYBOARD_LAYOUTS[config['layout']] - ) - # TODO: maybe validate key_indexes - - for layer_name, layer_lines, in config['layer_lines'].items(): - keymaps[layer_name] = parse_keymap( - config, key_indexes, layer_lines, valid_keycodes - ) - return keymaps - -# keymap.c output - -USERCODE = """ -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case L1: - ergodox_right_led_1_on(); - break; - case L2: - ergodox_right_led_2_on(); - break; - case L3: - ergodox_right_led_3_on(); - break; - case L4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case L5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - // case L6: - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - // case L7: - // ergodox_right_led_1_on(); - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - default: - ergodox_board_led_off(); - break; - } -}; -""" - -MACROCODE = """ -#define UC_MODE_WIN 0 -#define UC_MODE_LINUX 1 -#define UC_MODE_OSX 2 - -// TODO: allow default mode to be configured -static uint16_t unicode_mode = UC_MODE_WIN; - -uint16_t hextokeycode(uint8_t hex) {{ - if (hex == 0x0) {{ - return KC_P0; - }} - if (hex < 0xA) {{ - return KC_P1 + (hex - 0x1); - }} - return KC_A + (hex - 0xA); -}} - -void unicode_action_function(uint16_t hi, uint16_t lo) {{ - switch (unicode_mode) {{ - case UC_MODE_WIN: - register_code(KC_LALT); - - register_code(KC_PPLS); - unregister_code(KC_PPLS); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LALT); - break; - case UC_MODE_LINUX: - register_code(KC_LCTL); - register_code(KC_LSFT); - - register_code(KC_U); - unregister_code(KC_U); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LCTL); - unregister_code(KC_LSFT); - break; - case UC_MODE_OSX: - break; - }} -}} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {{ - if (!record->event.pressed) {{ - return MACRO_NONE; - }} - // MACRODOWN only works in this function - switch(id) {{ - case UM: - unicode_mode = (unicode_mode + 1) % 2; - break; -{macro_cases} -{unicode_macro_cases} - default: - break; - }} - return MACRO_NONE; -}}; -""" - - -UNICODE_MACRO_TEMPLATE = """ -case {macro_id}: - unicode_action_function(0x{hi:02x}, 0x{lo:02x}); - break; -""".strip() - - -def unicode_macro_cases(config): - for macro_id, uc_hex in config['unicode_macros'].items(): - hi = int(uc_hex, 16) >> 8 - lo = int(uc_hex, 16) & 0xFF - unimacro_keys = ", ".join( - "T({})".format( - "KP_" + digit if digit.isdigit() else digit - ) for digit in uc_hex - ) - yield UNICODE_MACRO_TEMPLATE.format( - macro_id=macro_id, hi=hi, lo=lo - ) - - -def iter_keymap_lines(keymap, row_indents=None): - col_widths = {} - col = 0 - # first pass, figure out the column widths - prev_row_index = None - for code, row_index in keymap.values(): - if row_index != prev_row_index: - col = 0 - if row_indents: - col = row_indents[row_index] - col_widths[col] = max(len(code), col_widths.get(col, 0)) - prev_row_index = row_index - col += 1 - - # second pass, yield the cell values - col = 0 - prev_row_index = None - for key_index in sorted(keymap): - code, row_index = keymap[key_index] - if row_index != prev_row_index: - col = 0 - yield "\n" - if row_indents: - for indent_col in range(row_indents[row_index]): - pad = " " * (col_widths[indent_col] - 4) - yield (" /*-*/" + pad) - col = row_indents[row_index] - else: - yield pad - yield " {}".format(code) - if key_index < len(keymap) - 1: - yield "," - # This will be yielded on the next iteration when - # we know that we're not at the end of a line. - pad = " " * (col_widths[col] - len(code)) - prev_row_index = row_index - col += 1 - - -def iter_keymap_parts(config, keymaps): - # includes - for include_path in config['keymaps_includes']: - yield '#include "{}"\n'.format(include_path) - - yield "\n" - - # definitions - for i, macro_id in enumerate(sorted(config['macro_ids'])): - yield "#define {} {}\n".format(macro_id, i) - - yield "\n" - - for i, layer_name in enumerate(config['layer_lines']): - yield '#define L{0:<3} {0:<5} // {1}\n'.format(i, layer_name) - - yield "\n" - - # keymaps - yield "const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n" - - for i, layer_name in enumerate(config['layer_lines']): - # comment - layer_lines = config['layer_lines'][layer_name] - prefixed_lines = " * " + " * ".join(layer_lines) - yield "/*\n{} */\n".format(prefixed_lines) - - # keymap codes - keymap = keymaps[layer_name] - row_indents = ROW_INDENTS.get(config['layout']) - keymap_lines = "".join(iter_keymap_lines(keymap, row_indents)) - yield "[L{0}] = KEYMAP({1}\n),\n".format(i, keymap_lines) - - yield "};\n\n" - - # no idea what this is for - yield "const uint16_t PROGMEM fn_actions[] = {};\n" - - # macros - yield MACROCODE.format( - macro_cases="", - unicode_macro_cases="\n".join(unicode_macro_cases(config)), - ) - - # TODO: dynamically create blinking lights - yield USERCODE - - -def main(argv=sys.argv[1:]): - if not argv or '-h' in argv or '--help' in argv: - print(__doc__) - return 0 - - in_path = os.path.abspath(argv[0]) - if not os.path.exists(in_path): - print("No such file '{}'".format(in_path)) - return 1 - - if len(argv) > 1: - out_path = os.path.abspath(argv[1]) - else: - dirname = os.path.dirname(in_path) - out_path = os.path.join(dirname, "keymap.c") - - config = parse_config(in_path) - valid_keys = parse_valid_keys(config, out_path) - keymaps = parse_keymaps(config, valid_keys) - - with io.open(out_path, mode="w", encoding="utf-8") as fh: - for part in iter_keymap_parts(config, keymaps): - fh.write(part) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.c b/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.c deleted file mode 100644 index 5fcc14d51..000000000 --- a/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.c +++ /dev/null @@ -1,783 +0,0 @@ -#include "ergodox_ez.h" -#include "action_layer.h" -#include "keymap.h" -#include "keymap_german.h" - -#define UC_ASYMPTOTICALLY_EQUAL_TO 0 -#define UC_DIVISION_SIGN 1 -#define UC_DOWNWARDS_ARROW 2 -#define UC_ELEMENT_OF 3 -#define UC_EMPTY_SET 4 -#define UC_FOR_ALL 5 -#define UC_GREEK_CAPITAL_LETTER_ALPHA 6 -#define UC_GREEK_CAPITAL_LETTER_BETA 7 -#define UC_GREEK_CAPITAL_LETTER_CHI 8 -#define UC_GREEK_CAPITAL_LETTER_DELTA 9 -#define UC_GREEK_CAPITAL_LETTER_EPSILON 10 -#define UC_GREEK_CAPITAL_LETTER_ETA 11 -#define UC_GREEK_CAPITAL_LETTER_GAMMA 12 -#define UC_GREEK_CAPITAL_LETTER_IOTA 13 -#define UC_GREEK_CAPITAL_LETTER_KAPPA 14 -#define UC_GREEK_CAPITAL_LETTER_LAMDA 15 -#define UC_GREEK_CAPITAL_LETTER_MU 16 -#define UC_GREEK_CAPITAL_LETTER_NU 17 -#define UC_GREEK_CAPITAL_LETTER_OMEGA 18 -#define UC_GREEK_CAPITAL_LETTER_OMICRON 19 -#define UC_GREEK_CAPITAL_LETTER_PHI 20 -#define UC_GREEK_CAPITAL_LETTER_PI 21 -#define UC_GREEK_CAPITAL_LETTER_PSI 22 -#define UC_GREEK_CAPITAL_LETTER_RHO 23 -#define UC_GREEK_CAPITAL_LETTER_SIGMA 24 -#define UC_GREEK_CAPITAL_LETTER_TAU 25 -#define UC_GREEK_CAPITAL_LETTER_THETA 26 -#define UC_GREEK_CAPITAL_LETTER_UPSILON 27 -#define UC_GREEK_CAPITAL_LETTER_XI 28 -#define UC_GREEK_CAPITAL_LETTER_ZETA 29 -#define UC_GREEK_SMALL_LETTER_ALPHA 30 -#define UC_GREEK_SMALL_LETTER_BETA 31 -#define UC_GREEK_SMALL_LETTER_CHI 32 -#define UC_GREEK_SMALL_LETTER_DELTA 33 -#define UC_GREEK_SMALL_LETTER_EPSILON 34 -#define UC_GREEK_SMALL_LETTER_ETA 35 -#define UC_GREEK_SMALL_LETTER_FINAL_SIGMA 36 -#define UC_GREEK_SMALL_LETTER_GAMMA 37 -#define UC_GREEK_SMALL_LETTER_IOTA 38 -#define UC_GREEK_SMALL_LETTER_KAPPA 39 -#define UC_GREEK_SMALL_LETTER_LAMDA 40 -#define UC_GREEK_SMALL_LETTER_MU 41 -#define UC_GREEK_SMALL_LETTER_NU 42 -#define UC_GREEK_SMALL_LETTER_OMEGA 43 -#define UC_GREEK_SMALL_LETTER_OMICRON 44 -#define UC_GREEK_SMALL_LETTER_PHI 45 -#define UC_GREEK_SMALL_LETTER_PI 46 -#define UC_GREEK_SMALL_LETTER_PSI 47 -#define UC_GREEK_SMALL_LETTER_RHO 48 -#define UC_GREEK_SMALL_LETTER_SIGMA 49 -#define UC_GREEK_SMALL_LETTER_TAU 50 -#define UC_GREEK_SMALL_LETTER_THETA 51 -#define UC_GREEK_SMALL_LETTER_UPSILON 52 -#define UC_GREEK_SMALL_LETTER_XI 53 -#define UC_GREEK_SMALL_LETTER_ZETA 54 -#define UC_INFINITY 55 -#define UC_LEFTWARDS_ARROW 56 -#define UC_MULTIPLICATION_SIGN 57 -#define UC_NOT_AN_ELEMENT_OF 58 -#define UC_NOT_EQUAL_TO 59 -#define UC_PLUS_MINUS_SIGN 60 -#define UC_RIGHTWARDS_ARROW 61 -#define UC_SUBSCRIPT_EIGHT 62 -#define UC_SUBSCRIPT_FIVE 63 -#define UC_SUBSCRIPT_FOUR 64 -#define UC_SUBSCRIPT_NINE 65 -#define UC_SUBSCRIPT_ONE 66 -#define UC_SUBSCRIPT_SEVEN 67 -#define UC_SUBSCRIPT_SIX 68 -#define UC_SUBSCRIPT_THREE 69 -#define UC_SUBSCRIPT_TWO 70 -#define UC_SUBSCRIPT_ZERO 71 -#define UC_SUPERSCRIPT_EIGHT 72 -#define UC_SUPERSCRIPT_FIVE 73 -#define UC_SUPERSCRIPT_FOUR 74 -#define UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N 75 -#define UC_SUPERSCRIPT_NINE 76 -#define UC_SUPERSCRIPT_ONE 77 -#define UC_SUPERSCRIPT_SEVEN 78 -#define UC_SUPERSCRIPT_SIX 79 -#define UC_SUPERSCRIPT_THREE 80 -#define UC_SUPERSCRIPT_TWO 81 -#define UC_SUPERSCRIPT_ZERO 82 -#define UC_THERE_DOES_NOT_EXIST 83 -#define UC_THERE_EXISTS 84 -#define UC_UPWARDS_ARROW 85 -#define UC_VULGAR_FRACTION_ONE_EIGHTH 86 -#define UC_VULGAR_FRACTION_ONE_FIFTH 87 -#define UC_VULGAR_FRACTION_ONE_HALF 88 -#define UC_VULGAR_FRACTION_ONE_QUARTER 89 -#define UC_VULGAR_FRACTION_ONE_SIXTH 90 -#define UC_VULGAR_FRACTION_ONE_THIRD 91 -#define UC_VULGAR_FRACTION_THREE_QUARTERS 92 -#define UC_VULGAR_FRACTION_TWO_THIRDS 93 -#define UM 94 - -#define L0 0 // layer_0 -#define L1 1 // layer_1 -#define L2 2 // layer_2 -#define L3 3 // layer_3 -#define L4 4 // layer_4 -#define L5 5 // layer_5 -#define L6 6 // layer_6 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* - * .------------------------------------.------------------------------------. - * |MO(5)| 1 | 2 | 3 | 4 | 5 |ACUT | GRV | 6 | 7 | 8 | 9 | 0 |CIRC | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * |MO(4)| X | P | F | W | G |HOME |TG(2)| H | J | K | L | Q | Z | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | SS | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * |MO(3)| UE | OE | AE | C | V |END | TAB | B | M |COMM| DOT| UP | Y | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | |LGUI|LALT|LCTL| !RCTL|RALT|LEFT|DOWN|RGHT| - * '------------------------' '------------------------' - * .-----------. .-----------. - * |INS |TG(2)| !M(UM)|DELT | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | APP | ! PGUP| ! ! - * ! ! !-----! !-----! ! ! - * |BSPC |LSFT | ESC | ! PGDN|ENTER|SPACE| - * '-----------------' '-----------------' - */ -[L0] = KEYMAP( - MO(5), DE_1, DE_2, DE_3, DE_4, DE_5, DE_ACUT, - MO(4), DE_X, DE_P, DE_F, DE_W, DE_G, KC_HOME, - MO(1), DE_U, DE_I, DE_A, DE_E, DE_O, - MO(3), DE_UE, DE_OE, DE_AE, DE_C, DE_V, KC_END, - KC_TRNS, KC_TRNS, KC_LGUI, KC_LALT, KC_LCTL, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_INS, TG(2), - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_APP, - /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, KC_LSFT, KC_ESC, - DE_GRV, DE_6, DE_7, DE_8, DE_9, DE_0, DE_CIRC, - TG(2), DE_H, DE_J, DE_K, DE_L, DE_Q, DE_Z, - /*-*/ DE_S, DE_N, DE_R, DE_T, DE_D, DE_SS, - KC_TAB, DE_B, DE_M, DE_COMM, DE_DOT, KC_UP, DE_Y, - /*-*/ /*-*/ KC_RCTL, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT, - M(UM), KC_DELT, - KC_PGUP, - KC_PGDN, KC_ENTER, KC_SPACE -), -/* - * .------------------------------------.------------------------------------. - * | |EXLM|DQOT|PARA| | | | | | | | |RING| | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | |ASTR|PIPE|SLSH|LCBR|RCBR| | |HASH|LESS|MORE| |DQOT| | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | |UNDS|MINS|AMPR|LBRC|RBRC|-----!-----!DLR |LPRN|RPRN|TILD|QUOT| QST | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | |PLUS|EQL | | | | |BSLS|PERC|SCLN|COLN| ↑ | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | ↠| ↓ | → | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L1] = KEYMAP( - KC_TRNS, DE_EXLM, DE_DQOT, DE_PARA, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, DE_ASTR, DE_PIPE, DE_SLSH, DE_LCBR, DE_RCBR, KC_TRNS, - KC_TRNS, DE_UNDS, DE_MINS, DE_AMPR, DE_LBRC, DE_RBRC, - KC_TRNS, KC_TRNS, DE_PLUS, DE_EQL, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_RING, KC_TRNS, - KC_TRNS, DE_HASH, DE_LESS, DE_MORE, KC_TRNS, DE_DQOT, KC_TRNS, - /*-*/ DE_DLR, DE_LPRN, DE_RPRN, DE_TILD, DE_QUOT, DE_QST, - KC_TRNS, DE_BSLS, DE_PERC, DE_SCLN, DE_COLN, M(UC_UPWARDS_ARROW), KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, M(UC_LEFTWARDS_ARROW), M(UC_DOWNWARDS_ARROW), M(UC_RIGHTWARDS_ARROW), - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 |F10 |PEQL | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | | | | | | | | | P7 | P8 | P9 |PAST|PSLS | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | |-----!-----! | P4 | P5 | P6 |PMNS|PMNS | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | | | NLCK| | P1 | P2 | P3 |PPLS|PPLS | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! P0 |PCMM|PDOT|PENT|PENT| - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L2] = KEYMAP( - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_PEQL, - KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, - /*-*/ KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PMNS, - KC_NLCK, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PPLS, - /*-*/ /*-*/ KC_P0, KC_PCMM, KC_PDOT, KC_PENT, KC_PENT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | ¹ | ² | ³ | â´ | âµ | ∀ | | ⶠ| â· | ⸠| â¹ | â° | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | × | ½ | ÷ | ¼ | â…• | | | â…™ | | â…› | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | ± | AT |EURO| ∅ |-----!-----! ∞ | â¿ | ∃ | ∈ | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | â…“ | ≠ | â…” | ¾ | ≃ | | |EXLM| | ∄ | ∉ | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L3] = KEYMAP( - KC_TRNS, M(UC_SUPERSCRIPT_ONE), M(UC_SUPERSCRIPT_TWO), M(UC_SUPERSCRIPT_THREE), M(UC_SUPERSCRIPT_FOUR), M(UC_SUPERSCRIPT_FIVE), M(UC_FOR_ALL), - KC_TRNS, M(UC_MULTIPLICATION_SIGN), M(UC_VULGAR_FRACTION_ONE_HALF), M(UC_DIVISION_SIGN), M(UC_VULGAR_FRACTION_ONE_QUARTER), M(UC_VULGAR_FRACTION_ONE_FIFTH), KC_TRNS, - KC_TRNS, KC_TRNS, M(UC_PLUS_MINUS_SIGN), DE_AT, DE_EURO, M(UC_EMPTY_SET), - KC_TRNS, M(UC_VULGAR_FRACTION_ONE_THIRD), M(UC_NOT_EQUAL_TO), M(UC_VULGAR_FRACTION_TWO_THIRDS), M(UC_VULGAR_FRACTION_THREE_QUARTERS), M(UC_ASYMPTOTICALLY_EQUAL_TO), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(UC_SUPERSCRIPT_SIX), M(UC_SUPERSCRIPT_SEVEN), M(UC_SUPERSCRIPT_EIGHT), M(UC_SUPERSCRIPT_NINE), M(UC_SUPERSCRIPT_ZERO), KC_TRNS, - KC_TRNS, M(UC_VULGAR_FRACTION_ONE_SIXTH), KC_TRNS, M(UC_VULGAR_FRACTION_ONE_EIGHTH), KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ M(UC_INFINITY), M(UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N), M(UC_THERE_EXISTS), M(UC_ELEMENT_OF), KC_TRNS, KC_TRNS, - KC_TRNS, DE_EXLM, KC_TRNS, M(UC_THERE_DOES_NOT_EXIST), M(UC_NOT_AN_ELEMENT_OF), KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | â‚ | â‚‚ | ₃ | â‚„ | â‚… | | | ₆ | ₇ | ₈ | ₉ | â‚€ | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | χ | Ï€ | φ | ω | γ | | | η | ξ | κ | λ | | ζ | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | Ï… | ι | α | ε | ο |-----!-----! σ | ν | Ï | Ï„ | δ | Ï‚ | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | θ | | | | | | β | μ | | | | ψ | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L4] = KEYMAP( - KC_TRNS, M(UC_SUBSCRIPT_ONE), M(UC_SUBSCRIPT_TWO), M(UC_SUBSCRIPT_THREE), M(UC_SUBSCRIPT_FOUR), M(UC_SUBSCRIPT_FIVE), KC_TRNS, - KC_TRNS, M(UC_GREEK_SMALL_LETTER_CHI), M(UC_GREEK_SMALL_LETTER_PI), M(UC_GREEK_SMALL_LETTER_PHI), M(UC_GREEK_SMALL_LETTER_OMEGA), M(UC_GREEK_SMALL_LETTER_GAMMA), KC_TRNS, - KC_TRNS, M(UC_GREEK_SMALL_LETTER_UPSILON), M(UC_GREEK_SMALL_LETTER_IOTA), M(UC_GREEK_SMALL_LETTER_ALPHA), M(UC_GREEK_SMALL_LETTER_EPSILON), M(UC_GREEK_SMALL_LETTER_OMICRON), - KC_TRNS, KC_TRNS, M(UC_GREEK_SMALL_LETTER_THETA), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(UC_SUBSCRIPT_SIX), M(UC_SUBSCRIPT_SEVEN), M(UC_SUBSCRIPT_EIGHT), M(UC_SUBSCRIPT_NINE), M(UC_SUBSCRIPT_ZERO), KC_TRNS, - KC_TRNS, M(UC_GREEK_SMALL_LETTER_ETA), M(UC_GREEK_SMALL_LETTER_XI), M(UC_GREEK_SMALL_LETTER_KAPPA), M(UC_GREEK_SMALL_LETTER_LAMDA), KC_TRNS, M(UC_GREEK_SMALL_LETTER_ZETA), - /*-*/ M(UC_GREEK_SMALL_LETTER_SIGMA), M(UC_GREEK_SMALL_LETTER_NU), M(UC_GREEK_SMALL_LETTER_RHO), M(UC_GREEK_SMALL_LETTER_TAU), M(UC_GREEK_SMALL_LETTER_DELTA), M(UC_GREEK_SMALL_LETTER_FINAL_SIGMA), - KC_TRNS, M(UC_GREEK_SMALL_LETTER_BETA), M(UC_GREEK_SMALL_LETTER_MU), KC_TRNS, KC_TRNS, KC_TRNS, M(UC_GREEK_SMALL_LETTER_PSI), - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | | | | | | | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | Χ | Π | Φ | Ω | Γ | | | Η | Ξ | Κ | Λ | | Ζ | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | Î¥ | Ι | Α | Ε | Ο |-----!-----! Σ | Î | Ρ | Τ | Δ | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | Θ | | | | | | Î’ | Îœ | | | | Ψ | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L5] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_CHI), M(UC_GREEK_CAPITAL_LETTER_PI), M(UC_GREEK_CAPITAL_LETTER_PHI), M(UC_GREEK_CAPITAL_LETTER_OMEGA), M(UC_GREEK_CAPITAL_LETTER_GAMMA), KC_TRNS, - KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_UPSILON), M(UC_GREEK_CAPITAL_LETTER_IOTA), M(UC_GREEK_CAPITAL_LETTER_ALPHA), M(UC_GREEK_CAPITAL_LETTER_EPSILON), M(UC_GREEK_CAPITAL_LETTER_OMICRON), - KC_TRNS, KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_THETA), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_ETA), M(UC_GREEK_CAPITAL_LETTER_XI), M(UC_GREEK_CAPITAL_LETTER_KAPPA), M(UC_GREEK_CAPITAL_LETTER_LAMDA), KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_ZETA), - /*-*/ M(UC_GREEK_CAPITAL_LETTER_SIGMA), M(UC_GREEK_CAPITAL_LETTER_NU), M(UC_GREEK_CAPITAL_LETTER_RHO), M(UC_GREEK_CAPITAL_LETTER_TAU), M(UC_GREEK_CAPITAL_LETTER_DELTA), KC_TRNS, - KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_BETA), M(UC_GREEK_CAPITAL_LETTER_MU), KC_TRNS, KC_TRNS, KC_TRNS, M(UC_GREEK_CAPITAL_LETTER_PSI), - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* - * .------------------------------------.------------------------------------. - * | | | | | | | | | | | | | | | - * !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - * | | | | | | | | | | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | |-----!-----! | | | | | | - * !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - * | | | | | | | | | | | | | | | - * '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - * | | | | | | ! | | | | | - * '------------------------' '------------------------' - * .-----------. .-----------. - * | | | ! | | - * .-----+-----+-----! !-----+-----+-----. - * ! ! | | ! | ! ! - * ! ! !-----! !-----! ! ! - * | | | | ! | | | - * '-----------------' '-----------------' - */ -[L6] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = {}; - -#define UC_MODE_WIN 0 -#define UC_MODE_LINUX 1 -#define UC_MODE_OSX 2 - -// TODO: allow default mode to be configured -static uint16_t unicode_mode = UC_MODE_WIN; - -uint16_t hextokeycode(uint8_t hex) { - if (hex == 0x0) { - return KC_P0; - } - if (hex < 0xA) { - return KC_P1 + (hex - 0x1); - } - return KC_A + (hex - 0xA); -} - -void unicode_action_function(uint16_t hi, uint16_t lo) { - switch (unicode_mode) { - case UC_MODE_WIN: - register_code(KC_LALT); - - register_code(KC_PPLS); - unregister_code(KC_PPLS); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LALT); - break; - case UC_MODE_LINUX: - register_code(KC_LCTL); - register_code(KC_LSFT); - - register_code(KC_U); - unregister_code(KC_U); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LCTL); - unregister_code(KC_LSFT); - break; - case UC_MODE_OSX: - break; - } -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (!record->event.pressed) { - return MACRO_NONE; - } - // MACRODOWN only works in this function - switch(id) { - case UM: - unicode_mode = (unicode_mode + 1) % 2; - break; - -case UC_GREEK_SMALL_LETTER_OMICRON: - unicode_action_function(0x03, 0xbf); - break; -case UC_LEFTWARDS_ARROW: - unicode_action_function(0x21, 0x90); - break; -case UC_GREEK_CAPITAL_LETTER_RHO: - unicode_action_function(0x03, 0xa1); - break; -case UC_SUBSCRIPT_THREE: - unicode_action_function(0x20, 0x83); - break; -case UC_VULGAR_FRACTION_ONE_EIGHTH: - unicode_action_function(0x21, 0x5b); - break; -case UC_GREEK_SMALL_LETTER_LAMDA: - unicode_action_function(0x03, 0xbb); - break; -case UC_VULGAR_FRACTION_ONE_THIRD: - unicode_action_function(0x21, 0x53); - break; -case UC_GREEK_SMALL_LETTER_XI: - unicode_action_function(0x03, 0xbe); - break; -case UC_THERE_DOES_NOT_EXIST: - unicode_action_function(0x22, 0x04); - break; -case UC_SUPERSCRIPT_ONE: - unicode_action_function(0x00, 0xb9); - break; -case UC_GREEK_SMALL_LETTER_BETA: - unicode_action_function(0x03, 0xb2); - break; -case UC_SUBSCRIPT_FIVE: - unicode_action_function(0x20, 0x85); - break; -case UC_GREEK_CAPITAL_LETTER_IOTA: - unicode_action_function(0x03, 0x99); - break; -case UC_VULGAR_FRACTION_ONE_FIFTH: - unicode_action_function(0x21, 0x55); - break; -case UC_GREEK_SMALL_LETTER_PSI: - unicode_action_function(0x03, 0xc8); - break; -case UC_SUBSCRIPT_NINE: - unicode_action_function(0x20, 0x89); - break; -case UC_SUPERSCRIPT_FOUR: - unicode_action_function(0x20, 0x74); - break; -case UC_RIGHTWARDS_ARROW: - unicode_action_function(0x21, 0x92); - break; -case UC_SUPERSCRIPT_SIX: - unicode_action_function(0x20, 0x76); - break; -case UC_DOWNWARDS_ARROW: - unicode_action_function(0x21, 0x93); - break; -case UC_GREEK_SMALL_LETTER_PI: - unicode_action_function(0x03, 0xc0); - break; -case UC_SUPERSCRIPT_TWO: - unicode_action_function(0x00, 0xb2); - break; -case UC_GREEK_CAPITAL_LETTER_OMEGA: - unicode_action_function(0x03, 0xa9); - break; -case UC_GREEK_CAPITAL_LETTER_PSI: - unicode_action_function(0x03, 0xa8); - break; -case UC_SUBSCRIPT_FOUR: - unicode_action_function(0x20, 0x84); - break; -case UC_GREEK_CAPITAL_LETTER_NU: - unicode_action_function(0x03, 0x9d); - break; -case UC_DIVISION_SIGN: - unicode_action_function(0x00, 0xf7); - break; -case UC_GREEK_SMALL_LETTER_SIGMA: - unicode_action_function(0x03, 0xc3); - break; -case UC_GREEK_SMALL_LETTER_RHO: - unicode_action_function(0x03, 0xc1); - break; -case UC_VULGAR_FRACTION_ONE_SIXTH: - unicode_action_function(0x21, 0x59); - break; -case UC_GREEK_SMALL_LETTER_GAMMA: - unicode_action_function(0x03, 0xb3); - break; -case UC_VULGAR_FRACTION_TWO_THIRDS: - unicode_action_function(0x21, 0x54); - break; -case UC_GREEK_SMALL_LETTER_NU: - unicode_action_function(0x03, 0xbd); - break; -case UC_GREEK_SMALL_LETTER_ZETA: - unicode_action_function(0x03, 0xb6); - break; -case UC_GREEK_SMALL_LETTER_EPSILON: - unicode_action_function(0x03, 0xb5); - break; -case UC_GREEK_SMALL_LETTER_KAPPA: - unicode_action_function(0x03, 0xba); - break; -case UC_SUPERSCRIPT_SEVEN: - unicode_action_function(0x20, 0x77); - break; -case UC_GREEK_CAPITAL_LETTER_PI: - unicode_action_function(0x03, 0xa0); - break; -case UC_GREEK_SMALL_LETTER_FINAL_SIGMA: - unicode_action_function(0x03, 0xc2); - break; -case UC_GREEK_CAPITAL_LETTER_XI: - unicode_action_function(0x03, 0x9e); - break; -case UC_GREEK_SMALL_LETTER_THETA: - unicode_action_function(0x03, 0xb8); - break; -case UC_GREEK_SMALL_LETTER_ETA: - unicode_action_function(0x03, 0xb7); - break; -case UC_SUBSCRIPT_TWO: - unicode_action_function(0x20, 0x82); - break; -case UC_ASYMPTOTICALLY_EQUAL_TO: - unicode_action_function(0x22, 0x43); - break; -case UC_GREEK_SMALL_LETTER_ALPHA: - unicode_action_function(0x03, 0xb1); - break; -case UC_GREEK_CAPITAL_LETTER_PHI: - unicode_action_function(0x03, 0xa6); - break; -case UC_GREEK_SMALL_LETTER_PHI: - unicode_action_function(0x03, 0xc6); - break; -case UC_INFINITY: - unicode_action_function(0x22, 0x1e); - break; -case UC_GREEK_CAPITAL_LETTER_OMICRON: - unicode_action_function(0x03, 0x9f); - break; -case UC_ELEMENT_OF: - unicode_action_function(0x22, 0x08); - break; -case UC_MULTIPLICATION_SIGN: - unicode_action_function(0x00, 0xd7); - break; -case UC_SUBSCRIPT_ZERO: - unicode_action_function(0x20, 0x80); - break; -case UC_GREEK_CAPITAL_LETTER_SIGMA: - unicode_action_function(0x03, 0xa3); - break; -case UC_GREEK_SMALL_LETTER_OMEGA: - unicode_action_function(0x03, 0xc9); - break; -case UC_SUBSCRIPT_ONE: - unicode_action_function(0x20, 0x81); - break; -case UC_GREEK_CAPITAL_LETTER_ZETA: - unicode_action_function(0x03, 0x96); - break; -case UC_GREEK_SMALL_LETTER_TAU: - unicode_action_function(0x03, 0xc4); - break; -case UC_SUPERSCRIPT_FIVE: - unicode_action_function(0x20, 0x75); - break; -case UC_THERE_EXISTS: - unicode_action_function(0x22, 0x03); - break; -case UC_PLUS_MINUS_SIGN: - unicode_action_function(0x00, 0xb1); - break; -case UC_VULGAR_FRACTION_THREE_QUARTERS: - unicode_action_function(0x00, 0xbe); - break; -case UC_SUPERSCRIPT_THREE: - unicode_action_function(0x00, 0xb3); - break; -case UC_EMPTY_SET: - unicode_action_function(0x22, 0x05); - break; -case UC_UPWARDS_ARROW: - unicode_action_function(0x21, 0x91); - break; -case UC_SUPERSCRIPT_NINE: - unicode_action_function(0x20, 0x79); - break; -case UC_GREEK_SMALL_LETTER_DELTA: - unicode_action_function(0x03, 0xb4); - break; -case UC_GREEK_SMALL_LETTER_MU: - unicode_action_function(0x03, 0xbc); - break; -case UC_GREEK_CAPITAL_LETTER_KAPPA: - unicode_action_function(0x03, 0x9a); - break; -case UC_SUBSCRIPT_EIGHT: - unicode_action_function(0x20, 0x88); - break; -case UC_GREEK_CAPITAL_LETTER_ALPHA: - unicode_action_function(0x03, 0x91); - break; -case UC_SUBSCRIPT_SEVEN: - unicode_action_function(0x20, 0x87); - break; -case UC_GREEK_CAPITAL_LETTER_BETA: - unicode_action_function(0x03, 0x92); - break; -case UC_GREEK_CAPITAL_LETTER_ETA: - unicode_action_function(0x03, 0x97); - break; -case UC_SUPERSCRIPT_EIGHT: - unicode_action_function(0x20, 0x78); - break; -case UC_SUPERSCRIPT_ZERO: - unicode_action_function(0x20, 0x70); - break; -case UC_NOT_AN_ELEMENT_OF: - unicode_action_function(0x22, 0x09); - break; -case UC_GREEK_SMALL_LETTER_UPSILON: - unicode_action_function(0x03, 0xc5); - break; -case UC_NOT_EQUAL_TO: - unicode_action_function(0x22, 0x60); - break; -case UC_GREEK_CAPITAL_LETTER_CHI: - unicode_action_function(0x03, 0xa7); - break; -case UC_FOR_ALL: - unicode_action_function(0x22, 0x00); - break; -case UC_GREEK_CAPITAL_LETTER_TAU: - unicode_action_function(0x03, 0xa4); - break; -case UC_VULGAR_FRACTION_ONE_QUARTER: - unicode_action_function(0x00, 0xbc); - break; -case UC_GREEK_SMALL_LETTER_CHI: - unicode_action_function(0x03, 0xc7); - break; -case UC_GREEK_CAPITAL_LETTER_THETA: - unicode_action_function(0x03, 0x98); - break; -case UC_GREEK_SMALL_LETTER_IOTA: - unicode_action_function(0x03, 0xb9); - break; -case UC_GREEK_CAPITAL_LETTER_LAMDA: - unicode_action_function(0x03, 0x9b); - break; -case UC_SUPERSCRIPT_LATIN_SMALL_LETTER_N: - unicode_action_function(0x20, 0x7f); - break; -case UC_GREEK_CAPITAL_LETTER_UPSILON: - unicode_action_function(0x03, 0xa5); - break; -case UC_GREEK_CAPITAL_LETTER_MU: - unicode_action_function(0x03, 0x9c); - break; -case UC_GREEK_CAPITAL_LETTER_EPSILON: - unicode_action_function(0x03, 0x95); - break; -case UC_GREEK_CAPITAL_LETTER_GAMMA: - unicode_action_function(0x03, 0x93); - break; -case UC_SUBSCRIPT_SIX: - unicode_action_function(0x20, 0x86); - break; -case UC_GREEK_CAPITAL_LETTER_DELTA: - unicode_action_function(0x03, 0x94); - break; -case UC_VULGAR_FRACTION_ONE_HALF: - unicode_action_function(0x00, 0xbd); - break; - default: - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case L1: - ergodox_right_led_1_on(); - break; - case L2: - ergodox_right_led_2_on(); - break; - case L3: - ergodox_right_led_3_on(); - break; - case L4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case L5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - // case L6: - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - // case L7: - // ergodox_right_led_1_on(); - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - default: - ergodox_board_led_off(); - break; - } -}; diff --git a/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.md b/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.md deleted file mode 100644 index 2c9e0a837..000000000 --- a/keyboards/ergodox_ez/keymaps/german-manuneo/keymap.md +++ /dev/null @@ -1,188 +0,0 @@ -# ManuNeo Ergodox Keyboard Layout - -Compile this file to a `keymap.c` file using `compile_keymap.py` - - python compile_keymap.py keymaps/german-manuneo/keymap.md - -Tested with python 2.7 and python 3.4 - - -# Layout Config - - { - "layout": "ergodox_ez", - "keymaps_includes": [ - "ergodox_ez.h", - "action_layer.h", - "keymap_common.h", - "keymap_extras/keymap_german.h", - ], - "key_prefixes": ["DE_", "KC_"], - "macros": { - // TODO: implement macros - // "MUC": "", - }, - // TODO: implement default unicode mode - } - - -# Layers - - -## Layer 0 - - .------------------------------------.------------------------------------. - |MO(5)| 1 | 2 | 3 | 4 | 5 |ACUT | GRV | 6 | 7 | 8 | 9 | 0 |CIRC | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - |MO(4)| X | P | F | W | G |HOME |TG(2)| H | J | K | L | Q | Z | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |MO(1)| U | I | A | E | O |-----!-----! S | N | R | T | D | SS | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - |MO(3)| UE | OE | AE | C | V |END | TAB | B | M |COMM| DOT| UP | Y | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | |LGUI|LALT|LCTL| !RCTL|RALT|LEFT|DOWN|RGHT| - '------------------------' '------------------------' - .-----------. .-----------. - |INS |TG(2)| !M(UM)|DELT | - .-----+-----+-----! !-----+-----+-----. - ! ! | APP | ! PGUP| ! ! - ! ! !-----! !-----! ! ! - |BSPC |LSFT | ESC | ! PGDN|ENTER|SPACE| - '-----------------' '-----------------' - - -## Layer 1 - - .------------------------------------.------------------------------------. - | |EXLM|DQOT|PARA| | | | | | | | |RING| | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | |ASTR|PIPE|SLSH|LCBR|RCBR| | |HASH|LESS|MORE| |DQOT| | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | |UNDS|MINS|AMPR|LBRC|RBRC|-----!-----!DLR |LPRN|RPRN|TILD|QUOT| QST | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | |PLUS|EQL | | | | |BSLS|PERC|SCLN|COLN| ↑ | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | ↠| ↓ | → | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 2 - - .------------------------------------.------------------------------------. - | | F1 | F2 | F3 | F4 | F5 | F11 | F12 | F6 | F7 | F8 | F9 |F10 |PEQL | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | | | | | | | | | P7 | P8 | P9 |PAST|PSLS | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | |-----!-----! | P4 | P5 | P6 |PMNS|PMNS | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | | | NLCK| | P1 | P2 | P3 |PPLS|PPLS | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! P0 |PCMM|PDOT|PENT|PENT| - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - - -## Layer 3 - -http://symbolcodes.tlt.psu.edu/bylanguage/mathchart.html - - .------------------------------------.------------------------------------. - | | ¹ | ² | ³ | â´ | âµ | ∀ | | ⶠ| â· | ⸠| â¹ | â° | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | × | ½ | ÷ | ¼ | â…• | | | â…™ | | â…› | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | ± | AT |EURO| ∅ |-----!-----! ∞ | â¿ | ∃ | ∈ | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | â…“ | ≠ | â…” | ¾ | ≃ | | |EXLM| | ∄ | ∉ | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 4 - - - .------------------------------------.------------------------------------. - | | â‚ | â‚‚ | ₃ | â‚„ | â‚… | | | ₆ | ₇ | ₈ | ₉ | â‚€ | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | χ | Ï€ | φ | ω | γ | | | η | ξ | κ | λ | | ζ | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | Ï… | ι | α | ε | ο |-----!-----! σ | ν | Ï | Ï„ | δ | Ï‚ | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | θ | | | | | | β | μ | | | | ψ | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 5 - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | Χ | Π | Φ | Ω | Γ | | | Η | Ξ | Κ | Λ | | Ζ | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | Î¥ | Ι | Α | Ε | Ο |-----!-----! Σ | Î | Ρ | Τ | Δ | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | Θ | | | | | | Î’ | Îœ | | | | Ψ | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - - -## Layer 6 - - .------------------------------------.------------------------------------. - | | | | | | | | | | | | | | | - !-----+----+----+----+----+----------!-----+----+----+----+----+----+-----! - | | | | | | | | | | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | |-----!-----! | | | | | | - !-----+----+----+----x----x----! ! !----x----x----+----+----+-----! - | | | | | | | | | | | | | | | - '-----+----+----+----+----+----------'----------+----+----+----+----+-----' - | | | | | | ! | | | | | - '------------------------' '------------------------' - .-----------. .-----------. - | | | ! | | - .-----+-----+-----! !-----+-----+-----. - ! ! | | ! | ! ! - ! ! !-----! !-----! ! ! - | | | | ! | | | - '-----------------' '-----------------' - diff --git a/keyboards/ergodox_ez/keymaps/german/keymap.c b/keyboards/ergodox_ez/keymaps/german/keymap.c deleted file mode 100644 index 3eab51f0e..000000000 --- a/keyboards/ergodox_ez/keymaps/german/keymap.c +++ /dev/null @@ -1,185 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_german.h" - -// Layer names -#define BASE 0 // default layer -#define SYMB 1 // symbol layer -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ^ | 1 | 2 | 3 | 4 | 5 | Play | | Next | 6 | 7 | 8 | 9 | 0 | ß | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L2 | Z | U | I | O | P | Ãœ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | A | S | D | F | G |------| |------| H | J | K | L | Ö | Ä/L2 | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Y | X | C | V | B | | | | N | M | , | . |-/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case MDIA: - ergodox_right_led_2_on(); - break; - default: - ergodox_board_led_off(); - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/j3rn/keymap.c b/keyboards/ergodox_ez/keymaps/j3rn/keymap.c deleted file mode 100644 index 6e271321d..000000000 --- a/keyboards/ergodox_ez/keymaps/j3rn/keymap.c +++ /dev/null @@ -1,187 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Grv | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 | BkSp | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc|A / L2| S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ~L1 | ~L2 |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | Home | | PgUp |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | End | | PgDn | | | - * |Space | LGui |------| |------| Tab |Enter | - * | | |Shift | | Alt | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, - CTL_T(KC_ESC), LT(MDIA, KC_A),KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_FN1, KC_FN2, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - - ALT_T(KC_APP), KC_HOME, - KC_END, - KC_SPC, KC_LGUI, KC_LSHIFT, - // right hand - KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - - KC_PGUP, CTL_T(KC_ESC), - KC_PGDN, - KC_LALT, KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | Lclk | Rclk | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, - KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) - [2] = ACTION_LAYER_TAP_TOGGLE(MDIA) // FN2 - Momentary Layer 2 (Media) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/j3rn/readme.md b/keyboards/ergodox_ez/keymaps/j3rn/readme.md deleted file mode 100644 index fc4b64042..000000000 --- a/keyboards/ergodox_ez/keymaps/j3rn/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# J3RN's Mac-centric ErgoDox EZ keymap - -## Motivation - -Essentially, I wanted to switch to a layout that was less jarring than the default ErgoDox EZ layout, and did not require finger gymnastics to perform common OS X shortcuts (most of which involve the CMD (LGui) key). - -## How is it different from the default ErgoDox EZ layout? - -This layout more closely resembles that of the Mac keyboard, and has some other goodness baked in. Here is a rundown of what that means: - -### Mac-like changes - -- **The key to the left of "1" is "~" instead of "=".** -- **The key to the right of "0" is Backspace instead of "-"** (misleadingly labeled "delete" on the Mac's keyboard). There was no room to fit in "-" and "=" between "0" and Backspace, unfortunately. -- **The key to the left of "Q" is Tab instead of Delete.** -- **The rightmost big key on the left thumb is CMD (LGui) instead of Backspace.** - -### Other changes - -- **The button to the left of "A" is Ctrl/Esc instead of Backspace.** This is actually how I have the keyboard on my Macbook set up to be, since it's loads more convenient than a CAPS LOCK key. This is the Ctrl key I find myself using most. -- **Mouse uses Vim-style navigation**. To activate "Media mode," hold the 'a' key. This allows you to move the mouse around with hjkl just like in Vim. Additionally, right and left click are the conveniently placed 'i' and 'o' keys. -- **The key to the right of "5" and the key to left of "6" are "[" and "]", respectively, instead of Left and Right.** There is a more convenient set of Left and Right already present. Truth be told, I don't really use these keys, as they are a stretch to reach. -- **The Toggle L1 keys have been replaced by the otherwise displaced "-" and "=".** They are laid out, left-to-right, in the same order as on the Mac keyboard. Honestly, they are not terribly conveniently placed, and their placement might change in a later version. I found that I did not toggle L1 frequently at all, and found using the momentary keys to access L1 to fit my workflow better. -- **The "~"/L1 key in the bottom-left is now just momentary L1.** The "~" key was moved to the top-left as mentioned before, and I like to keep my multi-use keys to a minimum due to the latency for them to switch from "press" to "hold." -- **The Home and End buttons have been shifted up on the left thumb, and Shift inserted below them.** This makes doing Shift-5 and other such combinations less painful. -- **The Page Up and Page Down buttons have been shifted up on the right thumb, and Alt was moved from above them to below them.** I use Alt more than Page Up or Page Down (mostly in terminal applications), and thought that it deserved a more accessible location. - - -**I'm always open to feedback and/or suggestions!** diff --git a/keyboards/ergodox_ez/keymaps/jack/keymap.c b/keyboards/ergodox_ez/keymaps/jack/keymap.c deleted file mode 100644 index 80bf9d535..000000000 --- a/keyboards/ergodox_ez/keymaps/jack/keymap.c +++ /dev/null @@ -1,118 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -// TODO: Define layer names that make sense for the ErgoDox EZ. -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO, - KC_NO, KC_LCTL, KC_LALT,KC_LGUI, MO(2), - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_SPC,KC_END, - // right hand - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, - KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_NO, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_ENT, - MO(1), KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, - KC_NO, KC_NO, - KC_PGUP, - KC_PGDN, KC_SPC,KC_SPC - ), -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, - KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - KC_TRNS, KC_F12, KC_NO, KC_NO, KC_NO, RESET, KC_TRNS, - KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, - KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - KC_TRNS, KC_F12, KC_NO, KC_NO, KC_NO, RESET, KC_TRNS, - KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/jacobono/img/colemak-default-layer.png b/keyboards/ergodox_ez/keymaps/jacobono/img/colemak-default-layer.png deleted file mode 100644 index 06f63c496..000000000 Binary files a/keyboards/ergodox_ez/keymaps/jacobono/img/colemak-default-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/jacobono/img/number-dpad-layer.png b/keyboards/ergodox_ez/keymaps/jacobono/img/number-dpad-layer.png deleted file mode 100644 index 4dd718278..000000000 Binary files a/keyboards/ergodox_ez/keymaps/jacobono/img/number-dpad-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/jacobono/img/symbol-layer.png b/keyboards/ergodox_ez/keymaps/jacobono/img/symbol-layer.png deleted file mode 100644 index ee224cf0c..000000000 Binary files a/keyboards/ergodox_ez/keymaps/jacobono/img/symbol-layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/jacobono/keymap.c b/keyboards/ergodox_ez/keymaps/jacobono/keymap.c deleted file mode 100644 index 6b19800af..000000000 --- a/keyboards/ergodox_ez/keymaps/jacobono/keymap.c +++ /dev/null @@ -1,273 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define COLEMAK 0 // new colemak layout -#define QWERTY 1 // default layer -#define SYMB 2 // symbols -#define NUMPAD 3 // number pad -#define MDIA 4 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap 0: Basic COLEMAK layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | TAB | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | R | S | T | D |------| |------| H | N | E | I | O | DEL | - * |--------+------+------+------+------+------| | LGUI(TAB)------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L1 | | | UP |MO(L2)| |MO(L2)| Down | | ALT | RGUI | - * `----------------------------------' `------------------------------------' - * ,-------------. ,---------------. - * | LGUI | App | |Ctrl/Esc| Alt | - * ,------|------|------| |--------+--------+------. - * | | |QUKSL | | QUKSL | | | - * |Space |ENTER |------| |--------| ENTER |Space | - * | | |MO(L3)| | MO(L3) | | | - * `--------------------' `------------------------' - */ - - // If it accepts an argument (i.e, is a function), it doesn't need KC_. - // Otherwise, it needs KC_* - [COLEMAK] = KEYMAP( // layer 0 : Colemak layout default layer - // left hand - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_TRNS, - KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_TRNS, - TG(QWERTY), KC_TRNS, KC_TRNS,KC_UP, MO(SYMB), - KC_LGUI, KC_APP, - LGUI(S(KC_SPC)), - KC_SPC,KC_ENT,MO(NUMPAD), - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT, - KC_TRNS, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_TAB, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_DEL, - LGUI(KC_TAB), KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - MO(SYMB), KC_DOWN, KC_TRNS, KC_RALT, KC_RGUI, - CTL_T(KC_ESC), KC_LALT, - LGUI(S(KC_SPC)), - MO(NUMPAD), KC_ENT, KC_SPC), - - /* Keymap 1: Basic QWERTY layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | BkSp | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | DEL | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L0 | | L0 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L |; / L4| CTRL | - * |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L3| '" |AltShf| Left |MO(L2)| |MO(L2)| Down | [ | ] | ~L3 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | Tab | BkSp | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space| LGUI |------| |------| RGUI |Enter | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ - // If it accepts an argument (i.e, is a function), it doesn't need KC_. - // Otherwise, it needs KC_* - [QWERTY] = KEYMAP( // layer 1 - // left hand - KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, - KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LALT, - KC_TRNS, KC_QUOT, LALT(KC_LSFT), KC_LEFT, MO(SYMB), - KC_TAB, KC_DELT, - KC_HOME, - KC_SPC, KC_LGUI, KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT, - KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), KC_RCTRL, - KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - MO(SYMB), KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN, KC_RGUI, KC_ENT), - - - /* Keymap 2: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | @ | * | = | _ | | | | ~ | { | } | # | : | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | ! | + | - | " |------| |------| " | ( | ) | ' | ` | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | % | ^ | $ | & | | | | ; | [ | ] | \ | / | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // SYMBOL - [SYMB] = KEYMAP( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_TRNS, KC_AT, KC_ASTR, KC_EQL, KC_UNDS, KC_TRNS, - KC_TRNS, KC_PIPE, KC_EXLM, KC_PLUS, KC_MINS, S(KC_QUOTE), - KC_TRNS, KC_TRNS, KC_PERC, KC_CIRC, KC_DLR, KC_AMPR, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_TILD, KC_LCBR, KC_RCBR, KC_HASH, S(KC_SCLN), KC_F12, - S(KC_QUOTE),KC_LPRN, KC_RPRN, KC_QUOTE, KC_GRV, KC_TRNS, - KC_TRNS, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_SLSH, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), - - /* Keymap 3: Numpad Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | UP | | | | | | $ | 7 | 8 | 9 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | LEFT | DOWN | RIGHT| |------| |------| = | 4 | 5 | 6 | - | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | 1 | 2 | 3 | * | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | , | 0 | . | / | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // Numpad - [NUMPAD] = KEYMAP( - // left hand - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_UP,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_RIGHT,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_DLR, KC_7, KC_8, KC_9, KC_PLUS, KC_TRNS, - KC_EQL, KC_4, KC_5, KC_6, KC_MINS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_ASTR, KC_TRNS, - KC_COMMA,KC_0, KC_DOT, KC_SLSH, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), - - /* Keymap 4: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ - // MEDIA AND MOUSE - KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/jacobono/readme.md b/keyboards/ergodox_ez/keymaps/jacobono/readme.md deleted file mode 100644 index 48de0509f..000000000 --- a/keyboards/ergodox_ez/keymaps/jacobono/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# Default Layer # - -I'm using the colemak layer -- customized a bit to work a bit better when using spacemacs as my editor. - -![default-layer](img/colemak-default-layer.png) - -## Special Keys ## - -`SC1` => `LGUI + TAB` - -`SC2` => `LGUI + SPACE + TAB` - -`L1` => Switch to QWERTY Layout - -`T(L2)` => Toggle Symbol Layer - -`T(L3)` => Toggle Number and D-Pad Layer - -# QWERTY # - -Nothing special here -- just need this layer tucked away for the `WASD`. Which is literally the only reason I use it. -Just have the same button to toggle back to colemak. - -# Symbol Layer # - -![symbol-layer](img/symbol-layer.png) - -This is just putting matching closing symbols next to each other -- useful when editing lisp. - -# Number and D-Pad Layer # - -Just a basic number layer with a D-PAD on the other side. - -![number-dpad-layer](img/number-dpad-layer.png) diff --git a/keyboards/ergodox_ez/keymaps/jgarr/keymap.c b/keyboards/ergodox_ez/keymaps/jgarr/keymap.c deleted file mode 100644 index a3ad2040f..000000000 --- a/keyboards/ergodox_ez/keymaps/jgarr/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,-----------------------------------------------------. - * | Grv | 1 | 2 | 3 | 4 | 5 | Del | |Backspace| 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+------+-------------| |---------+------+------+------+------+------+--------| - * | Tab | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc| A | O | E | U | I |------| |---------| D | H | T | N |S / L2| - | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `----------------+------+------+------+------+--------' - * | Ctrl | LGui | Alt | Left | Right| | Up | Down | [ | ] | = | - * `----------------------------------' `----------------------------------' - * ,--------------. ,-------------. - * | AltShf| LGui | | Alt | ~L1 | - * ,------|-------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp |------| |------| Enter |Space | - * | |ace | End | | PgDn | | | - * `---------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(1), - CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - KC_LCTL, KC_LGUI, KC_LALT, KC_LEFT, KC_RGHT, - LALT(KC_LSFT), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_BSPC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_EQL, - KC_LALT, KC_FN1, - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/josh/keymap.c b/keyboards/ergodox_ez/keymaps/josh/keymap.c deleted file mode 100644 index de5664a25..000000000 --- a/keyboards/ergodox_ez/keymaps/josh/keymap.c +++ /dev/null @@ -1,205 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -//macros -#define CTL_SFT_T 100 -#define CTL_SFT_G 101 -#define CTL_ALT_H 102 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | ESC | | M 100| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * |TAB /Alt| Q | W | E | R | T | Meh | | Meh | Y | U | I | O | P |\ / ALT | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCTL | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / CTL | - * |--------+------+------+------+------+------| ~L1 | | ~L1 |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | WIN | ` | M 102| M 101|AltShf| |AltShf| Left | Down | Up | Right | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LALT | | Alt | CAPS | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Delete |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - ALT_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(SYMB), - KC_LGUI, KC_GRV, M(CTL_ALT_H),M(CTL_SFT_G),LALT(KC_LSFT), - CTL_T(KC_APP), KC_LALT, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - M(CTL_SFT_T),KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MEH_T(KC_NO),KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),CTL_T(KC_QUOT), - MO(SYMB), KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - LALT(KC_LSFT),KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, - KC_LALT, KC_CAPS, - KC_PGUP, - KC_PGDN,KC_DEL, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | CALC | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Left | Down | Up | Right| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_CALC, - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN,KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case CTL_SFT_T: - if (record->event.pressed) { - return MACRO(D(LCTL), D(LSFT), T(T), END); - } - return MACRO(U(LCTL), U(LSFT), END); - break; - case CTL_SFT_G: - if (record->event.pressed) { - return MACRO(D(LCTL), D(LSFT), T(G), END); - } - return MACRO(U(LCTL), U(LSFT), END); - break; - case CTL_ALT_H: - if (record->event.pressed) { - return MACRO(D(LCTL), D(LALT), T(H), END); - } - return MACRO(U(LCTL), U(LALT), END); - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/josh/readme.md b/keyboards/ergodox_ez/keymaps/josh/readme.md deleted file mode 100644 index cee19d47e..000000000 --- a/keyboards/ergodox_ez/keymaps/josh/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -Layout is based on the default layout that comes on the ergodox infinity. Focused mostly on making ctl and alt easy to reach. I spend most my day working in Eclipse which has just so many 3 key shortcuts. - -* Removed numpad keys from symbol layer (I don't use them) -* Added arrow keys under h, j, k, l on symbol layer. vi movement keys! -* Added a few macros for eclipse hotkeys that I used all the time -* Added calc button on symbol layer -* tap vs hold on tab and \. Gives alt, ctl and shift on both sides of the keyboard - diff --git a/keyboards/ergodox_ez/keymaps/kastyle/keymap.c b/keyboards/ergodox_ez/keymaps/kastyle/keymap.c deleted file mode 100644 index 3982e0a19..000000000 --- a/keyboards/ergodox_ez/keymaps/kastyle/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LGUI | | App | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LCtrl | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,---------------. ,---------------. - * |Ctrl/Esc| Alt | | Alt |Ctrl/Esc| - * ,------|--------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * |Backsp| Del |------| |------| Enter | Space| - * | | | End | | PgDn | | | - * `----------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - CTL_T(KC_ESC), ALT_T(KC_APP), - KC_HOME, - KC_BSPC,KC_DEL,KC_END, - // right hand - KC_APP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/kines-ish/keymap.c b/keyboards/ergodox_ez/keymaps/kines-ish/keymap.c deleted file mode 100644 index 5063c99f2..000000000 --- a/keyboards/ergodox_ez/keymaps/kines-ish/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Esc | Grv |Insert| Left | Right| | Up | Down | [ | ] | L2 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Ctrl | Alt | | LGui | Ctrl | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * |Backsp| Del |------| |------| Enter| Space| - * |ace | | End | | PgDn | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_ESC, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, - KC_LCTL,KC_LALT, - KC_HOME, - KC_BSPC,KC_DEL,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN2, - KC_LGUI, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | PrScr | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ScrLk | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Pause | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_PSCR,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_SLCK,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_PAUS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/kines-ish/readme.md b/keyboards/ergodox_ez/keymaps/kines-ish/readme.md deleted file mode 100644 index 5d39a0590..000000000 --- a/keyboards/ergodox_ez/keymaps/kines-ish/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -This keymap attempts to match the Kinesis Contoured (aka Advantage) default -layout as closely as possible. See -http://www.kinesis-ergo.com/wp-content/uploads/2013/06/advantage_layout_win.pdf - -Apart from the obvious mappings, this keymap also: - -* removes the dual-purpose momentary layer/normal keys: Z, /, and Grv; - because the author--coming from a Kinesis keyboard--finds the delays and - accidental modifiers to be more disconcerting than helpful. - -* puts Esc in the bottom left since there's no place for it in the top - left to match the Kinesis. - -* changes the bottom-right key into an L2 toggle since there's otherwise no - way to get to L2. - -* adds PrScr, ScrLk and Pause to the L1 keymap, down the left side, since - they're present on the Kinesis but not available in the default - ergodox_ez keymap. diff --git a/keyboards/ergodox_ez/keymaps/maz/keymap.c b/keyboards/ergodox_ez/keymaps/maz/keymap.c deleted file mode 100644 index 7b8f0df74..000000000 --- a/keyboards/ergodox_ez/keymaps/maz/keymap.c +++ /dev/null @@ -1,229 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define ARRW 2 // arrow keys -#define MDIA 3 // media keys, including mouse - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | | | | | | - * | Space| Bksp |------| |------| Tab |Enter | - * | ctrl | gui | Alt | | Alt | gui | ctrl | - * `--------------------' `----------------------' - */ - // TODO: maybe look into changing the delay or whatever for the holding macros... not sure which way you would go with this. if the macro automatically kicks in if you hold it and press another button (no matter how long you held it for), then it wouldn't hurt to have a longer period i think... although if you hold a button and then decide not to, then you;ll register a space/bksp/etc. on accident. on the other hand, if it's too short of a delay, then you might be able to register spc/bksp/etc quickly enough, although i don't see this as big of an issue - // not sure if gui is meta key or super... it says meta on the basic keycodes page, and i think that's consitent with other shit, but you should really figure out how to program the keyboard to have meta and super separately instead of hacking your init.el to recognize alt as meta... because shit will get fucked up beteween awesome and emacs and other shit i'm guessing -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_TRNS, KC_GRV, KC_TRNS,MO(SYMB),MO(ARRW), - KC_TRNS, KC_TRNS, - KC_TRNS, - CTL_T(KC_SPC),GUI_T(KC_BSPC),KC_LALT, - // right hand - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_CAPSLOCK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - MO(MDIA), MO(SYMB), KC_LBRC,KC_RBRC, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_RALT,GUI_T(KC_TAB), CTL_T(KC_ENT) - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_DOT, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_TRNS, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Arrow keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | |PGDOWN| PGUP | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | HOME | END | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[ARRW] = KEYMAP( - // left hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_PGDOWN, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 3: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |Mute |VolDn | VolUp| | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | Prev | Play | Next | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * |Brwser| | | | | | | - * |Back | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_WBAK, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/maz/readme.md b/keyboards/ergodox_ez/keymaps/maz/readme.md deleted file mode 100644 index 000a8d000..000000000 --- a/keyboards/ergodox_ez/keymaps/maz/readme.md +++ /dev/null @@ -1,121 +0,0 @@ -# Introduction - -## Motivation -I created this keymap in an attempt to optimize my typing experience in text editors (vim and emacs) and the command-line. - -More specifically, I wanted to have each modifier key controlled by the thumbs, the most powerful of the digits (I think). This cured me of emacs pinky, which had surprisingly grown quite quickly over the first two weeks of using emacs & emacs-like commands on the command-line. - -## Changes -There are some miscellaneous changes that I kind of forgot I made, such as moving the tilde key, but you can check out the visual layouts below, which I **have** kept up to date. -### Modifier Keys -The biggest changes from the ergodox ez default keymap are the modifiers on the thumb cluster. You must hold each key down for a certain amount of time (forgot where this is specified) in order for the modifier key to activate. - -### Layers -* an arrow layer (ARRW) has been created because the default arrow keys suck. Beware, these do use vim bindings because they're the best. -* the keys in the media layer have been moved around for a better experience (imo), especially with respect to the mouse -* the three layers (SYMB, MDIA, and ARRW) now have their own dedicated keys accessible by the thumbs in the basic layer -* caps lock has been put in place of the right-side `L1` toggle key because there was really no need to have two keys to toggle one layer, and caps lock is useful when writing queries -** unfortunatley, caps lock is not indicated by an LED, so be careful. I use caps lock just like I do insert in vim; for a short burst of text. I always turn off caps lock when I change my focus - -### Removal Of Keys -I also removed a bunch of unnecessary keys that I wasn't going to use anyway. You'll see such keys are blank in the basic layer. I will probably add some more keys in place of these, but I'm fine for now; I just didn't want the distraction of extra keys I barely use. - -## Caveats -### Thumb Cluster Range -I've heard many complaints about the thumb clusters. I agree that the three outter keys are almost impossible to reach. I am going to try to build [Matt Adereth's keyboard](https://github.com/adereth/dactyl-keyboard), which looks to have a better layout. However, I am able to comfortably use the three modifier keys mainly because: -* I use DCS keycaps with SA Row 3 keycaps where the Alt keys are -* I have relatively large hands (I guarantee you there's no problem - I guarantee you) - -### Dangerous positioning -I think it's quite dangerous to put something like control on the same key as enter. Alas, this is a risk I'm willing to accept, and so should you if you decide to use this keymap. I tend to avoid putting myself in situtations in which disaster could occur with one fell swoop of a keypress. - -# Keymap -## Keymap 0: Basic layer -``` -,--------------------------------------------------. ,--------------------------------------------------. -| = | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | - | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Tab | Q | W | E | R | T | L1 | | CAPS | Y | U | I | O | P | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| ESC | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | -|--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| -| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | Grv | |*SYMB*|*ARRW*| |*MDIA*|*SYMB*| [ | ] | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+--------+------. - | | | | | | | | - | Space| Bksp |------| |------| Tab |Enter | - | ctrl | gui | Alt | | Alt | gui | ctrl | - `--------------------' `----------------------' - -``` - -## Keymap 1: Symbol Layer -The only change here is the *dot* (`.`) character moving from next to `0` next to `+` in order to move the layer keys in the correct position -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | . | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | 0 | = | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Keymap 2: Arrow Layer -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | | | | | | | | | | | | | | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | | | | | | | | | |PGDOWN| PGUP | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | |------| |------| LEFT | DOWN | UP |RIGHT | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | | | | | | HOME | END | | | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` - -## Keymap 3: Media and mouse keys -``` - ,--------------------------------------------------. ,--------------------------------------------------. - | | | | | | | | | | | | | | | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | | | MsUp | | | | | | | | | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | |Mute |VolDn | VolUp| | | | | | | | | | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | Prev | Play | Next | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - |Brwser| | | | | | | - |Back | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' -``` diff --git a/keyboards/ergodox_ez/keymaps/mpiechotka/keymap.c b/keyboards/ergodox_ez/keymaps/mpiechotka/keymap.c deleted file mode 100644 index 5bfef5995..000000000 --- a/keyboards/ergodox_ez/keymaps/mpiechotka/keymap.c +++ /dev/null @@ -1,276 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_colemak.h" - -enum { - BASE = 0, - BASE_CM, - SYMB, - MACR -}; - -enum { - LWIN = 1, - PC1, - PC2, - PC3, - PC4, - DL_BASE, - DL_BASE_CM, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0a: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LAlt | LGui | | LAlt | RAlt | - * ,------|------|------| |------+--------+------. - * | |Backsp| Home | | PgUp | | | - * | Space|ace/ |------| |------| Tab/ |Enter/| - * | /Shft|Ctrl | 1) | | 2) | Ctrl |Shift | - * `--------------------' `----------------------' - * - * 1) End/L1 - * 2) PgDown/L2 - */ -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(SYMB), - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_EQL, - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - KC_LALT, F(LWIN), - KC_HOME, - SFT_T(KC_SPC),CTL_T(KC_BSPC),LT(SYMB, KC_END), - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_MINS, KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), - KC_LALT, KC_RALT, - KC_PGUP, - LT(MACR,KC_PGDN),CTL_T(KC_TAB), SFT_T(KC_ENT) - ), -/* Keymap 0b: Basic layer (Colemak keycodes or QWERTY) - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LAlt | LGui | | LAlt | RAlt | - * ,------|------|------| |------+--------+------. - * | |Backsp| Home | | PgUp | | | - * | Space|ace/ |------| |------| Tab/ |Enter/| - * | /Shft|Ctrl | 1) | | 2) | Ctrl |Shift | - * `--------------------' `----------------------' - * - * 1) End/L1 - * 2) PgDown/L2 - */ -[BASE_CM] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, CM_Q, CM_W, CM_F, CM_P, CM_G, TG(SYMB), - KC_ESC, CM_A, CM_R, CM_S, CM_T, CM_D, - KC_LSFT, CM_Z, CM_X, CM_C, CM_V, CM_B, KC_EQL, - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - KC_LALT, F(LWIN), - KC_HOME, - SFT_T(KC_SPC),CTL_T(KC_BSPC),LT(SYMB, KC_END), - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), CM_J, CM_L, CM_U, CM_Y, KC_P, /*CM_SCLN*/ KC_BSLS, - CM_H, CM_N, CM_E, CM_I, CM_O, KC_QUOT, - KC_MINS, CM_K, CM_M, CM_COMM,CM_DOT, CTL_T(CM_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, LT(SYMB,KC_NO), - KC_LALT, KC_RALT, - KC_PGUP, - LT(MACR,KC_PGDN),CTL_T(KC_TAB), SFT_T(KC_ENT) - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Macros - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | DLa | DLb | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | PC1 | PC2 | PC3 | PC4 | |------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MACROS -[MACR] = KEYMAP( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, F(DL_BASE),F(DL_BASE_CM),KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, F(PC1), F(PC2), F(PC3), F(PC4), KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [LWIN] = ACTION_MACRO(LWIN), - [PC1] = ACTION_MACRO(PC1), - [PC2] = ACTION_MACRO(PC2), - [PC3] = ACTION_MACRO(PC3), - [PC4] = ACTION_MACRO(PC4), - [DL_BASE] = ACTION_DEFAULT_LAYER_SET(BASE), - [DL_BASE_CM] = ACTION_DEFAULT_LAYER_SET(BASE_CM) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - case LWIN: - if (record->event.pressed) { - register_code(KC_RSFT); - unregister_code(KC_RSFT); - register_code(KC_LGUI); - } else { - unregister_code(KC_LGUI); - } - break; - case PC1: - if (!record->event.pressed) { - return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(1), W(50), T(ENT), END); - } - break; - case PC2: - if (!record->event.pressed) { - return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(2), W(50), T(ENT), END); - } - break; - case PC3: - if (!record->event.pressed) { - return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(3), W(50), T(ENT), END); - } - break; - case PC4: - if (!record->event.pressed) { - return MACRO(T(SLCK), W(50), T(SLCK), W(50), T(4), W(50), T(ENT), END); - } - break; - } - return MACRO_NONE; -} - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case SYMB: - ergodox_right_led_1_on(); - break; - case MACR: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } -}; diff --git a/keyboards/ergodox_ez/keymaps/mpiechotka/readme.md b/keyboards/ergodox_ez/keymaps/mpiechotka/readme.md deleted file mode 100644 index 785400d1d..000000000 --- a/keyboards/ergodox_ez/keymaps/mpiechotka/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# ErgoDox EZ mpiechotka Configuration - -Modification of ErgoDox EZ Colemak layout with additional QWERTY/software Colemak layer and change of the special keys. - - - diff --git a/keyboards/ergodox_ez/keymaps/msc/img/code_layer.png b/keyboards/ergodox_ez/keymaps/msc/img/code_layer.png deleted file mode 100644 index 7b5efaae7..000000000 Binary files a/keyboards/ergodox_ez/keymaps/msc/img/code_layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/msc/img/main_layer.png b/keyboards/ergodox_ez/keymaps/msc/img/main_layer.png deleted file mode 100644 index 65f92dda1..000000000 Binary files a/keyboards/ergodox_ez/keymaps/msc/img/main_layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/msc/img/media_layer.png b/keyboards/ergodox_ez/keymaps/msc/img/media_layer.png deleted file mode 100644 index a69799b07..000000000 Binary files a/keyboards/ergodox_ez/keymaps/msc/img/media_layer.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/msc/keymap.c b/keyboards/ergodox_ez/keymaps/msc/keymap.c deleted file mode 100644 index e567e513f..000000000 --- a/keyboards/ergodox_ez/keymaps/msc/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |' / Cmd | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Cmd | Alt |AltShf| Left | Right| | Left | Down | Up |Right | L2 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_LGUI,KC_LALT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN,GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(MDIA), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | Mute | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | Prev |VolDn |VolUp | Next | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | Lclk | Rclk |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/msc/readme.md b/keyboards/ergodox_ez/keymaps/msc/readme.md deleted file mode 100644 index 0d14fcbd2..000000000 --- a/keyboards/ergodox_ez/keymaps/msc/readme.md +++ /dev/null @@ -1,32 +0,0 @@ -# MSC Configuration - -### Based mostly on the ErgoDox EZ default layout with optimizations for coding on osx. - -#### Expecting the user to rely on Coder Layer this keymap removes some of the duplicate symbol keys in the lower portions of the board and replaces them with arrow keys and modifiers. The Media Layer is also updated to match the change in the arrow keys and the left and right click buttons are moved under the thumb position. The Media layer is now reached with toggle button in the lower right. - -### Main Layer - -![Main Layer](img/main_layer.png) - -### Code Layer - -![Code Layer](img/code_layer.png) - -### Media Layer - -![Media Layer](img/media_layer.png) - -## Changelog - -Version 1.0 - -- Changed the temp code layer key in the bottom right to toggle media layer -- Changed the temp media key to only be ";" -- Changed right hand bottom row to match vim home row nav directions -- Changed media keys to match arrow key changes -- Changed media left and right click to spacebar and backspace locations -- Changed bottom left to Cmd -- Changed single quote on left bottom row to alt - -#### Coming Soon: -- A new layer for Blender editing with a focus on left hand shortcut and a righthand num pad to control the view in Blender. diff --git a/keyboards/ergodox_ez/keymaps/naps62/keymap.c b/keyboards/ergodox_ez/keymaps/naps62/keymap.c deleted file mode 100644 index d8c28423c..000000000 --- a/keyboards/ergodox_ez/keymaps/naps62/keymap.c +++ /dev/null @@ -1,187 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Esc | 1 ! | 2 @ | 3 # | 4 $ | 5 % | Lang | | Esc | 6 ^ | 7 & | 8 * | 9 ( | 0 ) | Bckspc | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L | ; : | ' " | - * |--------+------+------+------+------+------| L1 | | L1 |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , < | . > | / ? | - _ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L1 | ` ~ | ' " | \ | | L2 | | { | } | [ { | ] } | L1 | - * `----------------------------------' `----------------------------------' - * ,--------------. ,---------------. - * | Home | End | | PgUp |Insert | - * ,------|-------|------| |-------+-------+------. - * | | | LGui | | Del | | | - * | Space| Alt |------| |-------| Enter |Space | - * | | | LGui | | Bcsp | | | - * `---------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(2), - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(1), - MO(1), KC_GRV, KC_QUOT, KC_BSLS, MO(2), - - KC_HOME, KC_END, - KC_LGUI, - KC_SPC, KC_LALT, KC_LGUI, - - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - MO(2), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MO(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, MO(1), - - KC_PGUP, KC_INS, - KC_DEL, - KC_BSPC, KC_ENT, KC_SPC -), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | = | . | 0 | - | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_EQL,KC_DOT, KC_0, KC_MINS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | |GuiUp | Expl | | Term | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |GuiLft|GuiDwn|GuiRgt| | |------| |------| Left | Down | Up |Right | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | |Browsr| | | | |VolDwn|VolUp | Mute | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | | Play | Prev | Next | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Fwd |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, LGUI(KC_W), LGUI(KC_E), KC_BTN1, LGUI(KC_T), KC_TRNS, - KC_TRNS, LGUI(KC_A), LGUI(KC_S), LGUI(KC_D), KC_MS_D, KC_MS_R, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, - KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/naps62/readme.md b/keyboards/ergodox_ez/keymaps/naps62/readme.md deleted file mode 100644 index 14728e4cc..000000000 --- a/keyboards/ergodox_ez/keymaps/naps62/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -# ErgoDox EZ naps62 Configuration - -## Motivation - -I wanted a layout that suited my Linux & Vim usage. I also didn't like the lack of efficient access to some of the more common special characters used in programming. - -## Key features / changes - -### Base Layer (L1) - -* **No `MT(mod, kc)` keys (modifier when pressed, key when tapped).** Those keys work with a global timeout. When a key press is shorter than the timeout, it's considered a tap, otherwise it's a hold. I couldn't find any particular timeout that would work for me. I need to use mods extremely fast, but also want the confort of using them more slowly in other occasions. So I gave up on this feature altogether. -* **Direct access to `{}[]`.** When programming, these are used extremely often. I was still getting used to the coder layer, and I prefer the arrows on the home row, so I used the bottom-right keys for this. -* **Layer keys everywhere.** I either use my little finger or my index finger to go to L1, whichever is more confortable in any given situation. L2 is not used while coding/writing, so I don't need an extremely-optimized access to it. -* **Lang key.** This is nothing more than `Super-Space` combo, which in my systems (both Linux & Windows) is the shortcut to change the keyboard language. I'm Portuguese, so I often cycle between US layout for coding, and PT layout for writing. -* **Special chars on the right-most column.** I only use Ctrl & Shift keys on the left side, so I used the right keys to include some of the more useful special characters as well. - -### Coder Layer (L2) - -* The `=` and `-` signs where nowhere to be found. `-` was already on the base layer, but it's still useful to have a fully-featured NumPad on the coder layer. - -### Media Layer (L3) - -* **Better media keys**. Why was Play/Pause so far away? And where was Mute? I put all my media keys close to each other, including the missing ones -* **Arrow keys on home row.** I use vim, so I'm always on my home row. I use this sometimes to get around, but not as often as to need them on the base row. I'm fine with them here -* I don't use mouse keys. They're still set up, and I made some changes as an experiment, but I mostly forgot they exist by now. - -## Author - -[Miguel Palhas](https://github.com/naps62) diff --git a/keyboards/ergodox_ez/keymaps/ordinary/keymap.c b/keyboards/ergodox_ez/keymaps/ordinary/keymap.c deleted file mode 100644 index 778cbc63c..000000000 --- a/keyboards/ergodox_ez/keymaps/ordinary/keymap.c +++ /dev/null @@ -1,454 +0,0 @@ -#include "ergodox_ez.h" -#include "led.h" -#include "debug.h" -#include "action_layer.h" -#include "action_util.h" -#include "mousekey.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols layer -#define MDIA 2 // media layer -#define SPEC 3 // special layer - -#define LCaps 10 // left caps-shift key -#define LSymb 11 // left symbol-shift key -#define LMdia 12 // left media-shift key -#define LSpec 13 // left special-shift key -#define RCaps 14 // right caps-shift key -#define RSymb 15 // right symbol-shift key -#define RMdia 16 // right media-shift key -#define RSpec 17 // right special-shift key - -#define MUL 20 // mouse up left -#define MUR 21 // mouse up right -#define MDL 22 // mouse down left -#define MDR 23 // mouse down right - -/* - * The Ordinary Layout for the Ergodox EZ keyboard, v4 - * - * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com - * - * No rights reserved. This software is in the public domain. - * Credit me if you are friendly but if you're a jerk don't bother. - * - * Details: readme.md - * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary - */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/******* Base Layer ******************************************************************************************************** - * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | - * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| - * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | - * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| - * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Home | End | | Left | Right| - * ,------|------|------| |------+------+------. - * | | | PgUp | | Up | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | PgDn | | Down | | | - * `--------------------' `--------------------' - */ -[BASE] = KEYMAP( -// left hand - F(LSpec),KC_1,KC_2,KC_3 ,KC_4 ,KC_5 ,KC_ESC -,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC -,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G -,M(LCaps) ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) -,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT,KC_LGUI - ,KC_HOME,KC_END - ,KC_PGUP - ,KC_BSPC,KC_DEL ,KC_PGDN - // right hand - ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) - ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) - ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) - ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) - ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_DOWN ,KC_ENT ,KC_SPC - ), - -/******* Symbols Layer ***************************************************************************************************** - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | - * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| - * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | LCtrl | Meh |Hyper | LAlt | LGui | |RGui/0|RAlt/.|Hypr/=|Meh/+ |RCtrl/Ent| - * `-----------------------------------' `-------------------------------------' - * ,-------------. ,-------------. - * | Left | Right| | Home | End | - * ,------|------|------| |------+------+------. - * | | | Up | | PgUp | | | - * |Space |Enter |------| |------|BackSp| Del | - * | | | Down | | PgDn | | | - * `--------------------' `--------------------' - */ -[SYMB] = KEYMAP( -// left hand - KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC -,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) -,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV -,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB -,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT ,KC_LGUI - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_SPC ,KC_ENT ,KC_DOWN - // right hand - ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS - ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS - ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS - ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS - ,GUI_T(KC_0),ALT_T(KC_DOT),ALL_T(KC_EQL),MEH_T(KC_PLUS),CTL_T(KC_ENT) - ,KC_HOME ,KC_END - ,KC_PGUP - ,KC_PGDN ,KC_BSPC ,KC_DEL -), - -/******* Media Layer ******************************************************************************************************* - * - * ,---------------------------------------------------------------. ,---------------------------------------------------------------. - * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | - * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| - * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | - * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| - * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | - * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| - * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | - * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' - * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| - * `---------------------------------------------' `---------------------------------------------' - * ,-------------. ,-------------. - * | Stop |Refrsh| | Prev | Next | - * ,------|------|------| |------+------+------. - * |Brwser|Brwser|Search| |VolUp | | | - * |Back | Fwd |------| |------| Stop | Play-| - * | | | Home | |VolDn | | Pause| - * `--------------------' `--------------------' - */ -[MDIA] = KEYMAP( -// left hand - KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC -,KC_TRNS ,KC_POWER ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U -,KC_TRNS ,KC_SLEP ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD -,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D -,KC_LCTL ,KC_MEH ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 - ,KC_WSTP ,KC_WREF - ,KC_WSCH - ,KC_WBAK ,KC_NO ,KC_WHOM - // right hand - ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS - ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_MAIL ,KC_TRNS - ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_MYCM ,KC_TRNS - ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS - ,GUI_T(KC_INS),ALT_T(KC_DEL),KC_HYPR ,KC_MEH ,KC_RCTL - ,KC_MPRV ,KC_MNXT - ,KC_VOLU - ,KC_VOLD ,KC_MSTP ,KC_MPLY -), - -/******* Special Layer ***************************************************************************************************** - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | Esc | | | | | | | | | | | | Bspc | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | RShift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[SPEC] = KEYMAP( -// left hand - KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS,KC_TRNS ,KC_TRNS - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_BSPC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_RSFT - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - ) -}; - -const uint16_t PROGMEM fn_actions[] = { - // the faux shift keys are implemented as macro taps - [LCaps] = ACTION_MACRO_TAP(LCaps) - ,[LSymb] = ACTION_MACRO_TAP(LSymb) - ,[LMdia] = ACTION_MACRO_TAP(LMdia) - ,[LSpec] = ACTION_MACRO_TAP(LSpec) - ,[RCaps] = ACTION_MACRO_TAP(RCaps) - ,[RSymb] = ACTION_MACRO_TAP(RSymb) - ,[RMdia] = ACTION_MACRO_TAP(RMdia) - ,[RSpec] = ACTION_MACRO_TAP(RSpec) -}; - -uint16_t caps_shift = 0; -uint16_t symb_shift = 0; -uint16_t mdia_shift = 0; - -bool symb_lock = false; -bool mdia_lock = false; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - // There are two shift keys for each layer so we increment a layer_shift var when one - // is pressed and decrement when one is released. If both are pressed at the same time - // then the layer is locked (or unlocked). The shift counts are bound between 0 and 2 - // only because sometimes rapid pressing led to irregular events; this way the states - // are self healing during use. - - case LCaps: // both caps-shift keys trigger Left Shift - case RCaps: // so they don't interfere with the magic combo - if (record->event.pressed && !record->tap.count) { - if(++caps_shift > 2) caps_shift = 2; - if(caps_shift == 2) { - register_code(KC_CAPS); - unregister_code(KC_CAPS); - } else if(caps_shift == 1) { - register_code(KC_LSFT); - } - } else { - if(--caps_shift < 0) caps_shift = 0; - if(caps_shift == 0) unregister_code(KC_LSFT); - } - break; - - case LSymb: - if (record->event.pressed) { - if(++symb_shift > 2) symb_shift = 2; - if(symb_shift == 2) { - symb_lock = !symb_lock; - } else if(symb_shift == 1) { - layer_on(SYMB); - } - } else { - if(--symb_shift < 0) symb_shift = 0; - if((symb_shift == 0) && (!symb_lock)) layer_off(SYMB); - } - break; - - case LMdia: - if (record->event.pressed) { - if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { - register_code(KC_TAB); - } else { - if(++mdia_shift > 2) mdia_shift = 2; - if(mdia_shift == 2) { - mdia_lock = !mdia_lock; - } else if(mdia_shift == 1) { - layer_on(MDIA); - } - } - } else { - if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { - unregister_code(KC_TAB); - } else { - if(--mdia_shift < 0) mdia_shift = 0; - if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); - } - } - break; - - case LSpec: - if (record->event.pressed) { - if (record->tap.count && !record->tap.interrupted) { - register_code(KC_GRV); - } else { - layer_on(SPEC); - } - } else { - if(record->tap.count && !record->tap.interrupted) { - unregister_code(KC_GRV); - } else { - layer_off(SPEC); - } - } - break; - - case RSymb: - if (record->event.pressed) { - if (record->tap.count && (!symb_shift) && (!symb_lock)) { - register_code(KC_QUOT); - } else { - if(++symb_shift > 2) symb_shift = 2; - if(symb_shift == 2) { - symb_lock = !symb_lock; - } else if(symb_shift == 1) { - layer_on(SYMB); - } - } - } else { - if(record->tap.count && symb_shift == 0) { - unregister_code(KC_QUOT); - } else { - if(--symb_shift < 0) symb_shift = 0; - if((!symb_shift) && (!symb_lock)) layer_off(SYMB); - } - } - break; - - case RMdia: - if (record->event.pressed) { - if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { - register_code(KC_BSLS); - } else { - if(++mdia_shift > 2) mdia_shift = 2; - if(mdia_shift == 2) { - mdia_lock = !mdia_lock; - } else if(mdia_shift == 1) { - layer_on(MDIA); - } - } - } else { - if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { - unregister_code(KC_BSLS); - } else { - if(--mdia_shift < 0) mdia_shift = 0; - if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); - } - } - break; - - case RSpec: - if (record->event.pressed) { - if (record->tap.count && !record->tap.interrupted) { - register_code(KC_EQL); - } else { - layer_on(SPEC); - } - } else { - if(record->tap.count && !record->tap.interrupted) { - unregister_code(KC_EQL); - } else { - layer_off(SPEC); - } - } - break; - - // mouse diagonals - - case MUL: // mouse up left - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_LEFT); - mousekey_send(); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_LEFT); - mousekey_send(); - } - break; - - case MUR: // mouse up right - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_RIGHT); - mousekey_send(); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_RIGHT); - mousekey_send(); - } - break; - - case MDL: // mouse down left - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_LEFT); - mousekey_send(); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_LEFT); - mousekey_send(); - } - break; - - case MDR: // mouse down right - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_RIGHT); - mousekey_send(); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_RIGHT); - mousekey_send(); - } - break; - - default: - // none - break; - } - - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - // shift or caps lock turns on red light - if(caps_shift || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<\n\n\nTab"], -[{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], -[{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], -[{y:-0.875,x:5.5},"B",{x:6.5},"N"], -[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc"},"Z",{x:14.5},"?\n/",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], -[{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], -[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Home","End"], -[{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], -[{x:2},"Page\n\n\n\n\n\nDown"], -[{r:-30,rx:13,y:-1,x:-3},"Left","Right"], -[{x:-3},"Up",{h:2},"Enter",{h:2},"Space"], -[{x:-3},"Down"] - diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.png b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.png deleted file mode 100644 index 99e5ed80b..000000000 Binary files a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.txt b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.txt deleted file mode 100644 index 4eccc9f35..000000000 --- a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-media.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], -[{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], -[{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#ffb063"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#e6e067"},"Print\n\n\n\n\n\nScreen"], -[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#e6e067",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#ff0000",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], -[{y:-0.875,c:"#2277ff",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#e6e067"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#2277ff",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], -[{y:-0.75,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#ffb063"},"End",{x:1},"Page\n\n\n\n\n\nDown"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Mute",{x:6.5,c:"#737373",a:7},""], -[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#ffb063",fa:[0,0,0,1]},"Delete\n\n\nOption"], -[{y:-0.875,x:2.5,c:"#ff8500"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#ffb063"},"Insert\n\n\nCmd",{x:1,c:"#77aaff"},"Hyper"], -[{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Crtl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ccbb00"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], -[{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], -[{x:2},"Home\n\n\nBrowser"], -[{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], -[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ccbb00",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], -[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nDown"] - diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.png b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.png deleted file mode 100644 index 6eecf447e..000000000 Binary files a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.txt b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.txt deleted file mode 100644 index a08827c6d..000000000 --- a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-special.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], -[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#54d6de"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{h:1.5},"",{x:4.5,h:1.5},"",""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], -[{y:-0.375,x:3.5},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], -[{y:-0.625,x:6.5,h:1.5},"",{x:4.5,h:1.5},""], -[{y:-0.75,x:3.5},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{c:"#2277ff",w:1.5},"RShift"], -[{y:-0.375,x:3.5,c:"#cccccc"},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.75,x:0.5},"","",{x:14.5},"",""], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], -[{h:2},"",{h:2},"",""], -[{x:2},""], -[{r:-30,rx:13,y:-1,x:-3},"",""], -[{x:-3},"",{h:2},"",{h:2},""], -[{x:-3},""] - diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.png b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.png deleted file mode 100644 index e4de64a96..000000000 Binary files a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt b/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt deleted file mode 100644 index e199f5c59..000000000 --- a/keyboards/ergodox_ez/keymaps/ordinary/ordinary-symbol.txt +++ /dev/null @@ -1,27 +0,0 @@ -[{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], -[{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], -[{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], -[{y:-0.875,c:"#2277ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb"},"!",{x:14.5,c:"#89b087"},"/",{c:"#2277ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"(",{x:10.5,c:"#89b087"},"5"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], -[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#54d6de",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], -[{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], -[{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], -[{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], -[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb"},"%",{x:14.5,c:"#89b087"},"-",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},".\n\n\nOption"], -[{y:-0.875,x:2.5,c:"#77aaff"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0\n\n\nCmd",{x:1},"=\n\n\nHyper"], -[{y:-0.75,x:0.5,c:"#77aaff"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+\n\n\nMeh","Enter\n\n\nCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Left","Right"], -[{h:2},"Space",{h:2},"Enter","Up"], -[{x:2},"Down"], -[{r:-30,rx:13,y:-1,x:-3},"Home","End"], -[{x:-3},"Page\n\n\n\n\n\nUp",{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete"], -[{x:-3},"Page\n\n\n\n\n\nDown"] - diff --git a/keyboards/ergodox_ez/keymaps/ordinary/readme.md b/keyboards/ergodox_ez/keymaps/ordinary/readme.md deleted file mode 100644 index 6465cd79e..000000000 --- a/keyboards/ergodox_ez/keymaps/ordinary/readme.md +++ /dev/null @@ -1,103 +0,0 @@ -# The Ordinary Layout, a familiar and powerful layout # - -The Ordinary Layout is intended to be unremarkably mundane and remarkably useful. This layout maintains most key positions from common QWERTY keyboards, and it features enhanced Symbol and Media layers compared to the default Ergodox EZ layout. - -The Ordinary Layout is supposed to look mostly like a normal keyboard, except in the ways that the Ergodox key arrangement is unique. The thumbs are responsible for space, enter, plus both forward and backward delete; with only a couple exceptions, all other keys are in the same place they are found on traditional keyboards. - -Nicholas Keene -ordinarylayout@nicholaskeene.com -no rights reserved, use for any purposes, credit me if you are a nice person - -## The Base Layout ## - -* The light blue keys are modifiers: traditional Control, Option, and Command keys, plus Hyper and Meh -* The dark blue keys are Shift keys: Capitals Shift (traditional shift), Symbol Shift, and Media Shift; plus a Shift Lock key -* Several dark blue keys double for entry of characters which would typically be in those locations -* The turquoise keys are text navigation and manipulation -* The red keys is Escape and it is always found in that location no matter what - -![Ordinary base layout](ordinary-base.png) - -This layout puts the modifier keys along the bottom of the keyboard where they are on most keyboards. They are in the regular order, with the addition of Hyper and Meh keys. The modifier keys are all in the same place on all layers, although some layers also assign symbols on those buttons. On the outside edges are the Shift keys. The traditional shift key is called Capitals Shift and it is in the normal location. Above that are Symbols Shift and Media Shift. Each Shift key momentarily switches the layout to that layer, and if you use the Shift Lock button you can lock the layout to that layer. - -Touch typists will also find tilde, tab, equals/plus, slash/pipe, and quote/double-quote sharing space on those Shift keys where they would probably be on a common keyboard. Other than the turquoise keys the only buttons which move to new locations are the Brackets and Dash and Escape. Most touch typists dont touch-type brackets or dash anyway so only Escape really requires retraining of muscle memory, and see below for the Special Escape Sequence. - -The four big turquoise keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. - -The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. - -## The Symbols Layer ## - -* The light green keys are the eponymous symbols -* The bright green keys are F-Keys -* The dark green keys constitute a number pad -* The turquoise keys are the *reverse* of the turquoise keys on the base layer - -![Ordinary symbol layout](ordinary-symbol.png) - -The Ergodox EZ ships with the "Coder Layer" which I like to call the Symbols layer. There are some significant improvements in The Ordinary Layout over the default layout. - -The symbol keys are mostly the same as on the default layout, which did a good job in this regard, but with a few enhancements: - -* Angle brackets on this layer mean that curly, square, and angle brackets are all available on different layers of the same two buttons. Also, they mean that all kinds of brackets, including parentheses, are available on both the Base and Symbols layers. -* The slash, backslash, and pipe characters are grouped together as a memory aid. -* The & and | symbols are juxtaposed as a memory aid - -The number pad area here, in green, includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads, because this layout does not use a Num Lock key to switch the buttons between numeric keycodes and navigational keycodes. See the explanation in The Media Layout section about navigation using these same buttons. - -Finally, consider the turquoise text-nav keys. Here in the Symbols layer, these are *reversed* from the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. - -## The Media Layer ## - -* The dark orange keys on the left move the mouse cursor -* The dark orange keys on the right move the text cursor -* The light orange keys are for scrolling and paging -* The bright green keys are more F-keys -* The dark yellow keys signal Web and Audio applications -* The light yellow keys signal the operating system -* The dark gray keys do nothing in case you bump them by accident - -![Ordinary media layout](ordinary-media.png) - -This layer was inspired by the Media layer on the Ergodox EZ but takes it farther. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. - -Moreover, the orange keys on the right overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. - -Alas, the yellow keys have at best spotty success with common software. Good luck with those but don't expect too much. - -## Switching Between Layers ## - -In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. - -Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. If you press both of a pair of shift keys, the layer will lock on until you press both shift keys again. For instance, the widely and rightly loathed Caps Lock is engaged by pressing both Capitals Shift buttons. All the Shift keys work this way. - -Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. - -## Special Sequences ## - -![Ordinary special layout](ordinary-special.png) - -### Escape ### - -The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, whnich is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. - -The Ordinary layout offers as a consolation prize a Special sequence for Escape: Special Shift + 1. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. - -### Backspace ### - -At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence, using the 0 key, to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. - -### RShift ### - -The Ordinary Layout locks layers by pressing both of a pair of shift keys. This interferes with the QMK firmware magic sequence, which is LShift+RShift. To work around this, both of the Capitals Shift keys produce a *Left Shift* keystroke. If for some reason a person needs *Right Shift* they can find it by pressing a Special Shift key, then the Capitals Shift key on the right side of the keyboard. - -**** - -The Ordinary Layout for the Ergodox EZ keyboard, v4 - -Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com - -No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. - -Details: readme.md - https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary diff --git a/keyboards/ergodox_ez/keymaps/osx_de/keymap.c b/keyboards/ergodox_ez/keymaps/osx_de/keymap.c deleted file mode 100644 index 554813d7e..000000000 --- a/keyboards/ergodox_ez/keymaps/osx_de/keymap.c +++ /dev/null @@ -1,364 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_german_osx.h" - -#define BASE 0 -#define SYMB 1 -#define MDIA 2 -#define SMLY 3 -#define NUMB 4 -#define EGOS 5 - -#define M_CTRL_CMDV 0 -#define M_CTRL_CMDC 1 -#define M_MEH_SH_ACUT 2 -#define M_LGUI_SHFT 3 -#define M_CTL_SFT_HASH 4 -#define M_DE_OSX_CIRC_CTRLCMD 5 -#define M_DE_OSX_PLUS_CTRLALT 6 -#define SM_SMILE 7 -#define SM_SMIRK 8 -#define SM_CRY 9 -#define SM_SAD 10 -#define SM_HEART 11 -#define SM_LAUGH 12 -#define SM_KISS 13 -#define SM_FROWN 14 -#define M_TOGGLE_5 15 - -//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE]=KEYMAP( -//left half - KC_ESC, DE_OSX_1, DE_OSX_2, DE_OSX_3, DE_OSX_4, DE_OSX_5, M(M_CTL_SFT_HASH), - KC_TAB, DE_OSX_Q, DE_OSX_W, DE_OSX_E, DE_OSX_R, DE_OSX_T, KC_LGUI, - KC_LALT, DE_OSX_A, DE_OSX_S, DE_OSX_D, DE_OSX_F, DE_OSX_G, - KC_LSFT, CTL_T(DE_OSX_Y), DE_OSX_X, DE_OSX_C, DE_OSX_V, DE_OSX_B, KC_LALT, - LT(SYMB,DE_OSX_LESS), M(M_DE_OSX_CIRC_CTRLCMD), M(M_DE_OSX_PLUS_CTRLALT), KC_UP, KC_DOWN, - M(M_MEH_SH_ACUT), TG(MDIA), - KC_HOME, - KC_BSPC, KC_DEL, LT(SMLY,KC_END), - //right half - M(M_CTL_SFT_HASH), DE_OSX_6, DE_OSX_7, DE_OSX_8, DE_OSX_9, DE_OSX_0, DE_OSX_SS, - KC_RGUI, DE_OSX_Z, DE_OSX_U, DE_OSX_I, DE_OSX_O, DE_OSX_P, DE_OSX_UE, - DE_OSX_H, DE_OSX_J, DE_OSX_K, DE_OSX_L, DE_OSX_OE, ALT_T(DE_OSX_AE), - KC_RALT, DE_OSX_N, DE_OSX_M, DE_OSX_COMM, DE_OSX_DOT, CTL_T(DE_OSX_MINS), KC_RSFT, - KC_LEFT, KC_RIGHT, LGUI(KC_LSFT), LALT(KC_LSFT), LT(SYMB,DE_OSX_PLUS), - TG(NUMB), ALL_T(DE_OSX_ACUT), - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC), -[SYMB]=KEYMAP( -//left half - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, DE_OSX_QST, KC_TRNS, KC_TRNS, - KC_TRNS, DE_OSX_HASH, DE_OSX_DLR, DE_OSX_BSLS, DE_OSX_SLSH, KC_DOT, - KC_TRNS, KC_TRNS, DE_OSX_LESS, DE_OSX_PERC, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_DEL, KC_TRNS, - //right half - M(M_TOGGLE_5), KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, - DE_OSX_SLSH, DE_OSX_LPRN, DE_OSX_RPRN, LALT(KC_8), LALT(KC_9), DE_OSX_HASH, - KC_TRNS, DE_OSX_PIPE, DE_OSX_TILD, DE_OSX_CIRC, KC_UP, DE_OSX_MINS, LSFT(KC_4), - DE_OSX_QUOT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, - KC_F13, KC_F12, - KC_F14, - KC_F15, KC_TRNS, KC_TRNS), -[MDIA]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, - KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_VOLD, KC_TRNS, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK), -[SMLY]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS, - M(SM_HEART), M(SM_KISS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -[NUMB]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, DE_OSX_MINS, - KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS, - KC_0, KC_DOT, KC_COMM, DE_OSX_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -[EGOS]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F1, KC_F2, - KC_F3, - KC_SPC, KC_LCTL, KC_F4, - //right half - M(M_TOGGLE_5), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -static uint16_t start; -switch(id) { -case M_TOGGLE_5: -//Macro: M_TOGGLE_5//----------------------- - if (record->event.pressed){ - layer_state ^= (1<<5); - layer_state &= (1<<5); - } - -break; -case M_CTRL_CMDC: -//Macro: M_CTRL_CMDC//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),END); - } else { - return MACRO(U(LCTRL),D(LGUI),T(C),U(LGUI),END); - } - } - -break; -case M_DE_OSX_PLUS_CTRLALT: -//Macro: M_DE_OSX_PLUS_CTRLALT//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),D(LALT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LALT),END); - } else { - return MACRO(U(LCTRL),U(LALT),T(RBRC),END); - } - } - -break; -case SM_KISS: -//Macro: SM_KISS//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(RBRC),U(LSFT),END); - } - -break; -case SM_FROWN: -//Macro: SM_FROWN//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LALT),T(8),U(LALT),END); - } - -break; -case SM_CRY: -//Macro: SM_CRY//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END); - } - -break; -case SM_SMILE: -//Macro: SM_SMILE//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END); - } - -break; -case SM_SMIRK: -//Macro: SM_SMIRK//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(COMM),U(LSFT),T(SLSH),D(LSFT),T(9),U(LSFT),END); - } - -break; -case M_LGUI_SHFT: -//Macro: M_LGUI_SHFT//----------------------- -if (record->event.pressed){ - return MACRO(D(LGUI),D(LSFT),END); - }else{ - return MACRO(U(LGUI),U(LSFT),END); - } - -break; -case SM_HEART: -//Macro: SM_HEART//----------------------- -if (record->event.pressed) { - return MACRO(T(GRV),T(3),END); - } - -break; -case SM_LAUGH: -//Macro: SM_LAUGH//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(D),U(LSFT),END); - } - -break; -case M_CTL_SFT_HASH: -//Macro: M_CTL_SFT_HASH//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),D(LSFT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LSFT),END); - } else { - return MACRO(U(LCTRL),U(LSFT),T(BSLS),END); - } - } - -break; -case SM_SAD: -//Macro: SM_SAD//----------------------- -if (record->event.pressed) { - return MACRO(D(LSFT),T(DOT),U(LSFT),T(SLSH),D(LSFT),T(8),U(LSFT),END); - } - -break; -case M_DE_OSX_CIRC_CTRLCMD: -//Macro: M_DE_OSX_CIRC_CTRLCMD//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),D(LGUI),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LGUI),END); - } else { - return MACRO(U(LCTRL),U(LGUI),T(NUBS),END); - } - } - -break; -case M_CTRL_CMDV: -//Macro: M_CTRL_CMDV//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),END); - } else { - return MACRO(U(LCTRL),D(LGUI),T(V),U(LGUI),END); - } - } - -break; -case M_MEH_SH_ACUT: -//Macro: M_MEH_SH_ACUT//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(D(LCTRL),D(LSFT),D(LALT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LSFT),U(LALT),END); - } else { - return MACRO(U(LCTRL),U(LALT),T(EQL),U(LSFT),END); - } - } - -break; -} -return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -uint8_t layer = biton32(layer_state); - -ergodox_board_led_off(); -ergodox_right_led_1_off(); -ergodox_right_led_2_off(); -ergodox_right_led_3_off(); -switch (layer) { - - case SYMB: - ergodox_right_led_1_on(); - - - break; - case MDIA: - - ergodox_right_led_2_on(); - - break; - case SMLY: - - - ergodox_right_led_3_on(); - break; - case NUMB: - ergodox_right_led_1_on(); - - ergodox_right_led_3_on(); - break; - case EGOS: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; -default: -// none -break; -} - -}; - diff --git a/keyboards/ergodox_ez/keymaps/osx_de/osx_de_highres.png b/keyboards/ergodox_ez/keymaps/osx_de/osx_de_highres.png deleted file mode 100644 index d442a992c..000000000 Binary files a/keyboards/ergodox_ez/keymaps/osx_de/osx_de_highres.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/osx_de/readme.md b/keyboards/ergodox_ez/keymaps/osx_de/readme.md deleted file mode 100644 index 5011a9dd6..000000000 --- a/keyboards/ergodox_ez/keymaps/osx_de/readme.md +++ /dev/null @@ -1,41 +0,0 @@ -#Ergodox EZ für OSX - -Dies ist nur ein kleiner Tweak der bestehenden firmware für das ErgoDox-EZ-Keyboard. Leider passte das layout nicht wirklich für OSX, deswegen habe ich einige Anpassungen gemacht. Dabei wurden folgende features umgesetzt: - -- Die Umlaute sollten an einigermassen sinnvollen Plätzen liegen -- der Umstieg sollte dadurch erleichtert werden, dass einige Tasten an ihren "normalen" Platz zurückgewandert sind. Z.B. ESC, Tab,... -- die Leertaste ist jetzt auf der rechten seite, neben Enter. Dafür hat der linke Daumen nun Backspace und Delete. -- die CMD- und Alt-Tasten sind in der Mitte einfach erreichbar. -- es gibt eine neue Layer die für Spiele genutzt werden kann (egosooter wie Counter Strike). Dort liegen die wichtigsten Tasten auf der linken Seite, im Daumenblock z.B. space und ctrl sowie die F-Tasten 1-4. Diese Layer ist über die Symbollayer erreichbar. -- Die Symbollayer wurde dahingehend angepasst, dass die klammern, etc nun auf beiden hälften der Tastatur zu finden sind -- der Zehnerblock wurde in eine eigene Layer umgezogen -- die Meh und Hyper-Tasten wurden in die Daumenblöcke umgezogen - -# Erstellt Mit Dem ErgodoxLayoutGenerator - -Der ErgodoxLayoutGenerator ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein. -Die Dokumentation für den ELG kann man [hier](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/) nachlesen (momentan leider nur in Englisch verfügbar). - - - ------------------------------- - -# ErgoDox EZ for OSX - -This is only a little tweak of the existing default layout for the ErgoDox keyboard. Unfortunately the default layout did not work well with german OSX, so I created som adjustments. These were the features added and changed: - -- the umlaut-keys should be at their useful place more or less -- the switching should be made more easy so some other keys (like tab, esc) were moved to their default place -- the space key can now be used with both hands -- the CMD- and ALT-Keys moved to the middle, can be reached more easily. -- there is a new layer for using the cursor-keys, placed like on the default keyboard. This makes them useable for games also -- the symbollayer now has only symbols -- the number block was moved to a special layer -- meh and hyper went down to the thumb block - -# Created Using the ErgodoxLayoutGenerator - -The ErgodoxLayoutGenerator (ELG) is a little tool, which makes the creation and maintenance of keycaps a lot easier. It was written in Java and can be downloaded [here](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases). To use the tool, you need to have a current version of Oracles JDK installed. - -The documentation of the ELG can be viewed [here](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/). - diff --git a/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c b/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c deleted file mode 100644 index 687a5cb8b..000000000 --- a/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/keymap.c +++ /dev/null @@ -1,174 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#include "keymap_neo2.h" -#include "keymap_uk.h" -#include "keymap_colemak.h" -#include "keymap_french_osx.h" -#include "keymap_nordic.h" -#include "keymap_dvorak.h" -#include "keymap_german.h" -#include "keymap_norwegian.h" -#include "keymap_fr_ch.h" -#include "keymap_german_osx.h" -#include "keymap_spanish.h" -#include "keymap_bepo.h" - -#define BASE 0 -#define SYMB 1 -#define MDIA 2 -#define QWERTZ 3 -#define NUMB 4 - -#define UNUSED 0 - -//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE]=KEYMAP( -//left half - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LCTL, - KC_TAB, KC_K, KC_DOT, KC_O, KC_COMM, KC_Z, KC_LGUI, - TG(QWERTZ), KC_H, KC_A, KC_E, KC_I, KC_U, - KC_LSFT, CTL_T(KC_X), KC_Q, DE_AE, DE_UE, DE_OE, KC_LALT, - LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - TG(MDIA), MEH_T(LSFT(DE_ACUT)), - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - //right half - KC_RCTL, KC_6, KC_7, KC_8, KC_9, KC_0, DE_OSX_MINS, - KC_RGUI, KC_V, KC_G, KC_C, KC_L, KC_MINS, KC_Y, - KC_D, KC_T, KC_R, KC_N, KC_S, LT(MDIA,KC_F), - KC_RALT, KC_B, KC_P, KC_W, KC_M, CTL_T(KC_J), KC_RSFT, - KC_UP, KC_DOWN, LGUI(KC_LSFT), KC_RBRC, LT(SYMB,KC_BSLS), - ALL_T(DE_ACUT), TG(NUMB), - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC), -[SYMB]=KEYMAP( -//left half - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_GRV, LSFT(KC_GRV), DE_EXLM, DE_QST, KC_TRNS, KC_TRNS, - KC_TRNS, DE_HASH, DE_DLR, LALT(LSFT(KC_7)), DE_SLSH, KC_DOT, - KC_TRNS, KC_TRNS, DE_LESS, DE_PERC, LALT(KC_7), LALT(KC_N), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_DEL, KC_TRNS, - //right half - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, LALT(LSFT(KC_7)), LALT(KC_5), LALT(KC_6), LALT(KC_7), DE_HASH, KC_F12, - DE_SLSH, DE_LPRN, DE_RPRN, LALT(KC_8), LALT(KC_9), KC_TRNS, - KC_TRNS, DE_AMPR, KC_GRV, LSFT(KC_GRV), DE_DQOT, DE_QUOT, DE_QST, - KC_TRNS, KC_DOT, KC_EXLM, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -[MDIA]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_WH_L, KC_WH_U, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MUTE, KC_MPRV, KC_MNXT, KC_UP, KC_TRNS, - KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_RIGHT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK), -[QWERTZ]=KEYMAP( -//left half - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_V), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LGUI, - KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_LALT, - LT(SYMB,KC_GRV), DE_LESS, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - KC_TRNS, MEH_T(LSFT(DE_ACUT)), - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - //right half - LGUI(KC_C), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_RGUI, KC_Y, KC_U, KC_I, KC_O, KC_P, DE_UE, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(MDIA,DE_AE), - KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN, LGUI(KC_LSFT), KC_RBRC, LT(SYMB,KC_BSLS), - ALL_T(DE_ACUT), KC_TRNS, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC), -[NUMB]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, LSFT(KC_RBRC), KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_RBRC, KC_TRNS, - KC_TRNS, LSFT(KC_6), KC_1, KC_2, KC_3, LSFT(KC_7), KC_TRNS, - KC_0, KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -switch(id) { -case UNUSED: -//Macro: UNUSED//----------------------- - - - - - - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - - - -break; -} -return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -uint8_t layer = biton32(layer_state); - -ergodox_board_led_off(); -ergodox_right_led_1_off(); -ergodox_right_led_2_off(); -ergodox_right_led_3_off(); -switch (layer) { - -default: -// none -break; -} - -}; - diff --git a/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png b/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png deleted file mode 100644 index 193aa339e..000000000 Binary files a/keyboards/ergodox_ez/keymaps/osx_de_adnw_koy/osx_de_adnw_koy_highres.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/osx_de_experimental/keymap.c b/keyboards/ergodox_ez/keymaps/osx_de_experimental/keymap.c deleted file mode 100644 index 21d695894..000000000 --- a/keyboards/ergodox_ez/keymaps/osx_de_experimental/keymap.c +++ /dev/null @@ -1,597 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_neo2.h" -#include "keymap_uk.h" -#include "keymap_colemak.h" -#include "keymap_nordic.h" -#include "keymap_dvorak.h" -#include "keymap_german.h" -#include "keymap_norwegian.h" -#include "keymap_fr_ch.h" -#include "keymap_german_osx.h" -#include "keymap_spanish.h" -#include "keymap_bepo.h" - - -/** -* This layout was generated using the ErgodoxLayoutGenerator (ELG). You can download it from https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases -* documentation about it can be found here https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/ -* Thanks to the team of Erez Zukerman for building the great Ergodox-EZ! -* -* use at own risk! -**/ - -#define BASE 0 -#define SYMB 1 -#define MDIA 2 -#define SMLY 3 -#define NUMB 4 -#define EGOS 5 - -#define SMLY_TOG_QUOT 0 - -#define M_TOGGLE_5 1 - -#define TGH_NUM 2 - -#define M_DE_OSX_PLUS_CTRLALT 3 - -#define SM_KISS 4 - -#define SM_FROWN 5 - -#define SM_CRY 6 - -#define SM_SMILE 7 - -#define SM_SMIRK 8 - -#define M_LGUI_SHFT 9 - -#define SM_HEART 10 - -#define TOG_HLD_MDIA 11 - -#define SM_LAUGH 12 - -#define SM_SAD 13 - -#define M_DE_OSX_CIRC_CTRLCMD 14 - -#define M_MEH_SH_ACUT 15 - - -//Layout keymap.c generated with ErgodoxLayoutGenerator V1.0BETA1 -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/** -* Layer: BASE -* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ -* | ESC | 1 | 2 | 3 | 4 | 5 | Hold or toggle | | Hold or toggle | 6 | 7 | 8 | 9 | 0 | ß | -* | | | | | | | Layer NUMB | | Layer MDIA | | | | | | | -* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ -* | TAB | Q | W | E | R | T | Cmd | | Cmd | Z | U | I | O | P | Ãœ | -* | | | | | | | | | | | | | | | | -* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/\-------------------\ \-------------------\/-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ -* | Alt | A | S | D | F | G | | H | J | K | L | Ö | Ä | -* | | | | | | | | | | | | | ALT | -* /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------//-------------------//-------------------/ -* | Shift | Y | X | C | V | B | Alt | | Alt | N | M | , | . | - | Shift | -* | | Ctrl | | | | | | | | | | | | Ctrl | | -* \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ -* -* -* /-------------------//-------------------//-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------//-------------------//-------------------/ -* | < | LongPress / Type | LongPress / Type | Shift+Ctrl | Type | | # | ACUT | CMD+Shift | ALT+Shift | + | -* | SYMB | DE_OSX_CIRC_CTRLCMD| DE_OSX_PLUS_CTRAlt | | Toggle SMLY | | Meh | Hyper | | | SYMB | -* \-------------------\\-------------------\\-------------------\\-------------------\/-------------------//-------------------/ /-------------------//-------------------/ \-------------------\\-------------------\\-------------------\\-------------------\\-------------------\ -* | HOME | END | | LEFT | RIGHT | -* | | | | | | -* \-------------------\/-------------------/ /-------------------/\-------------------\ -* | PGUP | | UP | -* | | | | -* /-------------------//-------------------//-------------------/ /-------------------//-------------------//-------------------/ -* | BSPC | DEL | PGDN | | DOWN | ENT | SPC | -* | | | | | | | | -* \-------------------\\-------------------\\-------------------\ \-------------------\\-------------------\\-------------------\ -* -* -**/ -[BASE]=KEYMAP( -//left half - KC_ESC, DE_OSX_1, DE_OSX_2, DE_OSX_3, DE_OSX_4, DE_OSX_5, M(TGH_NUM), - KC_TAB, DE_OSX_Q, DE_OSX_W, DE_OSX_E, DE_OSX_R, DE_OSX_T, KC_LGUI, - KC_LALT, DE_OSX_A, DE_OSX_S, DE_OSX_D, DE_OSX_F, DE_OSX_G, - KC_LSFT, CTL_T(DE_OSX_Y), DE_OSX_X, DE_OSX_C, DE_OSX_V, DE_OSX_B, KC_LALT, - LT(SYMB,DE_OSX_LESS), M(M_DE_OSX_CIRC_CTRLCMD), M(M_DE_OSX_PLUS_CTRLALT), LSFT(KC_LCTRL), M(SMLY_TOG_QUOT), - KC_HOME, KC_END, - KC_PGUP, - KC_BSPC, KC_DEL, KC_PGDN, - //right half - M(TOG_HLD_MDIA), DE_OSX_6, DE_OSX_7, DE_OSX_8, DE_OSX_9, DE_OSX_0, DE_OSX_SS, - KC_RGUI, DE_OSX_Z, DE_OSX_U, DE_OSX_I, DE_OSX_O, DE_OSX_P, DE_OSX_UE, - DE_OSX_H, DE_OSX_J, DE_OSX_K, DE_OSX_L, DE_OSX_OE, ALT_T(DE_OSX_AE), - KC_RALT, DE_OSX_N, DE_OSX_M, DE_OSX_COMM, DE_OSX_DOT, CTL_T(DE_OSX_MINS), KC_RSFT, - MEH_T(DE_OSX_HASH), ALL_T(DE_OSX_ACUT), LGUI(KC_LSFT), LALT(KC_LSFT), LT(SYMB,DE_OSX_PLUS), - KC_LEFT, KC_RIGHT, - KC_UP, - KC_DOWN, KC_ENT, KC_SPC), -/** -* Layer: SYMB -* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ -* | APPLICATION| F1 | F2 | F3 | F4 | F5 | F5 | | F6 | F6 | F7 | F8 | F9 | F10 | F11 | -* | | | | | | | | | | | | | | | | -* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ -* | | < | > | ! | ? | | | | | \ | [ | ] | < | > | ! | -* | | | | | | | | | | | | | | | | -* /-----------//-----------//-----------//-----------//-----------//-----------/\-----------\ \-----------\/-----------//-----------//-----------//-----------//-----------//-----------/ -* | | # | $ | \ | / | . | | / | ( | ) | { | } | # | -* | | | | | | | | | | | | | | -* /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------//-----------//-----------/ -* | | | < | % | | | ~ | | | | | | ~ | | | | | -* | | | | | | | | | | | | | | | | -* \-----------\\-----------\\-----------\\-----------\\-----------\\-----------\\-----------\ \-----------\\-----------\\-----------\\-----------\\-----------\\-----------\\-----------\ -* -* -* /-----------//-----------//-----------//-----------//-----------/ /-----------//-----------//-----------//-----------//-----------/ -* | | | | | | | ' | DQOT | | Toggle 5 | | -* | | | | | | | | | | | | -* \-----------\\-----------\\-----------\\-----------\/-----------//-----------/ /-----------//-----------/ \-----------\\-----------\\-----------\\-----------\\-----------\ -* | | | | F13 | F12 | -* | | | | | | -* \-----------\/-----------/ /-----------/\-----------\ -* | | | F14 | -* | | | | -* /-----------//-----------//-----------/ /-----------//-----------//-----------/ -* | | DEL | | | F15 | | | -* | | | | | | | | -* \-----------\\-----------\\-----------\ \-----------\\-----------\\-----------\ -* -* -**/ -[SYMB]=KEYMAP( -//left half - KC_APPLICATION, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F5, - KC_TRNS, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, DE_OSX_QST, KC_TRNS, KC_TRNS, - KC_TRNS, DE_OSX_HASH, DE_OSX_DLR, DE_OSX_BSLS, DE_OSX_SLSH, KC_DOT, - KC_TRNS, KC_TRNS, DE_OSX_LESS, DE_OSX_PERC, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_DEL, KC_TRNS, - //right half - KC_F6, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, DE_OSX_BSLS, DE_OSX_LBRC, DE_OSX_RBRC, DE_OSX_LESS, DE_OSX_MORE, DE_OSX_EXLM, - DE_OSX_SLSH, DE_OSX_LPRN, DE_OSX_RPRN, DE_OSX_LCBR, DE_OSX_RCBR, DE_OSX_HASH, - KC_TRNS, DE_OSX_PIPE, DE_OSX_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - DE_OSX_QUOT, DE_OSX_DQOT, KC_TRNS, M(M_TOGGLE_5), KC_TRNS, - KC_F13, KC_F12, - KC_F14, - KC_F15, KC_TRNS, KC_TRNS), -/** -* Layer: MDIA -* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ -* | | | BTN1 | U | BTN2 | U | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* /-----//-----//-----//-----//-----//-----/\-----\ \-----\/-----//-----//-----//-----//-----//-----/ -* | | | L | D | R | D | | | | | | | | -* | | | | | | | | | | | | | | -* /-----//-----//-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----//-----//-----/ -* | | | L | D | R | BTN3 | | | | | | | | UP | | -* | | | | | | | | | | | | | | | | -* \-----\\-----\\-----\\-----\\-----\\-----\\-----\ \-----\\-----\\-----\\-----\\-----\\-----\\-----\ -* -* -* /-----//-----//-----//-----//-----/ /-----//-----//-----//-----//-----/ -* | | | | | | | | | LEFT | DOWN | RIGHT| -* | | | | | | | | | | | | -* \-----\\-----\\-----\\-----\/-----//-----/ /-----//-----/ \-----\\-----\\-----\\-----\\-----\ -* | | | | MPRV | MNXT | -* | | | | | | -* \-----\/-----/ /-----/\-----\ -* | | | VOLU | -* | | | | -* /-----//-----//-----/ /-----//-----//-----/ -* | | | | | VOLD | MUTE | MPLY | -* | | | | | | | | -* \-----\\-----\\-----\ \-----\\-----\\-----\ -* -* -**/ -[MDIA]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, - KC_TRNS, KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, - KC_MPRV, KC_MNXT, - KC_VOLU, - KC_VOLD, KC_MUTE, KC_MPLY), -/** -* Layer: SMLY -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | Typing | Typing | Typing | | | | | -* | | | | | | | | | SM_SMILE| SM_SMIRK| SM_LAUGH| | | | | -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | Typing | Typing | Typing | | | | -* | | | | | | | | | | SM_FROWN| SM_SAD | SM_CRY | | | | -* /--------//--------//--------//--------//--------//--------/\--------\ \--------\/--------//--------//--------//--------//--------//--------/ -* | | | | | | | | Typing | Typing | | | | | -* | | | | | | | | SM_HEART| SM_KISS | | | | | -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* \--------\\--------\\--------\\--------\\--------\\--------\\--------\ \--------\\--------\\--------\\--------\\--------\\--------\\--------\ -* -* -* /--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | -* | | | | | | | | | | | | -* \--------\\--------\\--------\\--------\/--------//--------/ /--------//--------/ \--------\\--------\\--------\\--------\\--------\ -* | | | | | | -* | | | | | | -* \--------\/--------/ /--------/\--------\ -* | | | | -* | | | | -* /--------//--------//--------/ /--------//--------//--------/ -* | | | | | | | | -* | | | | | | | | -* \--------\\--------\\--------\ \--------\\--------\\--------\ -* -* -**/ -[SMLY]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - M(SM_SMILE), M(SM_SMIRK), M(SM_LAUGH), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(SM_FROWN), M(SM_SAD), M(SM_CRY), KC_TRNS, KC_TRNS, KC_TRNS, - M(SM_HEART), M(SM_KISS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -/** -* Layer: NUMB -* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ -* | | | | | | | | | | F6 | F7 | F8 | F9 | F10 | F11 | -* | | | | | | | | | | | | | | | | -* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ -* | | | | UP | | | | | | / | 7 | 8 | 9 | * | F12 | -* | | | | | | | | | | | | | | | | -* /----//----//----//----//----//----/\----\ \----\/----//----//----//----//----//----/ -* | | | LEFT| DOWN| RGHT| | | / | 4 | 5 | 6 | + | - | -* | | | | | | | | | | | | | | -* /----//----//----//----//----//----//----/ /----//----//----//----//----//----//----/ -* | | | | | | | | | | % | 1 | 2 | 3 | | | -* | | | | | | | | | | | | | | | | -* \----\\----\\----\\----\\----\\----\\----\ \----\\----\\----\\----\\----\\----\\----\ -* -* -* /----//----//----//----//----/ /----//----//----//----//----/ -* | | | | | | | 0 | . | , | = | | -* | | | | | | | | | | | | -* \----\\----\\----\\----\/----//----/ /----//----/ \----\\----\\----\\----\\----\ -* | | | | | | -* | | | | | | -* \----\/----/ /----/\----\ -* | | | | -* | | | | -* /----//----//----/ /----//----//----/ -* | | | | | | | | -* | | | | | | | | -* \----\\----\\----\ \----\\----\\----\ -* -* -**/ -[NUMB]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - //right half - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, DE_OSX_SLSH, KC_7, KC_8, KC_9, DE_OSX_ASTR, KC_F12, - DE_OSX_SLSH, KC_4, KC_5, KC_6, DE_OSX_PLUS, DE_OSX_MINS, - KC_TRNS, DE_OSX_PERC, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, - KC_0, KC_DOT, KC_COMM, DE_OSX_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -/** -* Layer: EGOS -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* /--------//--------//--------//--------//--------//--------/\--------\ \--------\/--------//--------//--------//--------//--------//--------/ -* | Shift | | | | | | | | | | | | | -* | | | | | | | | | | | | | | -* /--------//--------//--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------//--------//--------/ -* | | | | | | | | | | | | | | | | -* | | | | | | | | | | | | | | | | -* \--------\\--------\\--------\\--------\\--------\\--------\\--------\ \--------\\--------\\--------\\--------\\--------\\--------\\--------\ -* -* -* /--------//--------//--------//--------//--------/ /--------//--------//--------//--------//--------/ -* | Ctrl | | | | | | | | | Toggle 5| | -* | | | | | | | | | | | | -* \--------\\--------\\--------\\--------\/--------//--------/ /--------//--------/ \--------\\--------\\--------\\--------\\--------\ -* | F1 | F2 | | | | -* | | | | | | -* \--------\/--------/ /--------/\--------\ -* | F3 | | | -* | | | | -* /--------//--------//--------/ /--------//--------//--------/ -* | SPC | Ctrl | F4 | | | | | -* | | | | | | | | -* \--------\\--------\\--------\ \--------\\--------\\--------\ -* -* -**/ -[EGOS]=KEYMAP( -//left half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F1, KC_F2, - KC_F3, - KC_SPC, KC_LCTL, KC_F4, - //right half - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, M(M_TOGGLE_5), KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -static uint16_t start; -switch(id) { -case SMLY_TOG_QUOT: -//Macro: SMLY_TOG_QUOT//----------------------- -if (record->event.pressed) { - start = timer_read(); - layer_state ^= (1<150) { - return MACRO_NONE; - } else { - return MACRO(DOWN(KC_LSFT),TYPE(DE_OSX_HASH),UP(KC_LSFT),END); - } - } - -break; -case M_TOGGLE_5: -//Macro: M_TOGGLE_5//----------------------- - if (record->event.pressed){ - layer_state ^= (1<<5); - layer_state &= (1<<5); - } - -break; -case TGH_NUM: -//Macro: TGH_NUM//----------------------- -if (record->event.pressed){ - start = timer_read(); - layer_state ^=(1< 150) { - layer_state^=(1<event.pressed) { - start = timer_read(); - return MACRO(DOWN(KC_LCTRL),DOWN(KC_LALT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LALT),END); - } else { - return MACRO(UP(KC_LCTRL),UP(KC_LALT),TYPE(KC_RBRC),END); - } - } - -break; -case SM_KISS: -//Macro: SM_KISS//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_RBRC),UP(KC_LSFT),END); - } - -break; -case SM_FROWN: -//Macro: SM_FROWN//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LALT),TYPE(KC_8),UP(KC_LALT),END); - } - -break; -case SM_CRY: -//Macro: SM_CRY//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_COMM),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_8),UP(KC_LSFT),END); - } - -break; -case SM_SMILE: -//Macro: SM_SMILE//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_9),UP(KC_LSFT),END); - } - -break; -case SM_SMIRK: -//Macro: SM_SMIRK//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_COMM),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_9),UP(KC_LSFT),END); - } - -break; -case M_LGUI_SHFT: -//Macro: M_LGUI_SHFT//----------------------- -if (record->event.pressed){ - return MACRO(DOWN(KC_LGUI),DOWN(KC_LSFT),END); - }else{ - return MACRO(UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),UP(KC_LGUI),UP(KC_LSFT),U(LGUI),U(LSFT),END); - } - -break; -case SM_HEART: -//Macro: SM_HEART//----------------------- -if (record->event.pressed) { - return MACRO(TYPE(KC_GRV),TYPE(KC_3),END); - } - -break; -case TOG_HLD_MDIA: -//Macro: TOG_HLD_MDIA//----------------------- -if (record->event.pressed){ - start = timer_read(); - layer_state ^=(1< 150) { - layer_state^=(1<event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_D),UP(KC_LSFT),END); - } - -break; -case SM_SAD: -//Macro: SM_SAD//----------------------- -if (record->event.pressed) { - return MACRO(DOWN(KC_LSFT),TYPE(KC_DOT),UP(KC_LSFT),TYPE(KC_SLSH),DOWN(KC_LSFT),TYPE(KC_8),UP(KC_LSFT),END); - } - -break; -case M_DE_OSX_CIRC_CTRLCMD: -//Macro: M_DE_OSX_CIRC_CTRLCMD//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(DOWN(KC_LCTRL),DOWN(KC_LGUI),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LGUI),END); - } else { - return MACRO(UP(KC_LCTRL),UP(KC_LGUI),TYPE(KC_NUBS),END); - } - } - -break; -case M_MEH_SH_ACUT: -//Macro: M_MEH_SH_ACUT//----------------------- -if (record->event.pressed) { - start = timer_read(); - return MACRO(DOWN(KC_LCTRL),DOWN(KC_LSFT),DOWN(KC_LALT),END); - } else { - if (timer_elapsed(start) >150) { - return MACRO(U(LCTRL),U(LSFT),U(LALT),END); - } else { - return MACRO(UP(KC_LCTRL),UP(KC_LALT),TYPE(DE_OSX_ACUT),UP(KC_LSFT),END); - } - } - -break; -} -return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -uint8_t layer = biton32(layer_state); - -ergodox_board_led_off(); -ergodox_right_led_1_off(); -ergodox_right_led_2_off(); -ergodox_right_led_3_off(); -switch (layer) { - - case SYMB: - ergodox_right_led_1_on(); - - - break; - case MDIA: - - ergodox_right_led_2_on(); - - break; - case NUMB: - - - ergodox_right_led_3_on(); - break; - case EGOS: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - break; -default: -// none -break; -} - -}; - diff --git a/keyboards/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental_highres.png b/keyboards/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental_highres.png deleted file mode 100644 index 031d874a7..000000000 Binary files a/keyboards/ergodox_ez/keymaps/osx_de_experimental/osx_de_experimental_highres.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/osx_de_experimental/readme.md b/keyboards/ergodox_ez/keymaps/osx_de_experimental/readme.md deleted file mode 100644 index e6a101841..000000000 --- a/keyboards/ergodox_ez/keymaps/osx_de_experimental/readme.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Ergodox und Ergodox-EZ experimentelles Layout - -dieses layout ist experimentell und wird im Lufe der Zeit viele Änderungen und Verbesserungen durchlaufen. Falls diese sich als vorteilhaft erweisen, werden sie evtl. auch in das `osx_de` layout übernommen. - - - -# Erstellt Mit Dem ErgodoxLayoutGenerator - -Der ErgodoxLayoutGenerator (ELG) ist ein kleines Werkzeug, welches die Erstellung und Pflege der eigenen Keymaps erleichtern soll. Es ist in java geschrieben und kann [hier](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases) heruntergeladen werden. Damit das Tool funktioniert sollte das offizielle Oracle JDK in aktueller Version installiert sein. -Die Dokumentation für den ELG kann man [hier](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/) nachlesen (momentan leider nur in Englisch verfügbar). ---------------------------------------------------------------------------------------------------------------------- - -# Ergodox and Ergodox-EZ experimental layout - -This is an experimental layout which will undergo heavy changes over time. If changes prove to be good, they might also move into the `osx_de` layout. - -Created Using the ErgodoxLayoutGenerator - -The ErgodoxLayoutGenerator (ELG) is a little tool, which makes the creation and maintenance of keycaps a lot easier. It was written in Java and can be downloaded [here](https://github.com/sboesebeck/ErgodoxLayoutGenerator/releases). To use the tool, you need to have a current version of Oracles JDK installed. - -The documentation of the ELG can be viewed [here](https://boesebeck.name/2016/04/16/ergodoxlayoutgenerator-documentation/). \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/osx_fr/keymap.c b/keyboards/ergodox_ez/keymaps/osx_fr/keymap.c deleted file mode 100644 index de951666d..000000000 --- a/keyboards/ergodox_ez/keymaps/osx_fr/keymap.c +++ /dev/null @@ -1,187 +0,0 @@ -// French AZERTY version of the default_osx file -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_french_osx.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | - | & | é | " | ' | ( | LEFT | | RIGHT| § | è | ! | ç | à | ) | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | A | Z | E | R | T | L1 | | L1 | Y | U | I | O | P | ` | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | Q | S | D | F | G |------| |------| H | J | K | L | M | LGui | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |W/Ctrl| X | C | V | B | | | | N | , |; / L2| : |=/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | ù /L1| < |AltShf| Left | Right| | Up | Down | ^ | $ | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - FR_MINS, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_LEFT, - KC_DELT, FR_A, FR_Z, KC_E, KC_R, KC_T, TG(1), - KC_BSPC, FR_Q, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(FR_W), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,FR_UGRV), FR_LESS, LALT(KC_LSFT), KC_LEFT, KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC, KC_BSPC, KC_END, - - // right hand - KC_RGHT, FR_SECT, FR_EGRV, FR_EXLM, FR_CCED, FR_AGRV, FR_RPRN, - TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, FR_GRV, - KC_H, KC_J, KC_K, KC_L, FR_M, KC_LGUI, - MEH_T(KC_NO), KC_N, FR_COMM, LT(MDIA, FR_SCLN), FR_COLN, CTL_T(FR_EQL), KC_RSFT, - KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN, KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | , | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,FR_EXLM,FR_AT, FR_LCBR,FR_RCBR,FR_PIPE,KC_TRNS, - KC_TRNS,FR_HASH,FR_DLR, FR_LPRN,FR_RPRN,FR_GRV, - KC_TRNS,FR_PERC,FR_CIRC,FR_LBRC,FR_RBRC,FR_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, FR_7, FR_8, FR_9, FR_ASTR, KC_F12, - KC_DOWN, FR_4, FR_5, FR_6, FR_PLUS, KC_TRNS, - KC_TRNS, FR_AMP, FR_1, FR_2, FR_3, FR_BSLS, KC_TRNS, - KC_TRNS,FR_COMM, FR_0, FR_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c b/keyboards/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c deleted file mode 100644 index 1032be549..000000000 --- a/keyboards/ergodox_ez/keymaps/osx_kinesis_pnut/keymap.c +++ /dev/null @@ -1,191 +0,0 @@ -// Netable differences vs. the default firmware for the ErgoDox EZ: -// 1. The Cmd key is now on the right side, making Cmd+Space easier. -// 2. The media keys work on OSX (But not on Windows). -// Wanted to map default layer of my EZ to my existing Kinesis Mapping. -// Only default layer was remapped all others layers are standard Ergodox EZ -// Very personal mapping of-course, but who knows a starting point for others. - -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | CapsL | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ESC | A | S | D | F | G |------| |------| H | J | K | L |; / L2| '" | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |AltShf|Grv/L1| '" | Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LGui | App | | Ctrl/Esc | RGui | - * ,------|------|------| |------+--------+------. - * | | | Home | | = | | | - * | Backs|Delete|------| |------| Enter |Space | - * | pace | | End | | TAB | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_CAPSLOCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LALT(KC_LSFT), LT(SYMB,KC_GRV),KC_QUOT,KC_LEFT,KC_RGHT, - KC_LGUI, ALT_T(KC_APP), - KC_HOME, - KC_BSPC,KC_DELT,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOTE, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - CTL_T(KC_ESC), KC_LGUI, - KC_EQL, - KC_TAB, KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/plover/keymap.c b/keyboards/ergodox_ez/keymaps/plover/keymap.c deleted file mode 100644 index 8a58a37f6..000000000 --- a/keyboards/ergodox_ez/keymaps/plover/keymap.c +++ /dev/null @@ -1,228 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys -#define PLVR 3 // Plover layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LGui | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | L1 | |Plover| Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Esc | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | Home | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | End | | PgUp | | | - * |Backsp|Delete|------| |------| Enter |Space | - * | ace | | LAlt | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LGUI, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_HOME, - KC_END, - KC_BSPC,KC_DELT,KC_LALT, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(3), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Fwd |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), - -/* Keymap 4: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | c | v |------| |------| n | m | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[PLVR] = KEYMAP( // layout: layer 4: Steno for Plover - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_FN4, KC_NO, - KC_NO, - KC_C, KC_V, KC_NO, - // right hand - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/plums/keymap.c b/keyboards/ergodox_ez/keymaps/plums/keymap.c deleted file mode 100644 index 46eb2e42b..000000000 --- a/keyboards/ergodox_ez/keymaps/plums/keymap.c +++ /dev/null @@ -1,229 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | F5 | |Hypr+M| 6 | 7 | 8 | 9 | 0 | Mute | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | LGui | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| SYMB | | MDIA |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Ca/Ctl| { | ( | | | : | | - | = | ) | } |C`/Ctl| - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LGA | LAlt | | RAlt | Play | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * |Backsp| Esc |------| |------|Enter |Space | - * |ace | | End | | PgDn | | | - * `--------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(SYMB), - F(0), KC_LCBR, KC_LPRN,KC_PIPE,KC_COLN, - LGUI(KC_LALT), KC_LALT, - KC_HOME, - KC_BSPC, KC_ESC, KC_END, - // right hand - HYPR(KC_M), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MUTE, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - TG(MDIA), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_MINS, KC_EQL, KC_RPRN, KC_RCBR, F(1), - KC_RALT, KC_MPLY, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | | | | | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Left | Down | Up | Right| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F12, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------|MsLeft|MsDown| MsUp |MsRght| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |VolUp |VolDn | Prev | Next | | | LClk | RClk | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MPRV, KC_MNXT, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_MACRO_TAP(0), // FN0 - Ctrl + a (For screen/tmux) - [1] = ACTION_MACRO_TAP(1) // FN1 - Ctrl + ` (For quake style console) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. -{ - switch(id) { - case 0: - if (record->event.pressed) { - if (record->tap.count) { - if (record->tap.interrupted) { - record->tap.count = 0; - // hold press action - register_code(KC_LCTL); - } else { - // tap press action - return MACRO( D(LCTL), T(A), U(LCTL), END ); - } - } else { - // hold press action - register_code(KC_LCTL); - } - } else { - if (record->tap.count) { - // tap release action - } else { - // hold release action - unregister_code(KC_LCTL); - } - record->tap.count = 0; - } - break; - case 1: - if (record->event.pressed) { - if (record->tap.count) { - if (record->tap.interrupted) { - record->tap.count = 0; - // hold press action - register_code(KC_RCTL); - } else { - // tap press action - return MACRO( DOWN(KC_RCTL), TYPE(KC_GRV), UP(KC_RCTL), END ); - } - } else { - // hold press action - register_code(KC_RCTL); - } - } else { - if (record->tap.count) { - // tap release action - } else { - // hold release action - unregister_code(KC_RCTL); - } - record->tap.count = 0; - } - break; - } - return MACRO_NONE; -}; - - - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/plums/plums.png b/keyboards/ergodox_ez/keymaps/plums/plums.png deleted file mode 100644 index 2f127c4ca..000000000 Binary files a/keyboards/ergodox_ez/keymaps/plums/plums.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/plums/readme.md b/keyboards/ergodox_ez/keymaps/plums/readme.md deleted file mode 100644 index b72329eef..000000000 --- a/keyboards/ergodox_ez/keymaps/plums/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# ErgoDox EZ Plums Configuration - -## Changelog - -* Apr 23, 2016 (v0.1.0): - * Shortcut for iTerm2 quake style dropdown (Ctrl+`) - * Shortcut for screen/tmux (Ctrl+a) - * Shortcut for shush (Hyper+m) - * Combo modifier for LGUI + LALT - -![Plums](plums.png) diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c deleted file mode 100644 index a66971bef..000000000 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/keymap.c +++ /dev/null @@ -1,46 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = KEYMAP( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_BSLS, - CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_F1, KC_F2, KC_F3, KC_F4, KC_LGUI, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_LALT, - // - /*-*/ KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - /*-*/ KC_NO, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, - /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, - /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - /*-*/ /*-*/ /*-*/ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - KC_MPLY, KC_MNXT, - KC_MPRV, - KC_RALT, KC_QUOT, KC_SPC - ) -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { -}; diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/readme.md b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/readme.md deleted file mode 100644 index 80475ab21..000000000 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -# Roman's Layout - -There is only one layer based on [Norman layout](https://normanlayout.info/). - -Looking for multiple-layer layouts? - -- [Symbols, arrows, plover, HJKL arrows](../romanzolotarev-norman-plover-osx-hjkl/) -- [Same with IJKL arrows](../romanzolotarev-norman-plover-osx/) - -[![keyboard-layout](romanzolotarev-norman-osx.png)](http://www.keyboard-layout-editor.com/#/gists/9e89d54f1ea6eeeb7dab1b2d19d28195) - -## Functional Keys - -- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). -- Tap `F2` to copy screenshot to the clipboard. -- Hold `SHIFT` and tap `F2` to save screenshot as a file. -- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). - -## CTRL/ESC - -CTRL and ESC are frequently used in Vim. - -- Tap `CTRL/ESC` to send `ESC`. -- Hold `CTRL/ESC` to use as `CTRL`. - -## Activate N-rollover - -- Hold left `SHIFT` and right `SHIRT` and then tap `N`. diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png deleted file mode 100644 index 4b9433be2..000000000 Binary files a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-osx/romanzolotarev-norman-osx.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c deleted file mode 100644 index 7c9f67381..000000000 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c +++ /dev/null @@ -1,134 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 -#define SYMB 1 -#define PLVR 2 -#define ARRW 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = KEYMAP( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, TG(PLVR), - CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_FN1, - // - /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, - /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, - /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, - KC_MPLY, KC_MNXT, - KC_MPRV, - KC_FN3, KC_QUOT, KC_SPC - ), - [SYMB] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - /*-*/ /*-*/ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - [PLVR] = KEYMAP( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_C, KC_V, KC_NO, - // - /*-*/ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - /*-*/ KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, - /*-*/ /*-*/ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - /*-*/ KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - /*-*/ /*-*/ /*-*/ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M - ), - [ARRW] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [SYMB] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Symbols Layer - [PLVR] = ACTION_LAYER_TAP_TOGGLE(PLVR), // FN2 - Momentary Plover Layer - [ARRW] = ACTION_LAYER_TAP_TOGGLE(ARRW), // FN3 - Momentary Arrows Layer -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case PLVR: - ergodox_right_led_2_on(); - break; - case ARRW: - ergodox_right_led_3_on(); - break; - default: - break; - } -}; diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md deleted file mode 100644 index 16cebd091..000000000 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# Roman's Layout - -There are four layers: - -- **BASE** is [Norman layout](https://normanlayout.info/). -- **SYMB** for numbers and symbols. -- **PLVR** is optimized for [Plover](http://www.openstenoproject.org). -- **ARRW** for navigation (same fingers for arrows as HJKL on QWERTY). - -Looking for IJKL arrows? [Here we -go](../romanzolotarev-norman-plover-osx/). - -[![keyboard-layout](romanzolotarev-norman-plover-osx-hjkl.png)](http://www.keyboard-layout-editor.com/#/gists/56ffedceb0668dda47c993e7271563e0) - -## Switching - -- Tap `SYMB` to toggle **SYMB**. -- Tap `ARRW` to toggle **ARRW**. -- Hold `SYMB` (or `ARRW`) to activate **SYMB** (or **ARRW**) while holding. -- Tap `PLVR` to toggle **PLVR**. - -## LEDs - -- Red: SYMB is on. -- Green: PLVR is on. -- Blue: ARRW is on. - -## Functional Keys - -- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). -- Tap `F2` to copy screenshot to the clipboard. -- Hold `SHIFT` and tap `F2` to save screenshot as a file. -- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). -- Tap `F14`, `F15` to adjust display brightness. - -**IMPORTANT**: If you have another keyboard connected via Bluetooth, then -`F14` and `F15` will not work. Turn off that Bluetooth keyboard. Re-plug -you ErgoDox. Enjoy! - -## CTRL/ESC - -Both of those keys are frequently used in Vim. - -- Tap `CTRL/ESC` to send `ESC`. -- Hold `CTRL/ESC` to use as `CTRL`. - -## Activate N-rollover - -- While in **BASE** hold left `SHIFT` and right `SHIRT` and then tap `N`. -- Then you can activate **PLVR** and use ErgoDox EZ for steno. diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png deleted file mode 100644 index cdc535f79..000000000 Binary files a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx-hjkl/romanzolotarev-norman-plover-osx-hjkl.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c deleted file mode 100644 index 9971b834c..000000000 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/keymap.c +++ /dev/null @@ -1,134 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 -#define SYMB 1 -#define PLVR 2 -#define ARRW 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = KEYMAP( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, TG(PLVR), - CTL_T(KC_ESC), KC_A, KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_F1, KC_F2, KC_F3, KC_LALT, KC_LGUI, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_FN1, - // - /*-*/ KC_F15, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - /*-*/ KC_BSLS, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, - /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, - /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - /*-*/ /*-*/ /*-*/ KC_RGUI, KC_RALT, KC_F4, KC_F5, KC_F6, - KC_MPLY, KC_MNXT, - KC_MPRV, - KC_FN3, KC_QUOT, KC_SPC - ), - [SYMB] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - /*-*/ /*-*/ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), - [PLVR] = KEYMAP( - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_C, KC_V, KC_NO, - // - /*-*/ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - /*-*/ KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, - /*-*/ /*-*/ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - /*-*/ KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - /*-*/ /*-*/ /*-*/ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_NO, KC_N, KC_M - ), - [ARRW] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - [SYMB] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Symbols Layer - [PLVR] = ACTION_LAYER_TAP_TOGGLE(PLVR), // FN2 - Momentary Plover Layer - [ARRW] = ACTION_LAYER_TAP_TOGGLE(ARRW), // FN3 - Momentary Arrows Layer -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case SYMB: - ergodox_right_led_1_on(); - break; - case PLVR: - ergodox_right_led_2_on(); - break; - case ARRW: - ergodox_right_led_3_on(); - break; - default: - break; - } -}; diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md deleted file mode 100644 index 804c52a76..000000000 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/readme.md +++ /dev/null @@ -1,50 +0,0 @@ -# Roman's Layout - -There are four layers: - -- **BASE** is [Norman layout](https://normanlayout.info/). -- **SYMB** for numbers and symbols. -- **PLVR** is optimized for [Plover](http://www.openstenoproject.org). -- **ARRW** for navigation (same fingers for arrows as IJKL on QWERTY). - -Looking for HJKL arrows? [Here we -go](../romanzolotarev-norman-plover-osx-hjkl/). - -[![keyboard-layout](romanzolotarev-norman-plover-osx.png)](http://www.keyboard-layout-editor.com/#/gists/8ebcb701ecb763944417) - -## Switching - -- Tap `SYMB` to toggle **SYMB**. -- Tap `ARRW` to toggle **ARRW**. -- Hold `SYMB` (or `ARRW`) to activate **SYMB** (or **ARRW**) while holding. -- Tap `PLVR` to toggle **PLVR**. - -## LEDs - -- Red: SYMB is on. -- Green: PLVR is on. -- Blue: ARRW is on. - -## Functional Keys - -- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). -- Tap `F2` to copy screenshot to the clipboard. -- Hold `SHIFT` and tap `F2` to save screenshot as a file. -- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). -- Tap `F14`, `F15` to adjust display brightness. - -**IMPORTANT**: If you have another keyboard connected via Bluetooth, then -`F14` and `F15` will not work. Turn off that Bluetooth keyboard. Re-plug -you ErgoDox. Enjoy! - -## CTRL/ESC - -Both of those keys are frequently used in Vim. - -- Tap `CTRL/ESC` to send `ESC`. -- Hold `CTRL/ESC` to use as `CTRL`. - -## Activate N-rollover - -- While in **BASE** hold left `SHIFT` and right `SHIRT` and then tap `N`. -- Then you can activate **PLVR** and use ErgoDox EZ for steno. diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png deleted file mode 100644 index 10b0752be..000000000 Binary files a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-plover-osx/romanzolotarev-norman-plover-osx.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c deleted file mode 100644 index dedac694e..000000000 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c +++ /dev/null @@ -1,74 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 -#define QWRT 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = KEYMAP( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, - KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_BSLS, - KC_LCTL, KC_A, KC_S, KC_E, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, - KC_F1, KC_F2, KC_F3, KC_F4, KC_LGUI, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLD, KC_MUTE, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_VOLU, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_BSPC, CTL_T(KC_ESC), KC_LALT, - // - /*-*/ KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - /*-*/ TG(QWRT), KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_MINS, - /*-*/ /*-*/ KC_Y, KC_N, KC_I, KC_O, KC_H, KC_ENT, - /*-*/ KC_RBRC, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - /*-*/ /*-*/ /*-*/ KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - KC_MPLY, KC_MNXT, - KC_MPRV, - KC_RALT, KC_QUOT, KC_SPC - ), - [QWRT] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_E, KC_R, KC_T, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_D, KC_F, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, - /*-*/ /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, - // - /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_TRNS, - /*-*/ /*-*/ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_TRNS, - /*-*/ KC_TRNS, KC_N, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - /*-*/ /*-*/ /*-*/ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case QWRT: - ergodox_right_led_1_on(); - break; - default: - break; - } -}; diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/readme.md b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/readme.md deleted file mode 100644 index 0e78c130b..000000000 --- a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# Roman's Layout - -There are two layers: - -- **BASE** is [Norman layout](https://normanlayout.info/). -- **QWRT** is QWERTY. - -[![keyboard-layout](romanzolotarev-norman-qwerty-osx.png)](http://www.keyboard-layout-editor.com/#/gists/3b236f450da474dc506a5a80390c3cc7) - -## Switching - -- Tap `QWRT` to toggle **QWRT**. - -## LEDs - -- Red: QWRT is on. - -## Functional Keys - -- Tap `F1` to mute microphone via [Shush](http://mizage.com/shush/). -- Tap `F2` to copy screenshot to the clipboard. -- Hold `SHIFT` and tap `F2` to save screenshot as a file. -- Tap `F3`, `F4`, `F5`, `F6` to resize a window via [Divvy](http://mizage.com/divvy/). - -## CTRL/ESC - -Both CTRL and ESC are frequently used in Vim. - -- Tap `CTRL/ESC` to send `ESC`. -- Hold `CTRL/ESC` to use as `CTRL`. - -## Activate N-rollover - -- Hold left `SHIFT` and right `SHIRT` and then tap `N`. diff --git a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png b/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png deleted file mode 100644 index 34762ecb7..000000000 Binary files a/keyboards/ergodox_ez/keymaps/romanzolotarev-norman-qwerty-osx/romanzolotarev-norman-qwerty-osx.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/sneako/keymap.c b/keyboards/ergodox_ez/keymaps/sneako/keymap.c deleted file mode 100644 index 0c6863102..000000000 --- a/keyboards/ergodox_ez/keymaps/sneako/keymap.c +++ /dev/null @@ -1,187 +0,0 @@ -// Based on `default_osx` -// Replace left Bksp with Ctrl/Esc -// Remove the Ctrl from Z and / -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(1), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(1), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/sneako/readme.md b/keyboards/ergodox_ez/keymaps/sneako/readme.md deleted file mode 100644 index 8dd110ee6..000000000 --- a/keyboards/ergodox_ez/keymaps/sneako/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# ergodox_keymap - -Based on the default Ergodox EZ firmware - -Replaced the left side Bksp with a Crtl/Esc, this really helps in vim. -Removed the Ctrls from the Z and / keys. diff --git a/keyboards/ergodox_ez/keymaps/software_neo2/keymap.c b/keyboards/ergodox_ez/keymaps/software_neo2/keymap.c deleted file mode 100644 index 2eaba0d7d..000000000 --- a/keyboards/ergodox_ez/keymaps/software_neo2/keymap.c +++ /dev/null @@ -1,139 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_neo2.h" - -// Layer names -#define BASE 0 // default layer -#define MDIA 1 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ^ | 1 | 2 | 3 | 4 | 5 | Play | | Next | 6 | 7 | 8 | 9 | 0 |BackSpce| - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | X | V | L | C | W | L1 | | L1 | K | H | G | F | Q | ß | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Caps | U | I | A | E | O |------| |------| S | N | R | T | D | Y | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Ãœ/Ctrl| Ö/C-S| Ä/Alt| P | Z | | | | B | M | , | . | J | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L1 | Home | PgDn | PgUp | End | | Right| Down | Up | Left | Esc | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------+------+------| |------+--------+------. - * | | |NeoL2 | |NeoL2 | | | - * | Tab |Backsp|------| |------| Space |Enter | - * | |ace |NeoL1 | |NeoL1 | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_CIRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MPLY, - KC_DELT, NEO_X, NEO_V, NEO_L, NEO_C, NEO_W, TG(1), - KC_CAPS, NEO_U, NEO_I, NEO_A, NEO_E, NEO_O, - KC_LSFT, CTL_T(NEO_UE), C_S_T(NEO_OE), ALT_T(NEO_AE), NEO_P, NEO_Z, ALL_T(KC_NO), - DE_LESS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, - ALT_T(KC_APP),KC_LGUI, - NEO_L2_L, - KC_TAB,KC_BSPC,NEO_L1_L, - // right hand - KC_MNXT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(1), NEO_K, NEO_H, NEO_G, NEO_F, NEO_Q, NEO_SS, - NEO_S, NEO_N, NEO_R, NEO_T, NEO_D, NEO_Y, - MEH_T(KC_NO),NEO_B, NEO_M, KC_COMM, KC_DOT, NEO_J, KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ESC, - KC_LALT,CTL_T(KC_ESC), - NEO_L2_R, - NEO_L1_R,KC_SPC, KC_ENT - ), -/* Keymap 1: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | Lclk | MsUp | Rclk | | | | | |VolDwn| Mute |VolUp | | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | Btn4 |MsLeft|MsDown|MsRght| Btn5 |------| |------| | Prev | Stop | Play | Next | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | |WhRght|WhDown| WhUp |WhLeft|WhClk | | | |BwSrch|BwBack|BwHome|BwRefr|BwFwd | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | |MsAcl0|MsAcl1|MsAcl2| | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | |Brwser|Brwser| - * | Lclk | Rclk |------| |------|Back |Forwd | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_TRNS, - KC_TRNS, KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, - KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_BTN3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_BTN1, KC_BTN2, KC_TRNS, - // right hand - KC_TRNS, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11, - KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_F12, - KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, - KC_TRNS, KC_WSCH, KC_WBAK, KC_WHOM, KC_WREF, KC_WFWD, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_WBAK, KC_WFWD -), -}; - -const uint16_t PROGMEM fn_actions[] = { - /* [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) */ -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case MDIA: - ergodox_right_led_2_on(); - break; - default: - ergodox_board_led_off(); - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/supercoder/config_user.h b/keyboards/ergodox_ez/keymaps/supercoder/config_user.h deleted file mode 100644 index 8da138372..000000000 --- a/keyboards/ergodox_ez/keymaps/supercoder/config_user.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H 1 - -#include "config.h" - -#undef LOCKING_SUPPORT_ENABLE -#undef LOCKING_RESYNC_ENABLE - -#endif diff --git a/keyboards/ergodox_ez/keymaps/supercoder/images/layout.png b/keyboards/ergodox_ez/keymaps/supercoder/images/layout.png deleted file mode 100644 index c72958c6e..000000000 Binary files a/keyboards/ergodox_ez/keymaps/supercoder/images/layout.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg b/keyboards/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg deleted file mode 100644 index d690eaf02..000000000 Binary files a/keyboards/ergodox_ez/keymaps/supercoder/images/supercoder_2000.jpg and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/supercoder/keymap.c b/keyboards/ergodox_ez/keymaps/supercoder/keymap.c deleted file mode 100644 index ca21d30fd..000000000 --- a/keyboards/ergodox_ez/keymaps/supercoder/keymap.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * SuperCoder 2000 layout - */ - -#include "ergodox_ez.h" - -/* Layers */ - -#define SC2K 0 // default layer - -/* The Keymap */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Keymap 0: Base Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | 0 | 0 | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | 1 | 1 | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | 0 | 0 | 0 | 0 | 0 | 0 |------| |------| 1 | 1 | 1 | 1 | 1 | 1 | - * |-----------+------+------+------+------+------| 0 | | 1 |------+------+------+------+------+-----------| - * | 0 | 0 | 0 | 0 | 0 | 0 | | | | 1 | 1 | 1 | 1 | 1 | 1 | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | 0 | 0 | 0 | 0 | 0 | | 1 | 1 | 1 | 1 | 1 | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | DONE | DONE | | DONE | DONE | - * ,------|------|------| |------+------+------. - * | | | DONE | | DONE | | | - * | DONE | DONE |------| |------| DONE | DONE | - * | | | DONE | | DONE | | | - * `--------------------' `--------------------' - */ -[SC2K] = KEYMAP( - // left hand - KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 -,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 -,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 -,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 -,KC_0 ,KC_0 ,KC_0 ,KC_0 ,KC_0 - - ,KC_ENT ,KC_ENT - ,KC_ENT - ,KC_ENT ,KC_ENT ,KC_ENT - - // right hand - ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 - ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 - ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 - ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 - ,KC_1 ,KC_1 ,KC_1 ,KC_1 ,KC_1 - - ,KC_ENT ,KC_ENT - ,KC_ENT - ,KC_ENT ,KC_ENT ,KC_ENT - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { -} diff --git a/keyboards/ergodox_ez/keymaps/supercoder/makefile.mk b/keyboards/ergodox_ez/keymaps/supercoder/makefile.mk deleted file mode 100644 index 41a195d9c..000000000 --- a/keyboards/ergodox_ez/keymaps/supercoder/makefile.mk +++ /dev/null @@ -1,6 +0,0 @@ -BOOTMAGIC_ENABLE=no -COMMAND_ENABLE=no -SLEEP_LED_ENABLE=no -UNICODE_ENABLE=no -MOUSEKEY_ENABLE=no -EXTRAKEY_ENABLE=no diff --git a/keyboards/ergodox_ez/keymaps/supercoder/readme.md b/keyboards/ergodox_ez/keymaps/supercoder/readme.md deleted file mode 100644 index 97bf7f583..000000000 --- a/keyboards/ergodox_ez/keymaps/supercoder/readme.md +++ /dev/null @@ -1,29 +0,0 @@ -SuperCoder 2000 layout for the ErgoDox -================================================== - -![SuperCoder 2000](images/supercoder_2000.jpg) - -Ever found yourself in need of entering binary codes rapidly? Ever wanted to use -all ten fingers to do so? Ever felt your SuperCoder 2000 too limiting, by only -having three buttons? We heard you! With this layout for the ErgoDox EZ, you -will be able to tap in binary at an unparalleled speed and accuracy! Efficiency -never seen before! - -Behold the Ultimate SuperCoder 2000 layout! - -![SuperCoder layout](images/layout.png) - -### To use it... - -To use this piece of top quality engineering, you can either -[download the hex file][hex] we have prepared for you, or you can compile it on -your own: - - [hex]: https://raw.githubusercontent.com/algernon/ergodox-supercoder/master/supercoder.hex - -``` -$ git clone https://github.com/jackhumbert/qmk_firmware.git -$ cd qmk_firmware/keyboards/ergodox_ez -$ git clone https://github.com/algernon/ergodox-supercoder.git keymaps/supercoder -$ make KEYMAP=supercoder -``` diff --git a/keyboards/ergodox_ez/keymaps/techtomas/keymap.c b/keyboards/ergodox_ez/keymaps/techtomas/keymap.c deleted file mode 100644 index 1ff6618b9..000000000 --- a/keyboards/ergodox_ez/keymaps/techtomas/keymap.c +++ /dev/null @@ -1,231 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define APP 2 // app layer -#define CNTL 3 // control layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | L2/` | 1 | 2 | 3 | 4 | 5 |CmdSpc| | - | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | MEH/Tab| Q | W | E | R | T | [ | | ] | Y | U | I | O | P | MEH/\ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Hyp/Esc | A | S | D | F | G |------| |------| H | J | K | L | L2/; | Hyp/' | - * |--------+------+------+------+------+------| Tab | | STab |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | L2// | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |L1/Lft|L3/Rht| LCtl | LAlt | LGui | | Rgui | Up | Dn | L3 | L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCtl | LGui | |AltGui|ShfGui| - * ,-------|------|------| |------+--------+------. - * | | |L1/Hom| |L2/PUp| | | - * | Backsp|Delete|------| |------| Enter | Space | - * | | |L3/End| |L1/PDn| | | - * `--------------------' `-----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - LT(APP,KC_GRV), KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(KC_SPC), - MEH_T(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - ALL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TAB, - LT(SYMB,KC_LEFT), LT(CNTL,KC_RIGHT), KC_LCTL, KC_LALT, KC_LGUI, - KC_LCTL, KC_LGUI, - LT(SYMB,KC_HOME), - KC_BSPC, KC_DELETE, LT(CNTL,KC_END), - // right hand - KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, MEH_T(KC_BSLS), - KC_H, KC_J, KC_K, KC_L, LT(APP,KC_SCLN), ALL_T(KC_QUOT), - S(KC_TAB), KC_N, KC_M, KC_COMM, KC_DOT, LT(APP,KC_SLSH), KC_RSFT, - KC_RGUI, KC_UP, KC_DOWN, KC_FN3, KC_FN1, - LALT(KC_LGUI), S(KC_LGUI), - LT(APP,KC_PGUP), - LT(SYMB,KC_PGDN), KC_ENT, KC_SPC - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | Tab | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | < | | > | : | 7 | 8 | 9 | / | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| ; | 4 | 5 | 6 | * | | - * |--------+------+------+------+------+------| F14 | | F15 |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | - | Entr | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | . | = | + | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,S(KC_COMM), - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_F14, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TAB, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - S(KC_DOT), KC_COLN, KC_7, KC_8, KC_9, KC_BSLS, KC_F12, - KC_SCLN, KC_4, KC_5, KC_6, KC_ASTR, KC_TRNS, - KC_F15, KC_AMPR, KC_1, KC_2, KC_3, KC_MINS, KC_ENT, - KC_0, KC_DOT, KC_EQL, KC_PLUS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: App Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | CmdQ | CmdW | | | | Stab | | Play | Prev | Next | | |PrtSc | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| VolDn|VolUp | | | | | - * |--------+------+------+------+------+------| | | Mute |------+------+------+------+------+--------| - * | | CmdZ | CmdX | CmdC | CmdY | CtrlC| | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Control -[APP] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, LGUI(KC_Q), LGUI(KC_W), KC_TRNS, KC_TRNS, KC_TRNS, S(KC_TAB), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), LCTL(KC_C), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MPLY, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, - KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 3: Control Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Pwr | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| Lclk |------| |------| Lft | Down | Up | Right| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | Rclk | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Shift| | | Home | End | - * ,------|------|------| |------+------+------. - * | | | LAtl | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// Control -[CNTL] = KEYMAP( - KC_PWR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, - KC_LALT, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HOME, KC_END, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), - [2] = ACTION_LAYER_TAP_TOGGLE(APP), - [3] = ACTION_LAYER_TAP_TOGGLE(CNTL) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - case 3: - ergodox_right_led_3_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/techtomas/readme.md b/keyboards/ergodox_ez/keymaps/techtomas/readme.md deleted file mode 100644 index 36e0591a8..000000000 --- a/keyboards/ergodox_ez/keymaps/techtomas/readme.md +++ /dev/null @@ -1,57 +0,0 @@ -# Techtomas Configuration - -## Base Layer - -The base layer is a merge of what I liked with the default layout and the ordinary layout. The thumb cluster is more like the Kinesis advantage and the top row of the cluster is convient for use on the mac. - -* The Caps Lock postion handles [Hyper/Esc](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) -* The Tab key toggles MEH. -* The top vertical mods on the left and right are [ and ]. -* The bottom vertical mods on the left and right are tab and shift+tab -* The HYPER and MEH key are made in the same location on the right side of the board as well. Using Keyboard Maestro for OS X makes one-handed shortcuts very easy. -* Layer switching is focused around the thumb clusters plus some additional locations for convience. - -## Symbol Layer -The symbol layer can be tap/toggled with the bottom right key and also toggled on the thumb clusters. - -The bottom two vertical mods are set to F14 and F15 which is the default for changing screen brightness on the mac - -## App Layer -The app layer is used to control media playback and also some application shortcuts (OS X Focused). -It can be toggled on the left board in the top left corner (tilde/grave) or using your pinky on the right side of the board using either ; or /. -There is one additional toggle on the right thumb cluster for quick access to play and mute key combos. - -### Current App shortcuts defined -* Q = CMD+Q -* W = CMD+W -* Z = CMD+Z -* X = CMD+X -* C = CMD+C -* V = CMD+V -* B = CTRL+C -* P = Print Screen - -## Control Layer -The control layer is meant to help easily navigate and select text. It can also be stacked ontop of the Symbol layer when needed. - -The right arrow key and End key toggle the control layer on the left board. There is also a tap toggle for the layer in the same position on the right side of the board. - -On the left board you have mouse control with left & right click in the location of the G and B keys. -On the right board you have vim-style arrow keys using hjkl - -The left thumb cluster moves shift and alt within easy reach while holding the toggle (end). So far I've found this convient to navigate and skip around text when using the hjkl arrow keys. I found that it was easy to get the alt key stuck on depending on what key you released first so I added the PREVENT_STUCK_MODIFIERS to the config.h to help with that. - -## Changelog - -* May 4th, 2016 (v1.2): - * Moved layer toggles around to match my habbits of typing - * Enabled Prevent Stuck Modifers in my config.h (L3 + Alt on cluster would get stuck) - * Changed media layer to be more like an app layer with some quick shortcuts (mac centric) - * Moved around the base layer arrow keys so mod keys were more accesible - -* Apr 29, 2016 (V1.1): - * Added F14 and F15 to symbol layer - * Added control layer toggle to A key. - -* Apr 28, 2016 (V1.0): - * Modified config based on the default layout plus inspiration from the ordinary layout diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c b/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c deleted file mode 100644 index ec6ceb96b..000000000 --- a/keyboards/ergodox_ez/keymaps/teckinesis/keymap.c +++ /dev/null @@ -1,455 +0,0 @@ -#include "ergodox_ez.h" -#include "led.h" -#include "debug.h" -#include "action_layer.h" -#include "action_util.h" -#include "mousekey.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols layer -#define MDIA 2 // media layer -#define SPEC 3 // special layer - -#define LCaps 10 // left caps-shift key -#define LSymb 11 // left symbol-shift key -#define LMdia 12 // left media-shift key -#define LSpec 13 // left special-shift key -#define RCaps 14 // right caps-shift key -#define RSymb 15 // right symbol-shift key -#define RMdia 16 // right media-shift key -#define RSpec 17 // right special-shift key - -#define MUL 20 // mouse up left -#define MUR 21 // mouse up right -#define MDL 22 // mouse down left -#define MDR 23 // mouse down right - -/* - * teckinesis layout for ErgoDox (EZ) - * - * Modifications from The Ordinary Layout v4 by Will Wolff-Myren willwm@gmail.com - * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com - * - * No rights reserved. This software is in the public domain. - * Credit me if you are friendly but if you're a jerk don't bother. - * - * Details: readme.md - * https://github.com/willwm/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/teckinesis - */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/******* Base Layer ******************************************************************************************************** - * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | Special =+ | 1 | 2 | 3 | 4 | 5 | ESC | | ` | 6 | 7 | 8 | 9 | 0 | -_ Special | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | - * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| - * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | - * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| - * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl |Meh/\ |Hypr//| LAlt | LGui | | RGui | RAlt |Hypr/[|Meh/] | RCtrl | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Home | End | | Left | Right| - * ,------|------|------| |------+------+------. - * | | | PgUp | | Up | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | PgDn | | Down | | | - * `--------------------' `--------------------' - */ -[BASE] = KEYMAP( -// left hand - F(LSpec),KC_1,KC_2,KC_3 ,KC_4 ,KC_5 ,KC_ESC -,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC -,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G -,M(LCaps) ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) -,KC_LCTL,MEH_T(KC_BSLS),ALL_T(KC_SLSH),KC_LALT,KC_LGUI - ,KC_HOME,KC_END - ,KC_PGUP - ,KC_BSPC,KC_DEL ,KC_PGDN - // right hand - ,KC_GRV ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) - ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) - ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) - ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) - ,KC_RGUI,KC_RALT,ALL_T(KC_LBRC),MEH_T(KC_RBRC),KC_RCTL - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_DOWN ,KC_ENT ,KC_SPC - ), - -/******* Symbols Layer ***************************************************************************************************** - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | - * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| - * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | LCtrl | Meh |Hyper | LAlt | LGui | |RGui/0|RAlt/.|Hypr/=|Meh/+ |RCtrl/Ent| - * `-----------------------------------' `-------------------------------------' - * ,-------------. ,-------------. - * | Left | Right| | Home | End | - * ,------|------|------| |------+------+------. - * | | | Up | | PgUp | | | - * |Space |Enter |------| |------|BackSp| Del | - * | | | Down | | PgDn | | | - * `--------------------' `--------------------' - */ -[SYMB] = KEYMAP( -// left hand - KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC -,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) -,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV -,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB -,KC_LCTL ,KC_MEH ,KC_HYPR ,KC_LALT ,KC_LGUI - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_SPC ,KC_ENT ,KC_DOWN - // right hand - ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS - ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS - ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS - ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS - ,GUI_T(KC_0),ALT_T(KC_DOT),ALL_T(KC_EQL),MEH_T(KC_PLUS),CTL_T(KC_ENT) - ,KC_HOME ,KC_END - ,KC_PGUP - ,KC_PGDN ,KC_BSPC ,KC_DEL -), - -/******* Media Layer ******************************************************************************************************* - * - * ,---------------------------------------------------------------. ,---------------------------------------------------------------. - * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | - * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| - * | | |MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | | | - * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| - * | | |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | | | - * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| - * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | - * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' - * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| - * `---------------------------------------------' `---------------------------------------------' - * ,-------------. ,-------------. - * | Stop |Refrsh| | Prev | Next | - * ,------|------|------| |------+------+------. - * |Brwser|Brwser|Search| |VolUp | | | - * |Back | Fwd |------| |------| Stop | Play-| - * | | | Home | |VolDn | | Pause| - * `--------------------' `--------------------' - */ -[MDIA] = KEYMAP( -// left hand - KC_TRNS ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,KC_ESC -,KC_TRNS ,KC_NO ,M(MUL) ,KC_MS_U ,M(MUR) ,KC_VOLU ,KC_WH_U -,KC_TRNS ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_VOLD -,KC_TRNS ,KC_NO ,M(MDL) ,KC_MS_D ,M(MDR) ,KC_MUTE ,KC_WH_D -,KC_LCTL ,KC_MEH ,KC_BTN3 ,KC_BTN1 ,KC_BTN2 - ,KC_WSTP ,KC_WREF - ,KC_WSCH - ,KC_WBAK ,KC_NO ,KC_WHOM - // right hand - ,KC_NO ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,KC_TRNS - ,KC_WH_U ,KC_PSCR ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_TRNS - ,KC_NLCK ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO ,KC_TRNS - ,KC_WH_D ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_TRNS - ,GUI_T(KC_INS),ALT_T(KC_DEL),KC_HYPR ,KC_MEH ,KC_RCTL - ,KC_MPRV ,KC_MNXT - ,KC_VOLU - ,KC_VOLD ,KC_MSTP ,KC_MPLY -), - -/******* Special Layer ***************************************************************************************************** - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | Esc | | | | | | | | | | | | Bspc | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | RShift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[SPEC] = KEYMAP( -// left hand - KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS,KC_TRNS ,KC_TRNS - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_BSPC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_RSFT - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - ) -}; - -const uint16_t PROGMEM fn_actions[] = { - // the faux shift keys are implemented as macro taps - [LCaps] = ACTION_MACRO_TAP(LCaps) - ,[LSymb] = ACTION_MACRO_TAP(LSymb) - ,[LMdia] = ACTION_MACRO_TAP(LMdia) - ,[LSpec] = ACTION_MACRO_TAP(LSpec) - ,[RCaps] = ACTION_MACRO_TAP(RCaps) - ,[RSymb] = ACTION_MACRO_TAP(RSymb) - ,[RMdia] = ACTION_MACRO_TAP(RMdia) - ,[RSpec] = ACTION_MACRO_TAP(RSpec) -}; - -uint16_t caps_shift = 0; -uint16_t symb_shift = 0; -uint16_t mdia_shift = 0; - -bool symb_lock = false; -bool mdia_lock = false; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - // There are two shift keys for each layer so we increment a layer_shift var when one - // is pressed and decrement when one is released. If both are pressed at the same time - // then the layer is locked (or unlocked). The shift counts are bound between 0 and 2 - // only because sometimes rapid pressing led to irregular events; this way the states - // are self healing during use. - - case LCaps: // both caps-shift keys trigger Left Shift - case RCaps: // so they don't interfere with the magic combo - if (record->event.pressed && !record->tap.count) { - if(++caps_shift > 2) caps_shift = 2; - if(caps_shift == 2) { - register_code(KC_CAPS); - unregister_code(KC_CAPS); - } else if(caps_shift == 1) { - register_code(KC_LSFT); - } - } else { - if(--caps_shift < 0) caps_shift = 0; - if(caps_shift == 0) unregister_code(KC_LSFT); - } - break; - - case LSymb: - if (record->event.pressed) { - if(++symb_shift > 2) symb_shift = 2; - if(symb_shift == 2) { - symb_lock = !symb_lock; - } else if(symb_shift == 1) { - layer_on(SYMB); - } - } else { - if(--symb_shift < 0) symb_shift = 0; - if((symb_shift == 0) && (!symb_lock)) layer_off(SYMB); - } - break; - - case LMdia: - if (record->event.pressed) { - if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { - register_code(KC_TAB); - } else { - if(++mdia_shift > 2) mdia_shift = 2; - if(mdia_shift == 2) { - mdia_lock = !mdia_lock; - } else if(mdia_shift == 1) { - layer_on(MDIA); - } - } - } else { - if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { - unregister_code(KC_TAB); - } else { - if(--mdia_shift < 0) mdia_shift = 0; - if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); - } - } - break; - - case LSpec: - if (record->event.pressed) { - if (record->tap.count && !record->tap.interrupted) { - register_code(KC_EQL); - } else { - layer_on(SPEC); - } - } else { - if(record->tap.count && !record->tap.interrupted) { - unregister_code(KC_EQL); - } else { - layer_off(SPEC); - } - } - break; - - case RSymb: - if (record->event.pressed) { - if (record->tap.count && (!symb_shift) && (!symb_lock)) { - register_code(KC_QUOT); - } else { - if(++symb_shift > 2) symb_shift = 2; - if(symb_shift == 2) { - symb_lock = !symb_lock; - } else if(symb_shift == 1) { - layer_on(SYMB); - } - } - } else { - if(record->tap.count && symb_shift == 0) { - unregister_code(KC_QUOT); - } else { - if(--symb_shift < 0) symb_shift = 0; - if((!symb_shift) && (!symb_lock)) layer_off(SYMB); - } - } - break; - - case RMdia: - if (record->event.pressed) { - if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { - register_code(KC_BSLS); - } else { - if(++mdia_shift > 2) mdia_shift = 2; - if(mdia_shift == 2) { - mdia_lock = !mdia_lock; - } else if(mdia_shift == 1) { - layer_on(MDIA); - } - } - } else { - if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { - unregister_code(KC_BSLS); - } else { - if(--mdia_shift < 0) mdia_shift = 0; - if((!mdia_shift) && (!mdia_lock)) layer_off(MDIA); - } - } - break; - - case RSpec: - if (record->event.pressed) { - if (record->tap.count && !record->tap.interrupted) { - register_code(KC_MINS); - } else { - layer_on(SPEC); - } - } else { - if(record->tap.count && !record->tap.interrupted) { - unregister_code(KC_MINS); - } else { - layer_off(SPEC); - } - } - break; - - // mouse diagonals - - case MUL: // mouse up left - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_LEFT); - mousekey_send(); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_LEFT); - mousekey_send(); - } - break; - - case MUR: // mouse up right - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_RIGHT); - mousekey_send(); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_RIGHT); - mousekey_send(); - } - break; - - case MDL: // mouse down left - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_LEFT); - mousekey_send(); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_LEFT); - mousekey_send(); - } - break; - - case MDR: // mouse down right - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_RIGHT); - mousekey_send(); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_RIGHT); - mousekey_send(); - } - break; - - default: - // none - break; - } - - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - // shift or caps lock turns on red light - if(caps_shift || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<\n\n\n\nShift", - { - "c": "#cccccc" - }, - "Q", - { - "x": 14.5 - }, - "P", - { - "c": "#2277ff", - "f": 3, - "w": 1.5 - }, - "|\n\\\nMedia\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#cccccc" - }, - "D", - { - "x": 10.5 - }, - "K" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "S", - { - "x": 1 - }, - "F", - { - "x": 8.5 - }, - "J", - { - "x": 1 - }, - "L" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "G", - { - "x": 6.5 - }, - "H" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Symbols\n\n\n\n\n\nShift", - { - "c": "#cccccc" - }, - "A", - { - "x": 14.5 - }, - ":\n;", - { - "c": "#2277ff", - "f": 3, - "w": 1.5 - }, - "\"\n'\nSymbols\n\n\n\n\nShift" - ], - [ - { - "y": -0.625, - "x": 6.5, - "c": "#54d6de", - "fa": [ - 0, - 0, - 4, - 1 - ], - "h": 1.5 - }, - "< Tab\n\n\nShift Tab", - { - "x": 4.5, - "h": 1.5 - }, - "Tab >\n\n\nTab" - ], - [ - { - "y": -0.75, - "x": 3.5, - "c": "#cccccc" - }, - "C", - { - "x": 10.5 - }, - "<\n," - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "X", - { - "x": 1 - }, - "V", - { - "x": 8.5 - }, - "M", - { - "x": 1 - }, - ">\n." - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "B", - { - "x": 6.5 - }, - "N" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Capitals\n\n\n\n\n\nShift", - { - "c": "#cccccc" - }, - "Z", - { - "x": 14.5 - }, - "?\n/", - { - "c": "#2277ff", - "f": 3, - "w": 1.5 - }, - "\n\nCapitals\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#77aaff", - "fa": [ - 5, - 0, - 4, - 1 - ] - }, - "\n\n\nLAlt", - { - "x": 10.5 - }, - "\n\n\nRAlt" - ], - [ - { - "y": -0.875, - "x": 2.5, - "fa": [ - 5, - 1 - ] - }, - "\nHyper\n?\n/", - { - "x": 1, - "fa": [ - 5, - 1, - 0, - 1 - ] - }, - "\n\n\nSuper", - { - "x": 8.5 - }, - "\n\n\nSuper", - { - "x": 1, - "fa": [ - 0, - 0, - 0, - 1 - ] - }, - "{\n[\n\nHyper" - ], - [ - { - "y": -0.75, - "x": 0.5 - }, - "Ctrl\n\n\nLCtrl", - { - "f2": 1 - }, - "\nMeh\n|\n\\", - { - "x": 14.5, - "fa": [ - 0, - 0, - 1, - 1 - ] - }, - "}\n]\n\nMeh", - "Ctrl\n\n\nRCtrl" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#54d6de" - }, - "Home", - "End" - ], - [ - { - "h": 2 - }, - "< Del\n\n\nBackspace", - { - "h": 2 - }, - "Del >\n\n\nDelete", - "Page\n\n\n\n\n\nUp" - ], - [ - { - "x": 2 - }, - "Page\n\n\n\n\n\nDown" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - "Left", - "Right" - ], - [ - { - "x": -3 - }, - "Up", - { - "h": 2 - }, - "Enter", - { - "h": 2 - }, - "Space" - ], - [ - { - "x": -3 - }, - "Down" - ] -] \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png deleted file mode 100644 index 7c4584e9f..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-base.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json deleted file mode 100644 index 65fe394e8..000000000 --- a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.json +++ /dev/null @@ -1,436 +0,0 @@ -[ - { - "name": "teckinesis (MediaLayer)", - "author": "Will Wolff-Myren", - "switchMount": "cherry", - "switchBrand": "gateron", - "switchType": "KS-3-Tea" - }, - [ - { - "x": 3.5, - "c": "#99de2a" - }, - "F13", - { - "x": 10.5 - }, - "F18" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "F12", - { - "x": 1 - }, - "F14", - { - "x": 8.5 - }, - "F17", - { - "x": 1 - }, - "F19" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "F15", - { - "c": "#ff4444" - }, - "Esc", - { - "x": 4.5 - }, - "Esc", - { - "c": "#99de2a" - }, - "F16" - ], - [ - { - "y": -0.875, - "x": 1.5 - }, - "F11", - { - "x": 14.5 - }, - "F20" - ], - [ - { - "y": -0.995, - "c": "#000000", - "t": "#ff0000", - "w": 1.5 - }, - "Media\n\n\n\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "\n\nMedia\n\n\n\n\nShift" - ], - [ - { - "y": -0.3799999999999999, - "x": 3.5, - "c": "#ff8500", - "t": "#000000" - }, - "Mouse\n\n\n\n\n\nUp", - { - "x": 10.5 - }, - "Cursor\n\n\n\n\n\nUp" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "Mouse\n\n\n\n\n\nUpLeft", - { - "x": 1 - }, - "Mouse\n\n\n\n\n\nUpRgt", - { - "x": 8.5, - "c": "#ffb063" - }, - "Home", - { - "x": 1 - }, - "Page\n\n\n\n\n\nUp" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#e6e067" - }, - "Vol\n\n\n\n\n\nUp", - { - "c": "#ffb063", - "h": 1.5 - }, - "Scroll\n\n\n\n\n\nUp", - { - "x": 4.5, - "h": 1.5 - }, - "Scroll\n\n\n\n\n\nUp", - { - "c": "#e6e067" - }, - "Print\n\n\n\n\n\nScreen" - ], - [ - { - "y": -0.875, - "x": 1.5, - "c": "#737373", - "a": 7 - }, - "", - { - "x": 14.5 - }, - "" - ], - [ - { - "y": -0.9950000000000001, - "c": "#2277ff", - "a": 4, - "w": 1.5 - }, - "Symbols\n\n\n\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "\n\nSymbols\n\n\n\n\nShift" - ], - [ - { - "y": -0.3799999999999999, - "x": 3.5, - "c": "#ff8500" - }, - "Mouse\n\n\n\n\n\nDown", - { - "x": 10.5 - }, - "Cursor\n\n\n\n\n\nDown" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "Mouse\n\n\n\n\n\nLeft", - { - "x": 1 - }, - "Mouse\n\n\n\n\n\nRight", - { - "x": 8.5 - }, - "Cursor\n\n\n\n\n\nLeft", - { - "x": 1 - }, - "Cursor\n\n\n\n\n\nRight" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#e6e067" - }, - "Vol\n\n\n\n\n\nDown", - { - "x": 6.5 - }, - "Num\n\n\n\n\n\nLock" - ], - [ - { - "y": -0.875, - "x": 1.5, - "c": "#737373", - "a": 7 - }, - "", - { - "x": 14.5 - }, - "" - ], - [ - { - "y": -0.9950000000000001, - "c": "#2277ff", - "a": 4, - "w": 1.5 - }, - "Capitals\n\n\n\n\n\nShift", - { - "x": 16.5, - "w": 1.5 - }, - "\n\nCapitals\n\n\n\n\nShift" - ], - [ - { - "y": -0.6299999999999999, - "x": 6.5, - "c": "#ffb063", - "h": 1.5 - }, - "Scroll\n\n\n\n\n\nDown", - { - "x": 4.5, - "h": 1.5 - }, - "Scroll\n\n\n\n\n\nDown" - ], - [ - { - "y": -0.75, - "x": 3.5, - "c": "#ff8500" - }, - "Mouse\n\n\n\n\n\nDown", - { - "x": 10.5 - }, - "Cursor\n\n\n\n\n\nDown" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "Mouse\n\n\n\n\n\nDnLeft", - { - "x": 1 - }, - "Mouse\n\n\n\n\n\nDnRgt", - { - "x": 8.5, - "c": "#ffb063" - }, - "End", - { - "x": 1 - }, - "Page\n\n\n\n\n\nDown" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#e6e067" - }, - "Mute", - { - "x": 6.5, - "c": "#737373", - "a": 7 - }, - "" - ], - [ - { - "y": -0.875, - "x": 1.5 - }, - "", - { - "x": 14.5 - }, - "" - ], - [ - { - "y": -0.9950000000000001, - "c": "#2277ff", - "a": 4, - "w": 1.5 - }, - "Ctrl", - { - "x": 16.5, - "w": 1.5 - }, - "Ctrl" - ], - [ - { - "y": -0.3799999999999999, - "x": 3.5, - "c": "#ff8500" - }, - "Middle\n\n\n\n\n\nClick", - { - "x": 10.5, - "c": "#ffb063", - "fa": [ - 0, - 0, - 0, - 1 - ] - }, - "Delete\n\n\nOption" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#ff8500" - }, - "Left\n\n\n\n\n\nClick", - { - "x": 1 - }, - "Right\n\n\n\n\n\nClick", - { - "x": 8.5, - "c": "#ffb063" - }, - "Insert\n\n\nCmd", - { - "x": 1, - "c": "#77aaff" - }, - "Hyper" - ], - [ - { - "y": -0.75, - "x": 0.5 - }, - "Alt\n\n\nLAlt", - "Meh", - { - "x": 14.5 - }, - "Meh", - "Alt\n\n\nRAlt" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#ccbb00" - }, - "Stop\n\n\nBrowser", - "Reload\n\n\nBrowser" - ], - [ - { - "h": 2 - }, - "< Web\n\n\nBrowser", - { - "h": 2 - }, - "Web >\n\n\nBrowser", - "Search\n\n\nBrowser" - ], - [ - { - "x": 2 - }, - "Home\n\n\nBrowser" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - "Prev\n\n\nAudio\n\n\nTrack", - "Next\n\n\nAudio\n\n\nTrack" - ], - [ - { - "x": -3, - "c": "#e6e067" - }, - "Vol\n\n\n\n\n\nUp", - { - "c": "#ccbb00", - "h": 2 - }, - "Stop\n\n\nAudio", - { - "h": 2 - }, - "Play\n\n\nAudio\n\n\nPause" - ], - [ - { - "x": -3, - "c": "#e6e067" - }, - "Vol\n\n\n\n\n\nDown" - ] -] \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png deleted file mode 100644 index cc51605f9..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-media.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json deleted file mode 100644 index 439d0128e..000000000 --- a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.json +++ /dev/null @@ -1,422 +0,0 @@ -[ - { - "name": "teckinesis (Symbol Layer)", - "author": "Will Wolff-Myren", - "switchMount": "cherry", - "switchBrand": "gateron", - "switchType": "KS-3-Tea" - }, - [ - { - "x": 3.5, - "c": "#99de2a" - }, - "F3", - { - "x": 10.5 - }, - "F8" - ], - [ - { - "y": -0.875, - "x": 2.5 - }, - "F2", - { - "x": 1 - }, - "F4", - { - "x": 8.5 - }, - "F7", - { - "x": 1 - }, - "F9" - ], - [ - { - "y": -0.875, - "x": 5.5 - }, - "F5", - { - "c": "#ff4444" - }, - "Esc", - { - "x": 4.5, - "c": "#bbddbb" - }, - "_\n\n\n\n\n\n-", - { - "c": "#99de2a" - }, - "F6" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Special\n\n\n\n\n\nShift", - { - "c": "#99de2a" - }, - "F1", - { - "x": 14.5 - }, - "F10", - { - "c": "#2277ff", - "w": 1.5 - }, - "\n\nSpecial\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#bbddbb" - }, - "{", - { - "x": 10.5, - "c": "#89b087" - }, - "8" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bbddbb" - }, - "@", - { - "x": 1 - }, - "}", - { - "x": 8.5, - "c": "#89b087" - }, - "7", - { - "x": 1 - }, - "9" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#bbddbb" - }, - "&", - { - "h": 1.5 - }, - "<", - { - "x": 4.5, - "h": 1.5 - }, - ">", - "|" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Media\n\n\n\n\n\nShift", - { - "c": "#bbddbb" - }, - "!", - { - "x": 14.5, - "c": "#89b087" - }, - "/", - { - "c": "#2277ff", - "w": 1.5 - }, - "\n\nMedia\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#bbddbb" - }, - "(", - { - "x": 10.5, - "c": "#89b087" - }, - "5" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bbddbb" - }, - "$", - { - "x": 1 - }, - ")", - { - "x": 8.5, - "c": "#89b087" - }, - "4", - { - "x": 1 - }, - "6" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#bbddbb" - }, - "`", - { - "x": 6.5 - }, - "/" - ], - [ - { - "y": -0.875, - "c": "#000000", - "t": "#ff0000", - "w": 1.5 - }, - "Symbols\n\n\n\n\n\nShift", - { - "c": "#bbddbb", - "t": "#000000" - }, - "#", - { - "x": 14.5, - "c": "#89b087" - }, - "*", - { - "c": "#000000", - "t": "#ff0000", - "w": 1.5 - }, - "\n\nSymbols\n\n\n\n\nShift" - ], - [ - { - "y": -0.625, - "x": 6.5, - "c": "#54d6de", - "t": "#000000", - "fa": [ - 0, - 0, - 0, - 1 - ], - "h": 1.5 - }, - "Tab >\n\n\nTab", - { - "x": 4.5, - "h": 1.5 - }, - "< Tab\n\n\nShift Tab" - ], - [ - { - "y": -0.75, - "x": 3.5, - "c": "#bbddbb" - }, - "[", - { - "x": 10.5, - "c": "#89b087" - }, - "2" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#bbddbb" - }, - "^", - { - "x": 1 - }, - "]", - { - "x": 8.5, - "c": "#89b087" - }, - "1", - { - "x": 1 - }, - "3" - ], - [ - { - "y": -0.875, - "x": 5.5, - "c": "#bbddbb" - }, - "~", - { - "x": 6.5 - }, - "\\" - ], - [ - { - "y": -0.875, - "c": "#2277ff", - "w": 1.5 - }, - "Capitals\n\n\n\n\n\nShift", - { - "c": "#bbddbb" - }, - "%", - { - "x": 14.5, - "c": "#89b087" - }, - "-", - { - "c": "#2277ff", - "w": 1.5 - }, - "\n\nCapitals\n\n\n\n\nShift" - ], - [ - { - "y": -0.375, - "x": 3.5, - "c": "#77aaff" - }, - "\n\n\nLAlt", - { - "x": 10.5, - "c": "#89b087" - }, - ".\n\n\nOption" - ], - [ - { - "y": -0.875, - "x": 2.5, - "c": "#77aaff" - }, - "Hyper", - { - "x": 1 - }, - "\n\n\nSuper", - { - "x": 8.5, - "c": "#89b087" - }, - "0\n\n\nCmd", - { - "x": 1 - }, - "=\n\n\nHyper" - ], - [ - { - "y": -0.75, - "x": 0.5, - "c": "#77aaff" - }, - "Ctrl\n\n\nLCtrl", - "Meh", - { - "x": 14.5, - "c": "#89b087" - }, - "+\n\n\nMeh", - "Enter\n\n\nCtrl" - ], - [ - { - "r": 30, - "rx": 6.5, - "ry": 4.25, - "y": -1, - "x": 1, - "c": "#54d6de" - }, - "Left", - "Right" - ], - [ - { - "h": 2 - }, - "Space", - { - "h": 2 - }, - "Enter", - "Up" - ], - [ - { - "x": 2 - }, - "Down" - ], - [ - { - "r": -30, - "rx": 13, - "y": -1, - "x": -3 - }, - "Home", - "End" - ], - [ - { - "x": -3 - }, - "Page\n\n\n\n\n\nUp", - { - "h": 2 - }, - "< Del\n\n\nBackspace", - { - "h": 2 - }, - "Del >\n\n\nDelete" - ], - [ - { - "x": -3 - }, - "Page\n\n\n\n\n\nDown" - ] -] \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png b/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png deleted file mode 100644 index 7ca86cf47..000000000 Binary files a/keyboards/ergodox_ez/keymaps/teckinesis/teckinesis-symbol.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/tkuichooseyou/README.md b/keyboards/ergodox_ez/keymaps/tkuichooseyou/README.md deleted file mode 100644 index ab02fac2c..000000000 --- a/keyboards/ergodox_ez/keymaps/tkuichooseyou/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Based on Default OSX -I'm a vim and OSX user - -- Moved Hyper and Meh up, replaced with CMD - - Because I'm used to having symmetrical CMD keys on both hands -- Changed left delete to Tab to match OSX -- Changed left Backspace to CTRL/ESC for vim -- Changed top left and top right arrow to `CMD+{` and `CMD+}` - - Useful for switching tabs in Safari, Xcode, etc. -- Remove the Ctrl from Z and / -- Remove CMD from right quote -- Changed right Alt to Delete - diff --git a/keyboards/ergodox_ez/keymaps/tkuichooseyou/compiled.hex b/keyboards/ergodox_ez/keymaps/tkuichooseyou/compiled.hex deleted file mode 100644 index a8cf4527a..000000000 --- a/keyboards/ergodox_ez/keymaps/tkuichooseyou/compiled.hex +++ /dev/null @@ -1,1137 +0,0 @@ -:100000000C947B020C94C2020C94C2020C94C202A7 -:100010000C94C2020C94C2020C94C2020C94C20250 -:100020000C94C2020C94C2020C94F70D0C94C90EED -:100030000C94C2020C94C2020C94C2020C94C20230 -:100040000C94C2020C9486210C94C2020C94C2023D -:100050000C94C2020C94681C0C94C2020C94C20250 -:100060000C94C2020C94C2020C94C2020C94C20200 -:100070000C94C2020C94C2020C94C2020C94C202F0 -:100080000C94C2020C94C2020C94C2020C94C202E0 -:100090000C94C2020C94C2020C94C2020C94C202D0 -:1000A0000C94C2020C94C2020C94C202360F580F78 -:1000B0004610580F46109D0FC00F461015102810FF -:1000C000F712F712261326135C137C13AD14AD142C -:1000D0008713AD14371437149E14AD14AD14A71440 -:1000E0004414441444144414441444144414441450 -:1000F0004414441444144414441444144414441440 -:10010000561463146A1471147B140000F0A12E00BD -:100110002B002961E100354100001E00140004009D -:100120001D0034004D001F001A0016001B00E104E2 -:100130002A00200008000700060050002C002100C3 -:100140001500090019004F004A00220017000A009C -:100150000500000065642F0A006F0000E300000046 -:10016000E300300A00670000E30000004C002300B9 -:100170001C000B00110000002961240018000D0074 -:10018000100052004B0025000C000E0036005100FC -:100190002800260012000F0037002F002B00270038 -:1001A00013003342380030004E002D00310034007F -:1001B000E500C10000000100010001000100010094 -:1001C00000003A001E0220022202010001003B0052 -:1001D0001F0221022302010001003C002F0226021F -:1001E0002F00010001003D00300227023000010015 -:1001F00001003E003102350035020000010001001F -:1002000001000000010000000100010001000000E9 -:100210000100000001003F005200510024020000D4 -:1002200001004000240021001E00010001004100E7 -:10023000250022001F003700010042002600230095 -:10024000200027000100430025022E0231002E006D -:100250000100440045000100010001000000010010 -:100260000100010001000100000001000100010087 -:1002700001000100010001000100F2000100010085 -:1002800001000100F000F1000100F4000100010094 -:100290000100F3000100F500010001000100010070 -:1002A0000100000001000100010000000100000049 -:1002B0000100010001000000010000000100010038 -:1002C0000100010001000000010001000100010027 -:1002D0000100A9000100010001000100AC00AA001A -:1002E000B600010001000100AB00A8000100010000 -:1002F0000100010001000100010001000100AE0049 -:1003000001000100000016034500720067006F0045 -:1003100044006F007800200045005A0000001603DA -:100320004500720067006F0044006F0078002000F5 -:1003300045005A0000000403090409026D0004018D -:1003400000A0FA09040000010301010009211101C4 -:1003500000012240000705810308000A090401008A -:100360000103010200092111010001224D000705CE -:10037000820308000A0904020001030000000921A9 -:10038000110100012236000705830308000A090451 -:1003900003000103000000092111010001223900BE -:1003A000070584031000011201100100000008ED90 -:1003B000FE071301000102000105010906A1010564 -:1003C0000719E029E7150025019508750181020547 -:1003D000081901290595057501910295017503918B -:1003E0000105071900297715002501957875018108 -:1003F00002C005010980A101850216010026B7008F -:100400001A01002AB700751095018100C0050C097A -:1004100001A1018503160100269C021A01002A9CF5 -:1004200002751095018100C005010902A1010901B1 -:10043000A10005091901290515002501950575017A -:10044000810295017503810105010930093115818A -:10045000257F95027508810609381581257F95014C -:1004600075088106050C0A38021581257F950175EE -:10047000088106C0C005010906A101050719E02988 -:10048000E715002501950875018102950175088120 -:100490000105081901290595057501910295017558 -:1004A0000391010507190029FF150026FF00950695 -:1004B00075088100C000000000000000000000007E -:1004C000010204060A0F17202C3A4A5D71879DB37A -:1004D000C7DAE9F5FCFFFCF5E9DAC7B39D87715D82 -:1004E0004A3A2C20170F0A060402010000000000FF -:1004F00000000000000011241FBECFEFDAE0DEBFD5 -:10050000CDBF04B603FE27C0809101029091020284 -:10051000A0910302B09104028730904BA740B04BEA -:10052000D1F4109201021092020210920302109272 -:10053000040214BE84B7877F84BF0FB6F894A895D1 -:1005400080916000886180936000109260000FBE0F -:10055000E0E0FFE3099511E0A0E0B1E0E6EBF6E4AE -:1005600002C005900D92A433B107D9F712E0A4E3BD -:10057000B1E001C01D92A130B107E1F70E943C0B30 -:100580000C9459230C9400001092B9008AE08093D7 -:10059000B800089594EA9093BC009091BC0097FF36 -:1005A000FCCF9091B900987F983021F0903111F0F4 -:1005B00081E008958093BB0084E88093BC00809123 -:1005C000BC0087FFFCCF8091B900887F883111F093 -:1005D000803471F780E0089584E98093BC008091B5 -:1005E000BC0084FDFCCF08958093BB0084E8809319 -:1005F000BC008091BC0087FFFCCF9091B900987F30 -:1006000081E0983209F480E0089584E88093BC008A -:100610008091BC0087FFFCCF8091BB00089580B320 -:100620008C7080BB81B3836F81BB08958091010181 -:10063000811115C080E40E94CA02809301018111DA -:100640000CC082E10E94F40280930101811105C077 -:100650008FEF0E94F402809301010E94EC0284B1AA -:10066000807F84B985B1807F85B98AB1837F8AB95B -:100670008BB1837F8BB93E98469808950E94E00421 -:10068000809301010E9416030E940F03A5E3B1E0CD -:10069000E3E4F1E08EE08E0F11921D928E13FCCFF9 -:1006A0000C94CA040E94E004809301010E94160386 -:1006B0000E940F03A5E3B1E0E3E4F1E08EE08E0FCA -:1006C00011921D928E13FCCF0895BF92CF92DF92AC -:1006D000EF92FF920F931F93CF93DF9380910101CD -:1006E000882379F0809134018F5F809334018111E8 -:1006F00008C00E94E00480930101811102C00E94A1 -:10070000720405E311E0C0E0D0E0DD24D39482E080 -:10071000C82EEE24E394F12CC730D10500F580916A -:100720000101811164C080E40E94CA02809301012A -:10073000811112C082E10E94F402809301018111B3 -:100740000BC0C7010C2E01C0880F0A94EAF78095F0 -:100750000E94F402809301010E94EC0248C0CA305A -:10076000A1F028F4C83059F0C93061F005C0CC3090 -:1007700089F070F0CD3089F0209A289810C0219A25 -:1007800029980DC0229A2A980AC0239A2B9807C04C -:10079000529A01C0539A5B9802C03E9A469890EADA -:1007A0009A95F1F79FB1799902C082E001C080E08B -:1007B00091709D25982B7C9902C084E001C080E057 -:1007C000892B7D9902C038E001C030E0832B7E99EF -:1007D00002C020E101C020E0822B9FB19095991FBB -:1007E0009927991F9295990F907E892B0FC0809120 -:1007F0000101811149C080E40E94CA028093010175 -:10080000882379F1B12C0E94EC028B2DF8019081A4 -:10081000981719F08083C09200010E941603219658 -:100820000F5F1F4FCE30D10509F076CF80910001C8 -:10083000882361F1815080930001882339F08FE98A -:100840009FE00197F1F700C0000020C0A3E4B1E0F1 -:10085000E5E3F1E0CF01825F91919D938E13FCCF90 -:1008600015C083E10E94F402809301018111CACF77 -:1008700081E40E94CA02809301018111C3CF0E94CA -:100880000503B82EB094BFCF80E0C0CF0E947004A3 -:1008900081E0DF91CF911F910F91FF90EF90DF905A -:1008A000CF90BF900895E82FF0E0ED5BFE4F808180 -:1008B000089508950F931F93CF93DF93C3E4D1E07E -:1008C00010E00C2F025F899190E00E948C1B180FA2 -:1008D0000C13F9CF812FDF91CF911F910F910895C4 -:1008E0000C94400556985E9825982D9826982E9839 -:1008F00027982F988FEF90E090938900809388003D -:1009000090938B0080938A0090938D0080938C004D -:10091000259A2D9A2FEF80E792E021508040904059 -:10092000E1F700C00000269A2E9A2FEF80E792E0B0 -:10093000215080409040E1F700C00000279A2F9A94 -:100940002FEF80E792E0215080409040E1F700C017 -:10095000000025982D982FEF80E792E021508040ED -:100960009040E1F700C0000026982E982FEF80E716 -:1009700092E0215080409040E1F700C000002798AD -:100980002F9856985E9825982D9826982E982798F7 -:100990002F98089589EA8093800089E080938100F0 -:1009A00024982C983F988AB18F748AB96E98479A88 -:1009B0008BB1806B8BB9769A0E9472040C943F05C0 -:1009C00080E2809301018091510181110EC00E944B -:1009D000C40281E0809351012FEF83ED90E3215019 -:1009E00080409040E1F700C0000080E40E94CA020D -:1009F0008093010181112EC00E94F40280930101B5 -:100A0000811128C00E94F40280930101811122C04B -:100A10008FE30E94F4028093010181111BC00E94A8 -:100A2000EC0280E40E94CA0280930101811112C08D -:100A30008CE00E94F4028093010181110BC00E949E -:100A4000F40280930101811105C08FE30E94F4023A -:100A5000809301010E94EC028091010108956111CF -:100A60000BC0FC018281882321F085EE0E949B113E -:100A700003C085EE0E94631280E090E0089508951F -:100A80006091C2017091C3018091C4019091C50130 -:100A90000E94981B56985E9825982D9826982E9817 -:100AA00027982F98813019F0823021F00895259AE7 -:100AB0002D9A0895269A2E9A089581E0089581E04E -:100AC00008950C945F050895282F882339F090E04D -:100AD0002A3010F44D9608950697089587E290E025 -:100AE0000895AF92BF92DF92EF92FF920F931F9300 -:100AF000CF93DF938C01FC01C081D181CE010E9494 -:100B0000111ABE010E94E908EC01B8010E946105BA -:100B1000882309F4D1C1F8018281882309F4C6C071 -:100B200080916201811127C0C431F0E7DF0709F02D -:100B3000BDC10E94630581E0809362010E94321C66 -:100B400090936101809360011092550110925701BA -:100B500010925601109259011092580110925B01A7 -:100B600010925A0110925D0110925C0110925F0187 -:100B700010925E01A1C180916001909161010E947B -:100B80003E1C883C910570F480915501E82FF0E0FF -:100B9000EE0FFF1FEA5AFE4FD183C0838F5F809311 -:100BA00055018AC1C13020E8D20708F451C0F801CC -:100BB0008281882309F47EC05E01E894B7F88091B1 -:100BC0005401813079F050F08230C1F482EE0E94FD -:100BD0009B1187E50E949B1187E50EC082EE0E9463 -:100BE0009B110CC080EE0E949B1181EE0E949B1114 -:100BF00088E10E949B1188E10E9463128CE0E82E3C -:100C0000F12CC5010E2C02C0969587950A94E2F747 -:100C10008F700E946405D82E0E949B118D2D0E941A -:100C20006312F4E0EF1AF1082CEFE2162FEFF20650 -:100C300041F780915401813029F010F0823041F465 -:100C400082EE04C080EE0E94631281EE0E94631265 -:100C5000C43180E7D80768F4C23090E7D90708F0BC -:100C600046C0C115E0E7DE0771F0C130D047A1F101 -:100C70000CC1C33320E7D20709F4D8C0C433D0472E -:100C800009F4EBC002C1F8018281882309F402C192 -:100C90000E941815FFEF24E38CE0F15020408040C3 -:100CA000E1F700C000000E948D1C06C1C13080E841 -:100CB000D80770F2C43120E7D20708F0B3C0C230C1 -:100CC00080E7D807A0F4C11590E7D90709F4E2C07E -:100CD000C130D04709F0D9C0F8018281882309F4D6 -:100CE000D9C08091DF0181608093DF01E5C0F80108 -:100CF0008281882309F4CEC00E94E71C811102C0C2 -:100D00000E94CD1C0E94FA1C90E09093F301809306 -:100D1000F201C230F0E7DF0721F48091F201816037 -:100D20007AC0C33020E7D20721F48091F2018260BB -:100D300072C0C43080E7D80721F48091F20184604A -:100D40006AC0C53090E7D90719F48091F20127C035 -:100D5000C630E0E7DE0721F48091F20180615BC0DC -:100D6000C730F0E7DF0721F48091F201806253C0C1 -:100D7000C83020E7D20721F48091F20180644BC093 -:100D8000C93080E7D80721F48091F201806843C020 -:100D9000CA3090E7D90729F48091F2018460886015 -:100DA0003AC0CB30E0E7DE0721F48091F2018E7F7C -:100DB00032C0CC30F0E7DF0721F48091F2018D7F63 -:100DC0002AC0CD3020E7D20721F48091F2018B7F39 -:100DD00022C0CE3080E7D80719F48091F2011AC002 -:100DE0008091F201CF3090E7D90711F48F7E13C0C4 -:100DF000C031E0E7DE0711F48F7D0DC0C131F0E7AF -:100E0000DF0711F48F7B07C0C231D04711F48F7711 -:100E100002C08B7F877F8093F2018091F2010E9454 -:100E2000FE1C4AC0C333F0E7DF07A1F4F80182815A -:100E3000882321F01092520182E016C08091520165 -:100E4000811106C086E20E949B1186E20E94631215 -:100E500082E018C0C433D047C1F4F80182818823EE -:100E600031F01092530180E20E94B21225C08091AD -:100E70005301811106C087E20E949B1187E20E9404 -:100E8000631280E20E94B91217C081E08093520180 -:100E900080935301C801DF91CF911F910F91FF9073 -:100EA000EF90DF90BF90AF900C945D05C130F0E8FB -:100EB000DF0708F081CECCCE80E0DF91CF911F918B -:100EC0000F91FF90EF90DF90BF90AF90089526E0D4 -:100ED000729FF001112444E5849FE00DF11D11245F -:100EE000E60FF11DEE0FFF1FE25FFE4F859194911B -:100EF0000E94FB08811560E49607B0F5811570E348 -:100F0000970708F0DEC0803E9105D8F4803C91053B -:100F100008F06CC0883A910578F4853A910508F09C -:100F20006BC08130910509F452C108F40FC18430BF -:100F3000910508F04CC10AC18B3B910508F467C0CC -:100F400005C18F3F910509F048F4803F910508F0F5 -:100F5000ADC0883E910508F43AC1F8C0811520E281 -:100F6000920708F0A5C00895811543E5940790F411 -:100F7000811562E5960708F0C8C0811571E59707ED -:100F800008F0BEC0811520E5920708F09DC09F7053 -:100F9000906A0895811545E59407D8F4811564E5B4 -:100FA000960708F0C8C0482F4695469570E2479FBF -:100FB000A00111248370992721E030E0B90102C01B -:100FC000660F771F8A95E2F7CB01842B952B9A68E1 -:100FD0000895811576E5970708F4B2C09C01305654 -:100FE0002115304108F0B2C09F70AEC0FC01EE0F79 -:100FF000FF1FE657F04062C0853A910509F4A9C089 -:10100000863A910509F0A8C082E890E40895883AEC -:10101000910509F4A4C0893A910509F4A3C08A3A5C -:10102000910509F4A2C08B3A910509F4A1C08C3A4C -:10103000910509F4A0C08D3A910509F49FC0803B49 -:10104000910509F49EC08E3A910509F49DC08F3A2E -:10105000910509F49CC0813B910509F49BC0823B3A -:10106000910509F49AC0833B910509F499C0843B2A -:10107000910509F498C0853B910509F497C0863B1A -:10108000910509F496C0873B910509F495C0883B0A -:10109000910509F494C0893B910509F493C08A3BFA -:1010A000910509F492C080E094E408959065089554 -:1010B000FC01FF70EE0FFF1FE65FFE4F85919491DC -:1010C00008959927906C0895482F437021E030E0EF -:1010D00002C0220F331F4A95E2F73C68AC0164E07E -:1010E000569547956A95E1F74370342B8F70869536 -:1010F000869560E2869FC0011124822B932B089570 -:10110000982F8827816F906A0895482F46954695B5 -:1011100070E2479FA00111248370992721E030E0FD -:10112000B90102C0660F771F8A95E2F7CB01842BC5 -:10113000952B9C680895982F8827846F906A08954E -:101140008F719927982F88279062089580E090E00A -:10115000089581E890E4089583E890E4089582EE8C -:1011600094E4089589EE94E408958AEE94E4089551 -:1011700085EB94E4089586EB94E4089587EB94E47A -:1011800008958CEC94E408958DEC94E4089583E83C -:1011900095E408958AE895E4089582E995E4089530 -:1011A00084E995E4089581E296E4089583E296E463 -:1011B000089584E296E4089585E296E4089586E22F -:1011C00096E4089587E296E408958AE296E4089505 -:1011D000089596E0799FF001112494E5899FE00D30 -:1011E000F11D1124E60FF11DEE0FFF1FE25FFE4F10 -:1011F0008591949108958238910549F1B0F4813335 -:10120000910509F458C048F48932910509F44EC09B -:101210008A32910509F454C008958533910509F483 -:1012200040C08933910599F00895833E910529F1D5 -:1012300038F4803E910591F0823E9105A1F0089529 -:10124000863E9105F9F0873E910531F10895209190 -:10125000F20120FD3AC021FD38C008958091F201CD -:1012600080FD35C032C08091F20182FF32C0809192 -:10127000F20184FD30C083EE39C08091F20182FD1D -:1012800028C0F5CF8091F20183FF27C08091F20141 -:1012900084FD21C087EE2AC08091F20183FD1DC02C -:1012A000F5CF8091F20185FD1AC01BC08091F2013B -:1012B00085FD17C014C08091F20186FD14C015C0D1 -:1012C0008091F20186FD11C00EC080EE0FC089E34F -:1012D0000DC082EE0BC080E009C086EE07C089E237 -:1012E00005C085E303C08AE201C081E390E0089570 -:1012F00008950C947809809173010895CF93DF933A -:1013000000D01F92CDB7DEB79C018091F8018430E8 -:1013100019F593E099833B832A839093E9008FEF3B -:101320009091E800815095FD06C095ED9A95F1F7F2 -:1013300000008111F5CF8091E80085FF0DC040E0ED -:1013400050E063E070E0CE0101960E94E70B8091CF -:10135000E8008E778093E8000F900F900F90DF9158 -:10136000CF910895CF93DF9300D01F92CDB7DEB712 -:101370002091F801243021F522E029839B838A8380 -:1013800083E08093E9008FEF9091E800815095FD14 -:1013900006C095ED9A95F1F700008111F5CF809187 -:1013A000E80085FF0DC040E050E063E070E0CE0152 -:1013B00001960E94E70B8091E8008E778093E80009 -:1013C0000F900F900F90DF91CF9108952091F80129 -:1013D0002430F1F422E02093E9002FEF3091E8006F -:1013E000215035FD06C035ED3A95F1F70000211189 -:1013F000F5CF2091E80025FF0BC040E050E065E00C -:1014000070E00E94E70B8091E8008E778093E800FF -:101410000895CF93DF93EC019091F801943009F097 -:1014200046C080910C018823D9F080910D0188235A -:10143000B9F09093E9008FEF9091E800815095FD0D -:1014400006C095E19A95F1F700008111F5CF8091E2 -:10145000E80085FF2CC040E050E060E170E017C07C -:1014600081E08093E9008FEF9091E800815095FD35 -:1014700006C095ED9A95F1F700008111F5CF8091A6 -:10148000E80085FF14C040E050E068E070E0CE0165 -:101490000E94E70B8091E8008E778093E80080E15E -:1014A000FE01A3E6B1E001900D928A95E1F7DF918C -:1014B000CF9108958091F701811109C00E947C0DA0 -:1014C0000E94D90D8091E20084608093E20008952B -:1014D0001092F701089508950C9473210E94231C23 -:1014E0000E9479210E947F100C94790942E061ECFE -:1014F00081E00E94F60C42E061EC82E00E94F60C72 -:1015000042E061EC83E00E94F60C42E161EC84E091 -:101510000C94F60C8091FA01833009F455C030F434 -:10152000813071F0823009F48EC008958A3009F458 -:101530007AC08B3009F460C0893009F09CC020C0AB -:101540008091F901813A09F096C08091E800877F87 -:101550008093E8008091FD019091FE01892B21F498 -:1015600060E183E691E003C060E080E090E070E03D -:101570000E94320C8091E8008B778093E8000895F8 -:101580008091F901813209F076C08091FD0190913E -:10159000FE01009719F0039709F06DC08091E800F3 -:1015A000877F8093E8008091E80082FD05C08091EC -:1015B000F8018111F8CF5FC08091F1008093730131 -:1015C0008091E8008B7753C08091F901813A09F04E -:1015D00052C08091FD019091FE01892B09F04BC012 -:1015E0008091E800877F8093E8008091E80080FF89 -:1015F000FCCF80910C0136C08091F9018132D9F580 -:101600008091FD019091FE01892BA9F58091E80060 -:10161000877F8093E8000E942B0D8091FB018093CF -:101620000C010C9418158091F901813221F58091FB -:10163000E800877F8093E8000E942B0D8091FC01D9 -:101640008093740108958091F901813AA1F4809109 -:10165000E800877F8093E8008091E80080FFFCCF5E -:10166000809174018093F1008091E8008E778093DF -:10167000E8000C942B0D089584B7877F84BF0FB6C4 -:10168000F894A89580916000886180936000109222 -:1016900060000FBE80E880936100109261000E949C -:1016A000CE100E947C0D0E94D90D8091E2008460D2 -:1016B0008093E20078940E945F100E94D01082E034 -:1016C00091E00E947A100E9461218091F80185309A -:1016D00069F40E94E81B8091F6018823B1F30E940F -:1016E000151C882391F30E94D10BEFCF0E94D610D6 -:1016F000ECCF292F332723303105C9F064F4213092 -:10170000310581F02230310509F043C08DE690E0CB -:101710002AE333E042C021323105F1F022323105B3 -:1017200041F137C082E190E027EA33E036C09927E3 -:101730008130910541F08230910541F0892B49F5C6 -:10174000E6E3F3E005C0EEE1F3E002C0E6E0F3E03B -:10175000849190E09F0121C06430D8F4E62FF0E03E -:10176000EE0FFF1FEE5DFE4F2081318189E090E09A -:1017700014C0643070F470E0FB01EE0FFF1FE65EF2 -:10178000FE4F20813181FB01EA5EFE4F808190E0B7 -:1017900004C080E090E020E030E0FA013183208353 -:1017A000089580E189BD82E189BD09B400FEFDCFC5 -:1017B0008091D8008F7D8093D8008091E000826076 -:1017C0008093E0008091E00081FDFCCF0895CF92EE -:1017D000DF92EF92FF920F931F93CF93DF93EC0171 -:1017E0008B016A010E944A0D811133C0C114D104DA -:1017F00039F0F60180819181081B190BC80FD91FA0 -:10180000E12CF12C0115110519F18091E80085FDFD -:1018100016C08091E8008E778093E800C114D1044F -:1018200049F0F60180819181E80EF91EF182E08293 -:1018300085E00FC00E944A0D882321F30AC08991D8 -:101840008093F10001501109FFEFEF1AFF0ADACF80 -:1018500080E0DF91CF911F910F91FF90EF90DF908B -:10186000CF9008952091FF0130910002261737078D -:1018700048F06115710539F42091E8002E77209326 -:10188000E80001C0B90140E061157105A9F120919E -:10189000F801222309F443C0253009F442C0209105 -:1018A000E80023FD40C02091E80022FD32C02091D5 -:1018B000E80020FFE9CF4091F3002091F20030E0F2 -:1018C000342BFC01CF016115710559F02830310529 -:1018D00040F481918093F100615071092F5F3F4F77 -:1018E000F1CF41E02830310509F040E02091E800D7 -:1018F0002E772093E800C8CF4111C9CF0AC080914C -:10190000F801882361F0853061F08091E80083FD63 -:101910000AC08091E80082FFF2CF80E0089582E063 -:10192000089583E0089581E008952091FF013091AA -:1019300000022617370748F06115710539F4209128 -:10194000E8002E772093E80001C0B901FC0120E0F7 -:101950006115710591F18091F801882309F440C067 -:10196000853009F43FC08091E80083FD3DC080913F -:10197000E80082FD2FC08091E80080FFE9CF209130 -:10198000F3008091F20090E0922B6115710559F0FF -:101990008830910540F424912093F10031966150F4 -:1019A00071090196F2CF21E0089709F020E08091BB -:1019B000E8008E778093E800CBCF2111CCCF0AC00E -:1019C0008091F801882361F0853061F08091E80012 -:1019D00083FD0AC08091E80082FFF2CF80E0089585 -:1019E00082E0089583E0089581E00895982F97306C -:1019F00058F59093E900981739F07091EC00209118 -:101A0000ED005091F00003C0242F762F50E021FF0D -:101A100019C03091EB003E7F3093EB003091ED0028 -:101A20003D7F3093ED003091EB0031603093EB005F -:101A30007093EC002093ED005093F0002091EE00A5 -:101A400027FF07C09F5FD3CF8F708093E90081E0AD -:101A5000089580E008958091F90187FF11C0809179 -:101A6000E80082FD05C08091F8018111F8CF11C016 -:101A70008091E8008B770BC08091F801882349F0B2 -:101A80008091E80080FFF8CF8091E8008E77809306 -:101A9000E80008952091E4003091E50095E640913A -:101AA000EC00842F817040FF22C08091E80080FD0F -:101AB0001CC08091F801882391F0853091F08091CD -:101AC000EB0085FD10C04091E4005091E500421705 -:101AD000530729F39A01915011F784E0089582E0A9 -:101AE000089583E0089581E0089580E0089540918D -:101AF000E80042FFDECF08950E94EA0D0E94F20D39 -:101B0000E0EEF0E0808181608083E8EDF0E08081AC -:101B10008F77808319BCA7EDB0E08C918E7F8C937A -:101B200080818F7E80831092F70108950F931F9319 -:101B3000CF93DF930E94EA0D0E94F20DC8EDD0E032 -:101B400088818F77888388818068888388818F7D6A -:101B5000888319BC1092F8011092F4011092F601DA -:101B60001092F50100EE10E0F80180818B7F8083F8 -:101B700088818160888342E060E080E00E94F60C0A -:101B8000E1EEF0E080818E7F8083E2EEF0E0808104 -:101B900081608083808188608083F80180818E7F6E -:101BA0008083888180618883DF91CF911F910F911D -:101BB0000895E8EDF0E080818F7E8083E7EDF0E02E -:101BC00080818160808384E082BF81E08093F7011F -:101BD0000C94960DE8EDF0E080818E7F808310926A -:101BE000E20008951092DA001092E10008951F9229 -:101BF0000F920FB60F9211242F933F934F935F9341 -:101C00006F937F938F939F93AF93BF93EF93FF93C4 -:101C10008091E10082FF0BC08091E20082FF07C04B -:101C20008091E1008B7F8093E1000E945E108091A3 -:101C3000DA0080FF1FC08091D80080FF1BC0809118 -:101C4000DA008E7F8093DA008091D90080FF0DC08A -:101C500080E189BD82E189BD09B400FEFDCF81E04C -:101C60008093F8010E945A0A05C019BC1092F8012D -:101C70000E94680A8091E10080FF19C08091E20013 -:101C800080FF15C08091E2008E7F8093E2008091FA -:101C9000E20080618093E2008091D80080628093AE -:101CA000D80019BC85E08093F8010E946C0A8091ED -:101CB000E10084FF30C08091E20084FF2CC080E10D -:101CC00089BD82E189BD09B400FEFDCF8091D800B5 -:101CD0008F7D8093D8008091E1008F7E8093E1001A -:101CE0008091E2008F7E8093E2008091E20081602B -:101CF0008093E2008091F401882311F084E007C012 -:101D00008091E30087FD02C081E001C083E0809301 -:101D1000F8010E946E0A8091E10083FF29C0809142 -:101D2000E20083FF25C08091E100877F8093E1007E -:101D300082E08093F8011092F4018091E1008E7F9F -:101D40008093E1008091E2008E7F8093E200809199 -:101D5000E20080618093E20042E060E080E00E9467 -:101D6000F60C8091F00088608093F0000E946B0A6E -:101D7000FF91EF91BF91AF919F918F917F916F9163 -:101D80005F914F913F912F910F900FBE0F901F9039 -:101D900018951F920F920FB60F9211242F933F9315 -:101DA0004F935F936F937F938F939F93AF93BF9363 -:101DB000CF93DF93EF93FF93C091E900CF708091B1 -:101DC000EC00D82FD17080FDD0E81092E90080910E -:101DD000F000877F8093F00078940E940D0F10929E -:101DE000E9008091F00088608093F000CD2BCF70E7 -:101DF000C093E900FF91EF91DF91CF91BF91AF9137 -:101E00009F918F917F916F915F914F913F912F9112 -:101E10000F900FBE0F901F9018951F93CF93DF93D5 -:101E2000CDB7DEB7AA970FB6F894DEBF0FBECDBF11 -:101E3000E9EFF1E088E08E0F9091F10091938E131D -:101E4000FBCF0E948A0A8091E80083FF1FC1809126 -:101E5000F9019091FA01492F50E04A30510508F0FC -:101E600015C1FA01EA5AFF4F0C940A23803881F019 -:101E7000823809F00BC18091FD018F708093E900D9 -:101E80008091EB0085FB882780F91092E90006C05D -:101E90008091F5019091F601911182609091E80096 -:101EA000977F9093E8008093F1001092F100C8C0F2 -:101EB000282F2D7F09F0EAC0882319F0823061F0C5 -:101EC000E5C08091FB01813009F0E0C0933009F05A -:101ED00080E08093F6012BC08091FB01811127C027 -:101EE0008091FD018F7009F4D1C08093E9002091A9 -:101EF000EB0020FF1CC0933021F48091EB00806246 -:101F000014C09091EB0090619093EB0021E030E0E1 -:101F1000A90102C0440F551F8A95E2F74093EA00D9 -:101F20001092EA008091EB0088608093EB001092A1 -:101F3000E9008091E800877F86C08111A7C01091D9 -:101F4000FB011F778091E3008078812B8093E30071 -:101F50008091E800877F8093E8000E942B0D80919C -:101F6000E80080FFFCCF8091E30080688093E3006D -:101F7000111102C082E001C083E08093F80186C0A5 -:101F80008058823008F082C08091FB019091FC0162 -:101F90008C3D53E0950779F583E08A838AE2898353 -:101FA0004FB7F894DE01139620E03EE051E2E32FB4 -:101FB000F0E050935700E49120FF03C0E295EF70EA -:101FC0003F5FEF708E2F90E0EA3010F0C79601C0AF -:101FD000C0968D939D932F5F243149F74FBF809119 -:101FE000E800877F8093E8006AE270E0CE01019606 -:101FF0000E94320C14C0AE014F5F5F4F6091FD0133 -:102000000E94790BBC01892B09F440C09091E80033 -:10201000977F9093E80089819A810E94950C809126 -:10202000E8008B778093E80031C0803879F58091A3 -:10203000E800877F8093E8008091F4018093F100AD -:102040008091E8008E778093E8000E942B0D1EC0DF -:1020500081111CC09091FB019230C0F48091E80086 -:10206000877F8093E8009093F4010E942B0D80916C -:10207000F401811106C08091E30087FD02C081E078 -:1020800001C084E08093F8010E94760A8091E80004 -:1020900083FF0AC08091E800877F8093E8008091E9 -:1020A000EB0080628093EB00AA960FB6F894DEBF37 -:1020B0000FBECDBFDF91CF911F9108950895CF93AB -:1020C0008091F8018823A1F0C091E900CF70909130 -:1020D000EC00892F817090FD80E8C82B1092E900F8 -:1020E0008091E80083FD0E940D0FCF70C093E9003E -:1020F000CF91089590937A01809379010895E091AA -:102100007901F0917A01309721F00190F081E02D72 -:10211000099480E00895E0917901F0917A01309777 -:1021200021F00280F381E02D09940895E091790176 -:10213000F0917A01309721F00480F581E02D099427 -:10214000089520917701309178018217930771F0FB -:102150009093780180937701E0917901F0917A0171 -:10216000309721F00680F781E02D099408952091A1 -:102170007501309176018217930771F09093760183 -:1021800080937501E0917901F0917A01309721F007 -:102190000084F185E02D0994089508950C94CD10E4 -:1021A0000E94291C0E943E030C94AF1C9F92AF9288 -:1021B000BF92CF92DF92EF92FF920F931F93CF9334 -:1021C000DF9300D000D000D0CDB7DEB70E9465030A -:1021D0000DE010E0AA24A394B12C902E802F0E9431 -:1021E0005304980124583E4F6901F901F080F82604 -:1021F000A1F40150110988F78FEF89838A831B822C -:102200000E94321C8160782F9D838C8349815A8182 -:102210006B818D810E946D112FC09091DF0191FF24 -:1022200004C08E830E9459048E8125E030E0A50110 -:10223000022E01C0440F0A94EAF7E42E4F21C1F0A8 -:1022400029839A828E2191E009F490E09B830E9479 -:10225000321C8160782F9D838C8349815A816B81E8 -:102260008D810E946D11F6018081E826E08204C014 -:1022700021503109E0F6BDCF0E947D1E10917B01F7 -:102280000E947F101817B9F00E947F1080937B0185 -:1022900026960FB6F894DEBF0FBECDBFDF91CF916B -:1022A0001F910F91FF90EF90DF90CF90BF90AF9074 -:1022B0009F900C94790926960FB6F894DEBF0FBE56 -:1022C000CDBFDF91CF911F910F91FF90EF90DF90E5 -:1022D000CF90BF90AF909F900895CF93DF93CDB7ED -:1022E000DEB72B970FB6F894DEBF0FBECDBF4F837E -:1022F000588769877A878B87DE01119686E0FD0112 -:1023000011928A95E9F785E0FE01379601900D92CA -:102310008A95E1F749815A816B817C818D819E810B -:102320000E94B6172B960FB6F894DEBF0FBECDBF36 -:10233000DF91CF910895CF93882309F4C2C0C82FAD -:10234000823859F40E947F1081FDBBC089E30E944E -:10235000901A0E945D1B89E30CC0833879F40E94B7 -:102360007F1080FDAEC083E50E94901A0E945D1B25 -:1023700083E50E94D21ACF910C945D1B843859F4E6 -:102380000E947F1082FD9DC087E40E94901A0E94E7 -:102390005D1B87E4EECF8CEF8C0F813A48F48C2FD5 -:1023A0000E94C72081118DC08C2F0E94901AE3CF0C -:1023B00080E28C0F883048F4C77081E001C0880F3C -:1023C000CA95EAF70E94161BD6CF8BE58C0F833097 -:1023D00078F4C53A29F0C63A31F083E890E005C0B8 -:1023E00081E890E002C082E890E0CF910C94A110C7 -:1023F00088E58C0F833108F064C0C83A39F1C93AD6 -:1024000041F1CA3A49F1CB3A51F1CC3A59F1CD3ABE -:1024100061F1C03B69F1CE3A71F1CF3A79F1C13B3C -:1024200081F1C23B89F1C33B91F1C43B99F1C53BBA -:10243000A1F1C63BA9F1C73BB1F1C83BB9F1C93B1A -:10244000C1F1CA3BC9F180E090E038C082EE90E073 -:1024500035C089EE90E032C08AEE90E02FC085EB67 -:1024600090E02CC086EB90E029C087EB90E026C07E -:102470008CEC90E023C08DEC90E020C083E891E0EC -:102480001DC08AE891E01AC082E991E017C084E992 -:1024900091E014C081E292E011C083E292E00EC0AC -:1024A00084E292E00BC085E292E008C086E292E00E -:1024B00005C087E292E002C08AE292E0CF910C94DC -:1024C000B710CF910895882309F44BC0823859F48E -:1024D0000E947F1081FF45C089E30E94901A0E94EC -:1024E0005D1B89E30CC0833871F40E947F1080FF6C -:1024F00038C083E50E94901A0E945D1B83E50E940C -:10250000D21A0C945D1B843859F40E947F1082FF0C -:1025100028C087E40E94901A0E945D1B87E4EFCFD9 -:102520009CEF980F913A58F390E2980F983050F43E -:10253000877091E001C0990F8A95EAF7892F0E9470 -:102540001C1BDFCF9BE5980F933020F480E090E0D8 -:102550000C94A110885A833120F480E090E00C9410 -:10256000B7100895882321F00E94161B0C945D1B60 -:102570000895882321F00E941C1B0C945D1B089574 -:102580007F928F929F92AF92BF92CF92DF92EF9203 -:10259000FF920F931F93CF93DF931F92CDB7DEB7B8 -:1025A0007C01C62E772EFC01058102950F701281E9 -:1025B00011110E94331B0E94891A882379F011237C -:1025C00069F080E28C0D883048F082E00E94721A37 -:1025D0000E94891A91E0D82ED92601C0D12CE72D6E -:1025E000E295EF70F0E0E05AFF4F0C940A23872D3C -:1025F000807F072D0F70882311F00295007F112333 -:1026000089F0002309F490C180E28C0D883020F419 -:10261000802F0E94161B03C0802F0E94261B0E9441 -:102620005D1B82C18C2D0E946312002309F495C1A9 -:1026300080E28C0D883020F4802F0E941C1B03C088 -:10264000802F0E942C1B0E945D1B87C1972D907FBD -:10265000872D8F70903211F08295807FCC2021F0F1 -:10266000F1E0CF16B1F01EC0112349F0002309F4A8 -:1026700014C1013009F011C10E94461B6EC1002334 -:1026800019F0013009F469C189830E94491B8981CD -:102690000AC1112321F0023008F05FC1FEC0011110 -:1026A0005CC101C1112321F0002309F4F6C03CC133 -:1026B000002309F4F8C03EC1872D86958695837066 -:1026C00090E0009719F0019761F047C1112321F0C4 -:1026D0008C2D972D937002C080E090E00E94A11095 -:1026E0003CC1112321F08C2D972D937002C080E006 -:1026F00090E00E94B71031C18C2D112319F00E9477 -:10270000851D02C00E94ED1D0E94721E26C1872DEC -:10271000837009F052C0111120C18C2D82958695CD -:102720008770880F880F9C2D9F70892E912CA12C6B -:10273000B12C082E04C0880C991CAA1CBB1C0A943E -:10274000D2F7C4FE14C00FE010E020E030E0B90181 -:10275000A80104C0440F551F661F771F8A95D2F742 -:10276000CB01BA01609570958095909503C060E0AB -:1027700070E0CB01272D26952695237030E022307E -:10278000310569F02330310589F0682979298A29D2 -:102790009B292130310571F00E94FE18DEC06829A6 -:1027A00079298A299B290E941A19D7C00E94FE18EC -:1027B000C501B4010E94E218D0C0112319F0872D81 -:1027C000817001C08695882309F4C7C08C2D82953D -:1027D00086958770880F880F9C2D9F70892E912C6D -:1027E000A12CB12C082E04C0880C991CAA1CBB1C5F -:1027F0000A94D2F7C4FE14C00FE010E020E030E0ED -:10280000B901A80104C0440F551F661F771F8A95A0 -:10281000D2F7CB01BA01609570958095909503C071 -:1028200060E070E0CB01272D269526952370422F7E -:1028300050E04230510569F04330510589F0682974 -:1028400079298A299B294130510571F00E94D819B4 -:1028500084C0682979298A299B290E94F4197DC09E -:102860000E94D819C501B4010E94BC1976C08C2DF4 -:1028700090E0FC01E05EF109E531F10508F050C09F -:10288000E059FF4F0C940A230C2D0F70872D8F7188 -:10289000112331F00E945519802F0E94B2125DC0A1 -:1028A0000E947619802F0E94B91257C0112339F067 -:1028B000011153C0872D8F710E949B194EC00230A9 -:1028C00008F04BC0F7CF112339F0872D8F710E948C -:1028D000551943C01123C9F3872D8F710E947619B2 -:1028E0003CC0112329F0872D8F710E94401935C0FB -:1028F0000E94361932C0112351F0172D1F71812FFC -:102900000E94551963E0812F0E94691A26C081E058 -:102910000E94721A023008F182E00E94721A1DC0F1 -:10292000112331F0002389F28C2D0E949B1115C0D8 -:10293000002391F28C2D0E9463120FC0472D4F701F -:102940006C2DC7010E942F050E945A1806C0472D02 -:102950004F706C2DC7010E94E808DD20F9F00E943D -:10296000651A80FD1BC0F70112820E945F1A0E9447 -:102970005519C7010E94DD140E945F1A0F90DF9164 -:10298000CF911F910F91FF90EF90DF90CF90BF906C -:10299000AF909F908F907F900C9476190F90DF915D -:1029A000CF911F910F91FF90EF90DF90CF90BF904C -:1029B000AF909F908F907F9008950F931F93CF9328 -:1029C000DF93EC01888199812B813C81232BB9F025 -:1029D0009F3F11F48F3F99F0CE010E94710588232B -:1029E00071F0688179818A810E945B1A8C010E9452 -:1029F000101A0E94D718B801CE010E94C012DF91B0 -:102A0000CF911F910F9108950E94331B0E94431B89 -:102A10000E94081B0E945D1B0E94231F0E94721EC1 -:102A200080E090E00E94A11080E090E00C94B7104C -:102A30000E94231B0C9404150E94501A292F2295E2 -:102A40002F7030E02C3031054CF42A3031056CF415 -:102A50002250310922303105A8F407C02C3031054D -:102A600069F02F30310551F00DC0803F69F018F446 -:102A7000803E40F409C0843F29F406C093FB8827B8 -:102A800080F9089580E0089581E00895CF93DF9361 -:102A900000D000D01F92CDB7DEB70F900F900F90EF -:102AA0000F900F90DF91CF910895CF93DF9300D0D7 -:102AB00000D000D0CDB7DEB726960FB6F894DEBFB3 -:102AC0000FBECDBFDF91CF9108951F93CF93DF93BA -:102AD000C0918A0116E080918B01C81799F0D0E06F -:102AE0001C9FF0011D9FF00D1124E457FE4F408103 -:102AF000518162817381848195810E94551521964F -:102B0000C770E9CFDF91CF911F9108954091BC012B -:102B10005091BD016091BE017091BF018091C001D3 -:102B20009091C1010C9455158091C10182958F70CF -:102B300009F054C08091BE01882309F44FC08091F0 -:102B40008A01A0918B016091BC017091BD014091FF -:102B5000BF015091C001B6E08A1709F43FC090E070 -:102B600041155105C1F17F3F11F46F3FA1F1B89FAD -:102B7000F001B99FF00D1124E457FE4F218172132B -:102B80002AC02081621327C02281211124C0238101 -:102B900034812417350710F421503109241B350BDB -:102BA000283C3105C0F42091C1012F702061209391 -:102BB000C10126E0289FF001299FF00D1124EF5656 -:102BC000FE4F80818F70806180838CEB91E00E944A -:102BD000DD140C94651501968770BECF0895CF92D1 -:102BE000DF92EF92FF920F931F93CF93DF93CDB7B6 -:102BF000DEB762970FB6F894DEBF0FBECDBF8C0173 -:102C000085E0F801DE011D9601900D928A95E1F7AD -:102C1000D8014C9111965C91119712966C91129774 -:102C20001396CD90DC9014973091BC017091BD014A -:102C30008091BF019091C001009709F46BC17F3F63 -:102C400019F43F3F09F466C1E090BE01EE2009F49B -:102C5000C0C02091C101C816D90628F0F601E81BB2 -:102C6000F90BCF0104C0809590958C0D9D1DFF241C -:102C7000F394883C910578F0F12C207F09F0C6C0D0 -:102C80007C2DD98AC88A89890E9446158CEB91E0EF -:102C90000E94DD14B1C0822F807F09F046C07513F9 -:102CA00014C0341312C0611110C02F702061209322 -:102CB000C1010E9486158CEB91E00E94DD14809189 -:102CC000C101D80115968C932EC0CD2819F15F3F14 -:102CD00011F44F3FF9F0F62E61111CC080918A016A -:102CE00020918B0136E0821709F45AC090E0389F9A -:102CF000F001399FF00D1124E457FE4F71815713F5 -:102D000006C07081471303C07281711103C0019620 -:102D10008770E9CFF62E662309F418C18091C101AE -:102D200081608093C101F12C11C1751308C0341367 -:102D300006C0611104C08091C101D801C3C04D8794 -:102D40005E878D859E856A8B0E941C156A89882303 -:102D5000E1F16623D1F12091C101822F82958F701C -:102D600090E0029774F08091BC019091BD0198872A -:102D70008F831986DB86CA862C87CE0107960E9430 -:102D8000DD1486E0F801ACEBB1E001900D928A957C -:102D9000E1F70E9494150E948615FF24F394D6C093 -:102DA0004D875E878D859E850E94501A292F22951A -:102DB0002F7030E0223031050CF0BCC09F7009F05C -:102DC000B6C0805E883008F4C1C0C8010E94DD141E -:102DD000E4CFC816D90608F453C0F601E81BF90B76 -:102DE000CF01883C910508F450C0F12C7C2DD98A84 -:102DF000C88A89890E944615ECEBF1E086E0DF0184 -:102E00001D928A95E9F70E948615A0C0751314C01B -:102E1000341312C0611110C08091C101F801858383 -:102E2000C8010E94DD1486E0ECEBF1E0DF011D92A9 -:102E30008A95E9F7FE2C8AC04D875E878D859E8531 -:102E40006A8B0E941C156A89882309F4BECF662309 -:102E500009F4BBCF2091C101822F82958F7090E041 -:102E600002970CF48ECF8091BC019091BD019A83A2 -:102E700089831B82DD82CC822E83CE0101967FCF97 -:102E8000809590958C0D9D1DACCFF62E662309F490 -:102E90009CCF75132EC034132CC02091C10120FD8E -:102EA0001FC0822F82958F70D9F0D80115962C9370 -:102EB00015978F3049F08F5F982F9295907F822FD2 -:102EC0008F70892B15968C93C8010E94DD1486E0C3 -:102ED000F801ACEBB1E001900D928A95E1F793CF48 -:102EE00086E0F801ACEBB1E001900D928A95E1F734 -:102EF0002DC04D875E878D859E850E941C15811192 -:102F000040CF8091C10181608093C101C8010E94BE -:102F1000DD141CC0662309F458CF4D875E878D856C -:102F20009E850E941C15882309F44FCF2ACF81115A -:102F300048CF0CC0243031050CF047CF9F7009F406 -:102F400040CFF8019581907F09F03BCF8F2D62969D -:102F50000FB6F894DEBF0FBECDBFDF91CF911F91AA -:102F60000F91FF90EF90DF90CF9008951F93CF9334 -:102F7000DF93CDB7DEB72C970FB6F894DEBF0FBE48 -:102F8000CDBF4F83588769877A878B879C87CE010F -:102F900007960E94EF15882369F08F8198852A850E -:102FA0003B85232BF1F19F3F09F063C08F3F09F070 -:102FB00060C037C086E0FE013796DE0111960190B1 -:102FC0000D928A95E1F76F817885EA85FB853097C8 -:102FD00041F17F3F11F46F3F21F120918B0130E0EF -:102FE000C90101968770992740918A0150E08417A2 -:102FF000950709F447C069837A83FD83EC8396E0E3 -:10300000929FD001939FB00D1124A457BE4FFE0193 -:10301000319601900D929A95E1F780938B010E9471 -:10302000651516E080918A0190918B018917C1F195 -:10303000189FC001112484579E4F0E94EF158823CA -:1030400079F1E0918A011E9FF0011124E457FE4FAF -:103050004081518162817381848195810E945515DF -:1030600080918A0190E001968770992780938A0168 -:10307000D9CF4F81588569857A858B859C850E943B -:103080005515CFCF0E94181510928B0110928A010E -:10309000ECEBF1E086E0DF011D928A95E9F7C1CF04 -:1030A0002C960FB6F894DEBF0FBECDBFDF91CF9147 -:1030B0001F910895EF92FF920F931F93CF93DF9389 -:1030C0008C01892B09F46CC0F12CEE24E394E80107 -:1030D0002196F8018491843740F4843008F051C07F -:1030E000813081F0823019F15BC0853709F444C02A -:1030F000A8F19CE7980F903708F052C08F770E9494 -:10310000631241C00E5F1F4FFE01C49180E28C0F1D -:10311000883048F4C7708E2D01C0880FCA95EAF731 -:103120000E94361B14C08C2F0E949B112DC00E5F75 -:103130001F4FFE01C49180E28C0F883058F4C77095 -:103140008E2D01C0880FCA95EAF70E943C1B0E9491 -:103150005D1B1AC08C2F0E94631216C00E5F1F4F9A -:10316000FE01C491CC2381F08FE99FE00197F1F734 -:1031700000C00000C150F6CF0E5F1F4FFE01F4905B -:1031800003C00E949B118E018F2D882309F49FCFCD -:10319000EFE9FFE03197F1F700C000008150F5CF73 -:1031A000DF91CF911F910F91FF90EF9008950895B7 -:1031B0006093C6017093C7018093C8019093C901C1 -:1031C0000C9404150F931F930091C6011091C70131 -:1031D0002091C8013091C901DC01CB01802B912BDA -:1031E000A22BB32B8093C6019093C701A093C80173 -:1031F000B093C9011F910F910C9404150F931F9365 -:103200000091C6011091C7012091C8013091C901F8 -:10321000DC01CB0180239123A223B3238093C60139 -:103220009093C701A093C801B093C9011F910F915A -:103230000C9404150F931F930091C6011091C701C0 -:103240002091C8013091C901DC01CB018027912771 -:10325000A227B3278093C6019093C701A093C8010A -:10326000B093C9011F910F910C9404151092C201E3 -:103270001092C3011092C4011092C5010C94041560 -:1032800041E050E060E070E004C0440F551F661F4D -:10329000771F8A95D2F74093C2015093C301609380 -:1032A000C4017093C5010C94041541E050E060E046 -:1032B00070E004C0440F551F661F771F8A95D2F730 -:1032C0008091C2019091C301A091C401B091C50148 -:1032D000482B592B6A2B7B2B4093C2015093C3017F -:1032E0006093C4017093C5010C94041541E050E053 -:1032F00060E070E004C0440F551F661F771F8A9579 -:10330000D2F740955095609570958091C20190914B -:10331000C301A091C401B091C501482359236A2378 -:103320007B234093C2015093C3016093C401709307 -:10333000C5010C94041541E050E060E070E004C069 -:10334000440F551F661F771F8A95D2F78091C201DF -:103350009091C301A091C401B091C501482759279C -:103360006A277B274093C2015093C3016093C40135 -:103370007093C5010C9404150F931F930091C20123 -:103380001091C3012091C4013091C501DC01CB0132 -:10339000802B912BA22BB32B8093C2019093C3015E -:1033A000A093C401B093C5011F910F910C94041513 -:1033B0000F931F930091C2011091C3012091C4018A -:1033C0003091C501DC01CB0180239123A223B323DB -:1033D0008093C2019093C301A093C401B093C5012F -:1033E0001F910F910C9404150F931F930091C2012C -:1033F0001091C3012091C4013091C501DC01CB01C2 -:1034000080279127A227B3278093C2019093C301FD -:10341000A093C401B093C5011F910F910C940415A2 -:103420000895CF92DF92EF92FF920F931F93CF9365 -:10343000DF938C01C090C601D090C701E090C80115 -:10344000F090C9018091C2019091C301A091C40183 -:10345000B091C501C82AD92AEA2AFB2ACFE1D0E0D7 -:10346000D701C6010C2E04C0B695A79597958795F0 -:103470000A94D2F780FF06C0B8018C2F0E9467071C -:10348000019721F4219760F780E001C08C2FDF9134 -:10349000CF911F910F91FF90EF90DF90CF90089503 -:1034A000CF93DF93EC010E94111ABE010E946707BF -:1034B000DF91CF910895CB010E94501A0895809119 -:1034C000CA0185958595859508958091CA01877073 -:1034D000089598E0899F90011124262B2093CA011A -:1034E0000C9455192091CA01809582238093CA01BA -:1034F000982F977069F430E0482F552747FD509575 -:103500002417350729F08595859585950C947619AE -:1035100008959091CA01977081E009F480E00895C0 -:1035200090910C01992321F090910D01911109C006 -:1035300020910E0130910F01F90132969FEF40E08A -:103540001FC0982F9695969596959F3050F5E091CF -:103550000E01F0910F01E90FF11D877021E030E0BD -:10356000A90102C0440F551F8A95E2F7CA01918153 -:10357000892B818308959F3F39F04F5F4E3041F092 -:1035800051915813F8CF0DC05111F7CF942FF5CFAB -:103590009F3F39F0F901E90FF11D97FDFA958283FC -:1035A0000895089590910C01992321F090910D01B7 -:1035B000911109C020910E0130910F01F90132964D -:1035C000205F3F4F1FC0982F9695969596959F30F8 -:1035D000F0F4E0910E01F0910F01E90FF11D8770F9 -:1035E00021E030E0A90102C0440F551F8A95E2F79F -:1035F000CA01809591818923818308953196E217CC -:10360000F30729F090819813F9CF1082F7CF08952E -:1036100081E090E0E0910E01F0910F01E80FF91FB9 -:103620001082019680319105A9F708959091DE01ED -:10363000892B8093DE01089580959091DE01892386 -:103640008093DE0108951092DE0108959091DD01CE -:10365000892B8093DD01089580959091DD01892368 -:103660008093DD0108951092DD0108959091DC01B1 -:10367000892B8093DC01089580959091DC0189234A -:103680008093DC0108951092DC0108958093CB01B2 -:1036900008951092CB01089580910E0190910F0131 -:1036A000FC0131969C01205F3F4F80E09191911188 -:1036B0008F5FE217F307D1F70895E0910E01F091C3 -:1036C0000F018091DE018083E0910E01F0910F01E6 -:1036D00090818091DD01892B8083E0910E01F09132 -:1036E0000F0190818091DC01892B80838091CB0137 -:1036F000882361F0E0910E01F0910F019081892BF8 -:1037000080830E944C1B81111092CB0180910E018D -:1037100090910F010C948B1020E0009739F0AC01D0 -:1037200041505109842395232F5FF7CF822F0895AD -:10373000CF92DF92EF92FF926C01EE24FF24C1142E -:10374000D104E104F10421F0C701B60120E101C078 -:1037500020E0C72ED82EE92EFF24C114D104E104A5 -:10376000F10419F0285FC701B6016B017C0154E038 -:10377000F694E794D794C7945A95D1F7C114D1041D -:10378000E104F10419F02C5FC701B6016B017C0163 -:1037900042E0F694E794D794C7944A95D1F7C114C0 -:1037A000D104E104F10419F02E5FC701B601DC0178 -:1037B000CB01B695A79597958795892B8A2B8B2B4F -:1037C00009F02F5F822FFF90EF90DF90CF90089548 -:1037D0008091F801843039F11092E00120E488E111 -:1037E00090E00FB6F894A895809360000FBE2093E8 -:1037F000600080E00E94790983B7817F846083BF85 -:1038000083B7816083BF7894889583B78E7F83BFA9 -:103810000FB6F894A895809160008861809360004D -:10382000109260000FBE089508950E9452030E94F6 -:1038300065030E94141C0E945A0491E0811101C08A -:1038400090E0892F08950E9418150E947F100C9413 -:10385000790982E084BD93E095BD9AEF97BD80938E -:103860006E0008952FB7F8948091E1019091E201E4 -:10387000A091E301B091E4012FBF0895CF92DF92B0 -:10388000EF92FF920F931F932FB7F8944091E101AD -:103890005091E2016091E3017091E4012FBF6A0150 -:1038A0007B01EE24FF248C0120E030E0C016D1061D -:1038B000E206F30610F4415051099A01281B390B16 -:1038C000C9011F910F91FF90EF90DF90CF90089565 -:1038D0001F920F920FB60F9211248F939F93AF9365 -:1038E000BF938091E1019091E201A091E301B09139 -:1038F000E4010196A11DB11D8093E1019093E201C5 -:10390000A093E301B093E401BF91AF919F918F9198 -:103910000F900FBE0F901F9018950E947C0DF89489 -:103920002FEF87EA91E6215080409040E1F700C0F8 -:10393000000087E090EBDC0180930102909302028B -:10394000A0930302B09304029CE088E10FB6F894C0 -:10395000A895809360000FBE90936000FFCF0E94F7 -:10396000E71C811102C00E94CD1C0E94F21C8093B2 -:10397000DF010E94FA1C90E09093F3018093F20122 -:1039800087FB882780F980930D010E94F61C682F21 -:1039900070E080E090E00C94D8186DEE7EEF80E04F -:1039A00090E00E94432360E082E090E00E94322396 -:1039B00060E083E090E00E94322360E084E090E0E9 -:1039C0000E94322360E085E090E00C94322380E096 -:1039D00090E00E942C2321E08D3E9E4F09F020E0D4 -:1039E000822F089582E090E00C94242383E090E0FD -:1039F0000C94242384E090E00C942423682F84E02A -:103A000090E00C9432238091E70180FF0BC060911D -:103A1000130185E0689FB001112475956795759530 -:103A200067952BC081FF09C06091130185E0689FF5 -:103A3000B00111247595679520C082FF07C0609181 -:103A4000130185E0689FB001112417C09091E8012F -:103A50009923D1F060911201961788F720911301F4 -:103A600085E0289F90011124929FA001939F500D03 -:103A7000112470E0CA010E94F6226038710540F4FA -:103A80006115710539F002C065E070E0862F089578 -:103A90008FE7089581E008958091E70180FF08C0D5 -:103AA0006091110170E0759567957595679521C0D6 -:103AB00081FF06C06091110170E07595679519C08E -:103AC00082FF04C06091110170E010C09091E80184 -:103AD0009923C1F0609110019617A0F78091110110 -:103AE000899FC001112470E00E94F62260387105A0 -:103AF00028F46115710521F0862F08958FE7089548 -:103B000081E0089561E070E0F4CF803F21F40E94ED -:103B1000031D819504C0813F29F40E94031D8093F9 -:103B2000EB010895823F21F40E94031D819504C09A -:103B3000833F29F40E94031D8093EA010895893F81 -:103B400019F40E944C1D05C08A3F31F40E944C1D9F -:103B500081958093EC0108958B3F21F40E944C1DC8 -:103B6000819504C08C3F29F40E944C1D8093ED0187 -:103B70000895843F21F48091E901816017C0853F59 -:103B800021F48091E901826011C0863F21F4809187 -:103B9000E90184600BC0873F21F48091E9018860CE -:103BA00005C0883F31F48091E90180618093E9018B -:103BB00008958D3F21F48091E70181600BC08E3F15 -:103BC00021F48091E701826005C08F3F29F4809144 -:103BD000E70184608093E7010895803F39F4809184 -:103BE000EB0187FF6CC01092EB0169C0813F29F4A3 -:103BF0008091EB011816BCF362C09091EA01823FFC -:103C000029F497FF5CC01092EA0159C0833F19F470 -:103C10001916CCF354C0893F41F48091EC01181679 -:103C20000CF04DC01092EC014AC08A3F29F48091FB -:103C3000EC0187FF44C0F6CF8B3F39F48091ED0152 -:103C400087FF3DC01092ED013AC08C3F29F480916E -:103C5000ED011816BCF333C0843F21F48091E901D3 -:103C60008E7F17C0853F21F48091E9018D7F11C0BF -:103C7000863F21F48091E9018B7F0BC0873F21F4BF -:103C80008091E901877F05C0883F31F48091E90187 -:103C90008F7E8093E90113C08D3F21F48091E7016D -:103CA0008E7F0BC08E3F21F48091E7018D7F05C090 -:103CB0008F3F29F48091E7018B7F8093E70180910A -:103CC000EA0181110EC08091EB0181110AC080913F -:103CD000EC01811106C08091ED01811102C01092AA -:103CE000E801089589EE91E00E9496100E94321C2E -:103CF0009093E6018093E50108951F93CF93DF939E -:103D00008091E5019091E6010E943E1CAC019091EA -:103D1000E801992321F02091140130E006C02091A0 -:103D200015018AE0289F900111244217530708F4D7 -:103D300086C08091EA01C091EB01D091EC01109115 -:103D4000ED01811107C0C11176C0D11174C01111EC -:103D500072C075C09F3F19F09F5F9093E8011816DD -:103D600024F40E94031D8093EA018091EA0187FFF9 -:103D700005C00E94031D81958093EA011C1624F45E -:103D80000E94031D8093EB018091EB0187FF05C02A -:103D90000E94031D81958093EB016091EA016623E7 -:103DA00039F1C091EB01CC2319F1772767FD7095AC -:103DB000872F972F0E94FD2123E333E343E35FE343 -:103DC0000E9461220E94C5216093EA016C2F77272F -:103DD00067FD7095872F972F0E94FD2123E333E322 -:103DE00043E35FE30E9461220E94C5216093EB01DF -:103DF0001D1624F40E944C1D8093EC018091EC016F -:103E000087FF05C00E944C1D81958093EC0111161F -:103E100024F40E944C1D8093ED018091ED0187FFF9 -:103E200005C00E944C1D81958093ED01DF91CF91DB -:103E30001F910C94721E9F3F09F08ECF96CFDF9199 -:103E4000CF911F910895E9EEF1E085E0DF011D9229 -:103E50008A95E9F71092E8011092E70108958330FE -:103E600081F128F4813059F08230D1F00895853005 -:103E700009F449C0B8F1863009F456C0089580911C -:103E80001501262F30E0280F311D2F3F310524F476 -:103E9000680F6093150108958FEF809315010895C1 -:103EA00080911401262F30E0280F311D2F3F31055E -:103EB00024F4680F6093140108958FEF8093140128 -:103EC000089580911301262F30E0280F311D2F3FD8 -:103ED000310524F4680F6093130108958FEF8093E8 -:103EE0001301089580911201262F30E0280F311D13 -:103EF0002F3F310524F4680F6093120108958FEF6E -:103F000080931201089580911101262F30E0280F2F -:103F1000311D2F3F310524F4680F6093110108957E -:103F20008FEF80931101089580911001262F30E0CA -:103F3000280F311D2F3F310524F4680F60931001C5 -:103F400008958FEF809310010895833011F128F4C4 -:103F5000813049F0823091F00895853081F120F16F -:103F60008630C1F1089580911501681720F4861BF1 -:103F70008093150108951092150108958091140100 -:103F8000681720F4861B8093140108951092140181 -:103F9000089580911301681720F4861B8093130104 -:103FA000089510921301089580911201681720F46A -:103FB000861B80931201089510921201089580913A -:103FC0001101681720F4861B809311010895109247 -:103FD0001101089580911001681720F4861B8093C9 -:103FE000100108951092100108950F931F938D31C1 -:103FF00009F471C008F045C0803109F485C008F5A6 -:10400000873009F46FC068F4863009F0ADC0809144 -:10401000DF01817F8E7F8093DF0181E08093EF015C -:10402000A4C08B3009F49EC08E3009F09DC08091F1 -:10403000DF0182FB222720F991E0922790FB82F991 -:104040006CC0863109F48EC060F4813109F08CC0F7 -:104050000E94181590910D0181E0892780930D0130 -:1040600081C0893109F47EC08B3109F07DC0809117 -:10407000DF0181FB222720F991E0922790FB81F953 -:104080004CC0853309F466C048F4873209F462C035 -:1040900008F44FC0893209F45DC066C0833438F437 -:1040A0008A3308F044C0883309F45CC05DC08334AF -:1040B00009F450C0883409F057C00E9418150FEF5A -:1040C00013ED20E3015010402040E1F700C0000054 -:1040D0000E948D1C47C00E947F210E947F100E9479 -:1040E000790940C09091DF01892F8095817080FB14 -:1040F00090F929F0966098609093DF0136C0997F1F -:10410000977F9093DF012EC08091DF0183FB2227F0 -:1041100020F991E0922790FB83F98093DF019923A6 -:1041200009F18091DF0181608093DF011BC0895319 -:1041300001C08D5141E050E060E070E08A019B01D8 -:1041400004C0000F111F221F331F8A95D2F7C90127 -:10415000B80104C061E070E080E090E00E94D818EF -:104160000E94181581E001C080E01F910F91089511 -:1041700080E0089580E008958E518A3030F4E82F71 -:10418000F0E0E65DFE4F8081089580E00895CF93D2 -:10419000C82F8091EF01813079F018F08230E9F179 -:1041A00086C0E0910E01F0910F018081813169F0AC -:1041B000823209F07EC009C0E0910E01F0910F013A -:1041C0008081813111F0823261F48C2F0E94B820FD -:1041D000811104C08C2F0E94F51F1DC081E090E06A -:1041E0001AC08C2F0E94BA20811114C0C43179F0FA -:1041F00048F4CB3079F0C03109F05FC082E08093A1 -:10420000EF0108C0C93219F0C83321F056C010922E -:10421000EF0153C081E0817052C0C93281F110F5C5 -:10422000C43169F1A8F4C73009F045C08AE0809331 -:10423000150194E19093140193E0909313018093FE -:10424000120188E08093110188E28093100133C04D -:1042500082EE8C0F863078F58C2F0E94BC208093E4 -:10426000EE0129C0CE34E9F020F4CB3421F56AE028 -:1042700013C0C13579F0C235F1F461E00DC0809111 -:10428000EE01882319F01092EE0115C081E08093B1 -:10429000EF0115C061E006C08091EE010E942F1F62 -:1042A0000AC06AE08091EE010E94A51F04C010922E -:1042B000EF0180E004C081E002C080E0ACCFCF918C -:1042C0000895E1E8F0E080818860808380818160EA -:1042D00080838FB7F89493E09093890090ED90934A -:1042E00088008FBF0895EFE6F0E0808182608083D0 -:1042F0000895EFE6F0E080818D7F80830895EFE6FA -:10430000F0E0908182E08927808308951F920F92C8 -:104310000FB60F9211242F933F934F935F936F9398 -:104320007F938F939F93AF93BF93EF93FF9380916E -:10433000F0019091F10101969093F1018093F001C9 -:10434000811103C082E00E947909E091F101E695B4 -:10435000E695F0E0EB54FB4FE4918091F0018E1371 -:1043600003C080E00E947909FF91EF91BF91AF9166 -:104370009F918F917F916F915F914F913F912F917D -:104380000F900FBE0F901F9018950E94CC2168943B -:10439000B1110C945B2208950E94402288F09F572F -:1043A00098F0B92F9927B751B0F0E1F0660F771F59 -:1043B000881F991F1AF0BA95C9F714C0B13091F04F -:1043C0000E945A22B1E008950C945A22672F782F48 -:1043D0008827B85F39F0B93FCCF386957795679514 -:1043E000B395D9F73EF490958095709561957F4F80 -:1043F0008F4F9F4F0895E89409C097FB3EF4909526 -:104400008095709561957F4F8F4F9F4F9923A9F0AD -:10441000F92F96E9BB279395F6958795779567953C -:10442000B795F111F8CFFAF4BB0F11F460FF1BC080 -:104430006F5F7F4F8F4F9F4F16C0882311F096E913 -:1044400011C0772321F09EE8872F762F05C06623C1 -:1044500071F096E8862F70E060E02AF09A95660F7A -:10446000771F881FDAF7880F9695879597F9089533 -:1044700057FD9058440F551F59F05F3F71F0479515 -:10448000880F97FB991F61F09F3F79F087950895FA -:10449000121613061406551FF2CF4695F1DF08C019 -:1044A000161617061806991FF1CF86957105610536 -:1044B00008940895E894BB2766277727CB0197F9DE -:1044C00008950E9474220C94E5220E94D72238F0AD -:1044D0000E94DE2220F0952311F00C94CE220C9441 -:1044E000D42211240C945B220E94382270F3959FF1 -:1044F000C1F3950F50E0551F629FF001729FBB27DB -:10450000F00DB11D639FAA27F00DB11DAA1F649F76 -:104510006627B00DA11D661F829F2227B00DA11D29 -:10452000621F739FB00DA11D621F839FA00D611DAF -:10453000221F749F3327A00D611D231F849F600DD0 -:10454000211D822F762F6A2F11249F5750409AF0F9 -:10455000F1F088234AF0EE0FFF1FBB1F661F771F85 -:10456000881F91505040A9F79E3F510580F00C9450 -:10457000CE220C945B225F3FE4F3983ED4F3869501 -:1045800077956795B795F795E7959F5FC1F7FE2BF0 -:10459000880F911D9695879597F9089597F99F67CC -:1045A00080E870E060E008959FEF80EC08950024BB -:1045B0000A941616170618060906089500240A9488 -:1045C00012161306140605060895092E0394000C0E -:1045D00011F4882352F0BB0F40F4BF2B11F460FF9D -:1045E00004C06F5F7F4F8F4F9F4F089597FB072E3B -:1045F00016F4009407D077FD09D00E94102307FC21 -:1046000005D03EF4909581959F4F089570956195E2 -:104610007F4F0895EE0FFF1F0590F491E02D099450 -:10462000AA1BBB1B51E107C0AA1FBB1FA617B707D8 -:1046300010F0A61BB70B881F991F5A95A9F78095F4 -:104640009095BC01CD010895F999FECF92BD81BD31 -:10465000F89A992780B50895A8E1B0E042E050E0CB -:104660000C944B23262FF999FECF92BD81BDF89A69 -:10467000019700B4021631F020BD0FB6F894FA9AF3 -:10468000F99A0FBE08950196272F0E9433230C94A8 -:104690003223DC01CB01FC01F999FECF06C0F2BD4B -:1046A000E1BDF89A319600B40D9241505040B8F7F0 -:0646B0000895F894FFCF0D -:1046B60002207B09090AE609B2097E090101CC013B -:1046C60028080A03140A404D363975042804F203F3 -:1046D600B9034C0365037E03970301020304050631 -:0446E60007080900B8 -:00000001FF diff --git a/keyboards/ergodox_ez/keymaps/tkuichooseyou/keymap.c b/keyboards/ergodox_ez/keymaps/tkuichooseyou/keymap.c deleted file mode 100644 index 87b77e42e..000000000 --- a/keyboards/ergodox_ez/keymaps/tkuichooseyou/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 |CMD+{ | | CMD+}| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | Hyper| | Meh | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * |Ctrl/Esc| A | S | D | F | G |------| |------| H | J | K | L |; / L2| LGui | - * |--------+------+------+------+------+------| LGui | | LGui |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Del |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, LGUI(LSFT(KC_LBRC)), - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, ALL_T(KC_NO), - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - LGUI(LSFT(KC_RBRC)), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MEH_T(KC_NO), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_QUOT, - KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_DELT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/tm2030/keymap.c b/keyboards/ergodox_ez/keymaps/tm2030/keymap.c deleted file mode 100644 index ca8075226..000000000 --- a/keyboards/ergodox_ez/keymaps/tm2030/keymap.c +++ /dev/null @@ -1,242 +0,0 @@ -/* TypeMatrix-2030-like keymap */ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "led.h" - -#define BASE 0 // default layer -#define DVRK 1 // Dvorak layer -#define NUMR 8 // numeric layer -#define FNLR 9 // fn layer - -#define MDBL0 1 -#define MFNLR 2 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | ] | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T |Backsp| |Backsp| Y | U | I | O | P | [ | - * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| - * | LShift | A | S | D | F | G |------| |------| H | J | K | L | ; | '/Shift| - * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | \/Shift| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | - | Home | = |End/Ctl| - * `-----------------------------------' `-----------------------------------' - * ,--------------. ,-------------. - * |Esc/Alt| num | | Left |Right | - * ,------+-------+------| |------+------+------. - * | | | PgUp | | Up | | | - * |Space |LShift |------| |------|RShift|Space | - * | | | PgDn | | Down | | | - * `---------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_BSPC, - KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ENT, - KC_LCTL, M(MFNLR), KC_LGUI,KC_MPLY,ALT_T(KC_APP), - - ALT_T(KC_ESC), TG(NUMR), - KC_PGUP, - KC_SPC, KC_LSFT, KC_PGDN, - - // right hand - KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RBRC, - KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, SFT_T(KC_QUOT), - KC_ENT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_BSLS), - KC_RALT, KC_MINS, KC_HOME, KC_EQL, CTL_T(KC_END), - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, KC_RSFT, KC_SPC - ), -/* Dvorak layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Del | | Del | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | ' | , | . | P | Y |Backsp| |Backsp| F | G | C | R | L | / | - * |--------+------+------+------+------+------|ace | |ace |------+------+------+------+------+--------| - * | LShift | A | O | E | U | I |------| |------| D | H | T | N | S | -/Shift| - * |--------+------+------+------+------+------|Enter | |Enter |------+------+------+------+------+--------| - * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | \/Shift| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCtrl | fn | LGui | Play |App/Alt| | RAlt | [ | Home | ] |End/Ctl| - * `-----------------------------------' `-----------------------------------' - * ,--------------. ,-------------. - * |Esc/Alt| num | | Left |Right | - * ,------+-------+------| |------+------+------. - * | | | PgUp | | Up | | | - * |Space |LShift |------| |------|RShift|Space | - * | | | PgDn | | Down | | | - * `---------------------' `--------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[DVRK] = KEYMAP( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DELT, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_BSPC, - KC_LSFT, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_ENT, - KC_LCTL, M(MFNLR), KC_LGUI, KC_MPLY, ALT_T(KC_APP), - - ALT_T(KC_ESC), TG(NUMR), - KC_PGUP, - KC_SPC, KC_LSFT, KC_PGDN, - - // right hand - KC_DELT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_BSPC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, SFT_T(KC_MINS), - KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_BSLS), - KC_RALT, KC_LBRC, KC_HOME, KC_RBRC, CTL_T(KC_END), - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, KC_RSFT, KC_SPC - ), -/* Numeric Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | | | Tab | / | * | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | F6 | F7 | F8 | F9 | F10 | | | | | Home | 7 | 8 | 9 | + | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | F11 | F12 | | | |------| |------| Up | End | 4 | 5 | 6 | + | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | Left | Down | Right| 1 | 2 | 3 |KpEnter | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | 0 | 00 | . |Etr/Ctl| - * `----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | |n.lock|c.lock| - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[NUMR] = KEYMAP( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_TAB, KC_PSLS, KC_PAST, KC_PMNS, - KC_TRNS, KC_TRNS, KC_HOME, KC_P7, KC_P8, KC_P9, KC_PPLS, - KC_UP, KC_END, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_LEFT, KC_DOWN, KC_RGHT, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_TRNS, KC_P0, M(MDBL0),KC_PDOT, CTL_T(KC_PENT), - - KC_NLCK, KC_CAPS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* fn layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | |Insert| |Insert|Eject |Power |Sleep | Wake |PrtScr|ScrollLk| - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | |VolUp | | | | | | | | Pause | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | Calc | Mail |Browsr|------| |------| | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | cut | copy |paste | Mute |VolDn | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | Next | | | - * | Mute | |------| |------| | | - * | | | | | Prev | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[FNLR] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_MAIL, KC_WHOM, - KC_TRNS, KC_TRNS, LSFT(KC_DELT),LCTL(KC_INS),LSFT(KC_INS), KC_MUTE, KC_VOLD, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_MUTE, KC_TRNS, KC_TRNS, - // right hand - KC_INS, KC_EJCT, KC_PWR, KC_SLEP, KC_WAKE, KC_PSCR, KC_SLCK, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, - KC_MPRV, - KC_MNXT, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case MDBL0: - if (record->event.pressed) { - return MACRO( I(25), T(P0), T(P0), END ); - } - break; - case MFNLR: - layer_invert(NUMR); - layer_invert(FNLR); - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - // led 1: numeric layer - if (layer_state & (1 << NUMR)) { - ergodox_right_led_1_on(); - } - // led 2: Dvorak layer - if (default_layer_state == 1 << DVRK) { - ergodox_right_led_2_on(); - } - // led 3: caps lock - if (host_keyboard_leds() & (1<event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/tonyabra_osx/readme.md b/keyboards/ergodox_ez/keymaps/tonyabra_osx/readme.md deleted file mode 100644 index f9d76efc2..000000000 --- a/keyboards/ergodox_ez/keymaps/tonyabra_osx/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# ErgoDox EZ OS X Simplified Configuration - -This keyboard configuration replaces the hyper and meh keys with the command key. It also removes all of the meta keys that require a "hold" because I found that I hesitate when I type, which can accidentally fire those combinations. On the upper left of the left hand, I mimicked the Mac placement of tab and escape, and on the upper right of the right hand, I placed an additional enter key for convenience when breezing through prompts. - -This is my standard working configuration for now, but I can see myself tweaking it as I use it more. I highly recommend you do the same. \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/config.h b/keyboards/ergodox_ez/keymaps/townk_osx/config.h deleted file mode 100644 index 58ba690af..000000000 --- a/keyboards/ergodox_ez/keymaps/townk_osx/config.h +++ /dev/null @@ -1,92 +0,0 @@ -/* -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 t.m.k. keyboard firmware for Ergodox - -/* 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 COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } -#define ROWS (int []){ D0, D5, B5, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* 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 2 -#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 -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 3000 - -#endif diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/keymap.c b/keyboards/ergodox_ez/keymaps/townk_osx/keymap.c deleted file mode 100644 index 07e58a491..000000000 --- a/keyboards/ergodox_ez/keymaps/townk_osx/keymap.c +++ /dev/null @@ -1,285 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "action_util.h" -#include "led.h" -#include "keymap.h" -#include "timer.h" - -/* - -# Why this Layout - -This layout was based on Kinesis layout and other ErgoDox user layouts -available. It's target to be used on a MacOS but I'm pretty sure it can be -addapted to Windows and/or Linux easily. - -## Function Key - -The `fn` key work almost like it would in any other keyboard with the exception -it has a semi-sticky behavior. What does that mean? - -Well, if you press the `fn` and release it, the keyboard will be put on the -_function layout_ and the next key stroke will be processed as if the `fn` key -was pressed. Aftwards, the leyout get back to _normal_. If you hold `fn` and -press any other key, when you release them, the keyboard leyout is back to -_normal_. - -While pressing the `fn` with the left hand and strikeing the other keys on the -right hand is farly easy, the same cannot being said for the other keys on the -left side. So, instead of trying to do contorcionism with my left hand, I -decided to do a semi-sticky version of `fn`. This way, I can press the `fn` -key with my pinky, release it and press the `1` key to issue an `F1` to the -operating system. - -## Key-Pad Key - -The `key pad` key is a layout switch key. If pressed, it will put the keyboard -on the _key pad layout_ and stay there until key is pressed again. - -This is used to make the keyboard behave mostly like a **num pad keyboard**. - -## Notes -- Regardless in which layout you are, keys from other layouts are not - accessible. This means that if you are on the _key pad layout_, the left hand - will be pretty much unusable. - Of course that like anything else, there are exceptions to this rule. - Modifiers should remain accessible throughout the layers. -- The _shift key_ is, like the _function key_, also configured to have a sticky - behavior. -- All sticky keys have a timeout of 3 seconds. - -*/ -#define BASE 0 -#define KEYPAD 1 -#define FN 2 - -#define MACRO_TMUX_ESC 10 -#define MACRO_TMUX_PASTE 11 -#define MACRO_OSX_COPY 12 -#define MACRO_OSX_PASTE 13 - -#define M_TESC M(MACRO_TMUX_ESC) -#define M_TPASTE M(MACRO_TMUX_PASTE) -#define M_OSXCPY M(MACRO_OSX_COPY) -#define M_OSXPST M(MACRO_OSX_PASTE) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Base Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 | 2 | 3 | 4 | 5 | ESC | | Pwr | 6 | 7 | 8 | 9 | 0 | - _ | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Tab | Q | W | E | R | T | F16 | | F17 | Y | U | I | O | P | = + | - * |-----------+------+------+------+------+------| Meh | | Meh |------+------+------+------+------+-----------| - * | \ (Ctrl) | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " (Ctrl)| - * |-----------+------+------+------+------+------| F18 | | F19 |------+------+------+------+------+-----------| - * | LShift | Z | X | C | V | B | Hyper| | Hyper| N | M | , | . | / | RShift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | FN | KPAD |LCtrl | LAlt | LGui | | RGui | RAlt | RCtrl| KPAD | FN | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | M(0) | M(1) | | M(2) | M(3) | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' - * - * M(0) = Ctrk+A Esc - * (this is used to issue the Esc key to the Tmux application) - * M(1) = Ctrk+A P - * (this is used to issue the Paste key to the Tmux application) - * M(2) = Cmd+C - * M(3) = Cmd+V - */ -[BASE]=KEYMAP(//left half - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MEH_T(KC_F16), - CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_FN2, KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_F18), - KC_FN1, TG(KEYPAD), KC_LCTRL, KC_LALT, KC_LGUI, - M_TESC, M_TPASTE, - KC_HOME, - KC_BSPC, KC_DELT, KC_END, - //right half - KC_POWER, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MEH_T(KC_F17), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, CTL_T(KC_QUOT), - ALL_T(KC_F19), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN2, - KC_RGUI, KC_RALT, CTL_T(KC_LBRC), KC_FN3, KC_FN1, - M_OSXCPY, M_OSXPST, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC), - -/* Keymap 1: KeyPad Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | | LClk | RClk | MClk | | | | BTab | Clear| / | * | ^ | ( | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | M.Accel 2 | |ScrlUp| U |ScrlDn| | | | Tab | 7 | 8 | 9 | + | ) | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | M.Accel 1 | | L | D | R | |------| |------| 4 | 5 | 6 | - | | | - * |-----------+------+------+------+------+------| | |Return|------+------+------+------+------+-----------| - * | M.Accel 0 | |ScrlL | |ScrlR | | | | | 1 | 2 | 3 | = | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | XXXX | | | | | 0 | . | , | XXXX | | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | XXXX | | - * | | |------| |------| XXXX | | - * | | | | | | XXXX | | - * `--------------------' `--------------------' - */ -[KEYPAD]=KEYMAP(//left half - KC_NO, KC_NO, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, KC_NO, KC_NO, - KC_MS_ACCEL2, KC_NO, KC_MS_WH_UP, KC_MS_U, KC_MS_WH_DOWN, KC_NO, KC_NO, - KC_MS_ACCEL1, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, - KC_MS_ACCEL0, KC_NO, KC_MS_WH_LEFT, KC_NO, KC_MS_WH_RIGHT, KC_NO, KC_NO, - KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO, - //right half - LSFT(KC_TAB), KC_CLEAR, KC_KP_SLASH, KC_KP_ASTERISK, KC_CIRCUMFLEX, KC_LPRN, KC_NO, - KC_TAB, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_RPRN, KC_NO, - KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_NO, KC_NO, - KC_KP_ENTER, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_EQUAL, KC_NO, KC_NO, - KC_KP_0, KC_KP_DOT, KC_KP_COMMA, KC_TRNS, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_TRNS, KC_NO), - -/* Keymap 2: Functions Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | Vol. Up | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | Stop | Rw | Rec | FF | | XXXX | | XXXX | | | | | | Vol. Down | - * |-----------+------+------+------+------+------| XXXX | | XXXX |------+------+------+------+------+-----------| - * | CapsLock | Eject| Prev | Play | Next | |------| |------| Left | Down | Up | Right| | Mute | - * |-----------+------+------+------+------+------| XXXX | | XXXX |------+------+------+------+------+-----------| - * | L Shift | | | | | | XXXX | | XXXX | | | | | | R Shift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | XXXXX | | XXXX | XXXX | XXXX | | XXXX | XXXX | XXXX | | XXXXX | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * - * XXX = These keys are transparent keys that, when pressed, they issue the key from the previous layer. - */ -[FN]=KEYMAP(//left half - KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, - KC_NO, KC_MEDIA_STOP, KC_MEDIA_REWIND, KC_MEDIA_SELECT, KC_MEDIA_FAST_FORWARD, KC_NO, KC_TRNS, - KC_CAPS, KC_MEDIA_EJECT, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_NO, - KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO, - //right half - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLU, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLD, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_NO, KC_MUTE, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT, - KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - KC_NO, KC_NO, KC_NO)}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_ONESHOT(FN), - [2] = ACTION_MODS_ONESHOT(MOD_LSFT), // Sticky shift light. Tap for the next keypress to be shifted. Hold for regular shift. - [3] = ACTION_LAYER_TAP_KEY(KEYPAD, KC_RBRC), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case MACRO_TMUX_ESC: - if (record->event.pressed) { - return MACRO(D(LCTRL), T(A), U(LCTRL), D(ESC), END); - } - return MACRO(U(ESC), END); - case MACRO_TMUX_PASTE: - if (record->event.pressed) { - return MACRO(D(LCTRL), T(A), U(LCTRL), D(P), END); - } - return MACRO(U(P), END); - case MACRO_OSX_COPY: - if (record->event.pressed) { - return MACRO(D(LGUI), D(C), END); - } - return MACRO(U(C), U(LGUI), END); - case MACRO_OSX_PASTE: - if (record->event.pressed) { - return MACRO(D(LGUI), D(V), END); - } - return MACRO(U(V), U(LGUI), END); - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -uint8_t current_layer = BASE; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_led_all_off(); - ergodox_led_all_set(LED_BRIGHTNESS_LO); - - switch (layer) { - case BASE: - current_layer = BASE; - break; - case KEYPAD: - current_layer = KEYPAD; - break; - default: - // none - break; - } - - // layer leds - if (current_layer == KEYPAD) { - ergodox_right_led_3_on(); - } - - // capslock - if (host_keyboard_leds() & (3<mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) && // is shift pressed and there is no other - !(keyboard_report->mods & (~MOD_BIT(KC_LSFT) & ~MOD_BIT(KC_RSFT)))) || // modifier being pressed as well - (get_oneshot_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) && !has_oneshot_mods_timed_out())) { // or the one shot shift didn't timed out - ergodox_right_led_1_set(LED_BRIGHTNESS_HI); - ergodox_right_led_1_on(); - } -}; diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/makefile.mk b/keyboards/ergodox_ez/keymaps/townk_osx/makefile.mk deleted file mode 100644 index e757557bd..000000000 --- a/keyboards/ergodox_ez/keymaps/townk_osx/makefile.mk +++ /dev/null @@ -1,4 +0,0 @@ -# I don't want my keyboard blinking lights when is suppose to be asleep. -SLEEP_LED_ENABLE = no - -CONFIG_H = keymaps/$(KEYMAP)/config.h diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/readme.md b/keyboards/ergodox_ez/keymaps/townk_osx/readme.md deleted file mode 100644 index c2853ca17..000000000 --- a/keyboards/ergodox_ez/keymaps/townk_osx/readme.md +++ /dev/null @@ -1,77 +0,0 @@ -# Townk's Keymap - -Trying to take care of an enjury on my arm I borrow an ergonomic keyboard from -a frient ([Kinesis Advantage](http://www.kinesis-ergo.com/shop/advantage-pro-for-pc-mac/)). - -I really enjoyed my time with it but there were some anoyancies: - -* The curvature on the keys bothered me since I'm a Vim user and using the - motion keys on my editor was awkard. -* I had to spend too much time remapping the keyboard to make some symbol keys - more accessible to me. -* The fact that my hands had to stay close to each other was a bit stressfull - to my sholders. - -After a long research I find out that Ergodox EZ would be perfect for my needs -and purchase one. Before the keyboard even got in my hands I started to think -on the layout I would use on it and soon enough I planed couple adjustments -from the Kinesis I was using so far. - -## The layout - -Here are the layout mapping in images so you can have a glimpse on it: - -![Base Layout](townk_osx_base.png) -![fn Layout](townk_osx_fn.png) -![Keypad & Mouse Layout](townk_osx_keypad.png) - -Notice that, differently from the default behavior, my layer keys are not transparent -by default, which means that if you press any non-labeled white key, nothing will be -handled to the OS. - -### One shot keys - -It all started with the access to the function keys (F1, F2, F3...), since -those keys are located on a different layer I needed a way to press them with -minimal effort without disrupting my flow. - -For me, togglihg a layer to press a button and than toggle it back is a waste -of time (although I admit it's a single tap from what I have), so I decided to -do it as a one shot key. I could press it and the next pressed key would be -handled by the target layer which just after it delivers the key to the OS it -would get back to the previous layer. - -After setting up my layout to do just that I realized that occasionally I -would stop myseld on the middle of the process and the one shot layer would be -still triggered until I press any other key. So to prevent me from tapping -keys I don't want I added a timeout of 3 seconds for the one shot actions. - -Ultimately I tested the shift key as a one shot one and really like it, so -here you have it, all the one shot keys on my layout. - -## Glossary - -If you're not familiar with the Mac symbols used on some keys, here is a -reference to them: - -| Symbol | Description | -| :----: | ------------------- | -| ⌘ | Command | -| ⇪ | Caps Lock | -| ⇧ | Shift | -| ⌥ | Option (alt) | -| ⎋ | Esc | -| ⇥ | Tab forward | -| ⇤ | Tab backward | -| ⌃ | Control | -| ⣠| Space | -| ⌫ | Backspace | -| ⌦ | Delete | -| ⎠| Enter | -| ⌤ | Return | -| ⌽ | Power on/off button | -| ↖ | Home | -| ↘ | End | -| ⇞ | Page up | -| ⇟ | Page down | -| ⌧ | Clear | diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_base.png b/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_base.png deleted file mode 100644 index f9bc8b443..000000000 Binary files a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_base.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_fn.png b/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_fn.png deleted file mode 100644 index 983b72348..000000000 Binary files a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_fn.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_keypad.png b/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_keypad.png deleted file mode 100644 index 8f04b4327..000000000 Binary files a/keyboards/ergodox_ez/keymaps/townk_osx/townk_osx_keypad.png and /dev/null differ diff --git a/keyboards/ergodox_ez/keymaps/twey/keymap.c b/keyboards/ergodox_ez/keymaps/twey/keymap.c deleted file mode 100644 index 019930f2a..000000000 --- a/keyboards/ergodox_ez/keymaps/twey/keymap.c +++ /dev/null @@ -1,221 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -#include "keymap_plover.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define STEN 2 // steno -#define MDIA 3 // media keys - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,---------------------------------------------------. ,---------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | STEN | | NONE | 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+-------+-------------| |-------+------+------+------+------+------+--------| - * | Del | ' | , | . | P | Y | Esc | | Caps | F | G | C | R | L | / | - * |--------+------+------+------+-------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |-------| D | H | T | N | S | - | - * |--------+------+------+------+-------+------| Tab | | Enter |------+------+------+------+------+--------| - * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | - * `--------+------+------+------+-------+-------------' `--------------+------+------+------+------+--------' - * | L1 | NONE | Grv | Left | Right | | Up | Down | [ | ] | L1 | - * `-----------------------------------' `----------------------------------' - * ,--------------. ,---------------. - * | PgUp | PgDn | | Home | End | - * ,------|-------|------| |-------+-------+------. - * | | | NONE | | AltGr | | | - * | Alt | Enter |------| |-------| Space | Ctrl | - * | | | Supr | | ~MDIA | | | - * `---------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, M(0), - KC_DELT, KC_QUOT, KC_COMM,KC_DOT, KC_P, KC_Y, KC_ESC, - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_TAB, - MO(SYMB), KC_NO, KC_GRV, KC_LEFT,KC_RGHT, - KC_PGUP,KC_PGDN, - KC_NO, - KC_LALT,KC_ENT ,KC_LGUI, - // right hand - KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - KC_CAPS, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - KC_ENT, KC_B, KC_M, KC_W, KC_V, KC_Z , KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, MO(SYMB), - KC_HOME, KC_END, - KC_RALT, - MO(MDIA),KC_SPC,KC_RCTL - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -[STEN] = KEYMAP( // layout: layer 2: Steno for Plover - // left hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_STAR, - KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, - KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, - KC_TRNS,KC_NO, KC_NO, KC_TRNS, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - PV_A, PV_O, KC_NO, - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - PV_STAR, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, - PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, - PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, - KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, - KC_NO, KC_NO, - KC_NO, - KC_TRNS,PV_E, PV_U -), - -/* Keymap 3: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | Back | | Frwd | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | Prev | Play | Next | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK, KC_TRNS, KC_WFWD, KC_TRNS, KC_TRNS, - KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(MDIA) // FN1 - Momentary Layer 3 (Media) -}; - -void toggle_steno(int pressed) -{ - uint8_t layer = biton32(layer_state); - - if (pressed) { - if (layer != STEN) layer_on(STEN); else layer_off(STEN); - - register_code(PV_LP); - register_code(PV_LH); - register_code(PV_LR); - register_code(PV_O); - register_code(PV_RL); - register_code(PV_RG); - } else { - unregister_code(PV_LP); - unregister_code(PV_LH); - unregister_code(PV_LR); - unregister_code(PV_O); - unregister_code(PV_RL); - unregister_code(PV_RG); - } -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - toggle_steno(record->event.pressed); - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint32_t layer0 = layer_state & (1UL << 0), - layer1 = layer_state & (1UL << 1), - layer2 = layer_state & (1UL << 2), - layer3 = layer_state & (1UL << 3); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - if (layer1) ergodox_right_led_1_on(); - if (layer2) ergodox_right_led_2_on(); - if (layer3) ergodox_right_led_3_on(); -}; diff --git a/keyboards/ergodox_ez/keymaps/twey/readme.md b/keyboards/ergodox_ez/keymaps/twey/readme.md deleted file mode 100644 index 979e4261e..000000000 --- a/keyboards/ergodox_ez/keymaps/twey/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# Twey's Home Configuration -## Layers -- Layer 0: Non-ANSI Dvorak layout, with modified modifiers — all - modifiers on thumb keys, as well as return and space. -- Layer 1: Default symbol layout. -- Layer 2: Plover-oriented stenography layer. -- Layer 3: Extended media/mouse layout. - -## Unusual features -The Plover key (top right key on the left half) also sends my Plover -‘toggle’ chord (SH-FT) when pressed, as well as toggling the steno -layer, so you can toggle between steno and typing modes with a single -keypress. - -If you want to use this feature, you'll need to add the -`commands.json` dictionary to your Plover dictionaries, or define the -toggle stroke (`PHROLG`) yourself. diff --git a/keyboards/ergodox_ez/keymaps/workman_osx_mdw/keymap.c b/keyboards/ergodox_ez/keymaps/workman_osx_mdw/keymap.c deleted file mode 100644 index 8effa53b2..000000000 --- a/keyboards/ergodox_ez/keymaps/workman_osx_mdw/keymap.c +++ /dev/null @@ -1,366 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" -// readme -// This keyboard layout is based on the [Workman Dead layout](https://github.com/ojbucao/Workman/tree/master/mac#workman-dead-for-programmers), which uses the comma as a dead key to trigger a second layer. -// Since I have more keys at my disposal on the ErgoDox, I moved the dead key to the bottom right. There are still a lot of -// blanks so still discovering what I like. -// If you aren't familiar with a dead key, the idea is that you tap the dead key which switches the layout. the next key you hit -// triggers the key you pressed AND switches the layout back to the original. For now I do this with a super kludgey macro and I -// look forward to learning about a more elegant way to do the same thing. Until then, this will have to do. - - -// TODO: Define layer names that make sense for the ErgoDox EZ. -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys -#define DEAD 3 // dead version of the symbols layer - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | D | R | W | B | L1 | | L1 | J | F | U | P | ; | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Hyper | A | S | H | T | G |------| |------| Y | N | E | O | I | ' | - * |--------+------+------+------+------+------| | | Meh |------+------+------+------+------+--------| - * | LShift | Z | X | M | C | V | | | | K | L | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | CTRL | OPT | CMD | | Left | Down | Up | Right| L3 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * |Bckspc| Space|------| |------| Space |Enter | - * | | | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(1), - ALL_T(KC_ESC), KC_A, KC_S, KC_H, KC_T, KC_G, - KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_NO, - KC_NO, KC_NO, KC_LCTL,KC_LALT,KC_LGUI, - KC_NO, KC_NO, - KC_HOME, - KC_BSPC,KC_SPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(1), KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, - KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, - MEH_T(KC_NO),KC_K, KC_L, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_LEFT,KC_DOWN,KC_UP, KC_RGHT, KC_FN4, - KC_NO, KC_NO, - KC_PGUP, - KC_PGDN,KC_SPC,KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | % | & | ? | + | @ | | | | $ | _ | [ | ] | ! | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | / | ( | = | 0 | { |------| |------| } | 1 | * | ) | - | " | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 6 | 7 | 8 | 9 | | | | | | \ | 2 | 3 | 4 | 5 | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, KC_PERC, KC_AMPR, LSFT(KC_SLSH), LSFT(KC_EQL), KC_AT, KC_TRNS, - KC_TRNS, KC_SLSH, KC_LPRN, KC_EQL, KC_0, LSFT(KC_LBRC), - KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_PIPE, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_DLR, KC_UNDERSCORE, KC_LBRC, KC_RBRC, KC_EXLM, KC_F12, - KC_RCBR, KC_1, KC_ASTR, KC_RPRN, KC_MINS, KC_QUOT, - KC_TRNS, KC_SLSH, KC_2, KC_3, KC_4, KC_5, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -/* Keymap 4: Dead Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | % | & | ? | + | @ | | | | $ | _ | [ | ] | ! | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | / | ( | = | 0 | { |------| |------| } | 1 | * | ) | - | " | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | 6 | 7 | 8 | 9 | | | | | | \ | 2 | 3 | 4 | 5 | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[DEAD] = KEYMAP( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS, M(100), M(101), M(102), M(103), M(104), KC_TRNS, - KC_TRNS, M(109), M(110), M(111), M(112), M(113), - KC_TRNS, M(120), M(121), M(122), M(123), M(124), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, M(105), M(106), M(107), M(108), M(130), KC_F12, - M(114), M(115), M(116), M(117), M(118), M(119), - KC_TRNS, M(125), M(126), M(127), M(128), M(129), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB), // FN1 - Momentary Layer 1 (Symbols) - [2] = ACTION_LAYER_ON(BASE,0), // FN2 - Go back to the base layer - [3] = ACTION_LAYER_ON(DEAD,0), - [4] = ACTION_LAYER_TOGGLE(DEAD), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - case 100: - layer_clear(); - return MACRODOWN(D(LSFT), T(5), U(LSFT), T(FN4), END); - break; - case 101: - layer_clear(); - return MACRODOWN(D(LSFT), T(7), U(LSFT), T(FN4), END); - break; - case 102: - layer_clear(); - return MACRODOWN(D(LSFT), T(SLSH), U(LSFT), T(FN4), END); - break; - case 103: - layer_clear(); - return MACRODOWN(D(LSFT), T(EQL), U(LSFT), T(FN4), END); - break; - case 104: - layer_clear(); - return MACRODOWN(D(LSFT), T(2), U(LSFT), T(FN4), END); - break; - case 105: - layer_clear(); - return MACRODOWN(D(LSFT), T(4), U(LSFT), T(FN4), END); - break; - case 106: - layer_clear(); - return MACRODOWN(D(LSFT), T(MINS), U(LSFT), T(FN4), END); - break; - case 107: - layer_clear(); - return MACRODOWN(T(LBRC), T(FN4), END); - break; - case 108: - layer_clear(); - return MACRODOWN(T(RBRC), T(FN4), END); - break; - case 130: - layer_clear(); - return MACRODOWN(D(LSFT), T(1), U(LSFT), T(FN4), END); - break; - case 109: - layer_clear(); - return MACRODOWN(T(SLSH), T(FN4), END); - break; - case 110: - layer_clear(); - return MACRODOWN(D(LSFT), T(9), U(LSFT), T(FN4), END); - break; - case 111: - layer_clear(); - return MACRODOWN(T(EQL), T(FN4), END); - break; - case 112: - layer_clear(); - return MACRODOWN(T(0), T(FN4), END); - break; - case 113: - layer_clear(); - return MACRODOWN(D(LSFT), T(LBRC), U(LSFT), T(FN4), END); - break; - case 114: - layer_clear(); - return MACRODOWN(D(LSFT), T(RBRC), U(LSFT), T(FN4), END); - break; - case 115: - layer_clear(); - return MACRODOWN(T(1), T(FN4), END); - break; - case 116: - layer_clear(); - return MACRODOWN(D(LSFT), T(8), U(LSFT), T(FN4), END); - break; - case 117: - layer_clear(); - return MACRODOWN(D(LSFT), T(0), U(LSFT), T(FN4), END); - break; - case 118: - layer_clear(); - return MACRODOWN(T(MINS), T(FN4), END); - break; - case 119: - layer_clear(); - return MACRODOWN(D(LSFT), T(QUOT), U(LSFT), T(FN4), END); - break; - case 120: - layer_clear(); - return MACRODOWN(T(6), T(FN4), END); - break; - case 121: - layer_clear(); - return MACRODOWN(T(7), T(FN4), END); - break; - case 122: - layer_clear(); - return MACRODOWN(T(8), T(FN4), END); - break; - case 123: - layer_clear(); - return MACRODOWN(T(9), T(FN4), END); - break; - case 124: - layer_clear(); - return MACRODOWN(D(LSFT), T(BSLS), U(LSFT), T(FN4), END); - break; - case 125: - layer_clear(); - return MACRODOWN(T(BSLS), T(FN4), END); - break; - case 126: - layer_clear(); - return MACRODOWN(T(2), T(FN4), END); - break; - case 127: - layer_clear(); - return MACRODOWN(T(3), T(FN4), END); - break; - case 128: - layer_clear(); - return MACRODOWN(T(4), T(FN4), END); - break; - case 129: - layer_clear(); - return MACRODOWN(T(5), T(FN4), END); - break; - - default: - return MACRO_NONE; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/zweihander-osx/keymap.c b/keyboards/ergodox_ez/keymaps/zweihander-osx/keymap.c deleted file mode 100644 index 3444152bc..000000000 --- a/keyboards/ergodox_ez/keymaps/zweihander-osx/keymap.c +++ /dev/null @@ -1,233 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -#define SGWK 0 // "sagewick", ⌘S ⌘⇥ -#define SGWF 1 // "sagewick freshly", ⌘S ⌘⇥ ⌘R -#define BBED 2 // BBEdit -#define TMNL 3 // Terminal -#define SAFA 4 // Safari -#define ALFRED_LEAD_TIME 100 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | L1 | | L1 | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ⌦ | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / L⌘ | - * |--------+------+------+------+------+------| L⌘ | | L⌘ |------+------+------+------+------+--------| - * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / / ⌃| R⇧ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L⌃ | L⌥ | L⌘ | ↠| → | | ↑ | ↓ | [ | ] | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | `~ | '" | | ⎋ | ⌫ | - * ,------|------|------| |------+--------+------. - * | | | PgUp | | PgDn | | | - * | | ⌫ |------| |------| ⇥ |Enter | - * | | | L⌥ | | L⌃ | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, - KC_LCTL, KC_LALT, KC_LGUI,KC_LEFT,KC_RGHT, - KC_GRV, KC_QUOT, - KC_PGUP, - KC_SPC,KC_BSPC,KC_LALT, - // right hand - TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_SPC , - KC_ESC, KC_BSPC, - KC_PGDN, - KC_LCTL, KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | [ | ] | { | } | " | | | | / | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | & | 1 | 2 | 3 | = | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | . | ↠| → | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | Home | | | - * | | |------| |------| | | - * | | | | | End | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQUO,KC_TRNS, - KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, - KC_0, KC_DOT, KC_LEFT, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_HOME, - KC_END , KC_TRNS, KC_TRNS -), -/* Keymap 2: Media keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | Power | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | PgUp |⌘S⌘⇥⌘R| Term | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |Safari| PgDn | | |------| |------| ⌘[ | ↠| ↓ | → | | ⯠| - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | |BBEdit| | | |L⇧+Spc| Spc | â® | â­ | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | Home | | End | | | - * | | |------| |------| ⌘C | ⌘V | - * | | | | | ⌘X | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_F14 , KC_F15 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /* F14 dims screen, F15 brightens */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, M(SGWF), M(TMNL), KC_TRNS, - KC_TRNS, KC_TRNS, M(SAFA), KC_PGDN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(BBED), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_HOME, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR, - KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, - LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY, - KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - LGUI(KC_X), LGUI(KC_C), LGUI(KC_V) -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case SGWK: - if (record->event.pressed) { - return MACRO( - I(10), - D(LGUI), T(S), U(LGUI), - D(LGUI), T(TAB), U(LGUI), - END); - } - break; - case SGWF: - if (record->event.pressed) { - return MACRO( - I(10), - D(LGUI), T(S), U(LGUI), - D(LGUI), T(TAB), U(LGUI), - D(LGUI), T(R), U(LGUI), - END); - } - break; - case BBED: - if (record->event.pressed) { - return MACRO( - I(10), - D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), - T(B), T(B), T(E), T(D), T(I), T(T), - T(ENT), - END); - } - break; - case TMNL: - if (record->event.pressed) { - return MACRO( - I(10), - D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), - T(T), T(E), T(R), T(M), T(I), T(N), T(A), T(L), - T(ENT), - END); - } - break; - case SAFA: - if (record->event.pressed) { - return MACRO( - I(10), - D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), - T(S), T(A), T(F), T(A), T(R), T(I), - T(ENT), - END); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/zweihander-osx/readme.markdown b/keyboards/ergodox_ez/keymaps/zweihander-osx/readme.markdown deleted file mode 100644 index 7bce7c690..000000000 --- a/keyboards/ergodox_ez/keymaps/zweihander-osx/readme.markdown +++ /dev/null @@ -1,45 +0,0 @@ -# The Zweihander Layout - -NB: the backtick (\`) is special in Markdown. If I write ⌘\` in this readme, I mean “command-backtickâ€, not “command-backslash-backtickâ€. - -This layout is tuned for people who… - - -## use OS X - -This layout doesn’t make any concessions for Windows use. While it should work fine in Windows, I’m not about to devote precious keyboard space to Windows-specific shortcuts. - - -## mouse left-handed while doing other things with the right hand - -I tend to have my mouse in my left hand, but I like to use my other hand to make things go faster. I’ve added a bunch of buttons to the media layer to speed up browsing in Safari and Finder: - -- Close Window (⌘W) -- Back (⌘[) -- Forward (⌘]) -- Open and Close Parent Folder (⌥⌘↓) -- Go Up and Close Just-Left Folder (⌥⌘↑) -- Cycle through open windows in current application (⌘\` and ⌘⇧\`) -- Cycle through tabs in current window (⌥⇥ and ⌥⇧⇥) -- Space (page down in browsers; Quick Look in the Finder) -- Shift-Space (page up in web browsers) - -Because moving letter-by-letter is way slower than moving word-by-word, I added Option (⌥) to the bottommost button on the left side. This key can be held easily while holding ; (activate media layer) and pressing J and L to move left and right by word. - - -## use lots of modifier keys in OS X menu-item shortcuts - -I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once; this is why the bottom left of the keyboard has shift, control, option, and command in the usual spaces. Further, some common shortcuts I press have a key on the right side of the keyboard. These shortcuts include: - -- Empty Trash Without Asking for Confirmation (⇧⌥⌘⌫) -- Shut Down Without Asking for Confirmation (⇧⌥⌘ power) - - -## use Emacs-style shortcuts - -I press C-a, C-e, and C-k all the time. It’s difficult to press these key combinations with the control key on the bottom left and I’m too quick on the draw for the control function on the / key to work reliably, so the bottommost thumb button on the right side is another control key. - - -## use spreadsheets - -All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c deleted file mode 100644 index dc29cf5cd..000000000 --- a/keyboards/ergodox_ez/matrix.c +++ /dev/null @@ -1,382 +0,0 @@ -/* - -Note for ErgoDox EZ customizers: Here be dragons! -This is not a file you want to be messing with. -All of the interesting stuff for you is under keymaps/ :) -Love, Erez - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "action_layer.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "ergodox_ez.h" -#include "i2cmaster.h" -#ifdef DEBUG_MATRIX_SCAN_RATE -#include "timer.h" -#endif - -/* - * This constant define not debouncing time in msecs, but amount of matrix - * scan loops which should be made to get stable debounced results. - * - * On Ergodox matrix scan rate is relatively low, because of slow I2C. - * Now it's only 317 scans/second, or about 3.15 msec/scan. - * According to Cherry specs, debouncing time is 5 msec. - * - * And so, there is no sense to have DEBOUNCE higher than 2. - */ - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(uint8_t row); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - -static uint8_t mcp23018_reset_loop; - -#ifdef DEBUG_MATRIX_SCAN_RATE -uint32_t matrix_timer; -uint32_t matrix_scan_count; -#endif - - -__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(); -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - // initialize row and col - - mcp23018_status = init_mcp23018(); - - - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - -#ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; -#endif - - matrix_init_kb(); - -} - -void matrix_power_up(void) { - mcp23018_status = init_mcp23018(); - - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - -#ifdef DEBUG_MATRIX_SCAN_RATE - matrix_timer = timer_read32(); - matrix_scan_count = 0; -#endif - -} - -uint8_t matrix_scan(void) -{ - if (mcp23018_status) { // if there was an error - if (++mcp23018_reset_loop == 0) { - // since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans - // this will be approx bit more frequent than once per second - print("trying to reset mcp23018\n"); - mcp23018_status = init_mcp23018(); - if (mcp23018_status) { - print("left side not responding\n"); - } else { - print("left side attached\n"); - ergodox_blink_all_leds(); - } - } - } - -#ifdef DEBUG_MATRIX_SCAN_RATE - matrix_scan_count++; - - uint32_t timer_now = timer_read32(); - if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) { - print("matrix scan frequency: "); - pdec(matrix_scan_count); - print("\n"); - - matrix_timer = timer_now; - matrix_scan_count = 0; - } -#endif - - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - wait_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(i); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - wait_us(1); - // this should be wait_ms(1) but has been left as-is at EZ's request - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - matrix_scan_quantum(); - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1< http://jump.to/fleury -* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device with hardware TWI -* Usage: API compatible with I2C Software Library i2cmaster.h -**************************************************************************/ -#include -#include - -#include - - -/* define CPU frequency in Mhz here if not defined in Makefile */ -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -/* I2C clock in Hz */ -#define SCL_CLOCK 400000L - - -/************************************************************************* - Initialization of the I2C bus interface. Need to be called only once -*************************************************************************/ -void i2c_init(void) -{ - /* initialize TWI clock - * minimal values in Bit Rate Register (TWBR) and minimal Prescaler - * bits in the TWI Status Register should give us maximal possible - * I2C bus speed - about 444 kHz - * - * for more details, see 20.5.2 in ATmega16/32 secification - */ - - TWSR = 0; /* no prescaler */ - TWBR = 10; /* must be >= 10 for stable operation */ - -}/* i2c_init */ - - -/************************************************************************* - Issues a start condition and sends address and transfer direction. - return 0 = device accessible, 1= failed to access device -*************************************************************************/ -unsigned char i2c_start(unsigned char address) -{ - uint8_t twst; - - // send START condition - TWCR = (1<= 0: - if section['name'] == 'layout_config': - config.update(loads("\n".join( - section['code_lines'] - ))) - elif section['sub_name'].startswith('layer'): - layer_name = section['sub_name'] - config['layer_lines'][layer_name] = section['code_lines'] - - reset_section() - - def amend_section(line_index, line): - section['end_line'] = line_index - section['code_lines'].append(line) - - config = DEFAULT_CONFIG.copy() - config.update({ - 'layer_lines': collections.OrderedDict(), - 'macro_ids': {'UM'}, - 'unicode_macros': {}, - }) - - section = {} - reset_section() - - with io.open(path, encoding="utf-8") as fh: - for i, line in enumerate(fh): - if line.startswith("#"): - start_section(i, line) - elif line.startswith(" "): - amend_section(i, line[4:]) - else: - # TODO: maybe parse description - pass - - end_section() - assert 'layout' in config - return config - -# header file parsing - -IF0_RE = re.compile(r""" - ^ - #if 0 - $.*? - #endif -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -COMMENT_RE = re.compile(r""" - /\* - .*? - \*/" -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -def read_header_file(path): - with io.open(path, encoding="utf-8") as fh: - data = fh.read() - data, _ = COMMENT_RE.subn("", data) - data, _ = IF0_RE.subn("", data) - return data - - -def regex_partial(re_str_fmt, flags): - def partial(*args, **kwargs): - re_str = re_str_fmt.format(*args, **kwargs) - return re.compile(re_str, flags) - return partial - - -KEYDEF_REP = regex_partial(r""" - #define - \s - ( - (?:{}) # the prefixes - (?:\w+) # the key name - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -ENUM_RE = re.compile(r""" - ( - enum - \s\w+\s - \{ - .*? # the enum content - \} - ; - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -ENUM_KEY_REP = regex_partial(r""" - ( - {} # the prefixes - \w+ # the key name - ) # capture group end -""", re.MULTILINE | re.DOTALL | re.VERBOSE) - - -def parse_keydefs(config, data): - prefix_options = "|".join(config['key_prefixes']) - keydef_re = KEYDEF_REP(prefix_options) - enum_key_re = ENUM_KEY_REP(prefix_options) - for match in keydef_re.finditer(data): - yield match.groups()[0] - - for enum_match in ENUM_RE.finditer(data): - enum = enum_match.groups()[0] - for key_match in enum_key_re.finditer(enum): - yield key_match.groups()[0] - - -def parse_valid_keys(config, out_path): - basepath = os.path.abspath(os.path.join(os.path.dirname(out_path))) - dirpaths = [] - subpaths = [] - while len(subpaths) < 6: - path = os.path.join(basepath, *subpaths) - dirpaths.append(path) - dirpaths.append(os.path.join(path, "tmk_core", "common")) - dirpaths.append(os.path.join(path, "quantum")) - subpaths.append('..') - - includes = set(config['keymaps_includes']) - includes.add("keycode.h") - - valid_keycodes = set() - for dirpath, include in it.product(dirpaths, includes): - include_path = os.path.join(dirpath, include) - if os.path.exists(include_path): - header_data = read_header_file(include_path) - valid_keycodes.update( - parse_keydefs(config, header_data) - ) - return valid_keycodes - - -# Keymap Parsing - -def iter_raw_codes(layer_lines, filler, separator): - filler_re = re.compile("[" + filler + " ]") - for line in layer_lines: - line, _ = filler_re.subn("", line.strip()) - if not line: - continue - codes = line.split(separator) - for code in codes[1:-1]: - yield code - - -def iter_indexed_codes(raw_codes, key_indexes): - key_rows = {} - key_indexes_flat = [] - - for row_index, key_indexes in enumerate(key_indexes): - for key_index in key_indexes: - key_rows[key_index] = row_index - key_indexes_flat.extend(key_indexes) - assert len(raw_codes) == len(key_indexes_flat) - for raw_code, key_index in zip(raw_codes, key_indexes_flat): - # we keep track of the row mostly for layout purposes - yield raw_code, key_index, key_rows[key_index] - - -LAYER_CHANGE_RE = re.compile(r""" - (DF|TG|MO)\(\d+\) -""", re.VERBOSE) - - -MACRO_RE = re.compile(r""" - M\(\w+\) -""", re.VERBOSE) - - -UNICODE_RE = re.compile(r""" - U[0-9A-F]{4} -""", re.VERBOSE) - - -NON_CODE = re.compile(r""" - ^[^A-Z0-9_]$ -""", re.VERBOSE) - - -def parse_uni_code(raw_code): - macro_id = "UC_" + ( - unicodedata.name(raw_code) - .replace(" ", "_") - .replace("-", "_") - ) - code = "M({})".format(macro_id) - uc_hex = "{:04X}".format(ord(raw_code)) - return code, macro_id, uc_hex - - -def parse_key_code(raw_code, key_prefixes, valid_keycodes): - if raw_code in valid_keycodes: - return raw_code - - for prefix in key_prefixes: - code = prefix + raw_code - if code in valid_keycodes: - return code - - -def parse_code(raw_code, key_prefixes, valid_keycodes): - if not raw_code: - return 'KC_TRNS', None, None - - if LAYER_CHANGE_RE.match(raw_code): - return raw_code, None, None - - if MACRO_RE.match(raw_code): - macro_id = raw_code[2:-1] - return raw_code, macro_id, None - - if UNICODE_RE.match(raw_code): - hex_code = raw_code[1:] - return parse_uni_code(chr(int(hex_code, 16))) - - if NON_CODE.match(raw_code): - return parse_uni_code(raw_code) - - code = parse_key_code(raw_code, key_prefixes, valid_keycodes) - return code, None, None - - -def parse_keymap(config, key_indexes, layer_lines, valid_keycodes): - keymap = {} - raw_codes = list(iter_raw_codes( - layer_lines, config['filler'], config['separator'] - )) - indexed_codes = iter_indexed_codes(raw_codes, key_indexes) - key_prefixes = config['key_prefixes'] - for raw_code, key_index, row_index in indexed_codes: - code, macro_id, uc_hex = parse_code( - raw_code, key_prefixes, valid_keycodes - ) - # TODO: line numbers for invalid codes - err_msg = "Could not parse key '{}' on row {}".format( - raw_code, row_index - ) - assert code is not None, err_msg - # print(repr(raw_code), repr(code), macro_id, uc_hex) - if macro_id: - config['macro_ids'].add(macro_id) - if uc_hex: - config['unicode_macros'][macro_id] = uc_hex - keymap[key_index] = (code, row_index) - return keymap - - -def parse_keymaps(config, valid_keycodes): - keymaps = collections.OrderedDict() - key_indexes = config.get( - 'key_indexes', KEYBOARD_LAYOUTS[config['layout']] - ) - # TODO: maybe validate key_indexes - - for layer_name, layer_lines, in config['layer_lines'].items(): - keymaps[layer_name] = parse_keymap( - config, key_indexes, layer_lines, valid_keycodes - ) - return keymaps - -# keymap.c output - -USERCODE = """ -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - case L1: - ergodox_right_led_1_on(); - break; - case L2: - ergodox_right_led_2_on(); - break; - case L3: - ergodox_right_led_3_on(); - break; - case L4: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - case L5: - ergodox_right_led_1_on(); - ergodox_right_led_3_on(); - break; - // case L6: - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - // case L7: - // ergodox_right_led_1_on(); - // ergodox_right_led_2_on(); - // ergodox_right_led_3_on(); - // break; - default: - ergodox_board_led_off(); - break; - } -}; -""" - -MACROCODE = """ -#define UC_MODE_WIN 0 -#define UC_MODE_LINUX 1 -#define UC_MODE_OSX 2 - -// TODO: allow default mode to be configured -static uint16_t unicode_mode = UC_MODE_WIN; - -uint16_t hextokeycode(uint8_t hex) {{ - if (hex == 0x0) {{ - return KC_P0; - }} - if (hex < 0xA) {{ - return KC_P1 + (hex - 0x1); - }} - return KC_A + (hex - 0xA); -}} - -void unicode_action_function(uint16_t hi, uint16_t lo) {{ - switch (unicode_mode) {{ - case UC_MODE_WIN: - register_code(KC_LALT); - - register_code(KC_PPLS); - unregister_code(KC_PPLS); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LALT); - break; - case UC_MODE_LINUX: - register_code(KC_LCTL); - register_code(KC_LSFT); - - register_code(KC_U); - unregister_code(KC_U); - - register_code(hextokeycode((hi & 0xF0) >> 4)); - unregister_code(hextokeycode((hi & 0xF0) >> 4)); - register_code(hextokeycode((hi & 0x0F))); - unregister_code(hextokeycode((hi & 0x0F))); - register_code(hextokeycode((lo & 0xF0) >> 4)); - unregister_code(hextokeycode((lo & 0xF0) >> 4)); - register_code(hextokeycode((lo & 0x0F))); - unregister_code(hextokeycode((lo & 0x0F))); - - unregister_code(KC_LCTL); - unregister_code(KC_LSFT); - break; - case UC_MODE_OSX: - break; - }} -}} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {{ - if (!record->event.pressed) {{ - return MACRO_NONE; - }} - // MACRODOWN only works in this function - switch(id) {{ - case UM: - unicode_mode = (unicode_mode + 1) % 2; - break; -{macro_cases} -{unicode_macro_cases} - default: - break; - }} - return MACRO_NONE; -}}; -""" - - -UNICODE_MACRO_TEMPLATE = """ -case {macro_id}: - unicode_action_function(0x{hi:02x}, 0x{lo:02x}); - break; -""".strip() - - -def unicode_macro_cases(config): - for macro_id, uc_hex in config['unicode_macros'].items(): - hi = int(uc_hex, 16) >> 8 - lo = int(uc_hex, 16) & 0xFF - unimacro_keys = ", ".join( - "T({})".format( - "KP_" + digit if digit.isdigit() else digit - ) for digit in uc_hex - ) - yield UNICODE_MACRO_TEMPLATE.format( - macro_id=macro_id, hi=hi, lo=lo - ) - - -def iter_keymap_lines(keymap, row_indents=None): - col_widths = {} - col = 0 - # first pass, figure out the column widths - prev_row_index = None - for code, row_index in keymap.values(): - if row_index != prev_row_index: - col = 0 - if row_indents: - col = row_indents[row_index] - col_widths[col] = max(len(code), col_widths.get(col, 0)) - prev_row_index = row_index - col += 1 - - # second pass, yield the cell values - col = 0 - prev_row_index = None - for key_index in sorted(keymap): - code, row_index = keymap[key_index] - if row_index != prev_row_index: - col = 0 - yield "\n" - if row_indents: - for indent_col in range(row_indents[row_index]): - pad = " " * (col_widths[indent_col] - 4) - yield (" /*-*/" + pad) - col = row_indents[row_index] - else: - yield pad - yield " {}".format(code) - if key_index < len(keymap) - 1: - yield "," - # This will be yielded on the next iteration when - # we know that we're not at the end of a line. - pad = " " * (col_widths[col] - len(code)) - prev_row_index = row_index - col += 1 - - -def iter_keymap_parts(config, keymaps): - # includes - for include_path in config['keymaps_includes']: - yield '#include "{}"\n'.format(include_path) - - yield "\n" - - # definitions - for i, macro_id in enumerate(sorted(config['macro_ids'])): - yield "#define {} {}\n".format(macro_id, i) - - yield "\n" - - for i, layer_name in enumerate(config['layer_lines']): - yield '#define L{0:<3} {0:<5} // {1}\n'.format(i, layer_name) - - yield "\n" - - # keymaps - yield "const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n" - - for i, layer_name in enumerate(config['layer_lines']): - # comment - layer_lines = config['layer_lines'][layer_name] - prefixed_lines = " * " + " * ".join(layer_lines) - yield "/*\n{} */\n".format(prefixed_lines) - - # keymap codes - keymap = keymaps[layer_name] - row_indents = ROW_INDENTS.get(config['layout']) - keymap_lines = "".join(iter_keymap_lines(keymap, row_indents)) - yield "[L{0}] = KEYMAP({1}\n),\n".format(i, keymap_lines) - - yield "};\n\n" - - # no idea what this is for - yield "const uint16_t PROGMEM fn_actions[] = {};\n" - - # macros - yield MACROCODE.format( - macro_cases="", - unicode_macro_cases="\n".join(unicode_macro_cases(config)), - ) - - # TODO: dynamically create blinking lights - yield USERCODE - - -def main(argv=sys.argv[1:]): - if not argv or '-h' in argv or '--help' in argv: - print(__doc__) - return 0 - - in_path = os.path.abspath(argv[0]) - if not os.path.exists(in_path): - print("No such file '{}'".format(in_path)) - return 1 - - if len(argv) > 1: - out_path = os.path.abspath(argv[1]) - else: - dirname = os.path.dirname(in_path) - out_path = os.path.join(dirname, "keymap.c") - - config = parse_config(in_path) - valid_keys = parse_valid_keys(config, out_path) - keymaps = parse_keymaps(config, valid_keys) - - with io.open(out_path, mode="w", encoding="utf-8") as fh: - for part in iter_keymap_parts(config, keymaps): - fh.write(part) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/keyboards/ergodox_ez/util/readme.md b/keyboards/ergodox_ez/util/readme.md deleted file mode 100644 index 26c5e5d99..000000000 --- a/keyboards/ergodox_ez/util/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# ErgoDox EZ Utilities - -The Python script in this directory, by [mbarkhau](https://github.com/mbarkhau) allows you to write out a basic ErgoDox EZ keymap using Markdown notation, and then transpile it to C, which you can then compile. It's experimental, but if you're not comfortable using C, it's a nice option. diff --git a/keyboards/infinity_ergodox/MEMO.txt b/keyboards/infinity_ergodox/MEMO.txt deleted file mode 100644 index e2886aa00..000000000 --- a/keyboards/infinity_ergodox/MEMO.txt +++ /dev/null @@ -1,385 +0,0 @@ -flabbergast's TMK/ChibiOS port -============================== -2015/10/16 - - -Build ------ -$ git clone -b chibios https://github.com/flabbergast/tmk_keyboard.git - -$ cd tmk_keyboard -$ git submodule add -f -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios -or -$ cd tmk_keyboard/tmk_core/tool/chibios -$ git clone -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios - -$ cd tmk_keyboard/keyboard/infinity_chibios -$ make - - - - -Chibios Configuration ---------------------- -halconf.h: for HAL configuration - placed in project directory - read in chibios/os/hal/hal.mk - included in chibios/os/hal/include/hal.h -mcuconf.h: for MCU configuration - placed in project directory - included in halconf.h - - -Chibios Term ------------- -PAL = Port Abstraction Layer - palWritePad - palReadPad - palSetPad - chibios/os/hal/include/pal.h - -LLD = Low Level Driver - - -Makefile --------- - # /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) - MCU_FAMILY = KINETIS - MCU_SERIES = KL2x - - # - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ - # or /ld/ - MCU_LDSCRIPT = MKL26Z64 - - # - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ - MCU_STARTUP = kl2x - - # Board: it should exist either in /os/hal/boards/ - # or /boards - BOARD = PJRC_TEENSY_LC - - MCU = cortex-m0 - - # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 - ARMV = 6 - - -halconf.h ---------- - - -mcuconf.h ---------- - - -chconf.h --------- - - -ld script ---------- ---- ../../tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/ld/MKL26Z64.ld 2015-10-15 09:08:58.732904304 +0900 -+++ ld/MKL26Z64.ld 2015-10-15 08:48:06.430215496 +0900 -@@ -27,7 +27,8 @@ - { - flash0 : org = 0x00000000, len = 0xc0 - flashcfg : org = 0x00000400, len = 0x10 -- flash : org = 0x00000410, len = 64k - 0x410 -+ flash : org = 0x00000410, len = 62k - 0x410 -+ eeprom_emu : org = 0x0000F800, len = 2k - ram : org = 0x1FFFF800, len = 8k - } - -@@ -35,6 +36,10 @@ - __ram_size__ = LENGTH(ram); - __ram_end__ = __ram_start__ + __ram_size__; - -+__eeprom_workarea_start__ = ORIGIN(eeprom_emu); -+__eeprom_workarea_size__ = LENGTH(eeprom_emu); -+__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; -+ - SECTIONS - { - . = 0; - - - -Configuration/Startup for Infinity 60% --------------------------------------- -Configuration: - - -Clock: -Inifinity - FEI(FLL Engaged Internal) mode with core clock:48MHz, bus clock:48MHz, flash clock:24MHz - Clock dividor: - SIM_CLKDIV1[OUTDIV1] = 0 divide-by-1 for core clock - SIM_CLKDIV1[OUTDIV2] = 0 divide-by-1 for bus clock - SIM_CLKDIV1[OUTDIV4] = 1 divide-by-2 for flash clock - Internal reference clock: - MCG_C1[IREFS] = 1 Internal Reference Select for clock source for FLL - MCG_C1[IRCLKEN] = 1 Internal Reference Clock Enable - FLL multipilication: - MCG_C4[DMX32] = 1 - MCG_C4[DRST_DRS] = 01 FLL factor 1464 * 32.768kHz = 48MHz - -chibios/os/hal/ports/KINETIS/K20x/hal_lld.c - k20x_clock_init(): called in __early_init() defined in board.c - disable watchdog and configure clock - - configurable macros: - KINETIS_NO_INIT: whether init or not - KINETIS_MCG_MODE: clock mode - KINETIS_MCG_MODE_FEI - KINETIS_MCG_MODE_PEE - hal/ports/KINETIS/K20x/hal_lld.h - - -chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.h - PALConfig pal_default_config - boardInit() - __early_init() - macro definitions for board infos, freq and mcu type - -chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.c - -USB - - -Startup -------- - common/ports/ARMCMx/GCC/crt0_v[67]m.s - Reset_Handler: startup code - common/ports/ARMCMx/GCC/crt1.c - __core_init(): weak - __early_init(): weak - __late_init(): weak - __default_exit(): weak - called from Reset_Handler of crt0 - common/ports/ARMCMx/GCC/vector.c - common/ports/ARMCMx/GCC/ld/*.ld - -chibios/os/common/ports/ARMCMx/compilers/GCC/ -├── crt0_v6m.s -├── crt0_v7m.s -├── crt1.c -├── ld -│   ├── MK20DX128BLDR3.ld -│   ├── MK20DX128BLDR4.ld -│   ├── MK20DX128.ld -│   ├── MK20DX256.ld -│   ├── MKL25Z128.ld -│   ├── MKL26Z128.ld -│   ├── MKL26Z64.ld -│   └── STM32L476xG.ld -├── mk -│   ├── startup_k20x5.mk -│   ├── startup_k20x7.mk -│   ├── startup_k20x.mk -│   ├── startup_kl2x.mk -│   └── startup_stm32l4xx.mk -├── rules.ld -├── rules.mk -└── vectors.c - -chibios/os/hal/ -├── boards -│   ├── FREESCALE_FREEDOM_K20D50M -│   │   ├── board.c -│   │   ├── board.h -│   │   └── board.mk -│   ├── MCHCK_K20 -│   │   ├── board.c -│   │   ├── board.h -│   │   └── board.mk -│   ├── PJRC_TEENSY_3 -│   │   ├── board.c -│   │   ├── board.h -│   │   └── board.mk -│   ├── PJRC_TEENSY_3_1 -│   │   ├── board.c -│   │   ├── board.h -│   │   └── board.mk -│   ├── PJRC_TEENSY_LC -│   │   ├── board.c -│   │   ├── board.h -│   │   └── board.mk -│   ├── readme.txt -│   ├── simulator -│   │   ├── board.c -│   │   ├── board.h -│   │   └── board.mk -│   ├── ST_NUCLEO_F030R8 -│   │   ├── board.c -│   │   ├── board.h -│   │   ├── board.mk -│   │   └── cfg -│   │   └── board.chcfg -├── hal.mk -├── include -│   ├── adc.h -│   ├── can.h -│   ├── dac.h -│   ├── ext.h -│   ├── gpt.h -│   ├── hal_channels.h -│   ├── hal_files.h -│   ├── hal.h -│   ├── hal_ioblock.h -│   ├── hal_mmcsd.h -│   ├── hal_queues.h -│   ├── hal_streams.h -│   ├── i2c.h -│   ├── i2s.h -│   ├── icu.h -│   ├── mac.h -│   ├── mii.h -│   ├── mmc_spi.h -│   ├── pal.h -│   ├── pwm.h -│   ├── rtc.h -│   ├── sdc.h -│   ├── serial.h -│   ├── serial_usb.h -│   ├── spi.h -│   ├── st.h -│   ├── uart.h -│   └── usb.h -├── lib -│   └── streams -│   ├── chprintf.c -│   ├── chprintf.h -│   ├── memstreams.c -│   ├── memstreams.h -│   ├── nullstreams.c -│   └── nullstreams.h -├── osal -│   ├── nil -│   │   ├── osal.c -│   │   ├── osal.h -│   │   └── osal.mk -│   ├── os-less -│   │   └── ARMCMx -│   │   ├── osal.c -│   │   ├── osal.h -│   │   └── osal.mk -│   └── rt -│   ├── osal.c -│   ├── osal.h -│   └── osal.mk -├── ports -│   ├── AVR -│   ├── common -│   │   └── ARMCMx -│   │   ├── mpu.h -│   │   ├── nvic.c -│   │   └── nvic.h -│   ├── KINETIS -│   │   ├── K20x -│   │   │   ├── hal_lld.c -│   │   │   ├── hal_lld.h -│   │   │   ├── kinetis_registry.h -│   │   │   ├── platform.dox -│   │   │   ├── platform.mk -│   │   │   ├── pwm_lld.c -│   │   │   ├── pwm_lld.h -│   │   │   ├── spi_lld.c -│   │   │   └── spi_lld.h -│   │   ├── KL2x -│   │   │   ├── hal_lld.c -│   │   │   ├── hal_lld.h -│   │   │   ├── kinetis_registry.h -│   │   │   ├── platform.mk -│   │   │   ├── pwm_lld.c -│   │   │   └── pwm_lld.h -│   │   ├── LLD -│   │   │   ├── adc_lld.c -│   │   │   ├── adc_lld.h -│   │   │   ├── ext_lld.c -│   │   │   ├── ext_lld.h -│   │   │   ├── gpt_lld.c -│   │   │   ├── gpt_lld.h -│   │   │   ├── i2c_lld.c -│   │   │   ├── i2c_lld.h -│   │   │   ├── pal_lld.c -│   │   │   ├── pal_lld.h -│   │   │   ├── serial_lld.c -│   │   │   ├── serial_lld.h -│   │   │   ├── st_lld.c -│   │   │   ├── st_lld.h -│   │   │   ├── usb_lld.c -│   │   │   └── usb_lld.h -│   │   └── README.md -│   ├── LPC -│   ├── simulator -│   └── STM32 -├── src -│   ├── adc.c -│   ├── can.c -│   ├── dac.c -│   ├── ext.c -│   ├── gpt.c -│   ├── hal.c -│   ├── hal_mmcsd.c -│   ├── hal_queues.c -│   ├── i2c.c -│   ├── i2s.c -│   ├── icu.c -│   ├── mac.c -│   ├── mmc_spi.c -│   ├── pal.c -│   ├── pwm.c -│   ├── rtc.c -│   ├── sdc.c -│   ├── serial.c -│   ├── serial_usb.c -│   ├── spi.c -│   ├── st.c -│   ├── uart.c -│   └── usb.c -└── templates - ├── adc_lld.c - ├── adc_lld.h - ├── can_lld.c - ├── can_lld.h - ├── dac_lld.c - ├── dac_lld.h - ├── ext_lld.c - ├── ext_lld.h - ├── gpt_lld.c - ├── gpt_lld.h - ├── halconf.h - ├── hal_lld.c - ├── hal_lld.h - ├── i2c_lld.c - ├── i2c_lld.h - ├── i2s_lld.c - ├── i2s_lld.h - ├── icu_lld.c - ├── icu_lld.h - ├── mac_lld.c - ├── mac_lld.h - ├── mcuconf.h - ├── osal - │   ├── osal.c - │   ├── osal.h - │   └── osal.mk - ├── pal_lld.c - ├── pal_lld.h - ├── platform.mk - ├── pwm_lld.c - ├── pwm_lld.h - ├── rtc_lld.c - ├── rtc_lld.h - ├── sdc_lld.c - ├── sdc_lld.h - ├── serial_lld.c - ├── serial_lld.h - ├── spi_lld.c - ├── spi_lld.h - ├── st_lld.c - ├── st_lld.h - ├── uart_lld.c - ├── uart_lld.h - ├── usb_lld.c - └── usb_lld.h diff --git a/keyboards/infinity_ergodox/Makefile b/keyboards/infinity_ergodox/Makefile deleted file mode 100644 index 7edc03d8c..000000000 --- a/keyboards/infinity_ergodox/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -# project specific files -SRC = matrix.c \ - led.c - -## chip/board settings -# - the next two should match the directories in -# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) -# - For Teensies, FAMILY = KINETIS and SERIES is either -# KL2x (LC) or K20x (3.0,3.1,3.2). -# - For Infinity KB, SERIES = K20x -MCU_FAMILY = KINETIS -MCU_SERIES = K20x - -# Linker script to use -# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ -# or /ld/ -# - NOTE: a custom ld script is needed for EEPROM on Teensy LC -# - LDSCRIPT = -# - MKL26Z64 for Teensy LC -# - MK20DX128 for Teensy 3.0 -# - MK20DX256 for Teensy 3.1 and 3.2 -# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader -# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader -MCU_LDSCRIPT = MK20DX256BLDR8 - -# Startup code to use -# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ -# - STARTUP = -# - kl2x for Teensy LC -# - k20x5 for Teensy 3.0 and Infinity 60% -# - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox -MCU_STARTUP = k20x7 - -# Board: it should exist either in /os/hal/boards/ -# or /boards -# - BOARD = -# - PJRC_TEENSY_LC for Teensy LC -# - PJRC_TEENSY_3 for Teensy 3.0 -# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2 -# - MCHCK_K20 for Infinity KB -#BOARD = MCHCK_K20 -BOARD = PJRC_TEENSY_3_1 - -# Cortex version -# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 -MCU = cortex-m4 - -# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 -# I.e. 6 for Teensy LC; 7 for Teensy 3.x -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 - -# 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 -LCD_ENABLE ?= yes -LED_ENABLE ?= yes -LCD_BACKLIGHT_ENABLE ?= yes - -ifdef LCD_ENABLE -include drivers/gdisp/st7565ergodox/driver.mk -endif - -ifdef LED_ENABLE -include drivers/gdisp/IS31FL3731C/driver.mk -endif - -ifndef QUANTUM_DIR - include ../../Makefile -endif \ No newline at end of file diff --git a/keyboards/infinity_ergodox/bootloader_defs.h b/keyboards/infinity_ergodox/bootloader_defs.h deleted file mode 100644 index c67153be6..000000000 --- a/keyboards/infinity_ergodox/bootloader_defs.h +++ /dev/null @@ -1 +0,0 @@ -#define KIIBOHD_BOOTLOADER diff --git a/keyboards/infinity_ergodox/chconf.h b/keyboards/infinity_ergodox/chconf.h deleted file mode 100644 index d59c35eb6..000000000 --- a/keyboards/infinity_ergodox/chconf.h +++ /dev/null @@ -1,524 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -#define _CHIBIOS_RT_CONF_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 100000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 0 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 20 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM FALSE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_QUEUES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_TRACE FALSE - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK FALSE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief ISR enter hook. - */ -#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ - /* IRQ prologue code here.*/ \ -} - -/** - * @brief ISR exit hook. - */ -#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ - /* IRQ epilogue code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** - * @brief Trace hook. - * @details This hook is invoked each time a new record is written in the - * trace buffer. - */ -#define CH_CFG_TRACE_HOOK(tep) { \ - /* Trace code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/keyboards/infinity_ergodox/config.h b/keyboards/infinity_ergodox/config.h deleted file mode 100644 index d24ee0f05..000000000 --- a/keyboards/infinity_ergodox/config.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2015 Jun Wako - -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 - - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6464 -#define DEVICE_VER 0x0001 -/* in python2: list(u"whatever".encode('utf-16-le')) */ -/* at most 32 characters or the ugly hack in usb_main.c borks */ -#define MANUFACTURER "TMK" -#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00' -#define PRODUCT "Infinity keyboard/TMK" -#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00' - -/* key matrix size */ -#define MATRIX_ROWS 18 -#define MATRIX_COLS 5 -#define LOCAL_MATRIX_ROWS 9 - -/* 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 -#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2) - -/* - * 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 - -#endif diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h deleted file mode 100644 index 2ea73f1fb..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 _GDISP_LLD_BOARD_H -#define _GDISP_LLD_BOARD_H - -static const I2CConfig i2ccfg = { - 400000 // clock speed (Hz); 400kHz max for IS31 -}; - -#define GDISP_SCREEN_WIDTH 7 -#define GDISP_SCREEN_HEIGHT 7 - -static const uint8_t led_mask[] = { - 0xFF, 0x00, /* C1-1 -> C1-16 */ - 0xFF, 0x00, /* C2-1 -> C2-16 */ - 0xFF, 0x00, /* C3-1 -> C3-16 */ - 0xFF, 0x00, /* C4-1 -> C4-16 */ - 0x3F, 0x00, /* C5-1 -> C5-16 */ - 0x00, 0x00, /* C6-1 -> C6-16 */ - 0x00, 0x00, /* C7-1 -> C7-16 */ - 0x00, 0x00, /* C8-1 -> C8-16 */ - 0x00, 0x00, /* C9-1 -> C9-16 */ -}; - -// The address of the LED -#define LA(c, r) (c + r * 16 ) -// Need to be an address that is not mapped, but inside the range of the controller matrix -#define NA LA(8, 8) - -// The numbers in the comments are the led numbers DXX on the PCB -// The mapping is taken from the schematic of left hand side -static const uint8_t led_mapping[GDISP_SCREEN_HEIGHT][GDISP_SCREEN_WIDTH] = { -// 45 44 43 42 41 40 39 - { LA(1, 1), LA(1, 0), LA(0, 4), LA(0, 3), LA(0, 2), LA(0, 1), LA(0, 0)}, -// 52 51 50 49 48 47 46 - { LA(2, 3), LA(2, 2), LA(2, 1), LA(2, 0), LA(1, 4), LA(1, 3), LA(1, 2) }, -// 58 57 56 55 54 53 N/A - { LA(3, 4), LA(3, 3), LA(3, 2), LA(3, 1), LA(3, 0), LA(2, 4), NA }, -// 67 66 65 64 63 62 61 - { LA(5, 3), LA(5, 2), LA(5, 1), LA(5, 0), LA(4, 4), LA(4, 3), LA(4, 2) }, -// 76 75 74 73 72 60 59 - { LA(7, 3), LA(7, 2), LA(7, 1), LA(7, 0), LA(6, 3), LA(4, 1), LA(4, 0) }, -// N/A N/A N/A N/A N/A N/A 68 - { NA, NA, NA, NA, NA, NA, LA(5, 4) }, -// N/A N/A N/A N/A 71 70 69 - { NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0) }, -}; - - -#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND -#define IS31_TIMEOUT 5000 - -static GFXINLINE void init_board(GDisplay *g) { - (void) g; - /* I2C pins */ - palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATIVE_2); // PTB0/I2C0/SCL - palSetPadMode(GPIOB, 1, PAL_MODE_ALTERNATIVE_2); // PTB1/I2C0/SDA - palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL); - palClearPad(GPIOB, 16); - /* start I2C */ - i2cStart(&I2CD1, &i2ccfg); - // try high drive (from kiibohd) - I2CD1.i2c->C2 |= I2Cx_C2_HDRS; - // try glitch fixing (from kiibohd) - I2CD1.i2c->FLT = 4; -} - -static GFXINLINE void post_init_board(GDisplay *g) { - (void) g; -} - -static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) { - (void) g; - return led_mask; -} - -static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y) -{ - (void) g; - return led_mapping[y][x]; -} - -static GFXINLINE void set_hardware_shutdown(GDisplay* g, bool shutdown) { - (void) g; - if(!shutdown) { - palSetPad(GPIOB, 16); - } - else { - palClearPad(GPIOB, 16); - } -} - -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { - (void) g; - i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, data, length, 0, 0, US2ST(IS31_TIMEOUT)); -} - -#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk deleted file mode 100644 index f32d0d868..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/IS31FL3731C -GFXSRC += drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c deleted file mode 100644 index 1d21f0c49..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c +++ /dev/null @@ -1,333 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 . -*/ - -#include "gfx.h" - -#if GFX_USE_GDISP - -#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX -#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" - -#include "board_IS31FL3731C.h" - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -#ifndef GDISP_SCREEN_HEIGHT - #define GDISP_SCREEN_HEIGHT 9 -#endif -#ifndef GDISP_SCREEN_WIDTH - #define GDISP_SCREEN_WIDTH 16 -#endif -#ifndef GDISP_INITIAL_CONTRAST - #define GDISP_INITIAL_CONTRAST 0 -#endif -#ifndef GDISP_INITIAL_BACKLIGHT - #define GDISP_INITIAL_BACKLIGHT 100 -#endif - -#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) - -#define IS31_ADDR_DEFAULT 0x74 - -#define IS31_REG_CONFIG 0x00 -// bits in reg -#define IS31_REG_CONFIG_PICTUREMODE 0x00 -#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08 -#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18 -// D2:D0 bits are starting frame for autoplay mode - -#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode - -#define IS31_REG_AUTOPLAYCTRL1 0x02 -// D6:D4 number of loops (000=infty) -// D2:D0 number of frames to be used - -#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms) - -#define IS31_REG_DISPLAYOPT 0x05 -#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames -#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x8 -// D2:D0 bits blink period time (*0.27s) - -#define IS31_REG_AUDIOSYNC 0x06 -#define IS31_REG_AUDIOSYNC_ENABLE 0x1 - -#define IS31_REG_FRAMESTATE 0x07 - -#define IS31_REG_BREATHCTRL1 0x08 -// D6:D4 fade out time (26ms*2^i) -// D2:D0 fade in time (26ms*2^i) - -#define IS31_REG_BREATHCTRL2 0x09 -#define IS31_REG_BREATHCTRL2_ENABLE 0x10 -// D2:D0 extinguish time (3.5ms*2^i) - -#define IS31_REG_SHUTDOWN 0x0A -#define IS31_REG_SHUTDOWN_OFF 0x0 -#define IS31_REG_SHUTDOWN_ON 0x1 - -#define IS31_REG_AGCCTRL 0x0B -#define IS31_REG_ADCRATE 0x0C - -#define IS31_COMMANDREGISTER 0xFD -#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine' -#define IS31_FUNCTIONREG_SIZE 0xD - -#define IS31_FRAME_SIZE 0xB4 - -#define IS31_PWM_REG 0x24 -#define IS31_PWM_SIZE 0x90 - -#define IS31_LED_MASK_SIZE 0x12 -#define IS31_SCREEN_WIDTH 16 - -#define IS31 - -//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm -const unsigned char cie[256] = { - 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, - 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, - 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, - 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, - 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, - 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, - 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, - 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, - 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, - 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, - 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, - 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, - 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, - 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, - 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, - 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, - 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, - 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, - 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, - 242, 245, 247, 250, 252, 255, -}; - - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -typedef struct{ - uint8_t write_buffer_offset; - uint8_t write_buffer[IS31_FRAME_SIZE]; - uint8_t frame_buffer[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH]; - uint8_t page; -}__attribute__((__packed__)) PrivData; - -// Some common routines and macros -#define PRIV(g) ((PrivData*)g->priv) - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -static GFXINLINE void write_page(GDisplay* g, uint8_t page) { - uint8_t tx[2] __attribute__((aligned(2))); - tx[0] = IS31_COMMANDREGISTER; - tx[1] = page; - write_data(g, tx, 2); -} - -static GFXINLINE void write_register(GDisplay* g, uint8_t page, uint8_t reg, uint8_t data) { - uint8_t tx[2] __attribute__((aligned(2))); - tx[0] = reg; - tx[1] = data; - write_page(g, page); - write_data(g, tx, 2); -} - -static GFXINLINE void write_ram(GDisplay *g, uint8_t page, uint16_t offset, uint16_t length) { - PRIV(g)->write_buffer_offset = offset; - write_page(g, page); - write_data(g, (uint8_t*)PRIV(g), length + 1); -} - -LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { - // The private area is the display surface. - g->priv = gfxAlloc(sizeof(PrivData)); - __builtin_memset(PRIV(g), 0, sizeof(PrivData)); - PRIV(g)->page = 0; - - // Initialise the board interface - init_board(g); - gfxSleepMilliseconds(10); - - // zero function page, all registers (assuming full_page is all zeroes) - write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); - set_hardware_shutdown(g, false); - gfxSleepMilliseconds(10); - // software shutdown - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); - gfxSleepMilliseconds(10); - // zero function page, all registers - write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); - gfxSleepMilliseconds(10); - - - // zero all LED registers on all 8 pages, and enable the mask - __builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE); - for(uint8_t i=0; i<8; i++) { - write_ram(g, i, 0, IS31_FRAME_SIZE); - gfxSleepMilliseconds(1); - } - - // software shutdown disable (i.e. turn stuff on) - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); - gfxSleepMilliseconds(10); - - // Finish Init - post_init_board(g); - - /* Initialise the GDISP structure */ - g->g.Width = GDISP_SCREEN_WIDTH; - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; - g->g.Powermode = powerOn; - g->g.Backlight = GDISP_INITIAL_BACKLIGHT; - g->g.Contrast = GDISP_INITIAL_CONTRAST; - return TRUE; -} - -#if GDISP_HARDWARE_FLUSH - LLDSPEC void gdisp_lld_flush(GDisplay *g) { - // Don't flush if we don't need it. - if (!(g->flags & GDISP_FLG_NEEDFLUSH)) - return; - - PRIV(g)->page++; - PRIV(g)->page %= 2; - // TODO: some smarter algorithm for this - // We should run only one physical page at a time - // This way we don't need to send so much data, and - // we could use slightly less memory - uint8_t* src = PRIV(g)->frame_buffer; - for (int y=0;ywrite_buffer[get_led_address(g, x, y)]=cie[*src]; - ++src; - } - } - write_ram(g, PRIV(g)->page, IS31_PWM_REG, IS31_PWM_SIZE); - gfxSleepMilliseconds(1); - write_register(g, IS31_FUNCTIONREG, IS31_REG_PICTDISP, PRIV(g)->page); - - g->flags &= ~GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_DRAWPIXEL - LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = g->p.y; - break; - } - PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x] = gdispColor2Native(g->p.color); - g->flags |= GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = g->p.y; - break; - } - return gdispNative2Color(PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x]); - } -#endif - -#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL - LLDSPEC void gdisp_lld_control(GDisplay *g) { - switch(g->p.x) { - case GDISP_CONTROL_POWER: - if (g->g.Powermode == (powermode_t)g->p.ptr) - return; - switch((powermode_t)g->p.ptr) { - case powerOff: - case powerSleep: - case powerDeepSleep: - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); - break; - case powerOn: - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); - break; - default: - return; - } - g->g.Powermode = (powermode_t)g->p.ptr; - return; - - case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) - return; - switch((orientation_t)g->p.ptr) { - /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Width = GDISP_SCREEN_WIDTH; - break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - g->g.Height = GDISP_SCREEN_WIDTH; - g->g.Width = GDISP_SCREEN_HEIGHT; - break; - default: - return; - } - g->g.Orientation = (orientation_t)g->p.ptr; - return; - - case GDISP_CONTROL_CONTRAST: - return; - } - } -#endif // GDISP_NEED_CONTROL - -#endif // GFX_USE_GDISP diff --git a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h deleted file mode 100644 index bb28ad775..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 _GDISP_LLD_CONFIG_H -#define _GDISP_LLD_CONFIG_H - -#if GFX_USE_GDISP - -/*===========================================================================*/ -/* Driver hardware support. */ -/*===========================================================================*/ - -#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE - -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_GRAY256 - -#endif /* GFX_USE_GDISP */ - -#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk deleted file mode 100644 index 16c3f80f5..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/emulator_lcd -GFXSRC += drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c deleted file mode 100644 index babfe2b36..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c +++ /dev/null @@ -1,10 +0,0 @@ -#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LCD_ERGODOX -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO -#define GDISP_SCREEN_WIDTH 128 -#define GDISP_SCREEN_HEIGHT 32 -#define ROTATE_180_IS_FLIP - -#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk b/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk deleted file mode 100644 index 255434432..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/emulator_led -GFXSRC += drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c deleted file mode 100644 index b0ebcdc47..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/emulator_led/emulator_led.c +++ /dev/null @@ -1,10 +0,0 @@ -#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LED_ERGODOX -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO -#define GDISP_SCREEN_WIDTH 7 -#define GDISP_SCREEN_HEIGHT 7 -#define ROTATE_180_IS_FLIP - -#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h deleted file mode 100644 index 290571ce5..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _GDISP_LLD_BOARD_H -#define _GDISP_LLD_BOARD_H - -#include "print.h" - -#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 -#define ST7565_ADC ST7565_ADC_NORMAL -#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC -#define ST7565_PAGE_ORDER 0,1,2,3 -/* - * Custom page order for several LCD boards, e.g. HEM12864-99 - * #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3 - */ - -#define ST7565_GPIOPORT GPIOC -#define ST7565_PORT PORTC -#define ST7565_A0_PIN 7 -#define ST7565_RST_PIN 8 -#define ST7565_MOSI_PIN 6 -#define ST7565_SLCK_PIN 5 -#define ST7565_SS_PIN 4 - -#define palSetPadModeRaw(portname, bits) \ - ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits - -#define palSetPadModeNamed(portname, portmode) \ - palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode) - -#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2) -// DSPI Clock and Transfer Attributes -// Frame Size: 8 bits -// MSB First -// CLK Low by default -static const SPIConfig spi1config = { - NULL, - /* HW dependent part.*/ - ST7565_GPIOPORT, - ST7565_SS_PIN, - SPIx_CTARn_FMSZ(7) - | SPIx_CTARn_ASC(7) - | SPIx_CTARn_DT(7) - | SPIx_CTARn_CSSCK(7) - | SPIx_CTARn_PBR(0) - | SPIx_CTARn_BR(7) - //SPI_CR1_BR_0 -}; - -static bool_t st7565_is_data_mode = 1; - -static GFXINLINE void init_board(GDisplay *g) { - (void) g; - palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); - st7565_is_data_mode = 1; - palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); - palSetPadModeRaw(MOSI, ST7565_SPI_MODE); - palSetPadModeRaw(SLCK, ST7565_SPI_MODE); - palSetPadModeRaw(SS, ST7565_SPI_MODE); - - spiInit(); - spiStart(&SPID1, &spi1config); - spiSelect(&SPID1); -} - -static GFXINLINE void post_init_board(GDisplay *g) { - (void) g; -} - -static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { - (void) g; - if (state) { - palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN); - } - else { - palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); - } -} - -static GFXINLINE void acquire_bus(GDisplay *g) { - (void) g; - // Only the LCD is using the SPI bus, so no need to acquire - // spiAcquireBus(&SPID1); -} - -static GFXINLINE void release_bus(GDisplay *g) { - (void) g; - // Only the LCD is using the SPI bus, so no need to release - //spiReleaseBus(&SPID1); -} - -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { - (void) g; - if (st7565_is_data_mode) { - // The sleeps need to be at lest 10 vs 25 ns respectively - // So let's sleep two ticks, one tick might not be enough - // if we are at the end of the tick - chThdSleep(2); - palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); - chThdSleep(2); - st7565_is_data_mode = 0; - } - spiSend(&SPID1, 1, &cmd); -} - -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { - (void) g; - if (!st7565_is_data_mode) { - // The sleeps need to be at lest 10 vs 25 ns respectively - // So let's sleep two ticks, one tick might not be enough - // if we are at the end of the tick - chThdSleep(2); - palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); - chThdSleep(2); - st7565_is_data_mode = 1; - } - spiSend(&SPID1, length, data); -} - -#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk deleted file mode 100644 index 889a1a031..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/st7565ergodox -GFXSRC += drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c deleted file mode 100644 index c33aea81a..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c +++ /dev/null @@ -1,292 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#include "gfx.h" - -#if GFX_USE_GDISP - -#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX -#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" - -#include "board_ST7565.h" - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -#ifndef GDISP_SCREEN_HEIGHT - #define GDISP_SCREEN_HEIGHT 32 -#endif -#ifndef GDISP_SCREEN_WIDTH - #define GDISP_SCREEN_WIDTH 128 -#endif -#ifndef GDISP_INITIAL_CONTRAST - #define GDISP_INITIAL_CONTRAST 0 -#endif -#ifndef GDISP_INITIAL_BACKLIGHT - #define GDISP_INITIAL_BACKLIGHT 100 -#endif - -#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) - -#include "drivers/gdisp/st7565ergodox/st7565.h" - -/*===========================================================================*/ -/* Driver config defaults for backward compatibility. */ -/*===========================================================================*/ -#ifndef ST7565_LCD_BIAS - #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 -#endif -#ifndef ST7565_ADC - #define ST7565_ADC ST7565_ADC_NORMAL -#endif -#ifndef ST7565_COM_SCAN - #define ST7565_COM_SCAN ST7565_COM_SCAN_INC -#endif -#ifndef ST7565_PAGE_ORDER - #define ST7565_PAGE_ORDER 0,1,2,3 -#endif - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -typedef struct{ - bool_t buffer2; - uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; -}PrivData; - -// Some common routines and macros -#define PRIV(g) ((PrivData*)g->priv) -#define RAM(g) (PRIV(g)->ram) -#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } -#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } - -// Some common routines and macros -#define delay(us) gfxSleepMicroseconds(us) -#define delay_ms(ms) gfxSleepMilliseconds(ms) - -#define xyaddr(x, y) ((x) + ((y)>>3)*GDISP_SCREEN_WIDTH) -#define xybit(y) (1<<((y)&7)) - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -/* - * As this controller can't update on a pixel boundary we need to maintain the - * the entire display surface in memory so that we can do the necessary bit - * operations. Fortunately it is a small display in monochrome. - * 64 * 128 / 8 = 1024 bytes. - */ - -LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { - // The private area is the display surface. - g->priv = gfxAlloc(sizeof(PrivData)); - PRIV(g)->buffer2 = false; - - // Initialise the board interface - init_board(g); - - // Hardware reset - setpin_reset(g, TRUE); - gfxSleepMilliseconds(20); - setpin_reset(g, FALSE); - gfxSleepMilliseconds(20); - - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_OFF); - write_cmd(g, ST7565_LCD_BIAS); - write_cmd(g, ST7565_ADC); - write_cmd(g, ST7565_COM_SCAN); - - write_cmd(g, ST7565_START_LINE | 0); - - write_cmd(g, ST7565_RESISTOR_RATIO | 0x6); - - // turn on voltage converter (VC=1, VR=0, VF=0) - write_cmd(g, ST7565_POWER_CONTROL | 0x04); - delay_ms(50); - - // turn on voltage regulator (VC=1, VR=1, VF=0) - write_cmd(g, ST7565_POWER_CONTROL | 0x06); - delay_ms(50); - - // turn on voltage follower (VC=1, VR=1, VF=1) - write_cmd(g, ST7565_POWER_CONTROL | 0x07); - delay_ms(50); - - write_cmd(g, 0xE2); - write_cmd(g, ST7565_COM_SCAN); - write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101); - //write_cmd2(g, ST7565_CONTRAST, 0); - write_cmd(g, ST7565_DISPLAY_ON); - write_cmd(g, ST7565_ALLON_NORMAL); - write_cmd(g, ST7565_INVERT_DISPLAY); - - write_cmd(g, ST7565_RMW); - - // Finish Init - post_init_board(g); - - // Release the bus - release_bus(g); - - /* Initialise the GDISP structure */ - g->g.Width = GDISP_SCREEN_WIDTH; - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; - g->g.Powermode = powerOn; - g->g.Backlight = GDISP_INITIAL_BACKLIGHT; - g->g.Contrast = GDISP_INITIAL_CONTRAST; - return TRUE; -} - -#if GDISP_HARDWARE_FLUSH - LLDSPEC void gdisp_lld_flush(GDisplay *g) { - unsigned p; - - // Don't flush if we don't need it. - if (!(g->flags & GDISP_FLG_NEEDFLUSH)) - return; - - acquire_bus(g); - unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); - for (p = 0; p < 4; p++) { - write_cmd(g, ST7565_PAGE | (p + dstOffset)); - write_cmd(g, ST7565_COLUMN_MSB | 0); - write_cmd(g, ST7565_COLUMN_LSB | 0); - write_cmd(g, ST7565_RMW); - write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); - } - unsigned line = (PRIV(g)->buffer2 ? 32 : 0); - write_cmd(g, ST7565_START_LINE | line); - PRIV(g)->buffer2 = !PRIV(g)->buffer2; - release_bus(g); - - g->flags &= ~GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_DRAWPIXEL - LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_90: - x = g->p.y; - y = GDISP_SCREEN_HEIGHT-1 - g->p.x; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = GDISP_SCREEN_HEIGHT-1 - g->p.y; - break; - case GDISP_ROTATE_270: - x = GDISP_SCREEN_HEIGHT-1 - g->p.y; - y = g->p.x; - break; - } - if (gdispColor2Native(g->p.color) != Black) - RAM(g)[xyaddr(x, y)] |= xybit(y); - else - RAM(g)[xyaddr(x, y)] &= ~xybit(y); - g->flags |= GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_90: - x = g->p.y; - y = GDISP_SCREEN_HEIGHT-1 - g->p.x; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = GDISP_SCREEN_HEIGHT-1 - g->p.y; - break; - case GDISP_ROTATE_270: - x = GDISP_SCREEN_HEIGHT-1 - g->p.y; - y = g->p.x; - break; - } - return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; - } -#endif - -#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL - LLDSPEC void gdisp_lld_control(GDisplay *g) { - switch(g->p.x) { - case GDISP_CONTROL_POWER: - if (g->g.Powermode == (powermode_t)g->p.ptr) - return; - switch((powermode_t)g->p.ptr) { - case powerOff: - case powerSleep: - case powerDeepSleep: - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_OFF); - release_bus(g); - break; - case powerOn: - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_ON); - release_bus(g); - break; - default: - return; - } - g->g.Powermode = (powermode_t)g->p.ptr; - return; - - case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) - return; - switch((orientation_t)g->p.ptr) { - /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Width = GDISP_SCREEN_WIDTH; - break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - g->g.Height = GDISP_SCREEN_WIDTH; - g->g.Width = GDISP_SCREEN_HEIGHT; - break; - default: - return; - } - g->g.Orientation = (orientation_t)g->p.ptr; - return; - - case GDISP_CONTROL_CONTRAST: - if ((unsigned)g->p.ptr > 100) - g->p.ptr = (void *)100; - acquire_bus(g); - write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); - release_bus(g); - g->g.Contrast = (unsigned)g->p.ptr; - return; - } - } -#endif // GDISP_NEED_CONTROL - -#endif // GFX_USE_GDISP diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h deleted file mode 100644 index 48587b9e1..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _GDISP_LLD_CONFIG_H -#define _GDISP_LLD_CONFIG_H - -#if GFX_USE_GDISP - -/*===========================================================================*/ -/* Driver hardware support. */ -/*===========================================================================*/ - -#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE - -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO - -#endif /* GFX_USE_GDISP */ - -#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h deleted file mode 100644 index 48636b33d..000000000 --- a/keyboards/infinity_ergodox/drivers/gdisp/st7565ergodox/st7565.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _ST7565_H -#define _ST7565_H - -#define ST7565_CONTRAST 0x81 -#define ST7565_ALLON_NORMAL 0xA4 -#define ST7565_ALLON 0xA5 -#define ST7565_POSITIVE_DISPLAY 0xA6 -#define ST7565_INVERT_DISPLAY 0xA7 -#define ST7565_DISPLAY_OFF 0xAE -#define ST7565_DISPLAY_ON 0xAF - -#define ST7565_LCD_BIAS_7 0xA3 -#define ST7565_LCD_BIAS_9 0xA2 - -#define ST7565_ADC_NORMAL 0xA0 -#define ST7565_ADC_REVERSE 0xA1 - -#define ST7565_COM_SCAN_INC 0xC0 -#define ST7565_COM_SCAN_DEC 0xC8 - -#define ST7565_START_LINE 0x40 -#define ST7565_PAGE 0xB0 -#define ST7565_COLUMN_MSB 0x10 -#define ST7565_COLUMN_LSB 0x00 -#define ST7565_RMW 0xE0 - -#define ST7565_RESISTOR_RATIO 0x20 -#define ST7565_POWER_CONTROL 0x28 - -#endif /* _ST7565_H */ diff --git a/keyboards/infinity_ergodox/gfxconf.h b/keyboards/infinity_ergodox/gfxconf.h deleted file mode 100644 index 8caa577b7..000000000 --- a/keyboards/infinity_ergodox/gfxconf.h +++ /dev/null @@ -1,331 +0,0 @@ -/** - * This file has a different license to the rest of the uGFX system. - * You can copy, modify and distribute this file as you see fit. - * You do not need to publish your source modifications to this file. - * The only thing you are not permitted to do is to relicense it - * under a different license. - */ - -/** - * Copy this file into your project directory and rename it as gfxconf.h - * Edit your copy to turn on the uGFX features you want to use. - * The values below are the defaults. - * - * Only remove the comments from lines where you want to change the - * default value. This allows definitions to be included from - * driver makefiles when required and provides the best future - * compatibility for your project. - * - * Please use spaces instead of tabs in this file. - */ - -#ifndef _GFXCONF_H -#define _GFXCONF_H - - -/////////////////////////////////////////////////////////////////////////// -// GOS - One of these must be defined, preferably in your Makefile // -/////////////////////////////////////////////////////////////////////////// -//#define GFX_USE_OS_CHIBIOS TRUE -//#define GFX_USE_OS_FREERTOS FALSE -// #define GFX_FREERTOS_USE_TRACE FALSE -//#define GFX_USE_OS_WIN32 FALSE -//#define GFX_USE_OS_LINUX FALSE -//#define GFX_USE_OS_OSX FALSE -//#define GFX_USE_OS_ECOS FALSE -//#define GFX_USE_OS_RAWRTOS FALSE -//#define GFX_USE_OS_ARDUINO FALSE -//#define GFX_USE_OS_KEIL FALSE -//#define GFX_USE_OS_CMSIS FALSE -//#define GFX_USE_OS_RAW32 FALSE -// #define INTERRUPTS_OFF() optional_code -// #define INTERRUPTS_ON() optional_code -// These are not defined by default for some reason -#define GOS_NEED_X_THREADS FALSE -#define GOS_NEED_X_HEAP FALSE - -// Options that (should where relevant) apply to all operating systems - #define GFX_NO_INLINE FALSE -// #define GFX_COMPILER GFX_COMPILER_UNKNOWN -// #define GFX_CPU GFX_CPU_UNKNOWN -// #define GFX_OS_HEAP_SIZE 0 -// #define GFX_OS_NO_INIT FALSE -// #define GFX_OS_INIT_NO_WARNING FALSE -// #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine -// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine -// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine - - -/////////////////////////////////////////////////////////////////////////// -// GDISP // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GDISP TRUE - -//#define GDISP_NEED_AUTOFLUSH FALSE -//#define GDISP_NEED_TIMERFLUSH FALSE -//#define GDISP_NEED_VALIDATION TRUE -//#define GDISP_NEED_CLIP TRUE -#define GDISP_NEED_CIRCLE TRUE -#define GDISP_NEED_ELLIPSE TRUE -#define GDISP_NEED_ARC TRUE -#define GDISP_NEED_ARCSECTORS TRUE -#define GDISP_NEED_CONVEX_POLYGON TRUE -//#define GDISP_NEED_SCROLL FALSE -#define GDISP_NEED_PIXELREAD TRUE -#define GDISP_NEED_CONTROL TRUE -//#define GDISP_NEED_QUERY FALSE -//#define GDISP_NEED_MULTITHREAD FALSE -//#define GDISP_NEED_STREAMING FALSE -#define GDISP_NEED_TEXT TRUE -// #define GDISP_NEED_TEXT_WORDWRAP FALSE -// #define GDISP_NEED_ANTIALIAS FALSE -// #define GDISP_NEED_UTF8 FALSE - #define GDISP_NEED_TEXT_KERNING TRUE -// #define GDISP_INCLUDE_FONT_UI1 FALSE -// #define GDISP_INCLUDE_FONT_UI2 FALSE // The smallest preferred font. -// #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS20 FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE - #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 TRUE -// #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE -// #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE - #define GDISP_INCLUDE_FONT_FIXED_5X8 TRUE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS20_AA FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE -// #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE -// #define GDISP_INCLUDE_USER_FONTS FALSE - -//#define GDISP_NEED_IMAGE FALSE -// #define GDISP_NEED_IMAGE_NATIVE FALSE -// #define GDISP_NEED_IMAGE_GIF FALSE -// #define GDISP_NEED_IMAGE_BMP FALSE -// #define GDISP_NEED_IMAGE_BMP_1 FALSE -// #define GDISP_NEED_IMAGE_BMP_4 FALSE -// #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE -// #define GDISP_NEED_IMAGE_BMP_8 FALSE -// #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE -// #define GDISP_NEED_IMAGE_BMP_16 FALSE -// #define GDISP_NEED_IMAGE_BMP_24 FALSE -// #define GDISP_NEED_IMAGE_BMP_32 FALSE -// #define GDISP_NEED_IMAGE_JPG FALSE -// #define GDISP_NEED_IMAGE_PNG FALSE -// #define GDISP_NEED_IMAGE_ACCOUNTING FALSE -#ifdef EMULATOR -#define GDISP_NEED_PIXMAP TRUE -#endif -// #define GDISP_NEED_PIXMAP_IMAGE FALSE - -//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used. -//#define GDISP_LINEBUF_SIZE 128 -//#define GDISP_STARTUP_COLOR Black -#define GDISP_NEED_STARTUP_LOGO FALSE - -//#define GDISP_TOTAL_DISPLAYS 2 - -#ifndef EMULATOR -#define GDISP_DRIVER_LIST GDISPVMT_ST7565_ERGODOX, GDISPVMT_IS31FL3731C_ERGODOX -#else -#define GDISP_DRIVER_LIST GDISPVMT_EMULATOR_LCD_ERGODOX, GDISPVMT_EMULATOR_LED_ERGODOX -#endif - - #ifdef GDISP_DRIVER_LIST - // For code and speed optimization define as TRUE or FALSE if all controllers have the same capability - #define GDISP_HARDWARE_STREAM_WRITE FALSE - #define GDISP_HARDWARE_STREAM_READ FALSE - #define GDISP_HARDWARE_STREAM_POS FALSE - #define GDISP_HARDWARE_DRAWPIXEL TRUE - #define GDISP_HARDWARE_CLEARS FALSE - #define GDISP_HARDWARE_FILLS FALSE - #define GDISP_HARDWARE_BITFILLS FALSE - #define GDISP_HARDWARE_SCROLL FALSE - #define GDISP_HARDWARE_PIXELREAD TRUE - #define GDISP_HARDWARE_CONTROL TRUE - #define GDISP_HARDWARE_QUERY FALSE - #define GDISP_HARDWARE_CLIP FALSE - - #define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888 - #endif - -// The custom format is not defined for some reason, so define it as error -// so we don't get compiler warnings -#define GDISP_PIXELFORMAT_CUSTOM GDISP_PIXELFORMAT_ERROR - -#define GDISP_USE_GFXNET FALSE -// #define GDISP_GFXNET_PORT 13001 -// #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE -// #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE -// #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE - - -/////////////////////////////////////////////////////////////////////////// -// GWIN // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GWIN FALSE - -//#define GWIN_NEED_WINDOWMANAGER FALSE -// #define GWIN_REDRAW_IMMEDIATE FALSE -// #define GWIN_REDRAW_SINGLEOP FALSE -// #define GWIN_NEED_FLASHING FALSE -// #define GWIN_FLASHING_PERIOD 250 - -//#define GWIN_NEED_CONSOLE FALSE -// #define GWIN_CONSOLE_USE_HISTORY FALSE -// #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE -// #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE -// #define GWIN_CONSOLE_ESCSEQ FALSE -// #define GWIN_CONSOLE_USE_BASESTREAM FALSE -// #define GWIN_CONSOLE_USE_FLOAT FALSE -//#define GWIN_NEED_GRAPH FALSE -//#define GWIN_NEED_GL3D FALSE - -//#define GWIN_NEED_WIDGET FALSE -//#define GWIN_FOCUS_HIGHLIGHT_WIDTH 1 -// #define GWIN_NEED_LABEL FALSE -// #define GWIN_LABEL_ATTRIBUTE FALSE -// #define GWIN_NEED_BUTTON FALSE -// #define GWIN_BUTTON_LAZY_RELEASE FALSE -// #define GWIN_NEED_SLIDER FALSE -// #define GWIN_SLIDER_NOSNAP FALSE -// #define GWIN_SLIDER_DEAD_BAND 5 -// #define GWIN_SLIDER_TOGGLE_INC 20 -// #define GWIN_NEED_CHECKBOX FALSE -// #define GWIN_NEED_IMAGE FALSE -// #define GWIN_NEED_IMAGE_ANIMATION FALSE -// #define GWIN_NEED_RADIO FALSE -// #define GWIN_NEED_LIST FALSE -// #define GWIN_NEED_LIST_IMAGES FALSE -// #define GWIN_NEED_PROGRESSBAR FALSE -// #define GWIN_PROGRESSBAR_AUTO FALSE -// #define GWIN_NEED_KEYBOARD FALSE -// #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_English1 -// #define GWIN_NEED_KEYBOARD_ENGLISH1 TRUE -// #define GWIN_NEED_TEXTEDIT FALSE -// #define GWIN_FLAT_STYLING FALSE -// #define GWIN_WIDGET_TAGS FALSE - -//#define GWIN_NEED_CONTAINERS FALSE -// #define GWIN_NEED_CONTAINER FALSE -// #define GWIN_NEED_FRAME FALSE -// #define GWIN_NEED_TABSET FALSE -// #define GWIN_TABSET_TABHEIGHT 18 - - -/////////////////////////////////////////////////////////////////////////// -// GEVENT // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GEVENT TRUE - -//#define GEVENT_ASSERT_NO_RESOURCE FALSE -//#define GEVENT_MAXIMUM_SIZE 32 -//#define GEVENT_MAX_SOURCE_LISTENERS 32 - - -/////////////////////////////////////////////////////////////////////////// -// GTIMER // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GTIMER FALSE - -//#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY -//#define GTIMER_THREAD_WORKAREA_SIZE 2048 - - -/////////////////////////////////////////////////////////////////////////// -// GQUEUE // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GQUEUE FALSE - -//#define GQUEUE_NEED_ASYNC FALSE -//#define GQUEUE_NEED_GSYNC FALSE -//#define GQUEUE_NEED_FSYNC FALSE -//#define GQUEUE_NEED_BUFFERS FALSE - -/////////////////////////////////////////////////////////////////////////// -// GINPUT // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GINPUT FALSE - -//#define GINPUT_NEED_MOUSE FALSE -// #define GINPUT_TOUCH_STARTRAW FALSE -// #define GINPUT_TOUCH_NOTOUCH FALSE -// #define GINPUT_TOUCH_NOCALIBRATE FALSE -// #define GINPUT_TOUCH_NOCALIBRATE_GUI FALSE -// #define GINPUT_MOUSE_POLL_PERIOD 25 -// #define GINPUT_MOUSE_CLICK_TIME 300 -// #define GINPUT_TOUCH_CXTCLICK_TIME 700 -// #define GINPUT_TOUCH_USER_CALIBRATION_LOAD FALSE -// #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE -// #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32 -//#define GINPUT_NEED_KEYBOARD FALSE -// #define GINPUT_KEYBOARD_POLL_PERIOD 200 -// #define GKEYBOARD_DRIVER_LIST GKEYBOARDVMT_Win32, GKEYBOARDVMT_Win32 -// #define GKEYBOARD_LAYOUT_OFF FALSE -// #define GKEYBOARD_LAYOUT_SCANCODE2_US FALSE -//#define GINPUT_NEED_TOGGLE FALSE -//#define GINPUT_NEED_DIAL FALSE - - -/////////////////////////////////////////////////////////////////////////// -// GFILE // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GFILE FALSE - -//#define GFILE_NEED_PRINTG FALSE -//#define GFILE_NEED_SCANG FALSE -//#define GFILE_NEED_STRINGS FALSE -//#define GFILE_NEED_FILELISTS FALSE -//#define GFILE_NEED_STDIO FALSE -//#define GFILE_NEED_NOAUTOMOUNT FALSE -//#define GFILE_NEED_NOAUTOSYNC FALSE - -//#define GFILE_NEED_MEMFS FALSE -//#define GFILE_NEED_ROMFS FALSE -//#define GFILE_NEED_RAMFS FALSE -//#define GFILE_NEED_FATFS FALSE -//#define GFILE_NEED_NATIVEFS FALSE -//#define GFILE_NEED_CHBIOSFS FALSE - -//#define GFILE_ALLOW_FLOATS FALSE -//#define GFILE_ALLOW_DEVICESPECIFIC FALSE -//#define GFILE_MAX_GFILES 3 - -/////////////////////////////////////////////////////////////////////////// -// GADC // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GADC FALSE - -//#define GADC_MAX_LOWSPEED_DEVICES 4 - - -/////////////////////////////////////////////////////////////////////////// -// GAUDIO // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GAUDIO FALSE -// There seems to be a bug in the ugfx code, the wrong define is used -// So define it in order to avoid warnings -#define GFX_USE_GAUDIN GFX_USE_GAUDIO -// #define GAUDIO_NEED_PLAY FALSE -// #define GAUDIO_NEED_RECORD FALSE - - -/////////////////////////////////////////////////////////////////////////// -// GMISC // -/////////////////////////////////////////////////////////////////////////// -#define GFX_USE_GMISC TRUE - -//#define GMISC_NEED_ARRAYOPS FALSE -//#define GMISC_NEED_FASTTRIG FALSE -//#define GMISC_NEED_FIXEDTRIG FALSE -//#define GMISC_NEED_INVSQRT FALSE -// #define GMISC_INVSQRT_MIXED_ENDIAN FALSE -// #define GMISC_INVSQRT_REAL_SLOW FALSE -#define GMISC_NEED_MATRIXFLOAT2D TRUE -#define GMISC_NEED_MATRIXFIXED2D FALSE - -#endif /* _GFXCONF_H */ diff --git a/keyboards/infinity_ergodox/halconf.h b/keyboards/infinity_ergodox/halconf.h deleted file mode 100644 index 55dd5e88d..000000000 --- a/keyboards/infinity_ergodox/halconf.h +++ /dev/null @@ -1,353 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/halconf.h - * @brief HAL configuration header. - * @details HAL configuration file, this file allows to enable or disable the - * various device drivers from your application. You may also use - * this file in order to override the device drivers default settings. - * - * @addtogroup HAL_CONF - * @{ - */ - -#ifndef _HALCONF_H_ -#define _HALCONF_H_ - -#include "mcuconf.h" - -/** - * @brief Enables the PAL subsystem. - */ -#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) -#define HAL_USE_PAL TRUE -#endif - -/** - * @brief Enables the ADC subsystem. - */ -#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC FALSE -#endif - -/** - * @brief Enables the CAN subsystem. - */ -#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) -#define HAL_USE_CAN FALSE -#endif - -/** - * @brief Enables the DAC subsystem. - */ -#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) -#define HAL_USE_DAC FALSE -#endif - -/** - * @brief Enables the EXT subsystem. - */ -#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) -#define HAL_USE_EXT FALSE -#endif - -/** - * @brief Enables the GPT subsystem. - */ -#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) -#define HAL_USE_GPT FALSE -#endif - -/** - * @brief Enables the I2C subsystem. - */ -#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C TRUE -#endif - -/** - * @brief Enables the I2S subsystem. - */ -#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) -#define HAL_USE_I2S FALSE -#endif - -/** - * @brief Enables the ICU subsystem. - */ -#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) -#define HAL_USE_ICU FALSE -#endif - -/** - * @brief Enables the MAC subsystem. - */ -#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) -#define HAL_USE_MAC FALSE -#endif - -/** - * @brief Enables the MMC_SPI subsystem. - */ -#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) -#define HAL_USE_MMC_SPI FALSE -#endif - -/** - * @brief Enables the PWM subsystem. - */ -#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM FALSE -#endif - -/** - * @brief Enables the RTC subsystem. - */ -#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) -#define HAL_USE_RTC FALSE -#endif - -/** - * @brief Enables the SDC subsystem. - */ -#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC FALSE -#endif - -/** - * @brief Enables the SERIAL subsystem. - */ -#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL TRUE -#endif - -/** - * @brief Enables the SERIAL over USB subsystem. - */ -#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) -#define HAL_USE_SERIAL_USB TRUE -#endif - -/** - * @brief Enables the SPI subsystem. - */ -#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI TRUE -#endif - -/** - * @brief Enables the UART subsystem. - */ -#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) -#define HAL_USE_UART FALSE -#endif - -/** - * @brief Enables the USB subsystem. - */ -#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) -#define HAL_USE_USB TRUE -#endif - -/** - * @brief Enables the WDG subsystem. - */ -#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) -#define HAL_USE_WDG FALSE -#endif - -/*===========================================================================*/ -/* ADC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) -#define ADC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define ADC_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* CAN driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Sleep mode related APIs inclusion switch. - */ -#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) -#define CAN_USE_SLEEP_MODE TRUE -#endif - -/*===========================================================================*/ -/* I2C driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables the mutual exclusion APIs on the I2C bus. - */ -#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define I2C_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* MAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) -#define MAC_USE_ZERO_COPY FALSE -#endif - -/** - * @brief Enables an event sources for incoming packets. - */ -#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) -#define MAC_USE_EVENTS TRUE -#endif - -/*===========================================================================*/ -/* MMC_SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. - */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SDC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Number of initialization attempts before rejecting the card. - * @note Attempts are performed at 10mS intervals. - */ -#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) -#define SDC_INIT_RETRY 100 -#endif - -/** - * @brief Include support for MMC cards. - * @note MMC support is not yet implemented so this option must be kept - * at @p FALSE. - */ -#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) -#define SDC_MMC_SUPPORT FALSE -#endif - -/** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - */ -#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) -#define SDC_NICE_WAITING TRUE -#endif - -/*===========================================================================*/ -/* SERIAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Default bit rate. - * @details Configuration parameter, this is the baud rate selected for the - * default configuration. - */ -#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 -#endif - -/** - * @brief Serial buffers size. - * @details Configuration parameter, you can change the depth of the queue - * buffers depending on the requirements of your application. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 128 -#endif - -/*===========================================================================*/ -/* SERIAL_USB driver related setting. */ -/*===========================================================================*/ - -/** - * @brief Serial over USB buffers size. - * @details Configuration parameter, the buffer size must be a multiple of - * the USB data endpoint maximum packet size. - * @note The default is 64 bytes for both the transmission and receive - * buffers. - */ -#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_USB_BUFFERS_SIZE 256 -#endif - -/*===========================================================================*/ -/* SPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) -#define SPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define SPI_USE_MUTUAL_EXCLUSION TRUE -#endif - -/*===========================================================================*/ -/* USB driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) -#define USB_USE_WAIT TRUE -#endif - -#endif /* _HALCONF_H_ */ - -/** @} */ diff --git a/keyboards/infinity_ergodox/infinity_ergodox.c b/keyboards/infinity_ergodox/infinity_ergodox.c deleted file mode 100644 index 87ed40fab..000000000 --- a/keyboards/infinity_ergodox/infinity_ergodox.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "infinity_ergodox.h" -#include "ch.h" -#include "hal.h" -#include "serial_link/system/serial_link.h" -#include "lcd_backlight.h" - -void init_serial_link_hal(void) { - PORTA->PCR[1] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(2); - PORTA->PCR[2] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(2); - PORTE->PCR[0] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(3); - PORTE->PCR[1] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(3); -} - -#define RED_PIN 1 -#define GREEN_PIN 2 -#define BLUE_PIN 3 -#define CHANNEL_RED FTM0->CHANNEL[0] -#define CHANNEL_GREEN FTM0->CHANNEL[1] -#define CHANNEL_BLUE FTM0->CHANNEL[2] - -#define RGB_PORT PORTC -#define RGB_PORT_GPIO GPIOC - -// Base FTM clock selection (72 MHz system clock) -// @ 0xFFFF period, 72 MHz / (0xFFFF * 2) = Actual period -// Higher pre-scalar will use the most power (also look the best) -// Pre-scalar calculations -// 0 - 72 MHz -> 549 Hz -// 1 - 36 MHz -> 275 Hz -// 2 - 18 MHz -> 137 Hz -// 3 - 9 MHz -> 69 Hz (Slightly visible flicker) -// 4 - 4 500 kHz -> 34 Hz (Visible flickering) -// 5 - 2 250 kHz -> 17 Hz -// 6 - 1 125 kHz -> 9 Hz -// 7 - 562 500 Hz -> 4 Hz -// 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 - -void lcd_backlight_hal_init(void) { - // Setup Backlight - SIM->SCGC6 |= SIM_SCGC6_FTM0; - FTM0->CNT = 0; // Reset counter - - // PWM Period - // 16-bit maximum - FTM0->MOD = 0xFFFF; - - // Set FTM to PWM output - Edge Aligned, Low-true pulses -#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0) - CHANNEL_RED.CnSC = CNSC_MODE; - CHANNEL_GREEN.CnSC = CNSC_MODE; - CHANNEL_BLUE.CnSC = CNSC_MODE; - - // System clock, /w prescalar setting - FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE); - - CHANNEL_RED.CnV = 0; - CHANNEL_GREEN.CnV = 0; - CHANNEL_BLUE.CnV = 0; - - RGB_PORT_GPIO->PDDR |= (1 << RED_PIN); - RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN); - RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN); - -#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4) - RGB_PORT->PCR[RED_PIN] = RGB_MODE; - RGB_PORT->PCR[GREEN_PIN] = RGB_MODE; - RGB_PORT->PCR[BLUE_PIN] = RGB_MODE; -} - -void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) { - CHANNEL_RED.CnV = r; - CHANNEL_GREEN.CnV = g; - CHANNEL_BLUE.CnV = b; -} diff --git a/keyboards/infinity_ergodox/infinity_ergodox.h b/keyboards/infinity_ergodox/infinity_ergodox.h deleted file mode 100644 index de7267594..000000000 --- a/keyboards/infinity_ergodox/infinity_ergodox.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ -#define KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ - -#include "quantum.h" - -#define KEYMAP( \ - A80, A70, A60, A50, A40, A30, A20, \ - A81, A71, A61, A51, A41, A31, A21, \ - A82, A72, A62, A52, A42, A32, \ - A83, A73, A63, A53, A43, A33, A23, \ - A84, A74, A64, A54, A44, \ - A13, A03, \ - A04, \ - A34, A24, A14, \ - B20, B30, B40, B50, B60, B70, B80, \ - B21, B31, B41, B51, B61, B71, B81, \ - B32, B42, B52, B62, B72, B82, \ - B23, B33, B43, B53, B63, B73, B83, \ - B44, B54, B64, B74, B84, \ - B03, B13, \ - 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 } \ -} - -#endif /* KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ */ diff --git a/keyboards/infinity_ergodox/keymaps/default/keymap.c b/keyboards/infinity_ergodox/keymaps/default/keymap.c deleted file mode 100644 index f1e6b1c8a..000000000 --- a/keyboards/infinity_ergodox/keymaps/default/keymap.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2016 Fred Sundvik -Jun Wako - -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 . -*/ - -#include "infinity_ergodox.h" - -// Workaround for old keymap format -#define KC_RESET RESET - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP( // layer 0 : default - // left hand - EQL, 1, 2, 3, 4, 5, ESC, - BSLS,Q, W, E, R, T, FN1, - TAB, A, S, D, F, G, - LSFT,Z, X, C, V, B, FN0, - LGUI,GRV, BSLS,LEFT,RGHT, - LCTL,LALT, - HOME, - BSPC,DEL, END, - // right hand - FN2, 6, 7, 8, 9, 0, MINS, - LBRC,Y, U, I, O, P, RBRC, - H, J, K, L, SCLN,QUOT, - FN0, N, M, COMM,DOT, SLSH,RSFT, - LEFT,DOWN,UP, RGHT,RGUI, - RALT,RCTL, - PGUP, - PGDN,ENT, SPC - ), - - KEYMAP( // layer 1 : function and symbol keys - // left hand - TRNS,F1, F2, F3, F4, F5, F11, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - F12, F6, F7, F8, F9, F10, TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), - - KEYMAP( // layer 2 : keyboard functions - // left hand - RESET,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), - - KEYMAP( // layer 3: numpad - // left hand - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC, - TRNS,NO, P7, P8, P9, PMNS,BSPC, - NO, P4, P5, P6, PPLS,PENT, - TRNS,NO, P1, P2, P3, PPLS,PENT, - P0, PDOT,SLSH,PENT,PENT, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), -}; -const uint16_t fn_actions[] = { - ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1 - ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2 - ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer - ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0 -}; diff --git a/keyboards/infinity_ergodox/keymaps/default/visualizer.c b/keyboards/infinity_ergodox/keymaps/default/visualizer.c deleted file mode 100644 index c0d335ce6..000000000 --- a/keyboards/infinity_ergodox/keymaps/default/visualizer.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 . -*/ - -// Currently we are assuming that both the backlight and LCD are enabled -// But it's entirely possible to write a custom visualizer that use only -// one of them -#ifndef LCD_BACKLIGHT_ENABLE -#error This visualizer needs that LCD backlight is enabled -#endif - -#ifndef LCD_ENABLE -#error This visualizer needs that LCD is enabled -#endif - -#include "visualizer.h" -#include "led_test.h" - -static const char* welcome_text[] = {"TMK", "Infinity Ergodox"}; - -// Just an example how to write custom keyframe functions, we could have moved -// all this into the init function -bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) { - (void)animation; - // Read the uGFX documentation for information how to use the displays - // http://wiki.ugfx.org/index.php/Main_Page - gdispClear(White); - // You can use static variables for things that can't be found in the animation - // or state structs - gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black); - gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black); - // Always remember to flush the display - gdispFlush(); - // you could set the backlight color as well, but we won't do it here, since - // it's part of the following animation - // lcd_backlight_color(hue, saturation, intensity); - // We don't need constant updates, just drawing the screen once is enough - return false; -} - -// Feel free to modify the animations below, or even add new ones if needed - -// Don't worry, if the startup animation is long, you can use the keyboard like normal -// during that time -static keyframe_animation_t startup_animation = { - .num_frames = 4, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, - .frame_functions = { - display_welcome, - keyframe_animate_backlight_color, - keyframe_no_operation, - enable_visualization - }, -}; - -// The color animation animates the LCD color when you change layers -static keyframe_animation_t color_animation = { - .num_frames = 2, - .loop = false, - // Note that there's a 200 ms no-operation frame, - // this prevents the color from changing when activating the layer - // momentarily - .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)}, - .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color}, -}; - -// The LCD animation alternates between the layer name display and a -// bitmap that displays all active layers -static keyframe_animation_t lcd_animation = { - .num_frames = 2, - .loop = true, - .frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)}, - .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap}, -}; - -static keyframe_animation_t suspend_animation = { - .num_frames = 3, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0}, - .frame_functions = { - keyframe_display_layer_text, - keyframe_animate_backlight_color, - keyframe_disable_lcd_and_backlight, - }, -}; - -static keyframe_animation_t resume_animation = { - .num_frames = 5, - .loop = false, - .frame_lengths = {0, 0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, - .frame_functions = { - keyframe_enable_lcd_and_backlight, - display_welcome, - keyframe_animate_backlight_color, - keyframe_no_operation, - enable_visualization, - }, -}; - -void initialize_user_visualizer(visualizer_state_t* state) { - // The brightness will be dynamically adjustable in the future - // But for now, change it here. - lcd_backlight_brightness(0x50); - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&startup_animation); - start_keyframe_animation(&led_test_animation); -} - -void update_user_visualizer_state(visualizer_state_t* state) { - // Add more tests, change the colors and layer texts here - // Usually you want to check the high bits (higher layers first) - // because that's the order layers are processed for keypresses - // You can for check for example: - // state->status.layer - // state->status.default_layer - // state->status.leds (see led.h for available statuses) - if (state->status.layer & 0x8) { - state->target_lcd_color = LCD_COLOR(0xC0, 0xB0, 0xFF); - state->layer_text = "Numpad"; - } - else if (state->status.layer & 0x4) { - state->target_lcd_color = LCD_COLOR(0, 0xB0, 0xFF); - state->layer_text = "KBD functions"; - } - else if (state->status.layer & 0x2) { - state->target_lcd_color = LCD_COLOR(0x80, 0xB0, 0xFF); - state->layer_text = "Function keys"; - } - else { - state->target_lcd_color = LCD_COLOR(0x40, 0xB0, 0xFF); - state->layer_text = "Default"; - } - // You can also stop existing animations, and start your custom ones here - // remember that you should normally have only one animation for the LCD - // and one for the background. But you can also combine them if you want. - start_keyframe_animation(&lcd_animation); - start_keyframe_animation(&color_animation); -} - -void user_visualizer_suspend(visualizer_state_t* state) { - state->layer_text = "Suspending..."; - uint8_t hue = LCD_HUE(state->current_lcd_color); - uint8_t sat = LCD_SAT(state->current_lcd_color); - state->target_lcd_color = LCD_COLOR(hue, sat, 0); - start_keyframe_animation(&suspend_animation); -} - -void user_visualizer_resume(visualizer_state_t* state) { - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0x00); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&resume_animation); - start_keyframe_animation(&led_test_animation); -} diff --git a/keyboards/infinity_ergodox/led.c b/keyboards/infinity_ergodox/led.c deleted file mode 100644 index 77195bb35..000000000 --- a/keyboards/infinity_ergodox/led.c +++ /dev/null @@ -1,49 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#include "hal.h" - -#include "led.h" - - -void led_set(uint8_t usb_led) { -// The LCD backlight functionality conflicts with this simple -// red backlight -#if !defined(LCD_BACKLIGHT_ENABLE) && defined(STATUS_LED_ENABLE) - // PTC1: LCD Backlight Red(0:on/1:off) - GPIOC->PDDR |= (1<<1); - PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); - if (usb_led & (1<PCOR |= (1<<1); - } else { - GPIOC->PSOR |= (1<<1); - } -#elif !defined(LCD_BACKLIGHT_ENABLE) - (void)usb_led; - GPIOC->PDDR |= (1<<1); - PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); - GPIOC->PSOR |= (1<<1); - GPIOC->PDDR |= (1<<2); - PORTC->PCR[2] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); - GPIOC->PSOR |= (1<<2); - GPIOC->PDDR |= (1<<3); - PORTC->PCR[3] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1); - GPIOC->PSOR |= (1<<3); -#else - (void)usb_led; -#endif -} diff --git a/keyboards/infinity_ergodox/matrix.c b/keyboards/infinity_ergodox/matrix.c deleted file mode 100644 index 2b806cd64..000000000 --- a/keyboards/infinity_ergodox/matrix.c +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright 2016 Fred Sundvik -Jun Wako - -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 . -*/ -#include -#include -#include -#include "hal.h" -#include "timer.h" -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "matrix.h" - - -/* - * Infinity ErgoDox Pinusage: - * Column pins are input with internal pull-down. Row pins are output and strobe with high. - * Key is high or 1 when it turns on. - * - * col: { PTD1, PTD4, PTD5, PTD6, PTD7 } - * row: { PTB2, PTB3, PTB18, PTB19, PTC0, PTC9, PTC10, PTC11, PTD0 } - */ -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[LOCAL_MATRIX_ROWS]; -static bool debouncing = false; -static uint16_t debouncing_time = 0; - - -void matrix_init(void) -{ - /* Column(sense) */ - palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN); - - /* Row(strobe) */ - palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOB, 19, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOC, 9, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); - - memset(matrix, 0, MATRIX_ROWS); - memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS); -} - -uint8_t matrix_scan(void) -{ - for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { - matrix_row_t data = 0; - - // strobe row - switch (row) { - case 0: palSetPad(GPIOB, 2); break; - case 1: palSetPad(GPIOB, 3); break; - case 2: palSetPad(GPIOB, 18); break; - case 3: palSetPad(GPIOB, 19); break; - case 4: palSetPad(GPIOC, 0); break; - case 5: palSetPad(GPIOC, 9); break; - case 6: palSetPad(GPIOC, 10); break; - case 7: palSetPad(GPIOC, 11); break; - case 8: palSetPad(GPIOD, 0); break; - } - - // need wait to settle pin state - // if you wait too short, or have a too high update rate - // the keyboard might freeze, or there might not be enough - // processing power to update the LCD screen properly. - // 20us, or two ticks at 100000Hz seems to be OK - wait_us(20); - - // read col data: { PTD1, PTD4, PTD5, PTD6, PTD7 } - data = ((palReadPort(GPIOD) & 0xF0) >> 3) | - ((palReadPort(GPIOD) & 0x02) >> 1); - - // un-strobe row - switch (row) { - case 0: palClearPad(GPIOB, 2); break; - case 1: palClearPad(GPIOB, 3); break; - case 2: palClearPad(GPIOB, 18); break; - case 3: palClearPad(GPIOB, 19); break; - case 4: palClearPad(GPIOC, 0); break; - case 5: palClearPad(GPIOC, 9); break; - case 6: palClearPad(GPIOC, 10); break; - case 7: palClearPad(GPIOC, 11); break; - case 8: palClearPad(GPIOD, 0); break; - } - - if (matrix_debouncing[row] != data) { - matrix_debouncing[row] = data; - debouncing = true; - debouncing_time = timer_read(); - } - } - - uint8_t offset = 0; -#ifdef MASTER_IS_ON_RIGHT - if (is_serial_link_master()) { - offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS; - } -#endif - - if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { - for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) { - matrix[offset + row] = matrix_debouncing[row]; - } - debouncing = false; - } - return 1; -} - -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & (1< Date: Fri, 8 Jul 2016 09:09:31 +0300 Subject: All Ez keymaps compiles --- keyboards/ergodox/config.h | 12 ++++++++++++ keyboards/ergodox/keymaps/ab/keymap.c | 2 +- keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c | 2 +- keyboards/ergodox/keymaps/alexjj/keymap.c | 2 +- keyboards/ergodox/keymaps/algernon/keymap.c | 2 +- keyboards/ergodox/keymaps/andrew_osx/keymap.c | 2 +- keyboards/ergodox/keymaps/bepo/keymap.c | 2 +- keyboards/ergodox/keymaps/coderkun_neo2/keymap.c | 2 +- keyboards/ergodox/keymaps/colemak/keymap.c | 2 +- keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c | 2 +- keyboards/ergodox/keymaps/csharp_dev/keymap.c | 2 +- keyboards/ergodox/keymaps/dave/keymap.c | 2 +- keyboards/ergodox/keymaps/default_osx/keymap.c | 2 +- keyboards/ergodox/keymaps/dragon788/keymap.c | 2 +- keyboards/ergodox/keymaps/dvorak/keymap.c | 2 +- keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c | 2 +- keyboards/ergodox/keymaps/dvorak_spanish/keymap.c | 2 +- keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c | 2 +- keyboards/ergodox/keymaps/erez_experimental/keymap.c | 2 +- keyboards/ergodox/keymaps/german-kinergo/keymap.c | 2 +- keyboards/ergodox/keymaps/german-manuneo/keymap.c | 2 +- keyboards/ergodox/keymaps/german-manuneo/keymap.md | 2 +- keyboards/ergodox/keymaps/german/keymap.c | 2 +- keyboards/ergodox/keymaps/j3rn/keymap.c | 2 +- keyboards/ergodox/keymaps/jack/keymap.c | 2 +- keyboards/ergodox/keymaps/jacobono/keymap.c | 2 +- keyboards/ergodox/keymaps/jgarr/keymap.c | 2 +- keyboards/ergodox/keymaps/josh/keymap.c | 2 +- keyboards/ergodox/keymaps/kastyle/keymap.c | 2 +- keyboards/ergodox/keymaps/kines-ish/keymap.c | 2 +- keyboards/ergodox/keymaps/maz/keymap.c | 2 +- keyboards/ergodox/keymaps/mpiechotka/keymap.c | 2 +- keyboards/ergodox/keymaps/msc/keymap.c | 2 +- keyboards/ergodox/keymaps/naps62/keymap.c | 2 +- keyboards/ergodox/keymaps/ordinary/keymap.c | 2 +- keyboards/ergodox/keymaps/osx_de/keymap.c | 2 +- keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c | 2 +- keyboards/ergodox/keymaps/osx_de_experimental/keymap.c | 2 +- keyboards/ergodox/keymaps/osx_fr/keymap.c | 4 ++-- keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c | 2 +- keyboards/ergodox/keymaps/plover/keymap.c | 2 +- keyboards/ergodox/keymaps/plums/keymap.c | 2 +- keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c | 2 +- .../keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c | 2 +- .../keymaps/romanzolotarev-norman-plover-osx/keymap.c | 2 +- .../keymaps/romanzolotarev-norman-qwerty-osx/keymap.c | 2 +- keyboards/ergodox/keymaps/sneako/keymap.c | 2 +- keyboards/ergodox/keymaps/software_neo2/keymap.c | 2 +- keyboards/ergodox/keymaps/supercoder/keymap.c | 2 +- keyboards/ergodox/keymaps/techtomas/keymap.c | 2 +- keyboards/ergodox/keymaps/teckinesis/keymap.c | 2 +- keyboards/ergodox/keymaps/tkuichooseyou/keymap.c | 2 +- keyboards/ergodox/keymaps/tm2030/keymap.c | 2 +- keyboards/ergodox/keymaps/tonyabra_osx/keymap.c | 2 +- keyboards/ergodox/keymaps/townk_osx/keymap.c | 2 +- keyboards/ergodox/keymaps/twey/keymap.c | 2 +- keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c | 2 +- keyboards/ergodox/keymaps/zweihander-osx/keymap.c | 2 +- 58 files changed, 70 insertions(+), 58 deletions(-) create mode 100644 keyboards/ergodox/config.h diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h new file mode 100644 index 000000000..c37c10e93 --- /dev/null +++ b/keyboards/ergodox/config.h @@ -0,0 +1,12 @@ +#ifndef KEYBOARDS_ERGODOX_CONFIG_H_ +#define KEYBOARDS_ERGODOX_CONFIG_H_ + +#ifdef SUBPROJECT_ez + #include "ez/config.h" +#endif +#ifdef SUBPROJECT_infinity + #include "infinity/config.h" +#endif + + +#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */ diff --git a/keyboards/ergodox/keymaps/ab/keymap.c b/keyboards/ergodox/keymaps/ab/keymap.c index df6f33460..7938c9da3 100644 --- a/keyboards/ergodox/keymaps/ab/keymap.c +++ b/keyboards/ergodox/keymaps/ab/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c b/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c index 052517d70..31ae4262b 100644 --- a/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c +++ b/keyboards/ergodox/keymaps/adnw_k_o_y/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_german.h" diff --git a/keyboards/ergodox/keymaps/alexjj/keymap.c b/keyboards/ergodox/keymaps/alexjj/keymap.c index 448f62da0..ac954ba5b 100644 --- a/keyboards/ergodox/keymaps/alexjj/keymap.c +++ b/keyboards/ergodox/keymaps/alexjj/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c index c12087292..1ebcf528b 100644 --- a/keyboards/ergodox/keymaps/algernon/keymap.c +++ b/keyboards/ergodox/keymaps/algernon/keymap.c @@ -2,7 +2,7 @@ * algernon's ErgoDox EZ layout, please see the readme.md file! */ -#include "ergodox_ez.h" +#include "ergodox.h" #include "led.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/andrew_osx/keymap.c b/keyboards/ergodox/keymaps/andrew_osx/keymap.c index 48257d23a..750155d98 100644 --- a/keyboards/ergodox/keymaps/andrew_osx/keymap.c +++ b/keyboards/ergodox/keymaps/andrew_osx/keymap.c @@ -1,7 +1,7 @@ // Netable differences vs. the default firmware for the ErgoDox EZ: // 1. The Cmd key is now on the right side, making Cmd+Space easier. // 2. The media keys work on OSX (But not on Windows). -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/bepo/keymap.c b/keyboards/ergodox/keymaps/bepo/keymap.c index 921a94d63..2d88fc10e 100644 --- a/keyboards/ergodox/keymaps/bepo/keymap.c +++ b/keyboards/ergodox/keymaps/bepo/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_bepo.h" diff --git a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c index 8a2ba26d2..2ac06eef8 100644 --- a/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c +++ b/keyboards/ergodox/keymaps/coderkun_neo2/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "led.h" diff --git a/keyboards/ergodox/keymaps/colemak/keymap.c b/keyboards/ergodox/keymaps/colemak/keymap.c index 9601726f7..7ef81ab4b 100644 --- a/keyboards/ergodox/keymaps/colemak/keymap.c +++ b/keyboards/ergodox/keymaps/colemak/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c b/keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c index a909ed3a4..eb0156c45 100644 --- a/keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c +++ b/keyboards/ergodox/keymaps/colemak_osx_pc_no/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_norwegian.h" diff --git a/keyboards/ergodox/keymaps/csharp_dev/keymap.c b/keyboards/ergodox/keymaps/csharp_dev/keymap.c index e9648ede7..e0c66f487 100644 --- a/keyboards/ergodox/keymaps/csharp_dev/keymap.c +++ b/keyboards/ergodox/keymaps/csharp_dev/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/dave/keymap.c b/keyboards/ergodox/keymaps/dave/keymap.c index e9480af3e..32c70097b 100644 --- a/keyboards/ergodox/keymaps/dave/keymap.c +++ b/keyboards/ergodox/keymaps/dave/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/default_osx/keymap.c b/keyboards/ergodox/keymaps/default_osx/keymap.c index c57ffbb88..e9a242e07 100644 --- a/keyboards/ergodox/keymaps/default_osx/keymap.c +++ b/keyboards/ergodox/keymaps/default_osx/keymap.c @@ -1,7 +1,7 @@ // Netable differences vs. the default firmware for the ErgoDox EZ: // 1. The Cmd key is now on the right side, making Cmd+Space easier. // 2. The media keys work on OSX (But not on Windows). -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/dragon788/keymap.c b/keyboards/ergodox/keymaps/dragon788/keymap.c index 3aec8c6cf..d33bc6a25 100644 --- a/keyboards/ergodox/keymaps/dragon788/keymap.c +++ b/keyboards/ergodox/keymaps/dragon788/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/dvorak/keymap.c b/keyboards/ergodox/keymaps/dvorak/keymap.c index 22947327d..d3609c673 100644 --- a/keyboards/ergodox/keymaps/dvorak/keymap.c +++ b/keyboards/ergodox/keymaps/dvorak/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c index 82f55b4bc..89eae5208 100644 --- a/keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c +++ b/keyboards/ergodox/keymaps/dvorak_intl_squisher/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/dvorak_spanish/keymap.c b/keyboards/ergodox/keymaps/dvorak_spanish/keymap.c index 6eb864b44..6d7adf907 100755 --- a/keyboards/ergodox/keymaps/dvorak_spanish/keymap.c +++ b/keyboards/ergodox/keymaps/dvorak_spanish/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c b/keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c index 1d8e66a08..e80f08d73 100644 --- a/keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c +++ b/keyboards/ergodox/keymaps/emacs_osx_dk/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/erez_experimental/keymap.c b/keyboards/ergodox/keymaps/erez_experimental/keymap.c index 04ad2a816..47e40aa55 100644 --- a/keyboards/ergodox/keymaps/erez_experimental/keymap.c +++ b/keyboards/ergodox/keymaps/erez_experimental/keymap.c @@ -1,5 +1,5 @@ #include -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/german-kinergo/keymap.c b/keyboards/ergodox/keymaps/german-kinergo/keymap.c index b1cecf0dd..971318d87 100644 --- a/keyboards/ergodox/keymaps/german-kinergo/keymap.c +++ b/keyboards/ergodox/keymaps/german-kinergo/keymap.c @@ -1,7 +1,7 @@ // German keymap derived from "german", but more closely resembling the German layout of the Kinesis Ergo Elan. // // chschmitz, 2016-01-27 -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_german.h" diff --git a/keyboards/ergodox/keymaps/german-manuneo/keymap.c b/keyboards/ergodox/keymaps/german-manuneo/keymap.c index 5fcc14d51..16e92bc23 100644 --- a/keyboards/ergodox/keymaps/german-manuneo/keymap.c +++ b/keyboards/ergodox/keymaps/german-manuneo/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "action_layer.h" #include "keymap.h" #include "keymap_german.h" diff --git a/keyboards/ergodox/keymaps/german-manuneo/keymap.md b/keyboards/ergodox/keymaps/german-manuneo/keymap.md index 2c9e0a837..837b25446 100644 --- a/keyboards/ergodox/keymaps/german-manuneo/keymap.md +++ b/keyboards/ergodox/keymaps/german-manuneo/keymap.md @@ -12,7 +12,7 @@ Tested with python 2.7 and python 3.4 { "layout": "ergodox_ez", "keymaps_includes": [ - "ergodox_ez.h", + "ergodox.h", "action_layer.h", "keymap_common.h", "keymap_extras/keymap_german.h", diff --git a/keyboards/ergodox/keymaps/german/keymap.c b/keyboards/ergodox/keymaps/german/keymap.c index 3eab51f0e..9b2f6ffa2 100644 --- a/keyboards/ergodox/keymaps/german/keymap.c +++ b/keyboards/ergodox/keymaps/german/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_german.h" diff --git a/keyboards/ergodox/keymaps/j3rn/keymap.c b/keyboards/ergodox/keymaps/j3rn/keymap.c index 6e271321d..43c8f30a3 100644 --- a/keyboards/ergodox/keymaps/j3rn/keymap.c +++ b/keyboards/ergodox/keymaps/j3rn/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/jack/keymap.c b/keyboards/ergodox/keymaps/jack/keymap.c index 80bf9d535..dda253fa4 100644 --- a/keyboards/ergodox/keymaps/jack/keymap.c +++ b/keyboards/ergodox/keymaps/jack/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/jacobono/keymap.c b/keyboards/ergodox/keymaps/jacobono/keymap.c index 6b19800af..dc7382bfe 100644 --- a/keyboards/ergodox/keymaps/jacobono/keymap.c +++ b/keyboards/ergodox/keymaps/jacobono/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/jgarr/keymap.c b/keyboards/ergodox/keymaps/jgarr/keymap.c index a3ad2040f..42d58421d 100644 --- a/keyboards/ergodox/keymaps/jgarr/keymap.c +++ b/keyboards/ergodox/keymaps/jgarr/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/josh/keymap.c b/keyboards/ergodox/keymaps/josh/keymap.c index de5664a25..488b21427 100644 --- a/keyboards/ergodox/keymaps/josh/keymap.c +++ b/keyboards/ergodox/keymaps/josh/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/kastyle/keymap.c b/keyboards/ergodox/keymaps/kastyle/keymap.c index 3982e0a19..a92085003 100644 --- a/keyboards/ergodox/keymaps/kastyle/keymap.c +++ b/keyboards/ergodox/keymaps/kastyle/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/kines-ish/keymap.c b/keyboards/ergodox/keymaps/kines-ish/keymap.c index 5063c99f2..83f5b0e2b 100644 --- a/keyboards/ergodox/keymaps/kines-ish/keymap.c +++ b/keyboards/ergodox/keymaps/kines-ish/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/maz/keymap.c b/keyboards/ergodox/keymaps/maz/keymap.c index 7b8f0df74..6378f874b 100644 --- a/keyboards/ergodox/keymaps/maz/keymap.c +++ b/keyboards/ergodox/keymaps/maz/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/mpiechotka/keymap.c b/keyboards/ergodox/keymaps/mpiechotka/keymap.c index 5bfef5995..67aca4479 100644 --- a/keyboards/ergodox/keymaps/mpiechotka/keymap.c +++ b/keyboards/ergodox/keymaps/mpiechotka/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_colemak.h" diff --git a/keyboards/ergodox/keymaps/msc/keymap.c b/keyboards/ergodox/keymaps/msc/keymap.c index e567e513f..c43aecf6b 100644 --- a/keyboards/ergodox/keymaps/msc/keymap.c +++ b/keyboards/ergodox/keymaps/msc/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/naps62/keymap.c b/keyboards/ergodox/keymaps/naps62/keymap.c index d8c28423c..9064053fc 100644 --- a/keyboards/ergodox/keymaps/naps62/keymap.c +++ b/keyboards/ergodox/keymaps/naps62/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/ordinary/keymap.c b/keyboards/ergodox/keymaps/ordinary/keymap.c index 778cbc63c..bf0574ea2 100644 --- a/keyboards/ergodox/keymaps/ordinary/keymap.c +++ b/keyboards/ergodox/keymaps/ordinary/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "led.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/osx_de/keymap.c b/keyboards/ergodox/keymaps/osx_de/keymap.c index 554813d7e..e3b9e11f4 100644 --- a/keyboards/ergodox/keymaps/osx_de/keymap.c +++ b/keyboards/ergodox/keymaps/osx_de/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_german_osx.h" diff --git a/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c b/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c index 687a5cb8b..6c4312a32 100644 --- a/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c +++ b/keyboards/ergodox/keymaps/osx_de_adnw_koy/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c b/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c index 21d695894..61b6a4fdb 100644 --- a/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c +++ b/keyboards/ergodox/keymaps/osx_de_experimental/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_neo2.h" diff --git a/keyboards/ergodox/keymaps/osx_fr/keymap.c b/keyboards/ergodox/keymaps/osx_fr/keymap.c index de951666d..7dee284fa 100644 --- a/keyboards/ergodox/keymaps/osx_fr/keymap.c +++ b/keyboards/ergodox/keymaps/osx_fr/keymap.c @@ -1,5 +1,5 @@ // French AZERTY version of the default_osx file -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_french_osx.h" @@ -184,4 +184,4 @@ void matrix_scan_user(void) { break; } -}; \ No newline at end of file +}; diff --git a/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c b/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c index 1032be549..11281df8a 100644 --- a/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c +++ b/keyboards/ergodox/keymaps/osx_kinesis_pnut/keymap.c @@ -5,7 +5,7 @@ // Only default layer was remapped all others layers are standard Ergodox EZ // Very personal mapping of-course, but who knows a starting point for others. -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/plover/keymap.c b/keyboards/ergodox/keymaps/plover/keymap.c index 8a58a37f6..12b3aa212 100644 --- a/keyboards/ergodox/keymaps/plover/keymap.c +++ b/keyboards/ergodox/keymaps/plover/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/plums/keymap.c b/keyboards/ergodox/keymaps/plums/keymap.c index 46eb2e42b..2853455e3 100644 --- a/keyboards/ergodox/keymaps/plums/keymap.c +++ b/keyboards/ergodox/keymaps/plums/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c index a66971bef..24d0c4ecb 100644 --- a/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c index 7c9f67381..9f41e5189 100644 --- a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx-hjkl/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c index 9971b834c..563e24872 100644 --- a/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-plover-osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c index dedac694e..5569f5c74 100644 --- a/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c +++ b/keyboards/ergodox/keymaps/romanzolotarev-norman-qwerty-osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/sneako/keymap.c b/keyboards/ergodox/keymaps/sneako/keymap.c index 0c6863102..08cadd685 100644 --- a/keyboards/ergodox/keymaps/sneako/keymap.c +++ b/keyboards/ergodox/keymaps/sneako/keymap.c @@ -1,7 +1,7 @@ // Based on `default_osx` // Replace left Bksp with Ctrl/Esc // Remove the Ctrl from Z and / -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/software_neo2/keymap.c b/keyboards/ergodox/keymaps/software_neo2/keymap.c index 2eaba0d7d..41ace403d 100644 --- a/keyboards/ergodox/keymaps/software_neo2/keymap.c +++ b/keyboards/ergodox/keymaps/software_neo2/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_neo2.h" diff --git a/keyboards/ergodox/keymaps/supercoder/keymap.c b/keyboards/ergodox/keymaps/supercoder/keymap.c index ca21d30fd..775acf2c9 100644 --- a/keyboards/ergodox/keymaps/supercoder/keymap.c +++ b/keyboards/ergodox/keymaps/supercoder/keymap.c @@ -2,7 +2,7 @@ * SuperCoder 2000 layout */ -#include "ergodox_ez.h" +#include "ergodox.h" /* Layers */ diff --git a/keyboards/ergodox/keymaps/techtomas/keymap.c b/keyboards/ergodox/keymaps/techtomas/keymap.c index 1ff6618b9..93d59d487 100644 --- a/keyboards/ergodox/keymaps/techtomas/keymap.c +++ b/keyboards/ergodox/keymaps/techtomas/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/teckinesis/keymap.c b/keyboards/ergodox/keymaps/teckinesis/keymap.c index ec6ceb96b..2837874f7 100644 --- a/keyboards/ergodox/keymaps/teckinesis/keymap.c +++ b/keyboards/ergodox/keymaps/teckinesis/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "led.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c b/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c index 87b77e42e..d1c779186 100644 --- a/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c +++ b/keyboards/ergodox/keymaps/tkuichooseyou/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/tm2030/keymap.c b/keyboards/ergodox/keymaps/tm2030/keymap.c index ca8075226..1d861ee7c 100644 --- a/keyboards/ergodox/keymaps/tm2030/keymap.c +++ b/keyboards/ergodox/keymaps/tm2030/keymap.c @@ -1,5 +1,5 @@ /* TypeMatrix-2030-like keymap */ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "led.h" diff --git a/keyboards/ergodox/keymaps/tonyabra_osx/keymap.c b/keyboards/ergodox/keymaps/tonyabra_osx/keymap.c index 87b9fb676..2a15fcb8d 100644 --- a/keyboards/ergodox/keymaps/tonyabra_osx/keymap.c +++ b/keyboards/ergodox/keymaps/tonyabra_osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" diff --git a/keyboards/ergodox/keymaps/townk_osx/keymap.c b/keyboards/ergodox/keymaps/townk_osx/keymap.c index 07e58a491..5043d49a0 100644 --- a/keyboards/ergodox/keymaps/townk_osx/keymap.c +++ b/keyboards/ergodox/keymaps/townk_osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "action_util.h" diff --git a/keyboards/ergodox/keymaps/twey/keymap.c b/keyboards/ergodox/keymaps/twey/keymap.c index 019930f2a..5deacd63f 100644 --- a/keyboards/ergodox/keymaps/twey/keymap.c +++ b/keyboards/ergodox/keymaps/twey/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" #include "keymap_plover.h" diff --git a/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c b/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c index 8effa53b2..c05a1018d 100644 --- a/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c +++ b/keyboards/ergodox/keymaps/workman_osx_mdw/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" // readme diff --git a/keyboards/ergodox/keymaps/zweihander-osx/keymap.c b/keyboards/ergodox/keymaps/zweihander-osx/keymap.c index 3444152bc..40b1d7d6d 100644 --- a/keyboards/ergodox/keymaps/zweihander-osx/keymap.c +++ b/keyboards/ergodox/keymaps/zweihander-osx/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" -- cgit v1.2.3-24-g4f1b From e01b4c3fd9a7b66276ffd22dcac25d569d7bb7ff Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 9 Jul 2016 00:41:15 +0300 Subject: Most ergodox keymaps compiles on Infinity There are linker errors due to missing led funcitonality though --- .../drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h | 113 +++++++ .../ergodox/drivers/gdisp/IS31FL3731C/driver.mk | 2 + .../drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 333 +++++++++++++++++++++ .../drivers/gdisp/IS31FL3731C/gdisp_lld_config.h | 36 +++ .../ergodox/drivers/gdisp/emulator_lcd/driver.mk | 2 + .../drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 + .../ergodox/drivers/gdisp/emulator_led/driver.mk | 2 + .../drivers/gdisp/emulator_led/emulator_led.c | 10 + .../drivers/gdisp/st7565ergodox/board_ST7565.h | 127 ++++++++ .../ergodox/drivers/gdisp/st7565ergodox/driver.mk | 2 + .../drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c | 292 ++++++++++++++++++ .../drivers/gdisp/st7565ergodox/gdisp_lld_config.h | 26 ++ .../ergodox/drivers/gdisp/st7565ergodox/st7565.h | 37 +++ keyboards/ergodox/ergodox.c | 8 - keyboards/ergodox/ergodox.h | 1 - keyboards/ergodox/infinity/Makefile | 4 +- .../drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h | 113 ------- .../infinity/drivers/gdisp/IS31FL3731C/driver.mk | 2 - .../drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 333 --------------------- .../drivers/gdisp/IS31FL3731C/gdisp_lld_config.h | 36 --- .../infinity/drivers/gdisp/emulator_lcd/driver.mk | 2 - .../drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 - .../infinity/drivers/gdisp/emulator_led/driver.mk | 2 - .../drivers/gdisp/emulator_led/emulator_led.c | 10 - .../drivers/gdisp/st7565ergodox/board_ST7565.h | 127 -------- .../infinity/drivers/gdisp/st7565ergodox/driver.mk | 2 - .../drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c | 292 ------------------ .../drivers/gdisp/st7565ergodox/gdisp_lld_config.h | 26 -- .../infinity/drivers/gdisp/st7565ergodox/st7565.h | 37 --- 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 +- 34 files changed, 1038 insertions(+), 1024 deletions(-) create mode 100644 keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h create mode 100644 keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk create mode 100644 keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c create mode 100644 keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h create mode 100644 keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk create mode 100644 keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c create mode 100644 keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk create mode 100644 keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c create mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h create mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk create mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c create mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h create mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h delete mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h diff --git a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h new file mode 100644 index 000000000..2ea73f1fb --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h @@ -0,0 +1,113 @@ +/* +Copyright 2016 Fred Sundvik + +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 _GDISP_LLD_BOARD_H +#define _GDISP_LLD_BOARD_H + +static const I2CConfig i2ccfg = { + 400000 // clock speed (Hz); 400kHz max for IS31 +}; + +#define GDISP_SCREEN_WIDTH 7 +#define GDISP_SCREEN_HEIGHT 7 + +static const uint8_t led_mask[] = { + 0xFF, 0x00, /* C1-1 -> C1-16 */ + 0xFF, 0x00, /* C2-1 -> C2-16 */ + 0xFF, 0x00, /* C3-1 -> C3-16 */ + 0xFF, 0x00, /* C4-1 -> C4-16 */ + 0x3F, 0x00, /* C5-1 -> C5-16 */ + 0x00, 0x00, /* C6-1 -> C6-16 */ + 0x00, 0x00, /* C7-1 -> C7-16 */ + 0x00, 0x00, /* C8-1 -> C8-16 */ + 0x00, 0x00, /* C9-1 -> C9-16 */ +}; + +// The address of the LED +#define LA(c, r) (c + r * 16 ) +// Need to be an address that is not mapped, but inside the range of the controller matrix +#define NA LA(8, 8) + +// The numbers in the comments are the led numbers DXX on the PCB +// The mapping is taken from the schematic of left hand side +static const uint8_t led_mapping[GDISP_SCREEN_HEIGHT][GDISP_SCREEN_WIDTH] = { +// 45 44 43 42 41 40 39 + { LA(1, 1), LA(1, 0), LA(0, 4), LA(0, 3), LA(0, 2), LA(0, 1), LA(0, 0)}, +// 52 51 50 49 48 47 46 + { LA(2, 3), LA(2, 2), LA(2, 1), LA(2, 0), LA(1, 4), LA(1, 3), LA(1, 2) }, +// 58 57 56 55 54 53 N/A + { LA(3, 4), LA(3, 3), LA(3, 2), LA(3, 1), LA(3, 0), LA(2, 4), NA }, +// 67 66 65 64 63 62 61 + { LA(5, 3), LA(5, 2), LA(5, 1), LA(5, 0), LA(4, 4), LA(4, 3), LA(4, 2) }, +// 76 75 74 73 72 60 59 + { LA(7, 3), LA(7, 2), LA(7, 1), LA(7, 0), LA(6, 3), LA(4, 1), LA(4, 0) }, +// N/A N/A N/A N/A N/A N/A 68 + { NA, NA, NA, NA, NA, NA, LA(5, 4) }, +// N/A N/A N/A N/A 71 70 69 + { NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0) }, +}; + + +#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND +#define IS31_TIMEOUT 5000 + +static GFXINLINE void init_board(GDisplay *g) { + (void) g; + /* I2C pins */ + palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATIVE_2); // PTB0/I2C0/SCL + palSetPadMode(GPIOB, 1, PAL_MODE_ALTERNATIVE_2); // PTB1/I2C0/SDA + palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL); + palClearPad(GPIOB, 16); + /* start I2C */ + i2cStart(&I2CD1, &i2ccfg); + // try high drive (from kiibohd) + I2CD1.i2c->C2 |= I2Cx_C2_HDRS; + // try glitch fixing (from kiibohd) + I2CD1.i2c->FLT = 4; +} + +static GFXINLINE void post_init_board(GDisplay *g) { + (void) g; +} + +static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) { + (void) g; + return led_mask; +} + +static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y) +{ + (void) g; + return led_mapping[y][x]; +} + +static GFXINLINE void set_hardware_shutdown(GDisplay* g, bool shutdown) { + (void) g; + if(!shutdown) { + palSetPad(GPIOB, 16); + } + else { + palClearPad(GPIOB, 16); + } +} + +static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { + (void) g; + i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, data, length, 0, 0, US2ST(IS31_TIMEOUT)); +} + +#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk new file mode 100644 index 000000000..f32d0d868 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/IS31FL3731C +GFXSRC += drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c new file mode 100644 index 000000000..1d21f0c49 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c @@ -0,0 +1,333 @@ +/* +Copyright 2016 Fred Sundvik + +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 . +*/ + +#include "gfx.h" + +#if GFX_USE_GDISP + +#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX +#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h" +#include "src/gdisp/gdisp_driver.h" + +#include "board_IS31FL3731C.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 9 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 16 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 0 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) + +#define IS31_ADDR_DEFAULT 0x74 + +#define IS31_REG_CONFIG 0x00 +// bits in reg +#define IS31_REG_CONFIG_PICTUREMODE 0x00 +#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08 +#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18 +// D2:D0 bits are starting frame for autoplay mode + +#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode + +#define IS31_REG_AUTOPLAYCTRL1 0x02 +// D6:D4 number of loops (000=infty) +// D2:D0 number of frames to be used + +#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms) + +#define IS31_REG_DISPLAYOPT 0x05 +#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames +#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x8 +// D2:D0 bits blink period time (*0.27s) + +#define IS31_REG_AUDIOSYNC 0x06 +#define IS31_REG_AUDIOSYNC_ENABLE 0x1 + +#define IS31_REG_FRAMESTATE 0x07 + +#define IS31_REG_BREATHCTRL1 0x08 +// D6:D4 fade out time (26ms*2^i) +// D2:D0 fade in time (26ms*2^i) + +#define IS31_REG_BREATHCTRL2 0x09 +#define IS31_REG_BREATHCTRL2_ENABLE 0x10 +// D2:D0 extinguish time (3.5ms*2^i) + +#define IS31_REG_SHUTDOWN 0x0A +#define IS31_REG_SHUTDOWN_OFF 0x0 +#define IS31_REG_SHUTDOWN_ON 0x1 + +#define IS31_REG_AGCCTRL 0x0B +#define IS31_REG_ADCRATE 0x0C + +#define IS31_COMMANDREGISTER 0xFD +#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine' +#define IS31_FUNCTIONREG_SIZE 0xD + +#define IS31_FRAME_SIZE 0xB4 + +#define IS31_PWM_REG 0x24 +#define IS31_PWM_SIZE 0x90 + +#define IS31_LED_MASK_SIZE 0x12 +#define IS31_SCREEN_WIDTH 16 + +#define IS31 + +//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm +const unsigned char cie[256] = { + 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, + 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, + 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, + 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, + 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, + 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, + 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, + 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, + 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, + 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, + 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, + 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, + 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, + 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, + 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, + 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, + 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, + 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, + 242, 245, 247, 250, 252, 255, +}; + + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +typedef struct{ + uint8_t write_buffer_offset; + uint8_t write_buffer[IS31_FRAME_SIZE]; + uint8_t frame_buffer[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH]; + uint8_t page; +}__attribute__((__packed__)) PrivData; + +// Some common routines and macros +#define PRIV(g) ((PrivData*)g->priv) + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +static GFXINLINE void write_page(GDisplay* g, uint8_t page) { + uint8_t tx[2] __attribute__((aligned(2))); + tx[0] = IS31_COMMANDREGISTER; + tx[1] = page; + write_data(g, tx, 2); +} + +static GFXINLINE void write_register(GDisplay* g, uint8_t page, uint8_t reg, uint8_t data) { + uint8_t tx[2] __attribute__((aligned(2))); + tx[0] = reg; + tx[1] = data; + write_page(g, page); + write_data(g, tx, 2); +} + +static GFXINLINE void write_ram(GDisplay *g, uint8_t page, uint16_t offset, uint16_t length) { + PRIV(g)->write_buffer_offset = offset; + write_page(g, page); + write_data(g, (uint8_t*)PRIV(g), length + 1); +} + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // The private area is the display surface. + g->priv = gfxAlloc(sizeof(PrivData)); + __builtin_memset(PRIV(g), 0, sizeof(PrivData)); + PRIV(g)->page = 0; + + // Initialise the board interface + init_board(g); + gfxSleepMilliseconds(10); + + // zero function page, all registers (assuming full_page is all zeroes) + write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); + set_hardware_shutdown(g, false); + gfxSleepMilliseconds(10); + // software shutdown + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); + gfxSleepMilliseconds(10); + // zero function page, all registers + write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); + gfxSleepMilliseconds(10); + + + // zero all LED registers on all 8 pages, and enable the mask + __builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE); + for(uint8_t i=0; i<8; i++) { + write_ram(g, i, 0, IS31_FRAME_SIZE); + gfxSleepMilliseconds(1); + } + + // software shutdown disable (i.e. turn stuff on) + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + gfxSleepMilliseconds(10); + + // Finish Init + post_init_board(g); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + return TRUE; +} + +#if GDISP_HARDWARE_FLUSH + LLDSPEC void gdisp_lld_flush(GDisplay *g) { + // Don't flush if we don't need it. + if (!(g->flags & GDISP_FLG_NEEDFLUSH)) + return; + + PRIV(g)->page++; + PRIV(g)->page %= 2; + // TODO: some smarter algorithm for this + // We should run only one physical page at a time + // This way we don't need to send so much data, and + // we could use slightly less memory + uint8_t* src = PRIV(g)->frame_buffer; + for (int y=0;ywrite_buffer[get_led_address(g, x, y)]=cie[*src]; + ++src; + } + } + write_ram(g, PRIV(g)->page, IS31_PWM_REG, IS31_PWM_SIZE); + gfxSleepMilliseconds(1); + write_register(g, IS31_FUNCTIONREG, IS31_REG_PICTDISP, PRIV(g)->page); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_DRAWPIXEL + LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = g->p.y; + break; + } + PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x] = gdispColor2Native(g->p.color); + g->flags |= GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = g->p.y; + break; + } + return gdispNative2Color(PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x]); + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + case powerSleep: + case powerDeepSleep: + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); + break; + case powerOn: + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + break; + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + /* Rotation is handled by the drawing routines */ + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + default: + return; + } + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_CONTRAST: + return; + } + } +#endif // GDISP_NEED_CONTROL + +#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h new file mode 100644 index 000000000..bb28ad775 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h @@ -0,0 +1,36 @@ +/* +Copyright 2016 Fred Sundvik + +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 _GDISP_LLD_CONFIG_H +#define _GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_GRAY256 + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk new file mode 100644 index 000000000..16c3f80f5 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/emulator_lcd +GFXSRC += drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c new file mode 100644 index 000000000..babfe2b36 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c @@ -0,0 +1,10 @@ +#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LCD_ERGODOX +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO +#define GDISP_SCREEN_WIDTH 128 +#define GDISP_SCREEN_HEIGHT 32 +#define ROTATE_180_IS_FLIP + +#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk b/keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk new file mode 100644 index 000000000..255434432 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/emulator_led +GFXSRC += drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c new file mode 100644 index 000000000..b0ebcdc47 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c @@ -0,0 +1,10 @@ +#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LED_ERGODOX +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO +#define GDISP_SCREEN_WIDTH 7 +#define GDISP_SCREEN_HEIGHT 7 +#define ROTATE_180_IS_FLIP + +#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h new file mode 100644 index 000000000..290571ce5 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h @@ -0,0 +1,127 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _GDISP_LLD_BOARD_H +#define _GDISP_LLD_BOARD_H + +#include "print.h" + +#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 +#define ST7565_ADC ST7565_ADC_NORMAL +#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC +#define ST7565_PAGE_ORDER 0,1,2,3 +/* + * Custom page order for several LCD boards, e.g. HEM12864-99 + * #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3 + */ + +#define ST7565_GPIOPORT GPIOC +#define ST7565_PORT PORTC +#define ST7565_A0_PIN 7 +#define ST7565_RST_PIN 8 +#define ST7565_MOSI_PIN 6 +#define ST7565_SLCK_PIN 5 +#define ST7565_SS_PIN 4 + +#define palSetPadModeRaw(portname, bits) \ + ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits + +#define palSetPadModeNamed(portname, portmode) \ + palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode) + +#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2) +// DSPI Clock and Transfer Attributes +// Frame Size: 8 bits +// MSB First +// CLK Low by default +static const SPIConfig spi1config = { + NULL, + /* HW dependent part.*/ + ST7565_GPIOPORT, + ST7565_SS_PIN, + SPIx_CTARn_FMSZ(7) + | SPIx_CTARn_ASC(7) + | SPIx_CTARn_DT(7) + | SPIx_CTARn_CSSCK(7) + | SPIx_CTARn_PBR(0) + | SPIx_CTARn_BR(7) + //SPI_CR1_BR_0 +}; + +static bool_t st7565_is_data_mode = 1; + +static GFXINLINE void init_board(GDisplay *g) { + (void) g; + palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); + st7565_is_data_mode = 1; + palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); + palSetPadModeRaw(MOSI, ST7565_SPI_MODE); + palSetPadModeRaw(SLCK, ST7565_SPI_MODE); + palSetPadModeRaw(SS, ST7565_SPI_MODE); + + spiInit(); + spiStart(&SPID1, &spi1config); + spiSelect(&SPID1); +} + +static GFXINLINE void post_init_board(GDisplay *g) { + (void) g; +} + +static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { + (void) g; + if (state) { + palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN); + } + else { + palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); + } +} + +static GFXINLINE void acquire_bus(GDisplay *g) { + (void) g; + // Only the LCD is using the SPI bus, so no need to acquire + // spiAcquireBus(&SPID1); +} + +static GFXINLINE void release_bus(GDisplay *g) { + (void) g; + // Only the LCD is using the SPI bus, so no need to release + //spiReleaseBus(&SPID1); +} + +static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { + (void) g; + if (st7565_is_data_mode) { + // The sleeps need to be at lest 10 vs 25 ns respectively + // So let's sleep two ticks, one tick might not be enough + // if we are at the end of the tick + chThdSleep(2); + palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); + chThdSleep(2); + st7565_is_data_mode = 0; + } + spiSend(&SPID1, 1, &cmd); +} + +static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { + (void) g; + if (!st7565_is_data_mode) { + // The sleeps need to be at lest 10 vs 25 ns respectively + // So let's sleep two ticks, one tick might not be enough + // if we are at the end of the tick + chThdSleep(2); + palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); + chThdSleep(2); + st7565_is_data_mode = 1; + } + spiSend(&SPID1, length, data); +} + +#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk new file mode 100644 index 000000000..889a1a031 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/st7565ergodox +GFXSRC += drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c new file mode 100644 index 000000000..c33aea81a --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c @@ -0,0 +1,292 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#include "gfx.h" + +#if GFX_USE_GDISP + +#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX +#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h" +#include "src/gdisp/gdisp_driver.h" + +#include "board_ST7565.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 32 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 128 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 0 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) + +#include "drivers/gdisp/st7565ergodox/st7565.h" + +/*===========================================================================*/ +/* Driver config defaults for backward compatibility. */ +/*===========================================================================*/ +#ifndef ST7565_LCD_BIAS + #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 +#endif +#ifndef ST7565_ADC + #define ST7565_ADC ST7565_ADC_NORMAL +#endif +#ifndef ST7565_COM_SCAN + #define ST7565_COM_SCAN ST7565_COM_SCAN_INC +#endif +#ifndef ST7565_PAGE_ORDER + #define ST7565_PAGE_ORDER 0,1,2,3 +#endif + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +typedef struct{ + bool_t buffer2; + uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; +}PrivData; + +// Some common routines and macros +#define PRIV(g) ((PrivData*)g->priv) +#define RAM(g) (PRIV(g)->ram) +#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } +#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } + +// Some common routines and macros +#define delay(us) gfxSleepMicroseconds(us) +#define delay_ms(ms) gfxSleepMilliseconds(ms) + +#define xyaddr(x, y) ((x) + ((y)>>3)*GDISP_SCREEN_WIDTH) +#define xybit(y) (1<<((y)&7)) + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/* + * As this controller can't update on a pixel boundary we need to maintain the + * the entire display surface in memory so that we can do the necessary bit + * operations. Fortunately it is a small display in monochrome. + * 64 * 128 / 8 = 1024 bytes. + */ + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // The private area is the display surface. + g->priv = gfxAlloc(sizeof(PrivData)); + PRIV(g)->buffer2 = false; + + // Initialise the board interface + init_board(g); + + // Hardware reset + setpin_reset(g, TRUE); + gfxSleepMilliseconds(20); + setpin_reset(g, FALSE); + gfxSleepMilliseconds(20); + + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_OFF); + write_cmd(g, ST7565_LCD_BIAS); + write_cmd(g, ST7565_ADC); + write_cmd(g, ST7565_COM_SCAN); + + write_cmd(g, ST7565_START_LINE | 0); + + write_cmd(g, ST7565_RESISTOR_RATIO | 0x6); + + // turn on voltage converter (VC=1, VR=0, VF=0) + write_cmd(g, ST7565_POWER_CONTROL | 0x04); + delay_ms(50); + + // turn on voltage regulator (VC=1, VR=1, VF=0) + write_cmd(g, ST7565_POWER_CONTROL | 0x06); + delay_ms(50); + + // turn on voltage follower (VC=1, VR=1, VF=1) + write_cmd(g, ST7565_POWER_CONTROL | 0x07); + delay_ms(50); + + write_cmd(g, 0xE2); + write_cmd(g, ST7565_COM_SCAN); + write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101); + //write_cmd2(g, ST7565_CONTRAST, 0); + write_cmd(g, ST7565_DISPLAY_ON); + write_cmd(g, ST7565_ALLON_NORMAL); + write_cmd(g, ST7565_INVERT_DISPLAY); + + write_cmd(g, ST7565_RMW); + + // Finish Init + post_init_board(g); + + // Release the bus + release_bus(g); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + return TRUE; +} + +#if GDISP_HARDWARE_FLUSH + LLDSPEC void gdisp_lld_flush(GDisplay *g) { + unsigned p; + + // Don't flush if we don't need it. + if (!(g->flags & GDISP_FLG_NEEDFLUSH)) + return; + + acquire_bus(g); + unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); + for (p = 0; p < 4; p++) { + write_cmd(g, ST7565_PAGE | (p + dstOffset)); + write_cmd(g, ST7565_COLUMN_MSB | 0); + write_cmd(g, ST7565_COLUMN_LSB | 0); + write_cmd(g, ST7565_RMW); + write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); + } + unsigned line = (PRIV(g)->buffer2 ? 32 : 0); + write_cmd(g, ST7565_START_LINE | line); + PRIV(g)->buffer2 = !PRIV(g)->buffer2; + release_bus(g); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_DRAWPIXEL + LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_HEIGHT-1 - g->p.y; + y = g->p.x; + break; + } + if (gdispColor2Native(g->p.color) != Black) + RAM(g)[xyaddr(x, y)] |= xybit(y); + else + RAM(g)[xyaddr(x, y)] &= ~xybit(y); + g->flags |= GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_HEIGHT-1 - g->p.y; + y = g->p.x; + break; + } + return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + case powerSleep: + case powerDeepSleep: + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_OFF); + release_bus(g); + break; + case powerOn: + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_ON); + release_bus(g); + break; + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + /* Rotation is handled by the drawing routines */ + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + default: + return; + } + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_CONTRAST: + if ((unsigned)g->p.ptr > 100) + g->p.ptr = (void *)100; + acquire_bus(g); + write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); + release_bus(g); + g->g.Contrast = (unsigned)g->p.ptr; + return; + } + } +#endif // GDISP_NEED_CONTROL + +#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h new file mode 100644 index 000000000..48587b9e1 --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h @@ -0,0 +1,26 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _GDISP_LLD_CONFIG_H +#define _GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h new file mode 100644 index 000000000..48636b33d --- /dev/null +++ b/keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h @@ -0,0 +1,37 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _ST7565_H +#define _ST7565_H + +#define ST7565_CONTRAST 0x81 +#define ST7565_ALLON_NORMAL 0xA4 +#define ST7565_ALLON 0xA5 +#define ST7565_POSITIVE_DISPLAY 0xA6 +#define ST7565_INVERT_DISPLAY 0xA7 +#define ST7565_DISPLAY_OFF 0xAE +#define ST7565_DISPLAY_ON 0xAF + +#define ST7565_LCD_BIAS_7 0xA3 +#define ST7565_LCD_BIAS_9 0xA2 + +#define ST7565_ADC_NORMAL 0xA0 +#define ST7565_ADC_REVERSE 0xA1 + +#define ST7565_COM_SCAN_INC 0xC0 +#define ST7565_COM_SCAN_DEC 0xC8 + +#define ST7565_START_LINE 0x40 +#define ST7565_PAGE 0xB0 +#define ST7565_COLUMN_MSB 0x10 +#define ST7565_COLUMN_LSB 0x00 +#define ST7565_RMW 0xE0 + +#define ST7565_RESISTOR_RATIO 0x20 +#define ST7565_POWER_CONTROL 0x28 + +#endif /* _ST7565_H */ diff --git a/keyboards/ergodox/ergodox.c b/keyboards/ergodox/ergodox.c index 992e95d81..e69de29bb 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 fe54e3260..f8ec8b5bf 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 942032f83..22065e4d2 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/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h deleted file mode 100644 index 2ea73f1fb..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 _GDISP_LLD_BOARD_H -#define _GDISP_LLD_BOARD_H - -static const I2CConfig i2ccfg = { - 400000 // clock speed (Hz); 400kHz max for IS31 -}; - -#define GDISP_SCREEN_WIDTH 7 -#define GDISP_SCREEN_HEIGHT 7 - -static const uint8_t led_mask[] = { - 0xFF, 0x00, /* C1-1 -> C1-16 */ - 0xFF, 0x00, /* C2-1 -> C2-16 */ - 0xFF, 0x00, /* C3-1 -> C3-16 */ - 0xFF, 0x00, /* C4-1 -> C4-16 */ - 0x3F, 0x00, /* C5-1 -> C5-16 */ - 0x00, 0x00, /* C6-1 -> C6-16 */ - 0x00, 0x00, /* C7-1 -> C7-16 */ - 0x00, 0x00, /* C8-1 -> C8-16 */ - 0x00, 0x00, /* C9-1 -> C9-16 */ -}; - -// The address of the LED -#define LA(c, r) (c + r * 16 ) -// Need to be an address that is not mapped, but inside the range of the controller matrix -#define NA LA(8, 8) - -// The numbers in the comments are the led numbers DXX on the PCB -// The mapping is taken from the schematic of left hand side -static const uint8_t led_mapping[GDISP_SCREEN_HEIGHT][GDISP_SCREEN_WIDTH] = { -// 45 44 43 42 41 40 39 - { LA(1, 1), LA(1, 0), LA(0, 4), LA(0, 3), LA(0, 2), LA(0, 1), LA(0, 0)}, -// 52 51 50 49 48 47 46 - { LA(2, 3), LA(2, 2), LA(2, 1), LA(2, 0), LA(1, 4), LA(1, 3), LA(1, 2) }, -// 58 57 56 55 54 53 N/A - { LA(3, 4), LA(3, 3), LA(3, 2), LA(3, 1), LA(3, 0), LA(2, 4), NA }, -// 67 66 65 64 63 62 61 - { LA(5, 3), LA(5, 2), LA(5, 1), LA(5, 0), LA(4, 4), LA(4, 3), LA(4, 2) }, -// 76 75 74 73 72 60 59 - { LA(7, 3), LA(7, 2), LA(7, 1), LA(7, 0), LA(6, 3), LA(4, 1), LA(4, 0) }, -// N/A N/A N/A N/A N/A N/A 68 - { NA, NA, NA, NA, NA, NA, LA(5, 4) }, -// N/A N/A N/A N/A 71 70 69 - { NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0) }, -}; - - -#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND -#define IS31_TIMEOUT 5000 - -static GFXINLINE void init_board(GDisplay *g) { - (void) g; - /* I2C pins */ - palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATIVE_2); // PTB0/I2C0/SCL - palSetPadMode(GPIOB, 1, PAL_MODE_ALTERNATIVE_2); // PTB1/I2C0/SDA - palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL); - palClearPad(GPIOB, 16); - /* start I2C */ - i2cStart(&I2CD1, &i2ccfg); - // try high drive (from kiibohd) - I2CD1.i2c->C2 |= I2Cx_C2_HDRS; - // try glitch fixing (from kiibohd) - I2CD1.i2c->FLT = 4; -} - -static GFXINLINE void post_init_board(GDisplay *g) { - (void) g; -} - -static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) { - (void) g; - return led_mask; -} - -static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y) -{ - (void) g; - return led_mapping[y][x]; -} - -static GFXINLINE void set_hardware_shutdown(GDisplay* g, bool shutdown) { - (void) g; - if(!shutdown) { - palSetPad(GPIOB, 16); - } - else { - palClearPad(GPIOB, 16); - } -} - -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { - (void) g; - i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, data, length, 0, 0, US2ST(IS31_TIMEOUT)); -} - -#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk deleted file mode 100644 index f32d0d868..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/IS31FL3731C -GFXSRC += drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c deleted file mode 100644 index 1d21f0c49..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c +++ /dev/null @@ -1,333 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 . -*/ - -#include "gfx.h" - -#if GFX_USE_GDISP - -#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX -#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" - -#include "board_IS31FL3731C.h" - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -#ifndef GDISP_SCREEN_HEIGHT - #define GDISP_SCREEN_HEIGHT 9 -#endif -#ifndef GDISP_SCREEN_WIDTH - #define GDISP_SCREEN_WIDTH 16 -#endif -#ifndef GDISP_INITIAL_CONTRAST - #define GDISP_INITIAL_CONTRAST 0 -#endif -#ifndef GDISP_INITIAL_BACKLIGHT - #define GDISP_INITIAL_BACKLIGHT 100 -#endif - -#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) - -#define IS31_ADDR_DEFAULT 0x74 - -#define IS31_REG_CONFIG 0x00 -// bits in reg -#define IS31_REG_CONFIG_PICTUREMODE 0x00 -#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08 -#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18 -// D2:D0 bits are starting frame for autoplay mode - -#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode - -#define IS31_REG_AUTOPLAYCTRL1 0x02 -// D6:D4 number of loops (000=infty) -// D2:D0 number of frames to be used - -#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms) - -#define IS31_REG_DISPLAYOPT 0x05 -#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames -#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x8 -// D2:D0 bits blink period time (*0.27s) - -#define IS31_REG_AUDIOSYNC 0x06 -#define IS31_REG_AUDIOSYNC_ENABLE 0x1 - -#define IS31_REG_FRAMESTATE 0x07 - -#define IS31_REG_BREATHCTRL1 0x08 -// D6:D4 fade out time (26ms*2^i) -// D2:D0 fade in time (26ms*2^i) - -#define IS31_REG_BREATHCTRL2 0x09 -#define IS31_REG_BREATHCTRL2_ENABLE 0x10 -// D2:D0 extinguish time (3.5ms*2^i) - -#define IS31_REG_SHUTDOWN 0x0A -#define IS31_REG_SHUTDOWN_OFF 0x0 -#define IS31_REG_SHUTDOWN_ON 0x1 - -#define IS31_REG_AGCCTRL 0x0B -#define IS31_REG_ADCRATE 0x0C - -#define IS31_COMMANDREGISTER 0xFD -#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine' -#define IS31_FUNCTIONREG_SIZE 0xD - -#define IS31_FRAME_SIZE 0xB4 - -#define IS31_PWM_REG 0x24 -#define IS31_PWM_SIZE 0x90 - -#define IS31_LED_MASK_SIZE 0x12 -#define IS31_SCREEN_WIDTH 16 - -#define IS31 - -//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm -const unsigned char cie[256] = { - 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, - 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, - 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, - 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, - 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, - 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, - 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, - 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, - 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, - 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, - 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, - 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, - 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, - 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, - 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, - 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, - 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, - 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, - 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, - 242, 245, 247, 250, 252, 255, -}; - - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -typedef struct{ - uint8_t write_buffer_offset; - uint8_t write_buffer[IS31_FRAME_SIZE]; - uint8_t frame_buffer[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH]; - uint8_t page; -}__attribute__((__packed__)) PrivData; - -// Some common routines and macros -#define PRIV(g) ((PrivData*)g->priv) - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -static GFXINLINE void write_page(GDisplay* g, uint8_t page) { - uint8_t tx[2] __attribute__((aligned(2))); - tx[0] = IS31_COMMANDREGISTER; - tx[1] = page; - write_data(g, tx, 2); -} - -static GFXINLINE void write_register(GDisplay* g, uint8_t page, uint8_t reg, uint8_t data) { - uint8_t tx[2] __attribute__((aligned(2))); - tx[0] = reg; - tx[1] = data; - write_page(g, page); - write_data(g, tx, 2); -} - -static GFXINLINE void write_ram(GDisplay *g, uint8_t page, uint16_t offset, uint16_t length) { - PRIV(g)->write_buffer_offset = offset; - write_page(g, page); - write_data(g, (uint8_t*)PRIV(g), length + 1); -} - -LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { - // The private area is the display surface. - g->priv = gfxAlloc(sizeof(PrivData)); - __builtin_memset(PRIV(g), 0, sizeof(PrivData)); - PRIV(g)->page = 0; - - // Initialise the board interface - init_board(g); - gfxSleepMilliseconds(10); - - // zero function page, all registers (assuming full_page is all zeroes) - write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); - set_hardware_shutdown(g, false); - gfxSleepMilliseconds(10); - // software shutdown - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); - gfxSleepMilliseconds(10); - // zero function page, all registers - write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); - gfxSleepMilliseconds(10); - - - // zero all LED registers on all 8 pages, and enable the mask - __builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE); - for(uint8_t i=0; i<8; i++) { - write_ram(g, i, 0, IS31_FRAME_SIZE); - gfxSleepMilliseconds(1); - } - - // software shutdown disable (i.e. turn stuff on) - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); - gfxSleepMilliseconds(10); - - // Finish Init - post_init_board(g); - - /* Initialise the GDISP structure */ - g->g.Width = GDISP_SCREEN_WIDTH; - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; - g->g.Powermode = powerOn; - g->g.Backlight = GDISP_INITIAL_BACKLIGHT; - g->g.Contrast = GDISP_INITIAL_CONTRAST; - return TRUE; -} - -#if GDISP_HARDWARE_FLUSH - LLDSPEC void gdisp_lld_flush(GDisplay *g) { - // Don't flush if we don't need it. - if (!(g->flags & GDISP_FLG_NEEDFLUSH)) - return; - - PRIV(g)->page++; - PRIV(g)->page %= 2; - // TODO: some smarter algorithm for this - // We should run only one physical page at a time - // This way we don't need to send so much data, and - // we could use slightly less memory - uint8_t* src = PRIV(g)->frame_buffer; - for (int y=0;ywrite_buffer[get_led_address(g, x, y)]=cie[*src]; - ++src; - } - } - write_ram(g, PRIV(g)->page, IS31_PWM_REG, IS31_PWM_SIZE); - gfxSleepMilliseconds(1); - write_register(g, IS31_FUNCTIONREG, IS31_REG_PICTDISP, PRIV(g)->page); - - g->flags &= ~GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_DRAWPIXEL - LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = g->p.y; - break; - } - PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x] = gdispColor2Native(g->p.color); - g->flags |= GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = g->p.y; - break; - } - return gdispNative2Color(PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x]); - } -#endif - -#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL - LLDSPEC void gdisp_lld_control(GDisplay *g) { - switch(g->p.x) { - case GDISP_CONTROL_POWER: - if (g->g.Powermode == (powermode_t)g->p.ptr) - return; - switch((powermode_t)g->p.ptr) { - case powerOff: - case powerSleep: - case powerDeepSleep: - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); - break; - case powerOn: - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); - break; - default: - return; - } - g->g.Powermode = (powermode_t)g->p.ptr; - return; - - case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) - return; - switch((orientation_t)g->p.ptr) { - /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Width = GDISP_SCREEN_WIDTH; - break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - g->g.Height = GDISP_SCREEN_WIDTH; - g->g.Width = GDISP_SCREEN_HEIGHT; - break; - default: - return; - } - g->g.Orientation = (orientation_t)g->p.ptr; - return; - - case GDISP_CONTROL_CONTRAST: - return; - } - } -#endif // GDISP_NEED_CONTROL - -#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h deleted file mode 100644 index bb28ad775..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 _GDISP_LLD_CONFIG_H -#define _GDISP_LLD_CONFIG_H - -#if GFX_USE_GDISP - -/*===========================================================================*/ -/* Driver hardware support. */ -/*===========================================================================*/ - -#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE - -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_GRAY256 - -#endif /* GFX_USE_GDISP */ - -#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk deleted file mode 100644 index 16c3f80f5..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/emulator_lcd -GFXSRC += drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c deleted file mode 100644 index babfe2b36..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c +++ /dev/null @@ -1,10 +0,0 @@ -#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LCD_ERGODOX -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO -#define GDISP_SCREEN_WIDTH 128 -#define GDISP_SCREEN_HEIGHT 32 -#define ROTATE_180_IS_FLIP - -#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk deleted file mode 100644 index 255434432..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/emulator_led -GFXSRC += drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c deleted file mode 100644 index b0ebcdc47..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c +++ /dev/null @@ -1,10 +0,0 @@ -#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LED_ERGODOX -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO -#define GDISP_SCREEN_WIDTH 7 -#define GDISP_SCREEN_HEIGHT 7 -#define ROTATE_180_IS_FLIP - -#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h deleted file mode 100644 index 290571ce5..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _GDISP_LLD_BOARD_H -#define _GDISP_LLD_BOARD_H - -#include "print.h" - -#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 -#define ST7565_ADC ST7565_ADC_NORMAL -#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC -#define ST7565_PAGE_ORDER 0,1,2,3 -/* - * Custom page order for several LCD boards, e.g. HEM12864-99 - * #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3 - */ - -#define ST7565_GPIOPORT GPIOC -#define ST7565_PORT PORTC -#define ST7565_A0_PIN 7 -#define ST7565_RST_PIN 8 -#define ST7565_MOSI_PIN 6 -#define ST7565_SLCK_PIN 5 -#define ST7565_SS_PIN 4 - -#define palSetPadModeRaw(portname, bits) \ - ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits - -#define palSetPadModeNamed(portname, portmode) \ - palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode) - -#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2) -// DSPI Clock and Transfer Attributes -// Frame Size: 8 bits -// MSB First -// CLK Low by default -static const SPIConfig spi1config = { - NULL, - /* HW dependent part.*/ - ST7565_GPIOPORT, - ST7565_SS_PIN, - SPIx_CTARn_FMSZ(7) - | SPIx_CTARn_ASC(7) - | SPIx_CTARn_DT(7) - | SPIx_CTARn_CSSCK(7) - | SPIx_CTARn_PBR(0) - | SPIx_CTARn_BR(7) - //SPI_CR1_BR_0 -}; - -static bool_t st7565_is_data_mode = 1; - -static GFXINLINE void init_board(GDisplay *g) { - (void) g; - palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); - st7565_is_data_mode = 1; - palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); - palSetPadModeRaw(MOSI, ST7565_SPI_MODE); - palSetPadModeRaw(SLCK, ST7565_SPI_MODE); - palSetPadModeRaw(SS, ST7565_SPI_MODE); - - spiInit(); - spiStart(&SPID1, &spi1config); - spiSelect(&SPID1); -} - -static GFXINLINE void post_init_board(GDisplay *g) { - (void) g; -} - -static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { - (void) g; - if (state) { - palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN); - } - else { - palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); - } -} - -static GFXINLINE void acquire_bus(GDisplay *g) { - (void) g; - // Only the LCD is using the SPI bus, so no need to acquire - // spiAcquireBus(&SPID1); -} - -static GFXINLINE void release_bus(GDisplay *g) { - (void) g; - // Only the LCD is using the SPI bus, so no need to release - //spiReleaseBus(&SPID1); -} - -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { - (void) g; - if (st7565_is_data_mode) { - // The sleeps need to be at lest 10 vs 25 ns respectively - // So let's sleep two ticks, one tick might not be enough - // if we are at the end of the tick - chThdSleep(2); - palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); - chThdSleep(2); - st7565_is_data_mode = 0; - } - spiSend(&SPID1, 1, &cmd); -} - -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { - (void) g; - if (!st7565_is_data_mode) { - // The sleeps need to be at lest 10 vs 25 ns respectively - // So let's sleep two ticks, one tick might not be enough - // if we are at the end of the tick - chThdSleep(2); - palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); - chThdSleep(2); - st7565_is_data_mode = 1; - } - spiSend(&SPID1, length, data); -} - -#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk deleted file mode 100644 index 889a1a031..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/st7565ergodox -GFXSRC += drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c deleted file mode 100644 index c33aea81a..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c +++ /dev/null @@ -1,292 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#include "gfx.h" - -#if GFX_USE_GDISP - -#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX -#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" - -#include "board_ST7565.h" - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -#ifndef GDISP_SCREEN_HEIGHT - #define GDISP_SCREEN_HEIGHT 32 -#endif -#ifndef GDISP_SCREEN_WIDTH - #define GDISP_SCREEN_WIDTH 128 -#endif -#ifndef GDISP_INITIAL_CONTRAST - #define GDISP_INITIAL_CONTRAST 0 -#endif -#ifndef GDISP_INITIAL_BACKLIGHT - #define GDISP_INITIAL_BACKLIGHT 100 -#endif - -#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) - -#include "drivers/gdisp/st7565ergodox/st7565.h" - -/*===========================================================================*/ -/* Driver config defaults for backward compatibility. */ -/*===========================================================================*/ -#ifndef ST7565_LCD_BIAS - #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 -#endif -#ifndef ST7565_ADC - #define ST7565_ADC ST7565_ADC_NORMAL -#endif -#ifndef ST7565_COM_SCAN - #define ST7565_COM_SCAN ST7565_COM_SCAN_INC -#endif -#ifndef ST7565_PAGE_ORDER - #define ST7565_PAGE_ORDER 0,1,2,3 -#endif - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -typedef struct{ - bool_t buffer2; - uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; -}PrivData; - -// Some common routines and macros -#define PRIV(g) ((PrivData*)g->priv) -#define RAM(g) (PRIV(g)->ram) -#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } -#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } - -// Some common routines and macros -#define delay(us) gfxSleepMicroseconds(us) -#define delay_ms(ms) gfxSleepMilliseconds(ms) - -#define xyaddr(x, y) ((x) + ((y)>>3)*GDISP_SCREEN_WIDTH) -#define xybit(y) (1<<((y)&7)) - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -/* - * As this controller can't update on a pixel boundary we need to maintain the - * the entire display surface in memory so that we can do the necessary bit - * operations. Fortunately it is a small display in monochrome. - * 64 * 128 / 8 = 1024 bytes. - */ - -LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { - // The private area is the display surface. - g->priv = gfxAlloc(sizeof(PrivData)); - PRIV(g)->buffer2 = false; - - // Initialise the board interface - init_board(g); - - // Hardware reset - setpin_reset(g, TRUE); - gfxSleepMilliseconds(20); - setpin_reset(g, FALSE); - gfxSleepMilliseconds(20); - - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_OFF); - write_cmd(g, ST7565_LCD_BIAS); - write_cmd(g, ST7565_ADC); - write_cmd(g, ST7565_COM_SCAN); - - write_cmd(g, ST7565_START_LINE | 0); - - write_cmd(g, ST7565_RESISTOR_RATIO | 0x6); - - // turn on voltage converter (VC=1, VR=0, VF=0) - write_cmd(g, ST7565_POWER_CONTROL | 0x04); - delay_ms(50); - - // turn on voltage regulator (VC=1, VR=1, VF=0) - write_cmd(g, ST7565_POWER_CONTROL | 0x06); - delay_ms(50); - - // turn on voltage follower (VC=1, VR=1, VF=1) - write_cmd(g, ST7565_POWER_CONTROL | 0x07); - delay_ms(50); - - write_cmd(g, 0xE2); - write_cmd(g, ST7565_COM_SCAN); - write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101); - //write_cmd2(g, ST7565_CONTRAST, 0); - write_cmd(g, ST7565_DISPLAY_ON); - write_cmd(g, ST7565_ALLON_NORMAL); - write_cmd(g, ST7565_INVERT_DISPLAY); - - write_cmd(g, ST7565_RMW); - - // Finish Init - post_init_board(g); - - // Release the bus - release_bus(g); - - /* Initialise the GDISP structure */ - g->g.Width = GDISP_SCREEN_WIDTH; - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; - g->g.Powermode = powerOn; - g->g.Backlight = GDISP_INITIAL_BACKLIGHT; - g->g.Contrast = GDISP_INITIAL_CONTRAST; - return TRUE; -} - -#if GDISP_HARDWARE_FLUSH - LLDSPEC void gdisp_lld_flush(GDisplay *g) { - unsigned p; - - // Don't flush if we don't need it. - if (!(g->flags & GDISP_FLG_NEEDFLUSH)) - return; - - acquire_bus(g); - unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); - for (p = 0; p < 4; p++) { - write_cmd(g, ST7565_PAGE | (p + dstOffset)); - write_cmd(g, ST7565_COLUMN_MSB | 0); - write_cmd(g, ST7565_COLUMN_LSB | 0); - write_cmd(g, ST7565_RMW); - write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); - } - unsigned line = (PRIV(g)->buffer2 ? 32 : 0); - write_cmd(g, ST7565_START_LINE | line); - PRIV(g)->buffer2 = !PRIV(g)->buffer2; - release_bus(g); - - g->flags &= ~GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_DRAWPIXEL - LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_90: - x = g->p.y; - y = GDISP_SCREEN_HEIGHT-1 - g->p.x; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = GDISP_SCREEN_HEIGHT-1 - g->p.y; - break; - case GDISP_ROTATE_270: - x = GDISP_SCREEN_HEIGHT-1 - g->p.y; - y = g->p.x; - break; - } - if (gdispColor2Native(g->p.color) != Black) - RAM(g)[xyaddr(x, y)] |= xybit(y); - else - RAM(g)[xyaddr(x, y)] &= ~xybit(y); - g->flags |= GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_90: - x = g->p.y; - y = GDISP_SCREEN_HEIGHT-1 - g->p.x; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = GDISP_SCREEN_HEIGHT-1 - g->p.y; - break; - case GDISP_ROTATE_270: - x = GDISP_SCREEN_HEIGHT-1 - g->p.y; - y = g->p.x; - break; - } - return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; - } -#endif - -#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL - LLDSPEC void gdisp_lld_control(GDisplay *g) { - switch(g->p.x) { - case GDISP_CONTROL_POWER: - if (g->g.Powermode == (powermode_t)g->p.ptr) - return; - switch((powermode_t)g->p.ptr) { - case powerOff: - case powerSleep: - case powerDeepSleep: - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_OFF); - release_bus(g); - break; - case powerOn: - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_ON); - release_bus(g); - break; - default: - return; - } - g->g.Powermode = (powermode_t)g->p.ptr; - return; - - case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) - return; - switch((orientation_t)g->p.ptr) { - /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Width = GDISP_SCREEN_WIDTH; - break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - g->g.Height = GDISP_SCREEN_WIDTH; - g->g.Width = GDISP_SCREEN_HEIGHT; - break; - default: - return; - } - g->g.Orientation = (orientation_t)g->p.ptr; - return; - - case GDISP_CONTROL_CONTRAST: - if ((unsigned)g->p.ptr > 100) - g->p.ptr = (void *)100; - acquire_bus(g); - write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); - release_bus(g); - g->g.Contrast = (unsigned)g->p.ptr; - return; - } - } -#endif // GDISP_NEED_CONTROL - -#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h deleted file mode 100644 index 48587b9e1..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _GDISP_LLD_CONFIG_H -#define _GDISP_LLD_CONFIG_H - -#if GFX_USE_GDISP - -/*===========================================================================*/ -/* Driver hardware support. */ -/*===========================================================================*/ - -#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE - -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO - -#endif /* GFX_USE_GDISP */ - -#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h deleted file mode 100644 index 48636b33d..000000000 --- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _ST7565_H -#define _ST7565_H - -#define ST7565_CONTRAST 0x81 -#define ST7565_ALLON_NORMAL 0xA4 -#define ST7565_ALLON 0xA5 -#define ST7565_POSITIVE_DISPLAY 0xA6 -#define ST7565_INVERT_DISPLAY 0xA7 -#define ST7565_DISPLAY_OFF 0xAE -#define ST7565_DISPLAY_ON 0xAF - -#define ST7565_LCD_BIAS_7 0xA3 -#define ST7565_LCD_BIAS_9 0xA2 - -#define ST7565_ADC_NORMAL 0xA0 -#define ST7565_ADC_REVERSE 0xA1 - -#define ST7565_COM_SCAN_INC 0xC0 -#define ST7565_COM_SCAN_DEC 0xC8 - -#define ST7565_START_LINE 0x40 -#define ST7565_PAGE 0xB0 -#define ST7565_COLUMN_MSB 0x10 -#define ST7565_COLUMN_LSB 0x00 -#define ST7565_RMW 0xE0 - -#define ST7565_RESISTOR_RATIO 0x20 -#define ST7565_POWER_CONTROL 0x28 - -#endif /* _ST7565_H */ diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c index 87ed40fab..85e61e3aa 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 de7267594..a92aa89bb 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 2b806cd64..1fda90484 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 7ebfb24e3..6e3fbcc79 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 0368bcd4a..a1352527f 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 -- cgit v1.2.3-24-g4f1b From e0f28c2b1068d8cd218e1450dea97fde946ba87a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 9 Jul 2016 01:38:58 +0300 Subject: Add empty led control functions to Infinity Ergodox So that most keymaps compiles and links --- keyboards/ergodox/infinity/infinity.c | 30 ++++++++++++++++ keyboards/ergodox/infinity/infinity.h | 66 +++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c index 85e61e3aa..d33c54441 100644 --- a/keyboards/ergodox/infinity/infinity.c +++ b/keyboards/ergodox/infinity/infinity.c @@ -91,3 +91,33 @@ void matrix_scan_kb(void) { 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){ +} diff --git a/keyboards/ergodox/infinity/infinity.h b/keyboards/ergodox/infinity/infinity.h index a92aa89bb..83ce6444c 100644 --- a/keyboards/ergodox/infinity/infinity.h +++ b/keyboards/ergodox/infinity/infinity.h @@ -3,6 +3,72 @@ #include "quantum.h" +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); + +inline void ergodox_led_all_on(void) +{ + ergodox_board_led_on(); + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); +} + +inline void ergodox_led_all_off(void) +{ + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); +} + +inline void ergodox_right_led_1_set(uint8_t n){ + if (n) { + ergodox_right_led_1_on(); + } else { + ergodox_right_led_1_off(); + } +} + +inline void ergodox_right_led_2_set(uint8_t n){ + if (n) { + ergodox_right_led_2_on(); + } else { + ergodox_right_led_2_off(); + } +} + +inline void ergodox_right_led_3_set(uint8_t n){ + if (n) { + ergodox_right_led_3_on(); + } else { + ergodox_right_led_3_off(); + } +} + +inline void ergodox_right_led_set(uint8_t led, uint8_t n){ + if (n) { + ergodox_right_led_on(led); + } else { + ergodox_right_led_off(led); + } +} + +inline void ergodox_led_all_set(uint8_t n) { + ergodox_right_led_1_set(n); + ergodox_right_led_2_set(n); + ergodox_right_led_3_set(n); +} + #define KEYMAP( \ A80, A70, A60, A50, A40, A30, A20, \ A81, A71, A61, A51, A41, A31, A21, \ -- cgit v1.2.3-24-g4f1b 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(-) 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-24-g4f1b From 1641743b9d9800a4a95ad12c77e1e90aa462347e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 9 Jul 2016 11:27:06 +0300 Subject: Change _delay_ms to wait_ms in algernon keymap --- keyboards/ergodox/keymaps/algernon/keymap.c | 2433 ++++++++++++++------------- 1 file changed, 1217 insertions(+), 1216 deletions(-) diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c index 1ebcf528b..6a14ef467 100644 --- a/keyboards/ergodox/keymaps/algernon/keymap.c +++ b/keyboards/ergodox/keymaps/algernon/keymap.c @@ -1,1216 +1,1217 @@ -/* - * algernon's ErgoDox EZ layout, please see the readme.md file! - */ - -#include "ergodox.h" -#include "led.h" -#include "debug.h" -#include "action_layer.h" -#include "action_util.h" -#include "mousekey.h" -#include "timer.h" -#include "keymap_plover.h" -#include "eeconfig.h" - -/* Layers */ - -enum { - BASE = 0, - ADORE, - ARRW, - APPSEL, - HUN, - NMDIA, - OHLFT, - OHRGT, - PLVR, -}; - -/* Macros */ - -enum { - NONE = 0, - // Buttons that do extra stuff - A_GUI, - A_PLVR, - A_ESC, - A_MPN, - - // Function / number keys - KF_1, // 1, F1 - KF_2, // 2, F2 - KF_3, // ... - KF_4, - KF_5, - KF_6, - KF_7, - KF_8, - KF_9, - KF_10, - KF_11, // =, F11 - - // Application select keys - APP_SLK, // Slack - APP_EMCS, // Emacs - APP_TERM, // Terminal - APP_CHRM, // Chrome - APP_MSIC, // Music - - // Diagonal mouse movement - A_MUL, - A_MUR, - A_MDL, - A_MDR, - - // Hungarian layer keys - HU_AA, // à - HU_OO, // Ó - HU_EE, // É - HU_UU, // Ú - HU_II, // à - HU_OE, // Ö - HU_UE, // Ãœ - HU_OEE, // Å - HU_UEE, // Å° - - // One-handed layout specials - OH_BSSPC, - OH_ENTSFT, - OH_BASE, - OH_LEFT, - OH_RIGHT, -}; - -/* Fn keys */ - -enum { - F_BSE = 0, - F_HUN, - F_GUI, - F_SFT, - F_ALT, - F_CTRL -}; - -/* Custom keycodes */ - -enum { - CT_CLN = 0, - CT_MNS, - CT_TA, -}; - -/* States & timers */ - -uint16_t gui_timer = 0; - -uint16_t kf_timers[12]; - -uint16_t oh_base_timer = 0; -uint16_t oh_bsspc_timer = 0; -uint16_t oh_entsft_timer = 0; - -#define OH_BLINK_INTERVAL 500 - -uint8_t oh_left_blink = 0; -uint16_t oh_left_blink_timer = 0; -uint8_t oh_right_blink = 0; -uint16_t oh_right_blink_timer = 0; - -#if KEYLOGGER_ENABLE -bool log_enable = false; -#endif - -bool time_travel = false; - -/* The Keymap */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Base Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | - * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | : | | - | | | | | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | 1HND | - * ,------|------|------| |------+------+------. - * | | | Ctrl | | LEAD | | | - * |Backsp|LShift|------| |------| Enter| Space| - * | | | ESC | | HUN | | | - * `--------------------' `--------------------' - */ -[BASE] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) - - ,F(F_ALT),F(F_GUI) - ,F(F_CTRL) - ,KC_BSPC,F(F_SFT),M(A_ESC) - - // right hand - ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS - ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL - ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP - ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,OSL(NMDIA),M(OH_LEFT) - ,KC_LEAD - ,F(F_HUN) ,KC_ENT ,KC_SPC - ), - -/* Keymap 1: Adore layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | , | . | L | W | M | [ | | ] | F | H | C | P | Y | \ | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = / Arrow | - * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| / | Z | ' | K | X | | | | B | G | V | J | Q | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | : | | - | | | | | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | 1HND | - * ,------|------|------| |------+------+------. - * | | | Ctrl | | LEAD | | | - * |Backsp|LShift|------| |------| Enter| Space| - * | | | ESC | | HUN | | | - * `--------------------' `--------------------' - */ -[ADORE] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC -,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U -,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) - - ,F(F_ALT),F(F_GUI) - ,F(F_CTRL) - ,KC_BSPC,F(F_SFT),M(A_ESC) - - // right hand - ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS - ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL - ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP - ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,OSL(NMDIA),M(OH_LEFT) - ,KC_LEAD - ,F(F_HUN) ,KC_ENT ,KC_SPC - ), - -/* Keymap 2: Arrow layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | Home | Up | End | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | Left | Down | Rght | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| PgUp | PgDn | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[ARRW] = KEYMAP( -// left hand - KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_HOME ,KC_UP ,KC_END ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_PGUP ,KC_PGDN - ), - -/* Keymap 3: Application select layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | |Music |Slack |Emacs |Term |Chrome| | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[APPSEL] = KEYMAP( -// left hand - KC_TRNS ,M(APP_MSIC),M(APP_SLK),M(APP_EMCS),M(APP_TERM),M(APP_CHRM),KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - ), - - -/* Keymap 4: Hungarian Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | Å | | Å° | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | à | Ó | É | Ú | à |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | Ö | | Ãœ | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | BASE | | | - * `--------------------' `--------------------' - */ - -[HUN] = KEYMAP( -// left hand - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,M(HU_OEE),KC_NO ,M(HU_UEE),KC_NO ,KC_NO -,KC_NO ,M(HU_AA),M(HU_OO) ,M(HU_EE),M(HU_UU) ,M(HU_II) -,KC_NO ,KC_NO ,M(HU_OE) ,KC_NO ,M(HU_UE) ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,F(F_BSE),KC_TRNS ,KC_TRNS - ), - -/* Keymap 5: Navigation & Media layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | MS Slow | | | | | |ScrLCK| |ScrLCK| | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | MS Normal | | Home | Up | PgUp | | | |Scroll| |MsUpL | MsUp |MsUpR | |PrintScreen| - * |-----------+------+------+------+------+------| | | Up |------+------+------+------+------+-----------| - * | MS Fast | | Left | Down | Right| |------| |------| |MsLeft| MsDn |MsRght| | | - * |-----------+------+------+------+------+------| | |Scroll|------+------+------+------+------+-----------| - * | Play/Pause| | End | Down | PgDn | | | | Down | |MsDnL | MsDn |MsDnR | | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Mute | VlUp | | BASE | MClk | - * ,------|------|------| |------+------+------. - * | | | VlDn | | Prev |Left |Right | - * | SPC | Enter|------| |------| Click| Click| - * | | | ESC | | Next | | | - * `--------------------' `--------------------' - */ -[NMDIA] = KEYMAP( -// left hand - KC_ACL0 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LGUI(KC_L) -,KC_ACL1 ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_NO -,KC_ACL2 ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO -,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_MUTE ,KC_VOLU - ,KC_VOLD - ,KC_SPC,KC_ENTER,M(A_ESC) - - // right hand - ,LGUI(KC_L),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_WH_U ,KC_NO ,M(A_MUL),KC_MS_U ,M(A_MUR),KC_NO ,KC_PSCR - ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO - ,KC_WH_D ,KC_NO ,M(A_MDL),KC_MS_D ,M(A_MDR),KC_NO ,KC_MSTP - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_TRNS ,KC_MS_BTN3 - ,KC_MPRV - ,KC_MNXT ,KC_BTN1 ,KC_BTN2 - ), - -/* Keymap 6: One-handed, left side - * - * ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |A BSE| - * |-----------+------+------+------+------+-------------| - * | Tab | ' | , | . | P | Y | [ | - * |-----------+------+------+------+------+------| | - * | - | A | O | E | U | I |------| - * |-----------+------+------+------+------+------| ( | - * | Play/Pause| ; | Q | J | K | X | | - * `-----------+------+------+------+------+-------------' - * | Home | End | Down | Up | ESC | - * `-----------------------------------' - * ,-------------. - * | LAlt | GUI | - * ,------|------|------| - * |BackSp|LShift| Ctrl | - * | | |------| - * |Space |Enter |OTHER | - * `--------------------' - */ -[OHLFT] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,M(OH_BASE) -,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_ESC) - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_RIGHT) - - // right hand - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - ), - -/* Keymap 7: One-handed, right side - * - * ,-----------------------------------------------------. - * | = F11 | 0 F10| 9 F9 | 8 F8 | 7 F7 | 6 F6 |A BSE| - * |-----------+------+------+------+------+-------------| - * | / | L | R | C | G | F | ] | - * |-----------+------+------+------+------+------| | - * | \ | S | N | T | H | D |------| - * |-----------+------+------+------+------+------| ) | - * | Stop | Z | V | W | M | B | | - * `-----------+------+------+------+------+-------------' - * | PgDn | PgUp | Right| Left | ESC | - * `-----------------------------------' - * ,-------------. - * | LAlt | GUI | - * ,------|------|------| - * |BackSp|LShift| Ctrl | - * | | |------| - * |Space |Enter |OTHER | - * `--------------------' - */ -[OHRGT] = KEYMAP( -// left hand - M(KF_11) ,M(KF_10) ,M(KF_9) ,M(KF_8) ,M(KF_7) ,M(KF_6) ,M(OH_BASE) -,KC_SLSH ,KC_L ,KC_R ,KC_C ,KC_G ,KC_F ,KC_RBRC -,KC_BSLS ,KC_S ,KC_N ,KC_T ,KC_H ,KC_D -,KC_MSTP ,KC_Z ,KC_V ,KC_W ,KC_M ,KC_B ,KC_RPRN -,KC_PGDN ,KC_PGUP ,KC_RGHT ,KC_LEFT ,M(A_ESC) - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_LEFT) - - // right hand - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - ), - -/* Keymap 8: Steno for Plover - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | BASE | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | # | # | # | # | # | # | | # | # | # | # | # | # | # | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | T | P | H | |------| |------| | F | P | L | T | D | - * |--------+ S +------+------+------+ * | * | | * | * +------+------+------+------+--------| - * | | | K | W | R | | | | | | R | B | G | S | Z | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | A | O |------| |------| E | U | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[PLVR] = KEYMAP( -// left hand -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(A_PLVR), -KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, -KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, -KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - PV_A, PV_O, KC_NO, - - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, - PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, - PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO,PV_E, PV_U - ), - -}; - -const uint16_t PROGMEM fn_actions[] = { - [F_BSE] = ACTION_LAYER_CLEAR(ON_PRESS) - ,[F_HUN] = ACTION_LAYER_INVERT(HUN, ON_PRESS) - ,[F_GUI] = ACTION_MACRO_TAP(A_GUI) - ,[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT) - ,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT) - ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) -}; - -void toggle_steno(int pressed) -{ - uint8_t layer = biton32(layer_state); - - if (pressed) { - if (layer != PLVR) layer_on(PLVR); else layer_off(PLVR); - - register_code(PV_LP); - register_code(PV_LH); - register_code(PV_LR); - register_code(PV_O); - register_code(PV_RL); - register_code(PV_RG); - } else { - unregister_code(PV_LP); - unregister_code(PV_LH); - unregister_code(PV_LR); - unregister_code(PV_O); - unregister_code(PV_RL); - unregister_code(PV_RG); - } -} - -macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) -{ - uint8_t need_shift = 0; - uint8_t hold_shift = 0; - - if (!record->event.pressed) - return MACRO_NONE; - - layer_off (HUN); - - if (keyboard_report->mods & MOD_BIT (KC_LSFT)) { - hold_shift = 1; - need_shift = 1; - unregister_code (KC_LSFT); - } - if ((get_oneshot_mods () & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out ()) { - need_shift = 1; - hold_shift = 0; - unregister_code (KC_LSFT); - } - - clear_oneshot_mods (); - - register_code (KC_RALT); - unregister_code (KC_RALT); - if (accent == (KC_DQT)) { - register_code (KC_RSFT); - } - register_code (accent); - unregister_code (accent); - if (need_shift && accent != (KC_DQT)) { - register_code (KC_RSFT); - } else if (accent == (KC_DQT) && !need_shift) { - unregister_code (KC_RSFT); - } - register_code (hun_char); - unregister_code (hun_char); - if (need_shift || accent == (KC_DQT)) - unregister_code (KC_RSFT); - if (hold_shift) - register_code (KC_LSFT); - - return MACRO_NONE; -} - -void ang_handle_kf (keyrecord_t *record, uint8_t id) -{ - uint8_t code = id - KF_1; - - if (record->event.pressed) { - kf_timers[code] = timer_read (); - } else { - uint8_t kc; - - if (timer_elapsed (kf_timers[code]) > TAPPING_TERM) { - // Long press - kc = KC_F1 + code; - } else { - if (id == KF_11) - kc = KC_EQL; - else - kc = KC_1 + code; - } - - register_code (kc); - unregister_code (kc); - } -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case A_ESC: - if (record->event.pressed) { - if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) { - clear_oneshot_mods (); - } else { - register_code (KC_ESC); - } - layer_off (HUN); - } else { - unregister_code (KC_ESC); - } - break; - - case A_MPN: - if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || - ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { - int oneshot = ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out()); - - if (oneshot) - clear_oneshot_mods (); - unregister_code (KC_LSFT); - - register_code (KC_MPRV); - unregister_code (KC_MPRV); - - if (!oneshot) - register_code (KC_LSFT); - } else { - return MACRO (T(MNXT), END); - } - } - break; - - /* Hungarian layer */ - case HU_AA: - return ang_do_hun (record, KC_QUOT, KC_A); - case HU_OO: - return ang_do_hun (record, KC_QUOT, KC_O); - case HU_EE: - return ang_do_hun (record, KC_QUOT, KC_E); - case HU_UU: - return ang_do_hun (record, KC_QUOT, KC_U); - case HU_II: - return ang_do_hun (record, KC_QUOT, KC_I); - case HU_OE: - return ang_do_hun (record, KC_DQT, KC_O); - case HU_UE: - return ang_do_hun (record, KC_DQT, KC_U); - case HU_OEE: - return ang_do_hun (record, KC_EQL, KC_O); - case HU_UEE: - return ang_do_hun (record, KC_EQL, KC_U); - - /* Mouse movement */ - case A_MUL: - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_LEFT); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_LEFT); - } - mousekey_send(); - break; - - case A_MUR: - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_RIGHT); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_RIGHT); - } - mousekey_send(); - break; - - case A_MDL: - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_LEFT); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_LEFT); - } - mousekey_send(); - break; - - case A_MDR: - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_RIGHT); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_RIGHT); - } - mousekey_send(); - break; - - /* Plover base */ - case A_PLVR: - toggle_steno(record->event.pressed); - break; - - /* GUI & AppSel */ - case A_GUI: - if (record->event.pressed) { - register_code (KC_LGUI); - if (record->tap.count && !record->tap.interrupted) { - if (record->tap.count >= 2) { - register_code (KC_W); - layer_on (APPSEL); - set_oneshot_layer (APPSEL, ONESHOT_START); - } - } else { - record->tap.count = 0; - } - gui_timer = 0; - } else { - if (record->tap.count >= 2) - { - unregister_code (KC_W); - clear_oneshot_layer_state (ONESHOT_PRESSED); - } - gui_timer = timer_read (); - } - break; - - case APP_SLK: - return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); - - case APP_EMCS: - return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(ENT), END); - - case APP_TERM: - return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); - - case APP_CHRM: - return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END); - - case APP_MSIC: - return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); - - /* Function keys */ - case KF_1 ... KF_11: - ang_handle_kf (record, id); - break; - - /* 1HAND layout */ - case OH_BASE: - if (record->event.pressed) { - oh_base_timer = timer_read (); - } else { - if (timer_elapsed (oh_base_timer) > TAPPING_TERM) { - layer_clear (); - } else { - return MACRO (T(APP), END); - } - } - break; - - case OH_BSSPC: - if (record->event.pressed) { - oh_bsspc_timer = timer_read (); - } else { - if (timer_elapsed (oh_bsspc_timer) > TAPPING_TERM) { - return MACRO (T(BSPC), END); - } else { - return MACRO (T(SPC), END); - } - } - break; - - case OH_ENTSFT: - if (record->event.pressed) { - oh_entsft_timer = timer_read (); - } else { - if (timer_elapsed (oh_entsft_timer) > TAPPING_TERM) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT)) - unregister_code (KC_LSFT); - else - register_code (KC_LSFT); - } else { - return MACRO (T(ENT), END); - } - } - break; - - case OH_LEFT: - if (record->event.pressed) { - layer_move (OHLFT); - oh_left_blink = 1; - oh_left_blink_timer = timer_read (); - ergodox_right_led_1_on (); - } - break; - - case OH_RIGHT: - if (record->event.pressed) { - layer_move (OHRGT); - oh_right_blink = 1; - oh_right_blink_timer = timer_read (); - ergodox_right_led_3_on (); - } - break; - } - return MACRO_NONE; -}; - -uint8_t is_adore = 0; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - uint8_t dl; - - ergodox_led_all_on(); - for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { - ergodox_led_all_set (i); - _delay_ms (5); - } - _delay_ms(1000); - for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { - ergodox_led_all_set (i); - _delay_ms (10); - } - ergodox_led_all_off(); - - if (!eeconfig_is_enabled()) - eeconfig_init(); - dl = eeconfig_read_default_layer (); - if (dl == (1UL << ADORE)) - is_adore = 1; -}; - -LEADER_EXTERNS(); - -void ang_do_unicode (void) { - register_code (KC_RCTL); - register_code (KC_RSFT); - register_code (KC_U); - unregister_code (KC_U); - unregister_code (KC_RSFT); - unregister_code (KC_RCTL); - _delay_ms (100); -} - -void ang_tap (uint16_t codes[]) { - for (int i = 0; codes[i] != 0; i++) { - register_code (codes[i]); - unregister_code (codes[i]); - _delay_ms (50); - } -} - -#define TAP_ONCE(code) \ - register_code (code); \ - unregister_code (code) - -void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_RSFT); - register_code (KC_SCLN); - } else if (state->count == 2) { - register_code (KC_SCLN); - } -} - -void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_SCLN); - unregister_code (KC_RSFT); - } else if (state->count == 2) { - unregister_code (KC_SCLN); - } -} - -void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_MINS); - } else if (state->count == 2) { - register_code (KC_RSFT); - register_code (KC_MINS); - } -} - -void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_MINS); - } else if (state->count == 2) { - unregister_code (KC_RSFT); - unregister_code (KC_MINS); - } -} - -typedef struct { - bool layer_toggle; - bool sticky; - bool finished_once; -} td_ta_state_t; - -void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { - td_ta_state_t *td_ta = (td_ta_state_t *) user_data; - - if (td_ta->finished_once) { - return; - } - - if (td_ta->sticky) { - td_ta->sticky = false; - td_ta->layer_toggle = false; - layer_off (ARRW); - return; - } - - td_ta->finished_once = true; - if (state->count == 1 && !state->pressed) { - register_code (KC_TAB); - td_ta->sticky = false; - td_ta->layer_toggle = false; - } else { - td_ta->layer_toggle = true; - layer_on (ARRW); - td_ta->sticky = (state->count == 2); - } -} - -void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { - td_ta_state_t *td_ta = (td_ta_state_t *) user_data; - - if (!td_ta->layer_toggle) - unregister_code (KC_TAB); - if (!td_ta->sticky) - layer_off (ARRW); - - td_ta->finished_once = false; -} - -const qk_tap_dance_action_t tap_dance_actions[] = { - [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) - ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) - ,[CT_TA] = { - .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, - .user_data = (void *)&((td_ta_state_t) { false, false, false }) - } -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) - unregister_code (KC_LGUI); - - if (layer != OHLFT) - oh_left_blink = 0; - if (layer != OHRGT) - oh_right_blink = 0; - - if (layer == HUN) { - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - } else if (layer == NMDIA) { - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - } else if (layer == PLVR) { - ergodox_right_led_1_on (); - ergodox_right_led_2_on (); - ergodox_right_led_3_on (); - } else if (layer == ADORE) { - ergodox_right_led_1_on (); - ergodox_right_led_2_on (); - ergodox_right_led_3_on (); - - ergodox_right_led_2_set (LED_BRIGHTNESS_HI); - } - - if (layer == OHLFT || layer == OHRGT) { - ergodox_right_led_2_on(); - - if (oh_left_blink) { - if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL) { - if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) == 0) - ergodox_right_led_1_off (); - } - if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL * 2) { - ergodox_right_led_1_on (); - oh_left_blink_timer = timer_read (); - } - } - - if (oh_right_blink) { - if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL) { - if ((keyboard_report->mods & MOD_BIT(KC_LCTRL)) == 0) - ergodox_right_led_3_off (); - } - if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL * 2) { - ergodox_right_led_3_on (); - oh_right_blink_timer = timer_read (); - } - } - } - - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || - ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_1_set (LED_BRIGHTNESS_HI); - ergodox_right_led_1_on (); - } else { - ergodox_right_led_1_set (LED_BRIGHTNESS_LO); - if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) - ergodox_right_led_1_off (); - } - - if (keyboard_report->mods & MOD_BIT(KC_LALT) || - ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_2_set (LED_BRIGHTNESS_HI); - ergodox_right_led_2_on (); - } else { - ergodox_right_led_2_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) - ergodox_right_led_2_off (); - } - - if (keyboard_report->mods & MOD_BIT(KC_LCTRL) || - ((get_oneshot_mods() & MOD_BIT(KC_LCTRL)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_3_set (LED_BRIGHTNESS_HI); - ergodox_right_led_3_on (); - } else { - ergodox_right_led_3_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != PLVR && layer != ADORE) - ergodox_right_led_3_off (); - } - - LEADER_DICTIONARY() { - leading = false; - leader_end (); - -#if KEYLOGGER_ENABLE - SEQ_ONE_KEY (KC_D) { - ergodox_led_all_on(); - _delay_ms(100); - ergodox_led_all_off(); - log_enable = !log_enable; - } -#endif - - SEQ_ONE_KEY (KC_T) { - time_travel = !time_travel; - } - - SEQ_ONE_KEY (KC_U) { - ang_do_unicode (); - } - - SEQ_ONE_KEY (KC_V) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")"); - } - - SEQ_ONE_KEY (KC_L) { - /* λ */ - ang_do_unicode (); - - uint16_t codes[] = {KC_0, KC_3, KC_B, KC_B, KC_ENT, 0}; - ang_tap (codes); - } - - SEQ_ONE_KEY (KC_Y) { - uint16_t codes[] = {KC_BSLS, KC_O, KC_SLSH, 0}; - ang_tap (codes); - } - - SEQ_ONE_KEY (KC_S) { - ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); - TAP_ONCE (KC_BSLS); - register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); - ang_do_unicode (); TAP_ONCE (KC_3); TAP_ONCE (KC_0); TAP_ONCE (KC_C); TAP_ONCE (KC_4); TAP_ONCE (KC_SPC); - register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); - TAP_ONCE (KC_SLSH); - ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); - } - - SEQ_TWO_KEYS (KC_W, KC_M) { - register_code (KC_LALT); - register_code (KC_F2); - unregister_code (KC_F2); - unregister_code (KC_LALT); - - _delay_ms (1000); - - uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; - ang_tap (codes); - register_code (KC_LGUI); - register_code (KC_UP); - unregister_code (KC_UP); - unregister_code (KC_LGUI); - } - - SEQ_ONE_KEY (KC_A) { - if (is_adore == 0) { - default_layer_and (0); - default_layer_or ((1UL << ADORE)); - eeconfig_update_default_layer ((1UL << ADORE)); - is_adore = 1; - - ergodox_led_all_off (); - ergodox_right_led_3_on (); - _delay_ms (100); - ergodox_right_led_2_on (); - _delay_ms (100); - ergodox_right_led_3_off (); - ergodox_right_led_1_on (); - _delay_ms (100); - ergodox_right_led_2_off (); - _delay_ms (100); - ergodox_right_led_1_off (); - } else { - is_adore = 0; - default_layer_and (0); - default_layer_or (1UL << BASE); - eeconfig_update_default_layer ((1UL << BASE)); - - ergodox_led_all_off (); - ergodox_right_led_1_on (); - _delay_ms (100); - ergodox_right_led_2_on (); - _delay_ms (100); - ergodox_right_led_1_off (); - ergodox_right_led_3_on (); - _delay_ms (100); - ergodox_right_led_2_off (); - _delay_ms (100); - ergodox_right_led_3_off (); - } - } - } -} - -static uint16_t last4[4]; - -bool process_record_user (uint16_t keycode, keyrecord_t *record) { -#if KEYLOGGER_ENABLE - uint8_t layer = biton32(layer_state); - - if (log_enable && layer == BASE) { - xprintf ("KL: col=%d, row=%d\n", record->event.key.col, - record->event.key.row); - } -#endif - - if (time_travel && !record->event.pressed) { - uint8_t p; - - // shift cache one to the left - for (p = 0; p < 3; p++) { - last4[p] = last4[p + 1]; - } - last4[3] = keycode; - - if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { - uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; - ang_tap (codes); - register_code (KC_RSFT); - register_code (KC_EQL); - unregister_code (KC_EQL); - unregister_code (KC_RSFT); - - uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; - ang_tap (codes2); - - return false; - } - } - - return true; -} +/* + * algernon's ErgoDox EZ layout, please see the readme.md file! + */ + +#include "ergodox.h" +#include "led.h" +#include "debug.h" +#include "action_layer.h" +#include "action_util.h" +#include "mousekey.h" +#include "timer.h" +#include "keymap_plover.h" +#include "eeconfig.h" +#include "wait.h" + +/* Layers */ + +enum { + BASE = 0, + ADORE, + ARRW, + APPSEL, + HUN, + NMDIA, + OHLFT, + OHRGT, + PLVR, +}; + +/* Macros */ + +enum { + NONE = 0, + // Buttons that do extra stuff + A_GUI, + A_PLVR, + A_ESC, + A_MPN, + + // Function / number keys + KF_1, // 1, F1 + KF_2, // 2, F2 + KF_3, // ... + KF_4, + KF_5, + KF_6, + KF_7, + KF_8, + KF_9, + KF_10, + KF_11, // =, F11 + + // Application select keys + APP_SLK, // Slack + APP_EMCS, // Emacs + APP_TERM, // Terminal + APP_CHRM, // Chrome + APP_MSIC, // Music + + // Diagonal mouse movement + A_MUL, + A_MUR, + A_MDL, + A_MDR, + + // Hungarian layer keys + HU_AA, // à + HU_OO, // Ó + HU_EE, // É + HU_UU, // Ú + HU_II, // à + HU_OE, // Ö + HU_UE, // Ãœ + HU_OEE, // Å + HU_UEE, // Å° + + // One-handed layout specials + OH_BSSPC, + OH_ENTSFT, + OH_BASE, + OH_LEFT, + OH_RIGHT, +}; + +/* Fn keys */ + +enum { + F_BSE = 0, + F_HUN, + F_GUI, + F_SFT, + F_ALT, + F_CTRL +}; + +/* Custom keycodes */ + +enum { + CT_CLN = 0, + CT_MNS, + CT_TA, +}; + +/* States & timers */ + +uint16_t gui_timer = 0; + +uint16_t kf_timers[12]; + +uint16_t oh_base_timer = 0; +uint16_t oh_bsspc_timer = 0; +uint16_t oh_entsft_timer = 0; + +#define OH_BLINK_INTERVAL 500 + +uint8_t oh_left_blink = 0; +uint16_t oh_left_blink_timer = 0; +uint8_t oh_right_blink = 0; +uint16_t oh_right_blink_timer = 0; + +#if KEYLOGGER_ENABLE +bool log_enable = false; +#endif + +bool time_travel = false; + +/* The Keymap */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Keymap 0: Base Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | + * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| + * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | : | | - | | | | | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | LAlt | GUI | | MDIA | 1HND | + * ,------|------|------| |------+------+------. + * | | | Ctrl | | LEAD | | | + * |Backsp|LShift|------| |------| Enter| Space| + * | | | ESC | | HUN | | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) + + ,F(F_ALT),F(F_GUI) + ,F(F_CTRL) + ,KC_BSPC,F(F_SFT),M(A_ESC) + + // right hand + ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS + ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL + ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP + ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,OSL(NMDIA),M(OH_LEFT) + ,KC_LEAD + ,F(F_HUN) ,KC_ENT ,KC_SPC + ), + +/* Keymap 1: Adore layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | Next/Prev | , | . | L | W | M | [ | | ] | F | H | C | P | Y | \ | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = / Arrow | + * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| + * | Play/Pause| / | Z | ' | K | X | | | | B | G | V | J | Q | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | : | | - | | | | | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | LAlt | GUI | | MDIA | 1HND | + * ,------|------|------| |------+------+------. + * | | | Ctrl | | LEAD | | | + * |Backsp|LShift|------| |------| Enter| Space| + * | | | ESC | | HUN | | | + * `--------------------' `--------------------' + */ +[ADORE] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U +,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) + + ,F(F_ALT),F(F_GUI) + ,F(F_CTRL) + ,KC_BSPC,F(F_SFT),M(A_ESC) + + // right hand + ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS + ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL + ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP + ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,OSL(NMDIA),M(OH_LEFT) + ,KC_LEAD + ,F(F_HUN) ,KC_ENT ,KC_SPC + ), + +/* Keymap 2: Arrow layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | Home | Up | End | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | Left | Down | Rght | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| PgUp | PgDn | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[ARRW] = KEYMAP( +// left hand + KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_HOME ,KC_UP ,KC_END ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_PGUP ,KC_PGDN + ), + +/* Keymap 3: Application select layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | |Music |Slack |Emacs |Term |Chrome| | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[APPSEL] = KEYMAP( +// left hand + KC_TRNS ,M(APP_MSIC),M(APP_SLK),M(APP_EMCS),M(APP_TERM),M(APP_CHRM),KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + ), + + +/* Keymap 4: Hungarian Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | Å | | Å° | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | à | Ó | É | Ú | à |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | Ö | | Ãœ | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | BASE | | | + * `--------------------' `--------------------' + */ + +[HUN] = KEYMAP( +// left hand + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,M(HU_OEE),KC_NO ,M(HU_UEE),KC_NO ,KC_NO +,KC_NO ,M(HU_AA),M(HU_OO) ,M(HU_EE),M(HU_UU) ,M(HU_II) +,KC_NO ,KC_NO ,M(HU_OE) ,KC_NO ,M(HU_UE) ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,F(F_BSE),KC_TRNS ,KC_TRNS + ), + +/* Keymap 5: Navigation & Media layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | MS Slow | | | | | |ScrLCK| |ScrLCK| | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | MS Normal | | Home | Up | PgUp | | | |Scroll| |MsUpL | MsUp |MsUpR | |PrintScreen| + * |-----------+------+------+------+------+------| | | Up |------+------+------+------+------+-----------| + * | MS Fast | | Left | Down | Right| |------| |------| |MsLeft| MsDn |MsRght| | | + * |-----------+------+------+------+------+------| | |Scroll|------+------+------+------+------+-----------| + * | Play/Pause| | End | Down | PgDn | | | | Down | |MsDnL | MsDn |MsDnR | | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Mute | VlUp | | BASE | MClk | + * ,------|------|------| |------+------+------. + * | | | VlDn | | Prev |Left |Right | + * | SPC | Enter|------| |------| Click| Click| + * | | | ESC | | Next | | | + * `--------------------' `--------------------' + */ +[NMDIA] = KEYMAP( +// left hand + KC_ACL0 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LGUI(KC_L) +,KC_ACL1 ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_NO +,KC_ACL2 ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO +,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_MUTE ,KC_VOLU + ,KC_VOLD + ,KC_SPC,KC_ENTER,M(A_ESC) + + // right hand + ,LGUI(KC_L),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_WH_U ,KC_NO ,M(A_MUL),KC_MS_U ,M(A_MUR),KC_NO ,KC_PSCR + ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO + ,KC_WH_D ,KC_NO ,M(A_MDL),KC_MS_D ,M(A_MDR),KC_NO ,KC_MSTP + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_TRNS ,KC_MS_BTN3 + ,KC_MPRV + ,KC_MNXT ,KC_BTN1 ,KC_BTN2 + ), + +/* Keymap 6: One-handed, left side + * + * ,-----------------------------------------------------. + * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |A BSE| + * |-----------+------+------+------+------+-------------| + * | Tab | ' | , | . | P | Y | [ | + * |-----------+------+------+------+------+------| | + * | - | A | O | E | U | I |------| + * |-----------+------+------+------+------+------| ( | + * | Play/Pause| ; | Q | J | K | X | | + * `-----------+------+------+------+------+-------------' + * | Home | End | Down | Up | ESC | + * `-----------------------------------' + * ,-------------. + * | LAlt | GUI | + * ,------|------|------| + * |BackSp|LShift| Ctrl | + * | | |------| + * |Space |Enter |OTHER | + * `--------------------' + */ +[OHLFT] = KEYMAP( +// left hand + KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,M(OH_BASE) +,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN +,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_ESC) + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_RIGHT) + + // right hand + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_NO ,KC_NO + ), + +/* Keymap 7: One-handed, right side + * + * ,-----------------------------------------------------. + * | = F11 | 0 F10| 9 F9 | 8 F8 | 7 F7 | 6 F6 |A BSE| + * |-----------+------+------+------+------+-------------| + * | / | L | R | C | G | F | ] | + * |-----------+------+------+------+------+------| | + * | \ | S | N | T | H | D |------| + * |-----------+------+------+------+------+------| ) | + * | Stop | Z | V | W | M | B | | + * `-----------+------+------+------+------+-------------' + * | PgDn | PgUp | Right| Left | ESC | + * `-----------------------------------' + * ,-------------. + * | LAlt | GUI | + * ,------|------|------| + * |BackSp|LShift| Ctrl | + * | | |------| + * |Space |Enter |OTHER | + * `--------------------' + */ +[OHRGT] = KEYMAP( +// left hand + M(KF_11) ,M(KF_10) ,M(KF_9) ,M(KF_8) ,M(KF_7) ,M(KF_6) ,M(OH_BASE) +,KC_SLSH ,KC_L ,KC_R ,KC_C ,KC_G ,KC_F ,KC_RBRC +,KC_BSLS ,KC_S ,KC_N ,KC_T ,KC_H ,KC_D +,KC_MSTP ,KC_Z ,KC_V ,KC_W ,KC_M ,KC_B ,KC_RPRN +,KC_PGDN ,KC_PGUP ,KC_RGHT ,KC_LEFT ,M(A_ESC) + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_LEFT) + + // right hand + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_NO ,KC_NO + ), + +/* Keymap 8: Steno for Plover + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | BASE | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | # | # | # | # | # | # | | # | # | # | # | # | # | # | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | T | P | H | |------| |------| | F | P | L | T | D | + * |--------+ S +------+------+------+ * | * | | * | * +------+------+------+------+--------| + * | | | K | W | R | | | | | | R | B | G | S | Z | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | A | O |------| |------| E | U | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( +// left hand +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(A_PLVR), +KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, +KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, +KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + PV_A, PV_O, KC_NO, + + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, + PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, + PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO,PV_E, PV_U + ), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [F_BSE] = ACTION_LAYER_CLEAR(ON_PRESS) + ,[F_HUN] = ACTION_LAYER_INVERT(HUN, ON_PRESS) + ,[F_GUI] = ACTION_MACRO_TAP(A_GUI) + ,[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT) + ,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT) + ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) +}; + +void toggle_steno(int pressed) +{ + uint8_t layer = biton32(layer_state); + + if (pressed) { + if (layer != PLVR) layer_on(PLVR); else layer_off(PLVR); + + register_code(PV_LP); + register_code(PV_LH); + register_code(PV_LR); + register_code(PV_O); + register_code(PV_RL); + register_code(PV_RG); + } else { + unregister_code(PV_LP); + unregister_code(PV_LH); + unregister_code(PV_LR); + unregister_code(PV_O); + unregister_code(PV_RL); + unregister_code(PV_RG); + } +} + +macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) +{ + uint8_t need_shift = 0; + uint8_t hold_shift = 0; + + if (!record->event.pressed) + return MACRO_NONE; + + layer_off (HUN); + + if (keyboard_report->mods & MOD_BIT (KC_LSFT)) { + hold_shift = 1; + need_shift = 1; + unregister_code (KC_LSFT); + } + if ((get_oneshot_mods () & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out ()) { + need_shift = 1; + hold_shift = 0; + unregister_code (KC_LSFT); + } + + clear_oneshot_mods (); + + register_code (KC_RALT); + unregister_code (KC_RALT); + if (accent == (KC_DQT)) { + register_code (KC_RSFT); + } + register_code (accent); + unregister_code (accent); + if (need_shift && accent != (KC_DQT)) { + register_code (KC_RSFT); + } else if (accent == (KC_DQT) && !need_shift) { + unregister_code (KC_RSFT); + } + register_code (hun_char); + unregister_code (hun_char); + if (need_shift || accent == (KC_DQT)) + unregister_code (KC_RSFT); + if (hold_shift) + register_code (KC_LSFT); + + return MACRO_NONE; +} + +void ang_handle_kf (keyrecord_t *record, uint8_t id) +{ + uint8_t code = id - KF_1; + + if (record->event.pressed) { + kf_timers[code] = timer_read (); + } else { + uint8_t kc; + + if (timer_elapsed (kf_timers[code]) > TAPPING_TERM) { + // Long press + kc = KC_F1 + code; + } else { + if (id == KF_11) + kc = KC_EQL; + else + kc = KC_1 + code; + } + + register_code (kc); + unregister_code (kc); + } +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case A_ESC: + if (record->event.pressed) { + if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) { + clear_oneshot_mods (); + } else { + register_code (KC_ESC); + } + layer_off (HUN); + } else { + unregister_code (KC_ESC); + } + break; + + case A_MPN: + if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + int oneshot = ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out()); + + if (oneshot) + clear_oneshot_mods (); + unregister_code (KC_LSFT); + + register_code (KC_MPRV); + unregister_code (KC_MPRV); + + if (!oneshot) + register_code (KC_LSFT); + } else { + return MACRO (T(MNXT), END); + } + } + break; + + /* Hungarian layer */ + case HU_AA: + return ang_do_hun (record, KC_QUOT, KC_A); + case HU_OO: + return ang_do_hun (record, KC_QUOT, KC_O); + case HU_EE: + return ang_do_hun (record, KC_QUOT, KC_E); + case HU_UU: + return ang_do_hun (record, KC_QUOT, KC_U); + case HU_II: + return ang_do_hun (record, KC_QUOT, KC_I); + case HU_OE: + return ang_do_hun (record, KC_DQT, KC_O); + case HU_UE: + return ang_do_hun (record, KC_DQT, KC_U); + case HU_OEE: + return ang_do_hun (record, KC_EQL, KC_O); + case HU_UEE: + return ang_do_hun (record, KC_EQL, KC_U); + + /* Mouse movement */ + case A_MUL: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MUR: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + case A_MDL: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MDR: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + /* Plover base */ + case A_PLVR: + toggle_steno(record->event.pressed); + break; + + /* GUI & AppSel */ + case A_GUI: + if (record->event.pressed) { + register_code (KC_LGUI); + if (record->tap.count && !record->tap.interrupted) { + if (record->tap.count >= 2) { + register_code (KC_W); + layer_on (APPSEL); + set_oneshot_layer (APPSEL, ONESHOT_START); + } + } else { + record->tap.count = 0; + } + gui_timer = 0; + } else { + if (record->tap.count >= 2) + { + unregister_code (KC_W); + clear_oneshot_layer_state (ONESHOT_PRESSED); + } + gui_timer = timer_read (); + } + break; + + case APP_SLK: + return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); + + case APP_EMCS: + return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(ENT), END); + + case APP_TERM: + return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); + + case APP_CHRM: + return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END); + + case APP_MSIC: + return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); + + /* Function keys */ + case KF_1 ... KF_11: + ang_handle_kf (record, id); + break; + + /* 1HAND layout */ + case OH_BASE: + if (record->event.pressed) { + oh_base_timer = timer_read (); + } else { + if (timer_elapsed (oh_base_timer) > TAPPING_TERM) { + layer_clear (); + } else { + return MACRO (T(APP), END); + } + } + break; + + case OH_BSSPC: + if (record->event.pressed) { + oh_bsspc_timer = timer_read (); + } else { + if (timer_elapsed (oh_bsspc_timer) > TAPPING_TERM) { + return MACRO (T(BSPC), END); + } else { + return MACRO (T(SPC), END); + } + } + break; + + case OH_ENTSFT: + if (record->event.pressed) { + oh_entsft_timer = timer_read (); + } else { + if (timer_elapsed (oh_entsft_timer) > TAPPING_TERM) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT)) + unregister_code (KC_LSFT); + else + register_code (KC_LSFT); + } else { + return MACRO (T(ENT), END); + } + } + break; + + case OH_LEFT: + if (record->event.pressed) { + layer_move (OHLFT); + oh_left_blink = 1; + oh_left_blink_timer = timer_read (); + ergodox_right_led_1_on (); + } + break; + + case OH_RIGHT: + if (record->event.pressed) { + layer_move (OHRGT); + oh_right_blink = 1; + oh_right_blink_timer = timer_read (); + ergodox_right_led_3_on (); + } + break; + } + return MACRO_NONE; +}; + +uint8_t is_adore = 0; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + uint8_t dl; + + ergodox_led_all_on(); + for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { + ergodox_led_all_set (i); + wait_ms (5); + } + wait_ms(1000); + for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { + ergodox_led_all_set (i); + wait_ms (10); + } + ergodox_led_all_off(); + + if (!eeconfig_is_enabled()) + eeconfig_init(); + dl = eeconfig_read_default_layer (); + if (dl == (1UL << ADORE)) + is_adore = 1; +}; + +LEADER_EXTERNS(); + +void ang_do_unicode (void) { + register_code (KC_RCTL); + register_code (KC_RSFT); + register_code (KC_U); + unregister_code (KC_U); + unregister_code (KC_RSFT); + unregister_code (KC_RCTL); + wait_ms (100); +} + +void ang_tap (uint16_t codes[]) { + for (int i = 0; codes[i] != 0; i++) { + register_code (codes[i]); + unregister_code (codes[i]); + wait_ms (50); + } +} + +#define TAP_ONCE(code) \ + register_code (code); \ + unregister_code (code) + +void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_RSFT); + register_code (KC_SCLN); + } else if (state->count == 2) { + register_code (KC_SCLN); + } +} + +void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_SCLN); + unregister_code (KC_RSFT); + } else if (state->count == 2) { + unregister_code (KC_SCLN); + } +} + +void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_MINS); + } else if (state->count == 2) { + register_code (KC_RSFT); + register_code (KC_MINS); + } +} + +void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_MINS); + } else if (state->count == 2) { + unregister_code (KC_RSFT); + unregister_code (KC_MINS); + } +} + +typedef struct { + bool layer_toggle; + bool sticky; + bool finished_once; +} td_ta_state_t; + +void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (td_ta->finished_once) { + return; + } + + if (td_ta->sticky) { + td_ta->sticky = false; + td_ta->layer_toggle = false; + layer_off (ARRW); + return; + } + + td_ta->finished_once = true; + if (state->count == 1 && !state->pressed) { + register_code (KC_TAB); + td_ta->sticky = false; + td_ta->layer_toggle = false; + } else { + td_ta->layer_toggle = true; + layer_on (ARRW); + td_ta->sticky = (state->count == 2); + } +} + +void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (!td_ta->layer_toggle) + unregister_code (KC_TAB); + if (!td_ta->sticky) + layer_off (ARRW); + + td_ta->finished_once = false; +} + +const qk_tap_dance_action_t tap_dance_actions[] = { + [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) + ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) + ,[CT_TA] = { + .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, + .user_data = (void *)&((td_ta_state_t) { false, false, false }) + } +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) + unregister_code (KC_LGUI); + + if (layer != OHLFT) + oh_left_blink = 0; + if (layer != OHRGT) + oh_right_blink = 0; + + if (layer == HUN) { + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + } else if (layer == NMDIA) { + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + } else if (layer == PLVR) { + ergodox_right_led_1_on (); + ergodox_right_led_2_on (); + ergodox_right_led_3_on (); + } else if (layer == ADORE) { + ergodox_right_led_1_on (); + ergodox_right_led_2_on (); + ergodox_right_led_3_on (); + + ergodox_right_led_2_set (LED_BRIGHTNESS_HI); + } + + if (layer == OHLFT || layer == OHRGT) { + ergodox_right_led_2_on(); + + if (oh_left_blink) { + if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL) { + if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) == 0) + ergodox_right_led_1_off (); + } + if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL * 2) { + ergodox_right_led_1_on (); + oh_left_blink_timer = timer_read (); + } + } + + if (oh_right_blink) { + if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL) { + if ((keyboard_report->mods & MOD_BIT(KC_LCTRL)) == 0) + ergodox_right_led_3_off (); + } + if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL * 2) { + ergodox_right_led_3_on (); + oh_right_blink_timer = timer_read (); + } + } + } + + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_1_set (LED_BRIGHTNESS_HI); + ergodox_right_led_1_on (); + } else { + ergodox_right_led_1_set (LED_BRIGHTNESS_LO); + if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) + ergodox_right_led_1_off (); + } + + if (keyboard_report->mods & MOD_BIT(KC_LALT) || + ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_2_set (LED_BRIGHTNESS_HI); + ergodox_right_led_2_on (); + } else { + ergodox_right_led_2_set (LED_BRIGHTNESS_LO); + if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) + ergodox_right_led_2_off (); + } + + if (keyboard_report->mods & MOD_BIT(KC_LCTRL) || + ((get_oneshot_mods() & MOD_BIT(KC_LCTRL)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_3_set (LED_BRIGHTNESS_HI); + ergodox_right_led_3_on (); + } else { + ergodox_right_led_3_set (LED_BRIGHTNESS_LO); + if (layer != OHRGT && layer != HUN && layer != PLVR && layer != ADORE) + ergodox_right_led_3_off (); + } + + LEADER_DICTIONARY() { + leading = false; + leader_end (); + +#if KEYLOGGER_ENABLE + SEQ_ONE_KEY (KC_D) { + ergodox_led_all_on(); + wait_ms(100); + ergodox_led_all_off(); + log_enable = !log_enable; + } +#endif + + SEQ_ONE_KEY (KC_T) { + time_travel = !time_travel; + } + + SEQ_ONE_KEY (KC_U) { + ang_do_unicode (); + } + + SEQ_ONE_KEY (KC_V) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")"); + } + + SEQ_ONE_KEY (KC_L) { + /* λ */ + ang_do_unicode (); + + uint16_t codes[] = {KC_0, KC_3, KC_B, KC_B, KC_ENT, 0}; + ang_tap (codes); + } + + SEQ_ONE_KEY (KC_Y) { + uint16_t codes[] = {KC_BSLS, KC_O, KC_SLSH, 0}; + ang_tap (codes); + } + + SEQ_ONE_KEY (KC_S) { + ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); + TAP_ONCE (KC_BSLS); + register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + ang_do_unicode (); TAP_ONCE (KC_3); TAP_ONCE (KC_0); TAP_ONCE (KC_C); TAP_ONCE (KC_4); TAP_ONCE (KC_SPC); + register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); + TAP_ONCE (KC_SLSH); + ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); + } + + SEQ_TWO_KEYS (KC_W, KC_M) { + register_code (KC_LALT); + register_code (KC_F2); + unregister_code (KC_F2); + unregister_code (KC_LALT); + + wait_ms (1000); + + uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; + ang_tap (codes); + register_code (KC_LGUI); + register_code (KC_UP); + unregister_code (KC_UP); + unregister_code (KC_LGUI); + } + + SEQ_ONE_KEY (KC_A) { + if (is_adore == 0) { + default_layer_and (0); + default_layer_or ((1UL << ADORE)); + eeconfig_update_default_layer ((1UL << ADORE)); + is_adore = 1; + + ergodox_led_all_off (); + ergodox_right_led_3_on (); + wait_ms (100); + ergodox_right_led_2_on (); + wait_ms (100); + ergodox_right_led_3_off (); + ergodox_right_led_1_on (); + wait_ms (100); + ergodox_right_led_2_off (); + wait_ms (100); + ergodox_right_led_1_off (); + } else { + is_adore = 0; + default_layer_and (0); + default_layer_or (1UL << BASE); + eeconfig_update_default_layer ((1UL << BASE)); + + ergodox_led_all_off (); + ergodox_right_led_1_on (); + wait_ms (100); + ergodox_right_led_2_on (); + wait_ms (100); + ergodox_right_led_1_off (); + ergodox_right_led_3_on (); + wait_ms (100); + ergodox_right_led_2_off (); + wait_ms (100); + ergodox_right_led_3_off (); + } + } + } +} + +static uint16_t last4[4]; + +bool process_record_user (uint16_t keycode, keyrecord_t *record) { +#if KEYLOGGER_ENABLE + uint8_t layer = biton32(layer_state); + + if (log_enable && layer == BASE) { + xprintf ("KL: col=%d, row=%d\n", record->event.key.col, + record->event.key.row); + } +#endif + + if (time_travel && !record->event.pressed) { + uint8_t p; + + // shift cache one to the left + for (p = 0; p < 3; p++) { + last4[p] = last4[p + 1]; + } + last4[3] = keycode; + + if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { + uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; + ang_tap (codes); + register_code (KC_RSFT); + register_code (KC_EQL); + unregister_code (KC_EQL); + unregister_code (KC_RSFT); + + uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; + ang_tap (codes2); + + return false; + } + } + + return true; +} -- cgit v1.2.3-24-g4f1b From bf1c865c7a5d21cd7967bf676cafd18fc9f2254d Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 9 Jul 2016 20:58:19 +0300 Subject: Speed up ChibiOS keymap compilation By sharing the external library object files between the whole keyboard, instead of re-compiling them for each keymap. --- tmk_core/rules.mk | 50 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 17 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 2bf2a109f..c81fa6854 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -253,6 +253,14 @@ MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \ # Define all object files. OBJ = $(patsubst %.c,$(OBJDIR)/%.o,$(patsubst %.cpp,$(OBJDIR)/%.o,$(patsubst %.S,$(OBJDIR)/%.o,$(SRC)))) +# The files in the lib folder are shared between all keymaps, so generate that folder name by removing +# the keymap from the name +KBOBJDIR=$(subst _$(KEYMAP),,$(OBJDIR)) +# And fixup the object files to match +LIBOBJ = $(foreach v,$(OBJ),$(if $(findstring /lib/,$v),$v)) +NONLIBOBJ := $(filter-out $(LIBOBJ),$(OBJ)) +LIBOBJ := $(subst _$(KEYMAP)/,/,$(LIBOBJ)) +OBJ := $(LIBOBJ) $(NONLIBOBJ) # Define all listing files. LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst %.S,$(OBJDIR)/%.lst,$(SRC)))) @@ -370,20 +378,35 @@ BEGIN = gccversion check_submodule sizebefore $(eval CMD=$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)) @$(BUILD_CMD) +define GEN_OBJRULE # Compile: create object files from C source files. -$(OBJDIR)/%.o : %.c | $(BEGIN) - @mkdir -p $(@D) - @$(SILENT) || printf "$(MSG_COMPILING) $<" | $(AWK_CMD) - $(eval CMD=$(CC) -c $(ALL_CFLAGS) $< -o $@) - @$(BUILD_CMD) +$1/%.o : %.c | $(BEGIN) + @mkdir -p $$(@D) + @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) + $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$< -o $$@) + @$$(BUILD_CMD) # Compile: create object files from C++ source files. -$(OBJDIR)/%.o : %.cpp | $(BEGIN) - @mkdir -p $(@D) - @$(SILENT) || printf "$(MSG_COMPILING_CPP) $<" | $(AWK_CMD) - $(eval CMD=$(CC) -c $(ALL_CPPFLAGS) $< -o $@) +$1/%.o : %.cpp | $(BEGIN) + @mkdir -p $$(@D) + @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD) + $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$< -o $$@) @$(BUILD_CMD) +# Assemble: create object files from assembler source files. +$1/%.o : %.S | $(BEGIN) + @mkdir -p $$(@D) + @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD) + $$(eval CMD=$$(CC) -c $$(ALL_ASFLAGS) $$< -o $$@) + @$$(BUILD_CMD) + +endef + +# Since the object files could be in two different folders, generate +# separate rules for them, rather than having too generic rules +$(eval $(call GEN_OBJRULE,$(OBJDIR))) +$(eval $(call GEN_OBJRULE,$(KBOBJDIR))) + # Compile: create assembler files from C source files. %.s : %.c | $(BEGIN) @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD) @@ -396,13 +419,6 @@ $(OBJDIR)/%.o : %.cpp | $(BEGIN) $(eval CMD=$(CC) -S $(ALL_CPPFLAGS) $< -o $@) @$(BUILD_CMD) -# Assemble: create object files from assembler source files. -$(OBJDIR)/%.o : %.S | $(BEGIN) - @mkdir -p $(@D) - @$(SILENT) || printf "$(MSG_ASSEMBLING) $<" | $(AWK_CMD) - $(eval CMD=$(CC) -c $(ALL_ASFLAGS) $< -o $@) - @$(BUILD_CMD) - # Create preprocessed source for use in sending a bug report. %.i : %.c | $(BEGIN) $(CC) -E -mmcu=$(MCU) $(CFLAGS) $< -o $@ @@ -486,7 +502,7 @@ $(shell mkdir $(BUILD_DIR) 2>/dev/null) # Create object files directory $(shell mkdir $(OBJDIR) 2>/dev/null) - +$(shell mkdir $(KBOBJDIR) 2>/dev/null) # Include the dependency files. -include $(shell mkdir $(BUILD_DIR)/.dep 2>/dev/null) $(wildcard $(BUILD_DIR)/.dep/*) -- cgit v1.2.3-24-g4f1b From a6577b272e763303fc1a86bd54888e6f2b43cb37 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 9 Jul 2016 21:24:02 +0300 Subject: Define weak matrix user function for Infinity Ergodox So that a few keyboards, which don't use them, links properly. --- keyboards/ergodox/infinity/infinity.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/keyboards/ergodox/infinity/infinity.c b/keyboards/ergodox/infinity/infinity.c index d33c54441..f89e046d0 100644 --- a/keyboards/ergodox/infinity/infinity.c +++ b/keyboards/ergodox/infinity/infinity.c @@ -78,6 +78,15 @@ void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t 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 -- cgit v1.2.3-24-g4f1b 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(-) 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-24-g4f1b From fd7f20b029e621942e1c0b342bc852a545305ee0 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 12:02:17 +0300 Subject: Rename supercoder config_user to config.h Also fixup the include path of parent config --- keyboards/ergodox/keymaps/supercoder/config.h | 9 +++++++++ keyboards/ergodox/keymaps/supercoder/config_user.h | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 keyboards/ergodox/keymaps/supercoder/config.h delete mode 100644 keyboards/ergodox/keymaps/supercoder/config_user.h diff --git a/keyboards/ergodox/keymaps/supercoder/config.h b/keyboards/ergodox/keymaps/supercoder/config.h new file mode 100644 index 000000000..2de3599f8 --- /dev/null +++ b/keyboards/ergodox/keymaps/supercoder/config.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H 1 + +#include "../../config.h" + +#undef LOCKING_SUPPORT_ENABLE +#undef LOCKING_RESYNC_ENABLE + +#endif diff --git a/keyboards/ergodox/keymaps/supercoder/config_user.h b/keyboards/ergodox/keymaps/supercoder/config_user.h deleted file mode 100644 index 8da138372..000000000 --- a/keyboards/ergodox/keymaps/supercoder/config_user.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H 1 - -#include "config.h" - -#undef LOCKING_SUPPORT_ENABLE -#undef LOCKING_RESYNC_ENABLE - -#endif -- cgit v1.2.3-24-g4f1b From 650298cec34f55271f3faaab688d878c3f172e77 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 12:02:56 +0300 Subject: Cleanup the townk_osx config.h and make files --- keyboards/ergodox/keymaps/townk_osx/config.h | 50 +------------------------ keyboards/ergodox/keymaps/townk_osx/makefile.mk | 4 +- 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/keyboards/ergodox/keymaps/townk_osx/config.h b/keyboards/ergodox/keymaps/townk_osx/config.h index 58ba690af..72d3e9670 100644 --- a/keyboards/ergodox/keymaps/townk_osx/config.h +++ b/keyboards/ergodox/keymaps/townk_osx/config.h @@ -19,55 +19,7 @@ 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 t.m.k. keyboard firmware for Ergodox - -/* 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 COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } -#define ROWS (int []){ D0, D5, B5, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* 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 2 -#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)) \ -) - +#include "../../config.h" /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/ergodox/keymaps/townk_osx/makefile.mk b/keyboards/ergodox/keymaps/townk_osx/makefile.mk index e757557bd..c06021b9f 100644 --- a/keyboards/ergodox/keymaps/townk_osx/makefile.mk +++ b/keyboards/ergodox/keymaps/townk_osx/makefile.mk @@ -1,4 +1,2 @@ # I don't want my keyboard blinking lights when is suppose to be asleep. -SLEEP_LED_ENABLE = no - -CONFIG_H = keymaps/$(KEYMAP)/config.h +SLEEP_LED_ENABLE = no \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 37052a53f15ea5540b20e2d81a6992f34ebb84fe Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 12:05:34 +0300 Subject: Remove the Infinity Ergodox default keymap --- .../ergodox/infinity/keymaps/default/keymap.c | 114 -------------- .../ergodox/infinity/keymaps/default/visualizer.c | 168 --------------------- 2 files changed, 282 deletions(-) delete mode 100644 keyboards/ergodox/infinity/keymaps/default/keymap.c delete mode 100644 keyboards/ergodox/infinity/keymaps/default/visualizer.c diff --git a/keyboards/ergodox/infinity/keymaps/default/keymap.c b/keyboards/ergodox/infinity/keymaps/default/keymap.c deleted file mode 100644 index f1e6b1c8a..000000000 --- a/keyboards/ergodox/infinity/keymaps/default/keymap.c +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2016 Fred Sundvik -Jun Wako - -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 . -*/ - -#include "infinity_ergodox.h" - -// Workaround for old keymap format -#define KC_RESET RESET - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP( // layer 0 : default - // left hand - EQL, 1, 2, 3, 4, 5, ESC, - BSLS,Q, W, E, R, T, FN1, - TAB, A, S, D, F, G, - LSFT,Z, X, C, V, B, FN0, - LGUI,GRV, BSLS,LEFT,RGHT, - LCTL,LALT, - HOME, - BSPC,DEL, END, - // right hand - FN2, 6, 7, 8, 9, 0, MINS, - LBRC,Y, U, I, O, P, RBRC, - H, J, K, L, SCLN,QUOT, - FN0, N, M, COMM,DOT, SLSH,RSFT, - LEFT,DOWN,UP, RGHT,RGUI, - RALT,RCTL, - PGUP, - PGDN,ENT, SPC - ), - - KEYMAP( // layer 1 : function and symbol keys - // left hand - TRNS,F1, F2, F3, F4, F5, F11, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - F12, F6, F7, F8, F9, F10, TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), - - KEYMAP( // layer 2 : keyboard functions - // left hand - RESET,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), - - KEYMAP( // layer 3: numpad - // left hand - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS, - // right hand - TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC, - TRNS,NO, P7, P8, P9, PMNS,BSPC, - NO, P4, P5, P6, PPLS,PENT, - TRNS,NO, P1, P2, P3, PPLS,PENT, - P0, PDOT,SLSH,PENT,PENT, - TRNS,TRNS, - TRNS, - TRNS,TRNS,TRNS - ), -}; -const uint16_t fn_actions[] = { - ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1 - ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2 - ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer - ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0 -}; diff --git a/keyboards/ergodox/infinity/keymaps/default/visualizer.c b/keyboards/ergodox/infinity/keymaps/default/visualizer.c deleted file mode 100644 index c0d335ce6..000000000 --- a/keyboards/ergodox/infinity/keymaps/default/visualizer.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 . -*/ - -// Currently we are assuming that both the backlight and LCD are enabled -// But it's entirely possible to write a custom visualizer that use only -// one of them -#ifndef LCD_BACKLIGHT_ENABLE -#error This visualizer needs that LCD backlight is enabled -#endif - -#ifndef LCD_ENABLE -#error This visualizer needs that LCD is enabled -#endif - -#include "visualizer.h" -#include "led_test.h" - -static const char* welcome_text[] = {"TMK", "Infinity Ergodox"}; - -// Just an example how to write custom keyframe functions, we could have moved -// all this into the init function -bool display_welcome(keyframe_animation_t* animation, visualizer_state_t* state) { - (void)animation; - // Read the uGFX documentation for information how to use the displays - // http://wiki.ugfx.org/index.php/Main_Page - gdispClear(White); - // You can use static variables for things that can't be found in the animation - // or state structs - gdispDrawString(0, 3, welcome_text[0], state->font_dejavusansbold12, Black); - gdispDrawString(0, 15, welcome_text[1], state->font_dejavusansbold12, Black); - // Always remember to flush the display - gdispFlush(); - // you could set the backlight color as well, but we won't do it here, since - // it's part of the following animation - // lcd_backlight_color(hue, saturation, intensity); - // We don't need constant updates, just drawing the screen once is enough - return false; -} - -// Feel free to modify the animations below, or even add new ones if needed - -// Don't worry, if the startup animation is long, you can use the keyboard like normal -// during that time -static keyframe_animation_t startup_animation = { - .num_frames = 4, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, - .frame_functions = { - display_welcome, - keyframe_animate_backlight_color, - keyframe_no_operation, - enable_visualization - }, -}; - -// The color animation animates the LCD color when you change layers -static keyframe_animation_t color_animation = { - .num_frames = 2, - .loop = false, - // Note that there's a 200 ms no-operation frame, - // this prevents the color from changing when activating the layer - // momentarily - .frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)}, - .frame_functions = {keyframe_no_operation, keyframe_animate_backlight_color}, -}; - -// The LCD animation alternates between the layer name display and a -// bitmap that displays all active layers -static keyframe_animation_t lcd_animation = { - .num_frames = 2, - .loop = true, - .frame_lengths = {gfxMillisecondsToTicks(2000), gfxMillisecondsToTicks(2000)}, - .frame_functions = {keyframe_display_layer_text, keyframe_display_layer_bitmap}, -}; - -static keyframe_animation_t suspend_animation = { - .num_frames = 3, - .loop = false, - .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0}, - .frame_functions = { - keyframe_display_layer_text, - keyframe_animate_backlight_color, - keyframe_disable_lcd_and_backlight, - }, -}; - -static keyframe_animation_t resume_animation = { - .num_frames = 5, - .loop = false, - .frame_lengths = {0, 0, gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(5000), 0}, - .frame_functions = { - keyframe_enable_lcd_and_backlight, - display_welcome, - keyframe_animate_backlight_color, - keyframe_no_operation, - enable_visualization, - }, -}; - -void initialize_user_visualizer(visualizer_state_t* state) { - // The brightness will be dynamically adjustable in the future - // But for now, change it here. - lcd_backlight_brightness(0x50); - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0xFF); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&startup_animation); - start_keyframe_animation(&led_test_animation); -} - -void update_user_visualizer_state(visualizer_state_t* state) { - // Add more tests, change the colors and layer texts here - // Usually you want to check the high bits (higher layers first) - // because that's the order layers are processed for keypresses - // You can for check for example: - // state->status.layer - // state->status.default_layer - // state->status.leds (see led.h for available statuses) - if (state->status.layer & 0x8) { - state->target_lcd_color = LCD_COLOR(0xC0, 0xB0, 0xFF); - state->layer_text = "Numpad"; - } - else if (state->status.layer & 0x4) { - state->target_lcd_color = LCD_COLOR(0, 0xB0, 0xFF); - state->layer_text = "KBD functions"; - } - else if (state->status.layer & 0x2) { - state->target_lcd_color = LCD_COLOR(0x80, 0xB0, 0xFF); - state->layer_text = "Function keys"; - } - else { - state->target_lcd_color = LCD_COLOR(0x40, 0xB0, 0xFF); - state->layer_text = "Default"; - } - // You can also stop existing animations, and start your custom ones here - // remember that you should normally have only one animation for the LCD - // and one for the background. But you can also combine them if you want. - start_keyframe_animation(&lcd_animation); - start_keyframe_animation(&color_animation); -} - -void user_visualizer_suspend(visualizer_state_t* state) { - state->layer_text = "Suspending..."; - uint8_t hue = LCD_HUE(state->current_lcd_color); - uint8_t sat = LCD_SAT(state->current_lcd_color); - state->target_lcd_color = LCD_COLOR(hue, sat, 0); - start_keyframe_animation(&suspend_animation); -} - -void user_visualizer_resume(visualizer_state_t* state) { - state->current_lcd_color = LCD_COLOR(0x00, 0x00, 0x00); - state->target_lcd_color = LCD_COLOR(0x10, 0xFF, 0xFF); - start_keyframe_animation(&resume_animation); - start_keyframe_animation(&led_test_animation); -} -- cgit v1.2.3-24-g4f1b From 592ef7c6f0441216d2dbfb08af4e20ed35581102 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 14:29:00 +0300 Subject: Move Infinity Ergodox drivers to subproject, and fix makefile --- .../drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h | 113 ------- .../ergodox/drivers/gdisp/IS31FL3731C/driver.mk | 2 - .../drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 333 --------------------- .../drivers/gdisp/IS31FL3731C/gdisp_lld_config.h | 36 --- .../ergodox/drivers/gdisp/emulator_lcd/driver.mk | 2 - .../drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 - .../ergodox/drivers/gdisp/emulator_led/driver.mk | 2 - .../drivers/gdisp/emulator_led/emulator_led.c | 10 - .../drivers/gdisp/st7565ergodox/board_ST7565.h | 127 -------- .../ergodox/drivers/gdisp/st7565ergodox/driver.mk | 2 - .../drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c | 292 ------------------ .../drivers/gdisp/st7565ergodox/gdisp_lld_config.h | 26 -- .../ergodox/drivers/gdisp/st7565ergodox/st7565.h | 37 --- keyboards/ergodox/infinity/Makefile | 4 +- .../drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h | 113 +++++++ .../infinity/drivers/gdisp/IS31FL3731C/driver.mk | 2 + .../drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c | 333 +++++++++++++++++++++ .../drivers/gdisp/IS31FL3731C/gdisp_lld_config.h | 36 +++ .../infinity/drivers/gdisp/emulator_lcd/driver.mk | 2 + .../drivers/gdisp/emulator_lcd/emulator_lcd.c | 10 + .../infinity/drivers/gdisp/emulator_led/driver.mk | 2 + .../drivers/gdisp/emulator_led/emulator_led.c | 10 + .../drivers/gdisp/st7565ergodox/board_ST7565.h | 127 ++++++++ .../infinity/drivers/gdisp/st7565ergodox/driver.mk | 2 + .../drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c | 292 ++++++++++++++++++ .../drivers/gdisp/st7565ergodox/gdisp_lld_config.h | 26 ++ .../infinity/drivers/gdisp/st7565ergodox/st7565.h | 37 +++ 27 files changed, 994 insertions(+), 994 deletions(-) delete mode 100644 keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h delete mode 100644 keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk delete mode 100644 keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c delete mode 100644 keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h delete mode 100644 keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk delete mode 100644 keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c delete mode 100644 keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk delete mode 100644 keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c delete mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h delete mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk delete mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c delete mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h delete mode 100644 keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h create mode 100644 keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h diff --git a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h deleted file mode 100644 index 2ea73f1fb..000000000 --- a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h +++ /dev/null @@ -1,113 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 _GDISP_LLD_BOARD_H -#define _GDISP_LLD_BOARD_H - -static const I2CConfig i2ccfg = { - 400000 // clock speed (Hz); 400kHz max for IS31 -}; - -#define GDISP_SCREEN_WIDTH 7 -#define GDISP_SCREEN_HEIGHT 7 - -static const uint8_t led_mask[] = { - 0xFF, 0x00, /* C1-1 -> C1-16 */ - 0xFF, 0x00, /* C2-1 -> C2-16 */ - 0xFF, 0x00, /* C3-1 -> C3-16 */ - 0xFF, 0x00, /* C4-1 -> C4-16 */ - 0x3F, 0x00, /* C5-1 -> C5-16 */ - 0x00, 0x00, /* C6-1 -> C6-16 */ - 0x00, 0x00, /* C7-1 -> C7-16 */ - 0x00, 0x00, /* C8-1 -> C8-16 */ - 0x00, 0x00, /* C9-1 -> C9-16 */ -}; - -// The address of the LED -#define LA(c, r) (c + r * 16 ) -// Need to be an address that is not mapped, but inside the range of the controller matrix -#define NA LA(8, 8) - -// The numbers in the comments are the led numbers DXX on the PCB -// The mapping is taken from the schematic of left hand side -static const uint8_t led_mapping[GDISP_SCREEN_HEIGHT][GDISP_SCREEN_WIDTH] = { -// 45 44 43 42 41 40 39 - { LA(1, 1), LA(1, 0), LA(0, 4), LA(0, 3), LA(0, 2), LA(0, 1), LA(0, 0)}, -// 52 51 50 49 48 47 46 - { LA(2, 3), LA(2, 2), LA(2, 1), LA(2, 0), LA(1, 4), LA(1, 3), LA(1, 2) }, -// 58 57 56 55 54 53 N/A - { LA(3, 4), LA(3, 3), LA(3, 2), LA(3, 1), LA(3, 0), LA(2, 4), NA }, -// 67 66 65 64 63 62 61 - { LA(5, 3), LA(5, 2), LA(5, 1), LA(5, 0), LA(4, 4), LA(4, 3), LA(4, 2) }, -// 76 75 74 73 72 60 59 - { LA(7, 3), LA(7, 2), LA(7, 1), LA(7, 0), LA(6, 3), LA(4, 1), LA(4, 0) }, -// N/A N/A N/A N/A N/A N/A 68 - { NA, NA, NA, NA, NA, NA, LA(5, 4) }, -// N/A N/A N/A N/A 71 70 69 - { NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0) }, -}; - - -#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND -#define IS31_TIMEOUT 5000 - -static GFXINLINE void init_board(GDisplay *g) { - (void) g; - /* I2C pins */ - palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATIVE_2); // PTB0/I2C0/SCL - palSetPadMode(GPIOB, 1, PAL_MODE_ALTERNATIVE_2); // PTB1/I2C0/SDA - palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL); - palClearPad(GPIOB, 16); - /* start I2C */ - i2cStart(&I2CD1, &i2ccfg); - // try high drive (from kiibohd) - I2CD1.i2c->C2 |= I2Cx_C2_HDRS; - // try glitch fixing (from kiibohd) - I2CD1.i2c->FLT = 4; -} - -static GFXINLINE void post_init_board(GDisplay *g) { - (void) g; -} - -static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) { - (void) g; - return led_mask; -} - -static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y) -{ - (void) g; - return led_mapping[y][x]; -} - -static GFXINLINE void set_hardware_shutdown(GDisplay* g, bool shutdown) { - (void) g; - if(!shutdown) { - palSetPad(GPIOB, 16); - } - else { - palClearPad(GPIOB, 16); - } -} - -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { - (void) g; - i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, data, length, 0, 0, US2ST(IS31_TIMEOUT)); -} - -#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk deleted file mode 100644 index f32d0d868..000000000 --- a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/IS31FL3731C -GFXSRC += drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c deleted file mode 100644 index 1d21f0c49..000000000 --- a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c +++ /dev/null @@ -1,333 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 . -*/ - -#include "gfx.h" - -#if GFX_USE_GDISP - -#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX -#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" - -#include "board_IS31FL3731C.h" - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -#ifndef GDISP_SCREEN_HEIGHT - #define GDISP_SCREEN_HEIGHT 9 -#endif -#ifndef GDISP_SCREEN_WIDTH - #define GDISP_SCREEN_WIDTH 16 -#endif -#ifndef GDISP_INITIAL_CONTRAST - #define GDISP_INITIAL_CONTRAST 0 -#endif -#ifndef GDISP_INITIAL_BACKLIGHT - #define GDISP_INITIAL_BACKLIGHT 100 -#endif - -#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) - -#define IS31_ADDR_DEFAULT 0x74 - -#define IS31_REG_CONFIG 0x00 -// bits in reg -#define IS31_REG_CONFIG_PICTUREMODE 0x00 -#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08 -#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18 -// D2:D0 bits are starting frame for autoplay mode - -#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode - -#define IS31_REG_AUTOPLAYCTRL1 0x02 -// D6:D4 number of loops (000=infty) -// D2:D0 number of frames to be used - -#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms) - -#define IS31_REG_DISPLAYOPT 0x05 -#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames -#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x8 -// D2:D0 bits blink period time (*0.27s) - -#define IS31_REG_AUDIOSYNC 0x06 -#define IS31_REG_AUDIOSYNC_ENABLE 0x1 - -#define IS31_REG_FRAMESTATE 0x07 - -#define IS31_REG_BREATHCTRL1 0x08 -// D6:D4 fade out time (26ms*2^i) -// D2:D0 fade in time (26ms*2^i) - -#define IS31_REG_BREATHCTRL2 0x09 -#define IS31_REG_BREATHCTRL2_ENABLE 0x10 -// D2:D0 extinguish time (3.5ms*2^i) - -#define IS31_REG_SHUTDOWN 0x0A -#define IS31_REG_SHUTDOWN_OFF 0x0 -#define IS31_REG_SHUTDOWN_ON 0x1 - -#define IS31_REG_AGCCTRL 0x0B -#define IS31_REG_ADCRATE 0x0C - -#define IS31_COMMANDREGISTER 0xFD -#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine' -#define IS31_FUNCTIONREG_SIZE 0xD - -#define IS31_FRAME_SIZE 0xB4 - -#define IS31_PWM_REG 0x24 -#define IS31_PWM_SIZE 0x90 - -#define IS31_LED_MASK_SIZE 0x12 -#define IS31_SCREEN_WIDTH 16 - -#define IS31 - -//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm -const unsigned char cie[256] = { - 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, - 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, - 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, - 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, - 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, - 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, - 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, - 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, - 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, - 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, - 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, - 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, - 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, - 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, - 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, - 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, - 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, - 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, - 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, - 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, - 242, 245, 247, 250, 252, 255, -}; - - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -typedef struct{ - uint8_t write_buffer_offset; - uint8_t write_buffer[IS31_FRAME_SIZE]; - uint8_t frame_buffer[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH]; - uint8_t page; -}__attribute__((__packed__)) PrivData; - -// Some common routines and macros -#define PRIV(g) ((PrivData*)g->priv) - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -static GFXINLINE void write_page(GDisplay* g, uint8_t page) { - uint8_t tx[2] __attribute__((aligned(2))); - tx[0] = IS31_COMMANDREGISTER; - tx[1] = page; - write_data(g, tx, 2); -} - -static GFXINLINE void write_register(GDisplay* g, uint8_t page, uint8_t reg, uint8_t data) { - uint8_t tx[2] __attribute__((aligned(2))); - tx[0] = reg; - tx[1] = data; - write_page(g, page); - write_data(g, tx, 2); -} - -static GFXINLINE void write_ram(GDisplay *g, uint8_t page, uint16_t offset, uint16_t length) { - PRIV(g)->write_buffer_offset = offset; - write_page(g, page); - write_data(g, (uint8_t*)PRIV(g), length + 1); -} - -LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { - // The private area is the display surface. - g->priv = gfxAlloc(sizeof(PrivData)); - __builtin_memset(PRIV(g), 0, sizeof(PrivData)); - PRIV(g)->page = 0; - - // Initialise the board interface - init_board(g); - gfxSleepMilliseconds(10); - - // zero function page, all registers (assuming full_page is all zeroes) - write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); - set_hardware_shutdown(g, false); - gfxSleepMilliseconds(10); - // software shutdown - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); - gfxSleepMilliseconds(10); - // zero function page, all registers - write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); - gfxSleepMilliseconds(10); - - - // zero all LED registers on all 8 pages, and enable the mask - __builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE); - for(uint8_t i=0; i<8; i++) { - write_ram(g, i, 0, IS31_FRAME_SIZE); - gfxSleepMilliseconds(1); - } - - // software shutdown disable (i.e. turn stuff on) - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); - gfxSleepMilliseconds(10); - - // Finish Init - post_init_board(g); - - /* Initialise the GDISP structure */ - g->g.Width = GDISP_SCREEN_WIDTH; - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; - g->g.Powermode = powerOn; - g->g.Backlight = GDISP_INITIAL_BACKLIGHT; - g->g.Contrast = GDISP_INITIAL_CONTRAST; - return TRUE; -} - -#if GDISP_HARDWARE_FLUSH - LLDSPEC void gdisp_lld_flush(GDisplay *g) { - // Don't flush if we don't need it. - if (!(g->flags & GDISP_FLG_NEEDFLUSH)) - return; - - PRIV(g)->page++; - PRIV(g)->page %= 2; - // TODO: some smarter algorithm for this - // We should run only one physical page at a time - // This way we don't need to send so much data, and - // we could use slightly less memory - uint8_t* src = PRIV(g)->frame_buffer; - for (int y=0;ywrite_buffer[get_led_address(g, x, y)]=cie[*src]; - ++src; - } - } - write_ram(g, PRIV(g)->page, IS31_PWM_REG, IS31_PWM_SIZE); - gfxSleepMilliseconds(1); - write_register(g, IS31_FUNCTIONREG, IS31_REG_PICTDISP, PRIV(g)->page); - - g->flags &= ~GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_DRAWPIXEL - LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = g->p.y; - break; - } - PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x] = gdispColor2Native(g->p.color); - g->flags |= GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = g->p.y; - break; - } - return gdispNative2Color(PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x]); - } -#endif - -#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL - LLDSPEC void gdisp_lld_control(GDisplay *g) { - switch(g->p.x) { - case GDISP_CONTROL_POWER: - if (g->g.Powermode == (powermode_t)g->p.ptr) - return; - switch((powermode_t)g->p.ptr) { - case powerOff: - case powerSleep: - case powerDeepSleep: - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); - break; - case powerOn: - write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); - break; - default: - return; - } - g->g.Powermode = (powermode_t)g->p.ptr; - return; - - case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) - return; - switch((orientation_t)g->p.ptr) { - /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Width = GDISP_SCREEN_WIDTH; - break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - g->g.Height = GDISP_SCREEN_WIDTH; - g->g.Width = GDISP_SCREEN_HEIGHT; - break; - default: - return; - } - g->g.Orientation = (orientation_t)g->p.ptr; - return; - - case GDISP_CONTROL_CONTRAST: - return; - } - } -#endif // GDISP_NEED_CONTROL - -#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h deleted file mode 100644 index bb28ad775..000000000 --- a/keyboards/ergodox/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2016 Fred Sundvik - -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 _GDISP_LLD_CONFIG_H -#define _GDISP_LLD_CONFIG_H - -#if GFX_USE_GDISP - -/*===========================================================================*/ -/* Driver hardware support. */ -/*===========================================================================*/ - -#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE - -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_GRAY256 - -#endif /* GFX_USE_GDISP */ - -#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk deleted file mode 100644 index 16c3f80f5..000000000 --- a/keyboards/ergodox/drivers/gdisp/emulator_lcd/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/emulator_lcd -GFXSRC += drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c deleted file mode 100644 index babfe2b36..000000000 --- a/keyboards/ergodox/drivers/gdisp/emulator_lcd/emulator_lcd.c +++ /dev/null @@ -1,10 +0,0 @@ -#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LCD_ERGODOX -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO -#define GDISP_SCREEN_WIDTH 128 -#define GDISP_SCREEN_HEIGHT 32 -#define ROTATE_180_IS_FLIP - -#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk b/keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk deleted file mode 100644 index 255434432..000000000 --- a/keyboards/ergodox/drivers/gdisp/emulator_led/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/emulator_led -GFXSRC += drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c deleted file mode 100644 index b0ebcdc47..000000000 --- a/keyboards/ergodox/drivers/gdisp/emulator_led/emulator_led.c +++ /dev/null @@ -1,10 +0,0 @@ -#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LED_ERGODOX -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO -#define GDISP_SCREEN_WIDTH 7 -#define GDISP_SCREEN_HEIGHT 7 -#define ROTATE_180_IS_FLIP - -#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h deleted file mode 100644 index 290571ce5..000000000 --- a/keyboards/ergodox/drivers/gdisp/st7565ergodox/board_ST7565.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _GDISP_LLD_BOARD_H -#define _GDISP_LLD_BOARD_H - -#include "print.h" - -#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 -#define ST7565_ADC ST7565_ADC_NORMAL -#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC -#define ST7565_PAGE_ORDER 0,1,2,3 -/* - * Custom page order for several LCD boards, e.g. HEM12864-99 - * #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3 - */ - -#define ST7565_GPIOPORT GPIOC -#define ST7565_PORT PORTC -#define ST7565_A0_PIN 7 -#define ST7565_RST_PIN 8 -#define ST7565_MOSI_PIN 6 -#define ST7565_SLCK_PIN 5 -#define ST7565_SS_PIN 4 - -#define palSetPadModeRaw(portname, bits) \ - ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits - -#define palSetPadModeNamed(portname, portmode) \ - palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode) - -#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2) -// DSPI Clock and Transfer Attributes -// Frame Size: 8 bits -// MSB First -// CLK Low by default -static const SPIConfig spi1config = { - NULL, - /* HW dependent part.*/ - ST7565_GPIOPORT, - ST7565_SS_PIN, - SPIx_CTARn_FMSZ(7) - | SPIx_CTARn_ASC(7) - | SPIx_CTARn_DT(7) - | SPIx_CTARn_CSSCK(7) - | SPIx_CTARn_PBR(0) - | SPIx_CTARn_BR(7) - //SPI_CR1_BR_0 -}; - -static bool_t st7565_is_data_mode = 1; - -static GFXINLINE void init_board(GDisplay *g) { - (void) g; - palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); - st7565_is_data_mode = 1; - palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); - palSetPadModeRaw(MOSI, ST7565_SPI_MODE); - palSetPadModeRaw(SLCK, ST7565_SPI_MODE); - palSetPadModeRaw(SS, ST7565_SPI_MODE); - - spiInit(); - spiStart(&SPID1, &spi1config); - spiSelect(&SPID1); -} - -static GFXINLINE void post_init_board(GDisplay *g) { - (void) g; -} - -static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { - (void) g; - if (state) { - palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN); - } - else { - palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); - } -} - -static GFXINLINE void acquire_bus(GDisplay *g) { - (void) g; - // Only the LCD is using the SPI bus, so no need to acquire - // spiAcquireBus(&SPID1); -} - -static GFXINLINE void release_bus(GDisplay *g) { - (void) g; - // Only the LCD is using the SPI bus, so no need to release - //spiReleaseBus(&SPID1); -} - -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { - (void) g; - if (st7565_is_data_mode) { - // The sleeps need to be at lest 10 vs 25 ns respectively - // So let's sleep two ticks, one tick might not be enough - // if we are at the end of the tick - chThdSleep(2); - palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); - chThdSleep(2); - st7565_is_data_mode = 0; - } - spiSend(&SPID1, 1, &cmd); -} - -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { - (void) g; - if (!st7565_is_data_mode) { - // The sleeps need to be at lest 10 vs 25 ns respectively - // So let's sleep two ticks, one tick might not be enough - // if we are at the end of the tick - chThdSleep(2); - palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); - chThdSleep(2); - st7565_is_data_mode = 1; - } - spiSend(&SPID1, length, data); -} - -#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk deleted file mode 100644 index 889a1a031..000000000 --- a/keyboards/ergodox/drivers/gdisp/st7565ergodox/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -GFXINC += drivers/gdisp/st7565ergodox -GFXSRC += drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c deleted file mode 100644 index c33aea81a..000000000 --- a/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c +++ /dev/null @@ -1,292 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#include "gfx.h" - -#if GFX_USE_GDISP - -#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX -#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h" -#include "src/gdisp/gdisp_driver.h" - -#include "board_ST7565.h" - -/*===========================================================================*/ -/* Driver local definitions. */ -/*===========================================================================*/ - -#ifndef GDISP_SCREEN_HEIGHT - #define GDISP_SCREEN_HEIGHT 32 -#endif -#ifndef GDISP_SCREEN_WIDTH - #define GDISP_SCREEN_WIDTH 128 -#endif -#ifndef GDISP_INITIAL_CONTRAST - #define GDISP_INITIAL_CONTRAST 0 -#endif -#ifndef GDISP_INITIAL_BACKLIGHT - #define GDISP_INITIAL_BACKLIGHT 100 -#endif - -#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) - -#include "drivers/gdisp/st7565ergodox/st7565.h" - -/*===========================================================================*/ -/* Driver config defaults for backward compatibility. */ -/*===========================================================================*/ -#ifndef ST7565_LCD_BIAS - #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 -#endif -#ifndef ST7565_ADC - #define ST7565_ADC ST7565_ADC_NORMAL -#endif -#ifndef ST7565_COM_SCAN - #define ST7565_COM_SCAN ST7565_COM_SCAN_INC -#endif -#ifndef ST7565_PAGE_ORDER - #define ST7565_PAGE_ORDER 0,1,2,3 -#endif - -/*===========================================================================*/ -/* Driver local functions. */ -/*===========================================================================*/ - -typedef struct{ - bool_t buffer2; - uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; -}PrivData; - -// Some common routines and macros -#define PRIV(g) ((PrivData*)g->priv) -#define RAM(g) (PRIV(g)->ram) -#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } -#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } - -// Some common routines and macros -#define delay(us) gfxSleepMicroseconds(us) -#define delay_ms(ms) gfxSleepMilliseconds(ms) - -#define xyaddr(x, y) ((x) + ((y)>>3)*GDISP_SCREEN_WIDTH) -#define xybit(y) (1<<((y)&7)) - -/*===========================================================================*/ -/* Driver exported functions. */ -/*===========================================================================*/ - -/* - * As this controller can't update on a pixel boundary we need to maintain the - * the entire display surface in memory so that we can do the necessary bit - * operations. Fortunately it is a small display in monochrome. - * 64 * 128 / 8 = 1024 bytes. - */ - -LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { - // The private area is the display surface. - g->priv = gfxAlloc(sizeof(PrivData)); - PRIV(g)->buffer2 = false; - - // Initialise the board interface - init_board(g); - - // Hardware reset - setpin_reset(g, TRUE); - gfxSleepMilliseconds(20); - setpin_reset(g, FALSE); - gfxSleepMilliseconds(20); - - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_OFF); - write_cmd(g, ST7565_LCD_BIAS); - write_cmd(g, ST7565_ADC); - write_cmd(g, ST7565_COM_SCAN); - - write_cmd(g, ST7565_START_LINE | 0); - - write_cmd(g, ST7565_RESISTOR_RATIO | 0x6); - - // turn on voltage converter (VC=1, VR=0, VF=0) - write_cmd(g, ST7565_POWER_CONTROL | 0x04); - delay_ms(50); - - // turn on voltage regulator (VC=1, VR=1, VF=0) - write_cmd(g, ST7565_POWER_CONTROL | 0x06); - delay_ms(50); - - // turn on voltage follower (VC=1, VR=1, VF=1) - write_cmd(g, ST7565_POWER_CONTROL | 0x07); - delay_ms(50); - - write_cmd(g, 0xE2); - write_cmd(g, ST7565_COM_SCAN); - write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101); - //write_cmd2(g, ST7565_CONTRAST, 0); - write_cmd(g, ST7565_DISPLAY_ON); - write_cmd(g, ST7565_ALLON_NORMAL); - write_cmd(g, ST7565_INVERT_DISPLAY); - - write_cmd(g, ST7565_RMW); - - // Finish Init - post_init_board(g); - - // Release the bus - release_bus(g); - - /* Initialise the GDISP structure */ - g->g.Width = GDISP_SCREEN_WIDTH; - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Orientation = GDISP_ROTATE_0; - g->g.Powermode = powerOn; - g->g.Backlight = GDISP_INITIAL_BACKLIGHT; - g->g.Contrast = GDISP_INITIAL_CONTRAST; - return TRUE; -} - -#if GDISP_HARDWARE_FLUSH - LLDSPEC void gdisp_lld_flush(GDisplay *g) { - unsigned p; - - // Don't flush if we don't need it. - if (!(g->flags & GDISP_FLG_NEEDFLUSH)) - return; - - acquire_bus(g); - unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); - for (p = 0; p < 4; p++) { - write_cmd(g, ST7565_PAGE | (p + dstOffset)); - write_cmd(g, ST7565_COLUMN_MSB | 0); - write_cmd(g, ST7565_COLUMN_LSB | 0); - write_cmd(g, ST7565_RMW); - write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); - } - unsigned line = (PRIV(g)->buffer2 ? 32 : 0); - write_cmd(g, ST7565_START_LINE | line); - PRIV(g)->buffer2 = !PRIV(g)->buffer2; - release_bus(g); - - g->flags &= ~GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_DRAWPIXEL - LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_90: - x = g->p.y; - y = GDISP_SCREEN_HEIGHT-1 - g->p.x; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = GDISP_SCREEN_HEIGHT-1 - g->p.y; - break; - case GDISP_ROTATE_270: - x = GDISP_SCREEN_HEIGHT-1 - g->p.y; - y = g->p.x; - break; - } - if (gdispColor2Native(g->p.color) != Black) - RAM(g)[xyaddr(x, y)] |= xybit(y); - else - RAM(g)[xyaddr(x, y)] &= ~xybit(y); - g->flags |= GDISP_FLG_NEEDFLUSH; - } -#endif - -#if GDISP_HARDWARE_PIXELREAD - LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { - coord_t x, y; - - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - x = g->p.x; - y = g->p.y; - break; - case GDISP_ROTATE_90: - x = g->p.y; - y = GDISP_SCREEN_HEIGHT-1 - g->p.x; - break; - case GDISP_ROTATE_180: - x = GDISP_SCREEN_WIDTH-1 - g->p.x; - y = GDISP_SCREEN_HEIGHT-1 - g->p.y; - break; - case GDISP_ROTATE_270: - x = GDISP_SCREEN_HEIGHT-1 - g->p.y; - y = g->p.x; - break; - } - return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; - } -#endif - -#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL - LLDSPEC void gdisp_lld_control(GDisplay *g) { - switch(g->p.x) { - case GDISP_CONTROL_POWER: - if (g->g.Powermode == (powermode_t)g->p.ptr) - return; - switch((powermode_t)g->p.ptr) { - case powerOff: - case powerSleep: - case powerDeepSleep: - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_OFF); - release_bus(g); - break; - case powerOn: - acquire_bus(g); - write_cmd(g, ST7565_DISPLAY_ON); - release_bus(g); - break; - default: - return; - } - g->g.Powermode = (powermode_t)g->p.ptr; - return; - - case GDISP_CONTROL_ORIENTATION: - if (g->g.Orientation == (orientation_t)g->p.ptr) - return; - switch((orientation_t)g->p.ptr) { - /* Rotation is handled by the drawing routines */ - case GDISP_ROTATE_0: - case GDISP_ROTATE_180: - g->g.Height = GDISP_SCREEN_HEIGHT; - g->g.Width = GDISP_SCREEN_WIDTH; - break; - case GDISP_ROTATE_90: - case GDISP_ROTATE_270: - g->g.Height = GDISP_SCREEN_WIDTH; - g->g.Width = GDISP_SCREEN_HEIGHT; - break; - default: - return; - } - g->g.Orientation = (orientation_t)g->p.ptr; - return; - - case GDISP_CONTROL_CONTRAST: - if ((unsigned)g->p.ptr > 100) - g->p.ptr = (void *)100; - acquire_bus(g); - write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); - release_bus(g); - g->g.Contrast = (unsigned)g->p.ptr; - return; - } - } -#endif // GDISP_NEED_CONTROL - -#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h deleted file mode 100644 index 48587b9e1..000000000 --- a/keyboards/ergodox/drivers/gdisp/st7565ergodox/gdisp_lld_config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _GDISP_LLD_CONFIG_H -#define _GDISP_LLD_CONFIG_H - -#if GFX_USE_GDISP - -/*===========================================================================*/ -/* Driver hardware support. */ -/*===========================================================================*/ - -#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing -#define GDISP_HARDWARE_DRAWPIXEL TRUE -#define GDISP_HARDWARE_PIXELREAD TRUE -#define GDISP_HARDWARE_CONTROL TRUE - -#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO - -#endif /* GFX_USE_GDISP */ - -#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h deleted file mode 100644 index 48636b33d..000000000 --- a/keyboards/ergodox/drivers/gdisp/st7565ergodox/st7565.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://ugfx.org/license.html - */ - -#ifndef _ST7565_H -#define _ST7565_H - -#define ST7565_CONTRAST 0x81 -#define ST7565_ALLON_NORMAL 0xA4 -#define ST7565_ALLON 0xA5 -#define ST7565_POSITIVE_DISPLAY 0xA6 -#define ST7565_INVERT_DISPLAY 0xA7 -#define ST7565_DISPLAY_OFF 0xAE -#define ST7565_DISPLAY_ON 0xAF - -#define ST7565_LCD_BIAS_7 0xA3 -#define ST7565_LCD_BIAS_9 0xA2 - -#define ST7565_ADC_NORMAL 0xA0 -#define ST7565_ADC_REVERSE 0xA1 - -#define ST7565_COM_SCAN_INC 0xC0 -#define ST7565_COM_SCAN_DEC 0xC8 - -#define ST7565_START_LINE 0x40 -#define ST7565_PAGE 0xB0 -#define ST7565_COLUMN_MSB 0x10 -#define ST7565_COLUMN_LSB 0x00 -#define ST7565_RMW 0xE0 - -#define ST7565_RESISTOR_RATIO 0x20 -#define ST7565_POWER_CONTROL 0x28 - -#endif /* _ST7565_H */ diff --git a/keyboards/ergodox/infinity/Makefile b/keyboards/ergodox/infinity/Makefile index 22065e4d2..d1ec266d0 100644 --- a/keyboards/ergodox/infinity/Makefile +++ b/keyboards/ergodox/infinity/Makefile @@ -65,11 +65,11 @@ LED_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes 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 diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h new file mode 100644 index 000000000..2ea73f1fb --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h @@ -0,0 +1,113 @@ +/* +Copyright 2016 Fred Sundvik + +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 _GDISP_LLD_BOARD_H +#define _GDISP_LLD_BOARD_H + +static const I2CConfig i2ccfg = { + 400000 // clock speed (Hz); 400kHz max for IS31 +}; + +#define GDISP_SCREEN_WIDTH 7 +#define GDISP_SCREEN_HEIGHT 7 + +static const uint8_t led_mask[] = { + 0xFF, 0x00, /* C1-1 -> C1-16 */ + 0xFF, 0x00, /* C2-1 -> C2-16 */ + 0xFF, 0x00, /* C3-1 -> C3-16 */ + 0xFF, 0x00, /* C4-1 -> C4-16 */ + 0x3F, 0x00, /* C5-1 -> C5-16 */ + 0x00, 0x00, /* C6-1 -> C6-16 */ + 0x00, 0x00, /* C7-1 -> C7-16 */ + 0x00, 0x00, /* C8-1 -> C8-16 */ + 0x00, 0x00, /* C9-1 -> C9-16 */ +}; + +// The address of the LED +#define LA(c, r) (c + r * 16 ) +// Need to be an address that is not mapped, but inside the range of the controller matrix +#define NA LA(8, 8) + +// The numbers in the comments are the led numbers DXX on the PCB +// The mapping is taken from the schematic of left hand side +static const uint8_t led_mapping[GDISP_SCREEN_HEIGHT][GDISP_SCREEN_WIDTH] = { +// 45 44 43 42 41 40 39 + { LA(1, 1), LA(1, 0), LA(0, 4), LA(0, 3), LA(0, 2), LA(0, 1), LA(0, 0)}, +// 52 51 50 49 48 47 46 + { LA(2, 3), LA(2, 2), LA(2, 1), LA(2, 0), LA(1, 4), LA(1, 3), LA(1, 2) }, +// 58 57 56 55 54 53 N/A + { LA(3, 4), LA(3, 3), LA(3, 2), LA(3, 1), LA(3, 0), LA(2, 4), NA }, +// 67 66 65 64 63 62 61 + { LA(5, 3), LA(5, 2), LA(5, 1), LA(5, 0), LA(4, 4), LA(4, 3), LA(4, 2) }, +// 76 75 74 73 72 60 59 + { LA(7, 3), LA(7, 2), LA(7, 1), LA(7, 0), LA(6, 3), LA(4, 1), LA(4, 0) }, +// N/A N/A N/A N/A N/A N/A 68 + { NA, NA, NA, NA, NA, NA, LA(5, 4) }, +// N/A N/A N/A N/A 71 70 69 + { NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0) }, +}; + + +#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND +#define IS31_TIMEOUT 5000 + +static GFXINLINE void init_board(GDisplay *g) { + (void) g; + /* I2C pins */ + palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATIVE_2); // PTB0/I2C0/SCL + palSetPadMode(GPIOB, 1, PAL_MODE_ALTERNATIVE_2); // PTB1/I2C0/SDA + palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL); + palClearPad(GPIOB, 16); + /* start I2C */ + i2cStart(&I2CD1, &i2ccfg); + // try high drive (from kiibohd) + I2CD1.i2c->C2 |= I2Cx_C2_HDRS; + // try glitch fixing (from kiibohd) + I2CD1.i2c->FLT = 4; +} + +static GFXINLINE void post_init_board(GDisplay *g) { + (void) g; +} + +static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) { + (void) g; + return led_mask; +} + +static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y) +{ + (void) g; + return led_mapping[y][x]; +} + +static GFXINLINE void set_hardware_shutdown(GDisplay* g, bool shutdown) { + (void) g; + if(!shutdown) { + palSetPad(GPIOB, 16); + } + else { + palClearPad(GPIOB, 16); + } +} + +static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { + (void) g; + i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, data, length, 0, 0, US2ST(IS31_TIMEOUT)); +} + +#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk new file mode 100644 index 000000000..f32d0d868 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/IS31FL3731C +GFXSRC += drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c new file mode 100644 index 000000000..1d21f0c49 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c @@ -0,0 +1,333 @@ +/* +Copyright 2016 Fred Sundvik + +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 . +*/ + +#include "gfx.h" + +#if GFX_USE_GDISP + +#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX +#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h" +#include "src/gdisp/gdisp_driver.h" + +#include "board_IS31FL3731C.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 9 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 16 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 0 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) + +#define IS31_ADDR_DEFAULT 0x74 + +#define IS31_REG_CONFIG 0x00 +// bits in reg +#define IS31_REG_CONFIG_PICTUREMODE 0x00 +#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08 +#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18 +// D2:D0 bits are starting frame for autoplay mode + +#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode + +#define IS31_REG_AUTOPLAYCTRL1 0x02 +// D6:D4 number of loops (000=infty) +// D2:D0 number of frames to be used + +#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms) + +#define IS31_REG_DISPLAYOPT 0x05 +#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames +#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x8 +// D2:D0 bits blink period time (*0.27s) + +#define IS31_REG_AUDIOSYNC 0x06 +#define IS31_REG_AUDIOSYNC_ENABLE 0x1 + +#define IS31_REG_FRAMESTATE 0x07 + +#define IS31_REG_BREATHCTRL1 0x08 +// D6:D4 fade out time (26ms*2^i) +// D2:D0 fade in time (26ms*2^i) + +#define IS31_REG_BREATHCTRL2 0x09 +#define IS31_REG_BREATHCTRL2_ENABLE 0x10 +// D2:D0 extinguish time (3.5ms*2^i) + +#define IS31_REG_SHUTDOWN 0x0A +#define IS31_REG_SHUTDOWN_OFF 0x0 +#define IS31_REG_SHUTDOWN_ON 0x1 + +#define IS31_REG_AGCCTRL 0x0B +#define IS31_REG_ADCRATE 0x0C + +#define IS31_COMMANDREGISTER 0xFD +#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine' +#define IS31_FUNCTIONREG_SIZE 0xD + +#define IS31_FRAME_SIZE 0xB4 + +#define IS31_PWM_REG 0x24 +#define IS31_PWM_SIZE 0x90 + +#define IS31_LED_MASK_SIZE 0x12 +#define IS31_SCREEN_WIDTH 16 + +#define IS31 + +//Generated by http://jared.geek.nz/2013/feb/linear-led-pwm +const unsigned char cie[256] = { + 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, + 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, + 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, + 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, + 13, 14, 14, 15, 15, 15, 16, 16, 17, 17, + 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, + 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, + 28, 28, 29, 29, 30, 31, 31, 32, 32, 33, + 34, 34, 35, 36, 37, 37, 38, 39, 39, 40, + 41, 42, 43, 43, 44, 45, 46, 47, 47, 48, + 49, 50, 51, 52, 53, 54, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 70, 71, 72, 73, 74, 75, 76, 77, 79, + 80, 81, 82, 83, 85, 86, 87, 88, 90, 91, + 92, 94, 95, 96, 98, 99, 100, 102, 103, 105, + 106, 108, 109, 110, 112, 113, 115, 116, 118, 120, + 121, 123, 124, 126, 128, 129, 131, 132, 134, 136, + 138, 139, 141, 143, 145, 146, 148, 150, 152, 154, + 155, 157, 159, 161, 163, 165, 167, 169, 171, 173, + 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, + 196, 198, 200, 202, 204, 207, 209, 211, 214, 216, + 218, 220, 223, 225, 228, 230, 232, 235, 237, 240, + 242, 245, 247, 250, 252, 255, +}; + + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +typedef struct{ + uint8_t write_buffer_offset; + uint8_t write_buffer[IS31_FRAME_SIZE]; + uint8_t frame_buffer[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH]; + uint8_t page; +}__attribute__((__packed__)) PrivData; + +// Some common routines and macros +#define PRIV(g) ((PrivData*)g->priv) + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +static GFXINLINE void write_page(GDisplay* g, uint8_t page) { + uint8_t tx[2] __attribute__((aligned(2))); + tx[0] = IS31_COMMANDREGISTER; + tx[1] = page; + write_data(g, tx, 2); +} + +static GFXINLINE void write_register(GDisplay* g, uint8_t page, uint8_t reg, uint8_t data) { + uint8_t tx[2] __attribute__((aligned(2))); + tx[0] = reg; + tx[1] = data; + write_page(g, page); + write_data(g, tx, 2); +} + +static GFXINLINE void write_ram(GDisplay *g, uint8_t page, uint16_t offset, uint16_t length) { + PRIV(g)->write_buffer_offset = offset; + write_page(g, page); + write_data(g, (uint8_t*)PRIV(g), length + 1); +} + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // The private area is the display surface. + g->priv = gfxAlloc(sizeof(PrivData)); + __builtin_memset(PRIV(g), 0, sizeof(PrivData)); + PRIV(g)->page = 0; + + // Initialise the board interface + init_board(g); + gfxSleepMilliseconds(10); + + // zero function page, all registers (assuming full_page is all zeroes) + write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); + set_hardware_shutdown(g, false); + gfxSleepMilliseconds(10); + // software shutdown + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); + gfxSleepMilliseconds(10); + // zero function page, all registers + write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE); + gfxSleepMilliseconds(10); + + + // zero all LED registers on all 8 pages, and enable the mask + __builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE); + for(uint8_t i=0; i<8; i++) { + write_ram(g, i, 0, IS31_FRAME_SIZE); + gfxSleepMilliseconds(1); + } + + // software shutdown disable (i.e. turn stuff on) + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + gfxSleepMilliseconds(10); + + // Finish Init + post_init_board(g); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + return TRUE; +} + +#if GDISP_HARDWARE_FLUSH + LLDSPEC void gdisp_lld_flush(GDisplay *g) { + // Don't flush if we don't need it. + if (!(g->flags & GDISP_FLG_NEEDFLUSH)) + return; + + PRIV(g)->page++; + PRIV(g)->page %= 2; + // TODO: some smarter algorithm for this + // We should run only one physical page at a time + // This way we don't need to send so much data, and + // we could use slightly less memory + uint8_t* src = PRIV(g)->frame_buffer; + for (int y=0;ywrite_buffer[get_led_address(g, x, y)]=cie[*src]; + ++src; + } + } + write_ram(g, PRIV(g)->page, IS31_PWM_REG, IS31_PWM_SIZE); + gfxSleepMilliseconds(1); + write_register(g, IS31_FUNCTIONREG, IS31_REG_PICTDISP, PRIV(g)->page); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_DRAWPIXEL + LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = g->p.y; + break; + } + PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x] = gdispColor2Native(g->p.color); + g->flags |= GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = g->p.y; + break; + } + return gdispNative2Color(PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x]); + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + case powerSleep: + case powerDeepSleep: + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF); + break; + case powerOn: + write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON); + break; + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + /* Rotation is handled by the drawing routines */ + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + default: + return; + } + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_CONTRAST: + return; + } + } +#endif // GDISP_NEED_CONTROL + +#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h new file mode 100644 index 000000000..bb28ad775 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h @@ -0,0 +1,36 @@ +/* +Copyright 2016 Fred Sundvik + +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 _GDISP_LLD_CONFIG_H +#define _GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_GRAY256 + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk new file mode 100644 index 000000000..16c3f80f5 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/emulator_lcd +GFXSRC += drivers/gdisp/emulator_lcd/emulator_lcd.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c new file mode 100644 index 000000000..babfe2b36 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/emulator_lcd/emulator_lcd.c @@ -0,0 +1,10 @@ +#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LCD_ERGODOX +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO +#define GDISP_SCREEN_WIDTH 128 +#define GDISP_SCREEN_HEIGHT 32 +#define ROTATE_180_IS_FLIP + +#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk new file mode 100644 index 000000000..255434432 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/emulator_led +GFXSRC += drivers/gdisp/emulator_led/emulator_led.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c new file mode 100644 index 000000000..b0ebcdc47 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/emulator_led/emulator_led.c @@ -0,0 +1,10 @@ +#define GDISP_DRIVER_VMT GDISPVMT_EMULATOR_LED_ERGODOX +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO +#define GDISP_SCREEN_WIDTH 7 +#define GDISP_SCREEN_HEIGHT 7 +#define ROTATE_180_IS_FLIP + +#include "emulator/emulator_driver_impl.h" diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h new file mode 100644 index 000000000..290571ce5 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h @@ -0,0 +1,127 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _GDISP_LLD_BOARD_H +#define _GDISP_LLD_BOARD_H + +#include "print.h" + +#define ST7565_LCD_BIAS ST7565_LCD_BIAS_9 // actually 6 +#define ST7565_ADC ST7565_ADC_NORMAL +#define ST7565_COM_SCAN ST7565_COM_SCAN_DEC +#define ST7565_PAGE_ORDER 0,1,2,3 +/* + * Custom page order for several LCD boards, e.g. HEM12864-99 + * #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3 + */ + +#define ST7565_GPIOPORT GPIOC +#define ST7565_PORT PORTC +#define ST7565_A0_PIN 7 +#define ST7565_RST_PIN 8 +#define ST7565_MOSI_PIN 6 +#define ST7565_SLCK_PIN 5 +#define ST7565_SS_PIN 4 + +#define palSetPadModeRaw(portname, bits) \ + ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits + +#define palSetPadModeNamed(portname, portmode) \ + palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode) + +#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2) +// DSPI Clock and Transfer Attributes +// Frame Size: 8 bits +// MSB First +// CLK Low by default +static const SPIConfig spi1config = { + NULL, + /* HW dependent part.*/ + ST7565_GPIOPORT, + ST7565_SS_PIN, + SPIx_CTARn_FMSZ(7) + | SPIx_CTARn_ASC(7) + | SPIx_CTARn_DT(7) + | SPIx_CTARn_CSSCK(7) + | SPIx_CTARn_PBR(0) + | SPIx_CTARn_BR(7) + //SPI_CR1_BR_0 +}; + +static bool_t st7565_is_data_mode = 1; + +static GFXINLINE void init_board(GDisplay *g) { + (void) g; + palSetPadModeNamed(A0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); + st7565_is_data_mode = 1; + palSetPadModeNamed(RST, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); + palSetPadModeRaw(MOSI, ST7565_SPI_MODE); + palSetPadModeRaw(SLCK, ST7565_SPI_MODE); + palSetPadModeRaw(SS, ST7565_SPI_MODE); + + spiInit(); + spiStart(&SPID1, &spi1config); + spiSelect(&SPID1); +} + +static GFXINLINE void post_init_board(GDisplay *g) { + (void) g; +} + +static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) { + (void) g; + if (state) { + palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN); + } + else { + palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN); + } +} + +static GFXINLINE void acquire_bus(GDisplay *g) { + (void) g; + // Only the LCD is using the SPI bus, so no need to acquire + // spiAcquireBus(&SPID1); +} + +static GFXINLINE void release_bus(GDisplay *g) { + (void) g; + // Only the LCD is using the SPI bus, so no need to release + //spiReleaseBus(&SPID1); +} + +static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { + (void) g; + if (st7565_is_data_mode) { + // The sleeps need to be at lest 10 vs 25 ns respectively + // So let's sleep two ticks, one tick might not be enough + // if we are at the end of the tick + chThdSleep(2); + palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); + chThdSleep(2); + st7565_is_data_mode = 0; + } + spiSend(&SPID1, 1, &cmd); +} + +static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { + (void) g; + if (!st7565_is_data_mode) { + // The sleeps need to be at lest 10 vs 25 ns respectively + // So let's sleep two ticks, one tick might not be enough + // if we are at the end of the tick + chThdSleep(2); + palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); + chThdSleep(2); + st7565_is_data_mode = 1; + } + spiSend(&SPID1, length, data); +} + +#endif /* _GDISP_LLD_BOARD_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk new file mode 100644 index 000000000..889a1a031 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk @@ -0,0 +1,2 @@ +GFXINC += drivers/gdisp/st7565ergodox +GFXSRC += drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c new file mode 100644 index 000000000..c33aea81a --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c @@ -0,0 +1,292 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#include "gfx.h" + +#if GFX_USE_GDISP + +#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX +#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h" +#include "src/gdisp/gdisp_driver.h" + +#include "board_ST7565.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 32 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 128 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 0 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0) + +#include "drivers/gdisp/st7565ergodox/st7565.h" + +/*===========================================================================*/ +/* Driver config defaults for backward compatibility. */ +/*===========================================================================*/ +#ifndef ST7565_LCD_BIAS + #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 +#endif +#ifndef ST7565_ADC + #define ST7565_ADC ST7565_ADC_NORMAL +#endif +#ifndef ST7565_COM_SCAN + #define ST7565_COM_SCAN ST7565_COM_SCAN_INC +#endif +#ifndef ST7565_PAGE_ORDER + #define ST7565_PAGE_ORDER 0,1,2,3 +#endif + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +typedef struct{ + bool_t buffer2; + uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8]; +}PrivData; + +// Some common routines and macros +#define PRIV(g) ((PrivData*)g->priv) +#define RAM(g) (PRIV(g)->ram) +#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } +#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } + +// Some common routines and macros +#define delay(us) gfxSleepMicroseconds(us) +#define delay_ms(ms) gfxSleepMilliseconds(ms) + +#define xyaddr(x, y) ((x) + ((y)>>3)*GDISP_SCREEN_WIDTH) +#define xybit(y) (1<<((y)&7)) + +/*===========================================================================*/ +/* Driver exported functions. */ +/*===========================================================================*/ + +/* + * As this controller can't update on a pixel boundary we need to maintain the + * the entire display surface in memory so that we can do the necessary bit + * operations. Fortunately it is a small display in monochrome. + * 64 * 128 / 8 = 1024 bytes. + */ + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // The private area is the display surface. + g->priv = gfxAlloc(sizeof(PrivData)); + PRIV(g)->buffer2 = false; + + // Initialise the board interface + init_board(g); + + // Hardware reset + setpin_reset(g, TRUE); + gfxSleepMilliseconds(20); + setpin_reset(g, FALSE); + gfxSleepMilliseconds(20); + + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_OFF); + write_cmd(g, ST7565_LCD_BIAS); + write_cmd(g, ST7565_ADC); + write_cmd(g, ST7565_COM_SCAN); + + write_cmd(g, ST7565_START_LINE | 0); + + write_cmd(g, ST7565_RESISTOR_RATIO | 0x6); + + // turn on voltage converter (VC=1, VR=0, VF=0) + write_cmd(g, ST7565_POWER_CONTROL | 0x04); + delay_ms(50); + + // turn on voltage regulator (VC=1, VR=1, VF=0) + write_cmd(g, ST7565_POWER_CONTROL | 0x06); + delay_ms(50); + + // turn on voltage follower (VC=1, VR=1, VF=1) + write_cmd(g, ST7565_POWER_CONTROL | 0x07); + delay_ms(50); + + write_cmd(g, 0xE2); + write_cmd(g, ST7565_COM_SCAN); + write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST*64/101); + //write_cmd2(g, ST7565_CONTRAST, 0); + write_cmd(g, ST7565_DISPLAY_ON); + write_cmd(g, ST7565_ALLON_NORMAL); + write_cmd(g, ST7565_INVERT_DISPLAY); + + write_cmd(g, ST7565_RMW); + + // Finish Init + post_init_board(g); + + // Release the bus + release_bus(g); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + return TRUE; +} + +#if GDISP_HARDWARE_FLUSH + LLDSPEC void gdisp_lld_flush(GDisplay *g) { + unsigned p; + + // Don't flush if we don't need it. + if (!(g->flags & GDISP_FLG_NEEDFLUSH)) + return; + + acquire_bus(g); + unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0); + for (p = 0; p < 4; p++) { + write_cmd(g, ST7565_PAGE | (p + dstOffset)); + write_cmd(g, ST7565_COLUMN_MSB | 0); + write_cmd(g, ST7565_COLUMN_LSB | 0); + write_cmd(g, ST7565_RMW); + write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH); + } + unsigned line = (PRIV(g)->buffer2 ? 32 : 0); + write_cmd(g, ST7565_START_LINE | line); + PRIV(g)->buffer2 = !PRIV(g)->buffer2; + release_bus(g); + + g->flags &= ~GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_DRAWPIXEL + LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_HEIGHT-1 - g->p.y; + y = g->p.x; + break; + } + if (gdispColor2Native(g->p.color) != Black) + RAM(g)[xyaddr(x, y)] |= xybit(y); + else + RAM(g)[xyaddr(x, y)] &= ~xybit(y); + g->flags |= GDISP_FLG_NEEDFLUSH; + } +#endif + +#if GDISP_HARDWARE_PIXELREAD + LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) { + coord_t x, y; + + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + x = g->p.x; + y = g->p.y; + break; + case GDISP_ROTATE_90: + x = g->p.y; + y = GDISP_SCREEN_HEIGHT-1 - g->p.x; + break; + case GDISP_ROTATE_180: + x = GDISP_SCREEN_WIDTH-1 - g->p.x; + y = GDISP_SCREEN_HEIGHT-1 - g->p.y; + break; + case GDISP_ROTATE_270: + x = GDISP_SCREEN_HEIGHT-1 - g->p.y; + y = g->p.x; + break; + } + return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black; + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + case powerSleep: + case powerDeepSleep: + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_OFF); + release_bus(g); + break; + case powerOn: + acquire_bus(g); + write_cmd(g, ST7565_DISPLAY_ON); + release_bus(g); + break; + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + /* Rotation is handled by the drawing routines */ + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + default: + return; + } + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_CONTRAST: + if ((unsigned)g->p.ptr > 100) + g->p.ptr = (void *)100; + acquire_bus(g); + write_cmd2(g, ST7565_CONTRAST, ((((unsigned)g->p.ptr)<<6)/101) & 0x3F); + release_bus(g); + g->g.Contrast = (unsigned)g->p.ptr; + return; + } + } +#endif // GDISP_NEED_CONTROL + +#endif // GFX_USE_GDISP diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h new file mode 100644 index 000000000..48587b9e1 --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h @@ -0,0 +1,26 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _GDISP_LLD_CONFIG_H +#define _GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing +#define GDISP_HARDWARE_DRAWPIXEL TRUE +#define GDISP_HARDWARE_PIXELREAD TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h new file mode 100644 index 000000000..48636b33d --- /dev/null +++ b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h @@ -0,0 +1,37 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _ST7565_H +#define _ST7565_H + +#define ST7565_CONTRAST 0x81 +#define ST7565_ALLON_NORMAL 0xA4 +#define ST7565_ALLON 0xA5 +#define ST7565_POSITIVE_DISPLAY 0xA6 +#define ST7565_INVERT_DISPLAY 0xA7 +#define ST7565_DISPLAY_OFF 0xAE +#define ST7565_DISPLAY_ON 0xAF + +#define ST7565_LCD_BIAS_7 0xA3 +#define ST7565_LCD_BIAS_9 0xA2 + +#define ST7565_ADC_NORMAL 0xA0 +#define ST7565_ADC_REVERSE 0xA1 + +#define ST7565_COM_SCAN_INC 0xC0 +#define ST7565_COM_SCAN_DEC 0xC8 + +#define ST7565_START_LINE 0x40 +#define ST7565_PAGE 0xB0 +#define ST7565_COLUMN_MSB 0x10 +#define ST7565_COLUMN_LSB 0x00 +#define ST7565_RMW 0xE0 + +#define ST7565_RESISTOR_RATIO 0x20 +#define ST7565_POWER_CONTROL 0x28 + +#endif /* _ST7565_H */ -- cgit v1.2.3-24-g4f1b From ad416fb1a346ff5ff51ef16ef7aaa63115fe8272 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 14:46:18 +0300 Subject: Include the main Makefile before including Ergodox infinity drivers --- keyboards/ergodox/infinity/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/ergodox/infinity/Makefile b/keyboards/ergodox/infinity/Makefile index d1ec266d0..ccb735a48 100644 --- a/keyboards/ergodox/infinity/Makefile +++ b/keyboards/ergodox/infinity/Makefile @@ -64,6 +64,10 @@ LCD_ENABLE ?= yes LED_ENABLE ?= yes LCD_BACKLIGHT_ENABLE ?= yes +ifndef QUANTUM_DIR + include ../../../Makefile +endif + ifdef LCD_ENABLE include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk endif @@ -71,7 +75,3 @@ endif ifdef LED_ENABLE include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk endif - -ifndef QUANTUM_DIR - include ../../../Makefile -endif \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 349f189e83c39dc3387b9358d0d2f372a5bbdf2b Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 21:49:48 +0300 Subject: Move Ergodox readme from ez subfolder to parent --- keyboards/ergodox/ez/readme.md | 44 ------------------------------------------ keyboards/ergodox/readme.md | 44 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 44 deletions(-) delete mode 100644 keyboards/ergodox/ez/readme.md create mode 100644 keyboards/ergodox/readme.md diff --git a/keyboards/ergodox/ez/readme.md b/keyboards/ergodox/ez/readme.md deleted file mode 100644 index 67a5fb095..000000000 --- a/keyboards/ergodox/ez/readme.md +++ /dev/null @@ -1,44 +0,0 @@ -# Getting started - -There are two main ways you could customize the ErgoDox EZ. - -## The Easy Way: Use an existing firmware file and just flash it - -1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). Some Linux distributions already provide a binary (may be called `teensy-loader-cli`), so you may prefer to use this. -2. Find a firmware file you like. You can find a few if these in the keymaps subdirectory right here. The file you need ends with .hex, and you can look at its .c counterpart (or its PNG image) to see what you'll be getting. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. -3. Download the firmware file -4. Connect the keyboard, press its Reset button (gently insert a paperclip into the hole in the top-right corner) and flash it using the Teensy loader you installed on step 1 and the firmware you downloaded. - -## More technical: create your own totally custom firmware by editing the source files. - -This requires a little bit of familiarity with coding. - -1. Go to https://github.com/jackhumbert/qmk_firmware and read the readme at the base of this repository, top to bottom. Then come back here :) -2. Clone the repository (download it) -3. Set up a build environment as per [the build guide](/doc/BUILD_GUIDE.md) - - Using a Mac and have homebrew? just run `brew tap osx-cross/avr && brew install avr-libc` -4. Copy `keyboards/ergodox_ez/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) -5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. -6. Compile your firmware by running `make keymap=your_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_your_name.hex`, e.g. `ergodox_ez_german.hex`. -6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successfull build by running `make teensy keymap=your_name`. -7. Submit your work as a pull request to this repository, so others can also use it. :) See below on specifics. - -Good luck! :) - -## Contributing your keymap - -The ErgoDox EZ firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed almost 20 user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox EZ. To make it easy for these people to use your layout, I recommend submitting your PR in the following format. - -1. All work goes inside your keymap subdirectory (`keymaps/german` in this example). -2. `keymap.c` - this is your actual keymap file; please update the ASCII comments in the file so they correspond with what you did. -3. `readme.md` - a readme file, which GitHub would display by default when people go to your directory. Explain what's different about your keymap, what you tweaked or how it works. No specific format to follow, just communicate what you did. :) -4. Any graphics you wish to add. This is absolutely not a must. If you feel like it, you can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to make something and grab a screenshot, but it's really not a must. If you do have graphics, your readme can just embed the graphic as a link, just like I did with the default layout. - - -## Finding the keycodes you need - -Let's say you want a certain key in your layout to send a colon; to figure out what keycode to use to make it do that, you're going to need `quantum/keymap_common.h`. - -That file contains a big list of all of the special, fancy keys (like, being able to send % on its own and whatnot). - -If you want to send a plain vanilla key, you can look up its code under `doc/keycode.txt`. That's where all the boring keys hang out. diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md new file mode 100644 index 000000000..67a5fb095 --- /dev/null +++ b/keyboards/ergodox/readme.md @@ -0,0 +1,44 @@ +# Getting started + +There are two main ways you could customize the ErgoDox EZ. + +## The Easy Way: Use an existing firmware file and just flash it + +1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). Some Linux distributions already provide a binary (may be called `teensy-loader-cli`), so you may prefer to use this. +2. Find a firmware file you like. You can find a few if these in the keymaps subdirectory right here. The file you need ends with .hex, and you can look at its .c counterpart (or its PNG image) to see what you'll be getting. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. +3. Download the firmware file +4. Connect the keyboard, press its Reset button (gently insert a paperclip into the hole in the top-right corner) and flash it using the Teensy loader you installed on step 1 and the firmware you downloaded. + +## More technical: create your own totally custom firmware by editing the source files. + +This requires a little bit of familiarity with coding. + +1. Go to https://github.com/jackhumbert/qmk_firmware and read the readme at the base of this repository, top to bottom. Then come back here :) +2. Clone the repository (download it) +3. Set up a build environment as per [the build guide](/doc/BUILD_GUIDE.md) + - Using a Mac and have homebrew? just run `brew tap osx-cross/avr && brew install avr-libc` +4. Copy `keyboards/ergodox_ez/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) +5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. +6. Compile your firmware by running `make keymap=your_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_your_name.hex`, e.g. `ergodox_ez_german.hex`. +6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successfull build by running `make teensy keymap=your_name`. +7. Submit your work as a pull request to this repository, so others can also use it. :) See below on specifics. + +Good luck! :) + +## Contributing your keymap + +The ErgoDox EZ firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed almost 20 user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox EZ. To make it easy for these people to use your layout, I recommend submitting your PR in the following format. + +1. All work goes inside your keymap subdirectory (`keymaps/german` in this example). +2. `keymap.c` - this is your actual keymap file; please update the ASCII comments in the file so they correspond with what you did. +3. `readme.md` - a readme file, which GitHub would display by default when people go to your directory. Explain what's different about your keymap, what you tweaked or how it works. No specific format to follow, just communicate what you did. :) +4. Any graphics you wish to add. This is absolutely not a must. If you feel like it, you can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to make something and grab a screenshot, but it's really not a must. If you do have graphics, your readme can just embed the graphic as a link, just like I did with the default layout. + + +## Finding the keycodes you need + +Let's say you want a certain key in your layout to send a colon; to figure out what keycode to use to make it do that, you're going to need `quantum/keymap_common.h`. + +That file contains a big list of all of the special, fancy keys (like, being able to send % on its own and whatnot). + +If you want to send a plain vanilla key, you can look up its code under `doc/keycode.txt`. That's where all the boring keys hang out. -- cgit v1.2.3-24-g4f1b From 44cefcb40a8789d8d7965e645d5cd155b6d16370 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 22:08:01 +0300 Subject: Refer to the right path in the readme --- keyboards/ergodox/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md index 67a5fb095..c99c8d82b 100644 --- a/keyboards/ergodox/readme.md +++ b/keyboards/ergodox/readme.md @@ -17,7 +17,7 @@ This requires a little bit of familiarity with coding. 2. Clone the repository (download it) 3. Set up a build environment as per [the build guide](/doc/BUILD_GUIDE.md) - Using a Mac and have homebrew? just run `brew tap osx-cross/avr && brew install avr-libc` -4. Copy `keyboards/ergodox_ez/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) +4. Copy `keyboards/ergodox/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) 5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. 6. Compile your firmware by running `make keymap=your_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_your_name.hex`, e.g. `ergodox_ez_german.hex`. 6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successfull build by running `make teensy keymap=your_name`. -- cgit v1.2.3-24-g4f1b From c65da1f2089e53b051cd10a240e14d2335c6d8e6 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 22:52:26 +0300 Subject: Unify the ErgoDox EZ and Infinity documentation --- keyboards/ergodox/readme.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md index c99c8d82b..8cd553ee1 100644 --- a/keyboards/ergodox/readme.md +++ b/keyboards/ergodox/readme.md @@ -1,17 +1,20 @@ # Getting started -There are two main ways you could customize the ErgoDox EZ. +There are two main ways you could customize the ErgoDox (EZ and Infinity) ## The Easy Way: Use an existing firmware file and just flash it +This does not work for Infinity ErgoDox yet, you need to compile the firmware according to the instructions below + 1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). Some Linux distributions already provide a binary (may be called `teensy-loader-cli`), so you may prefer to use this. -2. Find a firmware file you like. You can find a few if these in the keymaps subdirectory right here. The file you need ends with .hex, and you can look at its .c counterpart (or its PNG image) to see what you'll be getting. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. +2. Find a firmware file you like. You can find a few of these in the keymaps subdirectory right here. The file you need ends with .hex, and you can look at its .c counterpart (or its PNG image) to see what you'll be getting. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. 3. Download the firmware file 4. Connect the keyboard, press its Reset button (gently insert a paperclip into the hole in the top-right corner) and flash it using the Teensy loader you installed on step 1 and the firmware you downloaded. -## More technical: create your own totally custom firmware by editing the source files. +## More technical: compile an existing keymap, or create your own totally custom firmware by editing the source files. -This requires a little bit of familiarity with coding. +This requires a little bit of familiarity with coding. +If you are just compiling and existing keymap and don't want to create your own, you can skip step 4, 5 and 8. 1. Go to https://github.com/jackhumbert/qmk_firmware and read the readme at the base of this repository, top to bottom. Then come back here :) 2. Clone the repository (download it) @@ -19,15 +22,17 @@ This requires a little bit of familiarity with coding. - Using a Mac and have homebrew? just run `brew tap osx-cross/avr && brew install avr-libc` 4. Copy `keyboards/ergodox/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) 5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. -6. Compile your firmware by running `make keymap=your_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_your_name.hex`, e.g. `ergodox_ez_german.hex`. -6. Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successfull build by running `make teensy keymap=your_name`. -7. Submit your work as a pull request to this repository, so others can also use it. :) See below on specifics. +6. Compile your firmware by running `make keymap=keymap_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_keymap_name.hex`, e.g. `ergodox_ez_german.hex`. For **Infinity ErgoDox** you need to add `subproject=infinity` to the make command. +7. **ErgoDox EZ** - Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successful build by running `make teensy keymap=your_name`. + + **Infinity ErgoDox** - Flash the firmware by running `make dfu-util keymap=your_name` +8. Submit your work as a pull request to this repository, so others can also use it. :) See below on specifics. Good luck! :) ## Contributing your keymap -The ErgoDox EZ firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed almost 20 user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox EZ. To make it easy for these people to use your layout, I recommend submitting your PR in the following format. +The ErgoDox firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed almost 20 user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox. To make it easy for these people to use your layout, I recommend submitting your PR in the following format. 1. All work goes inside your keymap subdirectory (`keymaps/german` in this example). 2. `keymap.c` - this is your actual keymap file; please update the ASCII comments in the file so they correspond with what you did. -- cgit v1.2.3-24-g4f1b From 401dd090772936a75667a5d1510ff580d6d568bd Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 22:55:20 +0300 Subject: A couple of more Ergodox readme fixes --- keyboards/ergodox/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md index 8cd553ee1..983559c76 100644 --- a/keyboards/ergodox/readme.md +++ b/keyboards/ergodox/readme.md @@ -23,9 +23,9 @@ If you are just compiling and existing keymap and don't want to create your own, 4. Copy `keyboards/ergodox/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) 5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. 6. Compile your firmware by running `make keymap=keymap_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_keymap_name.hex`, e.g. `ergodox_ez_german.hex`. For **Infinity ErgoDox** you need to add `subproject=infinity` to the make command. -7. **ErgoDox EZ** - Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successful build by running `make teensy keymap=your_name`. +7. **ErgoDox EZ** - Flash this hex file using the [Teensy loader](https://www.pjrc.com/teensy/loader.html) as described in step 4 in the "Easy Way" above. If you prefer you can automatically flash the hex file after successful build by running `make teensy keymap=keymap_name`. - **Infinity ErgoDox** - Flash the firmware by running `make dfu-util keymap=your_name` + **Infinity ErgoDox** - Flash the firmware by running `make dfu-util keymap=keymap_name subproject=infinity` 8. Submit your work as a pull request to this repository, so others can also use it. :) See below on specifics. Good luck! :) -- cgit v1.2.3-24-g4f1b From 6e8a5aca9d7a955a6037a6db8a6e9068354db894 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 10 Jul 2016 23:07:00 +0300 Subject: Fix typo in the readme. --- keyboards/ergodox/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md index 983559c76..9afa47410 100644 --- a/keyboards/ergodox/readme.md +++ b/keyboards/ergodox/readme.md @@ -14,7 +14,7 @@ This does not work for Infinity ErgoDox yet, you need to compile the firmware ac ## More technical: compile an existing keymap, or create your own totally custom firmware by editing the source files. This requires a little bit of familiarity with coding. -If you are just compiling and existing keymap and don't want to create your own, you can skip step 4, 5 and 8. +If you are just compiling an existing keymap and don't want to create your own, you can skip step 4, 5 and 8. 1. Go to https://github.com/jackhumbert/qmk_firmware and read the readme at the base of this repository, top to bottom. Then come back here :) 2. Clone the repository (download it) -- cgit v1.2.3-24-g4f1b From 566c79554ebd6e17d161ad488ce807ea7e8b24db Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Tue, 12 Jul 2016 17:50:06 +0300 Subject: Small fix for infinity include guard --- keyboards/ergodox/infinity/infinity.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/ergodox/infinity/infinity.h b/keyboards/ergodox/infinity/infinity.h index 83ce6444c..fec9e565c 100644 --- a/keyboards/ergodox/infinity/infinity.h +++ b/keyboards/ergodox/infinity/infinity.h @@ -1,5 +1,5 @@ -#ifndef KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ -#define KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ +#ifndef KEYBOARDS_ERGODOX_INFINITY_INFINITY_H_ +#define KEYBOARDS_ERGODOX_INFINITY_INFINITY_H_ #include "quantum.h" @@ -107,4 +107,4 @@ inline void ergodox_led_all_set(uint8_t n) { { B80, B81, B82, B83, B84 } \ } -#endif /* KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ */ +#endif /* KEYBOARDS_ERGODOX_INFINITY_INFINITY_H_ */ -- cgit v1.2.3-24-g4f1b From 7d55951050016f2cd9af80c7129bab3200abc810 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Fri, 29 Jul 2016 22:38:06 +0300 Subject: Fix the quick aliases documentation section Also move all keyboard customization documentation under the "Going Beyond the keycodes" heading. --- readme.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/readme.md b/readme.md index f717f8e4c..45af1b0c3 100644 --- a/readme.md +++ b/readme.md @@ -229,10 +229,18 @@ For a value of `4` for this imaginary setting. So we `undef` it first, then `def You can then override any settings, rather than having to copy and paste the whole thing. -## Going beyond the keycodes +# Going beyond the keycodes Aside from the [basic keycodes](doc/keycode.txt), your keymap can include shortcuts to common operations. +## Quick aliases to common actions + +Your keymap can include shortcuts to common operations (called "function actions" in tmk). + +These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk `ACTION_*` functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/doc/keymap.md#2-action). + +Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them. + ### Switching and toggling layers `MO(layer)` - momentary switch to *layer*. As soon as you let go of the key, the layer is deactivated and you pop back out to the previous layer. When you apply this to a key, that same key must be set as `KC_TRNS` on the destination layer. Otherwise, you won't make it back to the original layer when you release the key (and you'll get a keycode sent). You can only switch to layers *above* your current layer. If you're on layer 0 and you use `MO(1)`, that will switch to layer 1 just fine. But if you include `MO(3)` on layer 5, that won't do anything for you -- because layer 3 is lower than layer 5 on the stack. @@ -310,7 +318,7 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift. -### Space Cadet Shift: The future, built in +## Space Cadet Shift: The future, built in Steve Losh [described](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) the Space Cadet Shift quite well. Essentially, you hit the left Shift on its own, and you get an opening parenthesis; hit the right Shift on its own, and you get the closing one. When hit with other keys, the Shift key keeps working as it always does. Yes, it's as cool as it sounds. @@ -335,7 +343,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration This is just to keep the keyboard from going into command mode when you hold both Shift keys at the same time. -### The Leader key: A new kind of modifier +## The Leader key: A new kind of modifier If you've ever used Vim, you know what a Leader key is. If not, you're about to discover a wonderful concept. :) Instead of hitting Alt+Shift+W for example (holding down three keys at the same time), what if you could hit a _sequence_ of keys instead? So you'd hit our special modifier (the Leader key), followed by W and then C (just a rapid succession of keys), and something would happen. @@ -373,7 +381,7 @@ void matrix_scan_user(void) { As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS` and `SEQ_THREE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously. -### Tap Dance: A single key can do 3, 5, or 100 different things +## Tap Dance: A single key can do 3, 5, or 100 different things Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a colon. Hit it three times, and your keyboard's LEDs do a wild dance. That's just one example of what Tap Dance can do. It's one of the nicest community-contributed features in the firmware, conceived and created by [algernon](https://github.com/algernon) in [#451](https://github.com/jackhumbert/qmk_firmware/pull/451). Here's how algernon describes the feature: @@ -409,7 +417,7 @@ Our next stop is `matrix_scan_tap_dance()`. This handles the timeout of tap-danc For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros. -#### Examples +### Examples Here's a simple example for a single definition: @@ -518,11 +526,11 @@ const qk_tap_dance_action_t tap_dance_actions[] = { }; ``` -### Temporarily setting the default layer +## Temporarily setting the default layer `DF(layer)` - sets default layer to *layer*. The default layer is the one at the "bottom" of the layer stack - the ultimate fallback layer. This currently does not persist over power loss. When you plug the keyboard back in, layer 0 will always be the default. It is theoretically possible to work around that, but that's not what `DF` does. -### Prevent stuck modifiers +## Prevent stuck modifiers Consider the following scenario: @@ -543,12 +551,6 @@ This option uses 5 bytes of memory per every 8 keys on the keyboard rounded up (5 bits per key). For example on Planck (48 keys) it uses (48/8)\*5 = 30 bytes. -### Remember: These are just aliases - -These functions work the same way that their `ACTION_*` functions do - they're just quick aliases. To dig into all of the tmk ACTION_* functions, please see the [TMK documentation](https://github.com/jackhumbert/qmk_firmware/blob/master/doc/keymap.md#2-action). - -Instead of using `FNx` when defining `ACTION_*` functions, you can use `F(x)` - the benefit here is being able to use more than 32 function actions (up to 4096), if you happen to need them. - ## Macro shortcuts: Send a whole string when pressing just one key Instead of using the `ACTION_MACRO` function, you can simply use `M(n)` to access macro *n* - *n* will get passed into the `action_get_macro` as the `id`, and you can use a switch statement to trigger it. This gets called on the keydown and keyup, so you'll need to use an if statement testing `record->event.pressed` (see keymap_default.c). -- cgit v1.2.3-24-g4f1b From 8a9bf1f1653a5029ffd8f1e1171cd0b16bc2bc71 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 30 Jul 2016 08:37:30 +0200 Subject: Update some obsolete references Some links were still pointing to `/keyboards/ergodox_ez`, while the directory is `/keyboards/erdogox` now. Not all references have been updated, and some of the text here and there may need updating to mention the ErgoDox Infinity too, but that's out of the scope for this quick fix. Signed-off-by: Gergely Nagy --- Dockerfile | 2 +- Vagrantfile | 2 +- doc/TMK_README.md | 2 +- doc/VAGRANT_GUIDE.md | 4 ++-- keyboards/ergodox/keymaps/supercoder/readme.md | 2 +- keyboards/readme.md | 2 +- readme.md | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 96ace4ec6..578d009dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN apt-get install --no-install-recommends -y build-essential \ RUN apt-get clean RUN rm -rf /var/lib/apt/lists/* -ENV keyboard=ergodox_ez +ENV keyboard=ergodox ENV keymap=default VOLUME /qmk diff --git a/Vagrantfile b/Vagrantfile index 8cadeaddf..389b688ae 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -91,7 +91,7 @@ Vagrant.configure(2) do |config| Or you can copy and paste the example line below. - cd /vagrant; cd keyboards; cd ergodox_ez; make clean; make + cd /vagrant; cd keyboards; cd ergodox; make clean; make EOT diff --git a/doc/TMK_README.md b/doc/TMK_README.md index 6164dacd3..f3d96717a 100644 --- a/doc/TMK_README.md +++ b/doc/TMK_README.md @@ -34,7 +34,7 @@ You can find some keyboard specific projects under `converter` and `keyboard` di * [atomic](keyboards/atomic/) - [Atomic] Ortholinear 60% keyboard ### Ergodox EZ -* [ergodox_ez](keyboards/ergodox_ez) - [Ergodox_EZ] Assembled split keyboard +* [ergodox_ez](keyboards/ergodox/ez) - [Ergodox_EZ] Assembled split keyboard ## Other projects diff --git a/doc/VAGRANT_GUIDE.md b/doc/VAGRANT_GUIDE.md index 62044b7f7..c9958e16b 100644 --- a/doc/VAGRANT_GUIDE.md +++ b/doc/VAGRANT_GUIDE.md @@ -20,7 +20,7 @@ See [/doc/keymap.md](/doc/keymap.md). ## Flashing the firmware -The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](/keyboards/ergodox_ez/readme.md) gives a great example. +The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](/keyboards/ergodox/readme.md) gives a great example. If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version. - \ No newline at end of file + diff --git a/keyboards/ergodox/keymaps/supercoder/readme.md b/keyboards/ergodox/keymaps/supercoder/readme.md index 97bf7f583..8ef96eddf 100644 --- a/keyboards/ergodox/keymaps/supercoder/readme.md +++ b/keyboards/ergodox/keymaps/supercoder/readme.md @@ -23,7 +23,7 @@ your own: ``` $ git clone https://github.com/jackhumbert/qmk_firmware.git -$ cd qmk_firmware/keyboards/ergodox_ez +$ cd qmk_firmware/keyboards/ergodox $ git clone https://github.com/algernon/ergodox-supercoder.git keymaps/supercoder $ make KEYMAP=supercoder ``` diff --git a/keyboards/readme.md b/keyboards/readme.md index e97986546..f6c90b1f6 100644 --- a/keyboards/readme.md +++ b/keyboards/readme.md @@ -17,7 +17,7 @@ What makes OLKB keyboards shine is a combo of lean aesthetics, compact size, and Made in Taiwan using advanced robotic manufacturing, the ErgoDox EZ is a fully-assembled, premium ergonomic keyboard. Its split design allows you to place both halves shoulder width, and its custom-made wrist rests and tilt/tent kit make for incredibly comfortable typing. Available on [ergodox-ez.com](https://ergodox-ez.com). -* [ErgoDox EZ](/keyboards/ergodox_ez/) - Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types. +* [ErgoDox EZ](/keyboards/ergodox/) - Our one and only product. Yes, it's that awesome. Comes with either printed or blank keycaps, and 7 different keyswitch types. ### Clueboard - Zach White diff --git a/readme.md b/readme.md index 45af1b0c3..c3d866f36 100644 --- a/readme.md +++ b/readme.md @@ -82,9 +82,9 @@ If this is a bit complex for you, Docker might be the turn-key solution you need ```bash # You'll run this every time you want to build a keymap # modify the keymap and keyboard assigment to compile what you want -# defaults are ergodox_ez/default +# defaults are ergodox/default -docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware +docker run -e keymap=gwen -e keyboard=ergodox --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware ``` -- cgit v1.2.3-24-g4f1b From f78a994355e2fb23555b018fa631778b1b117b7f Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 23 Jul 2016 19:06:19 -0700 Subject: Add "jeebak" keymap folder as a copy of the "default" folder --- keyboards/planck/keymaps/jeebak/Makefile | 25 +++ keyboards/planck/keymaps/jeebak/keymap.c | 314 ++++++++++++++++++++++++++++++ keyboards/planck/keymaps/jeebak/readme.md | 2 + 3 files changed, 341 insertions(+) create mode 100644 keyboards/planck/keymaps/jeebak/Makefile create mode 100644 keyboards/planck/keymaps/jeebak/keymap.c create mode 100644 keyboards/planck/keymaps/jeebak/readme.md diff --git a/keyboards/planck/keymaps/jeebak/Makefile b/keyboards/planck/keymaps/jeebak/Makefile new file mode 100644 index 000000000..581e08cd0 --- /dev/null +++ b/keyboards/planck/keymaps/jeebak/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c new file mode 100644 index 000000000..5f71ae7d1 --- /dev/null +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -0,0 +1,314 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md new file mode 100644 index 000000000..de9680b49 --- /dev/null +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + -- cgit v1.2.3-24-g4f1b From 7d0345ef25b5e1924f1e98c76d78607778e0b17d Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 30 Jul 2016 01:52:33 -0700 Subject: Add IN_LIKE_FLINT song --- quantum/audio/song_list.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index fc6fcdeef..8022ca672 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -28,6 +28,14 @@ Q__NOTE(_E4), Q__NOTE(_C4), \ Q__NOTE(_E4), +/* Requires: PLAY_NOTE_ARRAY(..., ..., STACCATO); */ +#define IN_LIKE_FLINT \ + E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), \ + E__NOTE(_AS4), E__NOTE(_B4), QD_NOTE(_CS4), \ + E__NOTE(_B4), E__NOTE(_CS4), QD_NOTE(_DS4), \ + E__NOTE(_CS4), E__NOTE(_B4), QD_NOTE(_AS4), \ + E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), + #define GOODBYE_SOUND \ E__NOTE(_E7), \ E__NOTE(_A6), \ -- cgit v1.2.3-24-g4f1b From a01d703a58174f4dd67c0cd34e8572244da78efd Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Wed, 27 Jul 2016 01:50:46 -0400 Subject: initial commit of sethbc keymap --- keyboards/ergodox_ez/keymaps/sethbc/Makefile | 14 ++++ keyboards/ergodox_ez/keymaps/sethbc/keymap.c | 102 ++++++++++++++++++++++++++ keyboards/ergodox_ez/keymaps/sethbc/readme.md | 3 + 3 files changed, 119 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/sethbc/Makefile create mode 100644 keyboards/ergodox_ez/keymaps/sethbc/keymap.c create mode 100644 keyboards/ergodox_ez/keymaps/sethbc/readme.md diff --git a/keyboards/ergodox_ez/keymaps/sethbc/Makefile b/keyboards/ergodox_ez/keymaps/sethbc/Makefile new file mode 100644 index 000000000..4422ec6b7 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/sethbc/Makefile @@ -0,0 +1,14 @@ +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 diff --git a/keyboards/ergodox_ez/keymaps/sethbc/keymap.c b/keyboards/ergodox_ez/keymaps/sethbc/keymap.c new file mode 100644 index 000000000..533519025 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/sethbc/keymap.c @@ -0,0 +1,102 @@ +#include "ergodox_ez.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define FN1 1 // symbols +#define FN2 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_BSLS, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(FN2), + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(FN1), + KC_LGUI, KC_GRV, KC_BSLS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + // right hand + MO(FN2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MO(FN1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RGUI, + KC_RALT, KC_RCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), +// FN1 +[FN1] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +// FN2 +[FN2] = KEYMAP( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_NLCK, KC_PSLS, KC_PAST, KC_PAST, KC_PMNS, KC_BSPC, + KC_TRNS, KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_BSPC, + KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PENT, + KC_TRNS, KC_NO, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PENT, + KC_P0, KC_PDOT, KC_SLSH, KC_PENT, KC_PENT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox_ez/keymaps/sethbc/readme.md b/keyboards/ergodox_ez/keymaps/sethbc/readme.md new file mode 100644 index 000000000..510b2f99c --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/sethbc/readme.md @@ -0,0 +1,3 @@ +# sethbc's Ergodox EZ keymap + +Largely based on the Ergodox Infinity default keymap -- cgit v1.2.3-24-g4f1b From 694567f799b199c26852a0c3d3e0f46e1f646878 Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Wed, 27 Jul 2016 01:53:43 -0400 Subject: update makefile --- keyboards/ergodox_ez/keymaps/sethbc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/sethbc/Makefile b/keyboards/ergodox_ez/keymaps/sethbc/Makefile index 4422ec6b7..8c4ff8784 100644 --- a/keyboards/ergodox_ez/keymaps/sethbc/Makefile +++ b/keyboards/ergodox_ez/keymaps/sethbc/Makefile @@ -2,7 +2,7 @@ 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 +COMMAND_ENABLE = no # 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 -- cgit v1.2.3-24-g4f1b From a6ec5fa74a970d29c6b965fdc2e63846a212882d Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Sat, 30 Jul 2016 10:46:13 -0400 Subject: rebase --- keyboards/ergodox/keymaps/sethbc/Makefile | 14 ++++ keyboards/ergodox/keymaps/sethbc/keymap.c | 102 ++++++++++++++++++++++++++ keyboards/ergodox/keymaps/sethbc/readme.md | 3 + keyboards/ergodox_ez/keymaps/sethbc/Makefile | 14 ---- keyboards/ergodox_ez/keymaps/sethbc/keymap.c | 102 -------------------------- keyboards/ergodox_ez/keymaps/sethbc/readme.md | 3 - 6 files changed, 119 insertions(+), 119 deletions(-) create mode 100644 keyboards/ergodox/keymaps/sethbc/Makefile create mode 100644 keyboards/ergodox/keymaps/sethbc/keymap.c create mode 100644 keyboards/ergodox/keymaps/sethbc/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/sethbc/Makefile delete mode 100644 keyboards/ergodox_ez/keymaps/sethbc/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/sethbc/readme.md diff --git a/keyboards/ergodox/keymaps/sethbc/Makefile b/keyboards/ergodox/keymaps/sethbc/Makefile new file mode 100644 index 000000000..8c4ff8784 --- /dev/null +++ b/keyboards/ergodox/keymaps/sethbc/Makefile @@ -0,0 +1,14 @@ +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 = no # 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 diff --git a/keyboards/ergodox/keymaps/sethbc/keymap.c b/keyboards/ergodox/keymaps/sethbc/keymap.c new file mode 100644 index 000000000..6846c4d52 --- /dev/null +++ b/keyboards/ergodox/keymaps/sethbc/keymap.c @@ -0,0 +1,102 @@ +#include "ergodox.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define FN1 1 // symbols +#define FN2 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_BSLS, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(FN2), + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(FN1), + KC_LGUI, KC_GRV, KC_BSLS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + // right hand + MO(FN2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MO(FN1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RGUI, + KC_RALT, KC_RCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), +// FN1 +[FN1] = KEYMAP( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +// FN2 +[FN2] = KEYMAP( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_NLCK, KC_PSLS, KC_PAST, KC_PAST, KC_PMNS, KC_BSPC, + KC_TRNS, KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_BSPC, + KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PENT, + KC_TRNS, KC_NO, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PENT, + KC_P0, KC_PDOT, KC_SLSH, KC_PENT, KC_PENT, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/sethbc/readme.md b/keyboards/ergodox/keymaps/sethbc/readme.md new file mode 100644 index 000000000..510b2f99c --- /dev/null +++ b/keyboards/ergodox/keymaps/sethbc/readme.md @@ -0,0 +1,3 @@ +# sethbc's Ergodox EZ keymap + +Largely based on the Ergodox Infinity default keymap diff --git a/keyboards/ergodox_ez/keymaps/sethbc/Makefile b/keyboards/ergodox_ez/keymaps/sethbc/Makefile deleted file mode 100644 index 8c4ff8784..000000000 --- a/keyboards/ergodox_ez/keymaps/sethbc/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -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 = no # 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 diff --git a/keyboards/ergodox_ez/keymaps/sethbc/keymap.c b/keyboards/ergodox_ez/keymaps/sethbc/keymap.c deleted file mode 100644 index 533519025..000000000 --- a/keyboards/ergodox_ez/keymaps/sethbc/keymap.c +++ /dev/null @@ -1,102 +0,0 @@ -#include "ergodox_ez.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define FN1 1 // symbols -#define FN2 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_BSLS, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(FN2), - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(FN1), - KC_LGUI, KC_GRV, KC_BSLS, KC_LEFT, KC_RGHT, - KC_LCTL, KC_LALT, - KC_HOME, - KC_SPC, KC_BSPC, KC_END, - // right hand - MO(FN2), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MO(FN1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RGUI, - KC_RALT, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC - ), -// FN1 -[FN1] = KEYMAP( - // left hand - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -// FN2 -[FN2] = KEYMAP( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_NLCK, KC_PSLS, KC_PAST, KC_PAST, KC_PMNS, KC_BSPC, - KC_TRNS, KC_NO, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_BSPC, - KC_NO, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PENT, - KC_TRNS, KC_NO, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PENT, - KC_P0, KC_PDOT, KC_SLSH, KC_PENT, KC_PENT, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboards/ergodox_ez/keymaps/sethbc/readme.md b/keyboards/ergodox_ez/keymaps/sethbc/readme.md deleted file mode 100644 index 510b2f99c..000000000 --- a/keyboards/ergodox_ez/keymaps/sethbc/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# sethbc's Ergodox EZ keymap - -Largely based on the Ergodox Infinity default keymap -- cgit v1.2.3-24-g4f1b From eb1a06d3ae585dfe0af2b2809a1b22400fc0387f Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 23 Jul 2016 19:59:22 -0700 Subject: Tap for Esc, hold for Control --- keyboards/planck/keymaps/jeebak/keymap.c | 63 +++++++++++++++++--------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 5f71ae7d1..01f102c71 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -37,58 +37,61 @@ enum planck_keycodes { #define _______ KC_TRNS #define XXXXXXX KC_NO +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' + * ,---------------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |----------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Enter | + * |----------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `---------------------------------------------------------------------------------------' */ [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' + * ,---------------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | " | + * |----------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift | Z | X | C | V | B | K | M | , | . | / |Enter | + * |----------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `---------------------------------------------------------------------------------------' */ [_COLEMAK] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' + * ,---------------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | / | + * |----------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |----------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `---------------------------------------------------------------------------------------' */ [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -- cgit v1.2.3-24-g4f1b From b5d77440b632ecb637f880d5a7c4362c365fde0d Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Mon, 25 Jul 2016 20:25:03 -0700 Subject: Add personalized TouchCursor layer --- keyboards/planck/keymaps/jeebak/keymap.c | 34 ++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 01f102c71..84fee8070 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -20,6 +20,7 @@ extern keymap_config_t keymap_config; #define _LOWER 3 #define _RAISE 4 #define _PLOVER 5 +#define _TOUCHCURSOR 6 #define _ADJUST 16 enum planck_keycodes { @@ -39,6 +40,8 @@ enum planck_keycodes { // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor +// ^-- Requires KC_TRNS / _______ for the trigger key in the destination layer const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -50,14 +53,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+------| * | Shift | Z | X | C | V | B | N | M | , | . | / |Enter | * |----------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up |Right | * `---------------------------------------------------------------------------------------' */ [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Colemak @@ -68,14 +71,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+------| * | Shift | Z | X | C | V | B | K | M | , | . | / |Enter | * |----------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up |Right | * `---------------------------------------------------------------------------------------' */ [_COLEMAK] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Dvorak @@ -86,14 +89,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+------| * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Enter | * |----------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up |Right | * `---------------------------------------------------------------------------------------' */ [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, {CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Lower @@ -132,6 +135,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, +/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations + * ,-----------------------------------------------------------------------------------. + * | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + | | Alt |Space | | | | PgUp | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | | ` | PgDn | Del | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_TOUCHCURSOR] = { + {_______, _______, _______, KC_LSFT, KC_LGUI, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, + {_______, KC_LALT, KC_SPC, _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, + {_______, _______, _______, _______, _______, KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. * | # | # | # | # | # | # | # | # | # | # | # | # | -- cgit v1.2.3-24-g4f1b From ad7e4af45c103866149e3a66096a1e46d72f1072 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Tue, 26 Jul 2016 13:34:01 -0700 Subject: Tap for Enter, hold for Shift --- keyboards/planck/keymaps/jeebak/keymap.c | 61 ++++++++++++++++---------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 84fee8070..04bc57fa7 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -42,60 +42,61 @@ enum planck_keycodes { #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor // ^-- Requires KC_TRNS / _______ for the trigger key in the destination layer +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty - * ,---------------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |----------+------+------+------+------+-------------+------+------+------+------+------| - * | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |----------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift | Z | X | C | V | B | N | M | , | . | / |Enter | - * |----------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up |Right | - * `---------------------------------------------------------------------------------------' + * ,-----------------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+--------| + * | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |----------+------+------+------+------+------|------+------+------+------+------+--------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent | + * |----------+------+------+------+------+------+------+------+------+------+------+--------| + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up | Right | + * `-----------------------------------------------------------------------------------------' */ [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Colemak - * ,---------------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |----------+------+------+------+------+-------------+------+------+------+------+------| - * | Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | " | - * |----------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift | Z | X | C | V | B | K | M | , | . | / |Enter | - * |----------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up |Right | - * `---------------------------------------------------------------------------------------' + * ,-----------------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+--------| + * | Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | " | + * |----------+------+------+------+------+------|------+------+------+------+------+--------| + * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent | + * |----------+------+------+------+------+------+------+------+------+------+------+--------| + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up | Right | + * `-----------------------------------------------------------------------------------------' */ [_COLEMAK] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Dvorak - * ,---------------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |----------+------+------+------+------+-------------+------+------+------+------+------| - * | Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | / | - * |----------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |----------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up |Right | - * `---------------------------------------------------------------------------------------' + * ,-----------------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |----------+------+------+------+------+-------------+------+------+------+------+--------| + * | Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | / | + * |----------+------+------+------+------+------|------+------+------+------+------+--------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent | + * |----------+------+------+------+------+------+------+------+------+------+------+--------| + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up | Right | + * `-----------------------------------------------------------------------------------------' */ [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, {CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -- cgit v1.2.3-24-g4f1b From 6baf77d8fbb479df09ab2b96a09d823c76d45b95 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Tue, 26 Jul 2016 20:14:09 -0700 Subject: Move _RAISE symbols to _LOWER --- keyboards/planck/keymaps/jeebak/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 04bc57fa7..d2ae4edb3 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -106,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * | | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' @@ -114,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = { {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, @@ -122,17 +122,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ [_RAISE] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, -- cgit v1.2.3-24-g4f1b From a6bae9fb078a35210a1b2eb3dda4db6d63e4c0a5 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Tue, 26 Jul 2016 23:49:11 -0700 Subject: Add numbers to _RAISE --- keyboards/planck/keymaps/jeebak/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index d2ae4edb3..9058098c9 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -122,17 +122,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | + * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | 0 |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ [_RAISE] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, _______, _______}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_0, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, -- cgit v1.2.3-24-g4f1b From 7209310d1b004de74412ad1806b6f29e90d285d6 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Wed, 27 Jul 2016 22:48:27 -0700 Subject: Add mouse layer, and remove default arrow keys (touchcursor only, now) --- keyboards/planck/keymaps/jeebak/keymap.c | 51 ++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 9058098c9..039a920fb 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -21,6 +21,7 @@ extern keymap_config_t keymap_config; #define _RAISE 4 #define _PLOVER 5 #define _TOUCHCURSOR 6 +#define _MOUSE 7 #define _ADJUST 16 enum planck_keycodes { @@ -43,6 +44,7 @@ enum planck_keycodes { #define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor // ^-- Requires KC_TRNS / _______ for the trigger key in the destination layer #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define LT_ML LT(_MOUSE, KC_A) // L-ayer T-ap M-ouse C-ursor (on A) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -50,54 +52,54 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------------. * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| - * | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | " | + * | Ctrl/Esc | ML/A | S | D | F | G | H | J | K | L | ; | " | * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up | Right | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | | | | | * `-----------------------------------------------------------------------------------------' */ [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {CTL_ESC, LT_ML, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, _______, _______, _______, _______} }, /* Colemak * ,-----------------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| - * | Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | " | + * | Ctrl/Esc | ML/A | R | S | T | D | H | N | E | I | O | " | * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up | Right | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | | | | | * `-----------------------------------------------------------------------------------------' */ [_COLEMAK] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {CTL_ESC, LT_ML, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, _______, _______, _______, _______} }, /* Dvorak * ,-----------------------------------------------------------------------------------------. * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| - * | Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | / | + * | Ctrl/Esc | ML/A | O | E | U | I | D | H | T | N | S | / | * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Left | Down | Up | Right | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | | | | | * `-----------------------------------------------------------------------------------------' */ [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {CTL_ESC, LT_ML, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, _______, _______, _______, _______} }, /* Lower @@ -140,11 +142,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | * |------+------+------+------+------+-------------+------+------+------+------+------| - | | Alt |Space | | | | PgUp | Left | Down |Right | | | + * | | Alt |Space | | | | PgUp | Left | Down |Right | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - | | | | | | ` | PgDn | Del | | | | | + * | | | | | | ` | PgDn | Del | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - | | | | | | | | | | | | + * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ @@ -155,6 +157,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, +/* Mouse Layer + * ,-----------------------------------------------------------------------------------. + * | | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_MOUSE] = { + {_______, _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_ACL2, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______}, + {_______, _______, _______, KC_BTN3, KC_BTN1, KC_BTN4, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______}, + {_______, _______, _______, _______, KC_BTN2, KC_BTN5, KC_WH_D, KC_BTN1, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. * | # | # | # | # | # | # | # | # | # | # | # | # | -- cgit v1.2.3-24-g4f1b From 984fc2b630aeb24a1104f2ec6de2a91febed81a9 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Thu, 28 Jul 2016 12:29:06 -0700 Subject: Media keys for all the "regular" layers --- keyboards/planck/keymaps/jeebak/keymap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 039a920fb..8a04ea702 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -56,14 +56,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | | | | | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------------' */ [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {CTL_ESC, LT_ML, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, _______, _______, _______, _______} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, /* Colemak @@ -74,14 +74,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | | | | | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------------' */ [_COLEMAK] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {CTL_ESC, LT_ML, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, _______, _______, _______, _______} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, /* Dvorak @@ -92,14 +92,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | | | | | + * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------------' */ [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, {CTL_ESC, LT_ML, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, _______, _______, _______, _______} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, /* Lower @@ -110,14 +110,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | + * | | | | | | | | Prev | Stop | Slct | Mute | * `-----------------------------------------------------------------------------------' */ [_LOWER] = { {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} }, /* Raise @@ -128,14 +128,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | 0 |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | + * | | | | | | | | Prev | Stop | Slct | Mute | * `-----------------------------------------------------------------------------------' */ [_RAISE] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, _______, _______}, {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_0, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} }, /* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations -- cgit v1.2.3-24-g4f1b From 1876e100bea14e87beb7c91df71b980e3b6e670e Mon Sep 17 00:00:00 2001 From: Jonathan Arnett Date: Sat, 30 Jul 2016 14:37:54 -0400 Subject: Updated readme with recent changes --- keyboards/ergodox/keymaps/j3rn/readme.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/keyboards/ergodox/keymaps/j3rn/readme.md b/keyboards/ergodox/keymaps/j3rn/readme.md index fc4b64042..178aba773 100644 --- a/keyboards/ergodox/keymaps/j3rn/readme.md +++ b/keyboards/ergodox/keymaps/j3rn/readme.md @@ -1,4 +1,4 @@ -# J3RN's Mac-centric ErgoDox EZ keymap +# J3RN's Mac-Centric ErgoDox EZ keymap ## Motivation @@ -14,6 +14,7 @@ This layout more closely resembles that of the Mac keyboard, and has some other - **The key to the right of "0" is Backspace instead of "-"** (misleadingly labeled "delete" on the Mac's keyboard). There was no room to fit in "-" and "=" between "0" and Backspace, unfortunately. - **The key to the left of "Q" is Tab instead of Delete.** - **The rightmost big key on the left thumb is CMD (LGui) instead of Backspace.** +- **The key to the left of Alt-Shift is an Alt key**. This is close to it's position on the Mac keyboard, though slightly further left. ### Other changes @@ -23,7 +24,9 @@ This layout more closely resembles that of the Mac keyboard, and has some other - **The Toggle L1 keys have been replaced by the otherwise displaced "-" and "=".** They are laid out, left-to-right, in the same order as on the Mac keyboard. Honestly, they are not terribly conveniently placed, and their placement might change in a later version. I found that I did not toggle L1 frequently at all, and found using the momentary keys to access L1 to fit my workflow better. - **The "~"/L1 key in the bottom-left is now just momentary L1.** The "~" key was moved to the top-left as mentioned before, and I like to keep my multi-use keys to a minimum due to the latency for them to switch from "press" to "hold." - **The Home and End buttons have been shifted up on the left thumb, and Shift inserted below them.** This makes doing Shift-5 and other such combinations less painful. -- **The Page Up and Page Down buttons have been shifted up on the right thumb, and Alt was moved from above them to below them.** I use Alt more than Page Up or Page Down (mostly in terminal applications), and thought that it deserved a more accessible location. - +- **The Page Up and Page Down buttons have been shifted up on the right thumb.** I don't use either of these keys often, and wanted to free up some real estate. +- **The bottommost-inner keys on the left and right thumb are momentary L2 and momentary L1, respectively**. I have found that both modes are useful, and this seemed like a reasonably accessible place to put these. +- **Traditional numpad layout.** The base of most numpads is a double-wide "0" key to the left of a "." key. This is reflected in my layout by having two "0" keys to the left of a "." key. +- **The function keys (F1-F12) have been moved to L2.** They were in the way in L1. **I'm always open to feedback and/or suggestions!** -- cgit v1.2.3-24-g4f1b From eb9416a67d0220bde6993ecb22fe611b312ad47c Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Thu, 28 Jul 2016 15:13:22 -0700 Subject: PrintScreen and RGUI replace BACKLIT and Ctrl. Move BACKLIT to LOWER/RAISE layers --- keyboards/planck/keymaps/jeebak/keymap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 8a04ea702..3a7384ca8 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -56,14 +56,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------------' */ [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {CTL_ESC, LT_ML, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, /* Colemak @@ -74,14 +74,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------------' */ [_COLEMAK] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {CTL_ESC, LT_ML, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, /* Dvorak @@ -92,14 +92,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| - * | Brite | Ctrl | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------------' */ [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, {CTL_ESC, LT_ML, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} + {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, /* Lower @@ -110,14 +110,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Prev | Stop | Slct | Mute | + * |Brite | | | | | | | Prev | Stop | Slct | Mute | * `-----------------------------------------------------------------------------------' */ [_LOWER] = { {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} + {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} }, /* Raise @@ -128,14 +128,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | 0 |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Prev | Stop | Slct | Mute | + * |Brite | | | | | | | Prev | Stop | Slct | Mute | * `-----------------------------------------------------------------------------------' */ [_RAISE] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, _______, _______}, {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_0, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} + {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} }, /* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations -- cgit v1.2.3-24-g4f1b From 6a2c681ae96dfdc9a61591a6f3ded8e7059756a9 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Fri, 29 Jul 2016 10:43:59 -0700 Subject: Change calls from persistant_default_layer_set() to default_layer_set() --- keyboards/planck/keymaps/jeebak/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 3a7384ca8..35a46e7bf 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -242,7 +242,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef AUDIO_ENABLE PLAY_NOTE_ARRAY(tone_qwerty, false, 0); #endif - persistant_default_layer_set(1UL<<_QWERTY); + default_layer_set(1UL<<_QWERTY); } return false; break; @@ -251,7 +251,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef AUDIO_ENABLE PLAY_NOTE_ARRAY(tone_colemak, false, 0); #endif - persistant_default_layer_set(1UL<<_COLEMAK); + default_layer_set(1UL<<_COLEMAK); } return false; break; @@ -260,7 +260,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef AUDIO_ENABLE PLAY_NOTE_ARRAY(tone_dvorak, false, 0); #endif - persistant_default_layer_set(1UL<<_DVORAK); + default_layer_set(1UL<<_DVORAK); } return false; break; -- cgit v1.2.3-24-g4f1b From e0dd9d6af0dcf3732a7cd1ee6084a61960f015b0 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Fri, 29 Jul 2016 11:21:43 -0700 Subject: Add -, +, and . to RAISE --- keyboards/planck/keymaps/jeebak/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 35a46e7bf..976875e8a 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -124,17 +124,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | | | + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | - | + | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | 0 |Enter | + * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | . |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * |Brite | | | | | | | Prev | Stop | Slct | Mute | * `-----------------------------------------------------------------------------------' */ [_RAISE] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, _______, _______}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_0, _______}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_DOT, _______}, {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} }, -- cgit v1.2.3-24-g4f1b From 216efe6c994d8208481138384d432f7a3b9425f1 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Fri, 29 Jul 2016 18:02:31 -0700 Subject: Move reset to a less accessible location --- keyboards/planck/keymaps/jeebak/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 976875e8a..33e0d653a 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -197,20 +197,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | + * | | | | | | | | | | | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | * |------+------+------+------+------+------|------+------+------+------+------+------| * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | + * | | | | | | | | | | |Reset | * `-----------------------------------------------------------------------------------' */ [_ADJUST] = { - {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET} } -- cgit v1.2.3-24-g4f1b From b54a58859fa37bba78315f316af0bc2269000c1a Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 30 Jul 2016 12:21:04 -0700 Subject: Make RAISE layer an all numbers/arithmatic layer --- keyboards/planck/keymaps/jeebak/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 33e0d653a..ae7305dab 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -122,19 +122,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Raise * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | 4 | 5 | 6 | - | + | + * | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | 1 | 2 | 3 | . |Enter | + * | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| * |Brite | | | | | | | Prev | Stop | Slct | Mute | * `-----------------------------------------------------------------------------------' */ [_RAISE] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_1, KC_2, KC_3, KC_DOT, _______}, + {KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_DLR, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, KC_PIPE}, + {KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_DOT, KC_BSLS}, {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} }, -- cgit v1.2.3-24-g4f1b From db8ad8204e66e3c00a74e0efed0b16b5e4a04500 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 30 Jul 2016 12:26:51 -0700 Subject: Add additional maps for [, and ], to LOWER --- keyboards/planck/keymaps/jeebak/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index ae7305dab..3d6523b1e 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -106,17 +106,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + * | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| * |Brite | | | | | | | Prev | Stop | Slct | Mute | * `-----------------------------------------------------------------------------------' */ [_LOWER] = { {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {KC_LBRC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {KC_RBRC, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} }, -- cgit v1.2.3-24-g4f1b From a2ed7ce795d85f48e5c16128d767f27f19835626 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 30 Jul 2016 12:50:13 -0700 Subject: Add additional shortcut keymaps to TOUCHCURSOR layer --- keyboards/planck/keymaps/jeebak/keymap.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 3d6523b1e..ec142ecbb 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -142,18 +142,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | Alt |Space | | | | PgUp | Left | Down |Right | | | + * | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | ` | PgDn | Del | | | | | + * | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' + * + * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't + * seem to work on Mac. Presumably they'll work under Windows. */ [_TOUCHCURSOR] = { {_______, _______, _______, KC_LSFT, KC_LGUI, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, - {_______, KC_LALT, KC_SPC, _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, - {_______, _______, _______, _______, _______, KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______}, + {_______, KC_LALT, KC_SPC, _______, KC_FIND,KC_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, + {_______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, -- cgit v1.2.3-24-g4f1b From 230d313dbd7f09593566ce4f20ea2db974a1fcc4 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 30 Jul 2016 13:09:49 -0700 Subject: Update readme.md --- keyboards/planck/keymaps/jeebak/readme.md | 107 +++++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index de9680b49..eb8104379 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -1,2 +1,107 @@ -# The Default Planck Layout +jeebak's layout +======================= +This WIP keymap attempts to minimize fingers straying away from the home row. +To aid in this endeavor, when additional modifyer keys to switch layers are +needed, they will be mapped to home row keys. The `keymap.c` file will contain +the exact changes. The diagrams in this README shows the highlights of the +changes from the default mappings. +I also decided to change all calls to `persistant_default_layer_set()` to +`update_tri_layer()` since this is my personal perference. + +## Base Layers (Qwerty/Colemak/Dvorak) +These base layers are mostly the same as the default mappings. The interesting +changes are shown below. The `Ctrl/Esc`, mapped using `CTL_T(KC_ESC)` will emit +an `Escape` when tapped, and act as a `Control` key when held. A `TODO` item is +to see if it can also act as a `CapsLock` when double-tapped. The right shift +key acts as `Enter` when tapped, and as a `Shift` key when held. The arrow +keys, which have been moved to the +[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been +replaced with the Media keys as shown. The `ML/A` key activates the Mouse layer +when held, and emits an `A` when tapped. +``` + ,-----------------------------------------------------------------------------------------. + | | | | | | | | | | | | | + |----------+------+------+------+------+-------------+------+------+------+------+--------| + | Ctrl/Esc | ML/A | | | | | | | | | | | + |----------+------+------+------+------+------|------+------+------+------+------+--------| + | | | | | | | | | | | |Sft/Ent | + |----------+------+------+------+------+------+------+------+------+------+------+--------| + | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------------' +``` + +## Lower Layer (Symbols and Function Keys) +The symbols and functions keys are essentially the same as the default mapping. +The most notable changes are that the symbol keys from the `RAISE` layer have +been moved here. The remaining Media keys replace those that are now on the +base layers. The `BACKLIT` key has also been moved here. +``` + ,-----------------------------------------------------------------------------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + |------+------+------+------+------+------+------+------+------+------+------+------| + |Brite | | | | | | | Prev | Stop | Slct | Mute | + `-----------------------------------------------------------------------------------' +``` + +## Raise Layer (Numbers and Arithmetic Operators) +All of the numbers and arithmetic operators are available on this layer. Some +keys are duplicated for the convenience of their positions. The `0` and `$` +keys at the far left are for quick access to beginning and end of line in vim. +``` + ,-----------------------------------------------------------------------------------. + | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . | \ | + |------+------+------+------+------+------+------+------+------+------+------+------| + |Brite | | | | | | | Prev | Stop | Slct | Mute | + `-----------------------------------------------------------------------------------' +``` + +## TouchCursor layer plus personal customizations +[TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key +as the modifier, with the `IJKL` home row keys representing the inverted-T of +the arrow keys. All of the default TouchCursor keymappings for the right hand +are represented below. My personalizations include all of the keys shown for +the left hand. Having the `Alt` and `Shift` keys readily accessible from the +home row allows quick word jumps and highlighting when used in conjunction with +the arrow keys. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and +`KC_AGAIN` keycodes have been mapped but they don't seem to work on Mac. +Presumably they'll work under Windows. +``` + ,-----------------------------------------------------------------------------------. + | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` + +## Mouse Layer +The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. +The `A` key is used to activate this layer. All 16 keycodes for the mouse from +the `doc/keycode.txt` file are represented, and logically located, IMHO. The +left and right click buttons are duplicated; on the right hand side, for a +quick click here and there, and again on the left hand side for when the +buttons need to be held for dragging things or highlighting text, thus allowing +the right hand to be free to use the up/down/left/right actions. +``` + ,-----------------------------------------------------------------------------------. + | | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` -- cgit v1.2.3-24-g4f1b From 79067662c8c71129a84a41b0147edc63b33db709 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 13:22:18 +0300 Subject: Better "include guards" for the makefiles Checking for ARCH is not good enough, since some subprojects define it. Ergodox Ez for example. The leads to running the make from keyboards/ergodox/ez failing. The keyboard makefile will not be included in that case, and therefore not the CUSTOM_MATRIX either. Furthermore the output files are read from many different .build directories, so it doesn't fail deterministically. For example on the Travis CI the compilation passes, since there's no outdated objects that needs recompilation. --- Makefile | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 980ab26b2..31826f14a 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,9 @@ endif .DEFAULT_GOAL := all space := $(subst ,, ) -starting_makefile := $(subst $(space),_SPACE_,$(abspath $(firstword $(MAKEFILE_LIST)))) -mkfile_path := $(subst $(space),_SPACE_,$(abspath $(lastword $(MAKEFILE_LIST)))) +ESCAPED_ABS_PATH = $(subst $(space),_SPACE_,$(abspath $1)) +starting_makefile := $(call ESCAPED_ABS_PATH,$(firstword $(MAKEFILE_LIST))) +mkfile_path := $(call ESCAPED_ABS_PATH,$(lastword $(MAKEFILE_LIST)))) abs_tmk_root := $(patsubst %/,%,$(dir $(mkfile_path))) ifneq (,$(findstring /keyboards/,$(starting_makefile))) @@ -83,10 +84,8 @@ endif ifneq ("$(wildcard $(KEYBOARD_PATH)/$(KEYBOARD).c)","") KEYBOARD_FILE = keyboards/$(KEYBOARD)/$(KEYBOARD).c - ifndef ARCH - ifneq ("$(wildcard $(KEYBOARD_PATH)/Makefile)","") - include $(KEYBOARD_PATH)/Makefile - endif + ifneq ($(call ESCAPED_ABS_PATH,$(KEYBOARD_PATH)/Makefile),$(starting_makefile)) + -include $(KEYBOARD_PATH)/Makefile endif else $(error "$(KEYBOARD_PATH)/$(KEYBOARD).c" does not exist) @@ -101,7 +100,9 @@ ifdef SUBPROJECT ifneq ("$(wildcard $(SUBPROJECT_PATH)/$(SUBPROJECT).c)","") OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT) SUBPROJECT_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/$(SUBPROJECT).c - -include $(SUBPROJECT_PATH)/Makefile + ifneq ($(call ESCAPED_ABS_PATH,$(SUBPROJECT_PATH)/Makefile),$(starting_makefile)) + -include $(SUBPROJECT_PATH)/Makefile + endif else $(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist) endif @@ -119,14 +120,18 @@ endif KEYMAP_PATH = $(KEYBOARD_PATH)/keymaps/$(KEYMAP) ifneq ("$(wildcard $(KEYMAP_PATH)/keymap.c)","") KEYMAP_FILE = keyboards/$(KEYBOARD)/keymaps/$(KEYMAP)/keymap.c - -include $(KEYMAP_PATH)/Makefile + ifneq ($(call ESCAPED_ABS_PATH,$(KEYMAP_PATH)/Makefile),$(starting_makefile)) + -include $(KEYMAP_PATH)/Makefile + endif else ifeq ("$(wildcard $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)/keymap.c)","") $(error "$(KEYMAP_PATH)/keymap.c" does not exist) else KEYMAP_PATH = $(SUBPROJECT_PATH)/keymaps/$(KEYMAP) KEYMAP_FILE = keyboards/$(KEYBOARD)/$(SUBPROJECT)/keymaps/$(KEYMAP)/keymap.c - -include $(KEYMAP_PATH)/Makefile + ifneq ($(call ESCAPED_ABS_PATH,$(KEYMAP_PATH)/Makefile),$(starting_makefile)) + -include $(KEYMAP_PATH)/Makefile + endif endif endif -- cgit v1.2.3-24-g4f1b From f11a0275a8e11a9e8393d8d64b45b62a1a018512 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 13:24:25 +0300 Subject: Enable vpath seraching for source files only --- tmk_core/rules.mk | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index c81fa6854..f6819d7c3 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -15,6 +15,16 @@ # Carlos Lamas # +# Enable vpath seraching for source files only +# Without this, output files, could be read from the wrong .build directories +VPATH_SRC := $(VPATH) +vpath %.c $(VPATH_SRC) +vpath %.h $(VPATH_SRC) +vpath %.cpp $(VPATH_SRC) +vpath %.hpp $(VPATH_SRC) +vpath %.S $(VPATH_SRC) +VPATH := + # Output format. (can be srec, ihex, binary) FORMAT = ihex @@ -71,7 +81,7 @@ BUILD_CMD = LOG=$$($(CMD) 2>&1) ; if [ $$? -gt 0 ]; then $(PRINT_ERROR); elif [ # Each directory must be seperated by a space. # Use forward slashes for directory separators. # For a directory that has spaces, enclose it in quotes. -EXTRAINCDIRS += $(subst :, ,$(VPATH)) +EXTRAINCDIRS += $(subst :, ,$(VPATH_SRC)) # Compiler flag to set the C Standard level. -- cgit v1.2.3-24-g4f1b From abdf42573ac6e01432fdf69847f4259540c1a38d Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 13:25:49 +0300 Subject: Put the build output inside the root/.build directory --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 31826f14a..60c7a6ef6 100644 --- a/Makefile +++ b/Makefile @@ -140,7 +140,8 @@ ifdef SUBPROJECT else TARGET ?= $(KEYBOARD)_$(KEYMAP) endif -BUILD_DIR = .build + +BUILD_DIR = $(TOP_DIR)/.build # Object files directory # To put object files in current directory, use a dot (.), do NOT make -- cgit v1.2.3-24-g4f1b From e58e9af2ab2c0e66a8456b48d46f4d71a66af27a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 30 Jul 2016 18:16:34 +0300 Subject: More reliable .d file generation Also generated inside the obj dir instead of separate deps folder. --- tmk_core/rules.mk | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index f6819d7c3..8acb43932 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -278,7 +278,7 @@ LST = $(patsubst %.c,$(OBJDIR)/%.lst,$(patsubst %.cpp,$(OBJDIR)/%.lst,$(patsubst # Compiler flags to generate dependency files. #GENDEPFLAGS = -MMD -MP -MF .dep/$(@F).d -GENDEPFLAGS = -MMD -MP -MF $(BUILD_DIR)/.dep/$(subst /,_,$(subst $(BUILD_DIR)/,,$@)).d +GENDEPFLAGS = -MMD -MP -MF $(patsubst %.o,%.td,$@) # Combine all necessary flags and optional flags. @@ -288,6 +288,8 @@ ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) +MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) + # Default target. all: build sizeafter @@ -390,17 +392,17 @@ BEGIN = gccversion check_submodule sizebefore define GEN_OBJRULE # Compile: create object files from C source files. -$1/%.o : %.c | $(BEGIN) +$1/%.o : %.c $1/%.d | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) - $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$< -o $$@) + $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$$(BUILD_CMD) # Compile: create object files from C++ source files. -$1/%.o : %.cpp | $(BEGIN) +$1/%.o : %.cpp $1/%.d | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD) - $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$< -o $$@) + $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$(BUILD_CMD) # Assemble: create object files from assembler source files. @@ -409,9 +411,15 @@ $1/%.o : %.S | $(BEGIN) @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD) $$(eval CMD=$$(CC) -c $$(ALL_ASFLAGS) $$< -o $$@) @$$(BUILD_CMD) - endef +# We have to use static rules for the .d files for some reason +DEPS = $(patsubst %.o,%.d,$(OBJ)) +# Keep the .d files +.PRECIOUS: $(DEPS) +# Empty rule to force recompilation if the .d file is missing +$(DEPS): + # Since the object files could be in two different folders, generate # separate rules for them, rather than having too generic rules $(eval $(call GEN_OBJRULE,$(OBJDIR))) @@ -434,7 +442,7 @@ $(eval $(call GEN_OBJRULE,$(KBOBJDIR))) $(CC) -E -mmcu=$(MCU) $(CFLAGS) $< -o $@ # Target: clean project. -clean: +clean: show_path: @echo VPATH=$(VPATH) @@ -515,7 +523,7 @@ $(shell mkdir $(OBJDIR) 2>/dev/null) $(shell mkdir $(KBOBJDIR) 2>/dev/null) # Include the dependency files. --include $(shell mkdir $(BUILD_DIR)/.dep 2>/dev/null) $(wildcard $(BUILD_DIR)/.dep/*) +-include $(patsubst %.o,%.d,$(OBJ)) # Listing of phony targets. -- cgit v1.2.3-24-g4f1b From 84bfb195545b0ba527f34c386d15d6f732a28de7 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 30 Jul 2016 22:07:01 +0300 Subject: Force compilation and linking when options changes --- tmk_core/rules.mk | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 8acb43932..ebcd372ca 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -284,8 +284,8 @@ GENDEPFLAGS = -MMD -MP -MF $(patsubst %.o,%.td,$@) # Combine all necessary flags and optional flags. # Add target processor to flags. # You can give extra flags at 'make' command line like: make EXTRAFLAGS=-DFOO=bar -ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) -ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(GENDEPFLAGS) $(EXTRAFLAGS) +ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(EXTRAFLAGS) +ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(EXTRAFLAGS) ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) @@ -385,32 +385,51 @@ BEGIN = gccversion check_submodule sizebefore # Link: create ELF output file from object files. .SECONDARY : $(BUILD_DIR)/$(TARGET).elf .PRECIOUS : $(OBJ) -%.elf: $(OBJ) | $(BEGIN) +# Note the obj.txt depeendency is there to force linking if a source file is deleted +%.elf: $(OBJ) $(OBJDIR)/cflags.txt $(OBJDIR)/ldflags.txt $(OBJDIR)/obj.txt | $(BEGIN) @$(SILENT) || printf "$(MSG_LINKING) $@" | $(AWK_CMD) - $(eval CMD=$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)) + $(eval CMD=$(CC) $(ALL_CFLAGS) $(filter-out %.txt,$^) --output $@ $(LDFLAGS)) @$(BUILD_CMD) define GEN_OBJRULE # Compile: create object files from C source files. -$1/%.o : %.c $1/%.d | $(BEGIN) +$1/%.o : %.c $1/%.d $1/cflags.txt | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) - $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$< -o $$@ && $$(MOVE_DEP)) + $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$$(BUILD_CMD) # Compile: create object files from C++ source files. -$1/%.o : %.cpp $1/%.d | $(BEGIN) +$1/%.o : %.cpp $1/%.d $1/cppflags.txt | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD) - $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) + $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$(BUILD_CMD) # Assemble: create object files from assembler source files. -$1/%.o : %.S | $(BEGIN) +$1/%.o : %.S $1/asflags.txt | $(BEGIN) @mkdir -p $$(@D) @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD) $$(eval CMD=$$(CC) -c $$(ALL_ASFLAGS) $$< -o $$@) @$$(BUILD_CMD) + +$1/force: + +$1/cflags.txt: $1/force + echo '$$(ALL_CFLAGS)' | cmp -s - $$@ || echo '$$(ALL_CFLAGS)' > $$@ + +$1/cppflags.txt: $1/force + echo '$$(ALL_CPPFLAGS)' | cmp -s - $$@ || echo '$$(ALL_CPPFLAGS)' > $$@ + +$1/asflags.txt: $1/force + echo '$$(ALL_ASFLAGS)' | cmp -s - $$@ || echo '$$(ALL_ASFLAGS)' > $$@ + +$1/ldflags.txt: $1/force + echo '$$(LDFLAGS)' | cmp -s - $$@ || echo '$$(LDFLAGS)' > $$@ + +$1/obj.txt: $1/force + echo '$$(OBJ)' | cmp -s - $$@ || echo '$$(OBJ)' > $$@ + endef # We have to use static rules for the .d files for some reason -- cgit v1.2.3-24-g4f1b From 97817a773eb667045144ac820df673ed8d3471a0 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 30 Jul 2016 23:41:26 +0300 Subject: Generate version information to version.h So that only the files that really needs a version are recompiled. --- .gitignore | 3 ++- Makefile | 4 +++- keyboards/ergodox/keymaps/algernon/keymap.c | 1 + keyboards/ergodox/keymaps/default/keymap.c | 1 + keyboards/ergodox/keymaps/josh/keymap.c | 1 + keyboards/planck/keymaps/cbbrowne/keymap.c | 1 + keyboards/planck/keymaps/experimental/keymap.c | 1 + 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 849143352..8c85d6ffa 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ build/ .build/ *.bak .vagrant/ +quantum/version.h .idea/ CMakeLists.txt .DS_STORE @@ -26,4 +27,4 @@ CMakeLists.txt .project .settings/ .idea -.browse.VC.db* \ No newline at end of file +.browse.VC.db* diff --git a/Makefile b/Makefile index 60c7a6ef6..053c8532a 100644 --- a/Makefile +++ b/Makefile @@ -271,4 +271,6 @@ include $(TMK_PATH)/rules.mk GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" -OPT_DEFS += -DQMK_VERSION=\"$(GIT_VERSION)\" -DQMK_BUILDDATE=\"$(BUILD_DATE)\" + +$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(QUANTUM_PATH)/version.h) +$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(QUANTUM_PATH)/version.h) \ No newline at end of file diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c index 6a14ef467..c4de53da2 100644 --- a/keyboards/ergodox/keymaps/algernon/keymap.c +++ b/keyboards/ergodox/keymaps/algernon/keymap.c @@ -12,6 +12,7 @@ #include "keymap_plover.h" #include "eeconfig.h" #include "wait.h" +#include "version.h" /* Layers */ diff --git a/keyboards/ergodox/keymaps/default/keymap.c b/keyboards/ergodox/keymaps/default/keymap.c index f1a83f4e7..1b80cb3a2 100644 --- a/keyboards/ergodox/keymaps/default/keymap.c +++ b/keyboards/ergodox/keymaps/default/keymap.c @@ -1,6 +1,7 @@ #include "ergodox.h" #include "debug.h" #include "action_layer.h" +#include "version.h" #define BASE 0 // default layer #define SYMB 1 // symbols diff --git a/keyboards/ergodox/keymaps/josh/keymap.c b/keyboards/ergodox/keymaps/josh/keymap.c index 488b21427..b5463873a 100644 --- a/keyboards/ergodox/keymaps/josh/keymap.c +++ b/keyboards/ergodox/keymaps/josh/keymap.c @@ -1,6 +1,7 @@ #include "ergodox.h" #include "debug.h" #include "action_layer.h" +#include "version.h" #define BASE 0 // default layer #define SYMB 1 // symbols diff --git a/keyboards/planck/keymaps/cbbrowne/keymap.c b/keyboards/planck/keymaps/cbbrowne/keymap.c index 14a5be170..70eaefb7b 100644 --- a/keyboards/planck/keymaps/cbbrowne/keymap.c +++ b/keyboards/planck/keymaps/cbbrowne/keymap.c @@ -4,6 +4,7 @@ #endif #include "config.h" #include "quantum.h" +#include "version.h" /* Each layer is given a name to aid in readability, which is then used in the keymap matrix below. The underscores do not denote diff --git a/keyboards/planck/keymaps/experimental/keymap.c b/keyboards/planck/keymaps/experimental/keymap.c index d9303fcae..2c1270094 100644 --- a/keyboards/planck/keymaps/experimental/keymap.c +++ b/keyboards/planck/keymaps/experimental/keymap.c @@ -8,6 +8,7 @@ #endif #include "eeconfig.h" +#include "version.h" extern keymap_config_t keymap_config; -- cgit v1.2.3-24-g4f1b From d5a947b32495625970d220349ca8f47e4cb2992a Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 13:49:04 +0300 Subject: Also depend on the gcc version --- tmk_core/rules.mk | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index ebcd372ca..69f82dc83 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -393,21 +393,21 @@ BEGIN = gccversion check_submodule sizebefore define GEN_OBJRULE # Compile: create object files from C source files. -$1/%.o : %.c $1/%.d $1/cflags.txt | $(BEGIN) +$1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING) $$<" | $$(AWK_CMD) $$(eval CMD=$$(CC) -c $$(ALL_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$$(BUILD_CMD) # Compile: create object files from C++ source files. -$1/%.o : %.cpp $1/%.d $1/cppflags.txt | $(BEGIN) +$1/%.o : %.cpp $1/%.d $1/cppflags.txt $1/compiler.txt | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING_CPP) $$<" | $$(AWK_CMD) $$(eval CMD=$$(CC) -c $$(ALL_CPPFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$(BUILD_CMD) # Assemble: create object files from assembler source files. -$1/%.o : %.S $1/asflags.txt | $(BEGIN) +$1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN) @mkdir -p $$(@D) @$(SILENT) || printf "$$(MSG_ASSEMBLING) $$<" | $$(AWK_CMD) $$(eval CMD=$$(CC) -c $$(ALL_ASFLAGS) $$< -o $$@) @@ -430,6 +430,8 @@ $1/ldflags.txt: $1/force $1/obj.txt: $1/force echo '$$(OBJ)' | cmp -s - $$@ || echo '$$(OBJ)' > $$@ +$1/compiler.txt: $1/force + $$(CC) --version | cmp -s - $$@ || $$(CC) --version > $$@ endef # We have to use static rules for the .d files for some reason -- cgit v1.2.3-24-g4f1b From a0dc6221993b10834dd55f58057d3354ca0910c3 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 14:17:32 +0300 Subject: Remove the quick commands and add proper clean --- tmk_core/rules.mk | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 69f82dc83..d2350f27c 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -45,11 +45,6 @@ ifeq ($(COLOR),true) BOLD=\033[1m endif -ifdef quick - QUICK = $(quick) -endif - -QUICK ?= false AUTOGEN ?= false ifneq ($(shell awk --version 2>/dev/null),) @@ -293,9 +288,6 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) # Default target. all: build sizeafter -# Quick make that doesn't clean -quick: build sizeafter - # Change the build target to build a HEX file or a library. build: elf hex #build: elf hex eep lss sym @@ -464,6 +456,9 @@ $(eval $(call GEN_OBJRULE,$(KBOBJDIR))) # Target: clean project. clean: + $(REMOVE) -r $(OBJDIR) 2>/dev/null + $(REMOVE) -r $(KBOBJDIR) 2>/dev/null + $(REMOVE) $(BUILD_DIR)/$(TARGET).* show_path: @echo VPATH=$(VPATH) @@ -483,7 +478,6 @@ all-keyboards-defaults: all-keyboards-defaults-all KEYBOARDS := $(SUBDIRS:$(TOP_DIR)/keyboards/%/=/keyboards/%) all-keyboards-all: $(addsuffix -all,$(KEYBOARDS)) -all-keyboards-quick: $(addsuffix -quick,$(KEYBOARDS)) all-keyboards-clean: $(addsuffix -clean,$(KEYBOARDS)) all-keyboards: all-keyboards-all @@ -500,12 +494,10 @@ done endef define make_keyboard_helper -# Just remove the -quick, -all and so on from the first argument and pass it forward +# Just remove the -all and so on from the first argument and pass it forward $(call make_keyboard,$(subst -$2,,$1),$2) endef -/keyboards/%-quick: - $(call make_keyboard_helper,$@,quick) /keyboards/%-all: $(call make_keyboard_helper,$@,all) /keyboards/%-clean: @@ -523,19 +515,6 @@ all-keymaps-%: all-keymaps: all-keymaps-all -GOAL=$(MAKECMDGOALS) -ifeq ($(MAKECMDGOALS),) -GOAL = all -endif -CLEANING_GOALS=clean clean_list all -ifneq ($(findstring $(GOAL),$(CLEANING_GOALS)),) -$(shell $(REMOVE) -r $(BUILD_DIR) 2>/dev/null) -$(shell $(REMOVE) -r $(TOP_DIR)/$(BUILD_DIR)) -$(shell $(REMOVE) -r $(KEYBOARD_PATH)/$(BUILD_DIR)) -$(shell if $$SUBPROJECT; then $(REMOVE) -r $(SUBPROJECT_PATH)/$(BUILD_DIR); fi) -$(shell $(REMOVE) -r $(KEYMAP_PATH)/$(BUILD_DIR)) -endif - # Create build directory $(shell mkdir $(BUILD_DIR) 2>/dev/null) @@ -548,7 +527,7 @@ $(shell mkdir $(KBOBJDIR) 2>/dev/null) # Listing of phony targets. -.PHONY : all quick finish sizebefore sizeafter gccversion \ +.PHONY : all finish sizebefore sizeafter gccversion \ build elf hex eep lss sym coff extcoff check_submodule \ clean clean_list debug gdb-config show_path \ program teensy dfu flip dfu-ee flip-ee dfu-start \ -- cgit v1.2.3-24-g4f1b From 87a1a095d0b46cb39d3ac627d94650b4e52da19b Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 14:18:00 +0300 Subject: Fix the readme for the removed quick target --- readme.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index c3d866f36..57629f8be 100644 --- a/readme.md +++ b/readme.md @@ -122,17 +122,16 @@ Below are some definitions that will be useful: Below is a list of the useful `make` commands in QMK: -* `make` - cleans automatically and builds your keyboard and keymap depending on which folder you're in. This defaults to the "default" layout (unless in a keymap folder), and Planck keyboard in the root folder +* `make` - builds your keyboard and keymap depending on which folder you're in. This defaults to the "default" layout (unless in a keymap folder), and Planck keyboard in the root folder * `make keyboard=` - specifies the keyboard (only to be used in root) * `make keymap=` - specifies the keymap (only to be used in root and keyboard folder - not needed when in keymap folder) -* `make quick` - skips the clean step (cannot be used immediately after modifying config.h or Makefiles) +* `make clean` - cleans the `.build` folder, ensuring that everything is re-built * `make dfu` - (requires dfu-programmer) builds and flashes the keymap to your keyboard once placed in reset/dfu mode (button or press `KC_RESET`). This does not work for Teensy-based keyboards like the ErgoDox EZ. * `keyboard=` and `keymap=` are compatible with this * `make all-keyboards` - builds all keymaps for all keyboards and outputs status of each (use in root) * `make all-keyboards-default` - builds all default keymaps for all keyboards and outputs status of each (use in root) * `make all-keymaps [keyboard=]` - builds all of the keymaps for whatever keyboard folder you're in, or specified by `` -* `make all-keyboards-quick`, `make all-keyboards-default-quick` and `make all-keymaps-quick [keyboard=]` - like the normal "make-all-*" commands, but they skip the clean steps - +* `make all-keyboards-*`, `make all-keyboards-default-*` and `make all-keymaps-* [keyboard=]` - like the normal "make-all-*" commands, but the last string aftter the `-` (for example clean) is passed to the keyboard make command. Other, less useful functionality: * `make COLOR=false` - turns off color output -- cgit v1.2.3-24-g4f1b From fda29be3e7e85814344ab188f1b76f994ee8757e Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sun, 31 Jul 2016 14:18:51 +0300 Subject: Travis calls the normal build target, instead of quick --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 26deac0ce..297cf19a6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: global: - secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM= script: -- make all-keyboards-quick AUTOGEN=true +- make all-keyboards AUTOGEN=true addons: apt: packages: -- cgit v1.2.3-24-g4f1b From d9bef1658e062d76f87a752daa30047d865dca0f Mon Sep 17 00:00:00 2001 From: Jiehong Ma Date: Sun, 31 Jul 2016 16:49:31 +0200 Subject: feature: add basic doc about how a keyboard works on USB This comes from the discussion on #520 --- doc/basic_how_keyboards_work.md | 96 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 doc/basic_how_keyboards_work.md diff --git a/doc/basic_how_keyboards_work.md b/doc/basic_how_keyboards_work.md new file mode 100644 index 000000000..73c3f5c5f --- /dev/null +++ b/doc/basic_how_keyboards_work.md @@ -0,0 +1,96 @@ +# How keys are registered, and interpreted by computers + +In this file, you can will learn the concepts of how keyboards work over USB, +and you'll be able to better understand what you can expect from changing your +firmware directly. + +## Schematic view + +Whenever you type on 1 particular key, here is the chain of actions taking +place: + +``` text ++------+ +-----+ +----------+ +----------+ +----+ +| User |-------->| Key |------>| Firmware |----->| USB wire |---->| OS | ++------+ +-----+ +----------+ +----------+ |----+ +``` + +This scheme is a very simple view of what's going on, and more details follow +in the next sections. + +## 1. You Press a Key + +Whenever you press a key, the firmware of your keyboard can register this event. +It can register when the key is pressed, held and released. + +This usually happens with a [periodic scan of key presses with a frequency around 100 hz](https://github.com/benblazak/ergodox-firmware/blob/master/references.md#typical-keyboard-information). +This speed often is limited by the mechanical key response time, the protocol +to transfer those key presses (here USB HID), and by the software it is used in. + +## 2. What the Firmware Sends + +The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) +tells what a keyboard can actually send through USB to have a chance to be +properly recognised. This includes a pre-defined list of keycodes which are +simple numbers from `0x00` to `0xE7`. The firmware assigns a keycode to each +key of the keyboard. + +The firmware does not send actually letters or characters, but only keycodes. +Thus, by modifying the firmware, you only can modify what keycode is sent over +USB for a given key. + +## 3. What the Operating System Does + +Once the keycode reaches the operating system, a piece of software has to have +it match an actual character thanks to a keyboard layout. For example, if your +layout is set to QWERTY, a sample of the matching table is as follow: + +``` text +| keycode | character | +|---------+-----------| +| 0x04 | a/A | +| 0x05 | b/B | +| 0x06 | c/C | +| ... | ... | +| 0x1C | y/Y | +| 0x1D | z/Z | +| ... | ... | +|---------+-----------| +``` + +## Back to the firmware + +As the layout is generally fixed (unless you create your own), the firmware can +actually call a keycode by its layout name directly to ease things for you. + +This is exactly what is done here with `KC_A` actually representing `0x04` in +QWERTY. The full list can be found in `keycode.txt`. + +## List of Characters You Can Send + +Putting aside shortcuts, having a limited set of keycodes mapped to a limited +layout means that **the list of characters you can assign to a given key only +is the ones present in the layout**. + +For example, this means that if you have a QWERTY US layout, and you want to +assign 1 key to produce `€` (euro currency symbol), you are unable to do so, +because the QWERTY US layout does not have such mapping. You could fix that by +using a QWERTY UK layout, or a QWERTY US International. + +You may wonder why a keyboard layout containing all of Unicode is not devised +then? The limited number of keycode available through USB simply disallow such +a thing. + +## How to (Maybe) Enter Unicode Characters + +You can have the firmware send *sequences of keys* to use the [software Unicode +Input +Method](https://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input) of +the target operating system, thus effectively entering characters independently +of the layout defined in the OS. + +Yet, it does come with multiple disadvantages: + + - Tied to a specific OS a a time (need recompilation when changing OS); + - Within a given OS, does not work in all software; + - Limited to a subset of Unicode on some systems. -- cgit v1.2.3-24-g4f1b From ceecb7c81954254bd0820ea571ee60ab69a43658 Mon Sep 17 00:00:00 2001 From: Depariel Date: Sun, 31 Jul 2016 14:25:25 -0400 Subject: fixed compiling bugs in infinity_chibios.h, updated keymaps, added depariel keymap --- keyboards/infinity_chibios/config.h | 3 +- keyboards/infinity_chibios/infinity_chibios.h | 36 ++--- .../infinity_chibios/keymaps/default/keymap.c | 26 ++-- .../infinity_chibios/keymaps/depariel/keymap.c | 82 ++++++++++++ keyboards/infinity_chibios/keymaps/hasu/keymap.c | 148 +++++---------------- 5 files changed, 146 insertions(+), 149 deletions(-) create mode 100755 keyboards/infinity_chibios/keymaps/depariel/keymap.c diff --git a/keyboards/infinity_chibios/config.h b/keyboards/infinity_chibios/config.h index cb9022205..bd4becfc5 100644 --- a/keyboards/infinity_chibios/config.h +++ b/keyboards/infinity_chibios/config.h @@ -18,6 +18,7 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H +#define PREVENT_STUCK_MODIFIERS /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -50,7 +51,7 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* Keymap for Infiity prototype */ +/* Keymap for Infinity prototype */ #define INFINITY_PROTOTYPE diff --git a/keyboards/infinity_chibios/infinity_chibios.h b/keyboards/infinity_chibios/infinity_chibios.h index a44c68b82..f1ba15e48 100644 --- a/keyboards/infinity_chibios/infinity_chibios.h +++ b/keyboards/infinity_chibios/infinity_chibios.h @@ -29,15 +29,15 @@ along with this program. If not, see . K54, K64, K74, K84, K05, K15, K25, K35, K45, K55, K65, K75, K85, \ K06, K16, K26, K36, K46, K56, K66, K76 \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06 }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16 }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26 }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36 }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46 }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56 }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66 }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76 }, \ - { KC_##K80, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86 } \ + { K00, K01, K02, K03, K04, K05, K06 }, \ + { K10, K11, K12, K13, K14, K15, K16 }, \ + { K20, K21, K22, K23, K24, K25, K26 }, \ + { K30, K31, K32, K33, K34, K35, K36 }, \ + { K40, K41, K42, K43, K44, K45, K46 }, \ + { K50, K51, K52, K53, K54, K55, K56 }, \ + { K60, K61, K62, K63, K64, K65, K66 }, \ + { K70, K71, K72, K73, K74, K75, K76 }, \ + { K80, K81, K82, K83, K84, K85, K86 } \ } #else @@ -50,15 +50,15 @@ along with this program. If not, see . K64, K74, K84, K05, K15, K25, K35, K45, K55, K65, K75, K85, K06, \ K16, K26, K36, K46, K56, K66, K76, K86 \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06 }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16 }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26 }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36 }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46 }, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56 }, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66 }, \ - { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76 }, \ - { KC_##K80, KC_##K81, KC_##K82, KC_##K83, KC_##K84, KC_##K85, KC_##K86 } \ + { K00, K01, K02, K03, K04, K05, K06 }, \ + { K10, K11, K12, K13, K14, K15, K16 }, \ + { K20, K21, K22, K23, K24, K25, K26 }, \ + { K30, K31, K32, K33, K34, K35, K36 }, \ + { K40, K41, K42, K43, K44, K45, K46 }, \ + { K50, K51, K52, K53, K54, K55, K56 }, \ + { K60, K61, K62, K63, K64, K65, K66 }, \ + { K70, K71, K72, K73, K74, K75, K76 }, \ + { K80, K81, K82, K83, K84, K85, K86 } \ } #endif diff --git a/keyboards/infinity_chibios/keymaps/default/keymap.c b/keyboards/infinity_chibios/keymaps/default/keymap.c index 2acf72849..5f3b46a36 100644 --- a/keyboards/infinity_chibios/keymaps/default/keymap.c +++ b/keyboards/infinity_chibios/keymaps/default/keymap.c @@ -14,12 +14,12 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [0] = - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS, GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH,RSFT,FN0, \ - NO, LGUI,LALT, SPC, RALT,RGUI,NO, NO), + [0] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, \ + KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \ + KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,MO(1), \ + KC_NO, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_NO, KC_NO), /* Layer 1: HHKB mode (HHKB Fn) * ,-----------------------------------------------------------. @@ -34,15 +34,15 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [1] = - KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS, BSPC, \ - TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,PENT, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,TRNS,TRNS, \ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS), + [1] = KEYMAP( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ + KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS), }; const uint16_t fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), + }; diff --git a/keyboards/infinity_chibios/keymaps/depariel/keymap.c b/keyboards/infinity_chibios/keymaps/depariel/keymap.c new file mode 100755 index 000000000..e68891f79 --- /dev/null +++ b/keyboards/infinity_chibios/keymaps/depariel/keymap.c @@ -0,0 +1,82 @@ +#include "infinity_chibios.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Bksp| + * |-----------------------------------------------------------| + * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| + * |-----------------------------------------------------------' + * |Fn2 |Gui |Alt | Space |RAlt|Prv|PlPs|Next| + * `-----------------------------------------------------------' + */ + [0] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LT(5, KC_ENT), \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(4), \ + MO(4), KC_LGUI, KC_LALT, LT(3, KC_SPC), KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT), + + /* Layer 1: "Toggle" off SpaceFn for League of Legends + */ + [1] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(4), \ + MO(4), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_MPRV, KC_MPLY, KC_MNXT), + + /* Layer 2: "Toggle" off SpaceFn for MapleRoyals + */ + [2] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_LSFT, \ + MO(4), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Layer 3: FN layer 1 + */ + [3] = KEYMAP( + KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, \ + KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, LALT(KC_F4), KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_UP, KC_NO, KC_LPRN, KC_RPRN, KC_DEL, \ + MO(6), KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_END, KC_PGDN, KC_TILD, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, \ + LGUI(KC_SPC), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_CALC, KC_MENU, KC_TRNS, TG(4), \ + KC_TRNS, KC_TRNS, KC_TRNS, LT(3, KC_SPC), KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU), + + /* Layer 4: FN layer 2 + */ + [4] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PMNS, KC_PPLS, KC_PSLS, TG(2), \ + KC_CAPS, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_NO, KC_P7, KC_P8, KC_P9, KC_PAST, KC_BSPC, \ + KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P4, KC_P5, KC_P6, KC_PENT, \ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_RSFT, MO(4), \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_PDOT, KC_NO, TG(1)), + + /* Layer 5: FN layer 3 + */ + [5] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TAB , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F13, KC_F14, KC_F15, KC_F16, KC_NO, KC_TRNS, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F17, KC_F18, KC_F19, KC_F20, LT(5, KC_ENT), \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F21, KC_F22, KC_F23, KC_F24, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RALT, KC_NO, KC_NO, KC_NO), + + /* Layer 6: FN layer 4 + */ + [6] = KEYMAP( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + LCTL(LSFT(KC_TAB)), KC_NO, LGUI(KC_UP), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + MO(6), LGUI(KC_LEFT), LGUI(KC_DOWN), LGUI(KC_RGHT), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + diff --git a/keyboards/infinity_chibios/keymaps/hasu/keymap.c b/keyboards/infinity_chibios/keymaps/hasu/keymap.c index e9a212f0e..4c0e57927 100644 --- a/keyboards/infinity_chibios/keymaps/hasu/keymap.c +++ b/keyboards/infinity_chibios/keymaps/hasu/keymap.c @@ -14,12 +14,12 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [0] = - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ - LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT,FN6, \ - FN7, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,FN1, \ - NO, LGUI,LALT, FN4, FN5, RGUI,NO, NO), + [0] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_SCLN), KC_QUOT,MT(KC_RCTL, KC_ENT), \ + OSM(LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, LT(2, KC_SLSH), KC_RSFT,TG(1), \ + KC_NO, KC_LGUI,KC_LALT, LT(4, KC_SPC), MO(4), KC_RGUI,KC_NO, KC_NO), /* Layer 1: HHKB mode (HHKB Fn) * ,-----------------------------------------------------------. @@ -34,12 +34,12 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [1] = - KEYMAP(PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS, UP, TRNS,BSPC, \ - LCTL,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, \ - LSFT,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,RSFT,TRNS, \ - TRNS,LGUI,LALT, TRNS, RALT,RGUI,TRNS,TRNS), + [1] = KEYMAP( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS,KC_BSPC, \ + KC_LCTL,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_ENT, \ + KC_LSFT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_RSFT,KC_TRNS, \ + KC_TRNS,KC_LGUI,KC_LALT, KC_TRNS, KC_RALT,KC_RGUI,KC_TRNS,KC_TRNS), /* Layer 2: Vi mode[Slash] * ,-----------------------------------------------------------. @@ -54,12 +54,12 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Gui|Alt | Space |Alt |Gui| * `-------------------------------------------' */ - [2] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, BSPC, \ - LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, \ - LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN2, RSFT,TRNS, \ - TRNS,LGUI,LALT, SPC, RALT,RGUI,TRNS,TRNS), + [2] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + KC_TAB, KC_HOME,KC_PGDN,KC_UP, KC_PGUP,KC_END, KC_HOME,KC_PGDN,KC_PGUP,KC_END, KC_NO, KC_NO, KC_NO, KC_BSPC, \ + KC_LCTL,KC_NO, KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_NO, KC_NO, KC_ENT, \ + KC_LSFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME,KC_PGDN,KC_PGUP,KC_END, LT(2, KC_SLSH), KC_RSFT,KC_TRNS, \ + KC_TRNS,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_TRNS, KC_TRNS), /* Layer 3: Mouse mode(IJKL)[Semicolon] * ,-----------------------------------------------------------. @@ -75,12 +75,12 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------------------------------' * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel */ - [3] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,FN9, FN10,FN8, \ - LCTL,ACL0,ACL1,ACL2,ACL2,NO, NO, MS_L,MS_D,MS_R,FN3, NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT,TRNS, \ - TRNS,LGUI,LALT, BTN1, TRNS,TRNS,TRNS,TRNS), + [3] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + LALT(KC_TAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_MS_U, KC_WH_U, KC_WH_R, ALT_T(KC_LEFT), ALT_T(KC_RGHT),LALT(KC_TAB), \ + KC_LCTL, KC_ACL0,KC_ACL1,KC_ACL2,KC_ACL2,KC_NO, KC_NO, KC_MS_L,KC_MS_D, KC_MS_R, LT(3, KC_SCLN), KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN3,KC_BTN2,KC_BTN1,ALT_T(KC_LEFT), ALT_T(KC_RGHT), KC_NO, KC_RSFT, KC_TRNS, \ + KC_TRNS, KC_LGUI,KC_LALT, KC_BTN1, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), /* Layer 4: Mouse mode(IJKL)[Space] * ,-----------------------------------------------------------. @@ -96,104 +96,18 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------------------------------' * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel */ - [4] = \ - KEYMAP(GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - FN8, NO, NO, NO, NO, NO, WH_L,WH_D,MS_U,WH_U,WH_R,BTN4,BTN5,FN8, \ - LCTL,VOLD,VOLU,MUTE,NO, NO, NO, MS_L,MS_D,MS_R,BTN1,NO, ENT, \ - LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,FN9, FN10,NO, RSFT,TRNS, \ - TRNS,LGUI,LALT, TRNS, TRNS,TRNS,TRNS,TRNS), + [4] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + LALT(KC_TAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_MS_U, KC_WH_U, KC_WH_R,KC_BTN4,KC_BTN5,LALT(KC_TAB), \ + KC_LCTL, KC_VOLD,KC_VOLU,KC_MUTE,KC_NO, KC_NO, KC_NO, KC_MS_L,KC_MS_D, KC_MS_R, KC_BTN1,KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN3,KC_BTN2,KC_BTN1,ALT_T(KC_LEFT),ALT_T(KC_RGHT),KC_NO, KC_RSFT,KC_TRNS, \ + KC_TRNS, KC_LGUI,KC_LALT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS), }; -/* id for user defined functions */ -enum function_id { - LSHIFT_LPAREN, -}; - -enum macro_id { - HELLO, - VOLUP, - ALT_TAB, -}; - /* * Fn action definition */ const uint16_t fn_actions[] = { - [0] = ACTION_DEFAULT_LAYER_SET(0), // Default layer(not used) - [1] = ACTION_LAYER_TAP_TOGGLE(1), // HHKB layer(toggle with 5 taps) - [2] = ACTION_LAYER_TAP_KEY(2, KC_SLASH), // Cursor layer with Slash* - [3] = ACTION_LAYER_TAP_KEY(3, KC_SCLN), // Mousekey layer with Semicolon* - [4] = ACTION_LAYER_TAP_KEY(4, KC_SPC), // Mousekey layer with Space - [5] = ACTION_LAYER_MOMENTARY(4), // Mousekey layer(IJKL) - [6] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT), // RControl with tap Enter - [7] = ACTION_MODS_ONESHOT(MOD_LSFT), // Oneshot Shift - [8] = ACTION_MACRO(ALT_TAB), // Application switching - [9] = ACTION_MODS_KEY(MOD_LALT, KC_LEFT), - [10] = ACTION_MODS_KEY(MOD_LALT, KC_RIGHT), -}; - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) { - case HELLO: - return (record->event.pressed ? - MACRO( I(0), T(H), T(E), T(L), T(L), W(255), T(O), END ) : - MACRO_NONE ); - case VOLUP: - return (record->event.pressed ? - MACRO( D(VOLU), U(VOLU), END ) : - MACRO_NONE ); - case ALT_TAB: - return (record->event.pressed ? - MACRO( D(LALT), D(TAB), END ) : - MACRO( U(TAB), END )); - } - return MACRO_NONE; -} - - -/* - * user defined action function - */ -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (record->event.pressed) dprint("P"); else dprint("R"); - dprintf("%d", record->tap.count); - if (record->tap.interrupted) dprint("i"); - dprint("\n"); - - switch (id) { - case LSHIFT_LPAREN: - // Shift parentheses example: LShft + tap '(' - // http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#shift-parentheses - // http://geekhack.org/index.php?topic=41989.msg1304899#msg1304899 - if (record->event.pressed) { - if (record->tap.count > 0 && !record->tap.interrupted) { - if (record->tap.interrupted) { - dprint("tap interrupted\n"); - register_mods(MOD_BIT(KC_LSHIFT)); - } - } else { - register_mods(MOD_BIT(KC_LSHIFT)); - } - } else { - if (record->tap.count > 0 && !(record->tap.interrupted)) { - add_weak_mods(MOD_BIT(KC_LSHIFT)); - send_keyboard_report(); - register_code(KC_9); - unregister_code(KC_9); - del_weak_mods(MOD_BIT(KC_LSHIFT)); - send_keyboard_report(); - record->tap.count = 0; // ad hoc: cancel tap - } else { - unregister_mods(MOD_BIT(KC_LSHIFT)); - } - } - break; - } -} +}; -- cgit v1.2.3-24-g4f1b From 0c4177e0778d8d1f0f7b66e5f6203289eca154bf Mon Sep 17 00:00:00 2001 From: Depariel Date: Sun, 31 Jul 2016 15:16:55 -0400 Subject: fixed typo in hasu/keymap.c --- keyboards/infinity_chibios/keymaps/hasu/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/infinity_chibios/keymaps/hasu/keymap.c b/keyboards/infinity_chibios/keymaps/hasu/keymap.c index 4c0e57927..a1954d258 100644 --- a/keyboards/infinity_chibios/keymaps/hasu/keymap.c +++ b/keyboards/infinity_chibios/keymaps/hasu/keymap.c @@ -18,7 +18,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_GRV, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_SCLN), KC_QUOT,MT(KC_RCTL, KC_ENT), \ - OSM(LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, LT(2, KC_SLSH), KC_RSFT,TG(1), \ + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, LT(2, KC_SLSH), KC_RSFT,TG(1), \ KC_NO, KC_LGUI,KC_LALT, LT(4, KC_SPC), MO(4), KC_RGUI,KC_NO, KC_NO), /* Layer 1: HHKB mode (HHKB Fn) -- cgit v1.2.3-24-g4f1b From c2419ffeccc7916b9bcf8df244a63203aea5a908 Mon Sep 17 00:00:00 2001 From: Nathan Sharfi Date: Sun, 31 Jul 2016 14:10:03 -0700 Subject: Remove /keyboard/* files --- .../ergodox_ez/keymaps/zweihander-osx/keymap.c | 233 ---- .../ergodox_ez/keymaps/zweihander-osx/makefile.mk | 2 - .../keymaps/zweihander-osx/zweihander-osx.hex | 1159 -------------------- 3 files changed, 1394 deletions(-) delete mode 100644 keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c delete mode 100644 keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk delete mode 100644 keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c b/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c deleted file mode 100644 index 69d08d0e1..000000000 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/keymap.c +++ /dev/null @@ -1,233 +0,0 @@ -#include "ergodox_ez.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -#define SGWK 0 // "sagewick", ⌘S ⌘⇥ -#define SGWF 1 // "sagewick freshly", ⌘S ⌘⇥ ⌘R -#define BBED 2 // BBEdit -#define TMNL 3 // Terminal -#define SAFA 4 // Safari -#define ALFRED_LEAD_TIME 250 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | L1 | | L1 | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | ⌦ | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / L⌘ | - * |--------+------+------+------+------+------| L⌘ | | L⌘ |------+------+------+------+------+--------| - * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / / ⌃| R⇧ | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | L⌃ | L⌥ | L⌘ | ↠| → | | ↑ | ↓ | [ | ] | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,---------------. - * | `~ | '" | | ⎋ | ⌫ | - * ,------|------|------| |------+--------+------. - * | | | PgUp | | PgDn | | | - * | | ⌫ |------| |------| ⇥ |Enter | - * | | | L⌥ | | L⌃ | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB), - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, MO(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI, - KC_LCTL, KC_LALT, KC_LGUI,KC_LEFT,KC_RGHT, - KC_GRV, KC_QUOT, - KC_PGUP, - KC_SPC,KC_BSPC,KC_LALT, - // right hand - TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - KC_LGUI, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_SPC , - KC_ESC, KC_BSPC, - KC_PGDN, - KC_LCTL, KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | [ | ] | { | } | " | | | | / | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | = | | | | : | 1 | 2 | 3 | = | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | 0 | . | ↠| → | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQT ,KC_TRNS, - KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_EQL ,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_COLN, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, - KC_0, KC_DOT, KC_LEFT, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F14 | F15 | | | | | | ⌘Q | ⌘W | ⌘⇧` | ⌘` | | | Power | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | PgUp |⌘S⌘⇥⌘R| Term | | | | ⌘] | ⌥⌘↑ | ↑ | ⌥⌘↓ | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |Safari| PgDn | | |------| |------| ⌘[ | ↠| ↓ | → | | ⯠| - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | |BBEdit| | | |L⇧+Spc| Spc | â® | â­ | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | Home | | End | | | - * | | |------| |------| ⌘C | ⌘V | - * | | | | | ⌘X | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[MDIA] = KEYMAP( - KC_TRNS, KC_F14 , KC_F15 , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /* F14 dims screen, F15 brightens */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, M(SGWF), M(TMNL), KC_TRNS, - KC_TRNS, KC_TRNS, M(SAFA), KC_PGDN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(BBED), KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_HOME, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR , - KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, - LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY, - KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_END , - LGUI(KC_X), LGUI(KC_C), LGUI(KC_V) -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case SGWK: - if (record->event.pressed) { - return MACRO( - I(10), - D(LGUI), T(S), U(LGUI), - D(LGUI), T(TAB), U(LGUI), - END); - } - break; - case SGWF: - if (record->event.pressed) { - return MACRO( - I(10), - D(LGUI), T(S), U(LGUI), - D(LGUI), T(TAB), U(LGUI), - D(LGUI), T(R), U(LGUI), - END); - } - break; - case BBED: - if (record->event.pressed) { - return MACRO( - I(10), - D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), - T(B), T(B), T(E), T(D), T(I), T(T), - T(ENT), - END); - } - break; - case TMNL: - if (record->event.pressed) { - return MACRO( - I(10), - D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), - T(T), T(E), T(R), T(M), T(I), T(N), T(A), T(L), - T(ENT), - END); - } - break; - case SAFA: - if (record->event.pressed) { - return MACRO( - I(10), - D(LALT), T(SPC), U(LALT), W(ALFRED_LEAD_TIME), - T(S), T(A), T(F), T(A), T(R), T(I), - T(ENT), - END); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk b/keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk deleted file mode 100644 index 6e3d088a4..000000000 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/makefile.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Don’t do a tricolor wave when the computer is shut down in Windows -SLEEP_LED_ENABLE = no diff --git a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex b/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex deleted file mode 100644 index 270a197af..000000000 --- a/keyboard/ergodox_ez/keymaps/zweihander-osx/zweihander-osx.hex +++ /dev/null @@ -1,1159 +0,0 @@ -:100000000C94B3020C94F7020C94F7020C94F702D0 -:100010000C94F7020C94F7020C94F7020C94F7027C -:100020000C94F7020C94F7020C94B00D0C94820E11 -:100030000C94E01B0C94F7020C94F7020C94F7025A -:100040000C94F7020C94F7020C94F7020C94F7024C -:100050000C94F7020C94481C0C94F7020C94F702D1 -:100060000C94F7020C94F7020C94F7020C94F7022C -:100070000C94F7020C94F7020C94F7020C94F7021C -:100080000C94F7020C94F7020C94F7020C94F7020C -:100090000C94F7020C94F7020C94F7020C94F702FC -:1000A0000C94F7020C94F7020C94F702EF0E110F68 -:1000B000FF0F110FFF0F560F790FFF0FCE0FE10F3C -:1000C000B012B012DF12DF12151335136614661466 -:1000D00040136614F013F01357146614661460147A -:1000E000FD13FD13FD13FD13FD13FD13FD13FD1390 -:1000F000FD13FD13FD13FD13FD13FD13FD13FD1380 -:100100000F141C1423142A143414750A01E2012C50 -:10011000022C02E274FA011602160104020401091B -:1001200002090104020401150215010C020C012848 -:10013000022800750A01E2012C022C02E274FA0185 -:10014000170217010802080115021501100210011B -:100150000C020C0111021101040204010F020F0133 -:1001600028022800750A01E2012C022C02E274FA2E -:100170000105020501050205010802080107020741 -:10018000010C020C011702170128022800750A0150 -:10019000E30116021602E301E3012B022B02E30145 -:1001A000E30115021502E300750A01E301160216C8 -:1001B00002E301E3012B022B02E3000000F0A12E79 -:1001C000004C002A00E100E00000001E00140004C2 -:1001D000001D00E200E2001F001A0016001B00E3F1 -:1001E000002A00200008000700060050002C002113 -:1001F000001500090019004F004B00220017000AEB -:1002000000050000003500015401520000E3000029 -:10021000003400015401520000E3000000290023D3 -:10022000001C000B00110000002A00240018000D23 -:1002300000100052004E0025000C000E0036005148 -:10024000002800260012000F0037002F002B002787 -:10025000001300334238713000E0002D00310034CB -:1002600078E5002C00000001000100010001000100 -:100270000000003A002F0036020100010001003B9F -:1002800000300037020100010001003C002F02266F -:10029000020100010001003D0030022702010001BF -:1002A0000001003E00340234002E00000001000175 -:1002B0000001000000010000000100010001000039 -:1002C000000100000001003F0038002D0033020053 -:1002D0000001004000240021001E00270001004111 -:1002E00000250022001F00370001004200260023E5 -:1002F00000200050000100430025022E022E004F76 -:10030000000100440045000100010001000000015F -:10031000000100010001000100000069000100016E -:10032000000100010001006A000100043001000129 -:1003300000010001004B004E00010001000100011E -:100340000001300100010001004A000100033001FA -:100350000002300000010001000100000001000067 -:100360000001001408010000000100000001001A53 -:100370000830082F082C0200000100350A520C50EA -:10038000002C00A9004D00350852005100AC00AA15 -:100390000019080100510C4F00AB00A8000608012D -:1003A0000001000100010001001B08A5000100AED2 -:1003B0000001000100000016034500720067006F95 -:1003C0000044006F007800200045005A000000162D -:1003D000034500720067006F0044006F0078002042 -:1003E0000045005A0000000403090409026D0004DE -:1003F0000100A0FA09040000010301010009211114 -:10040000010001223F000705810308000A090401D9 -:10041000000103010200092111010001224D000722 -:1004200005820308000A0904020001030000000914 -:1004300021110100012236000705830308000A0983 -:100440000403000103000000092111010001223909 -:1004500000070584031000011201100100000008CC -:10046000EDFE071301000102000105010906A101CB -:10047000050719E029E71500250195087501810296 -:100480000508190129059505750191029501750366 -:100490009101050719002977150025019578750147 -:1004A0008102C005010980A101850216010026B75D -:1004B000001A01002AB700751095018100C0050CD3 -:1004C0000901A1018503160100269C021A01002AD8 -:1004D0009C02751095018100C005010902A1010966 -:1004E00001A10005091901290515002501950575CA -:1004F000018102950175038101050109300931155A -:1005000081257F95027508810609381581257F951B -:100510000175088106050C0A38021581257F9501B1 -:1005200075088106C0C005010906A101050719E08B -:1005300029E71500250195087501810295017508C7 -:10054000810105081901290595057501910295019B -:10055000750391010507190029FF150025FF950670 -:1005600075088100C00011241FBECFEFDAE0DEBFA6 -:10057000CDBF04B603FE24C08091F9019091FA0129 -:10058000A091FB01B091FC018730904BA740B04B8C -:10059000B9F41092F9011092FA011092FB01109235 -:1005A000FC0114BE84B7877F84BF88E10FB6F8943E -:1005B00080936000109260000FBEE0E0FFE30995B9 -:1005C00011E0A0E0B1E0E0E2F8E402C005900D9295 -:1005D000A433B107D9F711E0A4E3B1E001C01D9243 -:1005E000A93FB107E1F70E94F60A0C940E240C947F -:1005F0000000FC016230B9F028F4662341F061305C -:1006000061F023C06330A9F06430C9F01EC082815C -:100610008823D9F088EA91E0089582818823A9F09F -:100620008DE891E008958281882379F084E691E055 -:1006300008958281882349F083E391E008958281BF -:10064000882319F08AE091E0089580E090E0089511 -:1006500008956091BD017091BE018091BF0190919C -:10066000C0010E94511B56985E9825982D98269897 -:100670002E9827982F98813019F0823021F0089514 -:10068000259A2D9A0895269A2E9A08950C94290356 -:1006900056985E9825982D9826982E9827982F98EA -:1006A0008FEF90E0909389008093880090938B0067 -:1006B00080938A0090938D0080938C00259A2D9AC8 -:1006C0002FEF80E792E0215080409040E1F700C09A -:1006D0000000269A2E9A2FEF80E792E0215080406A -:1006E0009040E1F700C00000279A2F9A2FEF80E793 -:1006F00092E0215080409040E1F700C00000259832 -:100700002D982FEF80E792E0215080409040E1F754 -:1007100000C0000026982E982FEF80E792E021502D -:1007200080409040E1F700C0000027982F9856982D -:100730005E9825982D9826982E9827982F9808959A -:1007400089EA8093800089E08093810024982C9826 -:100750003F988AB18F748AB96E98479A8BB1806B33 -:100760008BB9769A0E9448030C94280380E2809308 -:1007700000018091340181110EC00E94050481E0C6 -:10078000809334012FEF83ED90E32150804090401F -:10079000E1F700C0000080E40E940B048093000198 -:1007A00081112EC00E94350480930001811128C060 -:1007B0000E94350480930001811122C08FE30E94C2 -:1007C00035048093000181111BC00E942D0480E438 -:1007D0000E940B0480930001811112C08CE00E94E2 -:1007E00035048093000181110BC00E943504809371 -:1007F0000001811105C08FE30E9435048093000140 -:100800000E942D048091000108951092B9008AE0A1 -:100810008093B800089594EA9093BC009091BC0036 -:1008200097FFFCCF9091B900987F983021F09031DC -:1008300011F081E008958093BB0084E88093BC00B0 -:100840008091BC0087FFFCCF8091B900887F883100 -:1008500011F0803471F780E0089584E98093BC0042 -:100860008091BC0084FDFCCF08958093BB0084E898 -:100870008093BC008091BC0087FFFCCF9091B900B1 -:10088000987F81E0983209F480E0089584E88093AD -:10089000BC008091BC0087FFFCCF8091BB00089515 -:1008A00080910001811115C080E40E940B048093A7 -:1008B000000181110CC082E10E9435048093000187 -:1008C000811105C08FEF0E943504809300010E94C2 -:1008D0002D0484B1807F84B985B1807F85B98AB1C8 -:1008E000837F8AB98BB1837F8BB93E9846980895F0 -:1008F0000E94B603809300010E94500480B38C7064 -:1009000080BB81B3836F81BBA6E3B1E0E4E4F1E097 -:100910008EE08E0F11921D928E13FCCF0C94A003CB -:10092000BF92CF92DF92EF92FF920F931F93CF93DC -:10093000DF9380910001882379F0809135018F5FEA -:1009400080933501811108C00E94B6038093000195 -:10095000811102C00E94480306E311E0C0E0D0E02C -:10096000DD24D39482E0C82EEE24E394F12CC7302A -:10097000D10500F580910001811164C080E40E94DE -:100980000B0480930001811112C082E10E943504A2 -:100990008093000181110BC0C7010C2E01C0880F8C -:1009A0000A94EAF780950E943504809300010E9422 -:1009B0002D0448C0CA30A1F028F4C83059F0C9301D -:1009C00061F005C0CC3089F070F0CD3089F0209A0C -:1009D000289810C0219A29980DC0229A2A980AC0F6 -:1009E000239A2B9807C0529A01C0539A5B9802C071 -:1009F0003E9A469890EA9A95F1F79FB1799902C08C -:100A000082E001C080E091709D25982B7C9902C006 -:100A100084E001C080E0892B7D9902C038E001C0EC -:100A200030E0832B7E9902C020E101C020E0822BC0 -:100A30009FB19095991F9927991F9295990F907E34 -:100A4000892B0FC080910001811149C080E40E9470 -:100A50000B0480930001882379F1B12C0E942D04AE -:100A60008B2DF8019081981719F08083C0920101B5 -:100A70000E94500421960F5F1F4FCE30D10509F020 -:100A800076CF80910101882361F18150809301012B -:100A9000882339F08FE99FE00197F1F700C000004B -:100AA00020C0A4E4B1E0E6E3F1E0CF01825F9191E0 -:100AB0009D938E13FCCF15C083E10E943504809373 -:100AC00000018111CACF81E40E940B0480930001D0 -:100AD0008111C3CF0E944604B82EB094BFCF80E0EE -:100AE000C0CF0E94460381E0DF91CF911F910F910B -:100AF000FF90EF90DF90CF90BF900895E82FF0E047 -:100B0000EC5BFE4F8081089508950F931F93CF9360 -:100B1000DF93C4E4D1E010E00C2F025F899190E0F4 -:100B20000E94451B180F0C13F9CF812FDF91CF9135 -:100B30001F910F91089581E0089581E008950C942C -:100B40009D0508950F931F93CF93DF938C01FC01B4 -:100B5000C081D181CE010E94CA19BE010E944B06FC -:100B6000EC01B8010E949F05882309F48DC0F801AB -:100B70008281882309F44AC080915D0181111FC0E0 -:100B8000C431F0E5DF0709F051C00E94A10581E002 -:100B900080935D010E94121C90935C0180935B0125 -:100BA0001092540110925601109255011092580162 -:100BB0001092570110925A011092590165C080910C -:100BC0005B0190915C010E941E1C883C910570F4B1 -:100BD00080915401E82FF0E0EE0FFF1FEB5AFE4F1B -:100BE000D183C0838F5F809354014EC0C43880E5A9 -:100BF000D80721F0C538D04501F13AC0F80182810B -:100C0000882341F01092520182E01EC0C438E0E512 -:100C1000DE0759F580915201811106C086E20E94DB -:100C2000541186E20E941C1282E01CC0C438F0E518 -:100C3000DF0741F3C538D045D9F4F8018281882314 -:100C400031F01092530180E20E946B121DC080911E -:100C50005301811106C087E20E94541187E20E946D -:100C60001C1280E20E9472120FC0C538D04529F3D1 -:100C700081E08093520180935301C801DF91CF91AD -:100C80001F910F910C949B0580E0DF91CF911F91F4 -:100C90000F910895089596E0799FF001112494E54D -:100CA000899FE00DF11D1124E60FF11DEE0FFF1FCE -:100CB000E154FE4F859194910895880F991FFC018E -:100CC000E55CFF4F859194910895880F991FFC0171 -:100CD000E554FE4F8591949108950F931F93CF9300 -:100CE000DF93EC018115904350F5C11580E2D807E0 -:100CF00008F0C3C0CB3BD10590F4C83AD10508F049 -:100D00006AC0C53AD10508F05BC0C430D10508F00F -:100D1000D0C1219709F0CAC101E010E00AC2CF3F5B -:100D2000D10511F008F0C5C1C03FD10508F0A2C03F -:100D3000CE01805E9109089708F4BBC1B7C1C130EC -:100D400090E5D90709F4A2C020F5C0318FE4D80797 -:100D500070F4C11590E4D90708F094C0C11521E3DF -:100D6000D20708F0A3C1DD278E01106CE2C1C115C6 -:100D7000D04509F09BC10E94D1148FEF94E32CE081 -:100D8000815090402040E1F700C000000E946D1C9F -:100D9000D0C1C11597E5D90758F4C03121E5D20774 -:100DA00008F01CC1C43180E5D80708F475C07EC1C5 -:100DB000CE0190578115904108F078C1DF7073C162 -:100DC000C53AD10509F477C1C63AD10509F076C113 -:100DD00002E810E4AEC1C83AD10509F472C1C93ABB -:100DE000D10509F471C1CA3AD10509F470C1CB3AF1 -:100DF000D10509F46FC1CC3AD10509F46EC1CD3AE1 -:100E0000D10509F46DC1C03BD10509F46CC1CE3ADE -:100E1000D10509F46BC1CF3AD10509F46AC1C13BD0 -:100E2000D10509F469C1C23BD10509F468C1C33BCE -:100E3000D10509F467C1C43BD10509F466C1C53BBE -:100E4000D10509F465C1C63BD10509F464C1C73BAE -:100E5000D10509F463C1C83BD10509F462C1C93B9E -:100E6000D10509F461C1CA3BD10509F460C100E0B4 -:100E700014E45FC18E0110655CC1CE019F700E94B9 -:100E8000650658C1DF708E01106A53C18091DA0186 -:100E900081608093DA014DC10E94121E811102C04F -:100EA0000E94F81D0E942F1E90E09093F9018093FC -:100EB000F801C23080E5D80721F48091F801816003 -:100EC00086C0C43090E5D90721F48091F801826092 -:100ED0007EC0C63020E5D20721F48091F8018460FD -:100EE00076C0C83080E5D80719F48091F80127C092 -:100EF000CA3090E5D90721F48091F801806167C07C -:100F0000CC3020E5D20721F48091F80180625FC0E7 -:100F1000CE3080E5D80721F48091F801806457C075 -:100F2000C03190E5D90721F48091F80180684FC065 -:100F3000C23120E5D20729F48091F80184608860ED -:100F400046C0C33080E5D80721F48091F8018E7F38 -:100F50003EC0C53090E5D90721F48091F8018D7F1E -:100F600036C0C73020E5D20721F48091F8018B7F8D -:100F70002EC0C93080E5D80719F48091F80126C049 -:100F8000CB3090E5D90721F48091F8018F7E1FC006 -:100F9000CD3020E5D20721F48091F8018F7D17C074 -:100FA000CF3080E5D80721F48091F8018F7B0FC006 -:100FB000C13190E5D90721F48091F8018F7707C0FE -:100FC000C331D04531F48091F8018B7F877F8093C6 -:100FD000F8018091F8010E94331EABC08D2F992734 -:100FE0008F70992781309105D9F49E0123703327A2 -:100FF00002C0880F991F2A95E2F79C688E0144E091 -:10100000000F111F4A95E1F700271370802B912BD9 -:1010100053E0CC0FDD1F5A95E1F7C076DD272FC0D6 -:101020008230910531F4DC2FCC278E01016F106ADC -:1010300080C08330910569F4CE018370992701E067 -:1010400010E002C0000F111F8A95E2F7C8019C68EA -:101050000FC084309105B9F4CE018370992701E067 -:1010600010E002C0000F111F8A95E2F7C8019A68CC -:1010700023E0CC0FDD1F2A95E1F7C07ED7708C01ED -:101080000C2B1D2B56C08530910531F4DC2FCC275D -:101090008E01046F106A4DC0069709F04AC0CF71E7 -:1010A000DD27DC2FCC278E01106243C000E010E06A -:1010B00040C08E013EC001E810E43BC003E810E4EC -:1010C00038C002EE14E435C009EE14E432C00AEE72 -:1010D00014E42FC005EB14E42CC006EB14E429C083 -:1010E00007EB14E426C00CEC14E423C00DEC14E46C -:1010F00020C003E815E41DC00AE815E41AC002E99F -:1011000015E417C004E915E414C001E216E411C0A7 -:1011100003E216E40EC004E216E40BC005E216E496 -:1011200008C006E216E405C007E216E402C00AE2BF -:1011300016E4C801DF91CF911F910F91089596E0B9 -:10114000799FF001112494E5899FE00DF11D112490 -:10115000E60FF11DEE0FFF1FE154FE4F85919491B4 -:10116000803E9105E0F4803C910558F5813391056E -:1011700009F46FC048F48932910509F463C08A32DA -:10118000910509F46DC072C089339105E9F0823888 -:101190009105D1F08533910509F44DC067C0833EB8 -:1011A000910581F138F4803E9105B9F0823E9105B8 -:1011B000D9F05CC0863E910561F1873E9105A1F1B1 -:1011C00055C00E945D0608952091F80120FD02C0DF -:1011D00021FF4CC080EE90E049C08091F80180FF73 -:1011E000F9CF89E390E042C08091F80182FF0EC000 -:1011F0008091F80184FF03C080E090E037C083EE67 -:1012000090E034C08091F80182FFF2CF82EE90E04E -:101210002DC08091F80183FF0BC08091F80184FDFF -:10122000EBCF87EE90E022C08091F80183FFF5CFED -:1012300086EE90E01BC08091F80185FF07C089E22F -:1012400090E014C08091F80185FFF9CF85E390E02C -:101250000DC08091F80186FF07C08AE290E006C0C9 -:101260008091F80186FFF9CF81E390E00E946D063E -:10127000089508950C94390980916E010895CF93D3 -:10128000DF9300D01F92CDB7DEB79C018091EF01B4 -:10129000843019F593E099833B832A839093E90086 -:1012A0008FEF9091E800815095FD06C095ED9A95DD -:1012B000F1F700008111F5CF8091E80085FF0DC0A6 -:1012C00040E050E063E070E0CE0101960E94A00B88 -:1012D0008091E8008E778093E8000F900F900F9038 -:1012E000DF91CF910895CF93DF9300D01F92CDB7B8 -:1012F000DEB72091EF01243021F522E029839B8382 -:101300008A8383E08093E9008FEF9091E800815019 -:1013100095FD06C095ED9A95F1F700008111F5CF86 -:101320008091E80085FF0DC040E050E063E070E090 -:10133000CE0101960E94A00B8091E8008E778093E9 -:10134000E8000F900F900F90DF91CF9108952091BA -:10135000EF012430F1F422E02093E9002FEF3091E7 -:10136000E800215035FD06C035ED3A95F1F7000053 -:101370002111F5CF2091E80025FF0BC040E050E09F -:1013800065E070E00E94A00B8091E8008E7780936A -:10139000E8000895CF93DF93EC019091EF01943032 -:1013A00009F046C080910C018823D9F080910D018D -:1013B0008823B9F09093E9008FEF9091E800815075 -:1013C00095FD06C095E19A95F1F700008111F5CFE2 -:1013D0008091E80085FF2CC040E050E060E170E0C3 -:1013E00017C081E08093E9008FEF9091E800815071 -:1013F00095FD06C095ED9A95F1F700008111F5CFA6 -:101400008091E80085FF14C040E050E068E070E0A3 -:10141000CE010E94A00B8091E8008E778093E800B7 -:1014200080E1FE01AEE5B1E001900D928A95E1F711 -:10143000DF91CF9108958091EE01811109C00E9442 -:10144000350D0E94920D8091E20084608093E2004D -:1014500008951092EE010895089508950C94DA1BF2 -:1014600042E061EC81E00E94AF0C42E061EC82E07E -:101470000E94AF0C42E061EC83E00E94AF0C42E1BD -:1014800061EC84E00C94AF0C8091F101833009F49D -:1014900055C030F4813071F0823009F48EC0089567 -:1014A0008A3009F47AC08B3009F460C0893009F0C1 -:1014B0009CC020C08091F001813A09F096C08091D3 -:1014C000E800877F8093E8008091F4019091F50116 -:1014D000892B21F460E18EE591E003C060E080E0BB -:1014E00090E070E00E94EB0B8091E8008B77809396 -:1014F000E80008958091F001813209F076C0809172 -:10150000F4019091F501009719F0039709F06DC06F -:101510008091E800877F8093E8008091E80082FD59 -:1015200005C08091EF018111F8CF5FC08091F1007B -:1015300080936E018091E8008B7753C08091F00119 -:10154000813A09F052C08091F4019091F501892B04 -:1015500009F04BC08091E800877F8093E80080917C -:10156000E80080FFFCCF80910C0136C08091F00133 -:101570008132D9F58091F4019091F501892BA9F57B -:101580008091E800877F8093E8000E94E40C8091BE -:10159000F20180930C010C94D1148091F0018132FE -:1015A00021F58091E800877F8093E8000E94E40C99 -:1015B0008091F30180936F0108958091F001813A49 -:1015C000A1F48091E800877F8093E8008091E80093 -:1015D00080FFFCCF80916F018093F1008091E80043 -:1015E0008E778093E8000C94E40C089584B7877F8D -:1015F00084BF88E10FB6F894809360001092600079 -:101600000FBE90E080E80FB6F8948093610090934D -:1016100061000FBE0E9487100E94350D0E94920D3E -:101620008091E20084608093E20078940E94181018 -:101630000E94891082E091E00E9433108091EF01B6 -:10164000853069F40E94A11B8091ED018823B1F3DC -:101650000E94CC1B882391F30E948A0BEFCF0E943B -:101660008F10ECCF292F332723303105C9F064F4D4 -:101670002130310581F02230310509F043C08DE67B -:1016800090E02BEE33E042C021323105F1F02232FE -:10169000310541F137C082E190E028E534E036C001 -:1016A00099278130910541F08230910541F0892BD5 -:1016B00049F5E7EEF3E005C0EFECF3E002C0E7EB3D -:1016C000F3E0849190E09F0121C06430D8F4E62FCC -:1016D000F0E0EE0FFF1FEE5DFE4F2081318189E0CB -:1016E00090E014C0643070F470E0FB01EE0FFF1F57 -:1016F000E65EFE4F20813181FB01EA5EFE4F808174 -:1017000090E004C080E090E020E030E0FA01318316 -:101710002083089580E189BD82E189BD09B400FE7E -:10172000FDCF8091D8008F7D8093D8008091E0001C -:1017300082608093E0008091E00081FDFCCF0895FD -:10174000CF92DF92EF92FF920F931F93CF93DF938D -:10175000EC018B016A010E94030D811133C0C11499 -:10176000D10439F0F60180819181081B190BC80F53 -:10177000D91FE12CF12C0115110519F18091E80018 -:1017800085FD16C08091E8008E778093E800C11433 -:10179000D10449F0F60180819181E80EF91EF182B1 -:1017A000E08285E00FC00E94030D882321F30AC068 -:1017B00089918093F10001501109FFEFEF1AFF0AA0 -:1017C000DACF80E0DF91CF911F910F91FF90EF90E2 -:1017D000DF90CF9008952091F6013091F701261700 -:1017E000370748F06115710539F42091E8002E772C -:1017F0002093E80001C0B90140E061157105A9F12D -:101800002091EF01222309F443C0253009F442C09E -:101810002091E80023FD40C02091E80022FD32C065 -:101820002091E80020FFE9CF4091F3002091F200E1 -:1018300030E0342BFC01CF016115710559F02830DF -:10184000310540F481918093F100615071092F5F5F -:101850003F4FF1CF41E02830310509F040E02091C1 -:10186000E8002E772093E800C8CF4111C9CF0AC005 -:101870008091EF01882361F0853061F08091E8006C -:1018800083FD0AC08091E80082FFF2CF80E00895D6 -:1018900082E0089583E0089581E008952091F601A3 -:1018A0003091F7012617370748F06115710539F4B3 -:1018B0002091E8002E772093E80001C0B901FC01D7 -:1018C00020E06115710591F18091EF01882309F401 -:1018D00040C0853009F43FC08091E80083FD3DC0E1 -:1018E0008091E80082FD2FC08091E80080FFE9CF61 -:1018F0002091F3008091F20090E0922B6115710528 -:1019000059F08830910540F424912093F1003196EC -:10191000615071090196F2CF21E0089709F020E0AB -:101920008091E8008E778093E800CBCF2111CCCF57 -:101930000AC08091EF01882361F0853061F08091C9 -:10194000E80083FD0AC08091E80082FFF2CF80E0CA -:10195000089582E0089583E0089581E00895982F26 -:10196000973058F59093E900981739F07091EC0092 -:101970002091ED005091F00003C0242F762F50E00D -:1019800021FF19C03091EB003E7F3093EB00309186 -:10199000ED003D7F3093ED003091EB0031603093EE -:1019A000EB007093EC002093ED005093F000209139 -:1019B000EE0027FF07C09F5FD3CF8F708093E900B1 -:1019C00081E0089580E008958091F00187FF11C0C3 -:1019D0008091E80082FD05C08091EF018111F8CF70 -:1019E00011C08091E8008B770BC08091EF018823B4 -:1019F00049F08091E80080FFF8CF8091E8008E7771 -:101A00008093E80008952091E4003091E50095E688 -:101A10004091EC00842F817040FF22C08091E8004B -:101A200080FD1CC08091EF01882391F0853091F0FA -:101A30008091EB0085FD10C04091E4005091E500DD -:101A40004217530729F39A01915011F784E0089542 -:101A500082E0089583E0089581E0089580E008958C -:101A60004091E80042FFDECF08950E94A30D0E943E -:101A7000AB0DE0EEF0E0808181608083E8EDF0E086 -:101A800080818F77808319BCA7EDB0E08C918E7F29 -:101A90008C9380818F7E80831092EE0108950F9346 -:101AA0001F93CF93DF930E94A30D0E94AB0DC8ED4F -:101AB000D0E088818F778883888180688883888157 -:101AC0008F7D888319BC1092EF011092EB01109268 -:101AD000ED011092EC0100EE10E0F80180818B7FA7 -:101AE000808388818160888342E060E080E00E949A -:101AF000AF0CE1EEF0E080818E7F8083E2EEF0E0DB -:101B0000808181608083808188608083F80180810A -:101B10008E7F8083888180618883DF91CF911F9140 -:101B20000F910895E8EDF0E080818F7E8083E7EDEE -:101B3000F0E080818160808384E082BF81E08093D7 -:101B4000EE010C944F0DE8EDF0E080818E7F8083F4 -:101B50001092E20008951092DA001092E1000895C8 -:101B60001F920F920FB60F9211242F933F934F9312 -:101B70005F936F937F938F939F93AF93BF93EF93F5 -:101B8000FF938091E10082FF0BC08091E20082FF11 -:101B900007C08091E1008B7F8093E1000E941710C5 -:101BA0008091DA0080FF1FC08091D80080FF1BC0A9 -:101BB0008091DA008E7F8093DA008091D90080FFD7 -:101BC0000DC080E189BD82E189BD09B400FEFDCF71 -:101BD00081E08093EF010E941B0A05C019BC10929E -:101BE000EF010E94290A8091E10080FF19C08091D5 -:101BF000E20080FF15C08091E2008E7F8093E200BA -:101C00008091E20080618093E2008091D800806240 -:101C10008093D80019BC85E08093EF010E942D0AC3 -:101C20008091E10084FF30C08091E20084FF2CC0ED -:101C300080E189BD82E189BD09B400FEFDCF8091BC -:101C4000D8008F7D8093D8008091E1008F7E8093B3 -:101C5000E1008091E2008F7E8093E2008091E200BB -:101C600081608093E2008091EB01882311F084E091 -:101C700007C08091E30087FD02C081E001C083E0DE -:101C80008093EF010E942E0A8091E10083FF29C01A -:101C90008091E20083FF25C08091E100877F8093DF -:101CA000E10082E08093EF011092EB018091E1006E -:101CB0008E7F8093E1008091E2008E7F8093E2002E -:101CC0008091E20080618093E20042E060E080E089 -:101CD0000E94AF0C8091F00088608093F0000E9419 -:101CE0002C0AFF91EF91BF91AF919F918F917F91BE -:101CF0006F915F914F913F912F910F900FBE0F9079 -:101D00001F9018951F920F920FB60F9211242F93C8 -:101D10003F934F935F936F937F938F939F93AF9373 -:101D2000BF93CF93DF93EF93FF93C091E900CF7000 -:101D30008091EC00D82FD17080FDD0E81092E9009E -:101D40008091F000877F8093F00078940E94C60E07 -:101D50001092E9008091F00088608093F000CD2B14 -:101D6000CF70C093E900FF91EF91DF91CF91BF91C8 -:101D7000AF919F918F917F916F915F914F913F9123 -:101D80002F910F900FBE0F901F9018951F93CF9318 -:101D9000DF93CDB7DEB7AA970FB6F894DEBF0FBEBC -:101DA000CDBFE0EFF1E088E08E0F9091F1009193CC -:101DB0008E13FBCF0E94440A8091E80083FF1FC16D -:101DC0008091F0019091F101492F50E04A30510586 -:101DD00008F015C1FA01EA5AFF4F0C94BE2380386F -:101DE00081F0823809F00BC18091F4018F708093EB -:101DF000E9008091EB0085FB882780F91092E900CB -:101E000006C08091EC019091ED019111826090915A -:101E1000E800977F9093E8008093F1001092F10022 -:101E2000C8C0282F2D7F09F0EAC0882319F082301E -:101E300061F0E5C08091F201813009F0E0C093309B -:101E400009F080E08093ED012BC08091F2018111B7 -:101E500027C08091F4018F7009F4D1C08093E9000C -:101E60002091EB0020FF1CC0933021F48091EB0007 -:101E7000806214C09091EB0090619093EB0021E0A0 -:101E800030E0A90102C0440F551F8A95E2F7409344 -:101E9000EA001092EA008091EB0088608093EB00EA -:101EA0001092E9008091E800877F86C08111A7C069 -:101EB0001091F2011F778091E3008078812B80934D -:101EC000E3008091E800877F8093E8000E94E40CA3 -:101ED0008091E80080FFFCCF8091E30080688093D0 -:101EE000E300111102C082E001C083E08093EF01A2 -:101EF00086C08058823008F082C08091F2019091B3 -:101F0000F3018C3D53E0950779F583E08A838AE2FB -:101F100089834FB7F894DE01139620E03EE051E24A -:101F2000E32FF0E050935700E49120FF03C0E295C7 -:101F3000EF703F5FEF708E2F90E0EA3010F0C796A1 -:101F400001C0C0968D939D932F5F243149F74FBFF9 -:101F50008091E800877F8093E8006AE270E0CE011C -:101F600001960E94EB0B14C0AE014F5F5F4F609172 -:101F7000F4010E94320BBC01892B09F440C09091FE -:101F8000E800977F9093E80089819A810E944E0C27 -:101F90008091E8008B778093E80031C0803879F534 -:101FA0008091E800877F8093E8008091EB01809327 -:101FB000F1008091E8008E778093E8000E94E40CA5 -:101FC0001EC081111CC09091F2019230C0F480912A -:101FD000E800877F8093E8009093EB010E94E40C77 -:101FE0008091EB01811106C08091E30087FD02C062 -:101FF00081E001C084E08093EF010E94300A80916B -:10200000E80083FF0AC08091E800877F8093E800A2 -:102010008091EB0080628093EB00AA960FB6F89453 -:10202000DEBF0FBECDBFDF91CF911F910895089500 -:10203000CF938091EF018823A1F0C091E900CF7088 -:102040009091EC00892F817090FD80E8C82B109250 -:10205000E9008091E80083FD0E94C60ECF70C09316 -:10206000E900CF91089590937501809374010895CC -:10207000E0917401F0917501309721F00190F081A9 -:10208000E02D099480E00895E0917401F0917501CC -:10209000309721F00280F381E02D09940895E091BA -:1020A0007401F0917501309721F00480F581E02DE5 -:1020B000099408952091720130917301821793075A -:1020C00071F09093730180937201E0917401F0912B -:1020D0007501309721F00680F781E02D099408956D -:1020E00020917001309171018217930771F09093E4 -:1020F000710180937001E0917401F0917501309746 -:1021000021F00084F185E02D0994089508950C9440 -:1021100086100E94091C0E9478040C94CB1C9F928C -:10212000AF92BF92CF92DF92EF92FF920F931F93E5 -:10213000CF93DF9300D000D000D0CDB7DEB70E94A0 -:1021400090040DE010E0AA24A394B12C902E802FCF -:102150000E947E05980129583E4F6901F901F080DF -:10216000F826A1F40150110988F78FEF89838A833B -:102170001B820E94121C8160782F9D838C83498171 -:102180005A816B818D810E9426112FC09091DA01B6 -:1021900091FF04C08E830E9484058E8125E030E08B -:1021A000A501022E01C0440F0A94EAF7E42E4F2144 -:1021B000C1F029839A828E2191E009F490E09B83FB -:1021C0000E94121C8160782F9D838C8349815A81E3 -:1021D0006B818D810E942611F6018081E826E082C4 -:1021E00004C021503109E0F6BDCF0E94B21F10910A -:1021F00076010E9438101817B9F00E9438108093A9 -:10220000760126960FB6F894DEBF0FBECDBFDF91E4 -:10221000CF911F910F91FF90EF90DF90CF90BF90E3 -:10222000AF909F900C943A0926960FB6F894DEBFB3 -:102230000FBECDBFDF91CF911F910F91FF90EF9017 -:10224000DF90CF90BF90AF909F900895CF93DF9392 -:10225000CDB7DEB72B970FB6F894DEBF0FBECDBF5C -:102260004F83588769877A878B87DE01119686E0CE -:10227000FD0111928A95E9F785E0FE0137960190FC -:102280000D928A95E1F749815A816B817C818D811C -:102290009E810E946F172B960FB6F894DEBF0FBE7B -:1022A000CDBFDF91CF910895CF93882309F4C2C0A9 -:1022B000C82F823859F40E94381081FDBBC089E3D1 -:1022C0000E94491A0E94161B89E30CC0833879F4D6 -:1022D0000E94381080FDAEC083E50E94491A0E941A -:1022E000161B83E50E948B1ACF910C94161B843821 -:1022F00059F40E94381082FD9DC087E40E94491A5B -:102300000E94161B87E4EECF8CEF8C0F813A48F4C5 -:102310008C2F0E94ED2181118DC08C2F0E94491AB3 -:10232000E3CF80E28C0F883048F4C77081E001C0B1 -:10233000880FCA95EAF70E94CF1AD6CF8BE58C0F8B -:10234000833078F4C53A29F0C63A31F083E890E05A -:1023500005C081E890E002C082E890E0CF910C9443 -:102360005A1088E58C0F833108F064C0C83A39F1FF -:10237000C93A41F1CA3A49F1CB3A51F1CC3A59F153 -:10238000CD3A61F1C03B69F1CE3A71F1CF3A79F1C2 -:10239000C13B81F1C23B89F1C33B91F1C43B99F14F -:1023A000C53BA1F1C63BA9F1C73BB1F1C83BB9F1AF -:1023B000C93BC1F1CA3BC9F180E090E038C082EE70 -:1023C00090E035C089EE90E032C08AEE90E02FC0F8 -:1023D00085EB90E02CC086EB90E029C087EB90E085 -:1023E00026C08CEC90E023C08DEC90E020C083E808 -:1023F00091E01DC08AE891E01AC082E991E017C01F -:1024000084E991E014C081E292E011C083E292E09D -:102410000EC084E292E00BC085E292E008C086E242 -:1024200092E005C087E292E002C08AE292E0CF919A -:102430000C947010CF910895882309F44BC0823812 -:1024400059F40E94381081FF45C089E30E94491A5F -:102450000E94161B89E30CC0833871F40E94381067 -:1024600080FF38C083E50E94491A0E94161B83E54D -:102470000E948B1A0C94161B843859F40E94381051 -:1024800082FF28C087E40E94491A0E94161B87E435 -:10249000EFCF9CEF980F913A58F390E2980F983055 -:1024A00050F4877091E001C0990F8A95EAF7892F5F -:1024B0000E94D51ADFCF9BE5980F933020F480E07F -:1024C00090E00C945A10885A833120F480E090E018 -:1024D0000C9470100895882321F00E94CF1A0C9458 -:1024E000161B0895882321F00E94D51A0C94161B00 -:1024F00008957F928F929F92AF92BF92CF92DF9278 -:10250000EF92FF920F931F93CF93DF931F92CDB75C -:10251000DEB77C01C62E772EFC01058102950F7077 -:10252000128111110E94EC1A0E94421A882379F03C -:10253000112369F080E28C0D883048F082E00E941F -:102540002B1A0E94421A91E0D82ED92601C0D12C14 -:10255000E72DE295EF70F0E0E05AFF4F0C94BE23B8 -:10256000872D807F072D0F70882311F00295007F43 -:10257000112389F0002309F490C180E28C0D88308A -:1025800020F4802F0E94CF1A03C0802F0E94DF1AF0 -:102590000E94161B82C18C2D0E941C12002309F47C -:1025A00095C180E28C0D883020F4802F0E94D51ACE -:1025B00003C0802F0E94E51A0E94161B87C1972D29 -:1025C000907F872D8F70903211F08295807FCC2084 -:1025D00021F0F1E0CF16B1F01EC0112349F0002325 -:1025E00009F414C1013009F011C10E94FF1A6EC133 -:1025F000002319F0013009F469C189830E94021B8C -:1026000089810AC1112321F0023008F05FC1FEC0A8 -:1026100001115CC101C1112321F0002309F4F6C0AE -:102620003CC1002309F4F8C03EC1872D86958695EC -:10263000837090E0009719F0019761F047C1112372 -:1026400021F08C2D972D937002C080E090E00E94C5 -:102650005A103CC1112321F08C2D972D937002C08C -:1026600080E090E00E94701031C18C2D112319F090 -:102670000E94BA1E02C00E94221F0E94A71F26C1EC -:10268000872D837009F052C0111120C18C2D8295C5 -:1026900086958770880F880F9C2D9F70892E912CAE -:1026A000A12CB12C082E04C0880C991CAA1CBB1CA0 -:1026B0000A94D2F7C4FE14C00FE010E020E030E02E -:1026C000B901A80104C0440F551F661F771F8A95E2 -:1026D000D2F7CB01BA01609570958095909503C0B3 -:1026E00060E070E0CB01272D26952695237030E021 -:1026F0002230310569F02330310589F068297929C4 -:102700008A299B292130310571F00E94B718DEC05B -:10271000682979298A299B290E94D318D7C00E9449 -:10272000B718C501B4010E949B18D0C0112319F03D -:10273000872D817001C08695882309F4C7C08C2D30 -:10274000829586958770880F880F9C2D9F70892EA3 -:10275000912CA12CB12C082E04C0880C991CAA1C09 -:10276000BB1C0A94D2F7C4FE14C00FE010E020E0B6 -:1027700030E0B901A80104C0440F551F661F771F40 -:102780008A95D2F7CB01BA016095709580959095A6 -:1027900003C060E070E0CB01272D269526952370BD -:1027A000422F50E04230510569F04330510589F025 -:1027B000682979298A299B294130510571F00E94A5 -:1027C000911984C0682979298A299B290E94AD1909 -:1027D0007DC00E949119C501B4010E94751976C08F -:1027E0008C2D90E0FC01E05EF109E531F10508F087 -:1027F00050C0E059FF4F0C94BE230C2D0F70872D55 -:102800008F71112331F00E940E19802F0E946B12DC -:102810005DC00E942F19802F0E94721257C0112391 -:1028200039F0011153C0872D8F710E9454194EC089 -:10283000023008F04BC0F7CF112339F0872D8F718C -:102840000E940E1943C01123C9F3872D8F710E9476 -:102850002F193CC0112329F0872D8F710E94F91880 -:1028600035C00E94EF1832C0112351F0172D1F718F -:10287000812F0E940E1963E0812F0E94221A26C028 -:1028800081E00E942B1A023008F182E00E942B1A8C -:102890001DC0112331F0002389F28C2D0E945411A8 -:1028A00015C0002391F28C2D0E941C120FC0472DE1 -:1028B0004F706C2DC7010E94F9020E94131806C0C8 -:1028C000472D4F706C2DC7010E944A06DD20F9F09C -:1028D0000E941E1A80FD1BC0F70112820E94181A66 -:1028E0000E940E19C7010E9496140E94181A0F9098 -:1028F000DF91CF911F910F91FF90EF90DF90CF90DC -:10290000BF90AF909F908F907F900C942F190F9055 -:10291000DF91CF911F910F91FF90EF90DF90CF90BB -:10292000BF90AF909F908F907F9008950F931F93CB -:10293000CF93DF93EC01888199812B813C81232BFC -:10294000B9F09F3F11F48F3F99F0CE010E94A2058C -:10295000882371F0688179818A810E94141A8C0120 -:102960000E94C9190E949018B801CE010E947912E4 -:10297000DF91CF911F910F9108950E94EC1A0E9450 -:10298000FC1A0E94C11A0E94161B0E9458200E9425 -:10299000A71F80E090E00E945A1080E090E00C9425 -:1029A00070100E94DC1A0C94BD140E94091A292F81 -:1029B00022952F7030E02C3031054CF42A3031054F -:1029C0006CF42250310922303105A8F407C02C30B4 -:1029D000310569F02F30310551F00DC0803F69F0AD -:1029E00018F4803E40F409C0843F29F406C093FBEC -:1029F000882780F9089580E0089581E00895CF93B5 -:102A0000DF9300D000D01F92CDB7DEB70F900F90AC -:102A10000F900F900F90DF91CF910895CF93DF9398 -:102A200000D000D000D0CDB7DEB726960FB6F89410 -:102A3000DEBF0FBECDBFDF91CF9108951F93CF931F -:102A4000DF93C091850116E080918601C81799F047 -:102A5000D0E01C9FF0011D9FF00D1124E957FE4F9F -:102A60004081518162817381848195810E940E151C -:102A70002196C770E9CFDF91CF911F9108954091C2 -:102A8000B7015091B8016091B9017091BA0180917C -:102A9000BB019091BC010C940E158091BC018295F4 -:102AA0008F7009F054C08091B901882309F44FC098 -:102AB00080918501A09186016091B7017091B80164 -:102AC0004091BA015091BB01B6E08A1709F43FC0AA -:102AD00090E041155105C1F17F3F11F46F3FA1F125 -:102AE000B89FF001B99FF00D1124E957FE4F2181E5 -:102AF00072132AC02081621327C02281211124C0B1 -:102B0000238134812417350710F421503109241B07 -:102B1000350B283C3105C0F42091BC012F70206199 -:102B20002093BC0126E0289FF001299FF00D11247D -:102B3000E457FE4F80818F708061808387EB91E046 -:102B40000E9496140C941E1501968770BECF0895AE -:102B5000CF92DF92EF92FF920F931F93CF93DF9369 -:102B6000CDB7DEB762970FB6F894DEBF0FBECDBF0C -:102B70008C0185E0F801DE011D9601900D928A9589 -:102B8000E1F7D8014C9111965C91119712966C91D6 -:102B900012971396CD90DC9014973091B7017091F5 -:102BA000B8018091BA019091BB01009709F46BC103 -:102BB0007F3F19F43F3F09F466C1E090B901EE2070 -:102BC00009F4C0C02091BC01C816D90628F0F6014E -:102BD000E81BF90BCF0104C0809590958C0D9D1DCD -:102BE000FF24F394883C910578F0F12C207F09F0C4 -:102BF000C6C07C2DD98AC88A89890E94FF1487EBB8 -:102C000091E00E949614B1C0822F807F09F046C0E7 -:102C1000751314C0341312C0611110C02F702061DD -:102C20002093BC010E943F1587EB91E00E9496140F -:102C30008091BC01D80115968C932EC0CD2819F136 -:102C40005F3F11F44F3FF9F0F62E61111CC08091E7 -:102C500085012091860136E0821709F45AC090E080 -:102C6000389FF001399FF00D1124E957FE4F718113 -:102C7000571306C07081471303C07281711103C0DE -:102C800001968770E9CFF62E662309F418C180916A -:102C9000BC0181608093BC01F12C11C1751308C087 -:102CA000341306C0611104C08091BC01D801C3C0B7 -:102CB0004D875E878D859E856A8B0E94D5146A89B3 -:102CC0008823E1F16623D1F12091BC01822F829506 -:102CD0008F7090E0029774F08091B7019091B801E5 -:102CE00098878F831986DB86CA862C87CE01079644 -:102CF0000E94961486E0F801A7EBB1E001900D92D6 -:102D00008A95E1F70E944D150E943F15FF24F39428 -:102D1000D6C04D875E878D859E850E94091A292F12 -:102D200022952F7030E0223031050CF0BCC09F702E -:102D300009F0B6C0805E883008F4C1C0C8010E94A6 -:102D40009614E4CFC816D90608F453C0F601E81B60 -:102D5000F90BCF01883C910508F450C0F12C7C2D73 -:102D6000D98AC88A89890E94FF14E7EBF1E086E0DE -:102D7000DF011D928A95E9F70E943F15A0C07513E7 -:102D800014C0341312C0611110C08091BC01F8014D -:102D90008583C8010E94961486E0E7EBF1E0DF012D -:102DA0001D928A95E9F7FE2C8AC04D875E878D8536 -:102DB0009E856A8B0E94D5146A89882309F4BECF48 -:102DC000662309F4BBCF2091BC01822F82958F70BE -:102DD00090E002970CF48ECF8091B7019091B801EA -:102DE0009A8389831B82DD82CC822E83CE01019659 -:102DF0007FCF809590958C0D9D1DACCFF62E6623D0 -:102E000009F49CCF75132EC034132CC02091BC0143 -:102E100020FD1FC0822F82958F70D9F0D8011596A2 -:102E20002C9315978F3049F08F5F982F9295907F54 -:102E3000822F8F70892B15968C93C8010E9496144F -:102E400086E0F801A7EBB1E001900D928A95E1F7D9 -:102E500093CF86E0F801A7EBB1E001900D928A953F -:102E6000E1F72DC04D875E878D859E850E94D51424 -:102E7000811140CF8091BC0181608093BC01C80169 -:102E80000E9496141CC0662309F458CF4D875E87B4 -:102E90008D859E850E94D514882309F44FCF2ACFB3 -:102EA000811148CF0CC0243031050CF047CF9F7002 -:102EB00009F440CFF8019581907F09F03BCF8F2D29 -:102EC00062960FB6F894DEBF0FBECDBFDF91CF91F3 -:102ED0001F910F91FF90EF90DF90CF9008951F9377 -:102EE000CF93DF93CDB7DEB72C970FB6F894DEBF44 -:102EF0000FBECDBF4F83588769877A878B879C87A2 -:102F0000CE0107960E94A815882369F08F819885C5 -:102F10002A853B85232BF1F19F3F09F063C08F3F4A -:102F200009F060C037C086E0FE013796DE011196D9 -:102F300001900D928A95E1F76F817885EA85FB858E -:102F4000309741F17F3F11F46F3F21F120918601CD -:102F500030E0C9010196877099274091850150E0C2 -:102F60008417950709F447C069837A83FD83EC834E -:102F700096E0929FD001939FB00D1124A957BE4FA8 -:102F8000FE01319601900D929A95E1F780938601AA -:102F90000E941E1516E08091850190918601891787 -:102FA000C1F1189FC001112489579E4F0E94A81596 -:102FB000882379F1E09185011E9FF0011124E957E2 -:102FC000FE4F4081518162817381848195810E948D -:102FD0000E158091850190E0019687709927809366 -:102FE0008501D9CF4F81588569857A858B859C85E8 -:102FF0000E940E15CFCF0E94D1141092860110921C -:103000008501E7EBF1E086E0DF011D928A95E9F7A3 -:10301000C1CF2C960FB6F894DEBF0FBECDBFDF91A7 -:10302000CF911F910895EF92FF920F931F93CF932B -:10303000DF938C01892B09F46CC0F12CEE24E3940E -:10304000E8012196F8018491843740F4843008F037 -:1030500051C0813081F0823019F15BC0853709F4AD -:1030600044C0A8F19CE7980F903708F052C08F77C2 -:103070000E941C1241C00E5F1F4FFE01C49180E2EE -:103080008C0F883048F4C7708E2D01C0880FCA9508 -:10309000EAF70E94EF1A14C08C2F0E9454112DC021 -:1030A0000E5F1F4FFE01C49180E28C0F883058F4F0 -:1030B000C7708E2D01C0880FCA95EAF70E94F51AD5 -:1030C0000E94161B1AC08C2F0E941C1216C00E5F85 -:1030D0001F4FFE01C491CC2381F08FE99FE001973F -:1030E000F1F700C00000C150F6CF0E5F1F4FFE0188 -:1030F000F49003C00E9454118E018F2D882309F48F -:103100009FCFEFE9FFE03197F1F700C00000815059 -:10311000F5CFDF91CF911F910F91FF90EF90089520 -:1031200008956093C1017093C2018093C30190938D -:10313000C4010C94BD140F931F930091C101109111 -:10314000C2012091C3013091C401DC01CB01802B6D -:10315000912BA22BB32B8093C1019093C201A0931A -:10316000C301B093C4011F910F910C94BD140F9330 -:103170001F930091C1011091C2012091C3013091B0 -:10318000C401DC01CB0180239123A223B3238093CC -:10319000C1019093C201A093C301B093C4011F91D8 -:1031A0000F910C94BD140F931F930091C1011091C6 -:1031B000C2012091C3013091C401DC01CB01802701 -:1031C0009127A227B3278093C1019093C201A093B6 -:1031D000C301B093C4011F910F910C94BD141092C0 -:1031E000BD011092BE011092BF011092C0010C945B -:1031F000BD1441E050E060E070E004C0440F551F92 -:10320000661F771F8A95D2F74093BD015093BE0188 -:103210006093BF017093C0010C94BD1441E050E075 -:1032200060E070E004C0440F551F661F771F8A9549 -:10323000D2F78091BD019091BE01A091BF01B091E4 -:10324000C001482B592B6A2B7B2B4093BD01509317 -:10325000BE016093BF017093C0010C94BD1441E0A6 -:1032600050E060E070E004C0440F551F661F771FF8 -:103270008A95D2F740955095609570958091BD01E3 -:103280009091BE01A091BF01B091C0014823592384 -:103290006A237B234093BD015093BE016093BF011D -:1032A0007093C0010C94BD1441E050E060E070E008 -:1032B00004C0440F551F661F771F8A95D2F780916F -:1032C000BD019091BE01A091BF01B091C0014827FE -:1032D00059276A277B274093BD015093BE01609315 -:1032E000BF017093C0010C94BD140F931F93009104 -:1032F000BD011091BE012091BF013091C001DC01E0 -:10330000CB01802B912BA22BB32B8093BD019093EB -:10331000BE01A093BF01B093C0011F910F910C9407 -:10332000BD140F931F930091BD011091BE01209118 -:10333000BF013091C001DC01CB0180239123A22386 -:10334000B3238093BD019093BE01A093BF01B093BE -:10335000C0011F910F910C94BD140F931F93009106 -:10336000BD011091BE012091BF013091C001DC016F -:10337000CB0180279127A227B3278093BD0190938B -:10338000BE01A093BF01B093C0011F910F910C9497 -:10339000BD140895CF92DF92EF92FF920F931F9387 -:1033A000CF93DF938C01C090C101D090C201E09017 -:1033B000C301F090C4018091BD019091BE01A09124 -:1033C000BF01B091C001C82AD92AEA2AFB2ACFE15D -:1033D000D0E0D701C6010C2E04C0B695A7959795ED -:1033E00087950A94D2F780FF06C0B8018C2F0E94FF -:1033F0009F08019721F4219760F780E001C08C2F8E -:10340000DF91CF911F910F91FF90EF90DF90CF90C0 -:103410000895CF93DF93EC010E94CA19BE010E9468 -:103420009F08DF91CF910895CB010E94091A08955A -:103430008091C50185958595859508958091C501F3 -:103440008770089598E0899F90011124262B20937E -:10345000C5010C940E192091C5018095822380939B -:10346000C501982F977069F430E0482F552747FD24 -:1034700050952417350729F08595859585950C94E9 -:103480002F1908959091C501977081E009F480E0AB -:10349000089590910C01992321F090910D019111C3 -:1034A00009C020910E0130910F01F90132969FEF72 -:1034B00040E01FC0982F9695969596959F3050F5B1 -:1034C000E0910E01F0910F01E90FF11D877021E0ED -:1034D00030E0A90102C0440F551F8A95E2F7CA01E6 -:1034E0009181892B818308959F3F39F04F5F4E3042 -:1034F00041F051915813F8CF0DC05111F7CF942FCF -:10350000F5CF9F3F39F0F901E90FF11D97FDFA95CD -:1035100082830895089590910C01992321F0909150 -:103520000D01911109C020910E0130910F01F90197 -:103530003296205F3F4F1FC0982F9695969596958F -:103540009F30F0F4E0910E01F0910F01E90FF11DB1 -:10355000877021E030E0A90102C0440F551F8A9511 -:10356000E2F7CA018095918189238183089531967C -:10357000E217F30729F090819813F9CF1082F7CF63 -:10358000089581E090E0E0910E01F0910F01E80FC5 -:10359000F91F1082019680319105A9F70895909145 -:1035A000D901892B8093D901089580959091D901F3 -:1035B00089238093D90108951092D901089590919B -:1035C000D801892B8093D801089580959091D801D6 -:1035D00089238093D80108951092D801089590917D -:1035E000D701892B8093D701089580959091D701B9 -:1035F00089238093D70108951092D701089580936D -:10360000C60108951092C601089580910E0190910F -:103610000F01FC0131969C01205F3F4F80E09191AA -:1036200091118F5FE217F307D1F70895E0910E0132 -:10363000F0910F018091D9018083E0910E01F0910A -:103640000F0190818091D801892B8083E0910E0138 -:10365000F0910F0190818091D701892B8083809117 -:10366000C601882361F0E0910E01F0910F01908175 -:10367000892B80830E94051B81111092C6018091C5 -:103680000E0190910F010C94441020E0009739F046 -:10369000AC0141505109842395232F5FF7CF822F2E -:1036A0000895CF92DF92EF92FF926C01EE24FF24F7 -:1036B000C114D104E104F10421F0C701B60120E1F5 -:1036C00001C020E0C72ED82EE92EFF24C114D1045A -:1036D000E104F10419F0285FC701B6016B017C0118 -:1036E00054E0F694E794D794C7945A95D1F7C1144F -:1036F000D104E104F10419F02C5FC701B6016B019C -:103700007C0142E0F694E794D794C7944A95D1F7A8 -:10371000C114D104E104F10419F02E5FC701B60110 -:10372000DC01CB01B695A79597958795892B8A2BB8 -:103730008B2B09F02F5F822FFF90EF90DF90CF90BF -:1037400008958091EF01843021F11092DB0120E493 -:1037500088E190E00FB6F894A895809360000FBEC2 -:103760002093600080E00E943A0983B7817F8460E3 -:1037700083BF83B7816083BF7894889583B78E7F3A -:1037800083BF88E10FB6F8948093600010926000C8 -:103790000FBE0895089508950E94CA1B0E949004C8 -:1037A0000E94CB1B0E94850591E0811101C090E031 -:1037B000892F08950E94D1140E9438100C943A0960 -:1037C0001F920F920FB60F9211248F939F93AF9376 -:1037D000BF938091DB01811113C08091DC01909136 -:1037E000DD01A091DE01B091DF014196A11DB11D67 -:1037F0008093DC019093DD01A093DE01B093DF01A3 -:10380000BF91AF919F918F910F900FBE0F901F901E -:10381000189582E084BD93E095BD9AEF97BD8093A3 -:103820006E0008952FB7F8948091DC019091DD012E -:10383000A091DE01B091DF012FBF0895CF92DF92FA -:10384000EF92FF920F931F932FB7F8944091DC01F2 -:103850005091DD016091DE017091DF012FBF6A019F -:103860007B01EE24FF248C0120E030E0C016D1065D -:10387000E206F30610F4415051099A01281B390B56 -:10388000C9011F910F91FF90EF90DF90CF900895A5 -:103890001F920F920FB60F9211248F939F93AF93A5 -:1038A000BF938091DC019091DD01A091DE01B09188 -:1038B000DF010196A11DB11D8093DC019093DD0114 -:1038C000A093DE01B093DF01BF91AF919F918F91E3 -:1038D0000F900FBE0F901F9018950E94350DF89411 -:1038E0002FEF87EA91E6215080409040E1F700C039 -:1038F000000087E090EBDC018093F9019093FA01DE -:10390000A093FB01B093FC019CE088E10FB6F89412 -:10391000A895809360000FBE90936000FFCFEF9258 -:10392000FF920F931F93CF93DF93D82FCDE08C2F6F -:103930000E947E0505E010E0E82EF12CC701002E64 -:1039400002C0959587950A94E2F780FF09C0602F21 -:103950007C2F80E00E944B06D81302C081E006C095 -:103960000150110958F7C15010F780E0DF91CF9155 -:103970001F910F91FF90EF900895CF93C82F8CE285 -:103980000E948F1C882321F08C2FCF910C948F1CC8 -:1039900080E0CF910895CF930E94121E811102C042 -:1039A0000E94F81DC5E6C15049F00E9490048FE3C3 -:1039B0009CE90197F1F700C00000F5CF89E20E9471 -:1039C000BD1C811113C18AE20E94BD1C81110E949D -:1039D000F81D85E00E94BD1C81110E946D1C0E9493 -:1039E0001D1E8093DA0187E00E94BD1C8823A9F187 -:1039F0008BE10E94BD1C882351F08091DA0181FB8C -:103A0000222720F991E0922790FB81F90EC08EE0E9 -:103A10000E94BD1C882361F08091DA0182FB22277D -:103A200020F991E0922790FB82F98093DA0115C08A -:103A300080E10E94BD1C9091DA01882341F093FB44 -:103A4000222720F981E0822780FB93F904C0892F87 -:103A5000809580FB90F99093DA018091DA010E94C1 -:103A6000211E0E942F1E8093F80180EE0E94BD1C33 -:103A7000882341F08091F801982F909590FB80F970 -:103A80008093F80189E30E94BD1C882359F080913E -:103A9000F80181FB222720F991E0922790FB81F920 -:103AA0008093F80182EE0E94BD1C882359F080911A -:103AB000F80182FB222720F991E0922790FB82F9FE -:103AC0008093F80186EE0E94BD1C882359F08091F6 -:103AD000F80183FB222720F991E0922790FB83F9DC -:103AE0008093F80183EE0E94BD1C882359F08091D9 -:103AF000F80184FB222720F991E0922790FB84F9BA -:103B00008093F80185E30E94BD1C882359F08091C1 -:103B1000F80185FB222720F991E0922790FB85F997 -:103B20008093F80181E30E94BD1C882359F08091A5 -:103B3000F80186FB222720F991E0922790FB86F975 -:103B40008093F80181E10E94BD1C882359F0809187 -:103B5000F80187FB222720F991E0922790FB87F953 -:103B60008093F8018091F8010E94331E8091F80142 -:103B700087FB882780F980930D0187E20E94BD1C96 -:103B8000C82F8EE10E94BD1C8111C2608FE10E948E -:103B9000BD1C8111C46080E20E94BD1C8111C860FF -:103BA00081E20E94BD1C8111C06182E20E94BD1CA5 -:103BB0008111C06283E20E94BD1C8111C06484E255 -:103BC0000E94BD1C882311F0C06802C0CC2329F0DC -:103BD0008C2F0E942A1E6C2F03C00E94261E682F65 -:103BE00070E080E090E0CF910C949118CF9108950F -:103BF0006DEE7EEF80E090E00E94F82360E082E0CE -:103C000090E00E94E62360E083E090E00E94E623DB -:103C100060E084E090E00E94E62360E085E090E0D0 -:103C20000C94E62380E090E00E94E02321E08D3EAA -:103C30009E4F09F020E0822F089582E090E00C94DE -:103C4000D823682F82E090E00C94E62383E090E094 -:103C50000C94D823682F83E090E00C94E62384E052 -:103C600090E00C94D823682F84E090E00C94E62335 -:103C70008091E20180FF0BC06091130185E0689F95 -:103C8000B001112475956795759567952BC081FFD7 -:103C900009C06091130185E0689FB00111247595FA -:103CA000679520C082FF07C06091130185E0689F7F -:103CB000B001112417C09091E3019923D1F06091D4 -:103CC0001201961788F72091130185E0289F900133 -:103CD0001124929FA001939F500D112470E0CA01FE -:103CE0000E94AA236038710540F46115710539F00E -:103CF00002C065E070E0862F08958FE7089581E0A7 -:103D000008958091E20180FF08C06091110170E088 -:103D1000759567957595679521C081FF06C060917F -:103D2000110170E07595679519C082FF04C060911C -:103D3000110170E010C09091E3019923C1F06091EE -:103D400010019617A0F780911101899FC0011124DD -:103D500070E00E94AA236038710528F4611571058E -:103D600021F0862F08958FE7089581E0089561E09E -:103D700070E0F4CF803F21F40E94381E819504C08A -:103D8000813F29F40E94381E8093E6010895823F06 -:103D900021F40E94381E819504C0833F29F40E94BB -:103DA000381E8093E5010895893F19F40E94811E11 -:103DB00005C08A3F31F40E94811E81958093E701FE -:103DC00008958B3F21F40E94811E819504C08C3F91 -:103DD00029F40E94811E8093E8010895843F21F414 -:103DE0008091E401816017C0853F21F48091E40156 -:103DF000826011C0863F21F48091E40184600BC091 -:103E0000873F21F48091E401886005C0883F31F448 -:103E10008091E40180618093E40108958D3F21F455 -:103E20008091E20181600BC08E3F21F48091E2011C -:103E3000826005C08F3F29F48091E2018460809305 -:103E4000E2010895803F39F48091E60187FF6CC05C -:103E50001092E60169C0813F29F48091E6011816AD -:103E6000BCF362C09091E501823F29F497FF5CC0EA -:103E70001092E50159C0833F19F41916CCF354C0D0 -:103E8000893F41F48091E70118160CF04DC0109263 -:103E9000E7014AC08A3F29F48091E70187FF44C0C7 -:103EA000F6CF8B3F39F48091E80187FF3DC0109237 -:103EB000E8013AC08C3F29F48091E8011816BCF360 -:103EC00033C0843F21F48091E4018E7F17C0853F89 -:103ED00021F48091E4018D7F11C0863F21F480910F -:103EE000E4018B7F0BC0873F21F48091E401877F41 -:103EF00005C0883F31F48091E4018F7E8093E40116 -:103F000013C08D3F21F48091E2018E7F0BC08E3F64 -:103F100021F48091E2018D7F05C08F3F29F48091CB -:103F2000E2018B7F8093E2018091E50181110EC057 -:103F30008091E60181110AC08091E701811106C0DC -:103F40008091E801811102C01092E301089584EE8E -:103F500091E00E944F100E94121C9093E101809307 -:103F6000E00108951F93CF93DF938091E00190913A -:103F7000E1010E941E1CAC019091E301992321F004 -:103F80002091140130E006C0209115018AE0289F9D -:103F9000900111244217530708F486C08091E5016F -:103FA000C091E601D091E7011091E801811107C0AD -:103FB000C11176C0D11174C0111172C075C09F3F7C -:103FC00019F09F5F9093E301181624F40E94381EA5 -:103FD0008093E5018091E50187FF05C00E94381EAE -:103FE00081958093E5011C1624F40E94381E80936D -:103FF000E6018091E60187FF05C00E94381E819589 -:104000008093E6016091E501662339F1C091E601F4 -:10401000CC2319F1772767FD7095872F972F0E9482 -:10402000BB2223E333E343E35FE30E941F230E94A9 -:1040300088226093E5016C2F772767FD7095872FA5 -:10404000972F0E94BB2223E333E343E35FE30E9405 -:104050001F230E9488226093E6011D1624F40E940B -:10406000811E8093E7018091E70187FF05C00E94D0 -:10407000811E81958093E701111624F40E94811E10 -:104080008093E8018091E80187FF05C00E94811EAE -:1040900081958093E801DF91CF911F910C94A71F28 -:1040A0009F3F09F08ECF96CFDF91CF911F9108955A -:1040B000E4EEF1E085E0DF011D928A95E9F71092C8 -:1040C000E3011092E2010895833081F128F48130F8 -:1040D00059F08230D1F00895853009F449C0B8F123 -:1040E000863009F456C0089580911501262F30E0DE -:1040F000280F311D2F3F310524F4680F60931501FF -:1041000008958FEF80931501089580911401262F53 -:1041100030E0280F311D2F3F310524F4680F6093E4 -:10412000140108958FEF8093140108958091130175 -:10413000262F30E0280F311D2F3F310524F4680F62 -:104140006093130108958FEF809313010895809178 -:104150001201262F30E0280F311D2F3F310524F4A6 -:10416000680F6093120108958FEF809312010895F4 -:1041700080911101262F30E0280F311D2F3F31058E -:1041800024F4680F6093110108958FEF809311015B -:10419000089580911001262F30E0280F311D2F3F08 -:1041A000310524F4680F6093100108958FEF809318 -:1041B00010010895833011F128F4813049F08230E4 -:1041C00091F00895853081F120F18630C1F1089594 -:1041D00080911501681720F4861B809315010895BE -:1041E00010921501089580911401681720F4861B20 -:1041F0008093140108951092140108958091130181 -:10420000681720F4861B8093130108951092130100 -:10421000089580911201681720F4861B8093120183 -:10422000089510921201089580911101681720F4E9 -:10423000861B8093110108951092110108958091B9 -:104240001001681720F4861B8093100108951092C6 -:10425000100108950F931F938B3109F475C0A0F5D9 -:104260008E3009F484C0C0F4873009F45BC068F470 -:10427000863009F0AAC08091DA01817F8E7F809319 -:10428000DA0181E08093EA01A1C0883009F496C088 -:104290008B3009F493C099C0813109F472C068F47D -:1042A000803109F092C08091DA0183FB222720F946 -:1042B00091E0922790FB83F950C0863109F47EC0CB -:1042C000893109F47BC081C0853309F479C068F471 -:1042D000873209F475C028F48E3108F476C08D5108 -:1042E0005AC0893209F46CC070C0833438F48A3300 -:1042F00008F050C0883309F461C067C0833409F402 -:104300005FC0883409F061C00E94D1140FEF13ED33 -:1043100020E3015010402040E1F700C000000E945F -:104320006D1C4CC09091DA01892F8095817080FBC3 -:1043300090F929F0966098609093DA0147C0997FD0 -:10434000977F9093DA013AC08091DA0181FB2227AE -:1043500020F991E0922790FB81F98093DA0199236B -:1043600069F18091DA0181608093DA0127C0809140 -:10437000DA0182FB222720F991E0922790FB82F953 -:10438000ECCF0E94D11490910D0181E08927809398 -:104390000D0114C0895341E050E060E070E08A01F3 -:1043A0009B0104C0000F111F221F331F8A95D2F7F3 -:1043B000C901B8010E9491180E94D11481E006C081 -:1043C00061E070E080E090E0F5CF80E01F910F9118 -:1043D000089580E0089580E00895CF93C82F8091DC -:1043E000EA01813079F018F08230E9F187C0E0917C -:1043F0000E01F0910F018081813169F0823209F064 -:104400007FC009C0E0910E01F0910F0180818131E0 -:1044100011F0823261F48C2F0E94E921811104C0D5 -:104420008C2F0E942A211DC081E090E01AC08C2FA1 -:104430000E94EB21811114C0C43179F048F4CB30D3 -:1044400079F0C03109F060C082E08093EA0108C0D1 -:10445000C93219F0C83321F057C01092EA0154C094 -:1044600081E0817053C0C93289F118F5C43171F10E -:10447000A8F4C73009F046C08AE08093150194E1A2 -:104480009093140193E0909313018093120188E0BC -:104490008093110188E28093100134C0CE51C63060 -:1044A00088F5EC2FF0E0E65DFE4F80818093E90116 -:1044B00029C0CE34E9F020F4CB3421F56AE013C0F2 -:1044C000C13579F0C235F1F461E00DC08091E901A8 -:1044D000882319F01092E90115C081E08093EA0168 -:1044E00015C061E006C08091E9010E9464200AC005 -:1044F0006AE08091E9010E94DA2004C01092EA018A -:1045000080E004C081E002C080E0ABCFCF9108958D -:1045100004D06894B1118DC0089570D088F09F5771 -:1045200090F0B92F9927B751A0F0D1F0660F771FFF -:10453000881F991F1AF0BA95C9F712C0B13081F0DF -:1045400077D0B1E0089574C0672F782F8827B85FBF -:1045500039F0B93FCCF3869577956795B395D9F740 -:104560003EF490958095709561957F4F8F4F9F4F4A -:104570000895E89409C097FB3EF490958095709556 -:1045800061957F4F8F4F9F4F9923A9F0F92F96E99F -:10459000BB279395F695879577956795B795F11114 -:1045A000F8CFFAF4BB0F11F460FF1BC06F5F7F4FB1 -:1045B0008F4F9F4F16C0882311F096E911C07723C3 -:1045C00021F09EE8872F762F05C0662371F096E8CC -:1045D000862F70E060E02AF09A95660F771F881F9B -:1045E000DAF7880F9695879597F9089557FD9058B3 -:1045F000440F551F59F05F3F71F04795880F97FBA7 -:10460000991F61F09F3F79F0879508951216130660 -:104610001406551FF2CF4695F1DF08C0161617068F -:104620001806991FF1CF86957105610508940895C4 -:10463000E894BB2766277727CB0197F908950BD01D -:1046400078C069D028F06ED018F0952309F05AC0D0 -:104650005FC01124EECFCADFA0F3959FD1F3950F71 -:1046600050E0551F629FF001729FBB27F00DB11DF6 -:10467000639FAA27F00DB11DAA1F649F6627B00D86 -:10468000A11D661F829F2227B00DA11D621F739F6F -:10469000B00DA11D621F839FA00D611D221F749F7D -:1046A0003327A00D611D231F849F600D211D822FC4 -:1046B000762F6A2F11249F5750408AF0E1F088230B -:1046C0004AF0EE0FFF1FBB1F661F771F881F915018 -:1046D0005040A9F79E3F510570F014C0AACF5F3F2C -:1046E000ECF3983EDCF3869577956795B795F7954B -:1046F000E7959F5FC1F7FE2B880F911D96958795D3 -:1047000097F9089597F99F6780E870E060E0089551 -:104710009FEF80EC089500240A94161617061806D9 -:104720000906089500240A941216130614060506B5 -:104730000895092E0394000C11F4882352F0BB0F46 -:1047400040F4BF2B11F460FF04C06F5F7F4F8F4FA9 -:104750009F4F089597FB072E16F4009407D077FD1E -:1047600009D00E94C42307FC05D03EF490958195A2 -:104770009F4F0895709561957F4F0895EE0FFF1F2D -:104780000590F491E02D0994AA1BBB1B51E107C0D1 -:10479000AA1FBB1FA617B70710F0A61BB70B881FD1 -:1047A000991F5A95A9F780959095BC01CD01089560 -:1047B000F999FECF92BD81BDF89A992780B50895E9 -:1047C000A8E1B0E042E050E00C940024262FF999D3 -:1047D000FECF92BD81BDF89A019700B4021639F060 -:1047E0001FBA20BD0FB6F894FA9AF99A0FBE089531 -:1047F0000196272F0E94E7230C94E623DC01CB01CE -:10480000FC01F999FECF06C0F2BDE1BDF89A3196E0 -:1048100000B40D9241505040B8F70895F894FFCF7E -:1048200020023C09CA09A70973093F090101C70110 -:1048300028080A03140A3F4D36392605D904A30473 -:104840006A04FD0316042F0448040102030405064C -:04485000070809004C -:00000001FF -- cgit v1.2.3-24-g4f1b From 07a631bd5a116170ebab5688eae9965d8a2231e2 Mon Sep 17 00:00:00 2001 From: Nathan Sharfi Date: Sun, 31 Jul 2016 14:21:08 -0700 Subject: Thumb ⌫ into ⇥, numpad & into :, yank home/end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also: add (back?) in the light-shine disabler --- keyboards/ergodox/keymaps/zweihander-osx/keymap.c | 26 +- .../ergodox/keymaps/zweihander-osx/makefile.mk | 2 + .../keymaps/zweihander-osx/zweihander-osx.hex | 1151 ++++++++++++++++++++ 3 files changed, 1166 insertions(+), 13 deletions(-) create mode 100644 keyboards/ergodox/keymaps/zweihander-osx/makefile.mk create mode 100644 keyboards/ergodox/keymaps/zweihander-osx/zweihander-osx.hex diff --git a/keyboards/ergodox/keymaps/zweihander-osx/keymap.c b/keyboards/ergodox/keymaps/zweihander-osx/keymap.c index 40b1d7d6d..d6d66fd55 100644 --- a/keyboards/ergodox/keymaps/zweihander-osx/keymap.c +++ b/keyboards/ergodox/keymaps/zweihander-osx/keymap.c @@ -11,7 +11,7 @@ #define BBED 2 // BBEdit #define TMNL 3 // Terminal #define SAFA 4 // Safari -#define ALFRED_LEAD_TIME 100 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input +#define ALFRED_LEAD_TIME 250 // time, in milliseconds, to let Alfred come to the fore and accept keyboard input const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer @@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | `~ | '" | | ⎋ | ⌫ | * ,------|------|------| |------+--------+------. * | | | PgUp | | PgDn | | | - * | | ⌫ |------| |------| ⇥ |Enter | + * | | ⇥ |------| |------| ⇥ |Enter | * | | | L⌥ | | L⌃ | | | * `--------------------' `----------------------' */ @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI,KC_LEFT,KC_RGHT, KC_GRV, KC_QUOT, KC_PGUP, - KC_SPC,KC_BSPC,KC_LALT, + KC_SPC,KC_TAB ,KC_LALT, // right hand TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, @@ -66,25 +66,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | < | > | ( | ) | ' |------| |------| - | 4 | 5 | 6 | + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | & | 1 | 2 | 3 | = | | + * | | | | | | = | | | | : | 1 | 2 | 3 | = | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | 0 | . | ↠| → | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | Home | | | + * | | | | | | | | * | | |------| |------| | | - * | | | | | End | | | + * | | | | | | | | * `--------------------' `--------------------' */ // SYMBOLS [SYMB] = KEYMAP( // left hand KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQUO,KC_TRNS, + KC_TRNS,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_DQT ,KC_TRNS, KC_TRNS,KC_LABK,KC_RABK,KC_LPRN,KC_RPRN,KC_QUOT, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_EQL ,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, @@ -93,11 +93,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, KC_MINS, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, + KC_TRNS, KC_COLN, KC_1, KC_2, KC_3, KC_EQL, KC_TRNS, KC_0, KC_DOT, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HOME, - KC_END , KC_TRNS, KC_TRNS + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS ), /* Keymap 2: Media keys * @@ -131,13 +131,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, // right hand - LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR, + LGUI(KC_Q), LGUI(KC_W), LGUI(LSFT(KC_GRV)), LGUI(KC_GRV), KC_TRNS, KC_TRNS, KC_PWR , KC_TRNS, LGUI(KC_RBRC), LGUI(LALT(KC_UP)), KC_UP , LGUI(LALT(KC_DOWN)), KC_TRNS, KC_TRNS, LGUI(KC_LBRC), KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_MPLY, KC_TRNS, LSFT(KC_SPC), KC_SPC , KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, + KC_END , LGUI(KC_X), LGUI(KC_C), LGUI(KC_V) ), }; diff --git a/keyboards/ergodox/keymaps/zweihander-osx/makefile.mk b/keyboards/ergodox/keymaps/zweihander-osx/makefile.mk new file mode 100644 index 000000000..6e3d088a4 --- /dev/null +++ b/keyboards/ergodox/keymaps/zweihander-osx/makefile.mk @@ -0,0 +1,2 @@ +# Don’t do a tricolor wave when the computer is shut down in Windows +SLEEP_LED_ENABLE = no diff --git a/keyboards/ergodox/keymaps/zweihander-osx/zweihander-osx.hex b/keyboards/ergodox/keymaps/zweihander-osx/zweihander-osx.hex new file mode 100644 index 000000000..832504b02 --- /dev/null +++ b/keyboards/ergodox/keymaps/zweihander-osx/zweihander-osx.hex @@ -0,0 +1,1151 @@ +:100000000C94D3020C941A030C941A030C941A0344 +:100010000C941A030C941A030C941A030C941A03EC +:100020000C941A030C941A030C94B71F0C94892097 +:100030000C941A030C941A030C941A030C941A03CC +:100040000C941A030C94FC1A0C941A030C941A03C3 +:100050000C941A030C9414160C941A030C941A039F +:100060000C941A030C941A030C941A030C941A039C +:100070000C941A030C941A030C941A030C941A038C +:100080000C941A030C941A030C941A030C941A037C +:100090000C941A030C941A030C941A030C941A036C +:1000A0000C941A030C941A030C941A03730C730C1B +:1000B000A20CA20CD80CF80C290E290E030D290E47 +:1000C000B30DB30D1A0E290E290E230EC00DC00D4F +:1000D000C00DC00DC00DC00DC00DC00DC00DC00DB8 +:1000E000C00DC00DC00DC00DC00DC00DD20DDF0D77 +:1000F000E60DED0DF70DF620182106221821062237 +:100100005D2180210622D521E821750A01E2012C1A +:10011000022C02E274FA011602160104020401091B +:1001200002090104020401150215010C020C012848 +:10013000022800750A01E2012C022C02E274FA0185 +:10014000170217010802080115021501100210011B +:100150000C020C0111021101040204010F020F0133 +:1001600028022800750A01E2012C022C02E274FA2E +:100170000105020501050205010802080107020741 +:10018000010C020C011702170128022800750A0150 +:10019000E30116021602E301E3012B022B02E30145 +:1001A000E30115021502E300750A01E301160216C8 +:1001B00002E301E3012B022B02E3000000F0A12E79 +:1001C000004C002A00E100E00000001E00140004C2 +:1001D000001D00E200E2001F001A0016001B00E3F1 +:1001E000002B00200008000700060050002C002112 +:1001F000001500090019004F004B00220017000AEB +:1002000000050000003500015301510000E300002B +:10021000003400015301510000E3000000290023D5 +:10022000001C000B00110000002A00240018000D23 +:1002300000100052004E0025000C000E0036005148 +:10024000002800260012000F0037002F002B002787 +:10025000001300334238613000E0002D00310034DB +:1002600068E5002C00000001000100010001000110 +:100270000000003A002F0036020100010001003B9F +:1002800000300037020100010001003C002F02266F +:10029000020100010001003D0030022702010001BF +:1002A0000001003E00340234002E00000001000175 +:1002B0000001000000010000000100010001000039 +:1002C000000100000001003F0038002D0033020053 +:1002D0000001004000240021001E00270001004111 +:1002E00000250022001F00370001004200260023E5 +:1002F00000200050000100430025022E022E004F76 +:10030000000100440045000100010001000000015F +:10031000000100010001000100000069000100016E +:10032000000100010001006A000100043001000129 +:1003300000010001004B004E00010001000100011E +:100340000001300100010001004A000100033001FA +:100350000002300000010001000100000001000067 +:100360000001001408010000000100000001001A53 +:100370000830082F082C0200000100350A520C50EA +:10038000002C00A9004D00350852005100AC00AA15 +:100390000019080100510C4F00AB00A8000608012D +:1003A0000001000100010001001B08A5000100AED2 +:1003B000000100010000000000000000000000003B +:1003C0000000010204060A0F17202C3A4A5D7187CB +:1003D0009DB3C7DAE9F5FCFFFCF5E9DAC7B39D8701 +:1003E000715D4A3A2C20170F0A0604020100000032 +:1003F0000000000000000016034500720067006F57 +:100400000044006F007800200045005A00000016EC +:10041000034500720067006F0044006F0078002001 +:100420000045005A0000000403090409026D00049D +:100430000100A0FA090400000103010100092111D3 +:100440000100012240000705810308000A09040198 +:10045000000103010200092111010001224D0007E2 +:1004600005820308000A09040200010300000009D4 +:1004700021110100012236000705830308000A0943 +:1004800004030001030000000921110100012239C9 +:10049000000705840310000112011001000000088C +:1004A000EDFE071301000102000105010906A1018B +:1004B000050719E029E71500250195087501810256 +:1004C0000508190129059505750191029501750326 +:1004D0009101050719002977150025019578750107 +:1004E0008102C005010980A101850216810026B79D +:1004F000001A81002AB700751095018100C0050C13 +:100500000901A1018503160100269C021A01002A97 +:100510009C02751095018100C005010902A1010925 +:1005200001A1000509190129051500250195057589 +:100530000181029501750381010501093009311519 +:1005400081257F95027508810609381581257F95DB +:100550000175088106050C0A38021581257F950171 +:1005600075088106C0C005010906A101050719E04B +:1005700029E7150025019508750181029501750887 +:10058000810105081901290595057501910295015B +:10059000750391010507190029FF150026FF009535 +:1005A0000675088100C011241FBECFEFDAE0DEBF60 +:1005B000CDBF04B603FE27C08091010290910202D4 +:1005C000A0910302B09104028730904BA740B04B3A +:1005D000D1F41092010210920202109203021092C2 +:1005E000040214BE84B7877F84BF0FB6F894A89521 +:1005F00080916000886180936000109260000FBE5F +:10060000E0E0FFE3099511E0A0E0B1E0E0EAF7E403 +:1006100002C005900D92A433B107D9F712E0A4E30C +:10062000B1E001C01D92A130B107E1F70E94FC1CAE +:100630000C94CE230C9400001092B9008AE08093B1 +:10064000B800089594EA9093BC009091BC0097FF85 +:10065000FCCF9091B900987F983021F0903111F043 +:1006600081E008958093BB0084E88093BC00809172 +:10067000BC0087FFFCCF8091B900887F883111F0E2 +:10068000803471F780E0089584E98093BC00809104 +:10069000BC0084FDFCCF08958093BB0084E8809368 +:1006A000BC008091BC0087FFFCCF9091B900987F7F +:1006B00081E0983209F480E0089584E88093BC00DA +:1006C0008091BC0087FFFCCF8091BB00089580B370 +:1006D0008C7080BB81B3836F81BB089580910101D1 +:1006E000811115C080E40E942203809301018111D1 +:1006F0000CC082E10E944C0380930101811105C06E +:100700008FEF0E944C03809301010E94440384B147 +:10071000807F84B985B1807F85B98AB1837F8AB9AA +:100720008BB1837F8BB93E98469808950C94E4046E +:100730000E942509809301010E946E030E946703B5 +:10074000A5E3B1E0E3E4F1E08EE08E0F11921D929B +:100750008E13FCCF0C940F090E9425098093010190 +:100760000E946E030E946703A5E3B1E0E3E4F1E0B9 +:100770008EE08E0F11921D928E13FCCF0895BF92C2 +:10078000CF92DF92EF92FF920F931F93CF93DF935D +:1007900080910101882379F0809134018F5F8093EB +:1007A0003401811108C00E94250980930101811143 +:1007B00002C00E94B70805E311E0C0E0D0E0EE24DB +:1007C000E394F12CDD24D39495E0C92EC730D105F4 +:1007D00000F58091010181113CC080E40E94220358 +:1007E00080930101811112C082E10E944C03809329 +:1007F000010181110BC0C7010C2E01C0880F0A94A2 +:10080000EAF780950E944C03809301010E94440303 +:1008100020C0CA30A1F028F4C83059F0C93061F0C6 +:1008200005C0CC3089F070F0CD3089F0209A28983E +:1008300010C0219A29980DC0229A2A980AC0239A9A +:100840002B9807C0529A01C0539A5B9802C03E9AF7 +:10085000469880EA8A95F1F7C730D10518F580915E +:100860000101811144C080E40E94220380930101B0 +:10087000882311F0B12C12C083E10E944C038093B5 +:1008800001018111F7CF81E40E94220380930101CD +:100890008111F0CF0E945D03B82EB0940E944403F2 +:1008A0008B2D26C08FB181708D25799902C092E081 +:1008B00001C090E0892B7C9902C024E001C020E0B7 +:1008C000822B7D9902C028E001C020E0822B7E9916 +:1008D00002C090E101C090E0892B9FB19095991FD3 +:1008E0009927991F9295990F907E892B01C080E0DE +:1008F000F8019081981719F08083C09200010E943E +:100900006E0321960F5F1F4FCE30D10509F05ECFE9 +:10091000809100018823A1F08150809300018823F9 +:1009200029F0F5E0FA95F1F700000AC0A3E4B1E080 +:10093000E5E3F1E0CF01825F91919D938E13FCCFAF +:100940000E94410681E0DF91CF911F910F91FF90AE +:10095000EF90DF90CF90BF900895E82FF0E0ED5B2F +:10096000FE4F808108950895FC016230B9F028F4AB +:10097000662341F0613061F023C06330A9F0643038 +:10098000C9F01EC082818823D9F088EA91E00895D9 +:1009900082818823A9F08DE891E0089582818823DF +:1009A00079F084E691E008958281882349F083E319 +:1009B00091E008958281882319F08AE091E00895FA +:1009C00080E090E0089508956091B0017091B101C8 +:1009D0008091B2019091B3010E94081556985E98DB +:1009E00025982D9826982E9827982F98813019F0C1 +:1009F000823021F00895259A2D9A0895269A2E9AEC +:100A0000089581E0089581E008950C9403050E9403 +:100A1000940E2FEF84E39CE0215080409040E1F75A +:100A200000C000000C9439160F931F93CF93DF93EF +:100A30008C01FC01C081D181CE010E948D13BE01C9 +:100A40000E94D807EC01B8010E940505882309F42B +:100A500012C1B801CE010E946808882309F40BC1B5 +:100A6000B801CE010E948109882309F404C1C43170 +:100A7000F0E7DF0708F0CDC0C23080E7D80708F400 +:100A8000A3C0F8018281882309F4AAC00E947215CC +:100A9000811102C00E9458150E94851590E0909324 +:100AA000F3018093F201C230F0E7DF0721F4809177 +:100AB000F201816082C0C33080E7D80721F48091C1 +:100AC000F20182607AC0C430E0E7DE0721F4809151 +:100AD000F201846072C0C530F0E7DF0719F480913D +:100AE000F20127C0C63080E7D80721F48091F201D7 +:100AF000806163C0C730E0E7DE0721F48091F20136 +:100B000080625BC0C830F0E7DF0721F48091F2011A +:100B1000806453C0C93080E7D80721F48091F20186 +:100B200080684BC0CA30E0E7DE0729F48091F2010B +:100B30008460886042C0CB30F0E7DF0721F4809109 +:100B4000F2018E7F3AC0CC3080E7D80721F4809143 +:100B5000F2018D7F32C0CD30E0E7DE0721F48091D5 +:100B6000F2018B7F2AC0CE30F0E7DF0719F48091C5 +:100B7000F20122C0CF3080E7D80721F48091F20142 +:100B80008F7E1BC0C031E0E7DE0721F48091F201C7 +:100B90008F7D13C0C131F0E7DF0721F48091F201AE +:100BA0008F7B0BC0C231D04721F48091F2018F7747 +:100BB00004C08091F2018B7F877F8093F201809146 +:100BC000F2010E94891557C0C115E0E7DE0779F0F0 +:100BD000C130D047A1F081E0809351018093520150 +:100BE000C801DF91CF911F910F910C940105F8017D +:100BF0008281882309F43FC00E9407053CC0F801A8 +:100C000082818823C1F18091CD0181608093CD01E3 +:100C100032C0CB3380E7D807A1F4F8018281882362 +:100C200021F01092510182E016C080915101811192 +:100C300006C086E20E940C0B86E20E94DF0B82E077 +:100C400018C0CC33D04739F6F8018281882331F0BF +:100C50001092520180E20E942E0C0DC08091520130 +:100C6000811106C087E20E940C0B87E20E94DF0B15 +:100C700080E20E94350C80E0DF91CF911F910F91AF +:100C800008950C94960308950C9443060C9444061E +:100C900026E0729FF001112444E5849FE00DF11DD0 +:100CA0001124E60FF11DEE0FFF1FE154FE4F859159 +:100CB00094910E94EA07811560E49607B0F58115CA +:100CC00070E3970708F0E6C0803E9105D8F4803CB9 +:100CD000910508F06CC0883A910578F4853A910541 +:100CE00008F06BC08130910509F460C108F417C1A8 +:100CF0008430910508F05AC112C18D3B910508F46A +:100D000067C00DC18F3F910509F048F4803F910500 +:100D100008F0B5C0883E910508F448C100C18115AE +:100D200020E2920708F0ADC00895811543E59407CD +:100D300090F4811562E5960708F0D0C0811571E541 +:100D4000970708F0C6C0811520E5920708F0A5C0F6 +:100D50009F70906A0895811545E59407D8F4811530 +:100D600064E5960708F0D0C0482F4695469570E296 +:100D7000479FA00111248370992721E030E0B90139 +:100D800002C0660F771F8A95E2F7CB01842B952B63 +:100D90009A680895811576E5970708F4BAC09C0112 +:100DA00030562115304108F0BAC09F70B6C0FC0122 +:100DB000EE0FFF1FE55CFF4F6AC0853A910509F40D +:100DC000B1C0863A910509F0B0C082E890E4089578 +:100DD000883A910509F4ACC0893A910509F4ABC091 +:100DE0008A3A910509F4AAC08B3A910509F4A9C081 +:100DF0008C3A910509F4A8C08B3B910509F4A7C072 +:100E00008C3B910509F4A6C08D3A910509F4A5C063 +:100E1000803B910509F4A4C08E3A910509F4A3C062 +:100E20008F3A910509F4A2C0813B910509F4A1C054 +:100E3000823B910509F4A0C0833B910509F49FC052 +:100E4000843B910509F49EC0853B910509F49DC042 +:100E5000863B910509F49CC0873B910509F49BC032 +:100E6000883B910509F49AC0893B910509F499C022 +:100E70008A3B910509F498C080E094E40895906558 +:100E80000895FC01FF70EE0FFF1FE554FE4F8591A2 +:100E9000949108959927906C0895482F437021E00C +:100EA00030E002C0220F331F4A95E2F73C68AC01E4 +:100EB00064E0569547956A95E1F74370342B8F703F +:100EC0008695869560E2869FC0011124822B932B24 +:100ED0000895982F8827816F906A0895482F469526 +:100EE000469570E2479FA00111248370992721E065 +:100EF00030E0B90102C0660F771F8A95E2F7CB0197 +:100F0000842B952B9C680895982F8827846F906A6E +:100F100008958F719927982F88279062089580E00F +:100F200090E0089581E890E4089583E890E40895BE +:100F300082EE94E4089589EE94E408958AEE94E4B0 +:100F4000089585EB94E4089586EB94E4089583EB8B +:100F500094E4089584EB94E4089587EB94E4089571 +:100F60008CEC94E408958DEC94E4089583E895E482 +:100F700008958AE895E4089582E995E4089584E95E +:100F800095E4089581E296E4089583E296E4089555 +:100F900084E296E4089585E296E4089586E296E474 +:100FA000089587E296E408958AE296E40895089504 +:100FB00096E0799FF001112494E5899FE00DF11DE1 +:100FC0001124E60FF11DEE0FFF1FE154FE4F859136 +:100FD000949108958238910549F1B0F481339105D7 +:100FE00009F458C048F48932910509F44EC08A3298 +:100FF000910509F454C008958533910509F440C062 +:101000008933910599F00895833E910529F138F4CB +:10101000803E910591F0823E9105A1F00895863EB3 +:101020009105F9F0873E910531F108952091F20183 +:1010300020FD3AC021FD38C008958091F20180FD65 +:1010400035C032C08091F20182FF32C08091F2013E +:1010500084FD30C083EE39C08091F20182FD28C04A +:10106000F5CF8091F20183FF27C08091F20184FDCA +:1010700021C087EE2AC08091F20183FD1DC0F5CF0B +:101080008091F20185FD1AC01BC08091F20185FD9F +:1010900017C014C08091F20186FD14C015C0809164 +:1010A000F20186FD11C00EC080EE0FC089E30DC0B5 +:1010B00082EE0BC080E009C086EE07C089E205C061 +:1010C00085E303C08AE201C081E390E008950895BA +:1010D0000F931F93CF93FB012281211102C0C1E026 +:1010E00041C08C01C0916001C11125C0843190477D +:1010F000B1F70E94670881E0809360010E94DE15CD +:1011000090935F0180935E011092530110925501FC +:1011100010925401109257011092560110925901E9 +:101120001092580110925B0110925A0110925D01C9 +:1011300010925C0117C080915E0190915F010E9446 +:10114000EA15883C910558F690915301E92FF0E09B +:10115000EE0FFF1FEC5AFE4F118300839F5F9093A9 +:101160005301C0E08C2FCF911F910F910895569895 +:101170005E9825982D9826982E9827982F988FEF6F +:1011800090E0909389008093880090938B008093E7 +:101190008A0090938D0080938C00259A2D9A2FEFD2 +:1011A00080E792E0215080409040E1F700C00000CD +:1011B000269A2E9A2FEF80E792E0215080409040AF +:1011C000E1F700C00000279A2F9A2FEF80E792E006 +:1011D000215080409040E1F700C0000025982D98F4 +:1011E0002FEF80E792E0215080409040E1F700C06F +:1011F000000026982E982FEF80E792E02150804043 +:101200009040E1F700C0000027982F9856985E980C +:1012100025982D9826982E9827982F98089589EA32 +:101220008093800089E08093810024982C983F98D7 +:101230008AB18F748AB96E98479A8BB1806B8BB9DB +:10124000769A0E94B7080C94E30480E2809301012F +:101250008091610181110EC00E941C0381E0809386 +:1012600061012FEF83ED90E3215080409040E1F742 +:1012700000C0000080E40E942203809301018111DC +:101280002EC00E944C0380930101811128C00E944E +:101290004C0380930101811122C08FE30E944C0313 +:1012A0008093010181111BC00E94440380E40E94CD +:1012B000220380930101811112C08CE00E944C0333 +:1012C0008093010181110BC00E944C0380930101A6 +:1012D000811105C08FE30E944C03809301010E949D +:1012E0004403809101010895282F882339F090E06C +:1012F0002A3010F44D9608950697089587E290E0FD +:101300000895FF920F931F93CF93DF93813020E8CE +:10131000920708F44DC0FB012281222309F448C042 +:10132000EC01DF7780916201813079F050F08230FA +:10133000C1F482EE0E940C0B87E50E940C0B87E53E +:101340000EC082EE0E940C0B0CC080EE0E940C0BB3 +:1013500081EE0E940C0B88E10E940C0B88E10E9438 +:10136000DF0B0CE010E0CE01002E02C096958795B1 +:101370000A94E2F78F700E947409F82E0E940C0BF9 +:101380008F2D0E94DF0B045011090C3FFFEF1F0748 +:1013900051F780916201813029F010F0823041F4E0 +:1013A00082EE04C080EE0E94DF0B81EE0E94DF0B14 +:1013B00081E0DF91CF911F910F91FF90089590935D +:1013C0006801809367010895E0916701F0916801D9 +:1013D000309721F00190F081E02D099480E008958C +:1013E000E0916701F0916801309721F00280F3816C +:1013F000E02D09940895E0916701F091680130971C +:1014000021F00480F581E02D099408952091650173 +:10141000309166018217930771F090936601809373 +:101420006501E0916701F0916801309721F0068035 +:10143000F781E02D099408952091630130916401B2 +:101440008217930771F09093640180936301E09198 +:101450006701F0916801309721F00084F185E02D5B +:101460000994089508950C94320A0E94D5150E949B +:1014700098030C945B16CF92DF92EF92FF920F933A +:101480001F93CF93DF93CDB7DEB72B970FB6F894AA +:10149000DEBF0FBECDBF0E94BF038AE6C82E81E02B +:1014A000D82E00E010E0E02E802F0E94AD04F6015F +:1014B00041916F01F42EF826B1F40F5F1F4F0E30EB +:1014C000110589F78FEF89838A831B820E94DE15BD +:1014D0008160782F9D838C8349815A816B818D81B6 +:1014E0000E94DE0A40C09091CD0191FF04C08B871D +:1014F0000E94B3048B8520E030E04F2D50E0922F06 +:10150000BA01022E02C0759567950A94E2F760FF52 +:1015100024C02E83EF8221E030E0690102C0CC0CB0 +:10152000DD1C9A95E2F790E08C219D21892B09F42E +:1015300020E028870E94DE158160782F9A878987AE +:101540004E815F8168858A850E94DE0AF801E6592E +:10155000FE4F8081C826C08206C02F5F3F4F2630D5 +:10156000310569F6AACF0E94F317109169010E9414 +:10157000E4091817A1F00E94E409809369012B96F1 +:101580000FB6F894DEBF0FBECDBFDF91CF911F9194 +:101590000F91FF90EF90DF90CF900C9446062B9622 +:1015A0000FB6F894DEBF0FBECDBFDF91CF911F9174 +:1015B0000F91FF90EF90DF90CF900895CF93DF933E +:1015C000CDB7DEB72B970FB6F894DEBF0FBECDBFF9 +:1015D0004F83588769877A878B87DE01119686E06B +:1015E000FD0111928A95E9F785E0FE013796019099 +:1015F0000D928A95E1F749815A816B817C818D81B9 +:101600009E810E9432112B960FB6F894DEBF0FBE5A +:10161000CDBFDF91CF910895CF93882309F4CDC03A +:10162000C82F823859F40E94E40981FDC6C089E3BD +:101630000E940C140E94D91489E30CC0833879F4F9 +:101640000E94E40980FDB9C083E50E940C140E9449 +:10165000D91483E50E944E14CF910C94D914843888 +:1016600059F40E94E40982FDA8C087E40E940C148A +:101670000E94D91487E4EECF8CEF8C0F813A48F4A6 +:101680008C2F0E943D1A811198C08C2F0E940C143F +:10169000E3CF80E28C0F883048F4C77081E001C04E +:1016A000880FCA95EAF70E949214D6CF8BE58C0F6B +:1016B000833078F4C53A29F0C63A31F083E890E0F7 +:1016C00005C081E890E002C082E890E0CF910C94E0 +:1016D000060A88E58C0F853108F06FC0C83A61F1C1 +:1016E000C93A69F1CA3A71F1CB3A79F1CC3A81F150 +:1016F000CB3B89F1CC3B91F1CD3A99F1C03BA1F1C3 +:10170000CE3AA9F1CF3AB1F1C13BB9F1C23BC1F137 +:10171000C33BC9F1C43BD1F1C53BD9F1C63BE1F1B3 +:10172000C73BE9F1C83BF1F1C93BF9F1CA3B09F408 +:101730003FC080E090E03EC082EE90E03BC089EE8A +:1017400090E038C08AEE90E035C085EB90E032C082 +:1017500086EB90E02FC083EB90E02CC084EB90E010 +:1017600029C087EB90E026C08CEC90E023C08DEC84 +:1017700090E020C083E891E01DC08AE891E01AC0A3 +:1017800082E991E017C084E991E014C081E292E01F +:1017900011C083E292E00EC084E292E00BC085E2C9 +:1017A00092E008C086E292E005C087E292E002C0C3 +:1017B0008AE292E0CF910C941C0ACF91089588237D +:1017C00009F44BC0823859F40E94E40981FF45C0F6 +:1017D00089E30E940C140E94D91489E30CC0833859 +:1017E00071F40E94E40980FF38C083E50E940C1464 +:1017F0000E94D91483E50E944E140C94D9148438A5 +:1018000059F40E94E40982FF28C087E40E940C1466 +:101810000E94D91487E4EFCF9CEF980F913A58F3C8 +:1018200090E2980F983050F4877091E001C0990FC2 +:101830008A95EAF7892F0E949814DFCF9BE5980FCD +:10184000933020F480E090E00C94060A885A8531A9 +:1018500020F480E090E00C941C0A0895882321F085 +:101860000E9492140C94D9140895882321F00E94A8 +:1018700098140C94D91408957F928F929F92AF92EE +:10188000BF92CF92DF92EF92FF920F931F93CF936D +:10189000DF931F92CDB7DEB77C01C62E772EFC01F9 +:1018A000058102950F70128111110E94AF140E94E0 +:1018B0000514882379F0112369F080E28C0D8830BB +:1018C00048F082E00E94EE130E94051491E0D82EA9 +:1018D000D92601C0D12CE72DE295EF70F0E0EA5A4D +:1018E000FF4F0C947F23872D807F072D0F70882357 +:1018F00011F00295007F112389F0002309F490C1B3 +:1019000080E28C0D883020F4802F0E94921403C056 +:10191000802F0E94A2140E94D91482C18C2D0E9493 +:10192000DF0B002309F495C180E28C0D883020F490 +:10193000802F0E94981403C0802F0E94A8140E9438 +:10194000D91487C1972D907F872D8F70903211F019 +:101950008295807FCC2021F0F1E0CF16B1F01EC03F +:10196000112349F0002309F414C1013009F011C119 +:101970000E94C2146EC1002319F0013009F469C13C +:1019800089830E94C51489810AC1112321F0023084 +:1019900008F05FC1FEC001115CC101C1112321F03B +:1019A000002309F4F6C03CC1002309F4F8C03EC18D +:1019B000872D86958695837090E0009719F00197A2 +:1019C00061F047C1112321F08C2D972D937002C037 +:1019D00080E090E00E94060A3CC1112321F08C2D8A +:1019E000972D937002C080E090E00E941C0A31C1E4 +:1019F0008C2D112319F00E94FB1602C00E94631760 +:101A00000E94E81726C1872D837009F052C011117A +:101A100020C18C2D829586958770880F880F9C2D0C +:101A20009F70892E912CA12CB12C082E04C0880CFB +:101A3000991CAA1CBB1C0A94D2F7C4FE14C00FE068 +:101A400010E020E030E0B901A80104C0440F551FA8 +:101A5000661F771F8A95D2F7CB01BA016095709502 +:101A60008095909503C060E070E0CB01272D26950E +:101A70002695237030E02230310569F0233031059E +:101A800089F0682979298A299B292130310571F04B +:101A90000E947A12DEC0682979298A299B290E942E +:101AA0009612D7C00E947A12C501B4010E945E123C +:101AB000D0C0112319F0872D817001C0869588232D +:101AC00009F4C7C08C2D829586958770880F880F82 +:101AD0009C2D9F70892E912CA12CB12C082E04C016 +:101AE000880C991CAA1CBB1C0A94D2F7C4FE14C013 +:101AF0000FE010E020E030E0B901A80104C0440F7D +:101B0000551F661F771F8A95D2F7CB01BA016095E2 +:101B100070958095909503C060E070E0CB01272D13 +:101B2000269526952370422F50E04230510569F0EA +:101B30004330510589F0682979298A299B29413048 +:101B4000510571F00E94541384C0682979298A29AB +:101B50009B290E9470137DC00E945413C501B401DB +:101B60000E94381376C08C2D90E0FC01E05EF109F4 +:101B7000E531F10508F050C0EA59FF4F0C947F237E +:101B80000C2D0F70872D8F71112331F00E94D1120F +:101B9000802F0E942E0C5DC00E94F212802F0E94A6 +:101BA000350C57C0112339F0011153C0872D8F71A7 +:101BB0000E9417134EC0023008F04BC0F7CF11231C +:101BC00039F0872D8F710E94D11243C01123C9F3C0 +:101BD000872D8F710E94F2123CC0112329F0872DAE +:101BE0008F710E94BC1235C00E94B21232C0112304 +:101BF00051F0172D1F71812F0E94D11263E0812FA8 +:101C00000E94E51326C081E00E94EE13023008F125 +:101C100082E00E94EE131DC0112331F0002389F2EF +:101C20008C2D0E940C0B15C0002391F28C2D0E946C +:101C3000DF0B0FC0472D4F706C2DC7010E94B404FD +:101C40000E94D61106C0472D4F706C2DC7010E940F +:101C5000D707DD20F9F00E94E11380FD1BC0F701DA +:101C600012820E94DB130E94D112C7010E94590EFA +:101C70000E94DB130F90DF91CF911F910F91FF9086 +:101C8000EF90DF90CF90BF90AF909F908F907F901C +:101C90000C94F2120F90DF91CF911F910F91FF9052 +:101CA000EF90DF90CF90BF90AF909F908F907F90FC +:101CB00008950F931F93CF93DF93EC01888199814F +:101CC0002B813C81232BB9F09F3F11F48F3F99F07A +:101CD000CE010E941405882371F0688179818A8180 +:101CE0000E94D7138C010E948C130E945312B801DA +:101CF000CE010E943C0CDF91CF911F910F9108956E +:101D00000E94AF140E94BF140E9484140E94D91430 +:101D10000E9499180E94E81780E090E00E94060A4D +:101D200080E090E00C941C0A0E949F140C94800E9A +:101D30000E94CC13292F22952F7030E02C303105D2 +:101D40004CF42A3031056CF422503109223031052F +:101D5000A8F407C02C30310569F02F30310551F05F +:101D60000DC0803F69F018F4803E40F409C0843F04 +:101D700029F406C093FB882780F9089580E0089530 +:101D800081E00895CF93DF9300D000D01F92CDB7AC +:101D9000DEB70F900F900F900F900F90DF91CF91C3 +:101DA0000895CF93DF9300D000D000D0CDB7DEB739 +:101DB00026960FB6F894DEBF0FBECDBFDF91CF9150 +:101DC00008951F93CF93DF93C091780116E080911F +:101DD0007901C81799F0D0E01C9FF0011D9FF00D0C +:101DE0001124E658FE4F40815181628173818481C4 +:101DF00095810E94D10E2196C770E9CFDF91CF91D6 +:101E00001F9108954091AA015091AB016091AC01DE +:101E10007091AD018091AE019091AF010C94D10E03 +:101E20008091AF0182958F7009F054C08091AC0110 +:101E3000882309F44FC080917801A09179016091C5 +:101E4000AA017091AB014091AD015091AE01B6E095 +:101E50008A1709F43FC090E041155105C1F17F3F59 +:101E600011F46F3FA1F1B89FF001B99FF00D11245B +:101E7000E658FE4F218172132AC02081621327C0C9 +:101E80002281211124C0238134812417350710F4C5 +:101E900021503109241B350B283C3105C0F4209119 +:101EA000AF012F7020612093AF0126E0289FF00141 +:101EB000299FF00D1124E158FE4F80818F708061C1 +:101EC00080838AEA91E00E94590E0C94E10E0196FB +:101ED0008770BECF0895CF92DF92EF92FF920F935B +:101EE0001F93CF93DF93CDB7DEB762970FB6F89409 +:101EF000DEBF0FBECDBF8C0185E0F801DE011D966F +:101F000001900D928A95E1F7D8014C9111965C9160 +:101F1000119712966C9112971396CD90DC901497AE +:101F20003091AA017091AB018091AD019091AE0109 +:101F3000009709F46BC17F3F19F43F3F09F466C174 +:101F4000E090AC01EE2009F4C0C02091AF01C816AA +:101F5000D90628F0F601E81BF90BCF0104C08095E3 +:101F600090958C0D9D1DFF24F394883C910578F08D +:101F7000F12C207F09F0C6C07C2DD98AC88A8989B6 +:101F80000E94C20E8AEA91E00E94590EB1C0822FCF +:101F9000807F09F046C0751314C0341312C061115C +:101FA00010C02F7020612093AF010E94020F8AEAB7 +:101FB00091E00E94590E8091AF01D80115968C9343 +:101FC0002EC0CD2819F15F3F11F44F3FF9F0F62EE6 +:101FD00061111CC0809178012091790136E082174F +:101FE00009F45AC090E0389FF001399FF00D112498 +:101FF000E658FE4F7181571306C07081471303C026 +:102000007281711103C001968770E9CFF62E6623A5 +:1020100009F418C18091AF0181608093AF01F12C68 +:1020200011C1751308C0341306C0611104C080913A +:10203000AF01D801C3C04D875E878D859E856A8BB1 +:102040000E94980E6A898823E1F16623D1F12091DC +:10205000AF01822F82958F7090E0029774F080918B +:10206000AA019091AB0198878F831986DB86CA8677 +:102070002C87CE0107960E94590E86E0F801AAEA45 +:10208000B1E001900D928A95E1F70E94100F0E9435 +:10209000020FFF24F394D6C04D875E878D859E8501 +:1020A0000E94CC13292F22952F7030E02230310569 +:1020B0000CF0BCC09F7009F0B6C0805E883008F498 +:1020C000C1C0C8010E94590EE4CFC816D90608F451 +:1020D00053C0F601E81BF90BCF01883C910508F4C9 +:1020E00050C0F12C7C2DD98AC88A89890E94C20EE1 +:1020F000EAEAF1E086E0DF011D928A95E9F70E94A5 +:10210000020FA0C0751314C0341312C0611110C0A7 +:102110008091AF01F8018583C8010E94590E86E0C5 +:10212000EAEAF1E0DF011D928A95E9F7FE2C8AC008 +:102130004D875E878D859E856A8B0E94980E6A8981 +:10214000882309F4BECF662309F4BBCF2091AF01E9 +:10215000822F82958F7090E002970CF48ECF809141 +:10216000AA019091AB019A8389831B82DD82CC8284 +:102170002E83CE0101967FCF809590958C0D9D1D6D +:10218000ACCFF62E662309F49CCF75132EC0341302 +:102190002CC02091AF0120FD1FC0822F82958F702F +:1021A000D9F0D80115962C9315978F3049F08F5F91 +:1021B000982F9295907F822F8F70892B15968C93F4 +:1021C000C8010E94590E86E0F801AAEAB1E0019028 +:1021D0000D928A95E1F793CF86E0F801AAEAB1E083 +:1021E00001900D928A95E1F72DC04D875E878D8510 +:1021F0009E850E94980E811140CF8091AF01816031 +:102200008093AF01C8010E94590E1CC0662309F4D7 +:1022100058CF4D875E878D859E850E94980E8823B6 +:1022200009F44FCF2ACF811148CF0CC0243031059B +:102230000CF047CF9F7009F440CFF8019581907F53 +:1022400009F03BCF8F2D62960FB6F894DEBF0FBE1C +:10225000CDBFDF91CF911F910F91FF90EF90DF9055 +:10226000CF9008951F93CF93DF93CDB7DEB72C9710 +:102270000FB6F894DEBF0FBECDBF4F835887698776 +:102280007A878B879C87CE0107960E946B0F8823E5 +:1022900069F08F8198852A853B85232BF1F19F3F3B +:1022A00009F063C08F3F09F060C037C086E0FE01CF +:1022B0003796DE01119601900D928A95E1F76F81B4 +:1022C0007885EA85FB85309741F17F3F11F46F3FB8 +:1022D00021F12091790130E0C90101968770992799 +:1022E0004091780150E08417950709F447C069834D +:1022F0007A83FD83EC8396E0929FD001939FB00D8B +:102300001124A658BE4FFE01319601900D929A9568 +:10231000E1F7809379010E94E10E16E08091780147 +:10232000909179018917C1F1189FC0011124865835 +:102330009E4F0E946B0F882379F1E09178011E9FD8 +:10234000F0011124E658FE4F408151816281738172 +:10235000848195810E94D10E8091780190E0019650 +:102360008770992780937801D9CF4F8158856985E7 +:102370007A858B859C850E94D10ECFCF0E94940ECA +:102380001092790110927801EAEAF1E086E0DF012B +:102390001D928A95E9F7C1CF2C960FB6F894DEBF4F +:1023A0000FBECDBFDF91CF911F910895EF92FF92A5 +:1023B0000F931F93CF93DF938C01892B09F46CC08B +:1023C000F12CEE24E394E8012196F80184918437FE +:1023D00040F4843008F051C0813081F0823019F12E +:1023E0005BC0853709F444C0A8F19CE7980F90378B +:1023F00008F052C08F770E94DF0B41C00E5F1F4F65 +:10240000FE01C49180E28C0F883048F4C7708E2D95 +:1024100001C0880FCA95EAF70E94B21414C08C2F2D +:102420000E940C0B2DC00E5F1F4FFE01C49180E275 +:102430008C0F883058F4C7708E2D01C0880FCA9554 +:10244000EAF70E94B8140E94D9141AC08C2F0E9477 +:10245000DF0B16C00E5F1F4FFE01C491CC2381F02D +:102460008FE99FE00197F1F700C00000C150F6CF5F +:102470000E5F1F4FFE01F49003C00E940C0B8E01F3 +:102480008F2D882309F49FCFEFE9FFE03197F1F713 +:1024900000C000008150F5CFDF91CF911F910F91C7 +:1024A000FF90EF90089508956093B4017093B50183 +:1024B0008093B6019093B7010C94800E0F931F93F5 +:1024C0000091B4011091B5012091B6013091B7018E +:1024D000DC01CB01802B912BA22BB32B8093B40179 +:1024E0009093B501A093B601B093B7011F910F91DE +:1024F0000C94800E0F931F930091B4011091B501BD +:102500002091B6013091B701DC01CB0180239123EA +:10251000A223B3238093B4019093B501A093B60195 +:10252000B093B7011F910F910C94800E0F931F93DE +:102530000091B4011091B5012091B6013091B7011D +:10254000DC01CB0180279127A227B3278093B40118 +:102550009093B501A093B601B093B7011F910F916D +:102560000C94800E1092B0011092B1011092B20141 +:102570001092B3010C94800E41E050E060E070E0F6 +:1025800004C0440F551F661F771F8A95D2F74093EA +:10259000B0015093B1016093B2017093B3010C94F8 +:1025A000800E41E050E060E070E004C0440F551F31 +:1025B000661F771F8A95D2F78091B0019091B10183 +:1025C000A091B201B091B301482B592B6A2B7B2B00 +:1025D0004093B0015093B1016093B2017093B30185 +:1025E0000C94800E41E050E060E070E004C0440FC5 +:1025F000551F661F771F8A95D2F7409550956095B5 +:1026000070958091B0019091B101A091B201B0910B +:10261000B301482359236A237B234093B00150938D +:10262000B1016093B2017093B3010C94800E41E04C +:1026300050E060E070E004C0440F551F661F771F34 +:102640008A95D2F78091B0019091B101A091B20129 +:10265000B091B301482759276A277B274093B001DF +:102660005093B1016093B2017093B3010C94800E4A +:102670000F931F930091B0011091B1012091B2010D +:102680003091B301DC01CB01802B912BA22BB32B1A +:102690008093B0019093B101A093B201B093B301C4 +:1026A0001F910F910C94800E0F931F930091B00116 +:1026B0001091B1012091B2013091B301DC01CB0145 +:1026C00080239123A223B3238093B0019093B1017F +:1026D000A093B201B093B3011F910F910C94800E9F +:1026E0000F931F930091B0011091B1012091B2019D +:1026F0003091B301DC01CB0180279127A227B327BA +:102700008093B0019093B101A093B201B093B30153 +:102710001F910F910C94800E0895CF92DF92EF924B +:10272000FF920F931F93CF93DF938C01C090B4015E +:10273000D090B501E090B601F090B7018091B00162 +:102740009091B101A091B201B091B301C82AD92AE8 +:10275000EA2AFB2ACFE1D0E0D701C6010C2E04C043 +:10276000B695A795979587950A94D2F780FF06C0EE +:10277000B8018C2F0E944806019721F4219760F739 +:1027800080E001C08C2FDF91CF911F910F91FF90BE +:10279000EF90DF90CF900895CF93DF93EC010E94EC +:1027A0008D13BE010E944806DF91CF910895CB01A1 +:1027B0000E94CC1308958091B801859585958595E3 +:1027C00008958091B8018770089598E0899F9001DD +:1027D0001124262B2093B8010C94D1122091B8011A +:1027E000809582238093B801982F977069F430E028 +:1027F000482F552747FD50952417350729F0859513 +:10280000859585950C94F21208959091B801977072 +:1028100081E009F480E0089590911501992321F059 +:1028200090910201911109C020910301309104019E +:10283000F90132969FEF40E01FC0982F969596952C +:1028400096959F3050F5E0910301F0910401E90F56 +:10285000F11D877021E030E0A90102C0440F551F2F +:102860008A95E2F7CA019181892B818308959F3F60 +:1028700039F04F5F4E3041F051915813F8CF0DC0F1 +:102880005111F7CF942FF5CF9F3F39F0F901E90FA0 +:10289000F11D97FDFA958283089508959091150191 +:1028A000992321F090910201911109C02091030117 +:1028B00030910401F9013296205F3F4F1FC0982FDD +:1028C0009695969596959F30F0F4E0910301F091DE +:1028D0000401E90FF11D877021E030E0A90102C079 +:1028E000440F551F8A95E2F7CA018095918189238B +:1028F000818308953196E217F30729F090819813A8 +:10290000F9CF1082F7CF089581E090E0E0910301C4 +:10291000F0910401E80FF91F1082019680319105B2 +:10292000A9F708959091CC01892B8093CC0108954B +:1029300080959091CC0189238093CC0108951092C9 +:10294000CC0108959091CB01892B8093CB01089500 +:1029500080959091CB0189238093CB0108951092AB +:10296000CB0108959091CA01892B8093CA010895E3 +:1029700080959091CA0189238093CA01089510928D +:10298000CA0108958093B90108951092B90108957C +:102990008091030190910401FC0131969C01205F1C +:1029A0003F4F80E0919191118F5FE217F307D1F7CC +:1029B0000895E0910301F09104018091CC0180839E +:1029C000E0910301F091040190818091CB01892B6A +:1029D0008083E0910301F091040190818091CA010C +:1029E000892B80838091B901882361F0E0910301F4 +:1029F000F09104019081892B80830E94C814811179 +:102A00001092B90180910301909104010C94F00996 +:102A1000CF92DF92EF92FF926C01EE24FF24C1145B +:102A2000D104E104F10421F0C701B60120E101C0A5 +:102A300020E0C72ED82EE92EFF24C114D104E104D2 +:102A4000F10419F0285FC701B6016B017C0154E065 +:102A5000F694E794D794C7945A95D1F7C114D1044A +:102A6000E104F10419F02C5FC701B6016B017C0190 +:102A700042E0F694E794D794C7944A95D1F7C114ED +:102A8000D104E104F10419F02E5FC701B601DC01A5 +:102A9000CB01B695A79597958795892B8A2B8B2B7C +:102AA00009F02F5F822FFF90EF90DF90CF90089575 +:102AB0006DEE7EEF80E090E00E94B82360E082E05F +:102AC00090E00E94A72360E083E090E00E94A723AB +:102AD00060E084E090E00E94A72360E085E090E061 +:102AE0000C94A72380E090E00E94A12321E08D3E7A +:102AF0009E4F09F020E0822F089582E090E00C9430 +:102B0000992383E090E00C94992384E090E00C9466 +:102B10009923682F84E090E00C94A7238091F8011A +:102B2000843039F11092CE0120E488E190E00FB6B4 +:102B3000F894A895809360000FBE2093600080E019 +:102B40000E94460683B7817F846083BF83B781601C +:102B500083BF7894889583B78E7F83BF0FB6F89430 +:102B6000A895809160008861809360001092600059 +:102B70000FBE08950895CF930E94AC030E94BF0337 +:102B80000E94BA15C0E08C2F0E94AD04811104C0D0 +:102B9000CF5FCE30C1F701C081E0CF9108950E9490 +:102BA000940E0E94E4090C94460682E084BD93E0F2 +:102BB00095BD9AEF97BD80936E0008952FB7F89456 +:102BC0008091CF019091D001A091D101B091D2011B +:102BD0002FBF0895CF92DF92EF92FF920F931F9332 +:102BE0002FB7F8944091CF015091D0016091D1015D +:102BF0007091D2012FBF6A017B01EE24FF248C016A +:102C000020E030E0C016D106E206F30610F4415091 +:102C100051099A01281B390BC9011F910F91FF908F +:102C2000EF90DF90CF9008951F920F920FB60F9202 +:102C300011248F939F93AF93BF938091CF01909175 +:102C4000D001A091D101B091D2010196A11DB11D79 +:102C50008093CF019093D001A093D101B093D20182 +:102C6000BF91AF919F918F910F900FBE0F901F90CA +:102C700018950E943C1FF8942FEF87EA91E62150A7 +:102C800080409040E1F700C0000087E090EBDC015D +:102C90008093010290930202A0930302B093040276 +:102CA0009CE088E10FB6F894A895809360000FBE71 +:102CB00090936000FFCF0E947215811102C00E94A4 +:102CC00058150E947D158093CD010E94851590E0D6 +:102CD0009093F3018093F20187FB882780F980931A +:102CE00002010E948115682F70E080E090E00C9452 +:102CF00054128091D50180FF0BC06091080185E0DE +:102D0000689FB001112475956795759567952BC0DF +:102D100081FF09C06091080185E0689FB00111241E +:102D20007595679520C082FF07C06091080185E016 +:102D3000689FB001112417C09091D6019923D1F05A +:102D400060910701961788F72091080185E0289F78 +:102D500090011124929FA001939F500D112470E0C7 +:102D6000CA010E946B236038710540F4611571053A +:102D700039F002C065E070E0862F08958FE708956E +:102D800081E008958091D50180FF08C0609106011F +:102D900070E0759567957595679521C081FF06C0B0 +:102DA0006091060170E07595679519C082FF04C0B7 +:102DB0006091060170E010C09091D6019923C1F096 +:102DC000609105019617A0F780910601899FC001C7 +:102DD000112470E00E946B236038710528F461159E +:102DE000710521F0862F08958FE7089581E00895F9 +:102DF00061E070E0F4CF803F21F40E947916819564 +:102E000004C0813F29F40E9479168093D901089566 +:102E1000823F21F40E947916819504C0833F29F4F2 +:102E20000E9479168093D8010895893F19F40E9471 +:102E3000C21605C08A3F31F40E94C2168195809364 +:102E4000DA0108958B3F21F40E94C216819504C0D7 +:102E50008C3F29F40E94C2168093DB010895843FC1 +:102E600021F48091D701816017C0853F21F48091C2 +:102E7000D701826011C0863F21F48091D701846020 +:102E80000BC0873F21F48091D701886005C0883F3F +:102E900031F48091D70180618093D70108958D3FEF +:102EA00021F48091D50181600BC08E3F21F4809187 +:102EB000D501826005C08F3F29F48091D5018460DF +:102EC0008093D5010895803F39F48091D90187FF1F +:102ED0006CC01092D90169C0813F29F48091D90159 +:102EE0001816BCF362C09091D801823F29F497FF75 +:102EF0005CC01092D80159C0833F19F41916CCF365 +:102F000054C0893F41F48091DA0118160CF04DC08D +:102F10001092DA014AC08A3F29F48091DA0187FFD2 +:102F200044C0F6CF8B3F39F48091DB0187FF3DC071 +:102F30001092DB013AC08C3F29F48091DB01181616 +:102F4000BCF333C0843F21F48091D7018E7F17C03A +:102F5000853F21F48091D7018D7F11C0863F21F4F8 +:102F60008091D7018B7F0BC0873F21F48091D701DF +:102F7000877F05C0883F31F48091D7018F7E809391 +:102F8000D70113C08D3F21F48091D5018E7F0BC0F6 +:102F90008E3F21F48091D5018D7F05C08F3F29F4AC +:102FA0008091D5018B7F8093D5018091D8018111CB +:102FB0000EC08091D90181110AC08091DA0181117E +:102FC00006C08091DB01811102C01092D6010895E4 +:102FD00087ED91E00E94FB090E94DE159093D401D9 +:102FE0008093D30108951F93CF93DF938091D301F2 +:102FF0009091D4010E94EA15AC019091D6019923D9 +:1030000021F02091090130E006C020910A018AE0F8 +:10301000289F900111244217530708F486C080911D +:10302000D801C091D901D091DA011091DB01811151 +:1030300007C0C11176C0D11174C0111172C075C022 +:103040009F3F19F09F5F9093D601181624F40E94B9 +:1030500079168093D8018091D80187FF05C00E941E +:10306000791681958093D8011C1624F40E94791654 +:103070008093D9018091D90187FF05C00E947916FC +:1030800081958093D9016091D801662339F1C0916F +:10309000D901CC2319F1772767FD7095872F972FDA +:1030A0000E94722223E333E343E35FE30E94D622CC +:1030B0000E943A226093D8016C2F772767FD7095A4 +:1030C000872F972F0E94722223E333E343E35FE3CA +:1030D0000E94D6220E943A226093D9011D1624F440 +:1030E0000E94C2168093DA018091DA0187FF05C041 +:1030F0000E94C21681958093DA01111624F40E9471 +:10310000C2168093DB018091DB0187FF05C00E941E +:10311000C21681958093DB01DF91CF911F910C94B2 +:10312000E8179F3F09F08ECF96CFDF91CF911F9187 +:103130000895E7EDF1E085E0DF011D928A95E9F75A +:103140001092D6011092D5010895833081F128F4B0 +:10315000813059F08230D1F00895853009F449C0AA +:10316000B8F1863009F456C0089580910A01262FDF +:1031700030E0280F311D2F3F310524F4680F609394 +:103180000A0108958FEF80930A0108958091090143 +:10319000262F30E0280F311D2F3F310524F4680F12 +:1031A0006093090108958FEF80930901089580913C +:1031B0000801262F30E0280F311D2F3F310524F460 +:1031C000680F6093080108958FEF809308010895B8 +:1031D00080910701262F30E0280F311D2F3F310548 +:1031E00024F4680F6093070108958FEF809307011F +:1031F000089580910601262F30E0280F311D2F3FC2 +:10320000310524F4680F6093060108958FEF8093D1 +:103210000601089580910501262F30E0280F311D09 +:103220002F3F310524F4680F6093050108958FEF57 +:10323000809305010895833011F128F4813049F01D +:10324000823091F00895853081F120F18630C1F10E +:10325000089580910A01681720F4861B80930A0163 +:10326000089510920A01089580910901681720F4C9 +:10327000861B809309010895109209010895809199 +:103280000801681720F4861B8093080108951092A6 +:103290000801089580910701681720F4861B809328 +:1032A000070108951092070108958091060168179B +:1032B00020F4861B8093060108951092060108955C +:1032C00080910501681720F4861B809305010895FD +:1032D0001092050108950F931F938D3109F471C069 +:1032E00008F045C0803109F485C008F5873009F43D +:1032F0006FC068F4863009F0ADC08091CD01817F48 +:103300008E7F8093CD0181E08093DD01A4C08B305E +:1033100009F49EC08E3009F09DC08091CD0182FBE2 +:10332000222720F991E0922790FB82F96CC0863128 +:1033300009F48EC060F4813109F08CC00E94940EB3 +:103340009091020181E089278093020181C0893137 +:1033500009F47EC08B3109F07DC08091CD0181FBE5 +:10336000222720F991E0922790FB81F94CC0853308 +:1033700009F466C048F4873209F462C008F44FC00B +:10338000893209F45DC066C0833438F48A3308F0AA +:1033900044C0883309F45CC05DC0833409F450C074 +:1033A000883409F057C00E94940E0FEF13ED20E30C +:1033B000015010402040E1F700C000000E94391683 +:1033C00047C00E94F51A0E94E4090E94460640C0C8 +:1033D0009091CD01892F8095817080FB90F929F023 +:1033E000966098609093CD0136C0997F977F9093B7 +:1033F000CD012EC08091CD0183FB222720F991E0E1 +:10340000922790FB83F98093CD01992309F1809154 +:10341000CD0181608093CD011BC0895301C08D51C6 +:1034200041E050E060E070E08A019B0104C0000FC1 +:10343000111F221F331F8A95D2F7C901B80104C09A +:1034400061E070E080E090E00E9454120E94940ECF +:1034500081E001C080E01F910F91089580E0089500 +:1034600080E008958E518A3030F4E82FF0E0EA5E73 +:10347000FE4F8081089580E00895CF93C82F8091FA +:10348000DD01813079F018F08230E9F186C0E091F9 +:103490000301F09104018081813169F0823209F0E9 +:1034A0007EC009C0E0910301F09104018081813167 +:1034B00011F0823261F48C2F0E942E1A811104C007 +:1034C0008C2F0E946B191DC081E090E01AC08C2FD8 +:1034D0000E94301A811114C0C43179F048F4CB3005 +:1034E00079F0C03109F05FC082E08093DD0108C04F +:1034F000C93219F0C83321F056C01092DD0153C013 +:1035000081E0817052C0C93281F110F5C43169F196 +:10351000A8F4C73009F045C08AE080930A0194E11D +:103520009093090193E0909308018093070188E04C +:103530008093060188E28093050133C082EE8C0FF0 +:10354000863078F58C2F0E94321A8093DC0129C0D6 +:10355000CE34E9F020F4CB3421F56AE013C0C13554 +:1035600079F0C235F1F461E00DC08091DC0188236F +:1035700019F01092DC0115C081E08093DD0115C0C7 +:1035800061E006C08091DC010E94A5180AC06AE0D3 +:103590008091DC010E941B1904C01092DD0180E0C3 +:1035A00004C081E002C080E0ACCFCF910895E1E893 +:1035B000F0E08081886080838081816080838FB724 +:1035C000F89493E09093890090ED909388008FBFDA +:1035D0000895EFE6F0E08081826080830895EFE651 +:1035E000F0E080818D7F80830895EFE6F0E09081A8 +:1035F00082E08927808308951F920F920FB60F9261 +:1036000011242F933F934F935F936F937F938F93E7 +:103610009F93AF93BF93EF93FF938091DE019091BF +:10362000DF0101969093DF018093DE01811103C0D9 +:1036300082E00E944606E091DF01E695E695F0E023 +:10364000E954FC4FE4918091DE018E1303C080E0C9 +:103650000E944606FF91EF91BF91AF919F918F918C +:103660007F916F915F914F913F912F910F900FBE7E +:103670000F901F9018958091F0010895CF93DF93DC +:1036800000D01F92CDB7DEB79C018091F801843045 +:1036900019F593E099833B832A839093E9008FEF98 +:1036A0009091E800815095FD06C095ED9A95F1F74F +:1036B00000008111F5CF8091E80085FF0DC040E04A +:1036C00050E063E070E0CE0101960E94A71D80915A +:1036D000E8008E778093E8000F900F900F90DF91B5 +:1036E000CF910895CF93DF9300D01F92CDB7DEB76F +:1036F0002091F801243021F522E029839B838A83DD +:1037000083E08093E9008FEF9091E800815095FD70 +:1037100006C095ED9A95F1F700008111F5CF8091E3 +:10372000E80085FF0DC040E050E063E070E0CE01AE +:1037300001960E94A71D8091E8008E778093E80093 +:103740000F900F900F90DF91CF9108952091F80185 +:103750002430F1F422E02093E9002FEF3091E800CB +:10376000215035FD06C035ED3A95F1F700002111E5 +:10377000F5CF2091E80025FF0BC040E050E065E068 +:1037800070E00E94A71D8091E8008E778093E8008A +:103790000895CF93DF93EC019091F801943009F0F4 +:1037A00046C0809115018823D9F0809102018823B9 +:1037B000B9F09093E9008FEF9091E800815095FD6A +:1037C00006C095E19A95F1F700008111F5CF80913F +:1037D000E80085FF2CC040E050E060E170E017C0D9 +:1037E00081E08093E9008FEF9091E800815095FD92 +:1037F00006C095ED9A95F1F700008111F5CF809103 +:10380000E80085FF14C040E050E068E070E0CE01C1 +:103810000E94A71D8091E8008E778093E80080E1E8 +:10382000FE01A0EEB1E001900D928A95E1F7DF91E3 +:10383000CF9108958091F701811109C00E943C1F2A +:103840000E94991F8091E20084608093E2000895B5 +:103850001092F701089508950C94E91A0E94CF156B +:103860000E94EF1A0E94E4090C94460642E061ECC3 +:1038700081E00E94B61E42E061EC82E00E94B61E2A +:1038800042E061EC83E00E94B61E42E161EC84E01C +:103890000C94B61E8091FA01833009F455C030F4BF +:1038A000813071F0823009F48EC008958A3009F4B5 +:1038B0007AC08B3009F460C0893009F09CC020C008 +:1038C0008091F901813A09F096C08091E800877FE4 +:1038D0008093E8008091FD019091FE01892B21F4F5 +:1038E00060E180EE91E003C060E080E090E070E095 +:1038F0000E94F21D8091E8008B778093E800089584 +:103900008091F901813209F076C08091FD0190919A +:10391000FE01009719F0039709F06DC08091E8004F +:10392000877F8093E8008091E80082FD05C0809148 +:10393000F8018111F8CF5FC08091F1008093F00110 +:103940008091E8008B7753C08091F901813A09F0AA +:1039500052C08091FD019091FE01892B09F04BC06E +:103960008091E800877F8093E8008091E80080FFE5 +:10397000FCCF8091150136C08091F9018132D9F5D3 +:103980008091FD019091FE01892BA9F58091E800BD +:10399000877F8093E8000E94EB1E8091FB0180935B +:1039A00015010C94940E8091F901813221F58091DA +:1039B000E800877F8093E8000E94EB1E8091FC0165 +:1039C0008093F10108958091F901813AA1F48091E9 +:1039D000E800877F8093E8008091E80080FFFCCFBB +:1039E0008091F1018093F1008091E8008E778093BF +:1039F000E8000C94EB1E089584B7877F84BF0FB650 +:103A0000F894A8958091600088618093600010927E +:103A100060000FBE80E880936100109261000E94F8 +:103A2000330A0E943C1F0E94991F8091E20084602B +:103A30008093E20078940E941F220E94350A8BE056 +:103A400091E00E94DF090E94D71A8091F801853029 +:103A500069F40E948E158091F6018823B1F30E94CB +:103A6000BB15882391F30E94911DEFCF0E943B0A62 +:103A7000ECCF292F332723303105C9F064F42130EE +:103A8000310581F02230310509F043C08DE690E028 +:103A90002BE234E042C021323105F1F0223231050F +:103AA00041F137C082E190E028E934E036C099273F +:103AB0008130910541F08230910541F0892B49F523 +:103AC000E7E2F4E005C0EFE0F4E002C0E7EFF3E086 +:103AD000849190E09F0121C06430D8F4E62FF0E09B +:103AE000EE0FFF1FE45DFE4F2081318189E090E001 +:103AF00014C0643070F470E0FB01EE0FFF1FEC5D4A +:103B0000FE4F20813181FB01E05EFE4F808190E01D +:103B100004C080E090E020E030E0FA0131832083AF +:103B2000089580E189BD82E189BD09B400FEFDCF21 +:103B30008091D8008F7D8093D8008091E0008260D2 +:103B40008093E0008091E00081FDFCCF0895CF924A +:103B5000DF92EF92FF920F931F93CF93DF93EC01CD +:103B60008B016A010E940A1F811133C0C114D10464 +:103B700039F0F60180819181081B190BC80FD91FFC +:103B8000E12CF12C0115110519F18091E80085FD5A +:103B900016C08091E8008E778093E800C114D104AC +:103BA00049F0F60180819181E80EF91EF182E082F0 +:103BB00085E00FC00E940A1F882321F30AC0899163 +:103BC0008093F10001501109FFEFEF1AFF0ADACFDD +:103BD00080E0DF91CF911F910F91FF90EF90DF90E8 +:103BE000CF9008952091FF013091000226173707EA +:103BF00048F06115710539F42091E8002E77209383 +:103C0000E80001C0B90140E061157105A9F12091FA +:103C1000F801222309F443C0253009F442C0209161 +:103C2000E80023FD40C02091E80022FD32C0209131 +:103C3000E80020FFE9CF4091F3002091F20030E04E +:103C4000342BFC01CF016115710559F02830310585 +:103C500040F481918093F100615071092F5F3F4FD3 +:103C6000F1CF41E02830310509F040E02091E80033 +:103C70002E772093E800C8CF4111C9CF0AC08091A8 +:103C8000F801882361F0853061F08091E80083FDC0 +:103C90000AC08091E80082FFF2CF80E0089582E0C0 +:103CA000089583E0089581E008952091FF01309107 +:103CB00000022617370748F06115710539F4209185 +:103CC000E8002E772093E80001C0B901FC0120E054 +:103CD0006115710591F18091F801882309F440C0C4 +:103CE000853009F43FC08091E80083FD3DC080919C +:103CF000E80082FD2FC08091E80080FFE9CF20918D +:103D0000F3008091F20090E0922B6115710559F05B +:103D10008830910540F424912093F1003196615050 +:103D200071090196F2CF21E0089709F020E0809117 +:103D3000E8008E778093E800CBCF2111CCCF0AC06A +:103D40008091F801882361F0853061F08091E8006E +:103D500083FD0AC08091E80082FFF2CF80E00895E1 +:103D600082E0089583E0089581E00895982F9730C8 +:103D700058F59093E900981739F07091EC00209174 +:103D8000ED005091F00003C0242F762F50E021FF6A +:103D900019C03091EB003E7F3093EB003091ED0085 +:103DA0003D7F3093ED003091EB0031603093EB00BC +:103DB0007093EC002093ED005093F0002091EE0002 +:103DC00027FF07C09F5FD3CF8F708093E90081E00A +:103DD000089580E008958091F90187FF11C08091D6 +:103DE000E80082FD05C08091F8018111F8CF11C073 +:103DF0008091E8008B770BC08091F801882349F00F +:103E00008091E80080FFF8CF8091E8008E77809362 +:103E1000E80008952091E4003091E50095E6409196 +:103E2000EC00842F817040FF22C08091E80080FD6B +:103E30001CC08091F801882391F0853091F0809129 +:103E4000EB0085FD10C04091E4005091E500421761 +:103E5000530729F39A01915011F784E0089582E005 +:103E6000089583E0089581E0089580E008954091E9 +:103E7000E80042FFDECF08950E94AA1F0E94B21FF1 +:103E8000E0EEF0E0808181608083E8EDF0E0808109 +:103E90008F77808319BCA7EDB0E08C918E7F8C93D7 +:103EA00080818F7E80831092F70108950F931F9376 +:103EB000CF93DF930E94AA1F0E94B21FC8EDD0E0EB +:103EC00088818F77888388818068888388818F7DC7 +:103ED000888319BC1092F8011092F4011092F60137 +:103EE0001092F50100EE10E0F80180818B7F808355 +:103EF00088818160888342E060E080E00E94B61E95 +:103F0000E1EEF0E080818E7F8083E2EEF0E0808160 +:103F100081608083808188608083F80180818E7FCA +:103F20008083888180618883DF91CF911F910F9179 +:103F30000895E8EDF0E080818F7E8083E7EDF0E08A +:103F400080818160808384E082BF81E08093F7017B +:103F50000C94561FE8EDF0E080818E7F80831092F4 +:103F6000E20008951092DA001092E10008951F9285 +:103F70000F920FB60F9211242F933F934F935F939D +:103F80006F937F938F939F93AF93BF93EF93FF9321 +:103F90008091E10082FF0BC08091E20082FF07C0A8 +:103FA0008091E1008B7F8093E1000E941E2280912E +:103FB000DA0080FF1FC08091D80080FF1BC0809175 +:103FC000DA008E7F8093DA008091D90080FF0DC0E7 +:103FD00080E189BD82E189BD09B400FEFDCF81E0A9 +:103FE0008093F8010E941A1C05C019BC1092F801B8 +:103FF0000E94281C8091E10080FF19C08091E2009E +:1040000080FF15C08091E2008E7F8093E200809156 +:10401000E20080618093E2008091D800806280930A +:10402000D80019BC85E08093F8010E942C1C809177 +:10403000E10084FF30C08091E20084FF2CC080E169 +:1040400089BD82E189BD09B400FEFDCF8091D80011 +:104050008F7D8093D8008091E1008F7E8093E10076 +:104060008091E2008F7E8093E2008091E200816087 +:104070008093E2008091F401882311F084E007C06E +:104080008091E30087FD02C081E001C083E080935E +:10409000F8010E942E1C8091E10083FF29C08091CD +:1040A000E20083FF25C08091E100877F8093E100DB +:1040B00082E08093F8011092F4018091E1008E7FFC +:1040C0008093E1008091E2008E7F8093E2008091F6 +:1040D000E20080618093E20042E060E080E00E94C4 +:1040E000B61E8091F00088608093F0000E942B1C27 +:1040F000FF91EF91BF91AF919F918F917F916F91C0 +:104100005F914F913F912F910F900FBE0F901F9095 +:1041100018951F920F920FB60F9211242F933F9371 +:104120004F935F936F937F938F939F93AF93BF93BF +:10413000CF93DF93EF93FF93C091E900CF7080910D +:10414000EC00D82FD17080FDD0E81092E90080916A +:10415000F000877F8093F00078940E94CD20109229 +:10416000E9008091F00088608093F000CD2BCF7043 +:10417000C093E900FF91EF91DF91CF91BF91AF9193 +:104180009F918F917F916F915F914F913F912F916F +:104190000F900FBE0F901F9018951F93CF93DF9332 +:1041A000CDB7DEB7AA970FB6F894DEBF0FBECDBF6E +:1041B000E9EFF1E088E08E0F9091F10091938E137A +:1041C000FBCF0E944A1C8091E80083FF1FC18091B1 +:1041D000F9019091FA01492F50E04A30510508F059 +:1041E00015C1FA01E558FF4F0C947F23803881F008 +:1041F000823809F00BC18091FD018F708093E90036 +:104200008091EB0085FB882780F91092E90006C0B9 +:104210008091F5019091F601911182609091E800F2 +:10422000977F9093E8008093F1001092F100C8C04E +:10423000282F2D7F09F0EAC0882319F0823061F021 +:10424000E5C08091FB01813009F0E0C0933009F0B6 +:1042500080E08093F6012BC08091FB01811127C083 +:104260008091FD018F7009F4D1C08093E900209105 +:10427000EB0020FF1CC0933021F48091EB008062A2 +:1042800014C09091EB0090619093EB0021E030E03E +:10429000A90102C0440F551F8A95E2F74093EA0036 +:1042A0001092EA008091EB0088608093EB001092FE +:1042B000E9008091E800877F86C08111A7C0109136 +:1042C000FB011F778091E3008078812B8093E300CE +:1042D0008091E800877F8093E8000E94EB1E809128 +:1042E000E80080FFFCCF8091E30080688093E300CA +:1042F000111102C082E001C083E08093F80186C002 +:104300008058823008F082C08091FB019091FC01BE +:104310008C3D53E0950779F583E08A838AE28983AF +:104320004FB7F894DE01139620E03EE051E2E32F10 +:10433000F0E050935700E49120FF03C0E295EF7046 +:104340003F5FEF708E2F90E0EA3010F0C79601C00B +:10435000C0968D939D932F5F243149F74FBF809175 +:10436000E800877F8093E8006AE270E0CE01019662 +:104370000E94F21D14C0AE014F5F5F4F6091FD01BE +:104380000E94391DBC01892B09F440C09091E800BE +:10439000977F9093E80089819A810E94551E8091B1 +:1043A000E8008B778093E80031C0803879F5809100 +:1043B000E800877F8093E8008091F4018093F1000A +:1043C0008091E8008E778093E8000E94EB1E1EC06B +:1043D00081111CC09091FB019230C0F48091E800E3 +:1043E000877F8093E8009093F4010E94EB1E8091F8 +:1043F000F401811106C08091E30087FD02C081E0D5 +:1044000001C084E08093F8010E94361C8091E8008E +:1044100083FF0AC08091E800877F8093E800809145 +:10442000EB0080628093EB00AA960FB6F894DEBF93 +:104430000FBECDBFDF91CF911F9108950895CF9307 +:104440008091F8018823A1F0C091E900CF7090918C +:10445000EC00892F817090FD80E8C82B1092E90054 +:104460008091E80083FD0E94CD20CF70C093E900C9 +:10447000CF9108950E9441226894B1110C94D022EA +:1044800008950E94B52288F09F5798F0B92F992778 +:10449000B751B0F0E1F0660F771F881F991F1AF02F +:1044A000BA95C9F714C0B13091F00E94CF22B1E0A3 +:1044B00008950C94CF22672F782F8827B85F39F0A2 +:1044C000B93FCCF3869577956795B395D9F73EF4C8 +:1044D00090958095709561957F4F8F4F9F4F089570 +:1044E000E89409C097FB3EF490958095709561958E +:1044F0007F4F8F4F9F4F9923A9F0F92F96E9BB2744 +:104500009395F695879577956795B795F111F8CFBF +:10451000FAF4BB0F11F460FF1BC06F5F7F4F8F4F2A +:104520009F4F16C0882311F096E911C0772321F020 +:104530009EE8872F762F05C0662371F096E8862FB8 +:1045400070E060E02AF09A95660F771F881FDAF70F +:10455000880F9695879597F9089557FD9058440FC1 +:10456000551F59F05F3F71F04795880F97FB991FD2 +:1045700061F09F3F79F0879508951216130614068F +:10458000551FF2CF4695F1DF08C01616170618061C +:10459000991FF1CF86957105610508940895E894F7 +:1045A000BB2766277727CB0197F908950E94E92258 +:1045B0000C945A230E944C2338F00E94532320F07D +:1045C000952311F00C9443230C94492311240C944B +:1045D000D0220E94AD2270F3959FC1F3950F50E059 +:1045E000551F629FF001729FBB27F00DB11D639FA5 +:1045F000AA27F00DB11DAA1F649F6627B00DA11D4B +:10460000661F829F2227B00DA11D621F739FB00DF0 +:10461000A11D621F839FA00D611D221F749F332760 +:10462000A00D611D231F849F600D211D822F762FF9 +:104630006A2F11249F5750409AF0F1F088234AF0D6 +:10464000EE0FFF1FBB1F661F771F881F9150504042 +:10465000A9F79E3F510580F00C9443230C94D0227F +:104660005F3FE4F3983ED4F3869577956795B795C9 +:10467000F795E7959F5FC1F7FE2B880F911D9695E3 +:10468000879597F9089597F99F6780E870E060E053 +:1046900008959FEF80EC089500240A9416161706DB +:1046A00018060906089500240A9412161306140623 +:1046B00005060895092E0394000C11F4882352F086 +:1046C000BB0F40F4BF2B11F460FF04C06F5F7F4F3E +:1046D0008F4F9F4F089597FB072E16F4009407D035 +:1046E00077FD09D00E94852307FC05D03EF4909504 +:1046F00081959F4F0895709561957F4F0895EE0FB6 +:10470000FF1F0590F491E02D0994AA1BBB1B51E1FA +:1047100007C0AA1FBB1FA617B70710F0A61BB70B31 +:10472000881F991F5A95A9F780959095BC01CD01D6 +:104730000895F999FECF92BD81BDF89A992780B569 +:104740000895A8E1B0E042E050E00C94C023262F89 +:10475000F999FECF92BD81BDF89A019700B4021677 +:1047600031F020BD0FB6F894FA9AF99A0FBE089569 +:104770000196272F0E94A8230C94A723DC01CB01CC +:10478000FC01F999FECF06C0F2BDE1BDF89A319661 +:1047900000B40D9241505040B8F70895F894FFCFFF +:1047A000052001BA0128080A03140A3B1BC91BA6ED +:1047B0001B721B3E1B0101020304050607080900CA +:1047C000404D363966051905E304AA043D04560434 +:0447D0006F048804E6 +:00000001FF -- cgit v1.2.3-24-g4f1b From a675c1aee028f5ba67b0c64df0fd24e51a92e288 Mon Sep 17 00:00:00 2001 From: Depariel Date: Sun, 31 Jul 2016 23:12:16 -0400 Subject: added support for Infinity 1.1a (4th drop) matrix, no LED support yet --- keyboards/infinity_chibios/config.h | 4 ++- keyboards/infinity_chibios/matrix.c | 51 ++++++++++++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 5 deletions(-) diff --git a/keyboards/infinity_chibios/config.h b/keyboards/infinity_chibios/config.h index bd4becfc5..452cc2a9f 100644 --- a/keyboards/infinity_chibios/config.h +++ b/keyboards/infinity_chibios/config.h @@ -52,8 +52,10 @@ along with this program. If not, see . ) /* Keymap for Infinity prototype */ -#define INFINITY_PROTOTYPE +//#define INFINITY_PROTOTYPE +/* Keymap for Infinity 1.1a (first revision with LED support) */ +//#define INFINITY_LED /* * Feature disable options diff --git a/keyboards/infinity_chibios/matrix.c b/keyboards/infinity_chibios/matrix.c index 2c68ea83a..62c165aa5 100644 --- a/keyboards/infinity_chibios/matrix.c +++ b/keyboards/infinity_chibios/matrix.c @@ -12,9 +12,12 @@ * Infinity Pinusage: * Column pins are input with internal pull-down. Row pins are output and strobe with high. * Key is high or 1 when it turns on. - * + * INFINITY PRODUCTION (NO LED) * col: { PTD1, PTD2, PTD3, PTD4, PTD5, PTD6, PTD7 } * row: { PTB0, PTB1, PTB2, PTB3, PTB16, PTB17, PTC4, PTC5, PTD0 } + * INFINITY PRODUCTION (WITH LED) + * col: { PTD1, PTD2, PTD3, PTD4, PTD5, PTD6, PTD7 } + * row: { PTC0, PTC1, PTC2, PTC3, PTC4, PTC5, PTC6, PTC7, PTD0 } */ /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -34,6 +37,18 @@ void matrix_init(void) palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN); palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN); +#ifdef INFINITY_LED + /* Row(strobe) */ + palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 3, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 4, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 5, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 6, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 7, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); +#else /* Row(strobe) */ palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); @@ -44,7 +59,7 @@ void matrix_init(void) palSetPadMode(GPIOC, 4, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOC, 5, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL); - +#endif memset(matrix, 0, MATRIX_ROWS); memset(matrix_debouncing, 0, MATRIX_ROWS); } @@ -53,7 +68,20 @@ uint8_t matrix_scan(void) { for (int row = 0; row < MATRIX_ROWS; row++) { matrix_row_t data = 0; - + #ifdef INFINITY_LED + // strobe row + switch (row) { + case 0: palSetPad(GPIOC, 0); break; + case 1: palSetPad(GPIOC, 1); break; + case 2: palSetPad(GPIOC, 2); break; + case 3: palSetPad(GPIOC, 3); break; + case 4: palSetPad(GPIOC, 4); break; + case 5: palSetPad(GPIOC, 5); break; + case 6: palSetPad(GPIOC, 6); break; + case 7: palSetPad(GPIOC, 7); break; + case 8: palSetPad(GPIOD, 0); break; + } + #else // strobe row switch (row) { case 0: palSetPad(GPIOB, 0); break; @@ -66,12 +94,26 @@ uint8_t matrix_scan(void) case 7: palSetPad(GPIOC, 5); break; case 8: palSetPad(GPIOD, 0); break; } + #endif wait_us(1); // need wait to settle pin state // read col data data = (palReadPort(GPIOD)>>1); - + #ifdef INFINITY_LED + // un-strobe row + switch (row) { + case 0: palClearPad(GPIOC, 0); break; + case 1: palClearPad(GPIOC, 1); break; + case 2: palClearPad(GPIOC, 2); break; + case 3: palClearPad(GPIOC, 3); break; + case 4: palClearPad(GPIOC, 4); break; + case 5: palClearPad(GPIOC, 5); break; + case 6: palClearPad(GPIOC, 6); break; + case 7: palClearPad(GPIOC, 7); break; + case 8: palClearPad(GPIOD, 0); break; + } + #else // un-strobe row switch (row) { case 0: palClearPad(GPIOB, 0); break; @@ -84,6 +126,7 @@ uint8_t matrix_scan(void) case 7: palClearPad(GPIOC, 5); break; case 8: palClearPad(GPIOD, 0); break; } + #endif if (matrix_debouncing[row] != data) { matrix_debouncing[row] = data; -- cgit v1.2.3-24-g4f1b From f422f442cf10b500f5b0b5509d932d72bfcf7f6e Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 1 Aug 2016 14:51:26 -0400 Subject: automatically forward ergodox ez --- util/ergodox_ez.html | 1 + util/travis_compiled_push.sh | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 util/ergodox_ez.html diff --git a/util/ergodox_ez.html b/util/ergodox_ez.html new file mode 100644 index 000000000..8e9286607 --- /dev/null +++ b/util/ergodox_ez.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh index 01317f4be..dadcbc48f 100644 --- a/util/travis_compiled_push.sh +++ b/util/travis_compiled_push.sh @@ -15,6 +15,8 @@ git submodule update --init --recursive rm -rf keyboard rm -rf keyboards cp -r ../qmk_firmware/keyboards . +mk keyboards/ergodox_ez/ +cp ../qmk_firmware/util/ergodox_ex.html keyboards/ergodox_ez/index.html cp ../qmk_firmware/readme.md qmk_readme.md ./generate.sh -- cgit v1.2.3-24-g4f1b From 56aa51664e69af93ca3c1f59c760853a24548145 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Mon, 1 Aug 2016 21:15:01 -0400 Subject: Updates ErgoDox readme --- keyboards/ergodox/readme.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md index 9afa47410..f81d7cd8d 100644 --- a/keyboards/ergodox/readme.md +++ b/keyboards/ergodox/readme.md @@ -2,24 +2,21 @@ There are two main ways you could customize the ErgoDox (EZ and Infinity) -## The Easy Way: Use an existing firmware file and just flash it - -This does not work for Infinity ErgoDox yet, you need to compile the firmware according to the instructions below +## The Easy Way: Use an existing firmware file and just flash it (ErgoDox EZ only) 1. Download and install the [Teensy Loader](https://www.pjrc.com/teensy/loader.html). Some Linux distributions already provide a binary (may be called `teensy-loader-cli`), so you may prefer to use this. -2. Find a firmware file you like. You can find a few of these in the keymaps subdirectory right here. The file you need ends with .hex, and you can look at its .c counterpart (or its PNG image) to see what you'll be getting. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. +2. Find a firmware file you like. There are [dozens of community-contributed keymaps](http://qmk.fm/keyboards/ergodox/) you can browse and download. You can also use the [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) to create a firmware Hex file you like. 3. Download the firmware file 4. Connect the keyboard, press its Reset button (gently insert a paperclip into the hole in the top-right corner) and flash it using the Teensy loader you installed on step 1 and the firmware you downloaded. ## More technical: compile an existing keymap, or create your own totally custom firmware by editing the source files. -This requires a little bit of familiarity with coding. +This requires a little bit of familiarity with coding. If you are just compiling an existing keymap and don't want to create your own, you can skip step 4, 5 and 8. 1. Go to https://github.com/jackhumbert/qmk_firmware and read the readme at the base of this repository, top to bottom. Then come back here :) 2. Clone the repository (download it) -3. Set up a build environment as per [the build guide](/doc/BUILD_GUIDE.md) - - Using a Mac and have homebrew? just run `brew tap osx-cross/avr && brew install avr-libc` +3. Set up a build environment as per the readme. 4. Copy `keyboards/ergodox/keymaps/default/keymap.c` into `keymaps/your_name/keymap.c` (for example, `keymaps/german/keymap.c`) 5. Edit this file, changing keycodes to your liking (see "Finding the keycodes you need" below). Try to edit the comments as well, so the "text graphics" represent your layout correctly. See below for more tips on sharing your work. 6. Compile your firmware by running `make keymap=keymap_name`. For example, `make keymap=german`. This will result in a hex file, which will be called `ergodox_ez_keymap_name.hex`, e.g. `ergodox_ez_german.hex`. For **Infinity ErgoDox** you need to add `subproject=infinity` to the make command. @@ -32,12 +29,12 @@ Good luck! :) ## Contributing your keymap -The ErgoDox firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed almost 20 user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox. To make it easy for these people to use your layout, I recommend submitting your PR in the following format. +The QMK firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed dozens of user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox. To make it easy for these people to use your layout, I recommend submitting your PR in the following format. 1. All work goes inside your keymap subdirectory (`keymaps/german` in this example). 2. `keymap.c` - this is your actual keymap file; please update the ASCII comments in the file so they correspond with what you did. 3. `readme.md` - a readme file, which GitHub would display by default when people go to your directory. Explain what's different about your keymap, what you tweaked or how it works. No specific format to follow, just communicate what you did. :) -4. Any graphics you wish to add. This is absolutely not a must. If you feel like it, you can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to make something and grab a screenshot, but it's really not a must. If you do have graphics, your readme can just embed the graphic as a link, just like I did with the default layout. +4. Any graphics you wish to add. This is absolutely not a must. If you feel like it, you can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to make something and grab a screenshot, but it's really not a must. If you do have graphics, your readme can just embed the graphic as a link, just like I did with the default layout. ## Finding the keycodes you need -- cgit v1.2.3-24-g4f1b From 25f138c0d321effdb7dbef8a297b7090dffb90dc Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 1 Aug 2016 22:59:25 -0400 Subject: fix mkdir cmd --- util/travis_compiled_push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh index dadcbc48f..ddc364cc6 100644 --- a/util/travis_compiled_push.sh +++ b/util/travis_compiled_push.sh @@ -15,7 +15,7 @@ git submodule update --init --recursive rm -rf keyboard rm -rf keyboards cp -r ../qmk_firmware/keyboards . -mk keyboards/ergodox_ez/ +mkdir keyboards/ergodox_ez/ cp ../qmk_firmware/util/ergodox_ex.html keyboards/ergodox_ez/index.html cp ../qmk_firmware/readme.md qmk_readme.md ./generate.sh -- cgit v1.2.3-24-g4f1b From 461f973c2b92c05e746a37712fdfbabe82eafa4b Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 1 Aug 2016 23:46:50 -0400 Subject: correct file name --- util/travis_compiled_push.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh index ddc364cc6..27ab3cec6 100644 --- a/util/travis_compiled_push.sh +++ b/util/travis_compiled_push.sh @@ -16,7 +16,7 @@ rm -rf keyboard rm -rf keyboards cp -r ../qmk_firmware/keyboards . mkdir keyboards/ergodox_ez/ -cp ../qmk_firmware/util/ergodox_ex.html keyboards/ergodox_ez/index.html +cp ../qmk_firmware/util/ergodox_ez.html keyboards/ergodox_ez/index.html cp ../qmk_firmware/readme.md qmk_readme.md ./generate.sh -- cgit v1.2.3-24-g4f1b From c70b276b1b29e31945a5a03f560961d8a008176d Mon Sep 17 00:00:00 2001 From: kuel Date: Tue, 2 Aug 2016 14:09:01 -0500 Subject: Add keymap_cyrillic.h, lots of cyrillic characters --- quantum/keymap_extras/keymap_cyrillic.h | 161 ++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 quantum/keymap_extras/keymap_cyrillic.h diff --git a/quantum/keymap_extras/keymap_cyrillic.h b/quantum/keymap_extras/keymap_cyrillic.h new file mode 100644 index 000000000..d5390afff --- /dev/null +++ b/quantum/keymap_extras/keymap_cyrillic.h @@ -0,0 +1,161 @@ +#ifndef KEYMAP_CYRILLIC_H +#define KEYMAP_CYRILLIC_H + +#include "keymap.h" + +/* + * This is based off of + * https://en.wikipedia.org/wiki/Cyrillic_script + */ + +// Capital Char russian/ukrainian/bulgarian +#define CY_A UC(0x0410) // Ð rus ukr bul +#define CY_BE UC(0x0411) // Б rus ukr bul +#define CY_VE UC(0x0412) // Ð’ rus ukr bul +#define CY_GHE UC(0x0413) // Г rus ukr bul +#define CY_GHEUP UC(0x0490) // Ò ukr +#define CY_DE UC(0x0414) // Д rus ukr bul +#define CY_DJE UC(0x0402) // Ђ +#define CY_GJE UC(0x0403) // Ѓ +#define CY_IE UC(0x0415) // Е rus ukr bul +#define CY_IO UC(0x0401) // Ð rus +#define CY_UIE UC(0x0404) // Є ukr +#define CY_ZHE UC(0x0416) // Ж rus ukr bul +#define CY_ZE UC(0x0417) // З rus ukr bul +#define CY_DZE UC(0x0405) // Ð… +#define CY_I UC(0x0418) // И rus ukr bul +#define CY_B_U_I UC(0x0406) // І ukr +#define CY_YI UC(0x0407) // Ї ukr +#define CY_SRT_I UC(0x0419) // Й rus ukr bul +#define CY_JE UC(0x0408) // Ј +#define CY_KA UC(0x041a) // К rus ukr bul +#define CY_EL UC(0x041b) // Л rus ukr bul +#define CY_LJE UC(0x0409) // Љ +#define CY_EM UC(0x041c) // Ðœ rus ukr bul +#define CY_EN UC(0x041d) // Ð rus ukr bul +#define CY_NJE UC(0x040a) // Њ +#define CY_O UC(0x041e) // О rus ukr bul +#define CY_PE UC(0x041f) // П rus ukr bul +#define CY_ER UC(0x0420) // Р rus ukr bul +#define CY_ES UC(0x0421) // С rus ukr bul +#define CY_TE UC(0x0422) // Т rus ukr bul +#define CY_TSHE UC(0x040b) // Ћ +#define CY_KJE UC(0x040c) // ÐŒ +#define CY_U UC(0x0423) // У rus ukr bul +#define CY_SRT_U UC(0x040e) // ÐŽ +#define CY_EF UC(0x0424) // Ф rus ukr bul +#define CY_HA UC(0x0425) // Ð¥ rus bul +#define CY_TSE UC(0x0426) // Ц rus ukr bul +#define CY_CHE UC(0x0427) // Ч rus ukr bul +#define CY_DZHE UC(0x040f) // Ð +#define CY_SHA UC(0x0428) // Ш rus ukr bul +#define CY_SHCHA UC(0x0429) // Щ rus ukr bul +#define CY_HSIGN UC(0x042a) // Ъ rus bul +#define CY_YERU UC(0x042b) // Ы rus +#define CY_SSIGN UC(0x042c) // Ь rus ukr bul +#define CY_E UC(0x042d) // Э rus +#define CY_YU UC(0x042e) // Ю rus ukr bul +#define CY_YA UC(0x042f) // Я rus ukr bul +// Important Cyrillic non-Slavic letters +#define CY_PALOCHKA UC(0x04c0) // Ó€ +#define CY_SCHWA UC(0x04d8) // Ó˜ +#define CY_GHE_S UC(0x0492) // Ò’ +#define CY_ZE_D UC(0x0498) // Ò˜ +#define CY_ES_D UC(0x04aa) // Òª +#define CY_BR_KA UC(0x04a0) // Ò  +#define CY_ZHE_D UC(0x0496) // Ò– +#define CY_KA_D UC(0x049a) // Òš +#define CY_EN_D UC(0x04a2) // Ò¢ +#define CY_ENGHE UC(0x04a4) // Ò¤ +#define CY_BRD_O UC(0x04e8) // Ó¨ +#define CY_STR_U UC(0x04ae) // Ò® +#define CY_S_U_S UC(0x04b0) // Ò° +#define CY_SHHA UC(0x04ba) // Òº +#define CY_HA_D UC(0x04b2) // Ò² + + +// Small +#define CY_a UC(0x0430) // a rus ukr bul +#define CY_be UC(0x0431) // б rus ukr bul +#define CY_ve UC(0x0432) // в rus ukr bul +#define CY_ghe UC(0x0433) // г rus ukr bul +#define CY_gheup UC(0x0491) // Ò‘ ukr +#define CY_de UC(0x0434) // д rus ukr bul +#define CY_dje UC(0x0452) // Ñ’ +#define CY_gje UC(0x0453) // Ñ“ +#define CY_ie UC(0x0435) // е rus ukr bul +#define CY_io UC(0x0451) // Ñ‘ rus +#define CY_uie UC(0x0454) // Ñ” ukr +#define CY_zhe UC(0x0436) // ж rus ukr bul +#define CY_ze UC(0x0437) // з rus ukr bul +#define CY_dze UC(0x0455) // Ñ• +#define CY_i UC(0x0438) // и rus ukr bul +#define CY_b_u_i UC(0x0456) // Ñ– ukr +#define CY_yi UC(0x0457) // Ñ— ukr +#define CY_srt_i UC(0x0439) // й rus ukr bul +#define CY_je UC(0x0458) // ј +#define CY_ka UC(0x043a) // к rus ukr bul +#define CY_el UC(0x043b) // л rus ukr bul +#define CY_lje UC(0x0459) // Ñ™ +#define CY_em UC(0x043c) // м rus ukr bul +#define CY_en UC(0x043d) // н rus ukr bul +#define CY_nje UC(0x045a) // Ñš +#define CY_o UC(0x043e) // о rus ukr bul +#define CY_pe UC(0x043f) // п rus ukr bul +#define CY_er UC(0x0440) // Ñ€ rus ukr bul +#define CY_es UC(0x0441) // Ñ rus ukr bul +#define CY_te UC(0x0442) // Ñ‚ rus ukr bul +#define CY_tshe UC(0x045b) // Ñ› +#define CY_kje UC(0x045c) // Ñœ +#define CY_u UC(0x0443) // у rus ukr bul +#define CY_srt_u UC(0x045e) // Ñž +#define CY_ef UC(0x0444) // Ñ„ rus ukr bul +#define CY_ha UC(0x0445) // Ñ… rus ukr bul +#define CY_tse UC(0x0446) // ц rus ukr bul +#define CY_che UC(0x0447) // ч rus ukr bul +#define CY_dzhe UC(0x045f) // ÑŸ +#define CY_sha UC(0x0448) // ш rus ukr bul +#define CY_shcha UC(0x0449) // щ rus ukr bul +#define CY_hsign UC(0x044a) // ÑŠ rus bul +#define CY_yeru UC(0x044b) // Ñ‹ rus +#define CY_ssign UC(0x044c) // ÑŒ rus ukr bul +#define CY_e UC(0x044d) // Ñ rus +#define CY_yu UC(0x044e) // ÑŽ rus ukr bul +#define CY_ya UC(0x044f) // Ñ rus ukr bul +// Important Cyrillic non-Slavic letters +#define CY_palochka UC(0x04cf) // Ó +#define CY_schwa UC(0x04d9) // Ó™ +#define CY_ghe_s UC(0x0493) // Ò“ +#define CY_ze_d UC(0x0499) // Ò™ +#define CY_es_d UC(0x04ab) // Ò« +#define CY_br_ka UC(0x04a1) // Ò¡ +#define CY_zhe_d UC(0x0497) // Ò— +#define CY_ka_d UC(0x049b) // Ò› +#define CY_en_d UC(0x04a3) // Ò£ +#define CY_enghe UC(0x04a5) // Ò¥ +#define CY_brd_o UC(0x04e9) // Ó© +#define CY_str_u UC(0x04af) // Ò¯ +#define CY_s_u_s UC(0x04b1) // Ò± +#define CY_shha UC(0x04bb) // Ò» +#define CY_ha_d UC(0x04b3) // Ò³ + + +// Extra +#define CY_slr_ve UC(0x1c80) // á²€ CYRILLIC SMALL LETTER ROUNDED VE +#define CY_ll_de UC(0x1c81) // á² CYRILLIC SMALL LETTER LONG-LEGGED DE +#define CY_ZEMLYA UC(0xa640) // Ꙁ CYRILLIC CAPITAL LETTER ZEMLYA +#define CY_zemlya UC(0xa641) // ê™ CYRILLIC SMALL LETTER ZEMLYA +#define CY_RV_DZE UC(0xa644) // Ꙅ CYRILLIC CAPITAL LETTER REVERSED DZE +#define CY_rv_DZE UC(0xa645) // ê™… CYRILLIC SMALL LETTER REVERSED DZE +#define CY_slw_es UC(0x1c83) // ᲃ CYRILLIC SMALL LETTER WIDE ES +#define CY_st_te UC(0x1c84) // ᲄ CYRILLIC SMALL LETTER TALL TE +#define CY_3l_te UC(0x1c85) // á²… CYRILLIC SMALL LETTER THREE-LEGGED TE +#define CY_thsign UC(0x1c86) // ᲆ CYRILLIC SMALL LETTER TALL HARD SIGN +#define CY_YERUBY UC(0xa650) // ê™ CYRILLIC CAPITAL LETTER YERU WITH BACK YER +#define CY_yeruby UC(0xa651) // ꙑ CYRILLIC SMALL LETTER YERU WITH BACK YER +#define CY_RUBLE UC(0x20bd) // ₽ +#define CY_NUMERO UC(0x2116) // â„– + +// The letters Zje and Sje are made for other letters and accent marks + +#endif -- cgit v1.2.3-24-g4f1b From abc3cd4d72ebd7627ebb78a78ad88827fbe4d5f9 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sun, 31 Jul 2016 03:04:37 -0700 Subject: Update readme.md --- keyboards/planck/keymaps/jeebak/readme.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index eb8104379..25fbc5e67 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -7,7 +7,7 @@ the exact changes. The diagrams in this README shows the highlights of the changes from the default mappings. I also decided to change all calls to `persistant_default_layer_set()` to -`update_tri_layer()` since this is my personal perference. +`default_layer_set()` since this is my personal perference. ## Base Layers (Qwerty/Colemak/Dvorak) These base layers are mostly the same as the default mappings. The interesting @@ -69,11 +69,12 @@ keys at the far left are for quick access to beginning and end of line in vim. as the modifier, with the `IJKL` home row keys representing the inverted-T of the arrow keys. All of the default TouchCursor keymappings for the right hand are represented below. My personalizations include all of the keys shown for -the left hand. Having the `Alt` and `Shift` keys readily accessible from the -home row allows quick word jumps and highlighting when used in conjunction with -the arrow keys. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and -`KC_AGAIN` keycodes have been mapped but they don't seem to work on Mac. -Presumably they'll work under Windows. +the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key +from the base layers) readily accessible from the home row allows quick word +jumps and highlighting when used in conjunction with the arrow keys. The +`KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` keycodes have +been mapped but they don't seem to work on Mac. Presumably they'll work under +Windows. ``` ,-----------------------------------------------------------------------------------. | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | -- cgit v1.2.3-24-g4f1b From fdd89e7f0d50f619e8608a4448449a3a627f1da1 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sun, 31 Jul 2016 17:16:25 -0700 Subject: Add Alt-Tab, Cmd-Tab, and Ctl-Tab Macros to TouchCursor layer, swap LGUI and LSFT --- keyboards/planck/keymaps/jeebak/keymap.c | 35 +++++++++++++++++++++++++++---- keyboards/planck/keymaps/jeebak/readme.md | 16 ++++++++++---- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index ec142ecbb..ef4de074f 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -24,6 +24,7 @@ extern keymap_config_t keymap_config; #define _MOUSE 7 #define _ADJUST 16 +// Keycodes enum planck_keycodes { QWERTY = SAFE_RANGE, COLEMAK, @@ -35,16 +36,25 @@ enum planck_keycodes { EXT_PLV }; +enum macro_keycodes { + KC_ALT_TAB, + KC_CMD_TAB, + KC_CTL_TAB, +}; + // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor -// ^-- Requires KC_TRNS / _______ for the trigger key in the destination layer #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor. #define LT_ML LT(_MOUSE, KC_A) // L-ayer T-ap M-ouse C-ursor (on A) +#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab +#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab +#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -140,7 +150,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations * ,-----------------------------------------------------------------------------------. - * | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | + * |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | * |------+------+------+------+------+-------------+------+------+------+------+------| * | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | * |------+------+------+------+------+------|------+------+------+------+------+------| @@ -154,7 +164,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_TOUCHCURSOR] = { - {_______, _______, _______, KC_LSFT, KC_LGUI, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, + {ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, {_______, KC_LALT, KC_SPC, _______, KC_FIND,KC_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, {_______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} @@ -330,6 +340,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch (id) { + case KC_ALT_TAB: + return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); + case KC_CMD_TAB: + return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); + case KC_CTL_TAB: + return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); + } + + return MACRO_NONE; +} + void matrix_init_user(void) { #ifdef AUDIO_ENABLE startup_user(); diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index 25fbc5e67..f7daf53d8 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -9,6 +9,11 @@ changes from the default mappings. I also decided to change all calls to `persistant_default_layer_set()` to `default_layer_set()` since this is my personal perference. +## Macros +``` +#define ALT_TAB M(KC_ALT_TAB) +``` + ## Base Layers (Qwerty/Colemak/Dvorak) These base layers are mostly the same as the default mappings. The interesting changes are shown below. The `Ctrl/Esc`, mapped using `CTL_T(KC_ESC)` will emit @@ -72,12 +77,15 @@ are represented below. My personalizations include all of the keys shown for the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key from the base layers) readily accessible from the home row allows quick word jumps and highlighting when used in conjunction with the arrow keys. The -`KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` keycodes have -been mapped but they don't seem to work on Mac. Presumably they'll work under -Windows. +`AltTab` macro is not only useful under Windows, but also under Mac when used +with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch). +The `CmdTab` and `CtlTab` sequences are duplicated for easy access while in +this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` +keycodes have been mapped but they don't seem to work on Mac. Presumably +they'll work under Windows. ``` ,-----------------------------------------------------------------------------------. - | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | + |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | |------+------+------+------+------+-------------+------+------+------+------+------| | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | |------+------+------+------+------+------|------+------+------+------+------+------| -- cgit v1.2.3-24-g4f1b From 16f4a3178459305fd517d23f028812620e64c18f Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Mon, 1 Aug 2016 15:28:05 -0700 Subject: Number layer tweaks --- keyboards/planck/keymaps/jeebak/keymap.c | 8 ++++---- keyboards/planck/keymaps/jeebak/readme.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index ef4de074f..e39887394 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -134,17 +134,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | | | + * | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . | \ | + * | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| * |Brite | | | | | | | Prev | Stop | Slct | Mute | * `-----------------------------------------------------------------------------------' */ [_RAISE] = { {KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DLR, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, KC_PIPE}, - {KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_DOT, KC_BSLS}, + {KC_DLR, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE}, + {KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS}, {BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE} }, diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index f7daf53d8..de2096954 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -61,9 +61,9 @@ keys at the far left are for quick access to beginning and end of line in vim. ,-----------------------------------------------------------------------------------. | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | |------+------+------+------+------+-------------+------+------+------+------+------| - | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | | | + | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | | | |------+------+------+------+------+------|------+------+------+------+------+------| - | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . | \ | + | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | |------+------+------+------+------+------+------+------+------+------+------+------| |Brite | | | | | | | Prev | Stop | Slct | Mute | `-----------------------------------------------------------------------------------' -- cgit v1.2.3-24-g4f1b From 9a4e72fa7175f0ef3b31c6a6036ac1a5010dc6c1 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Mon, 1 Aug 2016 22:02:39 -0700 Subject: Add CmdSlash to TouchCursor Layer --- keyboards/planck/keymaps/jeebak/keymap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index e39887394..0a6b9cfa0 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -40,6 +40,7 @@ enum macro_keycodes { KC_ALT_TAB, KC_CMD_TAB, KC_CTL_TAB, + KC_CMD_SLSH, }; // Fillers to make layering more clear @@ -55,6 +56,7 @@ enum macro_keycodes { #define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab #define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab #define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab +#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -166,7 +168,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_TOUCHCURSOR] = { {ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, {_______, KC_LALT, KC_SPC, _______, KC_FIND,KC_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, - {_______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______}, + {_______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, CMD_SLSH,_______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, @@ -352,6 +354,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); case KC_CTL_TAB: return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); + case KC_CMD_SLSH: + return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); } return MACRO_NONE; -- cgit v1.2.3-24-g4f1b From 7db1d7902bfb7044b899859d95846fa92bad61db Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Wed, 3 Aug 2016 20:00:54 -0700 Subject: Workaround for KC_COPY, etc. based on current AG_NORM/AG_SWAP setting --- keyboards/planck/keymaps/jeebak/keymap.c | 47 ++++++++++++++++++++++++++++--- keyboards/planck/keymaps/jeebak/readme.md | 12 ++++---- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 0a6b9cfa0..25918dc98 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -41,6 +41,12 @@ enum macro_keycodes { KC_CMD_TAB, KC_CTL_TAB, KC_CMD_SLSH, + KC_AG_FIND, + KC_AG_AGAIN, + KC_AG_UNDO, + KC_AG_CUT, + KC_AG_COPY, + KC_AG_PASTE, }; // Fillers to make layering more clear @@ -57,6 +63,12 @@ enum macro_keycodes { #define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab #define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab #define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) +#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings +#define AG_AGAIN M(KC_AG_AGAIN) +#define AG_UNDO M(KC_AG_UNDO) +#define AG_CUT M(KC_AG_CUT) +#define AG_COPY M(KC_AG_COPY) +#define AG_PASTE M(KC_AG_PASTE) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -167,8 +179,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_TOUCHCURSOR] = { {ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, - {_______, KC_LALT, KC_SPC, _______, KC_FIND,KC_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, - {_______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, CMD_SLSH,_______}, + {_______, KC_LALT, KC_SPC, _______, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, + {_______, AG_UNDO, AG_CUT, AG_COPY, AG_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, CMD_SLSH,_______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, @@ -347,15 +359,42 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { */ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. + // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in: + // quantum/quantum.c + if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { + use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. + } + switch (id) { case KC_ALT_TAB: - return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); + if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } case KC_CMD_TAB: - return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); + if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + case KC_CTL_TAB: return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); case KC_CMD_SLSH: return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); + + case KC_AG_FIND: + return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); + case KC_AG_AGAIN: + return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); + case KC_AG_UNDO: + return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); + case KC_AG_CUT: + return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); + case KC_AG_COPY: + return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); + case KC_AG_PASTE: + return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); } return MACRO_NONE; diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index de2096954..094bc2a0e 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -77,15 +77,17 @@ are represented below. My personalizations include all of the keys shown for the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key from the base layers) readily accessible from the home row allows quick word jumps and highlighting when used in conjunction with the arrow keys. The -`AltTab` macro is not only useful under Windows, but also under Mac when used +`Alt-Tab` macro is not only useful under Windows, but also under Mac when used with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch). -The `CmdTab` and `CtlTab` sequences are duplicated for easy access while in +The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` -keycodes have been mapped but they don't seem to work on Mac. Presumably -they'll work under Windows. +keycodes do not seem to work. There are macros in place that'll "automatically" +choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, +etc.) depending on which layout you've currently selected (`AG_NORM` or +`AG_SWAP`) in the `_ADJUST` layer. ``` ,-----------------------------------------------------------------------------------. - |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | + |CmdTab|AltTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | |------+------+------+------+------+-------------+------+------+------+------+------| | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | |------+------+------+------+------+------|------+------+------+------+------+------| -- cgit v1.2.3-24-g4f1b From 36abd4463fec1623e7eb590bb7960c6655cf2b70 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Thu, 4 Aug 2016 14:26:03 -0700 Subject: Revert swapp of AltTab/CmdTab in readme. Layout did not change --- keyboards/planck/keymaps/jeebak/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index 094bc2a0e..48eb23264 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -87,7 +87,7 @@ etc.) depending on which layout you've currently selected (`AG_NORM` or `AG_SWAP`) in the `_ADJUST` layer. ``` ,-----------------------------------------------------------------------------------. - |CmdTab|AltTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | + |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | |------+------+------+------+------+-------------+------+------+------+------+------| | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | |------+------+------+------+------+------|------+------+------+------+------+------| -- cgit v1.2.3-24-g4f1b From dcf672223f20412ae79eb73a58d80ccbb0bd5c31 Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 5 Aug 2016 20:53:58 +0200 Subject: enterfn / enterisctrl on hold added --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index 7af7c14bd..3ee141eb4 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------. * |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1 !! + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1 * |-----------------------------------------------------------| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return | * |-----------------------------------------------------------| @@ -107,15 +107,15 @@ enum function_id { }; const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_FUNCTION(LAUNCH), - [2] = ACTION_FUNCTION(RGBLED_TOGGLE), - [3] = ACTION_FUNCTION(RGBLED_STEP_MODE), - [4] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [5] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [6] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [7] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [8] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [9] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + [1] = ACTION_FUNCTION(LAUNCH), + [2] = ACTION_FUNCTION(RGBLED_TOGGLE), + [3] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [4] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [5] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [6] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [8] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [9] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), [10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), }; -- cgit v1.2.3-24-g4f1b From 545925fb1b92252fe0bad5a675727d52bea161ef Mon Sep 17 00:00:00 2001 From: Seth Chandler Date: Fri, 5 Aug 2016 23:19:12 -0400 Subject: remove orphaned clueboard files --- keyboards/clueboard2/Makefile | 71 --------------------------------------- keyboards/clueboard2/clueboard2.c | 63 ---------------------------------- 2 files changed, 134 deletions(-) delete mode 100644 keyboards/clueboard2/Makefile delete mode 100644 keyboards/clueboard2/clueboard2.c diff --git a/keyboards/clueboard2/Makefile b/keyboards/clueboard2/Makefile deleted file mode 100644 index e9367a90d..000000000 --- a/keyboards/clueboard2/Makefile +++ /dev/null @@ -1,71 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID - -ifndef QUANTUM_DIR - include ../../Makefile -endif diff --git a/keyboards/clueboard2/clueboard2.c b/keyboards/clueboard2/clueboard2.c deleted file mode 100644 index d78ffed9b..000000000 --- a/keyboards/clueboard2/clueboard2.c +++ /dev/null @@ -1,63 +0,0 @@ -#include "clueboard2.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); - - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< Date: Fri, 5 Aug 2016 23:31:35 -0700 Subject: Mouse layer updates - Rename to MOUSECURSOR - Use "d" key, since middle finger is stronger than pinky - Shuffle some mouse buttons around --- keyboards/planck/keymaps/jeebak/keymap.c | 32 +++++++++++++++---------------- keyboards/planck/keymaps/jeebak/readme.md | 14 +++++++------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 25918dc98..4a3cc2d56 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -21,7 +21,7 @@ extern keymap_config_t keymap_config; #define _RAISE 4 #define _PLOVER 5 #define _TOUCHCURSOR 6 -#define _MOUSE 7 +#define _MOUSECURSOR 7 #define _ADJUST 16 // Keycodes @@ -57,8 +57,8 @@ enum macro_keycodes { #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift // Requires KC_TRNS/_______ for the trigger key in the destination layer -#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor. -#define LT_ML LT(_MOUSE, KC_A) // L-ayer T-ap M-ouse C-ursor (on A) +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor #define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab #define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab #define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab @@ -76,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------------. * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| - * | Ctrl/Esc | ML/A | S | D | F | G | H | J | K | L | ; | " | + * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L | ; | " | * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| @@ -85,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {CTL_ESC, LT_ML, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {CTL_ESC, KC_A, KC_S, LT_MC(KC_D),KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, @@ -94,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| - * | Ctrl/Esc | ML/A | R | S | T | D | H | N | E | I | O | " | + * | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " | * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| @@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_COLEMAK] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {CTL_ESC, LT_ML, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {CTL_ESC, KC_A, KC_R, LT_MC(KC_S),KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, @@ -112,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------------. * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| - * | Ctrl/Esc | ML/A | O | E | U | I | D | H | T | N | S | / | + * | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / | * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| @@ -121,7 +121,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {CTL_ESC, LT_ML, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {CTL_ESC, KC_A, KC_O, LT_MC(KC_E),KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, @@ -186,20 +186,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Mouse Layer * ,-----------------------------------------------------------------------------------. - * | | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | | + * | | |ACCL0 | |ACCL1 | | |WHL_L | Up |WHL_R | BTN2 | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | | + * | |ACCL2 | BTN2 | | BTN1 | |WHL_Up| Left | Down |Right | BTN4 | BTN5 | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | | + * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_MOUSE] = { - {_______, _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_ACL2, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______}, - {_______, _______, _______, KC_BTN3, KC_BTN1, KC_BTN4, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______}, - {_______, _______, _______, _______, KC_BTN2, KC_BTN5, KC_WH_D, KC_BTN1, _______, _______, _______, _______}, +[_MOUSECURSOR] = { + {_______, _______, KC_ACL0, _______, KC_ACL1, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______}, + {_______, KC_ACL2, KC_BTN2, _______, KC_BTN1, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5}, + {_______, _______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index 48eb23264..0f2c9e26d 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -99,19 +99,19 @@ etc.) depending on which layout you've currently selected (`AG_NORM` or ## Mouse Layer The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. -The `A` key is used to activate this layer. All 16 keycodes for the mouse from -the `doc/keycode.txt` file are represented, and logically located, IMHO. The -left and right click buttons are duplicated; on the right hand side, for a -quick click here and there, and again on the left hand side for when the +The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the +mouse from the `doc/keycode.txt` file are represented, and logically located, +IMHO. The left and right click buttons are duplicated; on the right hand side, +for a quick click here and there, and again on the left hand side for when the buttons need to be held for dragging things or highlighting text, thus allowing the right hand to be free to use the up/down/left/right actions. ``` ,-----------------------------------------------------------------------------------. - | | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | | + | | |ACCL0 | |ACCL1 | | |WHL_L | Up |WHL_R | BTN2 | | |------+------+------+------+------+-------------+------+------+------+------+------| - | | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | | + | |ACCL2 | BTN2 | | BTN1 | |WHL_Up| Left | Down |Right | BTN4 | BTN5 | |------+------+------+------+------+------|------+------+------+------+------+------| - | | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | | + | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | |------+------+------+------+------+------+------+------+------+------+------+------| | | | | | | | | | | | | `-----------------------------------------------------------------------------------' -- cgit v1.2.3-24-g4f1b From 96ed96f924d7df610465b567e5127e73e99a368d Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 6 Aug 2016 00:01:12 -0700 Subject: Fix KC_ALT_TAB/KC_CMD_TAB logic --- keyboards/planck/keymaps/jeebak/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 4a3cc2d56..3b51e34e3 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -372,11 +372,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) switch (id) { case KC_ALT_TAB: - if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } - else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } - case KC_CMD_TAB: if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + case KC_CMD_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } case KC_CTL_TAB: return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); -- cgit v1.2.3-24-g4f1b From 57218827cbdb6e9510147239f69b8aa62e28cd14 Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 6 Aug 2016 00:08:42 -0700 Subject: Move KC_ACL1 button --- keyboards/planck/keymaps/jeebak/keymap.c | 8 ++++---- keyboards/planck/keymaps/jeebak/readme.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 3b51e34e3..c5761b2d1 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -186,9 +186,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Mouse Layer * ,-----------------------------------------------------------------------------------. - * | | |ACCL0 | |ACCL1 | | |WHL_L | Up |WHL_R | BTN2 | | + * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | |ACCL2 | BTN2 | | BTN1 | |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + * | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | * |------+------+------+------+------+------|------+------+------+------+------+------| * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -197,8 +197,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_MOUSECURSOR] = { - {_______, _______, KC_ACL0, _______, KC_ACL1, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______}, - {_______, KC_ACL2, KC_BTN2, _______, KC_BTN1, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5}, + {_______, _______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______}, + {_______, KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5}, {_______, _______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index 0f2c9e26d..359aacff9 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -107,9 +107,9 @@ buttons need to be held for dragging things or highlighting text, thus allowing the right hand to be free to use the up/down/left/right actions. ``` ,-----------------------------------------------------------------------------------. - | | |ACCL0 | |ACCL1 | | |WHL_L | Up |WHL_R | BTN2 | | + | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | |------+------+------+------+------+-------------+------+------+------+------+------| - | |ACCL2 | BTN2 | | BTN1 | |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | |------+------+------+------+------+------|------+------+------+------+------+------| | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | |------+------+------+------+------+------+------+------+------+------+------+------| -- cgit v1.2.3-24-g4f1b From bda4d15ffa5a7390591b2f4edb05ed568a1c708a Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 6 Aug 2016 11:59:57 -0700 Subject: Add Virtual Desktop Switching macros to TouchCursor layer --- keyboards/planck/keymaps/jeebak/keymap.c | 13 +++++++++++-- keyboards/planck/keymaps/jeebak/readme.md | 5 +++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index c5761b2d1..aa5c41593 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -47,6 +47,8 @@ enum macro_keycodes { KC_AG_CUT, KC_AG_COPY, KC_AG_PASTE, + KC_AG_DESK_L, + KC_AG_DESK_R, }; // Fillers to make layering more clear @@ -69,6 +71,8 @@ enum macro_keycodes { #define AG_CUT M(KC_AG_CUT) #define AG_COPY M(KC_AG_COPY) #define AG_PASTE M(KC_AG_PASTE) +#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and +#define AG_D_R M(KC_AG_DESK_R) // Right const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -166,7 +170,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | + * | | Alt |Space | | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R| * |------+------+------+------+------+------|------+------+------+------+------+------| * | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -179,7 +183,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_TOUCHCURSOR] = { {ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, - {_______, KC_LALT, KC_SPC, _______, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, + {_______, KC_LALT, KC_SPC, _______, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R }, {_______, AG_UNDO, AG_CUT, AG_COPY, AG_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, CMD_SLSH,_______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, @@ -395,6 +399,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); case KC_AG_PASTE: return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); + + case KC_AG_DESK_L: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); + case KC_AG_DESK_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); } return MACRO_NONE; diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index 359aacff9..28ae34f47 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -84,12 +84,13 @@ this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` keycodes do not seem to work. There are macros in place that'll "automatically" choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, etc.) depending on which layout you've currently selected (`AG_NORM` or -`AG_SWAP`) in the `_ADJUST` layer. +`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I +use to switch between Virtual Desktops Left/Right. ``` ,-----------------------------------------------------------------------------------. |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | |------+------+------+------+------+-------------+------+------+------+------+------| - | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | + | | Alt |Space | | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R| |------+------+------+------+------+------|------+------+------+------+------+------| | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | |------+------+------+------+------+------+------+------+------+------+------+------| -- cgit v1.2.3-24-g4f1b From 68e287013b42cea53a1834c141bdf2c0802da3af Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sat, 6 Aug 2016 13:36:26 -0700 Subject: Add Tab Close, New, Reopen macros to TouchCursor layer --- keyboards/planck/keymaps/jeebak/keymap.c | 21 +++++++++++++++++---- keyboards/planck/keymaps/jeebak/readme.md | 8 +++++--- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index aa5c41593..7dc8760ec 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -49,6 +49,9 @@ enum macro_keycodes { KC_AG_PASTE, KC_AG_DESK_L, KC_AG_DESK_R, + KC_AG_TAB_C, + KC_AG_TAB_N, + KC_AG_TAB_R, }; // Fillers to make layering more clear @@ -73,6 +76,9 @@ enum macro_keycodes { #define AG_PASTE M(KC_AG_PASTE) #define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and #define AG_D_R M(KC_AG_DESK_R) // Right +#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, +#define AG_T_N M(KC_AG_TAB_N) // Tab New, and +#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -170,9 +176,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | Alt |Space | | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R| + * | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R| * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | + * | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' @@ -183,8 +189,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_TOUCHCURSOR] = { {ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______}, - {_______, KC_LALT, KC_SPC, _______, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R }, - {_______, AG_UNDO, AG_CUT, AG_COPY, AG_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, CMD_SLSH,_______}, + {_______, KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R }, + {_______, AG_UNDO, AG_CUT, AG_COPY, AG_PASTE,KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R, CMD_SLSH,_______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, @@ -404,6 +410,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); case KC_AG_DESK_R: return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); + + case KC_AG_TAB_C: + return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); + case KC_AG_TAB_N: + return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); + case KC_AG_TAB_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); } return MACRO_NONE; diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index 28ae34f47..b43f8a2fb 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -85,14 +85,16 @@ keycodes do not seem to work. There are macros in place that'll "automatically" choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, etc.) depending on which layout you've currently selected (`AG_NORM` or `AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I -use to switch between Virtual Desktops Left/Right. +use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and +`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as +Google Chrome. ``` ,-----------------------------------------------------------------------------------. |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | |------+------+------+------+------+-------------+------+------+------+------+------| - | | Alt |Space | | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R| + | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L|Desk_R| |------+------+------+------+------+------|------+------+------+------+------+------| - | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | + | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | |------+------+------+------+------+------+------+------+------+------+------+------| | | | | | | | | | | | | `-----------------------------------------------------------------------------------' -- cgit v1.2.3-24-g4f1b From b5fcb5a7447424a160b86b4d2c0d2ea29ae1d813 Mon Sep 17 00:00:00 2001 From: Toni Date: Sun, 7 Aug 2016 11:37:28 +0200 Subject: new variant with the curly braces on tab layer --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 48 +++++++++++------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index 3ee141eb4..71c205a48 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -27,11 +27,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' LEFT DWN RIGHT */ [_DEF] = KEYMAP_ISO_SPLITRSHIFT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - LT(_TAB,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, CTL_T(KC_ENT), \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), SFT_T(KC_UP), \ - KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, ALT_T(KC_LEFT), GUI_T(KC_DOWN), CTL_T(KC_RIGHT)), + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + LT(_TAB,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, CTL_T(KC_ENT), \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), SFT_T(KC_UP), \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, ALT_T(KC_LEFT), GUI_T(KC_DOWN), CTL_T(KC_RIGHT)), /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) * ,-----------------------------------------------------------. @@ -39,27 +39,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * | |Paus| Up| [ | ] | | | | ( | ) | | | | | * |-----------------------------------------------------------| - * | |Lft|Dwn|Rgt| | | |Left|Down|Right|Up| | PLAY | + * | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY | * |-----------------------------------------------------------| - * | | | | | < | > | |M0 | | { | } | | Vol+ | | + * | | | | | < | > | |M0 | | | | | Vol+ | | * |-----------------------------------------------------------| * | | | | |Alt |Prev|Vol-|Next| * `-----------------------------------------------------------' */ [_SPC] = KEYMAP_ISO_SPLITRSHIFT( - KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_TRNS, KC_PAUS, KC_UP, RALT(KC_8), RALT(KC_9), KC_TRNS, KC_TRNS, LSFT(KC_8), LSFT(KC_9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NUBS, LSFT(KC_NUBS), KC_SPACE,M(0), RALT(KC_7), RALT(KC_0), KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), + KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_PAUS, KC_UP, RALT(KC_8), RALT(KC_9), KC_TRNS, KC_TRNS, LSFT(KC_8), LSFT(KC_9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NUBS, LSFT(KC_NUBS), KC_SPACE,M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) * ,-----------------------------------------------------------. * |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE * |-----------------------------------------------------------| - * | | | | | | | | | | | | | | | + * | | | | | | | | | { | } | | | | | * |-----------------------------------------------------------| - * | | | | | | | |Pos1|PgDn|PgUp|End| |Retrn | + * | | | | | | |Pos1|PgDn|PgUp|End| | |Retrn | * |-----------------------------------------------------------| * | | | | | | | |AF2| | | | | PgUp | | * |-----------------------------------------------------------| @@ -67,11 +67,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_TAB] = KEYMAP_ISO_SPLITRSHIFT( - KC_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + KC_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RALT(KC_7), RALT(KC_0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) * ,-----------------------------------------------------------. @@ -87,11 +87,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_SFX] = KEYMAP_ISO_SPLITRSHIFT( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, \ - KC_TRNS, F(2), F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ - KC_TRNS, F(4), F(5), F(6), F(7), F(8), F(9), KC_TRNS, KC_TRNS, KC_0, KC_TRNS, KC_SLSH, KC_TRNS, KC_UP, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT), + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, \ + KC_TRNS, F(2), F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ + KC_TRNS, F(4), F(5), F(6), F(7), F(8), F(9), KC_TRNS, KC_TRNS, KC_0, KC_TRNS, KC_SLSH, KC_TRNS, KC_UP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT), }; enum function_id { -- cgit v1.2.3-24-g4f1b From c5ee24a6c3ea39e9725dfc276c92d5bce726ca78 Mon Sep 17 00:00:00 2001 From: kuel Date: Sun, 7 Aug 2016 11:01:12 -0500 Subject: Add keymap_russian.h, a software implementation of Russian rename keymap_cyrillic.h to keymap_unicode_cyrillic.h changed CY_RUBLE and CY_NUMERO to CY_RUBL and CY_NMRO in keymap_unicode_cyrillic.h --- quantum/keymap_extras/keymap_cyrillic.h | 161 ----------------------- quantum/keymap_extras/keymap_russian.h | 79 ++++++++++++ quantum/keymap_extras/keymap_unicode_cyrillic.h | 163 ++++++++++++++++++++++++ 3 files changed, 242 insertions(+), 161 deletions(-) delete mode 100644 quantum/keymap_extras/keymap_cyrillic.h create mode 100644 quantum/keymap_extras/keymap_russian.h create mode 100644 quantum/keymap_extras/keymap_unicode_cyrillic.h diff --git a/quantum/keymap_extras/keymap_cyrillic.h b/quantum/keymap_extras/keymap_cyrillic.h deleted file mode 100644 index d5390afff..000000000 --- a/quantum/keymap_extras/keymap_cyrillic.h +++ /dev/null @@ -1,161 +0,0 @@ -#ifndef KEYMAP_CYRILLIC_H -#define KEYMAP_CYRILLIC_H - -#include "keymap.h" - -/* - * This is based off of - * https://en.wikipedia.org/wiki/Cyrillic_script - */ - -// Capital Char russian/ukrainian/bulgarian -#define CY_A UC(0x0410) // Ð rus ukr bul -#define CY_BE UC(0x0411) // Б rus ukr bul -#define CY_VE UC(0x0412) // Ð’ rus ukr bul -#define CY_GHE UC(0x0413) // Г rus ukr bul -#define CY_GHEUP UC(0x0490) // Ò ukr -#define CY_DE UC(0x0414) // Д rus ukr bul -#define CY_DJE UC(0x0402) // Ђ -#define CY_GJE UC(0x0403) // Ѓ -#define CY_IE UC(0x0415) // Е rus ukr bul -#define CY_IO UC(0x0401) // Ð rus -#define CY_UIE UC(0x0404) // Є ukr -#define CY_ZHE UC(0x0416) // Ж rus ukr bul -#define CY_ZE UC(0x0417) // З rus ukr bul -#define CY_DZE UC(0x0405) // Ð… -#define CY_I UC(0x0418) // И rus ukr bul -#define CY_B_U_I UC(0x0406) // І ukr -#define CY_YI UC(0x0407) // Ї ukr -#define CY_SRT_I UC(0x0419) // Й rus ukr bul -#define CY_JE UC(0x0408) // Ј -#define CY_KA UC(0x041a) // К rus ukr bul -#define CY_EL UC(0x041b) // Л rus ukr bul -#define CY_LJE UC(0x0409) // Љ -#define CY_EM UC(0x041c) // Ðœ rus ukr bul -#define CY_EN UC(0x041d) // Ð rus ukr bul -#define CY_NJE UC(0x040a) // Њ -#define CY_O UC(0x041e) // О rus ukr bul -#define CY_PE UC(0x041f) // П rus ukr bul -#define CY_ER UC(0x0420) // Р rus ukr bul -#define CY_ES UC(0x0421) // С rus ukr bul -#define CY_TE UC(0x0422) // Т rus ukr bul -#define CY_TSHE UC(0x040b) // Ћ -#define CY_KJE UC(0x040c) // ÐŒ -#define CY_U UC(0x0423) // У rus ukr bul -#define CY_SRT_U UC(0x040e) // ÐŽ -#define CY_EF UC(0x0424) // Ф rus ukr bul -#define CY_HA UC(0x0425) // Ð¥ rus bul -#define CY_TSE UC(0x0426) // Ц rus ukr bul -#define CY_CHE UC(0x0427) // Ч rus ukr bul -#define CY_DZHE UC(0x040f) // Ð -#define CY_SHA UC(0x0428) // Ш rus ukr bul -#define CY_SHCHA UC(0x0429) // Щ rus ukr bul -#define CY_HSIGN UC(0x042a) // Ъ rus bul -#define CY_YERU UC(0x042b) // Ы rus -#define CY_SSIGN UC(0x042c) // Ь rus ukr bul -#define CY_E UC(0x042d) // Э rus -#define CY_YU UC(0x042e) // Ю rus ukr bul -#define CY_YA UC(0x042f) // Я rus ukr bul -// Important Cyrillic non-Slavic letters -#define CY_PALOCHKA UC(0x04c0) // Ó€ -#define CY_SCHWA UC(0x04d8) // Ó˜ -#define CY_GHE_S UC(0x0492) // Ò’ -#define CY_ZE_D UC(0x0498) // Ò˜ -#define CY_ES_D UC(0x04aa) // Òª -#define CY_BR_KA UC(0x04a0) // Ò  -#define CY_ZHE_D UC(0x0496) // Ò– -#define CY_KA_D UC(0x049a) // Òš -#define CY_EN_D UC(0x04a2) // Ò¢ -#define CY_ENGHE UC(0x04a4) // Ò¤ -#define CY_BRD_O UC(0x04e8) // Ó¨ -#define CY_STR_U UC(0x04ae) // Ò® -#define CY_S_U_S UC(0x04b0) // Ò° -#define CY_SHHA UC(0x04ba) // Òº -#define CY_HA_D UC(0x04b2) // Ò² - - -// Small -#define CY_a UC(0x0430) // a rus ukr bul -#define CY_be UC(0x0431) // б rus ukr bul -#define CY_ve UC(0x0432) // в rus ukr bul -#define CY_ghe UC(0x0433) // г rus ukr bul -#define CY_gheup UC(0x0491) // Ò‘ ukr -#define CY_de UC(0x0434) // д rus ukr bul -#define CY_dje UC(0x0452) // Ñ’ -#define CY_gje UC(0x0453) // Ñ“ -#define CY_ie UC(0x0435) // е rus ukr bul -#define CY_io UC(0x0451) // Ñ‘ rus -#define CY_uie UC(0x0454) // Ñ” ukr -#define CY_zhe UC(0x0436) // ж rus ukr bul -#define CY_ze UC(0x0437) // з rus ukr bul -#define CY_dze UC(0x0455) // Ñ• -#define CY_i UC(0x0438) // и rus ukr bul -#define CY_b_u_i UC(0x0456) // Ñ– ukr -#define CY_yi UC(0x0457) // Ñ— ukr -#define CY_srt_i UC(0x0439) // й rus ukr bul -#define CY_je UC(0x0458) // ј -#define CY_ka UC(0x043a) // к rus ukr bul -#define CY_el UC(0x043b) // л rus ukr bul -#define CY_lje UC(0x0459) // Ñ™ -#define CY_em UC(0x043c) // м rus ukr bul -#define CY_en UC(0x043d) // н rus ukr bul -#define CY_nje UC(0x045a) // Ñš -#define CY_o UC(0x043e) // о rus ukr bul -#define CY_pe UC(0x043f) // п rus ukr bul -#define CY_er UC(0x0440) // Ñ€ rus ukr bul -#define CY_es UC(0x0441) // Ñ rus ukr bul -#define CY_te UC(0x0442) // Ñ‚ rus ukr bul -#define CY_tshe UC(0x045b) // Ñ› -#define CY_kje UC(0x045c) // Ñœ -#define CY_u UC(0x0443) // у rus ukr bul -#define CY_srt_u UC(0x045e) // Ñž -#define CY_ef UC(0x0444) // Ñ„ rus ukr bul -#define CY_ha UC(0x0445) // Ñ… rus ukr bul -#define CY_tse UC(0x0446) // ц rus ukr bul -#define CY_che UC(0x0447) // ч rus ukr bul -#define CY_dzhe UC(0x045f) // ÑŸ -#define CY_sha UC(0x0448) // ш rus ukr bul -#define CY_shcha UC(0x0449) // щ rus ukr bul -#define CY_hsign UC(0x044a) // ÑŠ rus bul -#define CY_yeru UC(0x044b) // Ñ‹ rus -#define CY_ssign UC(0x044c) // ÑŒ rus ukr bul -#define CY_e UC(0x044d) // Ñ rus -#define CY_yu UC(0x044e) // ÑŽ rus ukr bul -#define CY_ya UC(0x044f) // Ñ rus ukr bul -// Important Cyrillic non-Slavic letters -#define CY_palochka UC(0x04cf) // Ó -#define CY_schwa UC(0x04d9) // Ó™ -#define CY_ghe_s UC(0x0493) // Ò“ -#define CY_ze_d UC(0x0499) // Ò™ -#define CY_es_d UC(0x04ab) // Ò« -#define CY_br_ka UC(0x04a1) // Ò¡ -#define CY_zhe_d UC(0x0497) // Ò— -#define CY_ka_d UC(0x049b) // Ò› -#define CY_en_d UC(0x04a3) // Ò£ -#define CY_enghe UC(0x04a5) // Ò¥ -#define CY_brd_o UC(0x04e9) // Ó© -#define CY_str_u UC(0x04af) // Ò¯ -#define CY_s_u_s UC(0x04b1) // Ò± -#define CY_shha UC(0x04bb) // Ò» -#define CY_ha_d UC(0x04b3) // Ò³ - - -// Extra -#define CY_slr_ve UC(0x1c80) // á²€ CYRILLIC SMALL LETTER ROUNDED VE -#define CY_ll_de UC(0x1c81) // á² CYRILLIC SMALL LETTER LONG-LEGGED DE -#define CY_ZEMLYA UC(0xa640) // Ꙁ CYRILLIC CAPITAL LETTER ZEMLYA -#define CY_zemlya UC(0xa641) // ê™ CYRILLIC SMALL LETTER ZEMLYA -#define CY_RV_DZE UC(0xa644) // Ꙅ CYRILLIC CAPITAL LETTER REVERSED DZE -#define CY_rv_DZE UC(0xa645) // ê™… CYRILLIC SMALL LETTER REVERSED DZE -#define CY_slw_es UC(0x1c83) // ᲃ CYRILLIC SMALL LETTER WIDE ES -#define CY_st_te UC(0x1c84) // ᲄ CYRILLIC SMALL LETTER TALL TE -#define CY_3l_te UC(0x1c85) // á²… CYRILLIC SMALL LETTER THREE-LEGGED TE -#define CY_thsign UC(0x1c86) // ᲆ CYRILLIC SMALL LETTER TALL HARD SIGN -#define CY_YERUBY UC(0xa650) // ê™ CYRILLIC CAPITAL LETTER YERU WITH BACK YER -#define CY_yeruby UC(0xa651) // ꙑ CYRILLIC SMALL LETTER YERU WITH BACK YER -#define CY_RUBLE UC(0x20bd) // ₽ -#define CY_NUMERO UC(0x2116) // â„– - -// The letters Zje and Sje are made for other letters and accent marks - -#endif diff --git a/quantum/keymap_extras/keymap_russian.h b/quantum/keymap_extras/keymap_russian.h new file mode 100644 index 000000000..efb63a5cc --- /dev/null +++ b/quantum/keymap_extras/keymap_russian.h @@ -0,0 +1,79 @@ +#ifndef KEYMAP_RUSSIAN_H +#define KEYMAP_RUSSIAN_H + +#include "keymap.h" + +// rename ruble and numero in keymap_cyrillic.c + +// Normal Chracters // reg SHIFT +#define RU_A KC_F // а and Ð +#define RU_BE KC_COMM // б and Б +#define RU_VE KC_D // в and Ð’ +#define RU_GHE KC_U // г and Г +#define RU_DE KC_L // д and Д +#define RU_IE KC_T // е and Е +#define RU_IO KC_GRV // Ñ‘ and Ð +#define RU_ZHE KC_SCLN // ж and Ж +#define RU_ZE KC_P // з and З +#define RU_I KC_B // и and И +#define RU_SRT_I KC_Q // й and Й +#define RU_KA KC_R // к and К +#define RU_EL KC_K // л and Л +#define RU_EM KC_V // м and Ðœ +#define RU_EN KC_Y // н and Ð +#define RU_O KC_J // о and О +#define RU_PE KC_G // п and П +#define RU_ER KC_H // Ñ€ and Р +#define RU_ES KC_C // Ñ and С +#define RU_TE KC_N // Ñ‚ and Т +#define RU_U KC_E // у and У +#define RU_EF KC_A // Ñ„ and Ф +#define RU_HA KC_LBRC // Ñ… and Ð¥ +#define RU_TSE KC_W // ц and Ц +#define RU_CHE KC_X // ч and Ч +#define RU_SHA KC_I // ш and Ш +#define RU_SHCHA KC_O // щ and Щ +#define RU_HSIGN KC_RBRC // ÑŠ and Ъ +#define RU_YERU KC_S // Ñ‹ and Ы +#define RU_SSIGN KC_M // ÑŒ and Ь +#define RU_E KC_QUOT // Ñ and Э +#define RU_YU KC_DOT // ÑŽ and Ю +#define RU_YA KC_Z // Ñ and Я + +#define RU_1 KC_1 // 1 and ! +#define RU_2 KC_2 // 2 and " +#define RU_3 KC_3 // 3 and â„– +#define RU_4 KC_4 // 4 and ; +#define RU_5 KC_5 // 5 and % +#define RU_6 KC_6 // 6 and : +#define RU_7 KC_7 // 7 and ? +#define RU_8 KC_8 // 8 and * +#define RU_9 KC_9 // 9 and ( +#define RU_0 KC_0 // 0 and ) + +#define RU_MINS KC_MINS // - and _ +#define RU_EQL KC_EQL // = and + +#define RU_BSLS KC_BSLS // \ and / +#define RU_DOT KC_SLSH // . and , + +// Shifted Chracters +#define RU_EXLM LSFT(RU_1) // ! +#define RU_DQUT LSFT(RU_2) // " +#define RU_NMRO LSFT(RU_3) // â„– +#define RU_SCLN LSFT(RU_4) // ; +#define RU_PERC LSFT(RU_5) // % +#define RU_COLN LSFT(RU_6) // : +#define RU_QUES LSFT(RU_7) // ? +#define RU_ASTR LSFT(RU_8) // * +#define RU_LPRN LSFT(RU_9) // ( +#define RU_RPRN LSFT(RU_0) // ) + +#define RU_UNDR LSFT(RU_MINS) // _ +#define RU_PLUS LSFT(RU_EQL) // + +#define RU_SLSH LSFT(RU_BSLS) // / +#define RU_COMM LSFT(RU_DOT) // , + +// Alt Gr-ed characters +#define RU_RUBL RALT(RU_8) // ₽ + +#endif diff --git a/quantum/keymap_extras/keymap_unicode_cyrillic.h b/quantum/keymap_extras/keymap_unicode_cyrillic.h new file mode 100644 index 000000000..a40626d91 --- /dev/null +++ b/quantum/keymap_extras/keymap_unicode_cyrillic.h @@ -0,0 +1,163 @@ +#ifndef KEYMAP_CYRILLIC_H +#define KEYMAP_CYRILLIC_H + +#include "keymap.h" + +/* + * This is based off of + * https://en.wikipedia.org/wiki/Cyrillic_script + * + * Unicode is iffy, a software implementation is preferred + */ + +// Capital Char russian/ukrainian/bulgarian +#define CY_A UC(0x0410) // Ð rus ukr bul +#define CY_BE UC(0x0411) // Б rus ukr bul +#define CY_VE UC(0x0412) // Ð’ rus ukr bul +#define CY_GHE UC(0x0413) // Г rus ukr bul +#define CY_GHEUP UC(0x0490) // Ò ukr +#define CY_DE UC(0x0414) // Д rus ukr bul +#define CY_DJE UC(0x0402) // Ђ +#define CY_GJE UC(0x0403) // Ѓ +#define CY_IE UC(0x0415) // Е rus ukr bul +#define CY_IO UC(0x0401) // Ð rus +#define CY_UIE UC(0x0404) // Є ukr +#define CY_ZHE UC(0x0416) // Ж rus ukr bul +#define CY_ZE UC(0x0417) // З rus ukr bul +#define CY_DZE UC(0x0405) // Ð… +#define CY_I UC(0x0418) // И rus ukr bul +#define CY_B_U_I UC(0x0406) // І ukr +#define CY_YI UC(0x0407) // Ї ukr +#define CY_SRT_I UC(0x0419) // Й rus ukr bul +#define CY_JE UC(0x0408) // Ј +#define CY_KA UC(0x041a) // К rus ukr bul +#define CY_EL UC(0x041b) // Л rus ukr bul +#define CY_LJE UC(0x0409) // Љ +#define CY_EM UC(0x041c) // Ðœ rus ukr bul +#define CY_EN UC(0x041d) // Ð rus ukr bul +#define CY_NJE UC(0x040a) // Њ +#define CY_O UC(0x041e) // О rus ukr bul +#define CY_PE UC(0x041f) // П rus ukr bul +#define CY_ER UC(0x0420) // Р rus ukr bul +#define CY_ES UC(0x0421) // С rus ukr bul +#define CY_TE UC(0x0422) // Т rus ukr bul +#define CY_TSHE UC(0x040b) // Ћ +#define CY_KJE UC(0x040c) // ÐŒ +#define CY_U UC(0x0423) // У rus ukr bul +#define CY_SRT_U UC(0x040e) // ÐŽ +#define CY_EF UC(0x0424) // Ф rus ukr bul +#define CY_HA UC(0x0425) // Ð¥ rus bul +#define CY_TSE UC(0x0426) // Ц rus ukr bul +#define CY_CHE UC(0x0427) // Ч rus ukr bul +#define CY_DZHE UC(0x040f) // Ð +#define CY_SHA UC(0x0428) // Ш rus ukr bul +#define CY_SHCHA UC(0x0429) // Щ rus ukr bul +#define CY_HSIGN UC(0x042a) // Ъ rus bul +#define CY_YERU UC(0x042b) // Ы rus +#define CY_SSIGN UC(0x042c) // Ь rus ukr bul +#define CY_E UC(0x042d) // Э rus +#define CY_YU UC(0x042e) // Ю rus ukr bul +#define CY_YA UC(0x042f) // Я rus ukr bul +// Important Cyrillic non-Slavic letters +#define CY_PALOCHKA UC(0x04c0) // Ó€ +#define CY_SCHWA UC(0x04d8) // Ó˜ +#define CY_GHE_S UC(0x0492) // Ò’ +#define CY_ZE_D UC(0x0498) // Ò˜ +#define CY_ES_D UC(0x04aa) // Òª +#define CY_BR_KA UC(0x04a0) // Ò  +#define CY_ZHE_D UC(0x0496) // Ò– +#define CY_KA_D UC(0x049a) // Òš +#define CY_EN_D UC(0x04a2) // Ò¢ +#define CY_ENGHE UC(0x04a4) // Ò¤ +#define CY_BRD_O UC(0x04e8) // Ó¨ +#define CY_STR_U UC(0x04ae) // Ò® +#define CY_S_U_S UC(0x04b0) // Ò° +#define CY_SHHA UC(0x04ba) // Òº +#define CY_HA_D UC(0x04b2) // Ò² + + +// Small +#define CY_a UC(0x0430) // a rus ukr bul +#define CY_be UC(0x0431) // б rus ukr bul +#define CY_ve UC(0x0432) // в rus ukr bul +#define CY_ghe UC(0x0433) // г rus ukr bul +#define CY_gheup UC(0x0491) // Ò‘ ukr +#define CY_de UC(0x0434) // д rus ukr bul +#define CY_dje UC(0x0452) // Ñ’ +#define CY_gje UC(0x0453) // Ñ“ +#define CY_ie UC(0x0435) // е rus ukr bul +#define CY_io UC(0x0451) // Ñ‘ rus +#define CY_uie UC(0x0454) // Ñ” ukr +#define CY_zhe UC(0x0436) // ж rus ukr bul +#define CY_ze UC(0x0437) // з rus ukr bul +#define CY_dze UC(0x0455) // Ñ• +#define CY_i UC(0x0438) // и rus ukr bul +#define CY_b_u_i UC(0x0456) // Ñ– ukr +#define CY_yi UC(0x0457) // Ñ— ukr +#define CY_srt_i UC(0x0439) // й rus ukr bul +#define CY_je UC(0x0458) // ј +#define CY_ka UC(0x043a) // к rus ukr bul +#define CY_el UC(0x043b) // л rus ukr bul +#define CY_lje UC(0x0459) // Ñ™ +#define CY_em UC(0x043c) // м rus ukr bul +#define CY_en UC(0x043d) // н rus ukr bul +#define CY_nje UC(0x045a) // Ñš +#define CY_o UC(0x043e) // о rus ukr bul +#define CY_pe UC(0x043f) // п rus ukr bul +#define CY_er UC(0x0440) // Ñ€ rus ukr bul +#define CY_es UC(0x0441) // Ñ rus ukr bul +#define CY_te UC(0x0442) // Ñ‚ rus ukr bul +#define CY_tshe UC(0x045b) // Ñ› +#define CY_kje UC(0x045c) // Ñœ +#define CY_u UC(0x0443) // у rus ukr bul +#define CY_srt_u UC(0x045e) // Ñž +#define CY_ef UC(0x0444) // Ñ„ rus ukr bul +#define CY_ha UC(0x0445) // Ñ… rus ukr bul +#define CY_tse UC(0x0446) // ц rus ukr bul +#define CY_che UC(0x0447) // ч rus ukr bul +#define CY_dzhe UC(0x045f) // ÑŸ +#define CY_sha UC(0x0448) // ш rus ukr bul +#define CY_shcha UC(0x0449) // щ rus ukr bul +#define CY_hsign UC(0x044a) // ÑŠ rus bul +#define CY_yeru UC(0x044b) // Ñ‹ rus +#define CY_ssign UC(0x044c) // ÑŒ rus ukr bul +#define CY_e UC(0x044d) // Ñ rus +#define CY_yu UC(0x044e) // ÑŽ rus ukr bul +#define CY_ya UC(0x044f) // Ñ rus ukr bul +// Important Cyrillic non-Slavic letters +#define CY_palochka UC(0x04cf) // Ó +#define CY_schwa UC(0x04d9) // Ó™ +#define CY_ghe_s UC(0x0493) // Ò“ +#define CY_ze_d UC(0x0499) // Ò™ +#define CY_es_d UC(0x04ab) // Ò« +#define CY_br_ka UC(0x04a1) // Ò¡ +#define CY_zhe_d UC(0x0497) // Ò— +#define CY_ka_d UC(0x049b) // Ò› +#define CY_en_d UC(0x04a3) // Ò£ +#define CY_enghe UC(0x04a5) // Ò¥ +#define CY_brd_o UC(0x04e9) // Ó© +#define CY_str_u UC(0x04af) // Ò¯ +#define CY_s_u_s UC(0x04b1) // Ò± +#define CY_shha UC(0x04bb) // Ò» +#define CY_ha_d UC(0x04b3) // Ò³ + + +// Extra +#define CY_slr_ve UC(0x1c80) // á²€ CYRILLIC SMALL LETTER ROUNDED VE +#define CY_ll_de UC(0x1c81) // á² CYRILLIC SMALL LETTER LONG-LEGGED DE +#define CY_ZEMLYA UC(0xa640) // Ꙁ CYRILLIC CAPITAL LETTER ZEMLYA +#define CY_zemlya UC(0xa641) // ê™ CYRILLIC SMALL LETTER ZEMLYA +#define CY_RV_DZE UC(0xa644) // Ꙅ CYRILLIC CAPITAL LETTER REVERSED DZE +#define CY_rv_DZE UC(0xa645) // ê™… CYRILLIC SMALL LETTER REVERSED DZE +#define CY_slw_es UC(0x1c83) // ᲃ CYRILLIC SMALL LETTER WIDE ES +#define CY_st_te UC(0x1c84) // ᲄ CYRILLIC SMALL LETTER TALL TE +#define CY_3l_te UC(0x1c85) // á²… CYRILLIC SMALL LETTER THREE-LEGGED TE +#define CY_thsign UC(0x1c86) // ᲆ CYRILLIC SMALL LETTER TALL HARD SIGN +#define CY_YERUBY UC(0xa650) // ê™ CYRILLIC CAPITAL LETTER YERU WITH BACK YER +#define CY_yeruby UC(0xa651) // ꙑ CYRILLIC SMALL LETTER YERU WITH BACK YER +#define CY_RUBL UC(0x20bd) // ₽ +#define CY_NMRO UC(0x2116) // â„– + +// The letters Zje and Sje are made for other letters and accent marks + +#endif -- cgit v1.2.3-24-g4f1b From 2a0121a78643b1dc774d82352f8c9e246010803e Mon Sep 17 00:00:00 2001 From: kuel Date: Sun, 7 Aug 2016 11:07:38 -0500 Subject: Removed unnecessary comment --- quantum/keymap_extras/keymap_russian.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/quantum/keymap_extras/keymap_russian.h b/quantum/keymap_extras/keymap_russian.h index efb63a5cc..237e9abde 100644 --- a/quantum/keymap_extras/keymap_russian.h +++ b/quantum/keymap_extras/keymap_russian.h @@ -3,8 +3,6 @@ #include "keymap.h" -// rename ruble and numero in keymap_cyrillic.c - // Normal Chracters // reg SHIFT #define RU_A KC_F // а and Ð #define RU_BE KC_COMM // б and Б -- cgit v1.2.3-24-g4f1b From 3d86e5b7a796e8d574107109708ed873405a77dc Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sun, 7 Aug 2016 11:05:10 -0700 Subject: Tap for Tab, hold for Hyper --- keyboards/planck/keymaps/jeebak/keymap.c | 13 +++++---- keyboards/planck/keymaps/jeebak/readme.md | 46 +++++++++++++++++-------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 7dc8760ec..8541ecd8d 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -61,6 +61,7 @@ enum macro_keycodes { // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper // Requires KC_TRNS/_______ for the trigger key in the destination layer #define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor #define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor @@ -84,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * | Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L | ; | " | * |----------+------+------+------+------+------|------+------+------+------+------+--------| @@ -94,7 +95,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {CTL_ESC, KC_A, KC_S, LT_MC(KC_D),KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} @@ -102,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Colemak * ,-----------------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * | Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| * | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " | * |----------+------+------+------+------+------|------+------+------+------+------+--------| @@ -112,7 +113,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ [_COLEMAK] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {CTL_ESC, KC_A, KC_R, LT_MC(KC_S),KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} @@ -120,7 +121,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Dvorak * ,-----------------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * | Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| * | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / | * |----------+------+------+------+------+------|------+------+------+------+------+--------| @@ -130,7 +131,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ [_DVORAK] = { - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, {CTL_ESC, KC_A, KC_O, LT_MC(KC_E),KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT}, {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index b43f8a2fb..863567904 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -16,32 +16,36 @@ I also decided to change all calls to `persistant_default_layer_set()` to ## Base Layers (Qwerty/Colemak/Dvorak) These base layers are mostly the same as the default mappings. The interesting -changes are shown below. The `Ctrl/Esc`, mapped using `CTL_T(KC_ESC)` will emit -an `Escape` when tapped, and act as a `Control` key when held. A `TODO` item is -to see if it can also act as a `CapsLock` when double-tapped. The right shift -key acts as `Enter` when tapped, and as a `Shift` key when held. The arrow -keys, which have been moved to the +changes are shown below. + +- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held. +- The `Sft/Ent` as `Enter` and `Shift`, and +- The `Hyper/Tab` as `Tab` and `Hyper` + +A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped. +The arrow keys, which have been moved to the [TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been -replaced with the Media keys as shown. The `ML/A` key activates the Mouse layer -when held, and emits an `A` when tapped. +replaced with the Media keys as shown. The `MC/kc` key activates the +`MouseCursor` layer when held, and emits the corresponding `kc` for its layer, +when tapped. ``` ,-----------------------------------------------------------------------------------------. - | | | | | | | | | | | | | + | Hyper/Tab| | | | | | | | | | | | |----------+------+------+------+------+-------------+------+------+------+------+--------| - | Ctrl/Esc | ML/A | | | | | | | | | | | + | Ctrl/Esc | | |MC/kc | | | | | | | | | |----------+------+------+------+------+------|------+------+------+------+------+--------| | | | | | | | | | | | |Sft/Ent | |----------+------+------+------+------+------+------+------+------+------+------+--------| | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | `-----------------------------------------------------------------------------------------' -``` - +``` + ## Lower Layer (Symbols and Function Keys) The symbols and functions keys are essentially the same as the default mapping. The most notable changes are that the symbol keys from the `RAISE` layer have been moved here. The remaining Media keys replace those that are now on the base layers. The `BACKLIT` key has also been moved here. -``` +``` ,-----------------------------------------------------------------------------------. | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | |------+------+------+------+------+-------------+------+------+------+------+------| @@ -51,13 +55,13 @@ base layers. The `BACKLIT` key has also been moved here. |------+------+------+------+------+------+------+------+------+------+------+------| |Brite | | | | | | | Prev | Stop | Slct | Mute | `-----------------------------------------------------------------------------------' -``` - +``` + ## Raise Layer (Numbers and Arithmetic Operators) All of the numbers and arithmetic operators are available on this layer. Some keys are duplicated for the convenience of their positions. The `0` and `$` keys at the far left are for quick access to beginning and end of line in vim. -``` +``` ,-----------------------------------------------------------------------------------. | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | |------+------+------+------+------+-------------+------+------+------+------+------| @@ -67,8 +71,8 @@ keys at the far left are for quick access to beginning and end of line in vim. |------+------+------+------+------+------+------+------+------+------+------+------| |Brite | | | | | | | Prev | Stop | Slct | Mute | `-----------------------------------------------------------------------------------' -``` - +``` + ## TouchCursor layer plus personal customizations [TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key as the modifier, with the `IJKL` home row keys representing the inverted-T of @@ -88,7 +92,7 @@ etc.) depending on which layout you've currently selected (`AG_NORM` or use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and `Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as Google Chrome. -``` +``` ,-----------------------------------------------------------------------------------. |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | |------+------+------+------+------+-------------+------+------+------+------+------| @@ -98,7 +102,7 @@ Google Chrome. |------+------+------+------+------+------+------+------+------+------+------+------| | | | | | | | | | | | | `-----------------------------------------------------------------------------------' -``` +``` ## Mouse Layer The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. @@ -108,7 +112,7 @@ IMHO. The left and right click buttons are duplicated; on the right hand side, for a quick click here and there, and again on the left hand side for when the buttons need to be held for dragging things or highlighting text, thus allowing the right hand to be free to use the up/down/left/right actions. -``` +``` ,-----------------------------------------------------------------------------------. | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | |------+------+------+------+------+-------------+------+------+------+------+------| @@ -118,4 +122,4 @@ the right hand to be free to use the up/down/left/right actions. |------+------+------+------+------+------+------+------+------+------+------+------| | | | | | | | | | | | | `-----------------------------------------------------------------------------------' -``` +``` -- cgit v1.2.3-24-g4f1b From ef83f1d04f4cf85c1922632b8a759fe67a5b24cb Mon Sep 17 00:00:00 2001 From: JeeBak Kim Date: Sun, 7 Aug 2016 12:44:45 -0700 Subject: Tap for ;, hold for GUI, tap for ", hold for Alt --- keyboards/planck/keymaps/jeebak/keymap.c | 6 ++++-- keyboards/planck/keymaps/jeebak/readme.md | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/jeebak/keymap.c b/keyboards/planck/keymaps/jeebak/keymap.c index 8541ecd8d..cb7ccb588 100644 --- a/keyboards/planck/keymaps/jeebak/keymap.c +++ b/keyboards/planck/keymaps/jeebak/keymap.c @@ -62,6 +62,8 @@ enum macro_keycodes { #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper +#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI +#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt // Requires KC_TRNS/_______ for the trigger key in the destination layer #define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor #define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor @@ -87,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------------. * | Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | * |----------+------+------+------+------+-------------+------+------+------+------+--------| - * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L | ; | " | + * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | * |----------+------+------+------+------+------|------+------+------+------+------+--------| * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent | * |----------+------+------+------+------+------+------+------+------+------+------+--------| @@ -96,7 +98,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = { {HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {CTL_ESC, KC_A, KC_S, LT_MC(KC_D),KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {CTL_ESC, KC_A, KC_S, LT_MC(KC_D),KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT}, {KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, diff --git a/keyboards/planck/keymaps/jeebak/readme.md b/keyboards/planck/keymaps/jeebak/readme.md index 863567904..e1dd1dca5 100644 --- a/keyboards/planck/keymaps/jeebak/readme.md +++ b/keyboards/planck/keymaps/jeebak/readme.md @@ -18,9 +18,11 @@ I also decided to change all calls to `persistant_default_layer_set()` to These base layers are mostly the same as the default mappings. The interesting changes are shown below. -- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held. -- The `Sft/Ent` as `Enter` and `Shift`, and -- The `Hyper/Tab` as `Tab` and `Hyper` +- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held, +- `GUI/;` as `;` and `GUI`, +- `Alt/"` as `"` and `Alt`, +- `Sft/Ent` as `Enter` and `Shift`, and +- `Hyper/Tab` as `Tab` and `Hyper` A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped. The arrow keys, which have been moved to the @@ -32,7 +34,7 @@ when tapped. ,-----------------------------------------------------------------------------------------. | Hyper/Tab| | | | | | | | | | | | |----------+------+------+------+------+-------------+------+------+------+------+--------| - | Ctrl/Esc | | |MC/kc | | | | | | | | | + | Ctrl/Esc | | |MC/kc | | | | | | |GUI/; | Alt/" | |----------+------+------+------+------+------|------+------+------+------+------+--------| | | | | | | | | | | | |Sft/Ent | |----------+------+------+------+------+------+------+------+------+------+------+--------| -- cgit v1.2.3-24-g4f1b From 8fab141a024fd55a28366958716f4be1a10f9c03 Mon Sep 17 00:00:00 2001 From: di0ib Date: Sun, 7 Aug 2016 20:58:59 -1000 Subject: Convert hex to bin For flashing via alternative methods like LUFA MassStorage bootloader. --- tmk_core/avr.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 6c03e1650..b48173341 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -138,6 +138,11 @@ else endif dfu-programmer $(MCU) reset +# Convert hex to bin. +flashbin: $(BUILD_DIR)/$(TARGET).hex + $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin + $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; + $(COPY) $(BUILD_DIR)/$(TARGET).bin FLASH.bin; # Generate avr-gdb config/init file which does the following: # define the reset signal, load the target file, connect to target, and set -- cgit v1.2.3-24-g4f1b From f41c2e6863f2ebf55311051cdead743683846a49 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Mon, 8 Aug 2016 17:53:08 +0200 Subject: Update TMK_README.md updated link to non-existent build.md file --- doc/TMK_README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/TMK_README.md b/doc/TMK_README.md index f3d96717a..0c75a0e27 100644 --- a/doc/TMK_README.md +++ b/doc/TMK_README.md @@ -113,7 +113,7 @@ Third party libraries like LUFA, PJRC and V-USB have their own license respectiv Build Firmware and Program Controller ------------------------------------- -See [doc/build.md](tmk_core/doc/build.md), or the readme in the particular keyboards/* folder. +See [doc/BUILD_GUIDE.md](tmk_core/doc/BUILD_GUIDE.md), or the readme in the particular keyboards/* folder. -- cgit v1.2.3-24-g4f1b From 76cd7c5444471c7fbf0f648088cac13f4c79af57 Mon Sep 17 00:00:00 2001 From: Corey Finley Date: Fri, 5 Aug 2016 09:08:55 -0400 Subject: Adds keymap based on Kinesis advantage --- keyboards/preonic/keymaps/kinesis/Makefile | 27 ++++++ keyboards/preonic/keymaps/kinesis/config.h | 92 ++++++++++++++++++ keyboards/preonic/keymaps/kinesis/keymap.c | 144 ++++++++++++++++++++++++++++ keyboards/preonic/keymaps/kinesis/readme.md | 1 + 4 files changed, 264 insertions(+) create mode 100644 keyboards/preonic/keymaps/kinesis/Makefile create mode 100644 keyboards/preonic/keymaps/kinesis/config.h create mode 100644 keyboards/preonic/keymaps/kinesis/keymap.c create mode 100644 keyboards/preonic/keymaps/kinesis/readme.md diff --git a/keyboards/preonic/keymaps/kinesis/Makefile b/keyboards/preonic/keymaps/kinesis/Makefile new file mode 100644 index 000000000..6c8d2897c --- /dev/null +++ b/keyboards/preonic/keymaps/kinesis/Makefile @@ -0,0 +1,27 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +TAP_DANCE_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/preonic/keymaps/kinesis/config.h b/keyboards/preonic/keymaps/kinesis/config.h new file mode 100644 index 000000000..086baa84f --- /dev/null +++ b/keyboards/preonic/keymaps/kinesis/config.h @@ -0,0 +1,92 @@ +/* +Copyright 2012 Jun Wako + +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 0x6061 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Ortholinear Keyboards +#define PRODUCT The Preonic Keyboard +#define DESCRIPTION A compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { D2, D5, B5, B6, D3 } +#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* 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 DEBOUNCING_DELAY 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)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D1 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 28 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +#define TAPPING_TERM 200 + +/* 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 + +#endif diff --git a/keyboards/preonic/keymaps/kinesis/keymap.c b/keyboards/preonic/keymaps/kinesis/keymap.c new file mode 100644 index 000000000..1cd6eb993 --- /dev/null +++ b/keyboards/preonic/keymaps/kinesis/keymap.c @@ -0,0 +1,144 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _FN 1 +#define _ULCK 2 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define HYP_TIC ALL_T(KC_GRV) +#define EQ_LOCK TD(TD_EQ_LOCK) +#define MIN_ULK TD(TD_MIN_ULOCK) + +//Tap Dance Declarations +enum { + TD_EQ_LOCK = 0, + TD_MIN_ULOCK +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | FN | ` | Alt | LGUI | Back | ESC |ENTER | SPCE | RGUI | [ | ] | FN | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = { + {EQ_LOCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, MIN_ULK }, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS }, + {KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, + {KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC }, + {MO(_FN), HYP_TIC, KC_LALT, KC_LGUI, KC_BSPC, KC_ESC, KC_ENT, KC_SPC, KC_RGUI, KC_LBRC, KC_RBRC, MO(_FN) } + }, + + /* Fn + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | VOL- | VOL+ | MUTE |BLtogg| | LEFT | DOWN | UP | RGHT | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | BL- | BL+ |Aud on|AudOff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff| | |PLY/PS| | PREV | NEXT | | + * `-----------------------------------------------------------------------------------' + */ + [_FN] = { + {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______ }, + {_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______ }, + {_______, KC_VOLD, KC_VOLU, KC_MUTE, BL_TOGG, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______ }, + {_______, BL_DEC, BL_INC, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______ }, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, KC_MPLY, _______, KC_MPRV, KC_MNXT, _______ } + } + +}; + +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} +}; + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +/*bool process_record_user(uint16_t keycode, keyrecord_t *record) {*/ + /*return true;*/ + /*[>switch (keycode) {<]*/ + /*[>case QWERTY:<]*/ + /*[>return true;<]*/ + /*[>}<]*/ +/*};*/ + +void matrix_init_user(void) { + startup_user(); +} + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + + +const qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for equal, twice for hyper + X (alfred lock) + [TD_EQ_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, HYPR(KC_X)), + //Tap once for minus, twice for time.heals.nothing + [TD_MIN_ULOCK] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, M(_ULCK)) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _ULCK: + if (record->event.pressed) { + /* time.heals.nothing */ + return MACRO( I(220), T(T), T(I), T(M), T(E), T(DOT), T(H), T(E), T(A), T(L), T(S), T(DOT), T(N), T(O), T(T), T(H), T(I), T(N), T(G), END); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/preonic/keymaps/kinesis/readme.md b/keyboards/preonic/keymaps/kinesis/readme.md new file mode 100644 index 000000000..e911968dd --- /dev/null +++ b/keyboards/preonic/keymaps/kinesis/readme.md @@ -0,0 +1 @@ +# The default Preonic layout - largely based on the Planck's \ No newline at end of file -- cgit v1.2.3-24-g4f1b From e85bf50e1acb9d5d3117e8b57ab6178eba00debb Mon Sep 17 00:00:00 2001 From: skullY Date: Mon, 8 Aug 2016 13:43:24 -0700 Subject: Clueboard: Add some readme.md files and do some minor cleanup. --- keyboards/clueboard/Makefile | 2 +- keyboards/clueboard/config.h | 3 - keyboards/clueboard/keymaps/default/keymap.c | 8 --- keyboards/clueboard/keymaps/skully/readme.md | 5 ++ keyboards/clueboard/readme.md | 95 +++++++++++++++++++++++++++- keyboards/clueboard/rev2/config.h | 2 +- 6 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 keyboards/clueboard/keymaps/skully/readme.md diff --git a/keyboards/clueboard/Makefile b/keyboards/clueboard/Makefile index ccc01ea9a..e6b13f955 100644 --- a/keyboards/clueboard/Makefile +++ b/keyboards/clueboard/Makefile @@ -90,7 +90,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options -# comment out to disable the options. +# change to no to disable the options. # BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) diff --git a/keyboards/clueboard/config.h b/keyboards/clueboard/config.h index ceac80795..ad6832385 100644 --- a/keyboards/clueboard/config.h +++ b/keyboards/clueboard/config.h @@ -29,9 +29,6 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 diff --git a/keyboards/clueboard/keymaps/default/keymap.c b/keyboards/clueboard/keymaps/default/keymap.c index 896bc7ebc..01f158bf0 100644 --- a/keyboards/clueboard/keymaps/default/keymap.c +++ b/keyboards/clueboard/keymaps/default/keymap.c @@ -66,19 +66,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `----------------------------------------------------------------------------------' */ [_RS] = KEYMAP( - #ifdef RGBLIGHT_ENABLE KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_VAI, \ KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, \ KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ MO(_FL), KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), RGB_SAI, \ KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, RGB_MOD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_HUD, RGB_SAD, RGB_HUI), - #else - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, MO(_RS),KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_FL), KC_TRNS, KC_TRNS, KC_TRNS), - #endif }; enum function_id { diff --git a/keyboards/clueboard/keymaps/skully/readme.md b/keyboards/clueboard/keymaps/skully/readme.md new file mode 100644 index 000000000..20ac1e4f8 --- /dev/null +++ b/keyboards/clueboard/keymaps/skully/readme.md @@ -0,0 +1,5 @@ +# The Maximized Clueboard Layout + +This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing. + +The most notable change from the default layout is putting Ctrl on the Capslock key. I also swap Alt and Cmd because I mostly use a Mac day to day. diff --git a/keyboards/clueboard/readme.md b/keyboards/clueboard/readme.md index aa301f020..6c29c09ec 100644 --- a/keyboards/clueboard/readme.md +++ b/keyboards/clueboard/readme.md @@ -1,4 +1,97 @@ Clueboard keyboard firmware ====================== -TODO: to be updated. +DIY/Assembled compact 66% keyboard by [Clueboard](http://clueboard.co). + +For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md). + +## First Time Setup + +Download or clone the whole firmware and navigate to the keyboards/clueboard directory. Once your dev env is setup, you'll be able to generate the default .hex: + +``` +$ make +``` + +You will see a lot of output and if everything worked correctly you will see something similar to this: + +``` +Size after: + text data bss dec hex filename + 0 19992 0 19992 4e18 clueboard_rev2_default.hex +``` + +At this point you can press RESET on your Clueboard and flash your keyboard with this command: + +``` +$ make dfu +``` + +If you would like to use one of the alternative keymaps, or create your own, see below. + +## Clueboard 1.0 + +If you have a first generation Clueboard (one with a black PCB) you will need to use the revision 1 code. To do so add `SUBPROJECT=rev1` to your make command, like this: + +``` +$ make SUBPROJECT=rev1 +``` + +And when flashing your keyboard: + +``` +$ make SUBPROJECT=rev1 dfu +``` + +If you are flashing an alternative layout to your rev1, include both `SUBPROJECT=rev1` and `KEYMAP=` in your command, for example when flashing max: + +``` +$ make SUBPROJECT=rev1 KEYMAP=max dfu +``` + +## Alternate Keymaps + +There are many alternative and user-contributed layouts available in the [keymaps/](keymaps/) directory. To compile and flash an alternative you will want to add `KEYMAP=` to your command: + +``` +$ make KEYMAP=skully +``` + +And when flashing your keyboard, put `KEYMAP=` between "make" and "dfu": + +``` +$ make KEYMAP=skully dfu +``` + +### Notable Layouts + +These layouts are notable for one reason or another. If you are looking for ideas or inspiration you should look at these first: + +* [keymaps/default](keymaps/default) - The default Clueboard layout +* [keymaps/max](keymaps/max) - A maximised layout that makes use of every key and feature of the Clueboard 2.0 PCB. +* [keymaps/skully](keymaps/skully) - The layout that @skullydazed uses on his own Clueboards. + +## Create Your Own Keymap + +There are a lot of possibilities when creating your own keymap, and the primary documentation for doing that is [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md. As a way to get started, here is the procedure I recommend: + +* Copy `[keymaps/default](keymaps/default/)` to `keymaps/`. +* Compile the firmware (`$ make KEYMAP=`) +* Flash the firmware (`$ make KEYMAP= dfu`) +* Make sure everything works like the default keyboard +* Modify `keymaps//readme.md` to tell others about your layout. +* Modify `keymaps//keymap.c` to reflect your desired layout. +* Compile your new custom firmware (`$ make KEYMAP=`) +** If you have warnings you may flash without fixing them, but something may not work right. +** If you have any errors you must fix them before continuing. +* Flash the firmware (`$ make KEYMAP= dfu`) + +## Share Your Keymap + +Got your layout dialed in? Please share it with the world so we can benefit from your work! Simply submit a pull request with your layout and we'll include it in the official repository. Please use the following guidelines when putting together your pull request: + +* Include a readme.md that states what your primary keyboard use is, how your layout differs from the default, and highlights anything you think makes your layout particularly great. +* If your layout requires certain features (EG, RGB underlight or backlighting) ensure you have a Makefile and config.h that reflects that +* If your layout requires special hardware to be added, please describe that in the readme.md + +TODO: Write up or link quick how-to on creating and submitting a PR. (Pull requests accepted. :) diff --git a/keyboards/clueboard/rev2/config.h b/keyboards/clueboard/rev2/config.h index 02982ff29..15ca4ece8 100644 --- a/keyboards/clueboard/rev2/config.h +++ b/keyboards/clueboard/rev2/config.h @@ -36,4 +36,4 @@ #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 -#endif \ No newline at end of file +#endif -- cgit v1.2.3-24-g4f1b From d561f63bd14b8ea2e6d8b26a1ba46a1e8503c5bd Mon Sep 17 00:00:00 2001 From: skullY Date: Mon, 8 Aug 2016 13:46:55 -0700 Subject: Clueboard: Fix the title in keymaps/skully/readme.md --- keyboards/clueboard/keymaps/skully/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/clueboard/keymaps/skully/readme.md b/keyboards/clueboard/keymaps/skully/readme.md index 20ac1e4f8..c1182123d 100644 --- a/keyboards/clueboard/keymaps/skully/readme.md +++ b/keyboards/clueboard/keymaps/skully/readme.md @@ -1,4 +1,4 @@ -# The Maximized Clueboard Layout +# skullY's Clueboard Layout This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing. -- cgit v1.2.3-24-g4f1b From adad05c3fbd511e77a77484945fa2f675d6abf8b Mon Sep 17 00:00:00 2001 From: skullY Date: Mon, 8 Aug 2016 16:11:54 -0700 Subject: Add support for the cluecard --- keyboards/cluecard/Makefile | 76 ++++++++++++ keyboards/cluecard/cluecard.c | 98 ++++++++++++++++ keyboards/cluecard/cluecard.h | 22 ++++ keyboards/cluecard/config.h | 167 +++++++++++++++++++++++++++ keyboards/cluecard/keymaps/default/Makefile | 21 ++++ keyboards/cluecard/keymaps/default/config.h | 8 ++ keyboards/cluecard/keymaps/default/keymap.c | 63 ++++++++++ keyboards/cluecard/keymaps/default/readme.md | 1 + keyboards/cluecard/readme.md | 28 +++++ 9 files changed, 484 insertions(+) create mode 100644 keyboards/cluecard/Makefile create mode 100644 keyboards/cluecard/cluecard.c create mode 100644 keyboards/cluecard/cluecard.h create mode 100644 keyboards/cluecard/config.h create mode 100644 keyboards/cluecard/keymaps/default/Makefile create mode 100644 keyboards/cluecard/keymaps/default/config.h create mode 100644 keyboards/cluecard/keymaps/default/keymap.c create mode 100644 keyboards/cluecard/keymaps/default/readme.md create mode 100644 keyboards/cluecard/readme.md diff --git a/keyboards/cluecard/Makefile b/keyboards/cluecard/Makefile new file mode 100644 index 000000000..029d0b967 --- /dev/null +++ b/keyboards/cluecard/Makefile @@ -0,0 +1,76 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +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 ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= yes # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../Makefile +endif + + diff --git a/keyboards/cluecard/cluecard.c b/keyboards/cluecard/cluecard.c new file mode 100644 index 000000000..81db252d2 --- /dev/null +++ b/keyboards/cluecard/cluecard.c @@ -0,0 +1,98 @@ +#include "cluecard.h" +#define BL_RED OCR1B +#define BL_GREEN OCR1A +#define BL_BLUE OCR1C + +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(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +void backlight_init_ports(void) +{ + // Set B5, B6, and B7 as output + DDRB |= (1<<7)|(1<<6)|(1<<5); + + // Setup PWM + ICR1 = 0xFFFF; + TCCR1A = 0b10101010; + TCCR1B = 0b00011001; + + BL_RED = 0xFFFF; + BL_GREEN = 0xFFFF; + BL_BLUE = 0xFFFF; +} + +void backlight_set(uint8_t level) +{ + // Set the RGB color + switch (level) + { + case 0: + // Off + BL_RED = 0xFFFF; + BL_GREEN = 0xFFFF; + BL_BLUE = 0xFFFF; + break; + case 1: + // Red + BL_RED = 0x0000; + BL_GREEN = 0xFFFF; + BL_BLUE = 0xFFFF; + break; + case 2: + // Green + BL_RED = 0xFFFF; + BL_GREEN = 0x0000; + BL_BLUE = 0xFFFF; + break; + case 3: + // Blue + BL_RED = 0xFFFF; + BL_GREEN = 0xFFFF; + BL_BLUE = 0x0000; + break; + case 4: + // Magenta + BL_RED = 0x4000; + BL_GREEN = 0x4000; + BL_BLUE = 0x4000; + break; + case 5: + // Purple + BL_RED = 0x0000; + BL_GREEN = 0xFFFF; + BL_BLUE = 0x0000; + break; + case 6: + // Yellow + BL_RED = 0x0000; + BL_GREEN = 0x0000; + BL_BLUE = 0xFFFF; + break; + default: + xprintf("Unknown level: %d\n", level); + } +} diff --git a/keyboards/cluecard/cluecard.h b/keyboards/cluecard/cluecard.h new file mode 100644 index 000000000..3342a0823 --- /dev/null +++ b/keyboards/cluecard/cluecard.h @@ -0,0 +1,22 @@ +#ifndef CLUECARD_H +#define CLUECARD_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + k00, k01, k02, \ + k10, k12, \ + k20, k21, k22, \ + k11, \ + k30, k31, k32 \ +) { \ + { k00, k01, k02, }, \ + { k10, k11, k12, }, \ + { k20, k21, k22, }, \ + { k30, k31, k32, } \ +} + +#endif diff --git a/keyboards/cluecard/config.h b/keyboards/cluecard/config.h new file mode 100644 index 000000000..765347b13 --- /dev/null +++ b/keyboards/cluecard/config.h @@ -0,0 +1,167 @@ +/* +Copyright 2012 Jun Wako + +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 0xC1ED +#define PRODUCT_ID 0x2330 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Clueboard +#define PRODUCT ATMEGA32U4 Firmware Dev Kit +#define DESCRIPTION A small board to help you hack on QMK. + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, F5, F4, B4 } +#define MATRIX_COL_PINS { F1, F7, F6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 20 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 6 + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* Underlight configuration + */ +#define RGB_DI_PIN E6 +//#define RGBLIGHT_TIMER +#define RGBLED_NUM 4 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * 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 + +#endif diff --git a/keyboards/cluecard/keymaps/default/Makefile b/keyboards/cluecard/keymaps/default/Makefile new file mode 100644 index 000000000..8ee841da0 --- /dev/null +++ b/keyboards/cluecard/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/cluecard/keymaps/default/config.h b/keyboards/cluecard/keymaps/default/config.h new file mode 100644 index 000000000..8893d122e --- /dev/null +++ b/keyboards/cluecard/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/cluecard/keymaps/default/keymap.c b/keyboards/cluecard/keymaps/default/keymap.c new file mode 100644 index 000000000..517afe867 --- /dev/null +++ b/keyboards/cluecard/keymaps/default/keymap.c @@ -0,0 +1,63 @@ +#include "cluecard.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP( + RGB_TOG, RGB_SAI, RGB_VAI, \ + RGB_HUD, RGB_HUI, \ + RGB_MOD, RGB_SAD, RGB_VAD, \ + BL_STEP, \ + F(0), F(1), F(2) \ + ) +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(0), + [1] = ACTION_FUNCTION(1), + [2] = ACTION_FUNCTION(2) +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + if (record->event.pressed) { + switch (id) { + case 0: + PLAY_NOTE_ARRAY(tone_startup, false, 0); + break; + case 1: + PLAY_NOTE_ARRAY(music_scale, false, 0); + break; + case 2: + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + break; + } + } +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { +} diff --git a/keyboards/cluecard/keymaps/default/readme.md b/keyboards/cluecard/keymaps/default/readme.md new file mode 100644 index 000000000..9e3b97bea --- /dev/null +++ b/keyboards/cluecard/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for cluecard diff --git a/keyboards/cluecard/readme.md b/keyboards/cluecard/readme.md new file mode 100644 index 000000000..ae1afbbfd --- /dev/null +++ b/keyboards/cluecard/readme.md @@ -0,0 +1,28 @@ +cluecard keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/cluecard folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make`. + +### Other Keymaps + +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: + +``` +$ make keymap=[default|jack|] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` -- cgit v1.2.3-24-g4f1b From 552399df4cef88463ea8ac40822d776d0fb90e18 Mon Sep 17 00:00:00 2001 From: Ian Sterling Date: Mon, 8 Aug 2016 18:34:08 -0700 Subject: Adding my own keymaps to the following keyboards: Planck, Preonic, Atreus, Ergodox --- keyboards/atreus/keymaps/xyverz/keymap.c | 89 ++++++ keyboards/ergodox/keymaps/xyverz/dvorak.png | Bin 0 -> 87314 bytes keyboards/ergodox/keymaps/xyverz/keymap.c | 184 +++++++++++++ keyboards/ergodox/keymaps/xyverz/old_keymap.c | 311 +++++++++++++++++++++ keyboards/ergodox/keymaps/xyverz/readme.md | 10 + keyboards/planck/keymaps/xyverz/README.md | 2 + keyboards/planck/keymaps/xyverz/keymap.c | 379 ++++++++++++++++++++++++++ keyboards/planck/keymaps/xyverz/makefile.mk | 2 + keyboards/preonic/keymaps/xyverz/README.md | 49 ++++ keyboards/preonic/keymaps/xyverz/keymap.c | 342 +++++++++++++++++++++++ keyboards/preonic/keymaps/xyverz/makefile.mk | 1 + 11 files changed, 1369 insertions(+) create mode 100644 keyboards/atreus/keymaps/xyverz/keymap.c create mode 100644 keyboards/ergodox/keymaps/xyverz/dvorak.png create mode 100644 keyboards/ergodox/keymaps/xyverz/keymap.c create mode 100644 keyboards/ergodox/keymaps/xyverz/old_keymap.c create mode 100644 keyboards/ergodox/keymaps/xyverz/readme.md create mode 100644 keyboards/planck/keymaps/xyverz/README.md create mode 100644 keyboards/planck/keymaps/xyverz/keymap.c create mode 100644 keyboards/planck/keymaps/xyverz/makefile.mk create mode 100644 keyboards/preonic/keymaps/xyverz/README.md create mode 100644 keyboards/preonic/keymaps/xyverz/keymap.c create mode 100644 keyboards/preonic/keymaps/xyverz/makefile.mk diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..447fbcf10 --- /dev/null +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -0,0 +1,89 @@ +// This is the personal keymap of Ian Sterling (@xyverz). It is based on the keymap by +// Chris Gerber (@gerbercj), with the addition of persistent layers like the Planck and +// Preonic keyboards by Jack Humbert. + +#include "atreus.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DV 0 +#define _QW 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 + +// Macro name shortcuts +#define DVORAK M(_DV) +#define QWERTY M(_QW) +#define COLEMAK M(_CM) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_DV] = { /* Dvorak */ + {KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L }, + {KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S }, + {SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, CTL_T(KC_DEL), KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_EQL} + }, + [_QW] = { /* Qwerty */ + {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P }, + {KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT} + }, + [_CM] = { /* Colemak */ + {KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN}, + {KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O }, + {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT} + }, + [_L1] = { /* LAYER 1 */ + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 }, + {KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_EQL }, + {KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, + {KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } + }, + [_L2] = { /* LAYER 2 */ + {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 }, + {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12 }, + {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, RESET } + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/ergodox/keymaps/xyverz/dvorak.png b/keyboards/ergodox/keymaps/xyverz/dvorak.png new file mode 100644 index 000000000..cb8316309 Binary files /dev/null and b/keyboards/ergodox/keymaps/xyverz/dvorak.png differ diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..dd39dbacb --- /dev/null +++ b/keyboards/ergodox/keymaps/xyverz/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | \ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | O | E | U | I |------| |------| D | H | T | N |S / L2| - | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_DELT, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(1), + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, + TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, + KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, + MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, + KC_UP, KC_DOWN,KC_SLSH,KC_EQL, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/xyverz/old_keymap.c b/keyboards/ergodox/keymaps/xyverz/old_keymap.c new file mode 100644 index 000000000..e082372f9 --- /dev/null +++ b/keyboards/ergodox/keymaps/xyverz/old_keymap.c @@ -0,0 +1,311 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" + +extern keymap_config_t keymap_config; + +#define _DVORAK 0 // default layer +#define _QWERTY 1 // symbols +#define _LOWER 2 +#define _RAISE 3 +#define _ADJUST 16 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* + * Keymap 0: Dvorak + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ] | 1 | 2 | 3 | 4 | 5 | Esc | | ESC | 6 | 7 | 8 | 9 | 0 | [ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | ' | , | . | Y | Y |(Null)| |(Null)| F | G | C | R | L | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | + * |--------+------+------+------+------+------| FN1 | | FN2 |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCtr | LAlt | | Ralt | RCtr | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' + * + * + ***************************************************************************************************** + * This Dvorak keyboard layout stems from my early Kinesis years, using the Contour PS/2 with a Dvorak + * software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the cor- + * ner keys. I've decided to continue using this layout with my ErgoDox. + */ + + [_DVORAK] = ( + KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, + KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, LOWER, + KC_LGUI, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, + NO, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + RAISE, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_UP, KC_DOWN, KC_SLSH, KC_EQL, KC_RGUI, + KC_RALT, KC_RCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC +), + +/* Keymap 1: QWERTY + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +[_QWERTY] = ( + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + {ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + RAISE, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT +), + + +/* Lower 2: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[_LOWER] = ( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + +/* Raise 3: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[_RAISE] = ( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), + +/* Adjust 16: Lower + Raise + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | Reset| | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| |Dvorak|Qwerty| | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[_ADJUST] = ( + KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, QWERTY, DVORAK, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DVORAK: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DVORAK); + } + break; + case _QWERTY: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QWERTY); + } + break; + case _LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case _RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + + } + return MACRO_NONE; +}; + + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md new file mode 100644 index 000000000..8f6dba45e --- /dev/null +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -0,0 +1,10 @@ +# ErgoDox EZ Default Configuration + +## Changelog + +* Feb 2, 2016 (V1.1): + * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). + +This is what we ship with out of the factory. :) The image says it all: + +![Default](default_highres.png) diff --git a/keyboards/planck/keymaps/xyverz/README.md b/keyboards/planck/keymaps/xyverz/README.md new file mode 100644 index 000000000..b0054fc30 --- /dev/null +++ b/keyboards/planck/keymaps/xyverz/README.md @@ -0,0 +1,2 @@ +# Zrevyx's Planck Layout + diff --git a/keyboards/planck/keymaps/xyverz/keymap.c b/keyboards/planck/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..9ac78ec15 --- /dev/null +++ b/keyboards/planck/keymaps/xyverz/keymap.c @@ -0,0 +1,379 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MUSIC 5 +#define _PLOVER 6 +#define _ADJUST 16 + +// Macro name shortcuts +#define QWERTY M(_QWERTY) +#define COLEMAK M(_COLEMAK) +#define DVORAK M(_DVORAK) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) +#define M_BL 5 +#define AUD_OFF M(6) +#define AUD_ON M(7) +#define MUS_OFF M(8) +#define MUS_ON M(9) +#define VC_IN M(10) +#define VC_DE M(11) +#define PLOVER M(12) +#define EXT_PLV M(13) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, + {M(M_BL), _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______}, + {M(M_BL), _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Music (reserved for process_action_user) + * + */ +[_MUSIC] = { + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = { + {440.0*pow(2.0,(31)/12.0), 12}, + {440.0*pow(2.0,(28)/12.0), 8}, + {440.0*pow(2.0,(19)/12.0), 8}, + {440.0*pow(2.0,(24)/12.0), 8}, + {440.0*pow(2.0,(28)/12.0), 20} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + break; + case _COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + break; + case _DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + break; + case _LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case _RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case M_BL: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + case 6: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + audio_off(); + #endif + } + break; + case 7: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + audio_on(); + PLAY_NOTE_ARRAY(tone_startup, false, 0); + #endif + } + break; + case 8: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + layer_off(_MUSIC); + stop_all_notes(); + #endif + } + break; + case 9: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(music_scale, false, 0); + layer_on(_MUSIC); + #endif + } + break; + case 10: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + voice_iterate(); + PLAY_NOTE_ARRAY(music_scale, false, 0); + #endif + } + break; + case 11: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + voice_deiterate(); + PLAY_NOTE_ARRAY(music_scale, false, 0); + #endif + } + break; + case 12: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_off(_MUSIC); + stop_all_notes(); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + break; + case 13: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + break; + + } + return MACRO_NONE; +}; + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + _delay_ms(20); // stops the tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); + #endif +} + +#ifdef AUDIO_ENABLE +void play_goodbye_tone() +{ + PLAY_NOTE_ARRAY(goodbye, false, 0); + _delay_ms(150); +} + +uint8_t starting_note = 0x0C; +int offset = 7; + +void process_action_user(keyrecord_t *record) { + + if (IS_LAYER_ON(_MUSIC)) { + if (record->event.pressed) { + play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF); + } else { + stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row))); + } + } + +} +#endif diff --git a/keyboards/planck/keymaps/xyverz/makefile.mk b/keyboards/planck/keymaps/xyverz/makefile.mk new file mode 100644 index 000000000..99fbfbd0b --- /dev/null +++ b/keyboards/planck/keymaps/xyverz/makefile.mk @@ -0,0 +1,2 @@ +AUDIO_ENABLE = yes +NKRO_ENABLE = yes \ No newline at end of file diff --git a/keyboards/preonic/keymaps/xyverz/README.md b/keyboards/preonic/keymaps/xyverz/README.md new file mode 100644 index 000000000..9c23c5b9f --- /dev/null +++ b/keyboards/preonic/keymaps/xyverz/README.md @@ -0,0 +1,49 @@ +# The default Preonic layout - largely based on the Planck's + +## QWERTY Layer: + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | - | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ + +## LOWER Layer: + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ + +## RAISE Layer: + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ \ No newline at end of file diff --git a/keyboards/preonic/keymaps/xyverz/keymap.c b/keyboards/preonic/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..adc7392e5 --- /dev/null +++ b/keyboards/preonic/keymaps/xyverz/keymap.c @@ -0,0 +1,342 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MUSIC 5 +#define _ADJUST 16 + +// Macro name shortcuts +#define QWERTY M(_QWERTY) +#define COLEMAK M(_COLEMAK) +#define DVORAK M(_DVORAK) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) +#define M_BL 5 +#define AUD_OFF M(6) +#define AUD_ON M(7) +#define MUS_OFF M(8) +#define MUS_ON M(9) +#define VC_IN M(10) +#define VC_DE M(11) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | - | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL}, + {KC_MINS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, + {M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______}, + {M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Music (reserved for process_action_user) + * + */ +[_MUSIC] = { + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, + {_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +#ifdef AUDIO_ENABLE +float start_up[][2] = { + {440.0*pow(2.0,(14)/12.0), 20}, + {440.0*pow(2.0,(26)/12.0), 8}, + {440.0*pow(2.0,(18)/12.0), 20}, + {440.0*pow(2.0,(26)/12.0), 8} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + break; + case _COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + break; + case _DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + break; + case _LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case _RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case M_BL: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + case 6: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + audio_off(); + #endif + } + break; + case 7: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + audio_on(); + PLAY_NOTE_ARRAY(start_up, false, 0); + #endif + } + break; + case 8: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + layer_off(_MUSIC); + stop_all_notes(); + #endif + } + break; + case 9: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(music_scale, false, 0); + layer_on(_MUSIC); + #endif + } + break; + case 10: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + voice_iterate(); + PLAY_NOTE_ARRAY(music_scale, false, 0); + #endif + } + break; + case 11: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + voice_deiterate(); + PLAY_NOTE_ARRAY(music_scale, false, 0); + #endif + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(start_up, false, 0); + #endif +} + +#ifdef AUDIO_ENABLE + +uint8_t starting_note = 0x0C; +int offset = 7; + +void process_action_user(keyrecord_t *record) { + + if (IS_LAYER_ON(_MUSIC)) { + if (record->event.pressed) { + play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF); + } else { + stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row))); + } + } + +} + +void play_goodbye_tone() +{ + PLAY_NOTE_ARRAY(goodbye, false, 0); + _delay_ms(150); +} + +#endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/xyverz/makefile.mk b/keyboards/preonic/keymaps/xyverz/makefile.mk new file mode 100644 index 000000000..628167ff6 --- /dev/null +++ b/keyboards/preonic/keymaps/xyverz/makefile.mk @@ -0,0 +1 @@ +AUDIO_ENABLE = yes \ No newline at end of file -- cgit v1.2.3-24-g4f1b From de1db144d06b488937633110b0598a1cac68f4fc Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 8 Aug 2016 18:44:09 -0700 Subject: Delete dvorak.png Not reflective of my layout. --- keyboards/ergodox/keymaps/xyverz/dvorak.png | Bin 87314 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 keyboards/ergodox/keymaps/xyverz/dvorak.png diff --git a/keyboards/ergodox/keymaps/xyverz/dvorak.png b/keyboards/ergodox/keymaps/xyverz/dvorak.png deleted file mode 100644 index cb8316309..000000000 Binary files a/keyboards/ergodox/keymaps/xyverz/dvorak.png and /dev/null differ -- cgit v1.2.3-24-g4f1b From bf93fa510bcc5cec84bcd9d81cb8fae6beb1ebb4 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 8 Aug 2016 18:46:34 -0700 Subject: Delete readme.md file cleanup, removing file that doesn't apply to my layout. --- keyboards/ergodox/keymaps/xyverz/readme.md | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 keyboards/ergodox/keymaps/xyverz/readme.md diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md deleted file mode 100644 index 8f6dba45e..000000000 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# ErgoDox EZ Default Configuration - -## Changelog - -* Feb 2, 2016 (V1.1): - * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). - -This is what we ship with out of the factory. :) The image says it all: - -![Default](default_highres.png) -- cgit v1.2.3-24-g4f1b From c060afe68eb729fd3afcfdb3f16e28730ab868b3 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 8 Aug 2016 18:47:13 -0700 Subject: Delete old_keymap.c file cleanup --- keyboards/ergodox/keymaps/xyverz/old_keymap.c | 311 -------------------------- 1 file changed, 311 deletions(-) delete mode 100644 keyboards/ergodox/keymaps/xyverz/old_keymap.c diff --git a/keyboards/ergodox/keymaps/xyverz/old_keymap.c b/keyboards/ergodox/keymaps/xyverz/old_keymap.c deleted file mode 100644 index e082372f9..000000000 --- a/keyboards/ergodox/keymaps/xyverz/old_keymap.c +++ /dev/null @@ -1,311 +0,0 @@ -#include "ergodox.h" -#include "debug.h" -#include "action_layer.h" - -extern keymap_config_t keymap_config; - -#define _DVORAK 0 // default layer -#define _QWERTY 1 // symbols -#define _LOWER 2 -#define _RAISE 3 -#define _ADJUST 16 - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* - * Keymap 0: Dvorak - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ] | 1 | 2 | 3 | 4 | 5 | Esc | | ESC | 6 | 7 | 8 | 9 | 0 | [ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | ' | , | . | Y | Y |(Null)| |(Null)| F | G | C | R | L | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | - * |--------+------+------+------+------+------| FN1 | | FN2 |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCtr | LAlt | | Ralt | RCtr | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * | BkSp | Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' - * - * - ***************************************************************************************************** - * This Dvorak keyboard layout stems from my early Kinesis years, using the Contour PS/2 with a Dvorak - * software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the cor- - * ner keys. I've decided to continue using this layout with my ErgoDox. - */ - - [_DVORAK] = ( - KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, - KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, LOWER, - KC_LGUI, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, - KC_LCTL, KC_LALT, - KC_HOME, - KC_BSPC, KC_DEL, KC_END, - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, - NO, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - RAISE, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - KC_UP, KC_DOWN, KC_SLSH, KC_EQL, KC_RGUI, - KC_RALT, KC_RCTL, - KC_PGUP, - KC_PGDN, KC_ENT, KC_SPC -), - -/* Keymap 1: QWERTY - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -[_QWERTY] = ( - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - {ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - RAISE, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT -), - - -/* Lower 2: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[_LOWER] = ( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -/* Raise 3: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[_RAISE] = ( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), - -/* Adjust 16: Lower + Raise - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | Reset| | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| |Dvorak|Qwerty| | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -[_ADJUST] = ( - KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, QWERTY, DVORAK, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), - -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _DVORAK: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_DVORAK); - } - break; - case _QWERTY: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_QWERTY); - } - break; - case _LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - break; - case _RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - break; - - } - return MACRO_NONE; -}; - - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; -- cgit v1.2.3-24-g4f1b From 14938367626f0cddba4bc35abe62a9bcc02bee10 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 8 Aug 2016 18:48:36 -0700 Subject: Delete README.md file clean up. --- keyboards/preonic/keymaps/xyverz/README.md | 49 ------------------------------ 1 file changed, 49 deletions(-) delete mode 100644 keyboards/preonic/keymaps/xyverz/README.md diff --git a/keyboards/preonic/keymaps/xyverz/README.md b/keyboards/preonic/keymaps/xyverz/README.md deleted file mode 100644 index 9c23c5b9f..000000000 --- a/keyboards/preonic/keymaps/xyverz/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# The default Preonic layout - largely based on the Planck's - -## QWERTY Layer: - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | - | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | - * `-----------------------------------------------------------------------------------' - */ - -## LOWER Layer: - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | - * `-----------------------------------------------------------------------------------' - */ - -## RAISE Layer: - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | - * `-----------------------------------------------------------------------------------' - */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 4e030313f7f55be7573eaab0b91e45290dc2d0b3 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 8 Aug 2016 18:51:34 -0700 Subject: Delete README.md file cleanup --- keyboards/planck/keymaps/xyverz/README.md | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 keyboards/planck/keymaps/xyverz/README.md diff --git a/keyboards/planck/keymaps/xyverz/README.md b/keyboards/planck/keymaps/xyverz/README.md deleted file mode 100644 index b0054fc30..000000000 --- a/keyboards/planck/keymaps/xyverz/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Zrevyx's Planck Layout - -- cgit v1.2.3-24-g4f1b From c062b6a13d7974144b5ab02896d2213051fd91ad Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 8 Aug 2016 18:52:48 -0700 Subject: Delete keymap.c file cleanup --- keyboards/ergodox/keymaps/xyverz/keymap.c | 184 ------------------------------ 1 file changed, 184 deletions(-) delete mode 100644 keyboards/ergodox/keymaps/xyverz/keymap.c diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c deleted file mode 100644 index dd39dbacb..000000000 --- a/keyboards/ergodox/keymaps/xyverz/keymap.c +++ /dev/null @@ -1,184 +0,0 @@ -#include "ergodox.h" -#include "debug.h" -#include "action_layer.h" - -#define BASE 0 // default layer -#define SYMB 1 // symbols -#define MDIA 2 // media keys - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Basic layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | \ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Del | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |------| D | H | T | N |S / L2| - | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| - * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | App | LGui | | Alt |Ctrl/Esc| - * ,------|------|------| |------+--------+------. - * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * | |ace | End | | PgDn | | | - * `--------------------' `----------------------' - */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = KEYMAP( // layer 0 : default - // left hand - KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_DELT, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(1), - KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, - TG(1), KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, - KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), KC_MINS, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT, - KC_UP, KC_DOWN,KC_SLSH,KC_EQL, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), -/* Keymap 1: Symbol Layer - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | . | 0 | = | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// SYMBOLS -[SYMB] = KEYMAP( - // left hand - KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS, - KC_TRNS, - KC_TRNS,KC_TRNS,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS -), -/* Keymap 2: Media and mouse keys - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | - * | | | | | | | | - * `--------------------' `--------------------' - */ -// MEDIA AND MOUSE -KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK -), -}; - -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - - uint8_t layer = biton32(layer_state); - - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - // TODO: Make this relevant to the ErgoDox EZ. - case 1: - ergodox_right_led_1_on(); - break; - case 2: - ergodox_right_led_2_on(); - break; - default: - // none - break; - } - -}; -- cgit v1.2.3-24-g4f1b From 39dd3d674cfb7299ce377f70a678d3613f826e0a Mon Sep 17 00:00:00 2001 From: Ian Sterling Date: Mon, 8 Aug 2016 19:35:13 -0700 Subject: Changed behavior of _DVORAK layout's KC_RSFT to SFT_T(KC_ENT) for flexibility's sake. Updated the rest of the keymap to reflect the current (as of 19:37 on 08 Aug 2018) default layout and default makefile. --- keyboards/planck/keymaps/xyverz/README.md | 2 - keyboards/planck/keymaps/xyverz/keymap.c | 335 +++++++++++----------------- keyboards/planck/keymaps/xyverz/makefile.mk | 27 ++- 3 files changed, 160 insertions(+), 204 deletions(-) delete mode 100644 keyboards/planck/keymaps/xyverz/README.md diff --git a/keyboards/planck/keymaps/xyverz/README.md b/keyboards/planck/keymaps/xyverz/README.md deleted file mode 100644 index b0054fc30..000000000 --- a/keyboards/planck/keymaps/xyverz/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Zrevyx's Planck Layout - diff --git a/keyboards/planck/keymaps/xyverz/keymap.c b/keyboards/planck/keymaps/xyverz/keymap.c index 9ac78ec15..90529428d 100644 --- a/keyboards/planck/keymaps/xyverz/keymap.c +++ b/keyboards/planck/keymaps/xyverz/keymap.c @@ -19,25 +19,19 @@ extern keymap_config_t keymap_config; #define _DVORAK 2 #define _LOWER 3 #define _RAISE 4 -#define _MUSIC 5 -#define _PLOVER 6 +#define _PLOVER 5 #define _ADJUST 16 -// Macro name shortcuts -#define QWERTY M(_QWERTY) -#define COLEMAK M(_COLEMAK) -#define DVORAK M(_DVORAK) -#define LOWER M(_LOWER) -#define RAISE M(_RAISE) -#define M_BL 5 -#define AUD_OFF M(6) -#define AUD_ON M(7) -#define MUS_OFF M(8) -#define MUS_ON M(9) -#define VC_IN M(10) -#define VC_DE M(11) -#define PLOVER M(12) -#define EXT_PLV M(13) +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; // Fillers to make layering more clear #define _______ KC_TRNS @@ -60,7 +54,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Colemak @@ -78,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Dvorak @@ -95,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)}, {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } }, @@ -114,7 +108,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______}, {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, - {M(M_BL), _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} + {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} }, /* Raise @@ -132,17 +126,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______}, - {M(M_BL), _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} -}, - -/* Music (reserved for process_action_user) - * - */ -[_MUSIC] = { - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} + {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} }, /* Plover layer (http://opensteno.org) @@ -151,7 +135,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | | S | T | P | H | * | * | F | P | L | T | D | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | S | K | W | R | * | * | R | B | G | S | Z | + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Exit | | | A | O | | E | U | | | | * `-----------------------------------------------------------------------------------' @@ -170,42 +154,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_ADJUST] = { {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, - {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, - {_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} } -}; - -const uint16_t PROGMEM fn_actions[] = { - }; #ifdef AUDIO_ENABLE -float tone_startup[][2] = { - {440.0*pow(2.0,(31)/12.0), 12}, - {440.0*pow(2.0,(28)/12.0), 8}, - {440.0*pow(2.0,(19)/12.0), 8}, - {440.0*pow(2.0,(24)/12.0), 8}, - {440.0*pow(2.0,(28)/12.0), 20} -}; +float tone_startup[][2] = SONG(STARTUP_SOUND); float tone_qwerty[][2] = SONG(QWERTY_SOUND); float tone_dvorak[][2] = SONG(DVORAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND); float tone_plover[][2] = SONG(PLOVER_SOUND); float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -float goodbye[][2] = SONG(GOODBYE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); #endif @@ -214,166 +188,127 @@ void persistant_default_layer_set(uint16_t default_layer) { default_layer_set(default_layer); } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - break; - case _COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_colemak, false, 0); - #endif - persistant_default_layer_set(1UL<<_COLEMAK); - } - break; - case _DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_dvorak, false, 0); - #endif - persistant_default_layer_set(1UL<<_DVORAK); - } - break; - case _LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - break; - case _RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - break; - case M_BL: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; - case 6: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - audio_off(); - #endif - } - break; - case 7: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - audio_on(); - PLAY_NOTE_ARRAY(tone_startup, false, 0); - #endif - } - break; - case 8: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - layer_off(_MUSIC); - stop_all_notes(); - #endif - } - break; - case 9: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(music_scale, false, 0); - layer_on(_MUSIC); - #endif - } - break; - case 10: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - voice_iterate(); - PLAY_NOTE_ARRAY(music_scale, false, 0); - #endif - } - break; - case 11: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - voice_deiterate(); - PLAY_NOTE_ARRAY(music_scale, false, 0); - #endif - } - break; - case 12: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_plover, false, 0); - #endif - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_off(_MUSIC); - stop_all_notes(); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - break; - case 13: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); - #endif - layer_off(_PLOVER); - } - break; - +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); } - return MACRO_NONE; -}; + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - _delay_ms(20); // stops the tick - PLAY_NOTE_ARRAY(tone_startup, false, 0); - #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif } #ifdef AUDIO_ENABLE -void play_goodbye_tone() + +void startup_user() { - PLAY_NOTE_ARRAY(goodbye, false, 0); - _delay_ms(150); + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); } -uint8_t starting_note = 0x0C; -int offset = 7; - -void process_action_user(keyrecord_t *record) { +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} - if (IS_LAYER_ON(_MUSIC)) { - if (record->event.pressed) { - play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF); - } else { - stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row))); - } - } +void music_on_user(void) +{ + music_scale_user(); +} +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); } -#endif + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/xyverz/makefile.mk b/keyboards/planck/keymaps/xyverz/makefile.mk index 99fbfbd0b..0f4953888 100644 --- a/keyboards/planck/keymaps/xyverz/makefile.mk +++ b/keyboards/planck/keymaps/xyverz/makefile.mk @@ -1,2 +1,25 @@ -AUDIO_ENABLE = yes -NKRO_ENABLE = yes \ No newline at end of file + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif -- cgit v1.2.3-24-g4f1b From ca3278cc356038ecdaf96fe12025b43c18692976 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Tue, 9 Aug 2016 09:31:56 -0700 Subject: adds Xyverz's keymaps (#615) * Adding my own keymaps to the following keyboards: Planck, Preonic, Atreus, Ergodox * Delete dvorak.png Not reflective of my layout. * Delete readme.md file cleanup, removing file that doesn't apply to my layout. * Delete old_keymap.c file cleanup * Delete README.md file clean up. * Delete README.md file cleanup * Delete keymap.c file cleanup * Changed behavior of _DVORAK layout's KC_RSFT to SFT_T(KC_ENT) for flexibility's sake. Updated the rest of the keymap to reflect the current (as of 19:37 on 08 Aug 2018) default layout and default makefile. --- keyboards/atreus/keymaps/xyverz/keymap.c | 89 +++++++ keyboards/planck/keymaps/xyverz/keymap.c | 314 ++++++++++++++++++++++++ keyboards/planck/keymaps/xyverz/makefile.mk | 25 ++ keyboards/preonic/keymaps/xyverz/keymap.c | 342 +++++++++++++++++++++++++++ keyboards/preonic/keymaps/xyverz/makefile.mk | 1 + 5 files changed, 771 insertions(+) create mode 100644 keyboards/atreus/keymaps/xyverz/keymap.c create mode 100644 keyboards/planck/keymaps/xyverz/keymap.c create mode 100644 keyboards/planck/keymaps/xyverz/makefile.mk create mode 100644 keyboards/preonic/keymaps/xyverz/keymap.c create mode 100644 keyboards/preonic/keymaps/xyverz/makefile.mk diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..447fbcf10 --- /dev/null +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -0,0 +1,89 @@ +// This is the personal keymap of Ian Sterling (@xyverz). It is based on the keymap by +// Chris Gerber (@gerbercj), with the addition of persistent layers like the Planck and +// Preonic keyboards by Jack Humbert. + +#include "atreus.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DV 0 +#define _QW 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 + +// Macro name shortcuts +#define DVORAK M(_DV) +#define QWERTY M(_QW) +#define COLEMAK M(_CM) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_DV] = { /* Dvorak */ + {KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_NO, KC_F, KC_G, KC_C, KC_R, KC_L }, + {KC_A, KC_O, KC_E, KC_U, KC_I, KC_NO, KC_D, KC_H, KC_T, KC_N, KC_S }, + {SFT_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, CTL_T(KC_DEL), KC_B, KC_M, KC_W, KC_V, SFT_T(KC_Z) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_SLSH, KC_EQL} + }, + [_QW] = { /* Qwerty */ + {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P }, + {KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT} + }, + [_CM] = { /* Colemak */ + {KC_Q, KC_W, KC_F, KC_P, KC_G, KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN}, + {KC_A, KC_R, KC_S, KC_T, KC_D, KC_NO, KC_H, KC_N, KC_E, KC_I, KC_O }, + {SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, CTL_T(KC_DEL), KC_K, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH) }, + {KC_ESC, KC_TAB, KC_LGUI, MO(_L2), KC_BSPC, ALT_T(KC_ENT), KC_SPC, MO(_L1), KC_MINS, KC_QUOT, KC_ENT} + }, + [_L1] = { /* LAYER 1 */ + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 }, + {KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_EQL }, + {KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, + {KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } + }, + [_L2] = { /* LAYER 2 */ + {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 }, + {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12 }, + {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, RESET } + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/planck/keymaps/xyverz/keymap.c b/keyboards/planck/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..90529428d --- /dev/null +++ b/keyboards/planck/keymaps/xyverz/keymap.c @@ -0,0 +1,314 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Bksp |Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, + {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Del | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______}, + {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/xyverz/makefile.mk b/keyboards/planck/keymaps/xyverz/makefile.mk new file mode 100644 index 000000000..0f4953888 --- /dev/null +++ b/keyboards/planck/keymaps/xyverz/makefile.mk @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/preonic/keymaps/xyverz/keymap.c b/keyboards/preonic/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..adc7392e5 --- /dev/null +++ b/keyboards/preonic/keymaps/xyverz/keymap.c @@ -0,0 +1,342 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MUSIC 5 +#define _ADJUST 16 + +// Macro name shortcuts +#define QWERTY M(_QWERTY) +#define COLEMAK M(_COLEMAK) +#define DVORAK M(_DVORAK) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) +#define M_BL 5 +#define AUD_OFF M(6) +#define AUD_ON M(7) +#define MUS_OFF M(8) +#define MUS_ON M(9) +#define VC_IN M(10) +#define VC_DE M(11) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | - | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL}, + {KC_MINS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | - | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | Left |Right |Lower | Space |Raise | Up | Down | GUI |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT}, + {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_SPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Mute | Vol- | Vol+ | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______}, + {M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | Play | Next | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | Home | End | | Ins | | PgUp | PgDN | |Enter | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, + {KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______}, + {M(M_BL), _______, KC_HOME, KC_END, _______, KC_INS, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} +}, + +/* Music (reserved for process_action_user) + * + */ +[_MUSIC] = { + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AUD_ON, AUD_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, + {_______, VC_DE, VC_IN, MUS_ON, MUS_OFF, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +#ifdef AUDIO_ENABLE +float start_up[][2] = { + {440.0*pow(2.0,(14)/12.0), 20}, + {440.0*pow(2.0,(26)/12.0), 8}, + {440.0*pow(2.0,(18)/12.0), 20}, + {440.0*pow(2.0,(26)/12.0), 8} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + break; + case _COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + break; + case _DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + break; + case _LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case _RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + break; + case M_BL: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + case 6: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + audio_off(); + #endif + } + break; + case 7: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + audio_on(); + PLAY_NOTE_ARRAY(start_up, false, 0); + #endif + } + break; + case 8: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + layer_off(_MUSIC); + stop_all_notes(); + #endif + } + break; + case 9: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(music_scale, false, 0); + layer_on(_MUSIC); + #endif + } + break; + case 10: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + voice_iterate(); + PLAY_NOTE_ARRAY(music_scale, false, 0); + #endif + } + break; + case 11: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + voice_deiterate(); + PLAY_NOTE_ARRAY(music_scale, false, 0); + #endif + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(start_up, false, 0); + #endif +} + +#ifdef AUDIO_ENABLE + +uint8_t starting_note = 0x0C; +int offset = 7; + +void process_action_user(keyrecord_t *record) { + + if (IS_LAYER_ON(_MUSIC)) { + if (record->event.pressed) { + play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF); + } else { + stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row))); + } + } + +} + +void play_goodbye_tone() +{ + PLAY_NOTE_ARRAY(goodbye, false, 0); + _delay_ms(150); +} + +#endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/xyverz/makefile.mk b/keyboards/preonic/keymaps/xyverz/makefile.mk new file mode 100644 index 000000000..628167ff6 --- /dev/null +++ b/keyboards/preonic/keymaps/xyverz/makefile.mk @@ -0,0 +1 @@ +AUDIO_ENABLE = yes \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 2a160bbbe3ad496dd688f4399ab2b8d127c0b8a7 Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Tue, 9 Aug 2016 17:33:07 +0100 Subject: Update keymap. (#616) * changed order of bottom row of symbol layer to ease acess to brackets * updated readme.md to reflect keymap changes --- keyboards/planck/keymaps/callum/keymap.c | 4 ++-- keyboards/planck/keymaps/callum/readme.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index a747dcb15..ed187df1d 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------------------. * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | ~ | | | + | [ | { | } | ] | = | \ | ` | | + * | | ~ | ` | + | = | | | \ | [ | ] | { | } | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' @@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_SYMB] = { {KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC }, {KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, - {_______, KC_TILD, KC_PIPE, KC_PLUS, KC_LBRC, KC_LCBR, KC_RCBR, KC_RBRC, KC_EQL, KC_BSLS, KC_GRV, _______}, + {_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, diff --git a/keyboards/planck/keymaps/callum/readme.md b/keyboards/planck/keymaps/callum/readme.md index d4f3449f1..030def7f7 100644 --- a/keyboards/planck/keymaps/callum/readme.md +++ b/keyboards/planck/keymaps/callum/readme.md @@ -31,9 +31,9 @@ On *macOS* I recommend using [Karabiner](https://pqrs.org/osx/karabiner/) and ti None of the modifiers are overwritten so that `shift-alt-arrows` etc work as expected. ## The `SYMB` layer -![](http://i.imgur.com/iuU144Y.png) +![](http://i.imgur.com/thh1ne2.png) -The symbol layer has all the numbers and their usual corresponding symbols in the first two rows, with the symbols on the home row since I use them more frequently than the numbers. The third row contains all the remaining symbols, with brackets in the centre; then normally shifted symbols to the left, and non shifted to the right, in order of most to least used. +The symbol layer has all the numbers and their usual corresponding symbols in the first two rows, with the symbols on the home row since I use them more frequently than the numbers. The third row contains all the remaining symbols, arranged roughly so that the most used symbols are accessible with the strongest fingers. `esc` and `del` are repeated here since I wanted to be able to reach either, one handed, with either hand. -- cgit v1.2.3-24-g4f1b From 6f700f1eb0c76aa19187efd83ab2b49a0db7f71f Mon Sep 17 00:00:00 2001 From: Ian Sterling Date: Tue, 9 Aug 2016 23:49:27 -0700 Subject: Adding my own layouts for the Phantom and Ergodox. My Ergodox layout adds persistent layers based on the Planck and Preonic setup. The layout arrays are pulled directly from the ergodox/ez/ez.h keymap definition starting at line 81. --- keyboards/ergodox/keymaps/xyverz/keymap.c | 311 ++++++++++++++++++++++++++++++ keyboards/phantom/keymaps/xyverz/keymap.c | 67 +++++++ 2 files changed, 378 insertions(+) create mode 100644 keyboards/ergodox/keymaps/xyverz/keymap.c create mode 100644 keyboards/phantom/keymaps/xyverz/keymap.c diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..c5ce99dd2 --- /dev/null +++ b/keyboards/ergodox/keymaps/xyverz/keymap.c @@ -0,0 +1,311 @@ +/* + * The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak + * software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner + * keys. I've decided to continue using this layout with my ErgoDox. + * + * The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional + * keys as shown in the diagrams. The Colemak layout is merely an adaptation of that. + * + * I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck + * layouts. + * + * For a better explanation of the layout matrices shown below, take a look at ../../ez/ez.h where the + * keymap is defined, beginning on line 81. + * + */ + +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _DV 0 // Dvorak layer +#define _QW 1 // Qwerty layer +#define _CM 2 // Colemak layer +#define _MD 3 // Media Layer +#define _KP 4 // Keypad Layer + +// Macro name shortcuts +#define DVORAK M(_DV) +#define QWERTY M(_QW) +#define COLEMAK M(_CM) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Dvorak layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | ' | , | . | Y | Y | | | | F | G | C | R | L | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCtr | LAlt | | Ralt | RCtr | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' + * + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[_DV] = { // layer 0 : Dvorak + // left hand + {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, KC_NO }, + {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV, KC_END }, + {KC_2, KC_COMM, KC_O, KC_Q, KC_INS, KC_DEL }, + {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT, KC_BSPC}, + {KC_4, KC_P, KC_U, KC_K, KC_RGHT, KC_HOME}, + {KC_5, KC_Y, KC_I, KC_X, KC_NO, KC_LCTL}, + {KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT}, + + // right hand + {KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT}, + {KC_6, KC_F, KC_D, KC_B, KC_NO, KC_RCTL}, + {KC_7, KC_G, KC_H, KC_M, KC_UP, KC_PGUP}, + {KC_8, KC_C, KC_T, KC_W, KC_DOWN, KC_SPC }, + {KC_9, KC_R, KC_N, KC_V, KC_SLSH, KC_ENT }, + {KC_0, KC_L, KC_S, KC_Z, KC_EQL, KC_PGDN}, + {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI, KC_NO } +}, + +/* Keymap 1: QWERTY layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCtr | LAlt | | Ralt | RCtr | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[_QW] = { // layer 1 : QWERTY + // left hand + {KC_EQL, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, KC_NO }, + {KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END }, + {KC_2, KC_W, KC_S, KC_X, KC_INS, KC_DEL }, + {KC_3, KC_E, KC_D, KC_C, KC_LEFT, KC_BSPC}, + {KC_4, KC_R, KC_F, KC_V, KC_RGHT, KC_HOME}, + {KC_5, KC_T, KC_G, KC_B, KC_NO, KC_LCTL}, + {KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT}, + + // right hand + {KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT}, + {KC_6, KC_Y, KC_H, KC_N, KC_NO, KC_RCTL}, + {KC_7, KC_U, KC_J, KC_M, KC_UP, KC_PGUP}, + {KC_8, KC_I, KC_K, KC_COMM, KC_DOWN, KC_SPC }, + {KC_9, KC_O, KC_L, KC_DOT, KC_LBRC, KC_ENT }, + {KC_0, KC_P, KC_SCLN, KC_SLSH, KC_RBRC, KC_PGDN}, + {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, KC_NO } + }, + +/* Keymap 2: Colemak layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCtr | LAlt | | Ralt | RCtr | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[_CM] = { // layer 2 : Colemak + // left hand + {KC_EQL, KC_TAB, KC_BSPC, KC_LSFT, KC_LGUI, KC_NO }, + {KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END }, + {KC_2, KC_W, KC_R, KC_X, KC_INS, KC_DEL }, + {KC_3, KC_F, KC_S, KC_C, KC_LEFT, KC_BSPC}, + {KC_4, KC_P, KC_T, KC_V, KC_RGHT, KC_HOME}, + {KC_5, KC_G, KC_D, KC_B, KC_NO, KC_LCTL}, + {KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT}, + + // right hand + {KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT}, + {KC_6, KC_J, KC_H, KC_K, KC_NO, KC_RCTL}, + {KC_7, KC_L, KC_N, KC_M, KC_UP, KC_PGUP}, + {KC_8, KC_U, KC_E, KC_COMM, KC_DOWN, KC_SPC }, + {KC_9, KC_Y, KC_I, KC_DOT, KC_LBRC, KC_ENT }, + {KC_0, KC_SCLN, KC_O, KC_SLSH, KC_RBRC, KC_PGDN}, + {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, KC_NO } + }, + +/* Keymap 3: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | PrSc | ScLk | Paus | | FN4 | | FN5 | | Mute | Vol- | Vol+ | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | + * |--------+------+------+------+------+------| FN4 | | FN5 |------+------+------+------+------+--------| + * | | |Dvorak|Qwerty|Colemk| | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// Media Layer +[_MD] = { // layer 3 : Media layer + // left hand + {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO }, + {KC_F1, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_F2, KC_PSCR, KC_TRNS, DVORAK, KC_TRNS, KC_TRNS}, + {KC_F3, KC_SLCK, KC_TRNS, QWERTY, KC_TRNS, KC_TRNS}, + {KC_F4, KC_PAUS, KC_TRNS, COLEMAK, KC_TRNS, KC_TRNS}, + {KC_F5, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS}, + {KC_F11, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS}, + + // right hand + {KC_F12, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS}, + {KC_F6, KC_TRNS, KC_MSTP, KC_TRNS, KC_NO, KC_TRNS}, + {KC_F7, KC_MUTE, KC_MPRV, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_F8, KC_VOLD, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_F9, KC_VOLU, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_F10, KC_TRNS, KC_MSEL, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO } + }, + +/* Keymap 4: Keypad layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Power | | | | | | | | | | NmLk | KP / | KP * | KP - | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Sleep | | | | | | FN5 | | FN4 | | KP 7 | KP 8 | KP 9 | KP + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | + * |--------+------+------+------+------+------| FN5 | | FN4 |------+------+------+------+------+--------| + * | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | KP 0 | | KP . |KP Ent| | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// Keypad Layer +[_KP] = { // layer 4 : Keypad layer + // left hand + {KC_PWR, KC_SLEP, KC_WAKE, KC_TRNS, KC_TRNS, KC_NO }, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS}, + {KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS}, + + // right hand + {KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS}, + {KC_NLCK, KC_P7, KC_P4, KC_P1, KC_P0, KC_TRNS}, + {KC_PSLS, KC_P8, KC_P5, KC_P2, KC_NO, KC_TRNS}, + {KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, KC_TRNS}, + {KC_PMNS, KC_PPLS, KC_PPLS, KC_PENT, KC_PENT, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO } + }, + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/phantom/keymaps/xyverz/keymap.c b/keyboards/phantom/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..5948e4ca5 --- /dev/null +++ b/keyboards/phantom/keymaps/xyverz/keymap.c @@ -0,0 +1,67 @@ +#include "phantom.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------------------------. + * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| + * |-----------------------------------------------------------| |--------------| + * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| + * |-----------------------------------------------------------| |--------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| + * |-----------------------------------------------------------| `--------------' + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,----. + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | + * |-----------------------------------------------------------| ,-------------. + * |Ctrl|Gui |Alt | Space |ALT |GUI |_FL |CTRL | |Lft| Dn |Rig | + * `-----------------------------------------------------------' `-------------' + */ +[_BL] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DELETE, KC_END, KC_PGDN, \ + KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------------------------. + * |RESET| | | | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| |--------------| + * | | | | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| `--------------' + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------| ,----. + * | | F1| F2| F3| F4| F5|F6 |F7 |F8 | | | | | | + * |-----------------------------------------------------------| ,-------------. + * | | | | | | | | | | | | | + * `-----------------------------------------------------------' `-------------' + */ +[_FL] = KEYMAP( + KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_SLEP, \ + RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MUTE,KC_VOLD,KC_VOLU,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,KC_MSEL, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS,KC_TRNS,KC_CALC,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_CAPS, KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS) +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { +} -- cgit v1.2.3-24-g4f1b From 0d6035524173219ced32abbfa2e78171edab17ff Mon Sep 17 00:00:00 2001 From: Ian Sterling Date: Tue, 9 Aug 2016 23:56:21 -0700 Subject: Added braces using LSFT(KC_LBRC) and LSFT(KC_RBRC) since the normal RBCR and LBCR didn't work for me. --- keyboards/atreus/keymaps/xyverz/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c index 447fbcf10..f4d4a9cf0 100644 --- a/keyboards/atreus/keymaps/xyverz/keymap.c +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 }, {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12 }, - {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, RESET } + {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET } } }; -- cgit v1.2.3-24-g4f1b From 6975135f545d08955ed26ef046a0333e291af716 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Wed, 10 Aug 2016 11:40:51 +0200 Subject: updated reference Build setup links to main readme now. --- doc/TMK_README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/TMK_README.md b/doc/TMK_README.md index 0c75a0e27..e3438eda2 100644 --- a/doc/TMK_README.md +++ b/doc/TMK_README.md @@ -113,7 +113,7 @@ Third party libraries like LUFA, PJRC and V-USB have their own license respectiv Build Firmware and Program Controller ------------------------------------- -See [doc/BUILD_GUIDE.md](tmk_core/doc/BUILD_GUIDE.md), or the readme in the particular keyboards/* folder. +See [build environment setup](/readme.md#build-environment-setup), or the readme in the particular keyboards/* folder. -- cgit v1.2.3-24-g4f1b From aa1a90af66df6ab12a371416e23094315c4a43b3 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 11 Aug 2016 00:54:55 +0200 Subject: Added S60-X to keyboards with two layouts. --- .gitignore | 1 + keyboards/s60-x/Makefile | 75 ++++++++++++++ keyboards/s60-x/config.h | 164 ++++++++++++++++++++++++++++++ keyboards/s60-x/keymaps/default/Makefile | 21 ++++ keyboards/s60-x/keymaps/default/keymap.c | 92 +++++++++++++++++ keyboards/s60-x/keymaps/default/readme.md | 1 + keyboards/s60-x/keymaps/felix/Makefile | 21 ++++ keyboards/s60-x/keymaps/felix/keymap.c | 110 ++++++++++++++++++++ keyboards/s60-x/keymaps/felix/readme.md | 1 + keyboards/s60-x/readme.md | 32 ++++++ keyboards/s60-x/s60-x.c | 28 +++++ keyboards/s60-x/s60-x.h | 44 ++++++++ 12 files changed, 590 insertions(+) create mode 100644 keyboards/s60-x/Makefile create mode 100644 keyboards/s60-x/config.h create mode 100644 keyboards/s60-x/keymaps/default/Makefile create mode 100644 keyboards/s60-x/keymaps/default/keymap.c create mode 100644 keyboards/s60-x/keymaps/default/readme.md create mode 100644 keyboards/s60-x/keymaps/felix/Makefile create mode 100644 keyboards/s60-x/keymaps/felix/keymap.c create mode 100644 keyboards/s60-x/keymaps/felix/readme.md create mode 100644 keyboards/s60-x/readme.md create mode 100644 keyboards/s60-x/s60-x.c create mode 100644 keyboards/s60-x/s60-x.h diff --git a/.gitignore b/.gitignore index 8c85d6ffa..07bbf13db 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ CMakeLists.txt .settings/ .idea .browse.VC.db* +*.stackdump diff --git a/keyboards/s60-x/Makefile b/keyboards/s60-x/Makefile new file mode 100644 index 000000000..57edd5e03 --- /dev/null +++ b/keyboards/s60-x/Makefile @@ -0,0 +1,75 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +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 ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../Makefile +endif + + diff --git a/keyboards/s60-x/config.h b/keyboards/s60-x/config.h new file mode 100644 index 000000000..d548a99b3 --- /dev/null +++ b/keyboards/s60-x/config.h @@ -0,0 +1,164 @@ +/* +Copyright 2012 Jun Wako +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +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 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Massdrop +#define PRODUCT S60-X +#define DESCRIPTION q.m.k. keyboard firmware for S60-X + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B7, B3, B2, B1, B0 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/s60-x/keymaps/default/Makefile b/keyboards/s60-x/keymaps/default/Makefile new file mode 100644 index 000000000..f4671a9d1 --- /dev/null +++ b/keyboards/s60-x/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/default/keymap.c b/keyboards/s60-x/keymaps/default/keymap.c new file mode 100644 index 000000000..aa2856525 --- /dev/null +++ b/keyboards/s60-x/keymaps/default/keymap.c @@ -0,0 +1,92 @@ +/* +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +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 . +*/ + +#include "s60-x.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layout 0: Default Layer + * ,-----------------------------------------------------------. + * |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Fn1 |Gui |Alt | SpaceFn |Alt |Gui |App |Ctrl| + * `-----------------------------------------------------------' + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + FN1, LGUI, LALT, FN0, RALT, RGUI, APP, RCTL), + + /* Layout 1: Function Layer + * ,-----------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | + * |-----------------------------------------------------------| + * | |Prv|Ply|Nxt|Stp| | |PUp|Up |PDn| |Slk|Pau|Ins | + * |-----------------------------------------------------------| + * | |Vl-|Mut|Vl+| | |Hom|Lef|Dow|Rig|End| |PEnt | + * |-----------------------------------------------------------| + * | |Prt|Cut|Cop|Pst|Cal| | | | | |CapsLock | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ + TRNS, MPRV, MPLY, MNXT, MSTP, TRNS, TRNS, PGUP, UP, PGDN, TRNS, SLCK, PAUS, INS, \ + TRNS, VOLD, MUTE, VOLU, TRNS, TRNS, HOME, LEFT, DOWN, RGHT, END, TRNS, TRNS, PENT, \ + TRNS, TRNS, PSCR, FN2, FN3, FN4, CALC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CAPS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* +* Fn action definition +*/ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), /* SpaceFn layout 1 */ + [1] = ACTION_LAYER_MOMENTARY(1), /* Momentary layout 1 */ + [2] = ACTION_MODS_KEY(MOD_LSFT, KC_DEL), /* Cut */ + [3] = ACTION_MODS_KEY(MOD_LCTL, KC_INS), /* Copy */ + [4] = ACTION_MODS_KEY(MOD_LSFT, KC_INS), /* Paste */ +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/default/readme.md b/keyboards/s60-x/keymaps/default/readme.md new file mode 100644 index 000000000..73318dad7 --- /dev/null +++ b/keyboards/s60-x/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for s60-x \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/felix/Makefile b/keyboards/s60-x/keymaps/felix/Makefile new file mode 100644 index 000000000..251e4631d --- /dev/null +++ b/keyboards/s60-x/keymaps/felix/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/felix/keymap.c b/keyboards/s60-x/keymaps/felix/keymap.c new file mode 100644 index 000000000..a5ff1ae4d --- /dev/null +++ b/keyboards/s60-x/keymaps/felix/keymap.c @@ -0,0 +1,110 @@ +/* +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +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 . +*/ + +#include "s60-x.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layout 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|BckSp| + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Up |Fn1 | + * |-----------------------------------------------------------| + * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| + * `-----------------------------------------------------------' + */ + KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_FN1, \ + KC_FN2, KC_LGUI, KC_LALT, KC_FN0, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Layout 1: Gaming Layer, SpaceFn disabled + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | |Fn1 | + * |-----------------------------------------------------------| + * | | NOP| | Space | | | | | + * `-----------------------------------------------------------' + */ + KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_FN1, \ + KC_TRNS, KC_NO, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + /* Layout 2: Function Layer + * ,-----------------------------------------------------------. + * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |RES| + * |-----------------------------------------------------------| + * | |Prv|Ply|Nxt|Stp| | |PUp|Up |PDn| |Slk|Pau|Ins | + * |-----------------------------------------------------------| + * | |Vl-|Mut|Vl+| | |Hom|Lef|Dow|Rig|End| |PEnt | + * |-----------------------------------------------------------| + * | |Prt| | | |Cal| | | | |Pau |PUp |Rsft| + * |-----------------------------------------------------------| + * | | | | | |Home|PDn |End | + * `-----------------------------------------------------------' + */ + KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DEBUG, RESET, \ + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_SLCK, KC_PAUS, KC_INS, \ + KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, KC_PENT, \ + KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, KC_PGUP, KC_RSFT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), +}; + +/* +* Fn action definition +*/ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), /* SpaceFn layout 1 */ + [1] = ACTION_LAYER_TOGGLE(1), /* Disable SpaceFn */ + [2] = ACTION_LAYER_MOMENTARY(2) /* SpaceFn layout 1 */ +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/felix/readme.md b/keyboards/s60-x/keymaps/felix/readme.md new file mode 100644 index 000000000..73318dad7 --- /dev/null +++ b/keyboards/s60-x/keymaps/felix/readme.md @@ -0,0 +1 @@ +# The default keymap for s60-x \ No newline at end of file diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md new file mode 100644 index 000000000..34c48b0b7 --- /dev/null +++ b/keyboards/s60-x/readme.md @@ -0,0 +1,32 @@ +S60-x keyboard firmware +====================== +DIY compact keyboard by Massdrop. This is a port from TMK to QMK based on the [original S60-X Repo](https://github.com/jpec/s60x). + +## S60X Resources +- [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit) + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/s60-x folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make`. + +### Other Keymaps + +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: + +``` +$ make keymap=[default|] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` \ No newline at end of file diff --git a/keyboards/s60-x/s60-x.c b/keyboards/s60-x/s60-x.c new file mode 100644 index 000000000..417358140 --- /dev/null +++ b/keyboards/s60-x/s60-x.c @@ -0,0 +1,28 @@ +#include "s60-x.h" + +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(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/s60-x/s60-x.h b/keyboards/s60-x/s60-x.h new file mode 100644 index 000000000..714de30db --- /dev/null +++ b/keyboards/s60-x/s60-x.h @@ -0,0 +1,44 @@ +/* +Copyright 2012,2013 Jun Wako +Copyright 2015 Vinícius Nery Cordeiro +Copyright 2016 Felix Uhl + +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 S60X_H +#define S60X_H + +#include "quantum.h" + +/* S60-X keymap definition macro +* K2C, K31 and K3C are extra keys for ISO +* K0D is extra key from split backspace, K3E is extra key from split right shift +*/ + +#define KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, KC_NO } \ +} + +#endif -- cgit v1.2.3-24-g4f1b From a41a53baadf14b50d63fc9424aca67e7bde193f3 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 11 Aug 2016 09:13:38 +0200 Subject: Fix dead link in keycode.txt The link to the HID Usage tables was outdated and dead, so I replaced it. --- doc/keycode.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/keycode.txt b/doc/keycode.txt index c1134f9bf..5a42c50bf 100644 --- a/doc/keycode.txt +++ b/doc/keycode.txt @@ -2,7 +2,7 @@ Keycode Symbol Table ==================== Keycodes are defined in `common/keycode.h`. Range of 00-A4 and E0-E7 are identical with HID Usage: - + Virtual keycodes are defined out of above range to support special actions. -- cgit v1.2.3-24-g4f1b From 38766dbc82cd0765cd88a47bb88b57d58b4b6723 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 11 Aug 2016 09:36:37 +0200 Subject: Minor changes to keymaps Clarified extra keys Made ISO-keys non-dead in default layout Added non-US backslash on felix layout --- keyboards/s60-x/keymaps/default/keymap.c | 6 +++--- keyboards/s60-x/keymaps/felix/keymap.c | 8 ++++---- keyboards/s60-x/s60-x.h | 7 +++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/keyboards/s60-x/keymaps/default/keymap.c b/keyboards/s60-x/keymaps/default/keymap.c index aa2856525..3b680c307 100644 --- a/keyboards/s60-x/keymaps/default/keymap.c +++ b/keyboards/s60-x/keymaps/default/keymap.c @@ -31,10 +31,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ KEYMAP( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ - LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ - LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT, \ + LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ FN1, LGUI, LALT, FN0, RALT, RGUI, APP, RCTL), /* Layout 1: Function Layer diff --git a/keyboards/s60-x/keymaps/felix/keymap.c b/keyboards/s60-x/keymaps/felix/keymap.c index a5ff1ae4d..3052dd816 100644 --- a/keyboards/s60-x/keymaps/felix/keymap.c +++ b/keyboards/s60-x/keymaps/felix/keymap.c @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /| Up |Fn1 | + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Up | <> | * |-----------------------------------------------------------| * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| * `-----------------------------------------------------------' @@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ - KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_FN1, \ + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_NUBS, \ KC_FN2, KC_LGUI, KC_LALT, KC_FN0, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), /* Layout 1: Gaming Layer, SpaceFn disabled @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * | |Vl-|Mut|Vl+| | |Hom|Lef|Dow|Rig|End| |PEnt | * |-----------------------------------------------------------| - * | |Prt| | | |Cal| | | | |Pau |PUp |Rsft| + * | |Prt| | | |Cal| | | | |Pau |PUp |Fn1 | * |-----------------------------------------------------------| * | | | | | |Home|PDn |End | * `-----------------------------------------------------------' @@ -74,7 +74,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DEBUG, RESET, \ KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_SLCK, KC_PAUS, KC_INS, \ KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, KC_PENT, \ - KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, KC_PGUP, KC_RSFT, \ + KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, KC_PGUP, KC_FN1, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), }; diff --git a/keyboards/s60-x/s60-x.h b/keyboards/s60-x/s60-x.h index 714de30db..68f2ab22f 100644 --- a/keyboards/s60-x/s60-x.h +++ b/keyboards/s60-x/s60-x.h @@ -23,8 +23,11 @@ along with this program. If not, see . #include "quantum.h" /* S60-X keymap definition macro -* K2C, K31 and K3C are extra keys for ISO -* K0D is extra key from split backspace, K3E is extra key from split right shift +* K31 is the extra key next to short left ISO shift +* K2C is the moved key next to enter on ISO boards +* K3C is the extra key next to short right JIS shift +* K0D is extra key from split backspace +* K3E is extra key from HHKB-style split right shift */ #define KEYMAP( \ -- cgit v1.2.3-24-g4f1b From 56f86413e0d7606030cad68257a5d6287c9fd35f Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Thu, 11 Aug 2016 09:54:02 -0600 Subject: Add denolfe satan keymap --- keyboards/satan/keymaps/denolfe/Makefile | 20 +++ keyboards/satan/keymaps/denolfe/README.md | 12 ++ .../satan/keymaps/denolfe/keyboard-layout.png | Bin 0 -> 31762 bytes keyboards/satan/keymaps/denolfe/keymap.c | 171 +++++++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 keyboards/satan/keymaps/denolfe/Makefile create mode 100644 keyboards/satan/keymaps/denolfe/README.md create mode 100644 keyboards/satan/keymaps/denolfe/keyboard-layout.png create mode 100644 keyboards/satan/keymaps/denolfe/keymap.c diff --git a/keyboards/satan/keymaps/denolfe/Makefile b/keyboards/satan/keymaps/denolfe/Makefile new file mode 100644 index 000000000..c4adab737 --- /dev/null +++ b/keyboards/satan/keymaps/denolfe/Makefile @@ -0,0 +1,20 @@ + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?= no # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/satan/keymaps/denolfe/README.md b/keyboards/satan/keymaps/denolfe/README.md new file mode 100644 index 000000000..30b94fcdd --- /dev/null +++ b/keyboards/satan/keymaps/denolfe/README.md @@ -0,0 +1,12 @@ +# denolfe's Layout +Customized Satan keymap + +![Layout](keyboard-layout.png "Practical Keymap") + +## Programming Instructions: +`cd` into keymap directory, `make dfu` + +## Features +- Movement keys with CapsLock + h, j, k, l +- Media Keys +- Backlight control diff --git a/keyboards/satan/keymaps/denolfe/keyboard-layout.png b/keyboards/satan/keymaps/denolfe/keyboard-layout.png new file mode 100644 index 000000000..d6d6ad57f Binary files /dev/null and b/keyboards/satan/keymaps/denolfe/keyboard-layout.png differ diff --git a/keyboards/satan/keymaps/denolfe/keymap.c b/keyboards/satan/keymaps/denolfe/keymap.c new file mode 100644 index 000000000..2f6c8d8f4 --- /dev/null +++ b/keyboards/satan/keymaps/denolfe/keymap.c @@ -0,0 +1,171 @@ +#include "satan.h" + +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 +#define _SL 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * `-----------------------------------------------------------' + */ +[_BL] = KEYMAP( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_RCTL), + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | RESET| + * |-----------------------------------------------------------| + * | | | | | | | | | | | |BL-|BL+|BL | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ +[_FL] = KEYMAP( + #ifdef RGBLIGHT_ENABLE + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #else + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, KC_END, KC_MPRV, KC_MNXT, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_HOME, LCTL(KC_LEFT), LCTL(KC_END), LCTL(KC_RIGHT), KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, F(9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + #endif + +[_SL] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, LSFT(KC_END), KC_MPRV, KC_MNXT, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_UP), LSFT(KC_RIGHT), KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, LSFT(KC_HOME), LCTL(LSFT(KC_LEFT)), LCTL(LSFT(KC_END)), LCTL(LSFT(KC_RIGHT)), KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +enum function_id { + SHIFT_ESC, + #ifdef RGBLIGHT_ENABLE + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL + #endif +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), + #ifdef RGBLIGHT_ENABLE + [1] = ACTION_FUNCTION(RGBLED_TOGGLE), + [2] = ACTION_FUNCTION(RGBLED_STEP_MODE), + [3] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [4] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [5] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [6] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [7] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), + [8] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), + #endif + [9] = ACTION_LAYER_MODS(2, MOD_LSFT) +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + //led operations + #ifdef RGBLIGHT_ENABLE + case RGBLED_TOGGLE: + if (record->event.pressed) { + rgblight_toggle(); + } + break; + case RGBLED_INCREASE_HUE: + if (record->event.pressed) { + rgblight_increase_hue(); + } + break; + case RGBLED_DECREASE_HUE: + if (record->event.pressed) { + rgblight_decrease_hue(); + } + break; + case RGBLED_INCREASE_SAT: + if (record->event.pressed) { + rgblight_increase_sat(); + } + break; + case RGBLED_DECREASE_SAT: + if (record->event.pressed) { + rgblight_decrease_sat(); + } + break; + case RGBLED_INCREASE_VAL: + if (record->event.pressed) { + rgblight_increase_val(); + } + break; + case RGBLED_DECREASE_VAL: + if (record->event.pressed) { + rgblight_decrease_val(); + } + break; + case RGBLED_STEP_MODE: + if (record->event.pressed) { + rgblight_step(); + } + break; + #endif + } +} -- cgit v1.2.3-24-g4f1b From d1f418d85ddb3bc9594ab71267af92ef1a5b7b0c Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 11 Aug 2016 09:46:05 -0700 Subject: Update Makefile Corrected spelling of "ATREUS" in all locations. (ATRUES -> ATREUS) --- keyboards/atreus/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/atreus/Makefile b/keyboards/atreus/Makefile index 95ee1d4d7..5894d231f 100644 --- a/keyboards/atreus/Makefile +++ b/keyboards/atreus/Makefile @@ -2,11 +2,11 @@ ifdef TEENSY2 OPT_DEFS += -DATREUS_TEENSY2 - ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex + ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex else OPT_DEFS += -DATREUS_ASTAR OPT_DEFS += -DCATERINA_BOOTLOADER - ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) endif @@ -84,5 +84,5 @@ endif USB ?= /dev/cu.usbmodem1411 upload: build - $(ATRUES_UPLOAD_COMMAND) - \ No newline at end of file + $(ATREUS_UPLOAD_COMMAND) + -- cgit v1.2.3-24-g4f1b From eeade4af84af073479f38de32d97e99203b29350 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 11 Aug 2016 09:48:23 -0700 Subject: Update keymap.c Changed right-hand F-key layout in order to add KC_PLUS to _L2. --- keyboards/atreus/keymaps/xyverz/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c index f4d4a9cf0..0238fdbd3 100644 --- a/keyboards/atreus/keymaps/xyverz/keymap.c +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -51,8 +51,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, [_L2] = { /* LAYER 2 */ {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 }, - {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12 }, + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PLUS}, + {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET } } }; -- cgit v1.2.3-24-g4f1b From 71e1bb2e1cf5fd87cb9cc6f81b830763b38665d4 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 11 Aug 2016 11:04:57 -0700 Subject: Delete keymap.c Not ready to submit this one just yet. --- keyboards/phantom/keymaps/xyverz/keymap.c | 67 ------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 keyboards/phantom/keymaps/xyverz/keymap.c diff --git a/keyboards/phantom/keymaps/xyverz/keymap.c b/keyboards/phantom/keymaps/xyverz/keymap.c deleted file mode 100644 index 5948e4ca5..000000000 --- a/keyboards/phantom/keymaps/xyverz/keymap.c +++ /dev/null @@ -1,67 +0,0 @@ -#include "phantom.h" - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _BL 0 -#define _FL 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: (Base Layer) Default Layer - * ,-----------------------------------------------------------------------------. - * |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus| - * |-----------------------------------------------------------| |--------------| - * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp| - * |-----------------------------------------------------------| |--------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn| - * |-----------------------------------------------------------| `--------------' - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| ,----. - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up | - * |-----------------------------------------------------------| ,-------------. - * |Ctrl|Gui |Alt | Space |ALT |GUI |_FL |CTRL | |Lft| Dn |Rig | - * `-----------------------------------------------------------' `-------------' - */ -[_BL] = KEYMAP( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DELETE, KC_END, KC_PGDN, \ - KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT), - - /* Keymap _FL: Function Layer - * ,-----------------------------------------------------------------------------. - * |RESET| | | | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| |--------------| - * | | | | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| |--------------| - * | | | | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| `--------------' - * | | | | | | | | | | | | | | - * |-----------------------------------------------------------| ,----. - * | | F1| F2| F3| F4| F5|F6 |F7 |F8 | | | | | | - * |-----------------------------------------------------------| ,-------------. - * | | | | | | | | | | | | | - * `-----------------------------------------------------------' `-------------' - */ -[_FL] = KEYMAP( - KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_SLEP, \ - RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MUTE,KC_VOLD,KC_VOLU,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,KC_MSEL, KC_TRNS,KC_TRNS,KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS,KC_TRNS,KC_CALC,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_CAPS, KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS) -}; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { -} -- cgit v1.2.3-24-g4f1b From 4725942dc71c2f386d8323865a6255f4dfd2785b Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 11 Aug 2016 21:49:10 +0200 Subject: Small changes Enabled Bootmagic and ISO layouts on felix keymap Added unused pins --- keyboards/s60-x/config.h | 2 +- keyboards/s60-x/keymaps/felix/keymap.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/keyboards/s60-x/config.h b/keyboards/s60-x/config.h index d548a99b3..ac7951c24 100644 --- a/keyboards/s60-x/config.h +++ b/keyboards/s60-x/config.h @@ -46,7 +46,7 @@ along with this program. If not, see . */ #define MATRIX_ROW_PINS { B7, B3, B2, B1, B0 } #define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C6, C7, E6, F1 } -#define UNUSED_PINS +#define UNUSED_PINS { F0 } /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/s60-x/keymaps/felix/keymap.c b/keyboards/s60-x/keymaps/felix/keymap.c index 3052dd816..7fc0e021c 100644 --- a/keyboards/s60-x/keymaps/felix/keymap.c +++ b/keyboards/s60-x/keymaps/felix/keymap.c @@ -18,6 +18,7 @@ along with this program. If not, see . const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layout 0: Default Layer + * RSFT will be replaced once a better way to control magic is found. * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del| * |-----------------------------------------------------------| @@ -25,17 +26,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /| Up | <> | + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Up |RSft| * |-----------------------------------------------------------| * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| * `-----------------------------------------------------------' */ KEYMAP( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ - KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_NUBS, \ - KC_FN2, KC_LGUI, KC_LALT, KC_FN0, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_RSFT, \ + KC_FN2, KC_LGUI, KC_LALT, KC_FN0, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), /* Layout 1: Gaming Layer, SpaceFn disabled * ,-----------------------------------------------------------. @@ -55,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_FN1, \ - KC_TRNS, KC_NO, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_NO, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), /* Layout 2: Function Layer * ,-----------------------------------------------------------. @@ -75,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_SLCK, KC_PAUS, KC_INS, \ KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, KC_PENT, \ KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, KC_PGUP, KC_FN1, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), }; /* -- cgit v1.2.3-24-g4f1b From e692ebf86a962e90c51302e7b17a953ea2858f79 Mon Sep 17 00:00:00 2001 From: shela Date: Fri, 12 Aug 2016 20:38:26 +0900 Subject: fix typo --- quantum/keymap.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/quantum/keymap.h b/quantum/keymap.h index a15865183..f2d94d75c 100644 --- a/quantum/keymap.h +++ b/quantum/keymap.h @@ -156,16 +156,16 @@ enum quantum_keycodes { BL_INC, BL_TOGG, BL_STEP, - - // RGB functionality - RGB_TOG, - RGB_MOD, - RGB_HUI, - RGB_HUD, - RGB_SAI, - RGB_SAD, - RGB_VAI, - RGB_VAD, + + // RGB functionality + RGB_TOG, + RGB_MOD, + RGB_HUI, + RGB_HUD, + RGB_SAI, + RGB_SAD, + RGB_VAI, + RGB_VAD, // Left shift, open paren KC_LSPO, @@ -309,7 +309,7 @@ enum quantum_keycodes { #define OSL(layer) (layer | QK_ONE_SHOT_LAYER) // One-shot mod -#define OSM(layer) (layer | QK_ONE_SHOT_MOD) +#define OSM(mod) (mod | QK_ONE_SHOT_MOD) // M-od, T-ap - 256 keycode max #define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0xF) << 8)) -- cgit v1.2.3-24-g4f1b From 1c8d64d3b3664ef7d62ea12f8fd510231a7ec54e Mon Sep 17 00:00:00 2001 From: shela Date: Fri, 12 Aug 2016 21:24:43 +0900 Subject: add my keymap --- keyboards/hhkb/keymaps/shela/Makefile | 1 + keyboards/hhkb/keymaps/shela/action_pseudo_lut.c | 142 ++++++++++++++++++ keyboards/hhkb/keymaps/shela/action_pseudo_lut.h | 15 ++ keyboards/hhkb/keymaps/shela/config.h | 12 ++ keyboards/hhkb/keymaps/shela/keymap.c | 179 +++++++++++++++++++++++ keyboards/hhkb/keymaps/shela/keymap_jis2us.h | 32 ++++ keyboards/hhkb/keymaps/shela/readme.md | 14 ++ 7 files changed, 395 insertions(+) create mode 100644 keyboards/hhkb/keymaps/shela/Makefile create mode 100644 keyboards/hhkb/keymaps/shela/action_pseudo_lut.c create mode 100644 keyboards/hhkb/keymaps/shela/action_pseudo_lut.h create mode 100644 keyboards/hhkb/keymaps/shela/config.h create mode 100644 keyboards/hhkb/keymaps/shela/keymap.c create mode 100644 keyboards/hhkb/keymaps/shela/keymap_jis2us.h create mode 100644 keyboards/hhkb/keymaps/shela/readme.md diff --git a/keyboards/hhkb/keymaps/shela/Makefile b/keyboards/hhkb/keymaps/shela/Makefile new file mode 100644 index 000000000..d0586bda6 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/Makefile @@ -0,0 +1 @@ +SRC += action_pseudo_lut.c diff --git a/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c new file mode 100644 index 000000000..b205968c7 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.c @@ -0,0 +1,142 @@ +#include "quantum.h" +#include "action_pseudo_lut.h" + +static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE]; + +/* + * Pseudo layout action. + * This action converts a keycode in order to output the character according to the keymap you specified + * still your keyboard layout recognized wrongly on your OS. + * Memo: Using other layer keymap to get keycode + */ +void action_pseudo_lut(keyrecord_t *record, uint8_t base_keymap_id, const uint16_t (*keymap)[2]) { + static uint8_t prev_shift; + uint16_t keycode; + uint16_t pseudo_keycode; + + /* get keycode from keymap you specified */ + keycode = keymap_key_to_keycode(base_keymap_id, record->event.key); + + prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + + if (record->event.pressed) { + /* when magic commands entered, keycode does not converted */ + if (IS_COMMAND()) { + if (prev_shift) { + add_shift_bit(keycode); + } + register_code(keycode); + return; + } + + if (prev_shift) { + pseudo_keycode = convert_keycode(keymap, keycode, true); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + add_shift_bit(keycode); + + if (IS_LSFT(pseudo_keycode)) { + register_code(QK_LSFT ^ pseudo_keycode); + } else { + /* delete shift mod temporarily */ + del_mods(prev_shift); + send_keyboard_report(); + register_code(pseudo_keycode); + add_mods(prev_shift); + send_keyboard_report(); + } + } else { + pseudo_keycode = convert_keycode(keymap, keycode, false); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + + if (IS_LSFT(pseudo_keycode)) { + add_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + register_code(QK_LSFT ^ pseudo_keycode); + /* on Windows, prevent key repeat to avoid unintended output */ + unregister_code(QK_LSFT ^ pseudo_keycode); + del_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + } else { + register_code(pseudo_keycode); + } + } + } else { + if (get_shift_bit(keycode)) { + del_shift_bit(keycode); + pseudo_keycode = convert_keycode(keymap, keycode, true); + } else { + pseudo_keycode = convert_keycode(keymap, keycode, false); + } + dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode); + + if (IS_LSFT(pseudo_keycode)) { + unregister_code(QK_LSFT ^ pseudo_keycode); + } else { + unregister_code(pseudo_keycode); + } + } +} + +uint16_t convert_keycode(const uint16_t (*keymap)[2], uint16_t keycode, bool shift_modded) +{ + uint16_t pseudo_keycode; + + switch (keycode) { + case KC_A ... KC_CAPSLOCK: +#if defined(__AVR__) + if (shift_modded) { + pseudo_keycode = pgm_read_word(&keymap[keycode][1]); + } else { + pseudo_keycode = pgm_read_word(&keymap[keycode][0]); + } +#else + if (shift_modded) { + pseudo_keycode = keymap[keycode][1]; + } else { + pseudo_keycode = keymap[keycode][0]; + } +#endif + /* if undefined, use got keycode as it is */ + if (pseudo_keycode == 0x00) { + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + } + break; + default: + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + break; + } + return pseudo_keycode; +} + +uint8_t get_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7)); + } else { + dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode); + return 0; + } +} + +void add_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7)); + } else { + dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode); + } +} + +void del_shift_bit(uint16_t keycode) { + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7)); + } else { + dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode); + } +} diff --git a/keyboards/hhkb/keymaps/shela/action_pseudo_lut.h b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.h new file mode 100644 index 000000000..681252440 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/action_pseudo_lut.h @@ -0,0 +1,15 @@ +#ifndef ACTION_PSEUDO_LUT_H +#define ACTION_PSEUDO_LUT_H + +#define SHIFT_BIT_SIZE (0xE7 / 8 + 1) // 1bit per 1key + +#define IS_LSFT(kc) ((QK_LSFT & (kc)) == QK_LSFT) + +void action_pseudo_lut(keyrecord_t *, uint8_t, const uint16_t (*)[2]); +uint16_t convert_keycode(const uint16_t (*)[2], uint16_t, bool); + +uint8_t get_shift_bit(uint16_t); +void add_shift_bit(uint16_t); +void del_shift_bit(uint16_t); + +#endif diff --git a/keyboards/hhkb/keymaps/shela/config.h b/keyboards/hhkb/keymaps/shela/config.h new file mode 100644 index 000000000..08cc1fb46 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_SHELA_H +#define CONFIG_SHELA_H + +#include "../../config.h" + +#undef TAPPING_TERM +#define TAPPING_TERM 230 + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 2000 + +#endif diff --git a/keyboards/hhkb/keymaps/shela/keymap.c b/keyboards/hhkb/keymaps/shela/keymap.c new file mode 100644 index 000000000..c286b99de --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/keymap.c @@ -0,0 +1,179 @@ +/* + * HHKB Pro 2 US Layout for shela + */ +#include "hhkb.h" +#include "keymap_jis2us.h" +#include "action_pseudo_lut.h" + +enum keymap_layout { + BASE = 0, + PSEUDO_US, + DVORAK, + MOUSE, + TENKEY, + HHKB, + SPACE_FN, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0: Default Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` | BSp | + * |-----------------------------------------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------| + * | Control | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 | + * `-----------------------------------------------------------------------------------------' + * |LAlt | LGui | SpaceFN | RGui |RAlt | + * `-----------------------------------------------------------------' + */ + [BASE] = + KEYMAP(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_GRV, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, \ + KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \ + OSM(MOD_LSFT),KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_FN0, \ + KC_LALT,KC_LGUI, KC_FN2, KC_RGUI,KC_RALT), + + /* Layer 1: Pseudo US Layout Layer */ + [PSEUDO_US] = + KEYMAP(KC_ESC, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_BSPC, \ + KC_TAB, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, \ + KC_LCTL,KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_ENT, \ + OSM(MOD_LSFT),KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_FN1, KC_RSFT,KC_FN0, \ + KC_LGUI,KC_FN3, KC_FN2, KC_FN4 ,KC_RGUI), + + /* Layer 2: Dvorak Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | [ | ] | ` | BSp | + * |-----------------------------------------------------------------------------------------| + * | Tab | ' | , | . | P | Y | F | G | C | R | L | / | = | \ | + * |-----------------------------------------------------------------------------------------| + * | Control | A | O | E | U | I | D | H | T | N | S | - | Enter | + * |-----------------------------------------------------------------------------------------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z | Shift | Fn0 | + * `-----------------------------------------------------------------------------------------' + * |LAlt | LGui | SpaceFN | RGui |RAlt | + * `-----------------------------------------------------------------' + */ + [DVORAK] = + KEYMAP(KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC,KC_RBRC,KC_GRV, KC_BSPC, \ + KC_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,KC_EQL, KC_BSLS, \ + KC_LCTL,KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,KC_ENT, \ + KC_LSFT,KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,KC_FN0, \ + KC_LALT,KC_LGUI, KC_FN2, KC_RGUI,KC_RALT), + + /* Layer 3: Mouse layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | MwL | MwD | MwU | MwR | | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | McL | McD | McU | McR | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | Mb1 | Mb2 | Mb3 | | | | Fn0 | + * `-----------------------------------------------------------------------------------------' + * | | | Mb1 | | | + * `-----------------------------------------------------------------' + */ + [MOUSE] = + KEYMAP(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_TRNS, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1,KC_BTN2,KC_BTN3,KC_NO, KC_NO, KC_TRNS,KC_FN0, \ + KC_TRNS,KC_TRNS, KC_BTN1, KC_TRNS,KC_TRNS), + + /* Layer 4: Tenkey layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | | | | | | | | | | / | * | - | | BSp | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | | 7 | 8 | 9 | + | | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | | 4 | 5 | 6 | Enter | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | | | 1 | 2 | 3 | + | Fn0 | + * `-----------------------------------------------------------------------------------------' + * | | | SpaceFN | 0 | . | + * `-----------------------------------------------------------------' + */ + [TENKEY] = + KEYMAP(KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSLS,KC_PAST,KC_PMNS,KC_NO, KC_BSPC, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_7,KC_KP_8,KC_KP_9,KC_PPLS,KC_NO, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_4,KC_KP_5,KC_KP_6,KC_PENT, \ + KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_KP_1,KC_KP_2,KC_KP_3,KC_PPLS,KC_FN0, \ + KC_TRNS,KC_TRNS, KC_FN2, KC_KP_0,KC_PDOT), + + /* Layer 5: HHKB mode (HHKB Fn) + * ,-----------------------------------------------------------------------------------------. + * | Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + * |-----------------------------------------------------------------------------------------| + * | Caps | Fn5 | Fn6 | Fn7 | Fn8 | Fn9 | | | Psc | Slk | Pus | Up | | BSp | + * |-----------------------------------------------------------------------------------------| + * | | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | + * |-----------------------------------------------------------------------------------------| + * | | | | | | | + | - | End | PgD | Dow | | | + * `-----------------------------------------------------------------------------------------' + * | | | | | | + * `-----------------------------------------------------------------' + */ + [HHKB] = + KEYMAP(KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \ + KC_CAPS,KC_FN5, KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS,KC_UP, KC_TRNS,KC_BSPC, \ + KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PPLS,KC_PMNS,KC_END, KC_PGDN,KC_DOWN,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS), + + /* Layer 6: SpaceFN + * ,-----------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | Del | + * |-----------------------------------------------------------------------------------------| + * | | End | Up | Hom | | | | Hom | Up | End | Psc | Slk | Pau | Ins | + * |-----------------------------------------------------------------------------------------| + * | | Lef | Dow | Rig | PgU | | PgU | Lef | Dow | Rig | | | | + * |-----------------------------------------------------------------------------------------| + * | | | | PgD | | Spc | PgD | ` | ~ | | | | | + * `-----------------------------------------------------------------------------------------' + * | | | | | | + * `-----------------------------------------------------------------' + */ + [SPACE_FN] = + KEYMAP(KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_DEL, \ + KC_TRNS,KC_END, KC_UP, KC_HOME,KC_NO, KC_NO, KC_NO, KC_HOME,KC_UP, KC_END, KC_PSCR,KC_SLCK,KC_PAUS,KC_INS, \ + KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_PGUP,KC_NO, KC_PGUP,KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_NO, KC_TRNS, \ + KC_TRNS,KC_NO, KC_NO, KC_PGDN,KC_NO, KC_SPC, KC_PGDN,KC_GRV, KC_TILD,KC_NO, KC_NO, KC_TRNS,KC_NO, \ + KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS), +}; + +/* + * user defined action function + */ +enum function_id { + PSEUDO_US_FUNCTION, +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + + switch (id) { + case PSEUDO_US_FUNCTION: + action_pseudo_lut(record, BASE, keymap_jis2us); + break; + } +} + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(HHKB), + [1] = ACTION_FUNCTION(PSEUDO_US_FUNCTION), + [2] = ACTION_LAYER_TAP_KEY(SPACE_FN, KC_SPACE), + [3] = ACTION_MODS_TAP_KEY(MOD_LALT, KC_MHEN), + [4] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_KANA), + [5] = ACTION_DEFAULT_LAYER_SET(BASE), + [6] = ACTION_DEFAULT_LAYER_SET(PSEUDO_US), + [7] = ACTION_DEFAULT_LAYER_SET(MOUSE), + [8] = ACTION_DEFAULT_LAYER_SET(TENKEY), + [9] = ACTION_DEFAULT_LAYER_SET(DVORAK), +}; diff --git a/keyboards/hhkb/keymaps/shela/keymap_jis2us.h b/keyboards/hhkb/keymaps/shela/keymap_jis2us.h new file mode 100644 index 000000000..cf2bd4f0e --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/keymap_jis2us.h @@ -0,0 +1,32 @@ +#ifndef KEYMAP_JIS2US_H +#define KEYMAP_JIS2US_H + +/* keymap for convert from JIS to US */ +const uint16_t PROGMEM keymap_jis2us[][2] = { + [KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */ + + [KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */ + [KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */ + [KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */ + [KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */ + [KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */ + [KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */ + [KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */ + [KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */ + [KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */ + [KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */ + [KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */ + [KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */ + [KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */ + [KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */ + [KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */ + [KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */ + [KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */ + [KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */ + [KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */ + [KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */ + [KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */ + [KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */ +}; + +#endif diff --git a/keyboards/hhkb/keymaps/shela/readme.md b/keyboards/hhkb/keymaps/shela/readme.md new file mode 100644 index 000000000..cf5f29169 --- /dev/null +++ b/keyboards/hhkb/keymaps/shela/readme.md @@ -0,0 +1,14 @@ +# Shela's HHKB Layout + +Layer 0: US Layout +Layer 1: Pseudo US Layout +Layer 2: Dvorak Layout +Layer 3: Mouse +Layer 4: Tenkey +Layer 5: HHKB Fn Key +Layer 6: SpaceFN + +## Pseudo US Layout + +On japanese Windows, HHKB Professional 2 US layout model recognized wrongly as JIS layout without changing OS settings. +But, you can use HHKB like a US layout keyboard as it is. -- cgit v1.2.3-24-g4f1b From c9272fee083d274c11bab0d8ec5520b54961f7fa Mon Sep 17 00:00:00 2001 From: shela Date: Fri, 12 Aug 2016 21:33:32 +0900 Subject: add new line --- keyboards/hhkb/keymaps/shela/readme.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/hhkb/keymaps/shela/readme.md b/keyboards/hhkb/keymaps/shela/readme.md index cf5f29169..2317e880f 100644 --- a/keyboards/hhkb/keymaps/shela/readme.md +++ b/keyboards/hhkb/keymaps/shela/readme.md @@ -1,12 +1,12 @@ # Shela's HHKB Layout -Layer 0: US Layout -Layer 1: Pseudo US Layout -Layer 2: Dvorak Layout -Layer 3: Mouse -Layer 4: Tenkey -Layer 5: HHKB Fn Key -Layer 6: SpaceFN +Layer 0: US Layout +Layer 1: Pseudo US Layout +Layer 2: Dvorak Layout +Layer 3: Mouse +Layer 4: Tenkey +Layer 5: HHKB Fn Key +Layer 6: SpaceFN ## Pseudo US Layout -- cgit v1.2.3-24-g4f1b From 11e23fd3fdbe86ff85b2be7783c46d4360b07360 Mon Sep 17 00:00:00 2001 From: shela Date: Fri, 12 Aug 2016 21:45:36 +0900 Subject: add new line --- keyboards/hhkb/keymaps/shela/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/hhkb/keymaps/shela/readme.md b/keyboards/hhkb/keymaps/shela/readme.md index 2317e880f..5a06a8363 100644 --- a/keyboards/hhkb/keymaps/shela/readme.md +++ b/keyboards/hhkb/keymaps/shela/readme.md @@ -10,5 +10,5 @@ Layer 6: SpaceFN ## Pseudo US Layout -On japanese Windows, HHKB Professional 2 US layout model recognized wrongly as JIS layout without changing OS settings. +On japanese Windows, HHKB Professional 2 US layout model recognized wrongly as JIS layout without changing OS settings. But, you can use HHKB like a US layout keyboard as it is. -- cgit v1.2.3-24-g4f1b From b98d47abe544c68ffba745b6643a777f8f61a03c Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 12 Aug 2016 16:36:07 +0200 Subject: ergodox: Update my keymap to v1.5 Major changes include: * The **1HAND** layer has been removed. * A `Delete` key is now available on the right thumb cluster. * The **ADORE** layer received a major update, see the updated layout image. * It is now possible to enable automatic logging for the **ADORE** layer, by setting the `ADORE_AUTOLOG` makefile variable to `yes` when compiling the keymap. It is off by default. * The `~` key and the `Media Next/Prev` key have been swapped on the **base** layer. * On the **ARROW** layer, `Backspace` has been replaced by `Enter`. * There is some experimental support for entering Unicode symbols. Signed-off-by: Gergely Nagy --- keyboards/ergodox/keymaps/algernon/Makefile | 7 + .../keymaps/algernon/images/adore-layer.png | Bin 95615 -> 93748 bytes .../ergodox/keymaps/algernon/images/base-layer.png | Bin 95654 -> 95222 bytes .../keymaps/algernon/images/one-handed-layer.png | Bin 91140 -> 0 bytes keyboards/ergodox/keymaps/algernon/keymap.c | 2422 ++++++++++---------- keyboards/ergodox/keymaps/algernon/readme.md | 52 +- 6 files changed, 1244 insertions(+), 1237 deletions(-) delete mode 100644 keyboards/ergodox/keymaps/algernon/images/one-handed-layer.png diff --git a/keyboards/ergodox/keymaps/algernon/Makefile b/keyboards/ergodox/keymaps/algernon/Makefile index 6bf3976b9..00194857a 100644 --- a/keyboards/ergodox/keymaps/algernon/Makefile +++ b/keyboards/ergodox/keymaps/algernon/Makefile @@ -8,10 +8,17 @@ CONSOLE_ENABLE = no TAP_DANCE_ENABLE = yes KEYLOGGER_ENABLE ?= yes +ADORE_AUTOLOG ?= no + ifeq (${FORCE_NKRO},yes) OPT_DEFS += -DFORCE_NKRO endif +ifeq (${ADORE_AUTOLOG},yes) +KEYLOGGER_ENABLE = yes +OPT_DEFS += -DADORE_AUTOLOG +endif + ifeq (${KEYLOGGER_ENABLE},yes) OPT_DEFS += -DKEYLOGGER_ENABLE CONSOLE_ENABLE = yes diff --git a/keyboards/ergodox/keymaps/algernon/images/adore-layer.png b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png index 3df68ea53..44ad8a1eb 100644 Binary files a/keyboards/ergodox/keymaps/algernon/images/adore-layer.png and b/keyboards/ergodox/keymaps/algernon/images/adore-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/base-layer.png b/keyboards/ergodox/keymaps/algernon/images/base-layer.png index 7b25a05b3..da159fbe2 100644 Binary files a/keyboards/ergodox/keymaps/algernon/images/base-layer.png and b/keyboards/ergodox/keymaps/algernon/images/base-layer.png differ diff --git a/keyboards/ergodox/keymaps/algernon/images/one-handed-layer.png b/keyboards/ergodox/keymaps/algernon/images/one-handed-layer.png deleted file mode 100644 index 698d11e5f..000000000 Binary files a/keyboards/ergodox/keymaps/algernon/images/one-handed-layer.png and /dev/null differ diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c index c4de53da2..244bfb51f 100644 --- a/keyboards/ergodox/keymaps/algernon/keymap.c +++ b/keyboards/ergodox/keymaps/algernon/keymap.c @@ -1,1218 +1,1206 @@ -/* - * algernon's ErgoDox EZ layout, please see the readme.md file! - */ - -#include "ergodox.h" -#include "led.h" -#include "debug.h" -#include "action_layer.h" -#include "action_util.h" -#include "mousekey.h" -#include "timer.h" -#include "keymap_plover.h" -#include "eeconfig.h" -#include "wait.h" +/* + * algernon's ErgoDox EZ layout, please see the readme.md file! + */ + +#include "ergodox.h" +#include "led.h" +#include "debug.h" +#include "action_layer.h" +#include "action_util.h" +#include "mousekey.h" +#include "timer.h" +#include "keymap_plover.h" +#include "eeconfig.h" +#include "wait.h" #include "version.h" - -/* Layers */ - -enum { - BASE = 0, - ADORE, - ARRW, - APPSEL, - HUN, - NMDIA, - OHLFT, - OHRGT, - PLVR, -}; - -/* Macros */ - -enum { - NONE = 0, - // Buttons that do extra stuff - A_GUI, - A_PLVR, - A_ESC, - A_MPN, - - // Function / number keys - KF_1, // 1, F1 - KF_2, // 2, F2 - KF_3, // ... - KF_4, - KF_5, - KF_6, - KF_7, - KF_8, - KF_9, - KF_10, - KF_11, // =, F11 - - // Application select keys - APP_SLK, // Slack - APP_EMCS, // Emacs - APP_TERM, // Terminal - APP_CHRM, // Chrome - APP_MSIC, // Music - - // Diagonal mouse movement - A_MUL, - A_MUR, - A_MDL, - A_MDR, - - // Hungarian layer keys - HU_AA, // à - HU_OO, // Ó - HU_EE, // É - HU_UU, // Ú - HU_II, // à - HU_OE, // Ö - HU_UE, // Ãœ - HU_OEE, // Å - HU_UEE, // Å° - - // One-handed layout specials - OH_BSSPC, - OH_ENTSFT, - OH_BASE, - OH_LEFT, - OH_RIGHT, -}; - -/* Fn keys */ - -enum { - F_BSE = 0, - F_HUN, - F_GUI, - F_SFT, - F_ALT, - F_CTRL -}; - -/* Custom keycodes */ - -enum { - CT_CLN = 0, - CT_MNS, - CT_TA, -}; - -/* States & timers */ - -uint16_t gui_timer = 0; - -uint16_t kf_timers[12]; - -uint16_t oh_base_timer = 0; -uint16_t oh_bsspc_timer = 0; -uint16_t oh_entsft_timer = 0; - -#define OH_BLINK_INTERVAL 500 - -uint8_t oh_left_blink = 0; -uint16_t oh_left_blink_timer = 0; -uint8_t oh_right_blink = 0; -uint16_t oh_right_blink_timer = 0; - -#if KEYLOGGER_ENABLE -bool log_enable = false; -#endif - -bool time_travel = false; - -/* The Keymap */ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Keymap 0: Base Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | - * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | : | | - | | | | | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | 1HND | - * ,------|------|------| |------+------+------. - * | | | Ctrl | | LEAD | | | - * |Backsp|LShift|------| |------| Enter| Space| - * | | | ESC | | HUN | | | - * `--------------------' `--------------------' - */ -[BASE] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) - - ,F(F_ALT),F(F_GUI) - ,F(F_CTRL) - ,KC_BSPC,F(F_SFT),M(A_ESC) - - // right hand - ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS - ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL - ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP - ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,OSL(NMDIA),M(OH_LEFT) - ,KC_LEAD - ,F(F_HUN) ,KC_ENT ,KC_SPC - ), - -/* Keymap 1: Adore layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | Next/Prev | , | . | L | W | M | [ | | ] | F | H | C | P | Y | \ | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = / Arrow | - * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| - * | Play/Pause| / | Z | ' | K | X | | | | B | G | V | J | Q | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | : | | - | | | | | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | LAlt | GUI | | MDIA | 1HND | - * ,------|------|------| |------+------+------. - * | | | Ctrl | | LEAD | | | - * |Backsp|LShift|------| |------| Enter| Space| - * | | | ESC | | HUN | | | - * `--------------------' `--------------------' - */ -[ADORE] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) -,M(A_MPN) ,KC_COMM ,KC_DOT ,KC_L ,KC_W ,KC_M ,KC_LBRC -,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U -,KC_MPLY ,KC_SLSH ,KC_Z ,KC_QUOT,KC_K ,KC_X ,KC_LPRN -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) - - ,F(F_ALT),F(F_GUI) - ,F(F_CTRL) - ,KC_BSPC,F(F_SFT),M(A_ESC) - - // right hand - ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 - ,KC_RBRC ,KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS - ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL - ,KC_RPRN ,KC_B ,KC_G ,KC_V ,KC_J ,KC_Q ,KC_MSTP - ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,OSL(NMDIA),M(OH_LEFT) - ,KC_LEAD - ,F(F_HUN) ,KC_ENT ,KC_SPC - ), - -/* Keymap 2: Arrow layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | Home | Up | End | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | Left | Down | Rght | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| PgUp | PgDn | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[ARRW] = KEYMAP( -// left hand - KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_HOME ,KC_UP ,KC_END ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_PGUP ,KC_PGDN - ), - -/* Keymap 3: Application select layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | |Music |Slack |Emacs |Term |Chrome| | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[APPSEL] = KEYMAP( -// left hand - KC_TRNS ,M(APP_MSIC),M(APP_SLK),M(APP_EMCS),M(APP_TERM),M(APP_CHRM),KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS - ), - - -/* Keymap 4: Hungarian Layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | Å | | Å° | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | à | Ó | É | Ú | à |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | Ö | | Ãœ | | | | | | | | | | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | BASE | | | - * `--------------------' `--------------------' - */ - -[HUN] = KEYMAP( -// left hand - KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,M(HU_OEE),KC_NO ,M(HU_UEE),KC_NO ,KC_NO -,KC_NO ,M(HU_AA),M(HU_OO) ,M(HU_EE),M(HU_UU) ,M(HU_II) -,KC_NO ,KC_NO ,M(HU_OE) ,KC_NO ,M(HU_UE) ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_TRNS ,KC_TRNS - - // right hand - ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,F(F_BSE),KC_TRNS ,KC_TRNS - ), - -/* Keymap 5: Navigation & Media layer - * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | MS Slow | | | | | |ScrLCK| |ScrLCK| | | | | | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | MS Normal | | Home | Up | PgUp | | | |Scroll| |MsUpL | MsUp |MsUpR | |PrintScreen| - * |-----------+------+------+------+------+------| | | Up |------+------+------+------+------+-----------| - * | MS Fast | | Left | Down | Right| |------| |------| |MsLeft| MsDn |MsRght| | | - * |-----------+------+------+------+------+------| | |Scroll|------+------+------+------+------+-----------| - * | Play/Pause| | End | Down | PgDn | | | | Down | |MsDnL | MsDn |MsDnR | | Stop | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | Mute | VlUp | | BASE | MClk | - * ,------|------|------| |------+------+------. - * | | | VlDn | | Prev |Left |Right | - * | SPC | Enter|------| |------| Click| Click| - * | | | ESC | | Next | | | - * `--------------------' `--------------------' - */ -[NMDIA] = KEYMAP( -// left hand - KC_ACL0 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LGUI(KC_L) -,KC_ACL1 ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_NO -,KC_ACL2 ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO -,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_NO -,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_MUTE ,KC_VOLU - ,KC_VOLD - ,KC_SPC,KC_ENTER,M(A_ESC) - - // right hand - ,LGUI(KC_L),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_WH_U ,KC_NO ,M(A_MUL),KC_MS_U ,M(A_MUR),KC_NO ,KC_PSCR - ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO - ,KC_WH_D ,KC_NO ,M(A_MDL),KC_MS_D ,M(A_MDR),KC_NO ,KC_MSTP - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_TRNS ,KC_MS_BTN3 - ,KC_MPRV - ,KC_MNXT ,KC_BTN1 ,KC_BTN2 - ), - -/* Keymap 6: One-handed, left side - * - * ,-----------------------------------------------------. - * | `~ | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 |A BSE| - * |-----------+------+------+------+------+-------------| - * | Tab | ' | , | . | P | Y | [ | - * |-----------+------+------+------+------+------| | - * | - | A | O | E | U | I |------| - * |-----------+------+------+------+------+------| ( | - * | Play/Pause| ; | Q | J | K | X | | - * `-----------+------+------+------+------+-------------' - * | Home | End | Down | Up | ESC | - * `-----------------------------------' - * ,-------------. - * | LAlt | GUI | - * ,------|------|------| - * |BackSp|LShift| Ctrl | - * | | |------| - * |Space |Enter |OTHER | - * `--------------------' - */ -[OHLFT] = KEYMAP( -// left hand - KC_GRV ,M(KF_1) ,M(KF_2) ,M(KF_3) ,M(KF_4) ,M(KF_5) ,M(OH_BASE) -,KC_TAB ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC -,KC_MINS ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I -,KC_MPLY ,KC_SCLN ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN -,KC_HOME ,KC_END ,KC_DOWN ,KC_UP ,M(A_ESC) - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_RIGHT) - - // right hand - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - ), - -/* Keymap 7: One-handed, right side - * - * ,-----------------------------------------------------. - * | = F11 | 0 F10| 9 F9 | 8 F8 | 7 F7 | 6 F6 |A BSE| - * |-----------+------+------+------+------+-------------| - * | / | L | R | C | G | F | ] | - * |-----------+------+------+------+------+------| | - * | \ | S | N | T | H | D |------| - * |-----------+------+------+------+------+------| ) | - * | Stop | Z | V | W | M | B | | - * `-----------+------+------+------+------+-------------' - * | PgDn | PgUp | Right| Left | ESC | - * `-----------------------------------' - * ,-------------. - * | LAlt | GUI | - * ,------|------|------| - * |BackSp|LShift| Ctrl | - * | | |------| - * |Space |Enter |OTHER | - * `--------------------' - */ -[OHRGT] = KEYMAP( -// left hand - M(KF_11) ,M(KF_10) ,M(KF_9) ,M(KF_8) ,M(KF_7) ,M(KF_6) ,M(OH_BASE) -,KC_SLSH ,KC_L ,KC_R ,KC_C ,KC_G ,KC_F ,KC_RBRC -,KC_BSLS ,KC_S ,KC_N ,KC_T ,KC_H ,KC_D -,KC_MSTP ,KC_Z ,KC_V ,KC_W ,KC_M ,KC_B ,KC_RPRN -,KC_PGDN ,KC_PGUP ,KC_RGHT ,KC_LEFT ,M(A_ESC) - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,M(OH_BSSPC),M(OH_ENTSFT),M(OH_LEFT) - - // right hand - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO - - ,KC_NO ,KC_NO - ,KC_NO - ,KC_NO ,KC_NO ,KC_NO - ), - -/* Keymap 8: Steno for Plover - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | BASE | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | # | # | # | # | # | # | | # | # | # | # | # | # | # | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | T | P | H | |------| |------| | F | P | L | T | D | - * |--------+ S +------+------+------+ * | * | | * | * +------+------+------+------+--------| - * | | | K | W | R | | | | | | R | B | G | S | Z | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | A | O |------| |------| E | U | - * | | | | | | | | - * `--------------------' `--------------------' - */ - -[PLVR] = KEYMAP( -// left hand -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(A_PLVR), -KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, -KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, -KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, -KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - PV_A, PV_O, KC_NO, - - // right hand - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, - PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, - PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, - KC_NO, - KC_NO,PV_E, PV_U - ), - -}; - -const uint16_t PROGMEM fn_actions[] = { - [F_BSE] = ACTION_LAYER_CLEAR(ON_PRESS) - ,[F_HUN] = ACTION_LAYER_INVERT(HUN, ON_PRESS) - ,[F_GUI] = ACTION_MACRO_TAP(A_GUI) - ,[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT) - ,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT) - ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) -}; - -void toggle_steno(int pressed) -{ - uint8_t layer = biton32(layer_state); - - if (pressed) { - if (layer != PLVR) layer_on(PLVR); else layer_off(PLVR); - - register_code(PV_LP); - register_code(PV_LH); - register_code(PV_LR); - register_code(PV_O); - register_code(PV_RL); - register_code(PV_RG); - } else { - unregister_code(PV_LP); - unregister_code(PV_LH); - unregister_code(PV_LR); - unregister_code(PV_O); - unregister_code(PV_RL); - unregister_code(PV_RG); - } -} - -macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) -{ - uint8_t need_shift = 0; - uint8_t hold_shift = 0; - - if (!record->event.pressed) - return MACRO_NONE; - - layer_off (HUN); - - if (keyboard_report->mods & MOD_BIT (KC_LSFT)) { - hold_shift = 1; - need_shift = 1; - unregister_code (KC_LSFT); - } - if ((get_oneshot_mods () & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out ()) { - need_shift = 1; - hold_shift = 0; - unregister_code (KC_LSFT); - } - - clear_oneshot_mods (); - - register_code (KC_RALT); - unregister_code (KC_RALT); - if (accent == (KC_DQT)) { - register_code (KC_RSFT); - } - register_code (accent); - unregister_code (accent); - if (need_shift && accent != (KC_DQT)) { - register_code (KC_RSFT); - } else if (accent == (KC_DQT) && !need_shift) { - unregister_code (KC_RSFT); - } - register_code (hun_char); - unregister_code (hun_char); - if (need_shift || accent == (KC_DQT)) - unregister_code (KC_RSFT); - if (hold_shift) - register_code (KC_LSFT); - - return MACRO_NONE; -} - -void ang_handle_kf (keyrecord_t *record, uint8_t id) -{ - uint8_t code = id - KF_1; - - if (record->event.pressed) { - kf_timers[code] = timer_read (); - } else { - uint8_t kc; - - if (timer_elapsed (kf_timers[code]) > TAPPING_TERM) { - // Long press - kc = KC_F1 + code; - } else { - if (id == KF_11) - kc = KC_EQL; - else - kc = KC_1 + code; - } - - register_code (kc); - unregister_code (kc); - } -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case A_ESC: - if (record->event.pressed) { - if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) { - clear_oneshot_mods (); - } else { - register_code (KC_ESC); - } - layer_off (HUN); - } else { - unregister_code (KC_ESC); - } - break; - - case A_MPN: - if (record->event.pressed) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || - ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { - int oneshot = ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out()); - - if (oneshot) - clear_oneshot_mods (); - unregister_code (KC_LSFT); - - register_code (KC_MPRV); - unregister_code (KC_MPRV); - - if (!oneshot) - register_code (KC_LSFT); - } else { - return MACRO (T(MNXT), END); - } - } - break; - - /* Hungarian layer */ - case HU_AA: - return ang_do_hun (record, KC_QUOT, KC_A); - case HU_OO: - return ang_do_hun (record, KC_QUOT, KC_O); - case HU_EE: - return ang_do_hun (record, KC_QUOT, KC_E); - case HU_UU: - return ang_do_hun (record, KC_QUOT, KC_U); - case HU_II: - return ang_do_hun (record, KC_QUOT, KC_I); - case HU_OE: - return ang_do_hun (record, KC_DQT, KC_O); - case HU_UE: - return ang_do_hun (record, KC_DQT, KC_U); - case HU_OEE: - return ang_do_hun (record, KC_EQL, KC_O); - case HU_UEE: - return ang_do_hun (record, KC_EQL, KC_U); - - /* Mouse movement */ - case A_MUL: - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_LEFT); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_LEFT); - } - mousekey_send(); - break; - - case A_MUR: - if (record->event.pressed) { - mousekey_on(KC_MS_UP); - mousekey_on(KC_MS_RIGHT); - } else { - mousekey_off(KC_MS_UP); - mousekey_off(KC_MS_RIGHT); - } - mousekey_send(); - break; - - case A_MDL: - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_LEFT); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_LEFT); - } - mousekey_send(); - break; - - case A_MDR: - if (record->event.pressed) { - mousekey_on(KC_MS_DOWN); - mousekey_on(KC_MS_RIGHT); - } else { - mousekey_off(KC_MS_DOWN); - mousekey_off(KC_MS_RIGHT); - } - mousekey_send(); - break; - - /* Plover base */ - case A_PLVR: - toggle_steno(record->event.pressed); - break; - - /* GUI & AppSel */ - case A_GUI: - if (record->event.pressed) { - register_code (KC_LGUI); - if (record->tap.count && !record->tap.interrupted) { - if (record->tap.count >= 2) { - register_code (KC_W); - layer_on (APPSEL); - set_oneshot_layer (APPSEL, ONESHOT_START); - } - } else { - record->tap.count = 0; - } - gui_timer = 0; - } else { - if (record->tap.count >= 2) - { - unregister_code (KC_W); - clear_oneshot_layer_state (ONESHOT_PRESSED); - } - gui_timer = timer_read (); - } - break; - - case APP_SLK: - return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); - - case APP_EMCS: - return MACRODOWN(T(E), T(M), T(A), T(C), T(S), T(ENT), END); - - case APP_TERM: - return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); - - case APP_CHRM: - return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END); - - case APP_MSIC: - return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); - - /* Function keys */ - case KF_1 ... KF_11: - ang_handle_kf (record, id); - break; - - /* 1HAND layout */ - case OH_BASE: - if (record->event.pressed) { - oh_base_timer = timer_read (); - } else { - if (timer_elapsed (oh_base_timer) > TAPPING_TERM) { - layer_clear (); - } else { - return MACRO (T(APP), END); - } - } - break; - - case OH_BSSPC: - if (record->event.pressed) { - oh_bsspc_timer = timer_read (); - } else { - if (timer_elapsed (oh_bsspc_timer) > TAPPING_TERM) { - return MACRO (T(BSPC), END); - } else { - return MACRO (T(SPC), END); - } - } - break; - - case OH_ENTSFT: - if (record->event.pressed) { - oh_entsft_timer = timer_read (); - } else { - if (timer_elapsed (oh_entsft_timer) > TAPPING_TERM) { - if (keyboard_report->mods & MOD_BIT(KC_LSFT)) - unregister_code (KC_LSFT); - else - register_code (KC_LSFT); - } else { - return MACRO (T(ENT), END); - } - } - break; - - case OH_LEFT: - if (record->event.pressed) { - layer_move (OHLFT); - oh_left_blink = 1; - oh_left_blink_timer = timer_read (); - ergodox_right_led_1_on (); - } - break; - - case OH_RIGHT: - if (record->event.pressed) { - layer_move (OHRGT); - oh_right_blink = 1; - oh_right_blink_timer = timer_read (); - ergodox_right_led_3_on (); - } - break; - } - return MACRO_NONE; -}; - -uint8_t is_adore = 0; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - uint8_t dl; - - ergodox_led_all_on(); - for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { - ergodox_led_all_set (i); - wait_ms (5); - } - wait_ms(1000); - for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { - ergodox_led_all_set (i); - wait_ms (10); - } - ergodox_led_all_off(); - - if (!eeconfig_is_enabled()) - eeconfig_init(); - dl = eeconfig_read_default_layer (); - if (dl == (1UL << ADORE)) - is_adore = 1; -}; - -LEADER_EXTERNS(); - -void ang_do_unicode (void) { - register_code (KC_RCTL); - register_code (KC_RSFT); - register_code (KC_U); - unregister_code (KC_U); - unregister_code (KC_RSFT); - unregister_code (KC_RCTL); - wait_ms (100); -} - -void ang_tap (uint16_t codes[]) { - for (int i = 0; codes[i] != 0; i++) { - register_code (codes[i]); - unregister_code (codes[i]); - wait_ms (50); - } -} - -#define TAP_ONCE(code) \ - register_code (code); \ - unregister_code (code) - -void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_RSFT); - register_code (KC_SCLN); - } else if (state->count == 2) { - register_code (KC_SCLN); - } -} - -void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_SCLN); - unregister_code (KC_RSFT); - } else if (state->count == 2) { - unregister_code (KC_SCLN); - } -} - -void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code (KC_MINS); - } else if (state->count == 2) { - register_code (KC_RSFT); - register_code (KC_MINS); - } -} - -void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code (KC_MINS); - } else if (state->count == 2) { - unregister_code (KC_RSFT); - unregister_code (KC_MINS); - } -} - -typedef struct { - bool layer_toggle; - bool sticky; - bool finished_once; -} td_ta_state_t; - -void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { - td_ta_state_t *td_ta = (td_ta_state_t *) user_data; - - if (td_ta->finished_once) { - return; - } - - if (td_ta->sticky) { - td_ta->sticky = false; - td_ta->layer_toggle = false; - layer_off (ARRW); - return; - } - - td_ta->finished_once = true; - if (state->count == 1 && !state->pressed) { - register_code (KC_TAB); - td_ta->sticky = false; - td_ta->layer_toggle = false; - } else { - td_ta->layer_toggle = true; - layer_on (ARRW); - td_ta->sticky = (state->count == 2); - } -} - -void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { - td_ta_state_t *td_ta = (td_ta_state_t *) user_data; - - if (!td_ta->layer_toggle) - unregister_code (KC_TAB); - if (!td_ta->sticky) - layer_off (ARRW); - - td_ta->finished_once = false; -} - -const qk_tap_dance_action_t tap_dance_actions[] = { - [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) - ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) - ,[CT_TA] = { - .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, - .user_data = (void *)&((td_ta_state_t) { false, false, false }) - } -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) - unregister_code (KC_LGUI); - - if (layer != OHLFT) - oh_left_blink = 0; - if (layer != OHRGT) - oh_right_blink = 0; - - if (layer == HUN) { - ergodox_right_led_2_on(); - ergodox_right_led_3_on(); - } else if (layer == NMDIA) { - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - } else if (layer == PLVR) { - ergodox_right_led_1_on (); - ergodox_right_led_2_on (); - ergodox_right_led_3_on (); - } else if (layer == ADORE) { - ergodox_right_led_1_on (); - ergodox_right_led_2_on (); - ergodox_right_led_3_on (); - - ergodox_right_led_2_set (LED_BRIGHTNESS_HI); - } - - if (layer == OHLFT || layer == OHRGT) { - ergodox_right_led_2_on(); - - if (oh_left_blink) { - if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL) { - if ((keyboard_report->mods & MOD_BIT(KC_LSFT)) == 0) - ergodox_right_led_1_off (); - } - if (timer_elapsed (oh_left_blink_timer) > OH_BLINK_INTERVAL * 2) { - ergodox_right_led_1_on (); - oh_left_blink_timer = timer_read (); - } - } - - if (oh_right_blink) { - if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL) { - if ((keyboard_report->mods & MOD_BIT(KC_LCTRL)) == 0) - ergodox_right_led_3_off (); - } - if (timer_elapsed (oh_right_blink_timer) > OH_BLINK_INTERVAL * 2) { - ergodox_right_led_3_on (); - oh_right_blink_timer = timer_read (); - } - } - } - - if (keyboard_report->mods & MOD_BIT(KC_LSFT) || - ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_1_set (LED_BRIGHTNESS_HI); - ergodox_right_led_1_on (); - } else { - ergodox_right_led_1_set (LED_BRIGHTNESS_LO); - if (layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) - ergodox_right_led_1_off (); - } - - if (keyboard_report->mods & MOD_BIT(KC_LALT) || - ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_2_set (LED_BRIGHTNESS_HI); - ergodox_right_led_2_on (); - } else { - ergodox_right_led_2_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != OHLFT && layer != NMDIA && layer != PLVR && layer != ADORE) - ergodox_right_led_2_off (); - } - - if (keyboard_report->mods & MOD_BIT(KC_LCTRL) || - ((get_oneshot_mods() & MOD_BIT(KC_LCTRL)) && !has_oneshot_mods_timed_out())) { - ergodox_right_led_3_set (LED_BRIGHTNESS_HI); - ergodox_right_led_3_on (); - } else { - ergodox_right_led_3_set (LED_BRIGHTNESS_LO); - if (layer != OHRGT && layer != HUN && layer != PLVR && layer != ADORE) - ergodox_right_led_3_off (); - } - - LEADER_DICTIONARY() { - leading = false; - leader_end (); - -#if KEYLOGGER_ENABLE - SEQ_ONE_KEY (KC_D) { - ergodox_led_all_on(); - wait_ms(100); - ergodox_led_all_off(); - log_enable = !log_enable; - } -#endif - - SEQ_ONE_KEY (KC_T) { - time_travel = !time_travel; - } - - SEQ_ONE_KEY (KC_U) { - ang_do_unicode (); - } - - SEQ_ONE_KEY (KC_V) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")"); - } - - SEQ_ONE_KEY (KC_L) { - /* λ */ - ang_do_unicode (); - - uint16_t codes[] = {KC_0, KC_3, KC_B, KC_B, KC_ENT, 0}; - ang_tap (codes); - } - - SEQ_ONE_KEY (KC_Y) { - uint16_t codes[] = {KC_BSLS, KC_O, KC_SLSH, 0}; - ang_tap (codes); - } - - SEQ_ONE_KEY (KC_S) { - ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); - TAP_ONCE (KC_BSLS); - register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); - ang_do_unicode (); TAP_ONCE (KC_3); TAP_ONCE (KC_0); TAP_ONCE (KC_C); TAP_ONCE (KC_4); TAP_ONCE (KC_SPC); - register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); - TAP_ONCE (KC_SLSH); - ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); - } - - SEQ_TWO_KEYS (KC_W, KC_M) { - register_code (KC_LALT); - register_code (KC_F2); - unregister_code (KC_F2); - unregister_code (KC_LALT); - - wait_ms (1000); - - uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; - ang_tap (codes); - register_code (KC_LGUI); - register_code (KC_UP); - unregister_code (KC_UP); - unregister_code (KC_LGUI); - } - - SEQ_ONE_KEY (KC_A) { - if (is_adore == 0) { - default_layer_and (0); - default_layer_or ((1UL << ADORE)); - eeconfig_update_default_layer ((1UL << ADORE)); - is_adore = 1; - - ergodox_led_all_off (); - ergodox_right_led_3_on (); - wait_ms (100); - ergodox_right_led_2_on (); - wait_ms (100); - ergodox_right_led_3_off (); - ergodox_right_led_1_on (); - wait_ms (100); - ergodox_right_led_2_off (); - wait_ms (100); - ergodox_right_led_1_off (); - } else { - is_adore = 0; - default_layer_and (0); - default_layer_or (1UL << BASE); - eeconfig_update_default_layer ((1UL << BASE)); - - ergodox_led_all_off (); - ergodox_right_led_1_on (); - wait_ms (100); - ergodox_right_led_2_on (); - wait_ms (100); - ergodox_right_led_1_off (); - ergodox_right_led_3_on (); - wait_ms (100); - ergodox_right_led_2_off (); - wait_ms (100); - ergodox_right_led_3_off (); - } - } - } -} - -static uint16_t last4[4]; - -bool process_record_user (uint16_t keycode, keyrecord_t *record) { -#if KEYLOGGER_ENABLE - uint8_t layer = biton32(layer_state); - - if (log_enable && layer == BASE) { - xprintf ("KL: col=%d, row=%d\n", record->event.key.col, - record->event.key.row); - } -#endif - - if (time_travel && !record->event.pressed) { - uint8_t p; - - // shift cache one to the left - for (p = 0; p < 3; p++) { - last4[p] = last4[p + 1]; - } - last4[3] = keycode; - - if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { - uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; - ang_tap (codes); - register_code (KC_RSFT); - register_code (KC_EQL); - unregister_code (KC_EQL); - unregister_code (KC_RSFT); - - uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; - ang_tap (codes2); - - return false; - } - } - - return true; -} + +/* Layers */ + +enum { + BASE = 0, + ADORE, + ARRW, + APPSEL, + HUN, + NMDIA, + PLVR, +}; + +/* Macros */ + +enum { + NONE = 0, + // Buttons that do extra stuff + A_GUI, + A_PLVR, + A_ESC, + A_MPN, + + // Function / number keys + KF_1, // 1, F1 + KF_2, // 2, F2 + KF_3, // ... + KF_4, + KF_5, + KF_6, + KF_7, + KF_8, + KF_9, + KF_10, + KF_11, // =, F11 + + // Application select keys + APP_SLK, // Slack + APP_EMCS, // Emacs + APP_TERM, // Terminal + APP_CHRM, // Chrome + APP_MSIC, // Music + + // Diagonal mouse movement + A_MUL, + A_MUR, + A_MDL, + A_MDR, + + // Hungarian layer keys + HU_AA, // à + HU_OO, // Ó + HU_EE, // É + HU_UU, // Ú + HU_II, // à + HU_OE, // Ö + HU_UE, // Ãœ + HU_OEE, // Å + HU_UEE, // Å° +}; + +/* Fn keys */ + +enum { + F_BSE = 0, + F_HUN, + F_GUI, + F_SFT, + F_ALT, + F_CTRL +}; + +/* Custom keycodes */ + +enum { + CT_CLN = 0, + CT_MNS, + CT_TA, + CT_LBP, + CT_RBP +}; + +/* States & timers */ + +uint16_t gui_timer = 0; + +uint16_t kf_timers[12]; + +#if KEYLOGGER_ENABLE +bool log_enable = false; +#endif + +bool time_travel = false; + +/* The Keymap */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Keymap 0: Base Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | Next/Prev | 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | ~ | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | \ | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | Tab/ARROW | A | O | E | U | I |------| |------| D | H | T | N | S | = / Arrow | + * |-----------+------+------+------+------+------| ( | | ) |------+------+------+------+------+-----------| + * | Play/Pause| / | Q | J | K | X | | | | B | M | W | V | Z | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | : | | - | | | | | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | LAlt | GUI | | MDIA | Del | + * ,------|------|------| |------+------+------. + * | | | Ctrl | | LEAD | | | + * |Backsp|LShift|------| |------| Enter| Space| + * | | | ESC | | HUN | | | + * `--------------------' `--------------------' + */ +[BASE] = KEYMAP( +// left hand + M(A_MPN) ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,KC_GRV ,KC_QUOT ,KC_COMM ,KC_DOT ,KC_P ,KC_Y ,KC_LBRC +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_U ,KC_I +,KC_MPLY ,KC_SLSH ,KC_Q ,KC_J ,KC_K ,KC_X ,KC_LPRN +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,TD(CT_CLN) + + ,F(F_ALT),F(F_GUI) + ,F(F_CTRL) + ,KC_BSPC,F(F_SFT),M(A_ESC) + + // right hand + ,KC_APP ,M(KF_6),M(KF_7) ,M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,KC_RBRC ,KC_F ,KC_G ,KC_C ,KC_R ,KC_L ,KC_BSLS + ,KC_D ,KC_H ,KC_T ,KC_N ,KC_S ,KC_EQL + ,KC_RPRN ,KC_B ,KC_M ,KC_W ,KC_V ,KC_Z ,KC_MSTP + ,TD(CT_MNS),KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,OSL(NMDIA),KC_DEL + ,KC_LEAD + ,F(F_HUN) ,KC_ENT ,KC_SPC + ), + +/* Keymap 1: Adore layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | Play/Pause| 1 F1 | 2 F2 | 3 F3 | 4 F4 | 5 F5 | Plvr | | Apps | 6 F6 | 7 F7 | 8 F8 | 9 F9 | 0 F10| F11 | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | `~ | X | W | K | L | M | ( | | ) | F | H | C | P | Y | \ | + * |-----------+------+------+------+------+------| [ | | ] |------+------+------+------+------+-----------| + * | Tab/Arrow | A | O | E | I | U |------| |------| D | R | T | N | S | = | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | Z | Q | ' | , | . | : | | - | B | G | V | J | / | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | LAlt | GUI | | MDIA | Del | + * ,------|------|------| |------+------+------. + * | | | Ctrl | | HUN | | | + * |Backsp|LShift|------| |------| Enter| Space| + * | | | ESC | | LEAD | | | + * `--------------------' `--------------------' + */ +[ADORE] = KEYMAP( +// left hand + KC_MPLY ,M(KF_1) ,M(KF_2) ,M(KF_3),M(KF_4),M(KF_5),M(A_PLVR) +,KC_GRV ,KC_X ,KC_W ,KC_K ,KC_L ,KC_M ,TD(CT_LBP) +,TD(CT_TA) ,KC_A ,KC_O ,KC_E ,KC_I ,KC_U +,KC_NO ,KC_Z ,KC_Q ,KC_QUOT,KC_COMM,KC_DOT ,TD(CT_CLN) +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,F(F_ALT),F(F_GUI) + ,F(F_CTRL) + ,KC_BSPC,F(F_SFT),M(A_ESC) + + // right hand + ,KC_APP ,M(KF_6),M(KF_7),M(KF_8),M(KF_9) ,M(KF_10) ,KC_F11 + ,TD(CT_RBP),KC_F ,KC_H ,KC_C ,KC_P ,KC_Y ,KC_BSLS + ,KC_D ,KC_R ,KC_T ,KC_N ,KC_S ,KC_EQL + ,TD(CT_MNS),KC_B ,KC_G ,KC_V ,KC_J ,KC_SLSH ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,OSL(NMDIA),KC_DEL + ,F(F_HUN) + ,KC_LEAD ,KC_ENT ,KC_SPC + ), + +/* Keymap 2: Arrow layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | Home | Up | End | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | Left | Down | Rght | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | Enter| |------| |------| PgUp | PgDn | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[ARRW] = KEYMAP( +// left hand + KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_ENT ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_HOME ,KC_UP ,KC_END ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_LEFT ,KC_DOWN ,KC_RGHT ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_PGUP ,KC_PGDN + ), + +/* Keymap 3: Application select layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | |Music |Slack |Emacs |Term |Chrome| | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | | | | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[APPSEL] = KEYMAP( +// left hand + KC_TRNS ,M(APP_MSIC),M(APP_SLK),M(APP_EMCS),M(APP_TERM),M(APP_CHRM),KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS + ), + + +/* Keymap 4: Hungarian Layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | | Å | | Å° | | | | | | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | à | Ó | É | Ú | à |------| |------| | | | | | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | | Ö | | Ãœ | | | | | | | | | | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | BASE | | | + * `--------------------' `--------------------' + */ + +[HUN] = KEYMAP( +// left hand + KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,M(HU_OEE),KC_NO ,M(HU_UEE),KC_NO ,KC_NO +,KC_NO ,M(HU_AA),M(HU_OO) ,M(HU_EE),M(HU_UU) ,M(HU_II) +,KC_NO ,KC_NO ,M(HU_OE) ,KC_NO ,M(HU_UE) ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,KC_NO ,KC_TRNS ,KC_TRNS + + // right hand + ,KC_TRNS ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_NO ,KC_NO + ,KC_NO + ,F(F_BSE),KC_TRNS ,KC_TRNS + ), + +/* Keymap 5: Navigation & Media layer + * + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | MS Slow | | | | | |ScrLCK| |ScrLCK| | | | | | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | MS Normal | | Home | Up | PgUp | | | |Scroll| |MsUpL | MsUp |MsUpR | |PrintScreen| + * |-----------+------+------+------+------+------| | | Up |------+------+------+------+------+-----------| + * | MS Fast | | Left | Down | Right| |------| |------| |MsLeft| MsDn |MsRght| | | + * |-----------+------+------+------+------+------| | |Scroll|------+------+------+------+------+-----------| + * | Play/Pause| | End | Down | PgDn | | | | Down | |MsDnL | MsDn |MsDnR | | Stop | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Mute | VlUp | | BASE | MClk | + * ,------|------|------| |------+------+------. + * | | | VlDn | | Prev |Left |Right | + * | SPC | Enter|------| |------| Click| Click| + * | | | ESC | | Next | | | + * `--------------------' `--------------------' + */ +[NMDIA] = KEYMAP( +// left hand + KC_ACL0 ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,LGUI(KC_L) +,KC_ACL1 ,KC_NO ,KC_HOME ,KC_UP ,KC_PGUP ,KC_NO ,KC_NO +,KC_ACL2 ,KC_NO ,KC_LEFT ,KC_DOWN ,KC_RIGHT,KC_NO +,KC_MPLY ,KC_NO ,KC_END ,KC_DOWN ,KC_PGDN ,KC_NO ,KC_NO +,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_MUTE ,KC_VOLU + ,KC_VOLD + ,KC_SPC,KC_ENTER,M(A_ESC) + + // right hand + ,LGUI(KC_L),KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + ,KC_WH_U ,KC_NO ,M(A_MUL),KC_MS_U ,M(A_MUR),KC_NO ,KC_PSCR + ,KC_NO ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_NO ,KC_NO + ,KC_WH_D ,KC_NO ,M(A_MDL),KC_MS_D ,M(A_MDR),KC_NO ,KC_MSTP + ,KC_NO ,KC_NO ,KC_NO ,KC_NO ,KC_NO + + ,KC_TRNS ,KC_MS_BTN3 + ,KC_MPRV + ,KC_MNXT ,KC_BTN1 ,KC_BTN2 + ), + +/* Keymap 6: Steno for Plover + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | BASE | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | # | # | # | # | # | # | | # | # | # | # | # | # | # | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | T | P | H | |------| |------| | F | P | L | T | D | + * |--------+ S +------+------+------+ * | * | | * | * +------+------+------+------+--------| + * | | | K | W | R | | | | | | R | B | G | S | Z | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | A | O |------| |------| E | U | + * | | | | | | | | + * `--------------------' `--------------------' + */ + +[PLVR] = KEYMAP( +// left hand +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, M(A_PLVR), +KC_NO, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, +KC_NO, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, +KC_NO, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, +KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + PV_A, PV_O, KC_NO, + + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, PV_NUM, + PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, + PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO,PV_E, PV_U + ), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [F_BSE] = ACTION_LAYER_CLEAR(ON_PRESS) + ,[F_HUN] = ACTION_LAYER_INVERT(HUN, ON_PRESS) + ,[F_GUI] = ACTION_MACRO_TAP(A_GUI) + ,[F_SFT] = ACTION_MODS_ONESHOT (MOD_LSFT) + ,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT) + ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) +}; + +void toggle_steno(int pressed) +{ + uint8_t layer = biton32(layer_state); + + if (pressed) { + if (layer != PLVR) layer_on(PLVR); else layer_off(PLVR); + + register_code(PV_LP); + register_code(PV_LH); + register_code(PV_LR); + register_code(PV_O); + register_code(PV_RL); + register_code(PV_RG); + } else { + unregister_code(PV_LP); + unregister_code(PV_LH); + unregister_code(PV_LR); + unregister_code(PV_O); + unregister_code(PV_RL); + unregister_code(PV_RG); + } +} + +macro_t *ang_do_hun (keyrecord_t *record, uint16_t accent, uint16_t hun_char) +{ + uint8_t need_shift = 0; + uint8_t hold_shift = 0; + + if (!record->event.pressed) + return MACRO_NONE; + + layer_off (HUN); + + if (keyboard_report->mods & MOD_BIT (KC_LSFT)) { + hold_shift = 1; + need_shift = 1; + unregister_code (KC_LSFT); + } + if ((get_oneshot_mods () & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out ()) { + need_shift = 1; + hold_shift = 0; + unregister_code (KC_LSFT); + } + + clear_oneshot_mods (); + + register_code (KC_RALT); + unregister_code (KC_RALT); + if (accent == (KC_DQT)) { + register_code (KC_RSFT); + } + register_code (accent); + unregister_code (accent); + if (need_shift && accent != (KC_DQT)) { + register_code (KC_RSFT); + } else if (accent == (KC_DQT) && !need_shift) { + unregister_code (KC_RSFT); + } + register_code (hun_char); + unregister_code (hun_char); + if (need_shift || accent == (KC_DQT)) + unregister_code (KC_RSFT); + if (hold_shift) + register_code (KC_LSFT); + + return MACRO_NONE; +} + +void ang_handle_kf (keyrecord_t *record, uint8_t id) +{ + uint8_t code = id - KF_1; + + if (record->event.pressed) { + kf_timers[code] = timer_read (); + } else { + uint8_t kc; + + if (timer_elapsed (kf_timers[code]) > TAPPING_TERM) { + // Long press + kc = KC_F1 + code; + } else { + if (id == KF_11) + kc = KC_EQL; + else + kc = KC_1 + code; + } + + register_code (kc); + unregister_code (kc); + } +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case A_ESC: + if (record->event.pressed) { + if ((get_oneshot_mods ()) && !has_oneshot_mods_timed_out ()) { + clear_oneshot_mods (); + } else { + register_code (KC_ESC); + } + layer_off (HUN); + } else { + unregister_code (KC_ESC); + } + break; + + case A_MPN: + if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + int oneshot = ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out()); + + if (oneshot) + clear_oneshot_mods (); + unregister_code (KC_LSFT); + + register_code (KC_MPRV); + unregister_code (KC_MPRV); + + if (!oneshot) + register_code (KC_LSFT); + } else { + return MACRO (T(MNXT), END); + } + } + break; + + /* Hungarian layer */ + case HU_AA: + return ang_do_hun (record, KC_QUOT, KC_A); + case HU_OO: + return ang_do_hun (record, KC_QUOT, KC_O); + case HU_EE: + return ang_do_hun (record, KC_QUOT, KC_E); + case HU_UU: + return ang_do_hun (record, KC_QUOT, KC_U); + case HU_II: + return ang_do_hun (record, KC_QUOT, KC_I); + case HU_OE: + return ang_do_hun (record, KC_DQT, KC_O); + case HU_UE: + return ang_do_hun (record, KC_DQT, KC_U); + case HU_OEE: + return ang_do_hun (record, KC_EQL, KC_O); + case HU_UEE: + return ang_do_hun (record, KC_EQL, KC_U); + + /* Mouse movement */ + case A_MUL: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MUR: + if (record->event.pressed) { + mousekey_on(KC_MS_UP); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_UP); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + case A_MDL: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_LEFT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_LEFT); + } + mousekey_send(); + break; + + case A_MDR: + if (record->event.pressed) { + mousekey_on(KC_MS_DOWN); + mousekey_on(KC_MS_RIGHT); + } else { + mousekey_off(KC_MS_DOWN); + mousekey_off(KC_MS_RIGHT); + } + mousekey_send(); + break; + + /* Plover base */ + case A_PLVR: + toggle_steno(record->event.pressed); + break; + + /* GUI & AppSel */ + case A_GUI: + if (record->event.pressed) { + register_code (KC_LGUI); + if (record->tap.count && !record->tap.interrupted) { + if (record->tap.count >= 2) { + register_code (KC_W); + layer_on (APPSEL); + set_oneshot_layer (APPSEL, ONESHOT_START); + } + } else { + record->tap.count = 0; + } + gui_timer = 0; + } else { + if (record->tap.count >= 2) + { + unregister_code (KC_W); + clear_oneshot_layer_state (ONESHOT_PRESSED); + } + gui_timer = timer_read (); + } + break; + + case APP_SLK: + return MACRODOWN(T(S), T(L), T(A), T(C), T(K), T(ENT), END); + + case APP_EMCS: + return MACRODOWN(T(G), T(N), T(U), T(SPC), T(E), T(M), T(A), T(C), T(S), T(SPC), T(2), T(4), T(ENT), END); + + case APP_TERM: + return MACRODOWN(T(T), T(E), T(R), T(M), T(ENT), END); + + case APP_CHRM: + return MACRODOWN(T(C), T(H), T(R), T(O), T(M), T(ENT), END); + + case APP_MSIC: + return MACRODOWN(T(R), T(H), T(Y), T(T), T(H), T(M), T(B), T(O), T(X), T(ENT), END); + + /* Function keys */ + case KF_1 ... KF_11: + ang_handle_kf (record, id); + break; + } + + return MACRO_NONE; +}; + +uint8_t is_adore = 0; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + uint8_t dl; + + ergodox_led_all_on(); + for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--) { + ergodox_led_all_set (i); + wait_ms (5); + } + wait_ms(1000); + for (int i = LED_BRIGHTNESS_LO; i > 0; i--) { + ergodox_led_all_set (i); + wait_ms (10); + } + ergodox_led_all_off(); + + if (!eeconfig_is_enabled()) + eeconfig_init(); + dl = eeconfig_read_default_layer (); + if (dl == (1UL << ADORE)) { + is_adore = 1; +#if ADORE_AUTOLOG + log_enable = true; +#endif + } +}; + +LEADER_EXTERNS(); + +void ang_do_unicode (void) { + register_code (KC_RCTL); + register_code (KC_RSFT); + register_code (KC_U); + unregister_code (KC_U); + unregister_code (KC_RSFT); + unregister_code (KC_RCTL); + wait_ms (100); +} + +void ang_tap (uint16_t codes[]) { + for (int i = 0; codes[i] != 0; i++) { + register_code (codes[i]); + unregister_code (codes[i]); + wait_ms (50); + } +} + +#define TAP_ONCE(code) \ + register_code (code); \ + unregister_code (code) + +void ang_tap_dance_bp_finished (qk_tap_dance_state_t *state, void *user_data) { + bool left, parens; + + if (state->count > 2) { + state->count = 0; + return; + } + + if (state->keycode == TD(CT_LBP)) + left = true; + else + left = false; + + if (state->count == 1) + parens = false; + else + parens = true; + + if (parens) { + register_code (KC_RSFT); + if (left) { + TAP_ONCE(KC_9); + } else { + TAP_ONCE(KC_0); + } + unregister_code (KC_RSFT); + } else { + if (left) { + TAP_ONCE (KC_LBRC); + } else { + TAP_ONCE (KC_RBRC); + } + } +} + +void ang_tap_dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_RSFT); + register_code (KC_SCLN); + } else if (state->count == 2) { + register_code (KC_SCLN); + } +} + +void ang_tap_dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_SCLN); + unregister_code (KC_RSFT); + } else if (state->count == 2) { + unregister_code (KC_SCLN); + } +} + +void ang_tap_dance_mns_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_MINS); + } else if (state->count == 2) { + register_code (KC_RSFT); + register_code (KC_MINS); + } +} + +void ang_tap_dance_mns_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_MINS); + } else if (state->count == 2) { + unregister_code (KC_RSFT); + unregister_code (KC_MINS); + } +} + +typedef struct { + bool layer_toggle; + bool sticky; + bool finished_once; +} td_ta_state_t; + +void ang_tap_dance_ta_finished (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (td_ta->finished_once) { + return; + } + + if (td_ta->sticky) { + td_ta->sticky = false; + td_ta->layer_toggle = false; + layer_off (ARRW); + return; + } + + td_ta->finished_once = true; + if (state->count == 1 && !state->pressed) { + register_code (KC_TAB); + td_ta->sticky = false; + td_ta->layer_toggle = false; + } else { + td_ta->layer_toggle = true; + layer_on (ARRW); + td_ta->sticky = (state->count == 2); + } +} + +void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { + td_ta_state_t *td_ta = (td_ta_state_t *) user_data; + + if (!td_ta->layer_toggle) + unregister_code (KC_TAB); + if (!td_ta->sticky) + layer_off (ARRW); + + td_ta->finished_once = false; +} + +const qk_tap_dance_action_t tap_dance_actions[] = { + [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) + ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) + ,[CT_TA] = { + .fn = { NULL, ang_tap_dance_ta_finished, ang_tap_dance_ta_reset }, + .user_data = (void *)&((td_ta_state_t) { false, false, false }) + } + ,[CT_LBP] = ACTION_TAP_DANCE_FN (ang_tap_dance_bp_finished) + ,[CT_RBP] = ACTION_TAP_DANCE_FN (ang_tap_dance_bp_finished) +}; + +static uint16_t uni[32]; +static uint8_t unicnt; +static bool unimagic = false; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + if (gui_timer && timer_elapsed (gui_timer) > TAPPING_TERM) + unregister_code (KC_LGUI); + + if (layer == HUN) { + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + } else if (layer == NMDIA) { + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + } else if (layer == PLVR) { + ergodox_right_led_1_on (); + ergodox_right_led_2_on (); + ergodox_right_led_3_on (); + } else if (layer == ADORE) { + ergodox_right_led_1_on (); + ergodox_right_led_2_on (); + ergodox_right_led_3_on (); + + ergodox_right_led_2_set (LED_BRIGHTNESS_HI); + } + + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || + ((get_oneshot_mods() & MOD_BIT(KC_LSFT)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_1_set (LED_BRIGHTNESS_HI); + ergodox_right_led_1_on (); + } else { + ergodox_right_led_1_set (LED_BRIGHTNESS_LO); + if (layer != NMDIA && layer != PLVR && layer != ADORE) + ergodox_right_led_1_off (); + } + + if (keyboard_report->mods & MOD_BIT(KC_LALT) || + ((get_oneshot_mods() & MOD_BIT(KC_LALT)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_2_set (LED_BRIGHTNESS_HI); + ergodox_right_led_2_on (); + } else { + ergodox_right_led_2_set (LED_BRIGHTNESS_LO); + if (layer != HUN && layer != NMDIA && layer != PLVR && layer != ADORE) + ergodox_right_led_2_off (); + } + + if (keyboard_report->mods & MOD_BIT(KC_LCTRL) || + ((get_oneshot_mods() & MOD_BIT(KC_LCTRL)) && !has_oneshot_mods_timed_out())) { + ergodox_right_led_3_set (LED_BRIGHTNESS_HI); + ergodox_right_led_3_on (); + } else { + ergodox_right_led_3_set (LED_BRIGHTNESS_LO); + if (layer != HUN && layer != PLVR && layer != ADORE) + ergodox_right_led_3_off (); + } + + LEADER_DICTIONARY() { + leading = false; + leader_end (); + +#if KEYLOGGER_ENABLE + SEQ_ONE_KEY (KC_D) { + ergodox_led_all_on(); + wait_ms(100); + ergodox_led_all_off(); + log_enable = !log_enable; + } +#endif + + SEQ_ONE_KEY (KC_T) { + time_travel = !time_travel; + } + + SEQ_ONE_KEY (KC_U) { + ang_do_unicode (); + } + + SEQ_TWO_KEYS (KC_LEAD, KC_U) { + unicnt = 0; + unimagic = true; + register_code(KC_RSFT); + TAP_ONCE(KC_U); + unregister_code(KC_RSFT); + } + + SEQ_ONE_KEY (KC_V) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ (" QMK_VERSION "/" KEYMAP_VERSION ")"); + } + + SEQ_ONE_KEY (KC_L) { + /* λ */ + ang_do_unicode (); + + uint16_t codes[] = {KC_0, KC_3, KC_B, KC_B, KC_ENT, 0}; + ang_tap (codes); + } + + SEQ_ONE_KEY (KC_Y) { + uint16_t codes[] = {KC_BSLS, KC_O, KC_SLSH, 0}; + ang_tap (codes); + } + + SEQ_ONE_KEY (KC_S) { + ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); + TAP_ONCE (KC_BSLS); + register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + ang_do_unicode (); TAP_ONCE (KC_3); TAP_ONCE (KC_0); TAP_ONCE (KC_C); TAP_ONCE (KC_4); TAP_ONCE (KC_SPC); + register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); + TAP_ONCE (KC_SLSH); + ang_do_unicode (); TAP_ONCE (KC_A); TAP_ONCE (KC_F); TAP_ONCE (KC_SPC); + } + + SEQ_TWO_KEYS (KC_W, KC_M) { + register_code (KC_LALT); + register_code (KC_F2); + unregister_code (KC_F2); + unregister_code (KC_LALT); + + wait_ms (1000); + + uint16_t codes[] = {KC_M, KC_A, KC_X, KC_MINS, KC_F, KC_O, KC_C, KC_U, KC_S, KC_E, KC_D, KC_ENT, 0}; + ang_tap (codes); + register_code (KC_LGUI); + register_code (KC_UP); + unregister_code (KC_UP); + unregister_code (KC_LGUI); + } + + SEQ_ONE_KEY (KC_A) { + if (is_adore == 0) { + default_layer_and (0); + default_layer_or ((1UL << ADORE)); + eeconfig_update_default_layer ((1UL << ADORE)); + is_adore = 1; + + ergodox_led_all_off (); + ergodox_right_led_3_on (); + wait_ms (100); + ergodox_right_led_2_on (); + wait_ms (100); + ergodox_right_led_3_off (); + ergodox_right_led_1_on (); + wait_ms (100); + ergodox_right_led_2_off (); + wait_ms (100); + ergodox_right_led_1_off (); +#if ADORE_AUTOLOG + log_enable = true; +#endif + } else { +#if ADORE_AUTOLOG + log_enable = false; +#endif + is_adore = 0; + default_layer_and (0); + default_layer_or (1UL << BASE); + eeconfig_update_default_layer ((1UL << BASE)); + + ergodox_led_all_off (); + ergodox_right_led_1_on (); + wait_ms (100); + ergodox_right_led_2_on (); + wait_ms (100); + ergodox_right_led_1_off (); + ergodox_right_led_3_on (); + wait_ms (100); + ergodox_right_led_2_off (); + wait_ms (100); + ergodox_right_led_3_off (); + } + } + } +} + +static uint16_t last4[4]; + +bool is_uni_seq(char *seq) { + uint8_t i; + + for (i = 0; seq[i]; i++) { + uint16_t code; + if (('1' <= seq[i]) && (seq[i] <= '9')) + code = seq[i] - '1' + KC_1; + else if (seq[i] == '0') + code = KC_0; + else + code = seq[i] - 'a' + KC_A; + + if (i > unicnt) + return false; + if (uni[i] != code) + return false; + } + + if (uni[i] == KC_ENT || uni[i] == KC_SPC) + return true; + + return false; +} + +uint16_t hex_to_keycode(uint8_t hex) +{ + if (hex == 0x0) { + return KC_0; + } else if (hex < 0xA) { + return KC_1 + (hex - 0x1); + } else { + return KC_A + (hex - 0xA); + } +} + +void register_hex(uint16_t hex) { + bool leading_zeros = true; + + for(int i = 3; i >= 0; i--) { + uint8_t digit = ((hex >> (i*4)) & 0xF); + if (digit != 0) + leading_zeros = false; + else if (leading_zeros) + continue; + register_code(hex_to_keycode(digit)); + unregister_code(hex_to_keycode(digit)); + wait_ms(10); + } +} + +typedef struct { + char *symbol; + uint16_t codes[4]; +} qk_ucis_symbol_t; + +static qk_ucis_symbol_t ucis_symbol_table[] = { + {"poop", {0x1, 0xf4a9, 0}}, + {"rofl", {0x1, 0xf923, 0}}, + {"kiss", {0x1, 0xf619, 0}}, + {"snowman", {0x2603, 0}}, + {NULL, {}} +}; + +bool process_record_ucis (uint16_t keycode, keyrecord_t *record) { + uint8_t i; + + if (!unimagic) + return true; + + if (!record->event.pressed) + return true; + + uni[unicnt] = keycode; + unicnt++; + + if (keycode == KC_BSPC) { + if (unicnt >= 2) { + unicnt-= 2; + return true; + } else { + unicnt--; + return false; + } + } + + if (keycode == KC_ENT || keycode == KC_SPC) { + bool symbol_found = false; + + for (i = unicnt; i > 0; i--) { + register_code (KC_BSPC); + unregister_code (KC_BSPC); + wait_ms(10); + } + + ang_do_unicode(); + wait_ms(10); + for (i = 0; ucis_symbol_table[i].symbol; i++) { + if (is_uni_seq (ucis_symbol_table[i].symbol)) { + symbol_found = true; + for (uint8_t j = 0; ucis_symbol_table[i].codes[j]; j++) { + register_hex(ucis_symbol_table[i].codes[j]); + } + break; + } + } + if (!symbol_found) { + for (i = 0; i < unicnt - 1; i++) { + uint8_t code; + + if (uni[i] > KF_1) + code = uni[i] - KF_1 + KC_1; + else + code = uni[i]; + TAP_ONCE(code); + wait_ms (10); + } + } + + unimagic = false; + return true; + } + return true; +} + +bool process_record_user (uint16_t keycode, keyrecord_t *record) { +#if KEYLOGGER_ENABLE + if (log_enable) { + xprintf ("KL: col=%d, row=%d\n", record->event.key.col, + record->event.key.row); + } +#endif + + if (!process_record_ucis (keycode, record)) + return false; + + if (time_travel && !record->event.pressed) { + uint8_t p; + + // shift cache one to the left + for (p = 0; p < 3; p++) { + last4[p] = last4[p + 1]; + } + last4[3] = keycode; + + if (last4[0] == KC_D && last4[1] == KC_A && last4[2] == KC_T && last4[3] == KC_E) { + uint16_t codes[] = {KC_E, KC_SPC, KC_MINS, KC_D, KC_SPC, KC_QUOT, 0}; + ang_tap (codes); + register_code (KC_RSFT); + register_code (KC_EQL); + unregister_code (KC_EQL); + unregister_code (KC_RSFT); + + uint16_t codes2[] = {KC_4, KC_SPC, KC_D, KC_A, KC_Y, KC_S, KC_QUOT, 0}; + ang_tap (codes2); + + return false; + } + } + + return true; +} diff --git a/keyboards/ergodox/keymaps/algernon/readme.md b/keyboards/ergodox/keymaps/algernon/readme.md index 6fe177511..26dfddbe6 100644 --- a/keyboards/ergodox/keymaps/algernon/readme.md +++ b/keyboards/ergodox/keymaps/algernon/readme.md @@ -16,11 +16,12 @@ Some of the things in the layout only work when one uses Spacemacs and GNOME und - [ADORE layer](#adore-layer) - [Hungarian layer](#hungarian-layer) - [Navigation and media layer](#navigation-and-media-layer) - - [One-handed layer](#one-handed-layer) - [Steno layer](#steno-layer) - [LED states](#led-states) * [Tools](#tools) - [Heatmap](#heatmap) +* [Special features](#special-features) + - [Unicode Symbol Input](#unicode-symbol-input) * [Building](#building) - [Using on Windows](#using-on-windows) * [Changelog](#changelog) @@ -38,7 +39,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest * The `Shift`, `Alt`, and `Control` modifiers are one-shot. When tapped, they are considered active for the next key press only. When double tapped, they toggle on, until a third, single tap sometime later. When held, they act as expected. My usual pattern is that I use these for the next keypress only, so this behaviour is perfect. If I need them held, I'll just double-tap. * The `GUI` key is special, because when I double-tap it, it sends `GUI + w`, which pops up an application selector. It also switches to a one-shot layer, where the number row on the left half turns into app selector macros, for the most common things I usually want to switch to. Otherwise it behaves as on a normal layout. * The `ESC` key also doubles as a one-shot cancel key: if tapped while any of the one-shot modifiers are in-flight (as in, single-tapped, and not expired yet), it cancels all one-shot modifiers. It also cancels the **Hun** layer, if active. Otherwise it sends the usual keycode. -* The **Media** and **Hun** layer keys are one-shot, the **1Hand** and **STENO** keys are toggles. +* The **Media** and **Hun** layer keys are one-shot, the **STENO** key is a toggle. * When holding any of the **Arrow** layer keys, the arrow layer activates while the layer key is held. Tapping the key produces the normal key. * Tapping the `:` key once yields `:`, tapping it twice yields `;`. * The **Lead** key allows me to type in a sequence of keys, and trigger some actions: @@ -51,6 +52,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest - `LEAD v` prints the firmware version, the keyboard and the keymap. - `LEAD d` toggles logging keypress positions to the HID console. - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. + - `LEAD LEAD u` enters the [Unicode symbol input][#unicode-symbol-input] mode. ## ADORE layer @@ -74,20 +76,6 @@ On this layer, the accented characters are at the same position as their base va This layer is primarily for navigating with the cursor or the mouse, and some media things. -## One-handed layer - -[![One-handed layer](images/one-handed-layer.png)](http://www.keyboard-layout-editor.com/#/gists/edff2495135955b8963198dace7f7ece) - -The one-handed layer is used in situations where the right hand is occupied, by mousing around, for example. Tapping the `OTHER` key switches which side is active. For the most part, keys remain in their usual position. When the right half is active, keys are mirrored to the left half. - -The differences are as follows: - -* The `ESC` key has been moved to the bottom row, so the `OTHER` key is easier to tap. -* Most keys on the thumb cluster now have dual uses, and these do not change when switching sides: - - The `Space`/`Backspace` key sends `Space` on tap, `Backspace` when held for longer than a normal tap. - - The `Enter`/`Shift` key sends `Enter` on short-tap, `Shift` on long-tap. -* The `Apps`/`BASE` key can be used to go back to the base layer, by long-tapping it. A short-tap will send the `App` key, as usual. - ## Steno layer [![Steno layer for Plover](images/steno-layer.png)](http://www.keyboard-layout-editor.com/#/gists/401ef9a84369e47c57f9aedcf0a0d667) @@ -103,11 +91,25 @@ For the layers, the following rules apply: * When the [ADORE layer](#adore-layer) is toggled on, LEDs will light up from left to right in a sequence, then turn off. When the layer is toggled off, the LEDs light up and turn off in the other direction. No LEDs are on while the layer is active. * When the [Hungarian layer](#hungarian-layer) is active, the *green* and *blue* LEDs are on. * When the [Navigation and media layer](#navigation-and-media-layer) is active, the *red* and *green* ones are on. -* When the [One-handed layer](#one-handed-layer) is active, the *green* LED is on and bright, and either the *red* or the *blue* one is going to slowly blink, depending on the currently active side. * For the [Steno layer](#steno-layer), all LEDs will be turned on. Unless noted otherwise, the layers use a dim light for the LEDs, while modifiers use a stronger one, and modifiers override any layer preferences. For example, when on the one-handed layer, with the left side active (*red* light blinking), if `Shift` is on, the *red* light will be constantly on. +# Special features + +## Unicode Symbol Input + +Once in the Unicode Symbol Input mode, one is able to type in symbol names, press `Enter` or `Space`, and get the Unicode symbol itself back. When in the mode, a capital `U` is printed first. Once the sequence is finished, all of it is erased by sending enough `Backspace` taps, and the firmware starts the OS-specific unicode input sequence. Then, it looks up the symbol name, and enters the associated code. If it is not found, it will just replay the pressed keycodes. + +The currently supported symbols are: + +- `snowman`: ☃ +- `kiss`: 😙 +- `rofl`: 🤣 +- `poop`: 💩 + +This is an experimental feature, and may or may not work reliably. + # Tools ## Heatmap @@ -133,14 +135,14 @@ To make my workflow easier, this layout is maintained in [its own repository][al $ git clone https://github.com/jackhumbert/qmk_firmware.git $ cd qmk_firmware $ git clone https://github.com/algernon/ergodox-layout.git \ - keyboards/ergodox_ez/keymaps/algernon-master -$ make KEYBOARD=ergodox_ez KEYMAP=algernon-master + keyboards/ergodox/keymaps/algernon-master +$ make keyboard=ergodox keymap=algernon-master ``` From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware): ``` -$ make KEYBOARD=ergodox_ez KEYMAP=algernon +$ make keyboard=ergodox keymap=algernon ``` ## Using on Windows @@ -149,6 +151,16 @@ The keymap default to forcing NKRO, which seems to upset Windows, and except the # Changelog +## v1.5 - 2016-08-12 + +* The **1HAND** layer has been removed. +* A `Delete` key is now available on the right thumb cluster. +* The [ADORE](#adore-layer) layer received a major update, see the layout image above. +* It is now possible to enable automatic logging for the [ADORE](#adore-layer) layer, by setting the `ADORE_AUTOLOG` makefile variable to `yes` when compiling the keymap. It is off by default. +* The `~` key and the `Media Next/Prev` key have been swapped on the [base layer](#base-layer). +* On the **ARROW** layer, `Backspace` has been replaced by `Enter`. +* There is some experimental support for entering Unicode symbols. + ## v1.4 - 2016-07-29 * When toggling the key logging on or off, the LEDs will do a little dance. -- cgit v1.2.3-24-g4f1b From cafa528b88c097f02ae92a5b15b015f5653cefe7 Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 12 Aug 2016 19:14:48 +0200 Subject: only aesthetics --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index 71c205a48..9f838ba61 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -67,10 +67,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_TAB] = KEYMAP_ISO_SPLITRSHIFT( - KC_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RALT(KC_7), RALT(KC_0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ + KC_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RALT(KC_7), RALT(KC_0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) -- cgit v1.2.3-24-g4f1b From 098951905d527c19043de75ef262ac9679ec452b Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 12 Aug 2016 20:45:43 -0400 Subject: forces all ergodox keymaps to be ez on qmk.fm (were infinity) --- util/travis_compiled_push.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh index 27ab3cec6..c2a994ef0 100644 --- a/util/travis_compiled_push.sh +++ b/util/travis_compiled_push.sh @@ -7,6 +7,8 @@ rev=$(git rev-parse --short HEAD) git config --global user.name "Travis CI" git config --global user.email "jack.humb+travis.ci@gmail.com" +make all-keymaps keyboard=ergodox/ez AUTOGEN=true + find . -name ".build" | xargs rm -rf cd .. git clone https://$GH_TOKEN@github.com/jackhumbert/qmk.fm.git -- cgit v1.2.3-24-g4f1b From 477f1ad0c8e360880d2b2db9abe4b000940a56bf Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 12 Aug 2016 19:07:44 -0700 Subject: fix link to ErgoDox EZ This just fixes the readme link to the ErgoDox EZ directory --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 57629f8be..e2221e749 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,7 @@ For an easy-to-read version of this document and the repository, check out [http * [Planck](/keyboards/planck/) * [Preonic](/keyboards/preonic/) * [Atomic](/keyboards/atomic/) -* [ErgoDox EZ](/keyboards/ergodox_ez/) +* [ErgoDox EZ](/keyboards/ergodox/ez/) * [Clueboard](/keyboards/clueboard/) * [Cluepad](/keyboards/cluepad/) @@ -31,7 +31,7 @@ The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/j This is not a tiny project. While this is the main readme, there are many other files you might want to consult. Here are some points of interest: -* The readme for your own keyboard: This is found under `keyboards//`. So for the ErgoDox EZ, it's [here](keyboards/ergodox_ez/); for the Planck, it's [here](keyboards/planck/) and so on. +* The readme for your own keyboard: This is found under `keyboards//`. So for the ErgoDox EZ, it's [here](keyboards/ergodox/ez/); for the Planck, it's [here](keyboards/planck/) and so on. * The list of possible keycodes you can use in your keymap is actually spread out in a few different places: * [doc/keycode.txt](doc/keycode.txt) - an explanation of those same keycodes. * [quantum/keymap.h](quantum/keymap.h) - this is where the QMK-specific aliases are all set up. Things like the Hyper and Meh key, the Leader key, and all of the other QMK innovations. These are also explained and documented below, but `keymap.h` is where they're actually defined. -- cgit v1.2.3-24-g4f1b From 458607ee5eafe1cc095b258cac014c334d8e7b72 Mon Sep 17 00:00:00 2001 From: Ian Sterling Date: Fri, 12 Aug 2016 22:26:30 -0700 Subject: Corrections to the Atreus Makefile and updates to my keymap --- keyboards/atreus/keymaps/xyverz/keymap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c index 0238fdbd3..02a661c8e 100644 --- a/keyboards/atreus/keymaps/xyverz/keymap.c +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -46,14 +46,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_L1] = { /* LAYER 1 */ {KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 }, {KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_EQL }, - {KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, + {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, {KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } }, [_L2] = { /* LAYER 2 */ {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PLUS}, {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, +<<<<<<< HEAD {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET } +======= + {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET} +>>>>>>> e1abe4c... Corrections to the Atreus Makefile and updates to my keymap } }; -- cgit v1.2.3-24-g4f1b From 3bae791372e2090b30647d431c70c233caaef26f Mon Sep 17 00:00:00 2001 From: Xyverz Date: Fri, 12 Aug 2016 22:30:01 -0700 Subject: Update keymap.c --- keyboards/atreus/keymaps/xyverz/keymap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c index 02a661c8e..b418cc9b5 100644 --- a/keyboards/atreus/keymaps/xyverz/keymap.c +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -53,11 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PLUS}, {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, -<<<<<<< HEAD - {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET } -======= {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET} ->>>>>>> e1abe4c... Corrections to the Atreus Makefile and updates to my keymap } }; -- cgit v1.2.3-24-g4f1b From c07fe96581f02d0ea14c50cda7565aa52406c122 Mon Sep 17 00:00:00 2001 From: Ian Sterling Date: Fri, 12 Aug 2016 23:45:40 -0700 Subject: Adding the MiniVan44 aka TheVan 44 by u/evangs to the repo. Initial Commit. --- keyboards/minivan44/Makefile | 75 ++++++++++++ keyboards/minivan44/config.h | 162 ++++++++++++++++++++++++++ keyboards/minivan44/keymaps/default/Makefile | 21 ++++ keyboards/minivan44/keymaps/default/config.h | 8 ++ keyboards/minivan44/keymaps/default/keymap.c | 97 +++++++++++++++ keyboards/minivan44/keymaps/default/readme.md | 1 + keyboards/minivan44/keymaps/xyverz/Makefile | 21 ++++ keyboards/minivan44/keymaps/xyverz/config.h | 8 ++ keyboards/minivan44/keymaps/xyverz/keymap.c | 92 +++++++++++++++ keyboards/minivan44/keymaps/xyverz/readme.md | 1 + keyboards/minivan44/minivan44.c | 28 +++++ keyboards/minivan44/minivan44.h | 22 ++++ keyboards/minivan44/readme.md | 28 +++++ 13 files changed, 564 insertions(+) create mode 100644 keyboards/minivan44/Makefile create mode 100644 keyboards/minivan44/config.h create mode 100644 keyboards/minivan44/keymaps/default/Makefile create mode 100644 keyboards/minivan44/keymaps/default/config.h create mode 100644 keyboards/minivan44/keymaps/default/keymap.c create mode 100644 keyboards/minivan44/keymaps/default/readme.md create mode 100644 keyboards/minivan44/keymaps/xyverz/Makefile create mode 100644 keyboards/minivan44/keymaps/xyverz/config.h create mode 100644 keyboards/minivan44/keymaps/xyverz/keymap.c create mode 100644 keyboards/minivan44/keymaps/xyverz/readme.md create mode 100644 keyboards/minivan44/minivan44.c create mode 100644 keyboards/minivan44/minivan44.h create mode 100644 keyboards/minivan44/readme.md diff --git a/keyboards/minivan44/Makefile b/keyboards/minivan44/Makefile new file mode 100644 index 000000000..45ca12780 --- /dev/null +++ b/keyboards/minivan44/Makefile @@ -0,0 +1,75 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= yes # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../Makefile +endif + + diff --git a/keyboards/minivan44/config.h b/keyboards/minivan44/config.h new file mode 100644 index 000000000..0ae93c095 --- /dev/null +++ b/keyboards/minivan44/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +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 0xFEAE +#define PRODUCT_ID 0x8844 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Evan Sailer +#define PRODUCT TheVan 44 +#define DESCRIPTION keyboard firmware for TV44 + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, B5, F7, D4 } +#define MATRIX_COL_PINS { D2, D3, D5, D6, B4, B6, F6, F5, F4, F1, F0, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/minivan44/keymaps/default/Makefile b/keyboards/minivan44/keymaps/default/Makefile new file mode 100644 index 000000000..f4671a9d1 --- /dev/null +++ b/keyboards/minivan44/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/default/config.h b/keyboards/minivan44/keymaps/default/config.h new file mode 100644 index 000000000..df06a2620 --- /dev/null +++ b/keyboards/minivan44/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/default/keymap.c b/keyboards/minivan44/keymaps/default/keymap.c new file mode 100644 index 000000000..d559a4b1c --- /dev/null +++ b/keyboards/minivan44/keymaps/default/keymap.c @@ -0,0 +1,97 @@ +#include "minivan44.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _QW 0 +#define _DV 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 +#define _L3 5 + +// Macro name shortcuts +#define QWERTY M(_QW) +#define DVORAK M(_DV) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = { /* Qwerty */ + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MO(_L1) }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_DV] = { /* Dvorak */ + {KC_TAB, KC_COMM, KC_DOT, KC_SLSH, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_BSPC }, + {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MO(_L1) }, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_CM] = { /* Colemak */ + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, + {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, MO(_L1) }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_L1] = { /* LAYER 1 */ + {KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, + {_______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, + {_______, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ } + }, + [_L2] = { /* LAYER 2 */ + {_______, QWERTY, DVORAK, COLEMAK, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, _______ }, + {KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, LSFT(KC_LBRC), LSFT(KC_RBRC), KC_4, KC_5, KC_6, KC_VOLU, KC_ENT }, + {_______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______ }, + {_______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ } + }, + [_L3] = { /* LAYER 3 */ + {_______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______ }, + {KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______ }, + {KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_F12, _______ }, + {_______, KC_LSFT, KC_B, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_C, _______, _______, XXXXXXX, _______ } + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/minivan44/keymaps/default/readme.md b/keyboards/minivan44/keymaps/default/readme.md new file mode 100644 index 000000000..189a9c0ff --- /dev/null +++ b/keyboards/minivan44/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for minivan44 \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/xyverz/Makefile b/keyboards/minivan44/keymaps/xyverz/Makefile new file mode 100644 index 000000000..f4671a9d1 --- /dev/null +++ b/keyboards/minivan44/keymaps/xyverz/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/xyverz/config.h b/keyboards/minivan44/keymaps/xyverz/config.h new file mode 100644 index 000000000..df06a2620 --- /dev/null +++ b/keyboards/minivan44/keymaps/xyverz/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/xyverz/keymap.c b/keyboards/minivan44/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..f995da0e7 --- /dev/null +++ b/keyboards/minivan44/keymaps/xyverz/keymap.c @@ -0,0 +1,92 @@ +#include "minivan44.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _DV 0 +#define _QW 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 + +// Macro name shortcuts +#define DVORAK M(_DV) +#define QWERTY M(_QW) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_DV] = { /* 0: Dvorak */ + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC }, + {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT }, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_QW] = { /* 1: Qwerty */ + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_CM] = { /* 2: Colemak */ + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, + {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_L1] = {/* 1: FN 1 */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, + {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, + {_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, + {_______, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, _______, _______ } + }, + + [_L2] = { /* 2: FN 2 */ + {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ESC }, + {_______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_VOLU, KC_ENT }, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_VOLD, _______ }, + {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ } + } + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; + + diff --git a/keyboards/minivan44/keymaps/xyverz/readme.md b/keyboards/minivan44/keymaps/xyverz/readme.md new file mode 100644 index 000000000..189a9c0ff --- /dev/null +++ b/keyboards/minivan44/keymaps/xyverz/readme.md @@ -0,0 +1 @@ +# The default keymap for minivan44 \ No newline at end of file diff --git a/keyboards/minivan44/minivan44.c b/keyboards/minivan44/minivan44.c new file mode 100644 index 000000000..be8214fd5 --- /dev/null +++ b/keyboards/minivan44/minivan44.c @@ -0,0 +1,28 @@ +#include "minivan44.h" + +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(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/minivan44/minivan44.h b/keyboards/minivan44/minivan44.h new file mode 100644 index 000000000..c6119c2e1 --- /dev/null +++ b/keyboards/minivan44/minivan44.h @@ -0,0 +1,22 @@ +#ifndef MINIVAN44_H +#define MINIVAN44_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K37, K38, K39, K3B \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, K38, K39, K3A, K3B } \ + +#endif diff --git a/keyboards/minivan44/readme.md b/keyboards/minivan44/readme.md new file mode 100644 index 000000000..59b62b0e6 --- /dev/null +++ b/keyboards/minivan44/readme.md @@ -0,0 +1,28 @@ +minivan44 keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/minivan44 folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make`. + +### Other Keymaps + +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: + +``` +$ make keymap=[default|jack|] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 8bdf745909bc2581491acce11225f56a85bc8f24 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 13 Aug 2016 10:33:47 +0200 Subject: process_unicode: Fix set_unicode_input_mode() In the header, this was defined as `set_unicode_input_mode`, but the implementation had `set_unicode_mode` for a name. Changed the implementation to match the header. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_unicode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index ad5d7f86b..3fcac15ce 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -13,7 +13,7 @@ uint16_t hex_to_keycode(uint8_t hex) } } -void set_unicode_mode(uint8_t os_target) +void set_unicode_input_mode(uint8_t os_target) { input_mode = os_target; } -- cgit v1.2.3-24-g4f1b From 2d0f585e426084b13fecc642cdda77506e2bfbf9 Mon Sep 17 00:00:00 2001 From: Ian Sterling Date: Sat, 13 Aug 2016 10:36:08 -0700 Subject: Renamed minivan44 to tv44 in all occurrences per wishes of Jack and Evan. --- keyboards/tv44/Makefile | 75 ++++++++++++++ keyboards/tv44/config.h | 162 +++++++++++++++++++++++++++++++ keyboards/tv44/keymaps/default/Makefile | 21 ++++ keyboards/tv44/keymaps/default/config.h | 8 ++ keyboards/tv44/keymaps/default/keymap.c | 97 ++++++++++++++++++ keyboards/tv44/keymaps/default/readme.md | 1 + keyboards/tv44/keymaps/xyverz/Makefile | 21 ++++ keyboards/tv44/keymaps/xyverz/config.h | 8 ++ keyboards/tv44/keymaps/xyverz/keymap.c | 92 ++++++++++++++++++ keyboards/tv44/keymaps/xyverz/readme.md | 1 + keyboards/tv44/readme.md | 28 ++++++ keyboards/tv44/tv44.c | 28 ++++++ keyboards/tv44/tv44.h | 22 +++++ 13 files changed, 564 insertions(+) create mode 100644 keyboards/tv44/Makefile create mode 100644 keyboards/tv44/config.h create mode 100644 keyboards/tv44/keymaps/default/Makefile create mode 100644 keyboards/tv44/keymaps/default/config.h create mode 100644 keyboards/tv44/keymaps/default/keymap.c create mode 100644 keyboards/tv44/keymaps/default/readme.md create mode 100644 keyboards/tv44/keymaps/xyverz/Makefile create mode 100644 keyboards/tv44/keymaps/xyverz/config.h create mode 100644 keyboards/tv44/keymaps/xyverz/keymap.c create mode 100644 keyboards/tv44/keymaps/xyverz/readme.md create mode 100644 keyboards/tv44/readme.md create mode 100644 keyboards/tv44/tv44.c create mode 100644 keyboards/tv44/tv44.h diff --git a/keyboards/tv44/Makefile b/keyboards/tv44/Makefile new file mode 100644 index 000000000..45ca12780 --- /dev/null +++ b/keyboards/tv44/Makefile @@ -0,0 +1,75 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= yes # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +ifndef QUANTUM_DIR + include ../../Makefile +endif + + diff --git a/keyboards/tv44/config.h b/keyboards/tv44/config.h new file mode 100644 index 000000000..0ae93c095 --- /dev/null +++ b/keyboards/tv44/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +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 0xFEAE +#define PRODUCT_ID 0x8844 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Evan Sailer +#define PRODUCT TheVan 44 +#define DESCRIPTION keyboard firmware for TV44 + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, B5, F7, D4 } +#define MATRIX_COL_PINS { D2, D3, D5, D6, B4, B6, F6, F5, F4, F1, F0, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/tv44/keymaps/default/Makefile b/keyboards/tv44/keymaps/default/Makefile new file mode 100644 index 000000000..f4671a9d1 --- /dev/null +++ b/keyboards/tv44/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/default/config.h b/keyboards/tv44/keymaps/default/config.h new file mode 100644 index 000000000..df06a2620 --- /dev/null +++ b/keyboards/tv44/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/default/keymap.c b/keyboards/tv44/keymaps/default/keymap.c new file mode 100644 index 000000000..6a4fef3da --- /dev/null +++ b/keyboards/tv44/keymaps/default/keymap.c @@ -0,0 +1,97 @@ +#include "tv44.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _QW 0 +#define _DV 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 +#define _L3 5 + +// Macro name shortcuts +#define QWERTY M(_QW) +#define DVORAK M(_DV) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = { /* Qwerty */ + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MO(_L1) }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_DV] = { /* Dvorak */ + {KC_TAB, KC_COMM, KC_DOT, KC_SLSH, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_BSPC }, + {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MO(_L1) }, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_CM] = { /* Colemak */ + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, + {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, MO(_L1) }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) }, + {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } + }, + [_L1] = { /* LAYER 1 */ + {KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, + {_______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, + {_______, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ } + }, + [_L2] = { /* LAYER 2 */ + {_______, QWERTY, DVORAK, COLEMAK, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, _______ }, + {KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, LSFT(KC_LBRC), LSFT(KC_RBRC), KC_4, KC_5, KC_6, KC_VOLU, KC_ENT }, + {_______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______ }, + {_______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ } + }, + [_L3] = { /* LAYER 3 */ + {_______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______ }, + {KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______ }, + {KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_F12, _______ }, + {_______, KC_LSFT, KC_B, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_C, _______, _______, XXXXXXX, _______ } + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/tv44/keymaps/default/readme.md b/keyboards/tv44/keymaps/default/readme.md new file mode 100644 index 000000000..ac84c08cf --- /dev/null +++ b/keyboards/tv44/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for tv44 \ No newline at end of file diff --git a/keyboards/tv44/keymaps/xyverz/Makefile b/keyboards/tv44/keymaps/xyverz/Makefile new file mode 100644 index 000000000..f4671a9d1 --- /dev/null +++ b/keyboards/tv44/keymaps/xyverz/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/xyverz/config.h b/keyboards/tv44/keymaps/xyverz/config.h new file mode 100644 index 000000000..df06a2620 --- /dev/null +++ b/keyboards/tv44/keymaps/xyverz/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/xyverz/keymap.c b/keyboards/tv44/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..8cbcf8d35 --- /dev/null +++ b/keyboards/tv44/keymaps/xyverz/keymap.c @@ -0,0 +1,92 @@ +#include "tv44.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _DV 0 +#define _QW 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 + +// Macro name shortcuts +#define DVORAK M(_DV) +#define QWERTY M(_QW) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_DV] = { /* 0: Dvorak */ + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC }, + {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT }, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_QW] = { /* 1: Qwerty */ + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_CM] = { /* 2: Colemak */ + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, + {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, + {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } + }, + + [_L1] = {/* 1: FN 1 */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, + {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, + {_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, + {KC_ESC, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, _______, _______ } + }, + + [_L2] = { /* 2: FN 2 */ + {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ESC }, + {_______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_VOLU, KC_ENT }, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_VOLD, _______ }, + {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ } + } + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; + + diff --git a/keyboards/tv44/keymaps/xyverz/readme.md b/keyboards/tv44/keymaps/xyverz/readme.md new file mode 100644 index 000000000..ac84c08cf --- /dev/null +++ b/keyboards/tv44/keymaps/xyverz/readme.md @@ -0,0 +1 @@ +# The default keymap for tv44 \ No newline at end of file diff --git a/keyboards/tv44/readme.md b/keyboards/tv44/readme.md new file mode 100644 index 000000000..e3b557fe2 --- /dev/null +++ b/keyboards/tv44/readme.md @@ -0,0 +1,28 @@ +tv44 keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/tv44 folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make`. + +### Other Keymaps + +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: + +``` +$ make keymap=[default|jack|] +``` + +Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` \ No newline at end of file diff --git a/keyboards/tv44/tv44.c b/keyboards/tv44/tv44.c new file mode 100644 index 000000000..6dc0efd28 --- /dev/null +++ b/keyboards/tv44/tv44.c @@ -0,0 +1,28 @@ +#include "tv44.h" + +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(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/tv44/tv44.h b/keyboards/tv44/tv44.h new file mode 100644 index 000000000..4c30174ac --- /dev/null +++ b/keyboards/tv44/tv44.h @@ -0,0 +1,22 @@ +#ifndef TV44_H +#define TV44_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K37, K38, K39, K3B \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, K38, K39, K3A, K3B } \ + +#endif -- cgit v1.2.3-24-g4f1b From e87506767cec6410d1a93c15d68452815c9c3553 Mon Sep 17 00:00:00 2001 From: Ian Sterling Date: Sat, 13 Aug 2016 10:44:42 -0700 Subject: Removal of old minivan44 folder. --- keyboards/minivan44/Makefile | 75 ------------ keyboards/minivan44/config.h | 162 -------------------------- keyboards/minivan44/keymaps/default/Makefile | 21 ---- keyboards/minivan44/keymaps/default/config.h | 8 -- keyboards/minivan44/keymaps/default/keymap.c | 97 --------------- keyboards/minivan44/keymaps/default/readme.md | 1 - keyboards/minivan44/keymaps/xyverz/Makefile | 21 ---- keyboards/minivan44/keymaps/xyverz/config.h | 8 -- keyboards/minivan44/keymaps/xyverz/keymap.c | 92 --------------- keyboards/minivan44/keymaps/xyverz/readme.md | 1 - keyboards/minivan44/minivan44.c | 28 ----- keyboards/minivan44/minivan44.h | 22 ---- keyboards/minivan44/readme.md | 28 ----- 13 files changed, 564 deletions(-) delete mode 100644 keyboards/minivan44/Makefile delete mode 100644 keyboards/minivan44/config.h delete mode 100644 keyboards/minivan44/keymaps/default/Makefile delete mode 100644 keyboards/minivan44/keymaps/default/config.h delete mode 100644 keyboards/minivan44/keymaps/default/keymap.c delete mode 100644 keyboards/minivan44/keymaps/default/readme.md delete mode 100644 keyboards/minivan44/keymaps/xyverz/Makefile delete mode 100644 keyboards/minivan44/keymaps/xyverz/config.h delete mode 100644 keyboards/minivan44/keymaps/xyverz/keymap.c delete mode 100644 keyboards/minivan44/keymaps/xyverz/readme.md delete mode 100644 keyboards/minivan44/minivan44.c delete mode 100644 keyboards/minivan44/minivan44.h delete mode 100644 keyboards/minivan44/readme.md diff --git a/keyboards/minivan44/Makefile b/keyboards/minivan44/Makefile deleted file mode 100644 index 45ca12780..000000000 --- a/keyboards/minivan44/Makefile +++ /dev/null @@ -1,75 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE ?= yes # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -ifndef QUANTUM_DIR - include ../../Makefile -endif - - diff --git a/keyboards/minivan44/config.h b/keyboards/minivan44/config.h deleted file mode 100644 index 0ae93c095..000000000 --- a/keyboards/minivan44/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 0xFEAE -#define PRODUCT_ID 0x8844 -#define DEVICE_VER 0x0002 -#define MANUFACTURER Evan Sailer -#define PRODUCT TheVan 44 -#define DESCRIPTION keyboard firmware for TV44 - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D7, B5, F7, D4 } -#define MATRIX_COL_PINS { D2, D3, D5, D6, B4, B6, F6, F5, F4, F1, F0, B3 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/minivan44/keymaps/default/Makefile b/keyboards/minivan44/keymaps/default/Makefile deleted file mode 100644 index f4671a9d1..000000000 --- a/keyboards/minivan44/keymaps/default/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -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 -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/default/config.h b/keyboards/minivan44/keymaps/default/config.h deleted file mode 100644 index df06a2620..000000000 --- a/keyboards/minivan44/keymaps/default/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/default/keymap.c b/keyboards/minivan44/keymaps/default/keymap.c deleted file mode 100644 index d559a4b1c..000000000 --- a/keyboards/minivan44/keymaps/default/keymap.c +++ /dev/null @@ -1,97 +0,0 @@ -#include "minivan44.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. - -#define _QW 0 -#define _DV 1 -#define _CM 2 -#define _L1 3 -#define _L2 4 -#define _L3 5 - -// Macro name shortcuts -#define QWERTY M(_QW) -#define DVORAK M(_DV) -#define COLEMAK M(_CM) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = { /* Qwerty */ - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, - {MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MO(_L1) }, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) }, - {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } - }, - [_DV] = { /* Dvorak */ - {KC_TAB, KC_COMM, KC_DOT, KC_SLSH, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_Q, KC_BSPC }, - {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MO(_L1) }, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_L2) }, - {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } - }, - [_CM] = { /* Colemak */ - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, - {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, MO(_L1) }, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2) }, - {KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_RALT, KC_ESC, XXXXXXX, TG(_L3) } - }, - [_L1] = { /* LAYER 1 */ - {KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, - {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, - {_______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, - {_______, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ } - }, - [_L2] = { /* LAYER 2 */ - {_______, QWERTY, DVORAK, COLEMAK, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, _______ }, - {KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, LSFT(KC_LBRC), LSFT(KC_RBRC), KC_4, KC_5, KC_6, KC_VOLU, KC_ENT }, - {_______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______ }, - {_______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, XXXXXXX, _______ } - }, - [_L3] = { /* LAYER 3 */ - {_______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______ }, - {KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______ }, - {KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_F12, _______ }, - {_______, KC_LSFT, KC_B, KC_SPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_C, _______, _______, XXXXXXX, _______ } - } -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _DV: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_DV); - } - break; - case _QW: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_QW); - } - break; - case _CM: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_CM); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/minivan44/keymaps/default/readme.md b/keyboards/minivan44/keymaps/default/readme.md deleted file mode 100644 index 189a9c0ff..000000000 --- a/keyboards/minivan44/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for minivan44 \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/xyverz/Makefile b/keyboards/minivan44/keymaps/xyverz/Makefile deleted file mode 100644 index f4671a9d1..000000000 --- a/keyboards/minivan44/keymaps/xyverz/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -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 -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/xyverz/config.h b/keyboards/minivan44/keymaps/xyverz/config.h deleted file mode 100644 index df06a2620..000000000 --- a/keyboards/minivan44/keymaps/xyverz/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/minivan44/keymaps/xyverz/keymap.c b/keyboards/minivan44/keymaps/xyverz/keymap.c deleted file mode 100644 index f995da0e7..000000000 --- a/keyboards/minivan44/keymaps/xyverz/keymap.c +++ /dev/null @@ -1,92 +0,0 @@ -#include "minivan44.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _DV 0 -#define _QW 1 -#define _CM 2 -#define _L1 3 -#define _L2 4 - -// Macro name shortcuts -#define DVORAK M(_DV) -#define QWERTY M(_QW) -#define COLEMAK M(_CM) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DV] = { /* 0: Dvorak */ - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC }, - {MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT }, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT }, - {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } - }, - - [_QW] = { /* 1: Qwerty */ - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, - {MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, - {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } - }, - - [_CM] = { /* 2: Colemak */ - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC }, - {MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT }, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, - {KC_LCTL, KC_LALT, KC_LGUI, KC_BSPC, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, KC_SLSH, KC_MINS, XXXXXXX, MO(_L2) } - }, - - [_L1] = {/* 1: FN 1 */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, - {_______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______ }, - {_______, _______, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT }, - {_______, KC_LGUI, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_SLSH, _______, _______ } - }, - - [_L2] = { /* 2: FN 2 */ - {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_ESC }, - {_______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_VOLU, KC_ENT }, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_VOLD, _______ }, - {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______ } - } - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _DV: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_DV); - } - break; - case _QW: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_QW); - } - break; - case _CM: - if (record->event.pressed) { - persistant_default_layer_set(1UL<<_CM); - } - break; - } - return MACRO_NONE; -}; - - diff --git a/keyboards/minivan44/keymaps/xyverz/readme.md b/keyboards/minivan44/keymaps/xyverz/readme.md deleted file mode 100644 index 189a9c0ff..000000000 --- a/keyboards/minivan44/keymaps/xyverz/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for minivan44 \ No newline at end of file diff --git a/keyboards/minivan44/minivan44.c b/keyboards/minivan44/minivan44.c deleted file mode 100644 index be8214fd5..000000000 --- a/keyboards/minivan44/minivan44.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "minivan44.h" - -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(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/minivan44/minivan44.h b/keyboards/minivan44/minivan44.h deleted file mode 100644 index c6119c2e1..000000000 --- a/keyboards/minivan44/minivan44.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef MINIVAN44_H -#define MINIVAN44_H - -#include "quantum.h" - -// This a shortcut to help you visually see your layout. -// The following is an example using the Planck MIT layout -// The first section contains all of the arguements -// The second converts the arguments into a two-dimensional array -#define KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K32, K33, K37, K38, K39, K3B \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ - { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, K38, K39, K3A, K3B } \ - -#endif diff --git a/keyboards/minivan44/readme.md b/keyboards/minivan44/readme.md deleted file mode 100644 index 59b62b0e6..000000000 --- a/keyboards/minivan44/readme.md +++ /dev/null @@ -1,28 +0,0 @@ -minivan44 keyboard firmware -====================== - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/minivan44 folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default - -To build with the default keymap, simply run `make`. - -### Other Keymaps - -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. - -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: - -``` -$ make keymap=[default|jack|] -``` - -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` \ No newline at end of file -- cgit v1.2.3-24-g4f1b From ba7f2b1d3f350b72236a19440ec7026fa0cfd2ba Mon Sep 17 00:00:00 2001 From: Nicholas Keene Date: Sat, 13 Aug 2016 15:53:03 -0500 Subject: The Ordinary Layout is the unsurprising layout --- keyboards/ergodox/keymaps/ordinary/keymap.c | 241 +++++++++------------ .../ergodox/keymaps/ordinary/ordinary-base.png | Bin 99605 -> 76549 bytes .../ergodox/keymaps/ordinary/ordinary-base.txt | 16 +- .../ergodox/keymaps/ordinary/ordinary-media.png | Bin 124144 -> 96205 bytes .../ergodox/keymaps/ordinary/ordinary-media.txt | 36 +-- .../ergodox/keymaps/ordinary/ordinary-special.png | Bin 63065 -> 68418 bytes .../ergodox/keymaps/ordinary/ordinary-special.txt | 20 +- .../ergodox/keymaps/ordinary/ordinary-symbol.png | Bin 103735 -> 73009 bytes .../ergodox/keymaps/ordinary/ordinary-symbol.txt | 20 +- keyboards/ergodox/keymaps/ordinary/readme.md | 8 +- 10 files changed, 158 insertions(+), 183 deletions(-) diff --git a/keyboards/ergodox/keymaps/ordinary/keymap.c b/keyboards/ergodox/keymaps/ordinary/keymap.c index bf0574ea2..eda45b7cb 100644 --- a/keyboards/ergodox/keymaps/ordinary/keymap.c +++ b/keyboards/ergodox/keymaps/ordinary/keymap.c @@ -1,23 +1,20 @@ -#include "ergodox.h" +#include "ergodox_ez.h" #include "led.h" #include "debug.h" #include "action_layer.h" #include "action_util.h" -#include "mousekey.h" #define BASE 0 // default layer #define SYMB 1 // symbols layer #define MDIA 2 // media layer #define SPEC 3 // special layer -#define LCaps 10 // left caps-shift key -#define LSymb 11 // left symbol-shift key -#define LMdia 12 // left media-shift key -#define LSpec 13 // left special-shift key -#define RCaps 14 // right caps-shift key -#define RSymb 15 // right symbol-shift key -#define RMdia 16 // right media-shift key -#define RSpec 17 // right special-shift key +#define LSymb 10 // left symbol-shift key +#define LMdia 11 // left media-shift key +#define LSpec 12 // left special-shift key +#define RSymb 13 // right symbol-shift key +#define RMdia 14 // right media-shift key +#define RSpec 15 // right special-shift key #define MUL 20 // mouse up left #define MUR 21 // mouse up right @@ -25,13 +22,14 @@ #define MDR 23 // mouse down right /* - * The Ordinary Layout for the Ergodox EZ keyboard, v4 - * + * The Ordinary Layout for the Ergodox EZ keyboard, v4.20 + * * Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com * * No rights reserved. This software is in the public domain. * Credit me if you are friendly but if you're a jerk don't bother. - * + * If you use or modify this layout I would love to hear from you. + * * Details: readme.md * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary */ @@ -61,10 +59,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [BASE] = KEYMAP( // left hand - F(LSpec),KC_1,KC_2,KC_3 ,KC_4 ,KC_5 ,KC_ESC + F(LSpec) ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_ESC ,F(LMdia) ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_LBRC ,M(LSymb) ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G -,M(LCaps) ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) +,KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,LSFT(KC_TAB) ,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT,KC_LGUI ,KC_HOME,KC_END ,KC_PGUP @@ -73,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) - ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,M(RCaps) + ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL ,KC_LEFT ,KC_RGHT ,KC_UP @@ -91,8 +89,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | LCtrl | Meh |Hyper | LAlt | LGui | |RGui/0|RAlt/.|Hypr/=|Meh/+ |RCtrl/Ent| - * `-----------------------------------' `-------------------------------------' + * | LCtrl | Meh |Hyper | LAlt | LGui | | 0 | . | = | + | Ent | + * `-----------------------------------' `-----------------------------------' * ,-------------. ,-------------. * | Left | Right| | Home | End | * ,------|------|------| |------+------+------. @@ -105,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // left hand KC_TRNS ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_ESC ,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) -,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV +,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV ,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB ,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT ,KC_LGUI ,KC_LEFT ,KC_RGHT @@ -116,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS - ,GUI_T(KC_0),ALT_T(KC_DOT),ALL_T(KC_EQL),MEH_T(KC_PLUS),CTL_T(KC_ENT) + ,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT ,KC_HOME ,KC_END ,KC_PGUP ,KC_PGDN ,KC_BSPC ,KC_DEL @@ -124,24 +122,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /******* Media Layer ******************************************************************************************************* * - * ,---------------------------------------------------------------. ,---------------------------------------------------------------. - * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | - * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| - * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | - * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| - * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | - * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| - * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | - * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' - * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| - * `---------------------------------------------' `---------------------------------------------' - * ,-------------. ,-------------. - * | Stop |Refrsh| | Prev | Next | - * ,------|------|------| |------+------+------. - * |Brwser|Brwser|Search| |VolUp | | | - * |Back | Fwd |------| |------| Stop | Play-| - * | | | Home | |VolDn | | Pause| - * `--------------------' `--------------------' + * ,---------------------------------------------------------------. ,---------------------------------------------------------------. + * | | F11 | F12 | F13 | F14 | F15 | Esc | | | F16 | F17 | F18 | F19 | F20 | | + * |------+---------+---------+---------+---------+----------------| |------+---------+---------+---------+---------+---------+------| + * | |Shut Down|MouseUpLf|Mouse Up |MouseUpRg|Volume Up|Scroll| |Scroll|PrintScrn| Home | Up | PgUp | Mail | | + * |------+---------+---------+---------+---------+---------| Up | | Up |---------+---------+---------+---------+---------+------| + * | | Sleep |MouseLeft|MouseDown|MouseRght|Volume Dn|------| |------| Num Lock| Left | Down | Right | MyComp | | + * |------+---------+---------+---------+---------+---------|Scroll| |Scroll|---------+---------+---------+---------+---------+------| + * | | |MouseDnLf|MouseDown|MouseDnRg| Mute | Down | | Down | | End | Down | PgDn | | | + * `------+---------+---------+---------+---------+----------------' `----------------+---------+---------+---------+---------+------' + * |LCtrl| Meh | MClick | LClick | R Click| |Cmd/Insrt|Optn/Del | Hyper | Meh |RCtrl| + * `---------------------------------------------' `---------------------------------------------' + * ,-------------. ,-------------. + * | Stop |Refrsh| | Prev | Next | + * ,------|------|------| |------+------+------. + * |Brwser|Brwser|Search| |VolUp | | | + * |Back | Fwd |------| |------| Stop | Play-| + * | | | Home | |VolDn | | Pause| + * `--------------------' `--------------------' */ [MDIA] = KEYMAP( // left hand @@ -166,67 +164,63 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /******* Special Layer ***************************************************************************************************** * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | Esc | | | | | | | | | | | | Bspc | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | |------| |------| | | | | | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | | | | | | | | | | | | | | RShift | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' + * ,-------------------------------------------------------. ,-------------------------------------------------------. + * | | Esc | | | | | | | | | | | - | Bspc | | + * |-------------+------+------+------+------+-------------| |------+------+------+------+------+------+-------------| + * | Media Lock | | | | | | | | | | | | [ | ] | Media Lock | + * |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------| + * | Symbol Lock | | | | | |------| |------| | | | | | Symbol Lock | + * |-------------+------+------+------+------+------| | | |------+------+------+------+------+-------------| + * | Caps Lock | | | | | | | | | | | | | | Caps Lock | + * `-------------+------+------+------+------+-------------' `-------------+------+------+------+------+-------------' + * | | | | | | | | | | | | + * `------------------------------------' `------------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' */ [SPEC] = KEYMAP( // left hand KC_TRNS ,KC_ESC ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS -,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS +,KC_CAPS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS,KC_TRNS ,KC_TRNS - // right hand - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_BSPC ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_RSFT - ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS - - ,KC_TRNS ,KC_TRNS - ,KC_TRNS - ,KC_TRNS ,KC_TRNS ,KC_TRNS + // right hand + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_MINS ,KC_BSPC ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_LBRC ,KC_RBRC ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_CAPS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS ,KC_TRNS + ,KC_TRNS ,KC_TRNS + ,KC_TRNS + ,KC_TRNS ,KC_TRNS ,KC_TRNS ) }; const uint16_t PROGMEM fn_actions[] = { // the faux shift keys are implemented as macro taps - [LCaps] = ACTION_MACRO_TAP(LCaps) - ,[LSymb] = ACTION_MACRO_TAP(LSymb) + [LSymb] = ACTION_MACRO_TAP(LSymb) ,[LMdia] = ACTION_MACRO_TAP(LMdia) ,[LSpec] = ACTION_MACRO_TAP(LSpec) - ,[RCaps] = ACTION_MACRO_TAP(RCaps) ,[RSymb] = ACTION_MACRO_TAP(RSymb) ,[RMdia] = ACTION_MACRO_TAP(RMdia) ,[RSpec] = ACTION_MACRO_TAP(RSpec) }; -uint16_t caps_shift = 0; uint16_t symb_shift = 0; uint16_t mdia_shift = 0; +uint16_t spec_shift = 0; -bool symb_lock = false; bool mdia_lock = false; +bool symb_lock = false; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { @@ -237,50 +231,28 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // only because sometimes rapid pressing led to irregular events; this way the states // are self healing during use. - case LCaps: // both caps-shift keys trigger Left Shift - case RCaps: // so they don't interfere with the magic combo - if (record->event.pressed && !record->tap.count) { - if(++caps_shift > 2) caps_shift = 2; - if(caps_shift == 2) { - register_code(KC_CAPS); - unregister_code(KC_CAPS); - } else if(caps_shift == 1) { - register_code(KC_LSFT); - } - } else { - if(--caps_shift < 0) caps_shift = 0; - if(caps_shift == 0) unregister_code(KC_LSFT); - } - break; - - case LSymb: - if (record->event.pressed) { - if(++symb_shift > 2) symb_shift = 2; - if(symb_shift == 2) { - symb_lock = !symb_lock; - } else if(symb_shift == 1) { - layer_on(SYMB); - } - } else { - if(--symb_shift < 0) symb_shift = 0; - if((symb_shift == 0) && (!symb_lock)) layer_off(SYMB); + case LSymb: // + if (record->event.pressed) { // when the LSymb button is pressed + if(++symb_shift > 2) mdia_shift = 2; // increment the symb shift count, max two + if(spec_shift) symb_lock = !symb_lock; // if the Special layer is on, toggle the shift lock + layer_on(SYMB); // in any case, turn on the Symbols layer + } else { // when the LSymb button is released + if(--symb_shift < 0) symb_shift = 0; // decrement the shift count, minimum zero + if((!symb_shift) && (!symb_lock)) layer_off(SYMB); // if both shifts are released and the lock is off, turn off the Symbols layer } break; case LMdia: if (record->event.pressed) { - if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) { register_code(KC_TAB); } else { + if(spec_shift) mdia_lock = !mdia_lock; if(++mdia_shift > 2) mdia_shift = 2; - if(mdia_shift == 2) { - mdia_lock = !mdia_lock; - } else if(mdia_shift == 1) { - layer_on(MDIA); - } + layer_on(MDIA); } } else { - if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + if(record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) { unregister_code(KC_TAB); } else { if(--mdia_shift < 0) mdia_shift = 0; @@ -290,35 +262,36 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) break; case LSpec: - if (record->event.pressed) { - if (record->tap.count && !record->tap.interrupted) { - register_code(KC_GRV); + if (record->event.pressed) { // when the LSpec button is pressed + if(symb_shift) symb_lock == !symb_lock; // if another layer button is engaged, then + else if(mdia_shift) mdia_lock = !mdia_lock; // lock that layer, be it caps or symb or mdia + else if (record->tap.count && !record->tap.interrupted && (!spec_shift)) { + register_code(KC_GRV); // otherwise, if it's an uninterrupted tap, emit a char } else { - layer_on(SPEC); + if(++spec_shift > 2) spec_shift = 2; + layer_on(SPEC); // otherwise, turn on the Special layer } } else { - if(record->tap.count && !record->tap.interrupted) { + if(record->tap.count && !record->tap.interrupted && (!spec_shift)) { unregister_code(KC_GRV); } else { - layer_off(SPEC); + if(--spec_shift < 0) spec_shift = 0; + if(!spec_shift) layer_off(SPEC); } } break; case RSymb: if (record->event.pressed) { - if (record->tap.count && (!symb_shift) && (!symb_lock)) { + if (record->tap.count && (!symb_shift) && (!symb_lock) && (!spec_shift)) { register_code(KC_QUOT); } else { if(++symb_shift > 2) symb_shift = 2; - if(symb_shift == 2) { - symb_lock = !symb_lock; - } else if(symb_shift == 1) { - layer_on(SYMB); - } + if(spec_shift) symb_lock = !symb_lock; + layer_on(SYMB); } } else { - if(record->tap.count && symb_shift == 0) { + if(record->tap.count && (!symb_shift) && (!symb_lock) && (!spec_shift)) { unregister_code(KC_QUOT); } else { if(--symb_shift < 0) symb_shift = 0; @@ -329,18 +302,15 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case RMdia: if (record->event.pressed) { - if (record->tap.count && (!mdia_shift) && (!mdia_lock)) { + if (record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) { register_code(KC_BSLS); } else { if(++mdia_shift > 2) mdia_shift = 2; - if(mdia_shift == 2) { - mdia_lock = !mdia_lock; - } else if(mdia_shift == 1) { - layer_on(MDIA); - } + if(spec_shift) mdia_lock = !mdia_lock; + layer_on(MDIA); } } else { - if(record->tap.count && (!mdia_shift) && (!mdia_lock)) { + if(record->tap.count && (!mdia_shift) && (!mdia_lock) && (!spec_shift)) { unregister_code(KC_BSLS); } else { if(--mdia_shift < 0) mdia_shift = 0; @@ -351,16 +321,20 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) case RSpec: if (record->event.pressed) { - if (record->tap.count && !record->tap.interrupted) { + if(symb_shift) symb_lock = !symb_lock; + else if(mdia_shift) mdia_lock = !mdia_lock; + else if (record->tap.count && !record->tap.interrupted && (!spec_shift)) { register_code(KC_EQL); } else { + if(++spec_shift > 2) spec_shift = 2; layer_on(SPEC); } } else { - if(record->tap.count && !record->tap.interrupted) { + if(record->tap.count && !record->tap.interrupted && (!spec_shift)) { unregister_code(KC_EQL); } else { - layer_off(SPEC); + if(--spec_shift < 0) spec_shift = 0; + if(!spec_shift) layer_off(SPEC); } } break; @@ -419,7 +393,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // none break; } - + return MACRO_NONE; }; @@ -431,7 +405,9 @@ void matrix_init_user(void) { // Runs constantly in the background, in a loop. void matrix_scan_user(void) { // shift or caps lock turns on red light - if(caps_shift || (keyboard_report->mods & MOD_BIT(KC_RSFT)) || (host_keyboard_leds() & (1<mods & MOD_BIT(KC_LSFT)) + || (keyboard_report->mods & MOD_BIT(KC_RSFT)) + || (host_keyboard_leds() & (1<\n\n\nTab"], +[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"A",{x:14.5},":\n;",{c:"#c6c600",t:"#007d00",w:1.5},"\"\n'\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",fa:[0,0,0,1],h:1.5},"< Tab\n\n\nShift Tab",{x:4.5,h:1.5},"Tab >\n\n\nTab"], [{y:-0.75,x:3.5,c:"#cccccc"},"C",{x:10.5},"<\n,"], [{y:-0.875,x:2.5},"X",{x:1},"V",{x:8.5},"M",{x:1},">\n."], [{y:-0.875,x:5.5},"B",{x:6.5},"N"], -[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc"},"Z",{x:14.5},"?\n/",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], +[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#cccccc",t:"#000000"},"Z",{x:14.5},"?\n/",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5},"Option\n\n\nRAlt"], [{y:-0.875,x:2.5},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5},"Cmd\n\n\nSuper",{x:1},"Hyper"], [{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Ctrl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Home","End"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Home","End"], [{h:2},"< Del\n\n\nBackspace",{h:2},"Del >\n\n\nDelete","Page\n\n\n\n\n\nUp"], [{x:2},"Page\n\n\n\n\n\nDown"], [{r:-30,rx:13,y:-1,x:-3},"Left","Right"], diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.png b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png index 99e5ed80b..bb78b7c7a 100644 Binary files a/keyboards/ergodox/keymaps/ordinary/ordinary-media.png and b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt index 4eccc9f35..e1467b22e 100644 --- a/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-media.txt @@ -1,27 +1,27 @@ [{x:3.5,c:"#99de2a"},"F13",{x:10.5},"F18"], [{y:-0.875,x:2.5},"F12",{x:1},"F14",{x:8.5},"F17",{x:1},"F19"], [{y:-0.875,x:5.5},"F15",{c:"#ff4444"},"Esc",{x:4.5,c:"#737373",a:7},"",{c:"#99de2a",a:4},"F16"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#ffb063"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#e6e067"},"Print\n\n\n\n\n\nScreen"], -[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#e6e067",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#ff0000",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F11",{x:14.5},"F20",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nUp",{x:10.5},"Cursor\n\n\n\n\n\nUp"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nUpLeft",{x:1},"Mouse\n\n\n\n\n\nUpRgt",{x:8.5,c:"#1e8fff"},"Home",{x:1},"Page\n\n\n\n\n\nUp"], +[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#1e8fff",h:1.5},"Scroll\n\n\n\n\n\nUp",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nUp",{c:"#9977ee"},"Print\n\n\n\n\n\nScreen"], +[{y:-0.875,c:"#000000",t:"#3f68ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Shut\n\n\n\n\n\nDown",{x:14.5},"Mail",{c:"#000000",t:"#3f68ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], [{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nLeft",{x:1},"Mouse\n\n\n\n\n\nRight",{x:8.5},"Cursor\n\n\n\n\n\nLeft",{x:1},"Cursor\n\n\n\n\n\nRight"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], -[{y:-0.875,c:"#2277ff",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#e6e067"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#2277ff",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#ffb063",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], -[{y:-0.75,x:3.5,c:"#ff8500"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], -[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#ffb063"},"End",{x:1},"Page\n\n\n\n\n\nDown"], -[{y:-0.875,x:5.5,c:"#e6e067"},"Mute",{x:6.5,c:"#737373",a:7},""], -[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#ff8500"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#ffb063",fa:[0,0,0,1]},"Delete\n\n\nOption"], -[{y:-0.875,x:2.5,c:"#ff8500"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#ffb063"},"Insert\n\n\nCmd",{x:1,c:"#77aaff"},"Hyper"], +[{y:-0.875,x:5.5,c:"#9977ee"},"Vol\n\n\n\n\n\nDown",{x:6.5},"Num\n\n\n\n\n\nLock"], +[{y:-0.875,c:"#c6c600",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#9977ee",t:"#000000"},"Sleep",{x:14.5},"My\n\n\n\n\n\nComp",{c:"#c6c600",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#1e8fff",t:"#000000",h:1.5},"Scroll\n\n\n\n\n\nDown",{x:4.5,h:1.5},"Scroll\n\n\n\n\n\nDown"], +[{y:-0.75,x:3.5,c:"#0066cc"},"Mouse\n\n\n\n\n\nDown",{x:10.5},"Cursor\n\n\n\n\n\nDown"], +[{y:-0.875,x:2.5},"Mouse\n\n\n\n\n\nDnLeft",{x:1},"Mouse\n\n\n\n\n\nDnRgt",{x:8.5,c:"#1e8fff"},"End",{x:1},"Page\n\n\n\n\n\nDown"], +[{y:-0.875,x:5.5,c:"#9977ee"},"Mute",{x:6.5,c:"#737373",a:7},""], +[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#737373",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#0066cc",t:"#000000"},"Middle\n\n\n\n\n\nClick",{x:10.5,c:"#1e8fff",fa:[0,0,0,1]},"Delete\n\n\nOption"], +[{y:-0.875,x:2.5,c:"#0066cc"},"Left\n\n\n\n\n\nClick",{x:1},"Right\n\n\n\n\n\nClick",{x:8.5,c:"#1e8fff"},"Insert\n\n\nCmd",{x:1,c:"#dddd77"},"Hyper"], [{y:-0.75,x:0.5},"Ctrl\n\n\nLCtrl","Meh",{x:14.5},"Meh","Crtl\n\n\nRCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ccbb00"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#6633ee"},"Stop\n\n\nBrowser","Reload\n\n\nBrowser"], [{h:2},"< Web\n\n\nBrowser",{h:2},"Web >\n\n\nBrowser","Search\n\n\nBrowser"], [{x:2},"Home\n\n\nBrowser"], [{r:-30,rx:13,y:-1,x:-3},"Prev\n\n\nAudio\n\n\nTrack","Next\n\n\nAudio\n\n\nTrack"], -[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nUp",{c:"#ccbb00",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], -[{x:-3,c:"#e6e067"},"Vol\n\n\n\n\n\nDown"] +[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nUp",{c:"#6633ee",h:2},"Stop\n\n\nAudio",{h:2},"Play\n\n\nAudio\n\n\nPause"], +[{x:-3,c:"#9977ee"},"Vol\n\n\n\n\n\nDown"] diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-special.png b/keyboards/ergodox/keymaps/ordinary/ordinary-special.png index 6eecf447e..399c5fc75 100644 Binary files a/keyboards/ergodox/keymaps/ordinary/ordinary-special.png and b/keyboards/ergodox/keymaps/ordinary/ordinary-special.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt index a08827c6d..6f9d8ef04 100644 --- a/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt @@ -1,21 +1,21 @@ [{x:3.5,a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"_\n\n\n\n\n\n-"], +[{y:-0.875,x:5.5,a:7},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], [{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#54d6de"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], [{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], -[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], -[{y:-0.875,x:5.5},"",{h:1.5},"",{x:4.5,h:1.5},"",""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], -[{y:-0.375,x:3.5},"",{x:10.5},""], +[{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"{\n["], +[{y:-0.875,x:5.5,a:7},"",{h:1.5},"",{x:4.5,h:1.5},"",""], +[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Media\n\n\n\n\n\nLock",{c:"#cccccc",a:7},"",{x:14.5,a:4},"\n\n}\n]",{c:"#2277ff",w:1.5},"Media\n\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#cccccc",a:7},"",{x:10.5},""], [{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], [{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{w:1.5},""], -[{y:-0.625,x:6.5,h:1.5},"",{x:4.5,h:1.5},""], +[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock",{c:"#cccccc",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock"], +[{y:-0.625,x:6.5,c:"#cccccc",a:7,h:1.5},"",{x:4.5,h:1.5},""], [{y:-0.75,x:3.5},"",{x:10.5},""], [{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], [{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,w:1.5},"","",{x:14.5},"",{c:"#2277ff",w:1.5},"RShift"], -[{y:-0.375,x:3.5,c:"#cccccc"},"",{x:10.5},""], +[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock",{c:"#cccccc",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#cccccc",a:7},"",{x:10.5},""], [{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], [{y:-0.75,x:0.5},"","",{x:14.5},"",""], [{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png index e4de64a96..48cda5f6b 100644 Binary files a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png and b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt index e199f5c59..5c5bc155a 100644 --- a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt @@ -1,24 +1,24 @@ [{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], [{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], [{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], -[{y:-0.875,c:"#2277ff",w:1.5},"Special\n\n\n\n\n\nShift",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#2277ff",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.875,c:"#dddd77",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#dddd77",w:1.5},"\n\nShift\n\n\n\n\nLock"], [{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], [{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], [{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], -[{y:-0.875,c:"#2277ff",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb"},"!",{x:14.5,c:"#89b087"},"/",{c:"#2277ff",w:1.5},"\n\nMedia\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#bbddbb"},"(",{x:10.5,c:"#89b087"},"5"], +[{y:-0.875,c:"#dddd77",t:"#002299",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"!",{x:14.5,c:"#89b087"},"/",{c:"#dddd77",t:"#002299",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"(",{x:10.5,c:"#89b087"},"5"], [{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], [{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], -[{y:-0.875,c:"#000000",t:"#ff0000",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], -[{y:-0.625,x:6.5,c:"#54d6de",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], +[{y:-0.875,c:"#000000",t:"#007d00",w:1.5},"Symbols\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"#",{x:14.5,c:"#89b087"},"*",{c:"#000000",t:"#007d00",w:1.5},"\n\nSymbols\n\n\n\n\nShift"], +[{y:-0.625,x:6.5,c:"#ff8500",t:"#000000",fa:[0,0,0,1],h:1.5},"Tab >\n\n\nTab",{x:4.5,h:1.5},"< Tab\n\n\nShift Tab"], [{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], [{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], [{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], -[{y:-0.875,c:"#2277ff",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb"},"%",{x:14.5,c:"#89b087"},"-",{c:"#2277ff",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#77aaff"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},".\n\n\nOption"], -[{y:-0.875,x:2.5,c:"#77aaff"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0\n\n\nCmd",{x:1},"=\n\n\nHyper"], -[{y:-0.75,x:0.5,c:"#77aaff"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+\n\n\nMeh","Enter\n\n\nCtrl"], -[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#54d6de"},"Left","Right"], +[{y:-0.875,c:"#dddd77",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#dddd77",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#c6c600",t:"#000000"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},"."], +[{y:-0.875,x:2.5,c:"#c6c600"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0",{x:1},"="], +[{y:-0.75,x:0.5,c:"#c6c600"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+","Enter"], +[{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Left","Right"], [{h:2},"Space",{h:2},"Enter","Up"], [{x:2},"Down"], [{r:-30,rx:13,y:-1,x:-3},"Home","End"], diff --git a/keyboards/ergodox/keymaps/ordinary/readme.md b/keyboards/ergodox/keymaps/ordinary/readme.md index 6465cd79e..21d40477c 100644 --- a/keyboards/ergodox/keymaps/ordinary/readme.md +++ b/keyboards/ergodox/keymaps/ordinary/readme.md @@ -69,7 +69,7 @@ Alas, the yellow keys have at best spotty success with common software. Good luc In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. -Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. If you press both of a pair of shift keys, the layer will lock on until you press both shift keys again. For instance, the widely and rightly loathed Caps Lock is engaged by pressing both Capitals Shift buttons. All the Shift keys work this way. +Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. Lock the shift keys using the Shift Lock button, which is the same as the Special Shift button. You can press the shift and shift-lock buttons in either order. Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. @@ -79,7 +79,7 @@ Multiple layers can be turned on at once. The Capitals layer will affect charact ### Escape ### -The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, whnich is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. +The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, which is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. The Ordinary layout offers as a consolation prize a Special sequence for Escape: Special Shift + 1. This is natural so you can tap the top left button, then the button next to it and get Escape. This gesture works in all layers. @@ -87,9 +87,9 @@ The Ordinary layout offers as a consolation prize a Special sequence for Escape: At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence, using the 0 key, to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. -### RShift ### +### Other Characters ### -The Ordinary Layout locks layers by pressing both of a pair of shift keys. This interferes with the QMK firmware magic sequence, which is LShift+RShift. To work around this, both of the Capitals Shift keys produce a *Left Shift* keystroke. If for some reason a person needs *Right Shift* they can find it by pressing a Special Shift key, then the Capitals Shift key on the right side of the keyboard. +The Escape and Backspace special sequences are so useful why not have a few more? You can find dash under 9, left bracket under o, and right bracket under p. That's pretty much all the characters from the top right corner of the keyboard which moved to make room for the columnar layout. **** -- cgit v1.2.3-24-g4f1b From 911cc6832598ac9b637fdb11448354d418c197c4 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Sun, 14 Aug 2016 00:41:09 +0200 Subject: Added all original S60-X keymaps All keymaps that were included in VinnyCordeiro's repository were ported to QMK. Main Readme was copied over from VC's repo, slightly altered. Main Makefile was updated to reflect VC's original configuration. Small changes in felix keymap. --- keyboards/s60-x/Makefile | 2 +- keyboards/s60-x/keymaps/custom/keymap.c | 28 ++++ keyboards/s60-x/keymaps/custom/readme.md | 15 ++ keyboards/s60-x/keymaps/default/Makefile | 21 --- keyboards/s60-x/keymaps/default/keymap.c | 128 +++++--------- keyboards/s60-x/keymaps/default/readme.md | 28 +++- keyboards/s60-x/keymaps/felix/keymap.c | 127 +++++++++++--- keyboards/s60-x/keymaps/felix/readme.md | 10 +- keyboards/s60-x/keymaps/hasu/keymap.c | 182 ++++++++++++++++++++ keyboards/s60-x/keymaps/hasu/readme.md | 4 + keyboards/s60-x/keymaps/hhkb/keymap.c | 52 ++++++ keyboards/s60-x/keymaps/hhkb/readme.md | 26 +++ keyboards/s60-x/keymaps/iso/keymap.c | 48 ++++++ keyboards/s60-x/keymaps/iso/readme.md | 28 ++++ keyboards/s60-x/keymaps/jpec/keymap.c | 92 +++++++++++ keyboards/s60-x/keymaps/jpec/readme.md | 1 + keyboards/s60-x/keymaps/plain/keymap.c | 25 +++ keyboards/s60-x/keymaps/plain/readme.md | 16 ++ keyboards/s60-x/keymaps/poker/keymap.c | 180 ++++++++++++++++++++ keyboards/s60-x/keymaps/poker/readme.md | 31 ++++ keyboards/s60-x/keymaps/poker_bit/keymap.c | 110 ++++++++++++ keyboards/s60-x/keymaps/poker_bit/readme.md | 31 ++++ keyboards/s60-x/keymaps/poker_set/keymap.c | 178 ++++++++++++++++++++ keyboards/s60-x/keymaps/poker_set/readme.md | 31 ++++ keyboards/s60-x/keymaps/spacefn/keymap.c | 55 ++++++ keyboards/s60-x/keymaps/spacefn/readme.md | 27 +++ keyboards/s60-x/readme.md | 248 ++++++++++++++++++++++++++-- keyboards/s60-x/s60-x.h | 5 + 28 files changed, 1579 insertions(+), 150 deletions(-) create mode 100644 keyboards/s60-x/keymaps/custom/keymap.c create mode 100644 keyboards/s60-x/keymaps/custom/readme.md delete mode 100644 keyboards/s60-x/keymaps/default/Makefile create mode 100644 keyboards/s60-x/keymaps/hasu/keymap.c create mode 100644 keyboards/s60-x/keymaps/hasu/readme.md create mode 100644 keyboards/s60-x/keymaps/hhkb/keymap.c create mode 100644 keyboards/s60-x/keymaps/hhkb/readme.md create mode 100644 keyboards/s60-x/keymaps/iso/keymap.c create mode 100644 keyboards/s60-x/keymaps/iso/readme.md create mode 100644 keyboards/s60-x/keymaps/jpec/keymap.c create mode 100644 keyboards/s60-x/keymaps/jpec/readme.md create mode 100644 keyboards/s60-x/keymaps/plain/keymap.c create mode 100644 keyboards/s60-x/keymaps/plain/readme.md create mode 100644 keyboards/s60-x/keymaps/poker/keymap.c create mode 100644 keyboards/s60-x/keymaps/poker/readme.md create mode 100644 keyboards/s60-x/keymaps/poker_bit/keymap.c create mode 100644 keyboards/s60-x/keymaps/poker_bit/readme.md create mode 100644 keyboards/s60-x/keymaps/poker_set/keymap.c create mode 100644 keyboards/s60-x/keymaps/poker_set/readme.md create mode 100644 keyboards/s60-x/keymaps/spacefn/keymap.c create mode 100644 keyboards/s60-x/keymaps/spacefn/readme.md diff --git a/keyboards/s60-x/Makefile b/keyboards/s60-x/Makefile index 57edd5e03..8b51d4609 100644 --- a/keyboards/s60-x/Makefile +++ b/keyboards/s60-x/Makefile @@ -53,7 +53,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) CONSOLE_ENABLE ?= yes # Console for debug(+400) diff --git a/keyboards/s60-x/keymaps/custom/keymap.c b/keyboards/s60-x/keymaps/custom/keymap.c new file mode 100644 index 000000000..59361241f --- /dev/null +++ b/keyboards/s60-x/keymaps/custom/keymap.c @@ -0,0 +1,28 @@ +#include "keymap_common.h" + +/* Main layer: Test layout, using all keys. + + 0 1 2 3 4 5 6 7 8 9 A B C D E + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ 0 │GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │PGUP │BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 1 │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 2 │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │PGDN │ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 3 │LSHFT│HOME │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ END │RSHFT│ UP │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + 4 │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + KEYMAP(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, PGUP, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, PGDN, ENT , \ + LSFT, HOME, Z, X, C, V, B, N, M, COMM, DOT, SLSH, END, RSFT, UP, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), +}; +const uint16_t PROGMEM fn_actions[] = {}; + diff --git a/keyboards/s60-x/keymaps/custom/readme.md b/keyboards/s60-x/keymaps/custom/readme.md new file mode 100644 index 000000000..cf87bd915 --- /dev/null +++ b/keyboards/s60-x/keymaps/custom/readme.md @@ -0,0 +1,15 @@ +### 8 Custom +The custom keymap - [keymap_custom.c](keymap_custom.c) - is where I tested all the switches, not being concerned with a specific layout or layers. It's a plain layout option with the extra keys used on ISO & HHKB layouts being assigned some other keys. + +#### 8.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │PgUp │BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │PgDwn│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│Home │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ End │Shift│ Up │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/default/Makefile b/keyboards/s60-x/keymaps/default/Makefile deleted file mode 100644 index f4671a9d1..000000000 --- a/keyboards/s60-x/keymaps/default/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -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 -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/default/keymap.c b/keyboards/s60-x/keymaps/default/keymap.c index 3b680c307..be7a71aff 100644 --- a/keyboards/s60-x/keymaps/default/keymap.c +++ b/keyboards/s60-x/keymaps/default/keymap.c @@ -1,92 +1,48 @@ -/* -Copyright 2016 Julien Pecqueur -Copyright 2016 Felix Uhl - -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 . +#include "keymap_common.h" + +/* 0: Main layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ -#include "s60-x.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layout 0: Default Layer - * ,-----------------------------------------------------------. - * |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | - * |-----------------------------------------------------------| - * |Fn1 |Gui |Alt | SpaceFn |Alt |Gui |App |Ctrl| - * `-----------------------------------------------------------' - */ - KEYMAP( - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, BSPC, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ - LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT, \ - LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ - FN1, LGUI, LALT, FN0, RALT, RGUI, APP, RCTL), - - /* Layout 1: Function Layer - * ,-----------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - * |-----------------------------------------------------------| - * | |Prv|Ply|Nxt|Stp| | |PUp|Up |PDn| |Slk|Pau|Ins | - * |-----------------------------------------------------------| - * | |Vl-|Mut|Vl+| | |Hom|Lef|Dow|Rig|End| |PEnt | - * |-----------------------------------------------------------| - * | |Prt|Cut|Cop|Pst|Cal| | | | | |CapsLock | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ - TRNS, MPRV, MPLY, MNXT, MSTP, TRNS, TRNS, PGUP, UP, PGDN, TRNS, SLCK, PAUS, INS, \ - TRNS, VOLD, MUTE, VOLU, TRNS, TRNS, HOME, LEFT, DOWN, RGHT, END, TRNS, TRNS, PENT, \ - TRNS, TRNS, PSCR, FN2, FN3, FN4, CALC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CAPS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), -}; - -/* -* Fn action definition +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT , \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, FN0, APP, RCTL), + +/* 1: Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), /* SpaceFn layout 1 */ - [1] = ACTION_LAYER_MOMENTARY(1), /* Momentary layout 1 */ - [2] = ACTION_MODS_KEY(MOD_LSFT, KC_DEL), /* Cut */ - [3] = ACTION_MODS_KEY(MOD_LCTL, KC_INS), /* Copy */ - [4] = ACTION_MODS_KEY(MOD_LSFT, KC_INS), /* Paste */ + KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, PGDN, PSCR, SLCK, PAUS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay }; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/default/readme.md b/keyboards/s60-x/keymaps/default/readme.md index 73318dad7..01cda9df9 100644 --- a/keyboards/s60-x/keymaps/default/readme.md +++ b/keyboards/s60-x/keymaps/default/readme.md @@ -1 +1,27 @@ -# The default keymap for s60-x \ No newline at end of file +### 1 Standard - ANSI +The standard keymap is the one that is pre-flashed on the S60-X. + +#### 1.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 1.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/felix/keymap.c b/keyboards/s60-x/keymaps/felix/keymap.c index 7fc0e021c..9c620527b 100644 --- a/keyboards/s60-x/keymaps/felix/keymap.c +++ b/keyboards/s60-x/keymaps/felix/keymap.c @@ -16,26 +16,52 @@ along with this program. If not, see . #include "s60-x.h" +//make keymap a little easier to read +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +enum layer_names { + DEFAULT, + GAMING, + FUNCTION +}; + +enum languages { + GERMAN +}; + +#define LANGUAGE GERMAN + +enum custom_keycodes { + KC_C_AM = SAFE_RANGE, + KC_C_EM, + KC_C_IM, + KC_C_OM, + KC_C_UM, + KC_C_SM, + KC_C_YM, + KC_C_WM +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layout 0: Default Layer - * RSFT will be replaced once a better way to control magic is found. * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del| * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|BckSp| + * |Tab | Q| W| E| R| T| Z| U| I| O| P| [| ]|BckSp| * |-----------------------------------------------------------| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /| Up |RSft| + * |Shift | Y| X| C| V| B| N| M| ,| .| /| Up |RSft| * |-----------------------------------------------------------| - * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| + * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| * `-----------------------------------------------------------' */ - KEYMAP( + [DEFAULT] = KEYMAP( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_RSFT, \ + KC_LSFT, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_RSFT, \ KC_FN2, KC_LGUI, KC_LALT, KC_FN0, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), /* Layout 1: Gaming Layer, SpaceFn disabled @@ -51,32 +77,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | NOP| | Space | | | | | * `-----------------------------------------------------------' */ - KEYMAP( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_FN1, \ - KC_TRNS, KC_NO, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [GAMING] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_FN1, \ + _______, XXXXXXX, _______, KC_SPC, _______, _______, _______, _______), /* Layout 2: Function Layer * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |RES| + * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|RES| * |-----------------------------------------------------------| - * | |Prv|Ply|Nxt|Stp| | |PUp|Up |PDn| |Slk|Pau|Ins | + * | | | | |Prv|Ply|Nxt| Ü | | Ö | |Prt|Slk|Pau | * |-----------------------------------------------------------| - * | |Vl-|Mut|Vl+| | |Hom|Lef|Dow|Rig|End| |PEnt | + * | | Ä | ß | |Vl-|Mut|Vl+| | | | | |PEnt | * |-----------------------------------------------------------| - * | |Prt| | | |Cal| | | | |Pau |PUp |Fn1 | + * | | | | | |Cal| | | | |Pau |PUp |Fn1 | * |-----------------------------------------------------------| * | | | | | |Home|PDn |End | * `-----------------------------------------------------------' */ - KEYMAP( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DEBUG, RESET, \ - KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_SLCK, KC_PAUS, KC_INS, \ - KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, KC_PENT, \ - KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUS, KC_PGUP, KC_FN1, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + [FUNCTION] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, RESET, \ + _______, _______, KC_C_WM, KC_C_EM, KC_MPRV, KC_MPLY, KC_MNXT, KC_C_UM, KC_C_IM, KC_C_OM, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, KC_C_AM, KC_C_SM, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, _______, _______, KC_PENT, \ + _______, KC_C_YM, _______, _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_FN1, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), }; /* @@ -102,8 +128,61 @@ void matrix_scan_user(void) { } +bool process_german(uint16_t keycode, keyrecord_t *record) { + uint16_t send_code = 0; + switch (keycode) { + case KC_C_AM: + if (record->event.pressed) { + send_code = KC_Q; + } + break; + + case KC_C_OM: + if (record->event.pressed) { + send_code = KC_P; + } + break; + + case KC_C_UM: + if (record->event.pressed) { + send_code = KC_Y; + } + break; + + case KC_C_SM: + if (record->event.pressed) { + send_code = KC_S; + } + break; + } + + if (send_code == 0) { + return true; + } + else { + register_code(KC_RALT); + register_code(send_code); + unregister_code(send_code); + unregister_code(KC_RALT); + return false; + } +} + bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; + if (keycode == KC_QUOT) { + if (record->event.pressed) { + register_code(KC_QUOT); + unregister_code(KC_QUOT); + register_code(KC_SPACE); + unregister_code(KC_SPACE); + } + return false; + } +#if LANGUAGE == GERMAN + return process_german(keycode, record); +#else + return true; +#endif } void led_set_user(uint8_t usb_led) { diff --git a/keyboards/s60-x/keymaps/felix/readme.md b/keyboards/s60-x/keymaps/felix/readme.md index 73318dad7..7f083dfd0 100644 --- a/keyboards/s60-x/keymaps/felix/readme.md +++ b/keyboards/s60-x/keymaps/felix/readme.md @@ -1 +1,9 @@ -# The default keymap for s60-x \ No newline at end of file +# A non-US ANSI QWERTZ keymap + +This keymap was specifically designed to support ANSI keycaps while retaining the possibility of inputting characters with diacritics that are normally not used in the english language. + +It relies on the US-International keyboard layout, which can be installed in any current operating system without the use of third party hardware. + +Currently, it explicitly supports the following languages, though other languages are readily useable using the AltGr modifier. +- German + diff --git a/keyboards/s60-x/keymaps/hasu/keymap.c b/keyboards/s60-x/keymaps/hasu/keymap.c new file mode 100644 index 000000000..46ea81fea --- /dev/null +++ b/keyboards/s60-x/keymaps/hasu/keymap.c @@ -0,0 +1,182 @@ +#include "keymap_common.h" + +/* + * Hasu + */ +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Default Layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn2 │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ Fn1 │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ Fn3 │ Fn3 │ Fn0 │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, FN2, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, FN1, NO, FN9, NO, \ + LCTL, LGUI, LALT, SPC, RALT, FN3, FN3, FN0), + /* Keymap 1: colemak +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ Fn0 │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, F, P, G, J, L, U, Y, SCLN, LBRC, RBRC, BSLS, \ + BSPC, A, R, S, T, D, H, N, E, I, O, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, K, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, FN0), + /* Keymap 2: dvorak +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ FN0 │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC, RBRC, NO, BSPC, \ + TAB, QUOT, COMM, DOT, P, Y, F, G, C, R, L, SLSH, EQL, BSLS, \ + CAPS, A, O, E, U, I, D, H, T, N, S, MINS, NO, ENT, \ + LSFT, NO, SCLN, Q, J, K, X, B, M, W, V, Z, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, FN0), + /* Keymap 3: workman +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ D │ E │ W │ B │ J │ F │ U │ P │ ; │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│BKSPC│ A │ S │ H │ T │ G │ Y │ N │ E │ O │ I │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ M │ C │ V │ K │ L │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ FN0 │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, D, R, W, B, J, F, U, P, SCLN, LBRC, RBRC, BSLS, \ + BSPC, A, S, H, T, G, Y, N, E, O, I, QUOT, NO, ENT, \ + LSFT, NO, Z, X, M, C, V, K, L, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, FN0), + /* Overlay 4: HHKB mode +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ Del │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Caps │ │ │ │ │ │ │ │ Psc │ Slk │Pause│ Up │ │ Ins │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ VoD │ VoU │Mute │ │ │NP_* │NP_/ │Home │PgUp │Left │Right│▒▒▒▒▒│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ │ │ │ │ │NP_+ │NP_- │ End │PgDwn│Down │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│Space│█████│█████│█████│R_ALT│R_GUI│ App │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ + CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUS, UP, TRNS, INS, \ + LCTL, VOLD, VOLU, MUTE, TRNS, TRNS, PAST, PSLS, HOME, PGUP, LEFT, RGHT, TRNS, ENT, \ + LSFT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PPLS, PMNS, END, PGDN, DOWN, TRNS, RSFT, TRNS, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, FN4, TRNS), + /* Overlay 5: Vi mode (Slash) +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│BkSpc│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ Tab │Home │PgDwn│ Up │PgUp │ End │Home │PgDwn│PgUp │ End │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ │Left │Down │Right│ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ │ │ │ │ │Home │PgDwn│PgUp │ End │ │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│Space│█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, BSPC, \ + TAB, HOME, PGDN, UP, PGUP, END, HOME, PGDN, PGUP, END, TRNS, TRNS, TRNS, TRNS, \ + LCTL, TRNS, LEFT, DOWN, RGHT, TRNS, LEFT, DOWN, UP, RGHT, TRNS, TRNS, TRNS, ENT, \ + LSFT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGDN, PGUP, END, TRNS, TRNS, RSFT, TRNS, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), + /* Overlay 6: Mouse mode (Semicolon/App) +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│BkSpc│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ Tab │ │ │ │ │ │ MwL │ MwD │ MwU │ MwR │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ │ Ac0 │ Ac1 │ Ac2 │ │ McL │ McD │ McU │ McR │ │ │▒▒▒▒▒│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSFHT│▒▒▒▒▒│ │ │ │ │ Mb3 │ Mb2 │ Mb1 │ Mb4 │ Mb5 │ │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ Mb1 │█████│█████│█████│ │ │ │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel + */ + KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, BSPC, \ + TAB, TRNS, TRNS, TRNS, TRNS, TRNS, WH_L, WH_D, WH_U, WH_R, TRNS, TRNS, TRNS, TRNS, \ + LCTL, TRNS, ACL0, ACL1, ACL2, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, TRNS, ENT, \ + LSFT, TRNS, TRNS, TRNS, TRNS, TRNS, BTN3, BTN2, BTN1, BTN4, BTN5, TRNS, TRNS, RSFT, TRNS, \ + LCTL, LGUI, LALT, BTN1, TRNS, TRNS, TRNS, RCTL), + /* Overlay 7: Layout selector +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Lq │ Lc │ Ld │ Lw │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Lq │ Lw │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ Ld │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ Lc │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +Lq: set Qwerty layout +Lc: set Colemak layout +Ld: set Dvorak layout +Lw: set Workman layout + + */ + KEYMAP( + FN5, FN6, FN7, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, FN5, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN7, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN6, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(4), + [1] = ACTION_LAYER_TAP_KEY(5, KC_SLASH), + [2] = ACTION_LAYER_TAP_KEY(6, KC_SCLN), + [3] = ACTION_LAYER_MOMENTARY(6), + [4] = ACTION_LAYER_MOMENTARY(7), // to Layout selector + [5] = ACTION_DEFAULT_LAYER_SET(0), // set qwerty layout + [6] = ACTION_DEFAULT_LAYER_SET(1), // set colemak layout + [7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout + [8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout + [9] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRV), +}; diff --git a/keyboards/s60-x/keymaps/hasu/readme.md b/keyboards/s60-x/keymaps/hasu/readme.md new file mode 100644 index 000000000..64969b616 --- /dev/null +++ b/keyboards/s60-x/keymaps/hasu/readme.md @@ -0,0 +1,4 @@ +### 5. Hasu +This is Hasu's favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [keymap_hasu.c](keymap_hasu.c) for detail. + +(Hasu is the initial creator of the TMK firmware, in case you weren't aware.) \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/hhkb/keymap.c b/keyboards/s60-x/keymaps/hhkb/keymap.c new file mode 100644 index 000000000..a6e5b3279 --- /dev/null +++ b/keyboards/s60-x/keymaps/hhkb/keymap.c @@ -0,0 +1,52 @@ +#include "keymap_common.h" + +/* + * HHKB Layout + */ +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Default layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn3 │ ' │▒▒▒▒▒│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│ Fn │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│▒▒▒▒▒│ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│▒▒▒▒▒│ Alt │ Gui │▒▒▒▒▒│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSLS, GRV, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSPC, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, FN0, \ + NO, LGUI, LALT, SPC, NO, RALT, RGUI, NO), + /* 1: HHKB Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Caps │ │ │ │ │ │ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ VoD │ VoU │ Mut │ Ejc │ │NP_* │NP_/ │Home │PgUp │Left │Right│▒▒▒▒▒│NPEnt│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │NP_+ │NP_- │ End │PgDwn│Down │▒▒▒▒▒│ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│▒▒▒▒▒│ │ │█████│█████│█████│ │█████│█████│█████│▒▒▒▒▒│ │ │▒▒▒▒▒│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ + CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUS, UP, TRNS, TRNS, \ + TRNS, VOLD, VOLU, MUTE, EJCT, TRNS, PAST, PSLS, HOME, PGUP, LEFT, RGHT, NO, PENT, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PPLS, PMNS, END, PGDN, DOWN, NO, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), +}; diff --git a/keyboards/s60-x/keymaps/hhkb/readme.md b/keyboards/s60-x/keymaps/hhkb/readme.md new file mode 100644 index 000000000..2bceb26dd --- /dev/null +++ b/keyboards/s60-x/keymaps/hhkb/readme.md @@ -0,0 +1,26 @@ +### 7. HHKB +[keymap_hhkb.c](keymap_hhkb.c) emulates original HHKB layers. +#### 7.0: Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn3 │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│ Fn │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │▒▒▒▒▒│ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│▒▒▒▒▒│ Alt │ Gui │▒▒▒▒▒│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 7.1: HHKB Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ │ │ │ │ │ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ VoD │ VoU │ Mut │ Ejc │ │ * │ / │Home │PgUp │Left │Right│▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ + │ - │ End │PgDwn│Down │▒▒▒▒▒│ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │▒▒▒▒▒│ │ │█████│█████│█████│ │█████│█████│█████│▒▒▒▒▒│ │ │▒▒▒▒▒│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/iso/keymap.c b/keyboards/s60-x/keymaps/iso/keymap.c new file mode 100644 index 000000000..ad597cd7d --- /dev/null +++ b/keyboards/s60-x/keymaps/iso/keymap.c @@ -0,0 +1,48 @@ +#include "keymap_common.h" + +/* 0: Main layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: ANSI qwerty */ + KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, NO, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT , \ + LSFT, BSLS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, FN0, APP, RCTL), + +/* 1: Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, PGDN, PSCR, SLCK, PAUS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; diff --git a/keyboards/s60-x/keymaps/iso/readme.md b/keyboards/s60-x/keymaps/iso/readme.md new file mode 100644 index 000000000..2c06bf86f --- /dev/null +++ b/keyboards/s60-x/keymaps/iso/readme.md @@ -0,0 +1,28 @@ +### 2 Standard - ISO +The same as the standard keymap, but with additional ISO keys. + + +#### 2.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 2.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/jpec/keymap.c b/keyboards/s60-x/keymaps/jpec/keymap.c new file mode 100644 index 000000000..3b680c307 --- /dev/null +++ b/keyboards/s60-x/keymaps/jpec/keymap.c @@ -0,0 +1,92 @@ +/* +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +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 . +*/ + +#include "s60-x.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layout 0: Default Layer + * ,-----------------------------------------------------------. + * |` | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Fn1 |Gui |Alt | SpaceFn |Alt |Gui |App |Ctrl| + * `-----------------------------------------------------------' + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT, \ + LSFT, NUBS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + FN1, LGUI, LALT, FN0, RALT, RGUI, APP, RCTL), + + /* Layout 1: Function Layer + * ,-----------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | + * |-----------------------------------------------------------| + * | |Prv|Ply|Nxt|Stp| | |PUp|Up |PDn| |Slk|Pau|Ins | + * |-----------------------------------------------------------| + * | |Vl-|Mut|Vl+| | |Hom|Lef|Dow|Rig|End| |PEnt | + * |-----------------------------------------------------------| + * | |Prt|Cut|Cop|Pst|Cal| | | | | |CapsLock | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ + TRNS, MPRV, MPLY, MNXT, MSTP, TRNS, TRNS, PGUP, UP, PGDN, TRNS, SLCK, PAUS, INS, \ + TRNS, VOLD, MUTE, VOLU, TRNS, TRNS, HOME, LEFT, DOWN, RGHT, END, TRNS, TRNS, PENT, \ + TRNS, TRNS, PSCR, FN2, FN3, FN4, CALC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CAPS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* +* Fn action definition +*/ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), /* SpaceFn layout 1 */ + [1] = ACTION_LAYER_MOMENTARY(1), /* Momentary layout 1 */ + [2] = ACTION_MODS_KEY(MOD_LSFT, KC_DEL), /* Cut */ + [3] = ACTION_MODS_KEY(MOD_LCTL, KC_INS), /* Copy */ + [4] = ACTION_MODS_KEY(MOD_LSFT, KC_INS), /* Paste */ +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/jpec/readme.md b/keyboards/s60-x/keymaps/jpec/readme.md new file mode 100644 index 000000000..73318dad7 --- /dev/null +++ b/keyboards/s60-x/keymaps/jpec/readme.md @@ -0,0 +1 @@ +# The default keymap for s60-x \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/plain/keymap.c b/keyboards/s60-x/keymaps/plain/keymap.c new file mode 100644 index 000000000..0f0cdee2a --- /dev/null +++ b/keyboards/s60-x/keymaps/plain/keymap.c @@ -0,0 +1,25 @@ +#include "keymap_common.h" + +/* Main layer: +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, RALT, RGUI, APP, RCTL), +}; +const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboards/s60-x/keymaps/plain/readme.md b/keyboards/s60-x/keymaps/plain/readme.md new file mode 100644 index 000000000..ab13323e3 --- /dev/null +++ b/keyboards/s60-x/keymaps/plain/readme.md @@ -0,0 +1,16 @@ +### 4. Plain +Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host. +See [keymap_plain.c](keymap_plain.c) for detail. + +#### 4.0 Plain Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/poker/keymap.c b/keyboards/s60-x/keymaps/poker/keymap.c new file mode 100644 index 000000000..5fc970a04 --- /dev/null +++ b/keyboards/s60-x/keymaps/poker/keymap.c @@ -0,0 +1,180 @@ +#include "keymap_common.h" + +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 1: colemak +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, F, P, G, J, L, U, Y, SCLN, LBRC, RBRC, BSLS, \ + BSPC, A, R, S, T, D, H, N, E, I, O, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, K, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 2: dvorak +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC, RBRC, NO, BSPC, \ + TAB, QUOT, COMM, DOT, P, Y, F, G, C, R, L, SLSH, EQL, BSLS, \ + CAPS, A, O, E, U, I, D, H, T, N, S, MINS, NO, ENT, \ + LSFT, NO, SCLN, Q, J, K, X, B, M, W, V, Z, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 3: workman +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ D │ E │ W │ B │ J │ F │ U │ P │ ; │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│BKSPC│ A │ S │ H │ T │ G │ Y │ N │ E │ O │ I │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ M │ C │ V │ K │ L │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, D, R, W, B, J, F, U, P, SCLN, LBRC, RBRC, BSLS, \ + BSPC, A, S, H, T, G, Y, N, E, O, I, QUOT, NO, ENT, \ + LSFT, NO, Z, X, M, C, V, K, L, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 4: Poker with Arrow +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ Up │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │Left │Down │Right│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, RGHT), + /* 5: Poker with Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ ESC │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + /* 6: Poker Fn +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ FnL │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +Fn: to Fn overlay +FnL: to Layout selector overaly +FnQ: toggle Esc overlay +FnS: toggle Arrow overlay + + */ + KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN2, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, FN4, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN3, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, TRNS), + /* 7: Layout selector +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Lq │ Lc │ Ld │ Lw │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Lq │ Lw │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ Ld │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ Lc │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +Lq: set Qwerty layout +Lc: set Colemak layout +Ld: set Dvorak layout +Lw: set Workman layout + + */ + KEYMAP( + FN5, FN6, FN7, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, FN5, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN7, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN6, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; +const uint16_t PROGMEM fn_actions[] = { + /* Poker Layout */ + [0] = ACTION_LAYER_MOMENTARY(6), // to Fn overlay + [1] = ACTION_LAYER_TOGGLE(4), // toggle arrow overlay + [2] = ACTION_LAYER_TOGGLE(5), // toggle Esc overlay + [3] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // Task(RControl,RShift+Esc) + [4] = ACTION_LAYER_MOMENTARY(7), // to Layout selector + [5] = ACTION_DEFAULT_LAYER_SET(0), // set qwerty layout + [6] = ACTION_DEFAULT_LAYER_SET(1), // set colemak layout + [7] = ACTION_DEFAULT_LAYER_SET(2), // set dvorak layout + [8] = ACTION_DEFAULT_LAYER_SET(3), // set workman layout +}; diff --git a/keyboards/s60-x/keymaps/poker/readme.md b/keyboards/s60-x/keymaps/poker/readme.md new file mode 100644 index 000000000..0d8be9d0f --- /dev/null +++ b/keyboards/s60-x/keymaps/poker/readme.md @@ -0,0 +1,31 @@ +### 3 Poker +[keymap_poker.c](keymap_poker.c) emulates original Poker layers +while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. + + Fn + Esc = ` + Fn + {left, down, up, right} = {home, pgdown, pgup, end} + +#### 3.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Fn │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 3.1 Poker Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ Up │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ Fn │Left │Down │Right│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/poker_bit/keymap.c b/keyboards/s60-x/keymaps/poker_bit/keymap.c new file mode 100644 index 000000000..4a4cfd1be --- /dev/null +++ b/keyboards/s60-x/keymaps/poker_bit/keymap.c @@ -0,0 +1,110 @@ +#include "keymap_common.h" + +// Poker fix with toggle and bit operation +// Fn + Esc = ` +// Fn + {left, down, up, right} = {home, pgdown, pgup, end} +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 4: Poker Default + Fn'd +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Caps │ Fn2 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn4 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn1 │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + [4] = KEYMAP( + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + CAPS, FN2, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN4, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN1, TRNS, TRNS, TRNS, TRNS), + /* 5: Poker with Arrow +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│PgUp │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn3 │Home │PgDwn│ End │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN3, HOME, PGDN, END), + /* 6: Poker with Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ ESC │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + /* 7: Poker with Arrow + Fn'd +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ Up │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │Left │Down │Right│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, LEFT, DOWN, RGHT), +}; +const uint16_t PROGMEM fn_actions[] = { + /* Poker Layout */ + [0] = ACTION_LAYER_BIT_XOR(1, 0b0101, ON_BOTH), // Poker Fn(with fix for Esc) + [1] = ACTION_LAYER_TOGGLE(5), // Poker Arrow toggle + [2] = ACTION_LAYER_TOGGLE(6), // Poker Esc toggle + [3] = ACTION_LAYER_BIT_XOR(1, 0b1101, ON_BOTH), // Poker Fn(with fix for Arrow) + [4] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // FN3 Task(RControl,RShift+Esc) +}; diff --git a/keyboards/s60-x/keymaps/poker_bit/readme.md b/keyboards/s60-x/keymaps/poker_bit/readme.md new file mode 100644 index 000000000..0d8be9d0f --- /dev/null +++ b/keyboards/s60-x/keymaps/poker_bit/readme.md @@ -0,0 +1,31 @@ +### 3 Poker +[keymap_poker.c](keymap_poker.c) emulates original Poker layers +while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. + + Fn + Esc = ` + Fn + {left, down, up, right} = {home, pgdown, pgup, end} + +#### 3.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Fn │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 3.1 Poker Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ Up │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ Fn │Left │Down │Right│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/poker_set/keymap.c b/keyboards/s60-x/keymaps/poker_set/keymap.c new file mode 100644 index 000000000..0c1ef1a9b --- /dev/null +++ b/keyboards/s60-x/keymaps/poker_set/keymap.c @@ -0,0 +1,178 @@ +#include "keymap_common.h" + +// Poker fix with set(state transition) +// Fn + Esc = ` +// Fn + {left, down, up, right} = {home, pgdown, pgup, end} +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, SPC, FN0, RGUI, APP, RCTL), + /* 1: Poker with Arrow +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ Up │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn1 │Left │Down │Right│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN1, LEFT, DOWN, RGHT), + /* 2: Poker with Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ ESC │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn2 │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN2, TRNS, TRNS, TRNS), + /* 3: Poker with Arrow and Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Esc │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ Up │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn3 │Left │Down │Right│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN3, LEFT, DOWN, RGHT), + /* 4: Poker Fn'd +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Fn6 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn8 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn5 │█████│█████│█████│ Fn4 │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN6, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN5, FN4, TRNS, TRNS, TRNS), + /* 5: Poker Fn'd arrow +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Fn7 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn8 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│PgUp │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn4 │█████│█████│█████│ Fn5 │Home │PgDwn│ End │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN7, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, PGUP, TRNS, \ + TRNS, TRNS, TRNS, FN4, FN5, HOME, PGDN, END), + /* 6: Poker Fn'd Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Fn4 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn8 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn7 │█████│█████│█████│ Fn6 │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN4, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN7, FN6, TRNS, TRNS, TRNS), + /* 7: Poker Fn'd Arrow + Esc +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│Grave│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ Fn5 │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Fn8 │ End │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│PgUp │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ Fn6 │█████│█████│█████│ Fn7 │Home │PgDwn│ End │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + TRNS, FN5, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ + TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ + TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, PGUP, TRNS, \ + TRNS, TRNS, TRNS, FN6, FN7, HOME, PGDN, END), +}; + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + /* Poker Layout */ + [0] = ACTION_LAYER_SET(4, ON_PRESS), // FN0 move to Fn'd when press + [1] = ACTION_LAYER_SET(5, ON_PRESS), // FN1 move to Fn'd arrow when press + [2] = ACTION_LAYER_SET(6, ON_PRESS), // FN2 move to Fn'd Esc when press + [3] = ACTION_LAYER_SET(7, ON_PRESS), // FN3 move to Fn'd arrow + Esc when press + + //[4] = ACTION_LAYER_CLEAR(ON_RELEASE), // FN4 clear overlay when release + [4] = ACTION_LAYER_SET(0, ON_RELEASE), // FN4 clear overlay when release + [5] = ACTION_LAYER_SET(1, ON_RELEASE), // FN5 move to arrow when release + [6] = ACTION_LAYER_SET(2, ON_RELEASE), // FN6 move to Esc when release + [7] = ACTION_LAYER_SET(3, ON_RELEASE), // FN7 move to arrow + Esc when release + + [8] = ACTION_MODS_KEY(MOD_RCTL|MOD_RSFT, KC_ESC), // FN8 Task(RControl,RShift+Esc) +}; diff --git a/keyboards/s60-x/keymaps/poker_set/readme.md b/keyboards/s60-x/keymaps/poker_set/readme.md new file mode 100644 index 000000000..0d8be9d0f --- /dev/null +++ b/keyboards/s60-x/keymaps/poker_set/readme.md @@ -0,0 +1,31 @@ +### 3 Poker +[keymap_poker.c](keymap_poker.c) emulates original Poker layers +while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. + + Fn + Esc = ` + Fn + {left, down, up, right} = {home, pgdown, pgup, end} + +#### 3.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Fn │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 3.1 Poker Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ Up │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ Fn │Left │Down │Right│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/keymaps/spacefn/keymap.c b/keyboards/s60-x/keymaps/spacefn/keymap.c new file mode 100644 index 000000000..c93070532 --- /dev/null +++ b/keyboards/s60-x/keymaps/spacefn/keymap.c @@ -0,0 +1,55 @@ +#include "keymap_common.h" + +/* + * SpaceFN + * http://geekhack.org/index.php?topic=51069.0 + */ +const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Default Layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│LCTRL│L_GUI│L_ALT│█████│█████│█████Spc/Fn0█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ + LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ + LCTL, LGUI, LALT, FN0, RALT, RGUI, APP, RCTL), + + /* Overlay 1: SpaceFN +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+│ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ Del │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ Esc │ │ │ │Home │ Up │ End │Pscr │Slck │Pause│ Ins │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │PgUp │Left │Down │Right│ │ │▒▒▒▒▒│ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │▒▒▒▒▒│ │ │ │Space│PgDwn│ ` │ ~ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + KEYMAP( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ + TRNS, TRNS, TRNS, ESC, TRNS, TRNS, TRNS, HOME, UP, END, PSCR, SLCK, PAUS, INS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, SPC, PGDN, GRV, FN1, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), +}; + +/* + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), + [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde +}; diff --git a/keyboards/s60-x/keymaps/spacefn/readme.md b/keyboards/s60-x/keymaps/spacefn/readme.md new file mode 100644 index 000000000..d04bd9486 --- /dev/null +++ b/keyboards/s60-x/keymaps/spacefn/readme.md @@ -0,0 +1,27 @@ +### 6. SpaceFN +This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [keymap_spacefn.c](keymap_spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0). + +#### 6.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│████ Space/Fn ███│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 6.1 SpaceFN layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ Del │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │Home │ Up │ End │ Psc │ Slk │Pause│ Ins │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │PgUp │Left │Down │Right│ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │Space│PgDwn│ ` │ ~ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ Fn │█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md index 34c48b0b7..0872c2e01 100644 --- a/keyboards/s60-x/readme.md +++ b/keyboards/s60-x/readme.md @@ -1,32 +1,248 @@ -S60-x keyboard firmware +S60-x keyboard firmware ====================== -DIY compact keyboard by Massdrop. This is a port from TMK to QMK based on the [original S60-X Repo](https://github.com/jpec/s60x). +DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps are based on GH60 code. This is a port from TMK to QMK based on the [original S60-X Repo](https://github.com/VinnyCordeiro/tmk_keyboard). ## S60X Resources -- [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit) +- [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open) ## Quantum MK Firmware -For the full Quantum feature list, see [the parent readme.md](/doc/readme.md). +For the full Quantum feature list, see [the parent readme.md](/readme.md). -## Building +## Keymap +Several versions of keymaps are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document (you can find in top README.md) and existent keymap files. -Download or clone the whole firmware and navigate to the keyboards/s60-x folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. +To build firmware binary hex file with a certain keymap just run `make` with the `keymap` option like: -Depending on which keymap you would like to use, you will have to compile slightly differently. + $ make keymap=[custom|poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|] -### Default +File [S60-X_pre-compiled_firmwares.zip](S60-X_pre-compiled_firmwares.zip) contains pre-compiled firmwares for all keymaps available. Not all of them are tested. -To build with the default keymap, simply run `make`. -### Other Keymaps +## Flashing your keyboard +The recommended programs for flashing your keyboard are [Atmel FLIP](http://www.atmel.com/tools/FLIP.aspx) (Windows) and [dfu-programmer](http://dfu-programmer.sourceforge.net/) (Linux/Windows). -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. +[QMK Firmware Flasher](https://github.com/jackhumbert/qmk_firmware_flasher/releases) may work, as the S60-X keyboard uses the ATMega32U4 microcontroller, but it is untested. Use at your own risk. -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: +[Easy AVR USB Keyboard Firmware](https://deskthority.net/wiki/Easy_AVR_USB_Keyboard_Firmware) also supports S60-X, but it is completely unrelated to TMK firmware. Use at your own risk. -``` -$ make keymap=[default|] -``` +**Programming the firmware (Windows)** -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` \ No newline at end of file +1. download and install FLIP (http://www.atmel.com/tools/FLIP.aspx) +2. connect the keyboard, press the program button (S1) and wait until it enumerates +3. go to device manager, find the atmega32u4 chip and click "update driver" +4. choose location manually: folder named "usb" inside the installation directory of FLIP +5. once the driver is installed, run flip +6. Device -> Select: choose ATMega32U4 +7. Settings -> Communication -> USB, FLIP should show the signature at this point (58 1E 95 87) +8. File -> Load HEX file: choose the hex firmware: .hex +9. click "Run" +10. after programming is done, disconnect the device from USB and connect again. + + +**Programming the firmware (Linux)** + +1. Download and install/compile/unpack dfu-programmer from http://dfu-programmer.sourceforge.net/. +2. Issue the following commands in the command prompt after connecting the device and pressing the programming button (S1). You may need root permissions or udev rules to do that. + 1. `sudo dfu-programmer atmega32u4 erase` + 2. `sudo dfu-programmer atmega32u4 flash .hex` + 3. `sudo dfu-programmer atmega32u4 start` +3. The keyboard should start working. If it doesn't, reconnect the cable. + + +### 0 Initial explanations +The █████ blocks on the layouts hides the switch positions that do not exist physically on the PCB. If you feel like hacking the keyboard and adding new keys, those are the positions that can be used. You'll have to modify the [keymap_common.h](keymap_common.h) file for that. + +The â–’â–’â–’â–’â–’ blocks hides switch positions not used on this particular layout, but they do exist on the PCB. + +There is no LED support on the PCB at the moment, but I'll let the code for that untouched. + + +### 1 Standard - ANSI +The standard keymap is the one that is pre-flashed on the S60-X. + +#### 1.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 1.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 2 Standard - ISO +The same as the standard keymap, but with additional ISO keys. + + +#### 2.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │CAPSL│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │NUHS │ENTER│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_GUI│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │RCTRL│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 2.1 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│▒▒▒▒▒│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 3 Poker +[keymap_poker.c](keymap_poker.c) emulates original Poker layers +while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. + + Fn + Esc = ` + Fn + {left, down, up, right} = {home, pgdown, pgup, end} + +#### 3.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Fn │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 3.1 Poker Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ FnQ │ Up │ │ │ │ │ │ │ Cal │ │Home │ Ins │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ Psc │ Slk │Pause│ │ Tsk │ End │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ Del │ │ Web │Mute │ VoU │ VoD │ │PgUp │PgDwn│ Del │▒▒▒▒▒│ Up │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ FnS │█████│█████│█████│ Fn │Left │Down │Right│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 4. Plain +Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host. +See [keymap_plain.c](keymap_plain.c) for detail. + +#### 4.0 Plain Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 5. Hasu +This is Hasu's favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [keymap_hasu.c](keymap_hasu.c) for detail. + +(Hasu is the creator of the TMK firmware, for those who do not know that.) + + +### 6. SpaceFN +This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [keymap_spacefn.c](keymap_spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0). + +#### 6.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│████ Space/Fn ███│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 6.1 SpaceFN layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ` │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ Del │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │ │Home │ Up │ End │ Psc │ Slk │Pause│ Ins │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │ │ │ │PgUp │Left │Down │Right│ │ │▒▒▒▒▒│ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │Space│PgDwn│ ` │ ~ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ Fn │█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 7. HHKB +[keymap_hhkb.c](keymap_hhkb.c) emulates original HHKB layers. +#### 7.0: Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn3 │ ' │▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│Shift│ Fn │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │▒▒▒▒▒│ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│▒▒▒▒▒│ Alt │ Gui │▒▒▒▒▒│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +#### 7.1: HHKB Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ │ │ │ │ │ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ VoD │ VoU │ Mut │ Ejc │ │ * │ / │Home │PgUp │Left │Right│▒▒▒▒▒│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ + │ - │ End │PgDwn│Down │▒▒▒▒▒│ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │▒▒▒▒▒│ │ │█████│█████│█████│ │█████│█████│█████│▒▒▒▒▒│ │ │▒▒▒▒▒│█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + + +### 8 Custom +The custom keymap - [keymap_custom.c](keymap_custom.c) - is where I tested all the switches, not being concerned with a specific layout or layers. It's a plain layout option with the extra keys used on ISO & HHKB layouts being assigned some other keys. + +#### 8.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠+ │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │PgUp │BkSpc│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │PgDwn│Enter│█████│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Shift│Home │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ End │Shift│ Up │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ diff --git a/keyboards/s60-x/s60-x.h b/keyboards/s60-x/s60-x.h index 68f2ab22f..91e7b67f3 100644 --- a/keyboards/s60-x/s60-x.h +++ b/keyboards/s60-x/s60-x.h @@ -22,6 +22,11 @@ along with this program. If not, see . #include "quantum.h" +#ifdef __INTELLISENSE__ +#define PROGMEM +#include "config.h" +#endif + /* S60-X keymap definition macro * K31 is the extra key next to short left ISO shift * K2C is the moved key next to enter on ISO boards -- cgit v1.2.3-24-g4f1b From 97fca1efff37f749fae8d53bb5ee4da9f8a898c5 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Sat, 13 Aug 2016 20:14:27 -0700 Subject: Fixing a mixup. Tidying up the keymap. --- keyboards/atreus/keymaps/xyverz/keymap.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/keyboards/atreus/keymaps/xyverz/keymap.c b/keyboards/atreus/keymaps/xyverz/keymap.c index 1ce92b4f2..b418cc9b5 100644 --- a/keyboards/atreus/keymaps/xyverz/keymap.c +++ b/keyboards/atreus/keymaps/xyverz/keymap.c @@ -46,24 +46,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_L1] = { /* LAYER 1 */ {KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0 }, {KC_TAB, KC_INS, KC_UP, KC_DEL, KC_HOME, KC_NO, KC_PGUP, KC_MUTE, KC_VOLD, KC_VOLU, KC_EQL }, -<<<<<<< HEAD {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, -======= - {KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_LCTL, KC_PGDN, KC_MPRV, KC_MPLY, KC_MNXT, KC_BSLS}, ->>>>>>> upstream/master {KC_TRNS, KC_GRV, KC_LGUI, KC_TRNS, KC_DEL, KC_LALT, KC_SPC, KC_TRNS, KC_LBRC, KC_RBRC, KC_ENT } }, [_L2] = { /* LAYER 2 */ {KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, -<<<<<<< HEAD {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_PLUS}, {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12 }, {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), RESET} -======= - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 }, - {KC_TRNS, KC_TRNS, DVORAK, QWERTY, COLEMAK, KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12 }, - {KC_TRNS, KC_TRNS, KC_LGUI, KC_TRNS, KC_BSPC, KC_LALT, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, RESET } ->>>>>>> upstream/master } }; -- cgit v1.2.3-24-g4f1b From 049343e523857eef6fe03bfd5ec73d830639e0b6 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Sun, 14 Aug 2016 00:33:11 -0700 Subject: Added my own layout to the Phantom. --- keyboards/phantom/keymaps/xyverz/keymap.c | 104 ++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 keyboards/phantom/keymaps/xyverz/keymap.c diff --git a/keyboards/phantom/keymaps/xyverz/keymap.c b/keyboards/phantom/keymaps/xyverz/keymap.c new file mode 100644 index 000000000..aa6af18b1 --- /dev/null +++ b/keyboards/phantom/keymaps/xyverz/keymap.c @@ -0,0 +1,104 @@ +#include "phantom.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QW 0 +#define _DV 1 +#define _CM 2 +#define _FL 3 + +// Macro name shortcuts +#define QWERTY M(_QW) +#define DVORAK M(_DV) +#define COLEMAK M(_CM) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QW] = { /* Layer 0: Qwerty */ + {KC_ESC, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS}, + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, KC_PGUP}, + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN}, + {KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, + {KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT} + }, + +[_DV] = { /* Layer 1: Dvorak */ + {KC_ESC, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS}, + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, KC_PGUP}, + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN}, + {KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_LSFT, XXXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, + {KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT} + }, + +[_CM] = { /* Layer 2: Colemak */ + {KC_ESC, KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS}, + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_INS, KC_HOME, KC_PGUP}, + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, + {KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT} + }, + +[_FL] = { /* Layer 3: Functions */ + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, RESET, KC_MPRV, KC_MPLY, KC_MNXT}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX}, + {_______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX}, + {QWERTY, DVORAK, COLEMAK, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______}, + }, + + +}; + +enum function_id { + SHIFT_ESC, +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; -- cgit v1.2.3-24-g4f1b From 880486bd247b93800f9d007f0ba90d38d5397b41 Mon Sep 17 00:00:00 2001 From: jacwib Date: Sun, 14 Aug 2016 10:46:40 +0200 Subject: Jack's keymap. --- keyboards/preonic/keymaps/jacwib/Makefile | 25 ++++ keyboards/preonic/keymaps/jacwib/config.h | 9 ++ keyboards/preonic/keymaps/jacwib/keymap.c | 215 +++++++++++++++++++++++++++++ keyboards/preonic/keymaps/jacwib/readme.md | 2 + 4 files changed, 251 insertions(+) create mode 100644 keyboards/preonic/keymaps/jacwib/Makefile create mode 100644 keyboards/preonic/keymaps/jacwib/config.h create mode 100644 keyboards/preonic/keymaps/jacwib/keymap.c create mode 100644 keyboards/preonic/keymaps/jacwib/readme.md diff --git a/keyboards/preonic/keymaps/jacwib/Makefile b/keyboards/preonic/keymaps/jacwib/Makefile new file mode 100644 index 000000000..1743c6487 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/preonic/keymaps/jacwib/config.h b/keyboards/preonic/keymaps/jacwib/config.h new file mode 100644 index 000000000..330686559 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/config.h @@ -0,0 +1,9 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here +#define FORCE_NKRO 1 + +#endif diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c new file mode 100644 index 000000000..1d5e0a777 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/keymap.c @@ -0,0 +1,215 @@ +#include "preonic.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "keymap_nordic.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + BACKLIT +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Ã… | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | Ö | Ä | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| < | Z | X | C | V | B | N | M | . | , | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |AltGr |Lower | Space| Enter|Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, KC_BSPC},//Done + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM },//Done + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH},//Done + {KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS},//Done + {KC_LCTL, KC_LGUI, KC_LALT, NO_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}//Done +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | @ | £ | $ | | | { | [ | ] | } | \ | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | |VolUp | | | ~ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |LastS |PauseP|NextS | | * | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | |VolDwn| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | |Bspc | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {_______, NO_AT, NO_PND, NO_DLR, _______, _______, NO_LCBR, NO_LBRC, NO_RBRC, NO_RCBR, NO_BSLS, KC_DEL},//Done + {_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, NO_TILD},//Done + {_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, NO_LPRN},//Done + {_______, NO_PIPE, _______, _______, _______, _______, _______, _______, KC_VOLD, _______, _______, _______},//Done + {_______, _______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______}//Done +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ! | " | # | ¤ | % | & | / | ( | ) | = | ? | Ins | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Mouse^| | | | |ScrlUp| | | ^ | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | |Mouse<|MouseV|Mouse>| | |MLC |MMC |MRC | ' | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | > | | | | | | |ScrlDown| : | ; | _ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | |Bspc | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {LSFT(KC_1),NO_QUO2,LSFT(KC_3), NO_BULT,LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL, NO_QUES, KC_INS},//Done + {_______, _______, _______, KC_MS_U, _______, _______, _______, _______, KC_WH_U, _______, _______, NO_CIRC},//Done + {_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, NO_APOS, NO_QUOT},//Done + {_______, NO_GRTR, _______, _______, _______, _______, _______, _______, KC_WH_D, NO_COLN, NO_SCLN, NO_UNDS},//Done + {_______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______, _______}//Done +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Reset| | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | |Rsft | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |MusOn |MusOff| | | | | | | | | Reset| + * |------+------+------+------+------+------+------+------+------+------+--,----+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},//Done + {_______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______},//Done + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT},//Done + {_______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______, _______, RESET },//Done + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}//Done +} + + +}; + +#ifdef AUDIO_ENABLE //Mario theme song: E5 E5 E5 C5 E5 G5 G4 +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +}; + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/preonic/keymaps/jacwib/readme.md b/keyboards/preonic/keymaps/jacwib/readme.md new file mode 100644 index 000000000..e81c62f76 --- /dev/null +++ b/keyboards/preonic/keymaps/jacwib/readme.md @@ -0,0 +1,2 @@ +# Jack's preonic keymap. +Tries to feel like a normal keyboard, and is also designed for use with a swedish keymap. \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 1ab78110bd21b32a59eea46558ab4d83c5658cdb Mon Sep 17 00:00:00 2001 From: jacwib Date: Sun, 14 Aug 2016 10:48:22 +0200 Subject: Update readme.md --- keyboards/preonic/keymaps/jacwib/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/preonic/keymaps/jacwib/readme.md b/keyboards/preonic/keymaps/jacwib/readme.md index e81c62f76..838af399c 100644 --- a/keyboards/preonic/keymaps/jacwib/readme.md +++ b/keyboards/preonic/keymaps/jacwib/readme.md @@ -1,2 +1,2 @@ -# Jack's preonic keymap. -Tries to feel like a normal keyboard, and is also designed for use with a swedish keymap. \ No newline at end of file +# Jacwib's preonic keymap. +Tries to feel like a normal keyboard, and is also designed for use with a swedish keymap. -- cgit v1.2.3-24-g4f1b From cf91aa416a6c32e2fa02d3ad31605ff1f24aab5e Mon Sep 17 00:00:00 2001 From: jacwib Date: Sun, 14 Aug 2016 10:48:52 +0200 Subject: Update keymap.c --- keyboards/preonic/keymaps/jacwib/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c index 1d5e0a777..4ddaa962e 100644 --- a/keyboards/preonic/keymaps/jacwib/keymap.c +++ b/keyboards/preonic/keymaps/jacwib/keymap.c @@ -100,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | |Rsft | * |------+------+------+------+------+------|------+------+------+------+------+------| * | |MusOn |MusOff| | | | | | | | | Reset| - * |------+------+------+------+------+------+------+------+------+------+--,----+------| + * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -- cgit v1.2.3-24-g4f1b From 62004866b3eee07a39a6caa0f6f3a2df0d5b2ef5 Mon Sep 17 00:00:00 2001 From: jacwib Date: Sun, 14 Aug 2016 10:49:06 +0200 Subject: Update config.h --- keyboards/preonic/keymaps/jacwib/config.h | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/preonic/keymaps/jacwib/config.h b/keyboards/preonic/keymaps/jacwib/config.h index 330686559..23e9e0ed2 100644 --- a/keyboards/preonic/keymaps/jacwib/config.h +++ b/keyboards/preonic/keymaps/jacwib/config.h @@ -3,7 +3,6 @@ #include "../../config.h" -// place overrides here #define FORCE_NKRO 1 #endif -- cgit v1.2.3-24-g4f1b From 26f4a0cf04cc11690abc80f644b5fbdc869cf056 Mon Sep 17 00:00:00 2001 From: jacwib Date: Sun, 14 Aug 2016 10:49:26 +0200 Subject: Update Makefile --- keyboards/preonic/keymaps/jacwib/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/keyboards/preonic/keymaps/jacwib/Makefile b/keyboards/preonic/keymaps/jacwib/Makefile index 1743c6487..3e87d41d3 100644 --- a/keyboards/preonic/keymaps/jacwib/Makefile +++ b/keyboards/preonic/keymaps/jacwib/Makefile @@ -1,9 +1,5 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) @@ -17,7 +13,6 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR -- cgit v1.2.3-24-g4f1b From e4e13ddc54d90b41a882c76a2d28f28763117763 Mon Sep 17 00:00:00 2001 From: jacwib Date: Sun, 14 Aug 2016 10:57:47 +0200 Subject: Update readme.md --- keyboards/preonic/keymaps/jacwib/readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/preonic/keymaps/jacwib/readme.md b/keyboards/preonic/keymaps/jacwib/readme.md index 838af399c..066031235 100644 --- a/keyboards/preonic/keymaps/jacwib/readme.md +++ b/keyboards/preonic/keymaps/jacwib/readme.md @@ -1,2 +1,3 @@ # Jacwib's preonic keymap. -Tries to feel like a normal keyboard, and is also designed for use with a swedish keymap. + +Designed for use with a swedish language. -- cgit v1.2.3-24-g4f1b From 6ba27ea31883d52b3e023681edc344cc95e90317 Mon Sep 17 00:00:00 2001 From: jacwib Date: Sun, 14 Aug 2016 11:02:46 +0200 Subject: Remove pointless comments --- keyboards/preonic/keymaps/jacwib/keymap.c | 42 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c index 4ddaa962e..53604ef01 100644 --- a/keyboards/preonic/keymaps/jacwib/keymap.c +++ b/keyboards/preonic/keymaps/jacwib/keymap.c @@ -42,11 +42,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, KC_BSPC},//Done - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM },//Done - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH},//Done - {KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS},//Done - {KC_LCTL, KC_LGUI, KC_LALT, NO_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}//Done + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, KC_BSPC}, + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM }, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH}, + {KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS}, + {KC_LCTL, KC_LGUI, KC_LALT, NO_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Lower @@ -63,11 +63,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOWER] = { - {_______, NO_AT, NO_PND, NO_DLR, _______, _______, NO_LCBR, NO_LBRC, NO_RBRC, NO_RCBR, NO_BSLS, KC_DEL},//Done - {_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, NO_TILD},//Done - {_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, NO_LPRN},//Done - {_______, NO_PIPE, _______, _______, _______, _______, _______, _______, KC_VOLD, _______, _______, _______},//Done - {_______, _______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______}//Done + {_______, NO_AT, NO_PND, NO_DLR, _______, _______, NO_LCBR, NO_LBRC, NO_RBRC, NO_RCBR, NO_BSLS, KC_DEL}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, NO_TILD}, + {_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, NO_LPRN}, + {_______, NO_PIPE, _______, _______, _______, _______, _______, _______, KC_VOLD, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______} }, /* Raise @@ -84,11 +84,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_RAISE] = { - {LSFT(KC_1),NO_QUO2,LSFT(KC_3), NO_BULT,LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL, NO_QUES, KC_INS},//Done - {_______, _______, _______, KC_MS_U, _______, _______, _______, _______, KC_WH_U, _______, _______, NO_CIRC},//Done - {_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, NO_APOS, NO_QUOT},//Done - {_______, NO_GRTR, _______, _______, _______, _______, _______, _______, KC_WH_D, NO_COLN, NO_SCLN, NO_UNDS},//Done - {_______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______, _______}//Done + {LSFT(KC_1),NO_QUO2,LSFT(KC_3), NO_BULT,LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL, NO_QUES, KC_INS}, + {_______, _______, _______, KC_MS_U, _______, _______, _______, _______, KC_WH_U, _______, _______, NO_CIRC}, + {_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN3, KC_BTN2, NO_APOS, NO_QUOT}, + {_______, NO_GRTR, _______, _______, _______, _______, _______, _______, KC_WH_D, NO_COLN, NO_SCLN, NO_UNDS}, + {_______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______, _______} }, /* Adjust (Lower + Raise) @@ -105,17 +105,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ADJUST] = { - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12},//Done - {_______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______},//Done - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT},//Done - {_______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______, _______, RESET },//Done - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}//Done + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {_______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT}, + {_______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______, _______, RESET }, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} } }; -#ifdef AUDIO_ENABLE //Mario theme song: E5 E5 E5 C5 E5 G5 G4 +#ifdef AUDIO_ENABLE float tone_startup[][2] = { {NOTE_B5, 20}, {NOTE_B6, 8}, -- cgit v1.2.3-24-g4f1b From 54e37fd2d10f91b1b77cee263c1e3a2b3552cbd9 Mon Sep 17 00:00:00 2001 From: jacwib Date: Sun, 14 Aug 2016 11:08:01 +0200 Subject: Fix bug --- keyboards/preonic/keymaps/jacwib/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c index 53604ef01..cf441bf30 100644 --- a/keyboards/preonic/keymaps/jacwib/keymap.c +++ b/keyboards/preonic/keymaps/jacwib/keymap.c @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = { {_______, NO_AT, NO_PND, NO_DLR, _______, _______, NO_LCBR, NO_LBRC, NO_RBRC, NO_RCBR, NO_BSLS, KC_DEL}, {_______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, _______, NO_TILD}, - {_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, NO_LPRN}, + {_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, LSFT(KC_BSLS)}, {_______, NO_PIPE, _______, _______, _______, _______, _______, _______, KC_VOLD, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______, _______, _______} }, -- cgit v1.2.3-24-g4f1b From ec75c04663e9e8cc4682f8e1239dafd6816e2cf3 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Sun, 14 Aug 2016 11:44:43 +0200 Subject: Fixed links to keymap sources --- keyboards/s60-x/readme.md | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md index 0872c2e01..d01e1a12e 100644 --- a/keyboards/s60-x/readme.md +++ b/keyboards/s60-x/readme.md @@ -58,7 +58,7 @@ The â–’â–’â–’â–’â–’ blocks hides switch positions not used on this particular la There is no LED support on the PCB at the moment, but I'll let the code for that untouched. -### 1 Standard - ANSI +### 1 [Standard - ANSI (default layout)](keymaps/default/keymap.c) The standard keymap is the one that is pre-flashed on the S60-X. #### 1.0 Default layer @@ -87,7 +87,7 @@ The standard keymap is the one that is pre-flashed on the S60-X. └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -### 2 Standard - ISO +### 2 [Standard - ISO](keymaps/iso/keymap.c) The same as the standard keymap, but with additional ISO keys. @@ -118,8 +118,8 @@ The same as the standard keymap, but with additional ISO keys. ### 3 Poker -[keymap_poker.c](keymap_poker.c) emulates original Poker layers -while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](keymap_poker_set.c) implements same layout in different way and they fix a minor issue of original Poker and enhance arrow keys. +[The poker keymap](keymaps/poker/keymap.c) emulates original Vortex Poker layers +while both [poker_bit](keymaps/poker_bit/keymap.c) and [poker_set](keymap/poker_set/keymap.c) implement the same layout in a slightly different way, fix a minor issue of the original poker Layout and enhance arrow keys. Fn + Esc = ` Fn + {left, down, up, right} = {home, pgdown, pgup, end} @@ -150,9 +150,8 @@ while both [keymap_poker_bit.c](keymap_poker_bit.c) and [keymap_poker_set.c](key └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -### 4. Plain +### 4. [Plain](keymaps/plain/keymap.c) Without any Fn layer this will be useful if you want to use key remapping tool like AHK on host. -See [keymap_plain.c](keymap_plain.c) for detail. #### 4.0 Plain Default layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠@@ -168,14 +167,14 @@ See [keymap_plain.c](keymap_plain.c) for detail. └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -### 5. Hasu -This is Hasu's favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. See [keymap_hasu.c](keymap_hasu.c) for detail. +### 5. [Hasu](keymaps/hasu/keymap.c) +This is Hasu's favorite keymap with HHKB Fn, Vi cursor and Mousekey layer. (Hasu is the creator of the TMK firmware, for those who do not know that.) -### 6. SpaceFN -This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. See [keymap_spacefn.c](keymap_spacefn.c) and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0). +### 6. [SpaceFN](keymaps/spacefn/keymap.c) +This layout proposed by spiceBar uses space bar to change layer with using Dual role key technique. Check the sourcefile and [SpaceFN discussion](http://geekhack.org/index.php?topic=51069.0) for more information. #### 6.0 Default layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠@@ -203,8 +202,8 @@ This layout proposed by spiceBar uses space bar to change layer with using Dual └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -### 7. HHKB -[keymap_hhkb.c](keymap_hhkb.c) emulates original HHKB layers. +### 7. [HHKB](keymap/hhkb/keymap.c) +The HHKB keymap emulates original HHKB layers. #### 7.0: Default layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ @@ -231,8 +230,8 @@ This layout proposed by spiceBar uses space bar to change layer with using Dual └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -### 8 Custom -The custom keymap - [keymap_custom.c](keymap_custom.c) - is where I tested all the switches, not being concerned with a specific layout or layers. It's a plain layout option with the extra keys used on ISO & HHKB layouts being assigned some other keys. +### 8 [Custom](keymaps/custom/keymap.c] +The custom keymap is where I tested all the switches, not being concerned with a specific layout or layers. It's a plain layout option with the extra keys used on ISO & HHKB layouts being assigned some other keys. #### 8.0 Default layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠-- cgit v1.2.3-24-g4f1b From 6774f300da7954e3009d6c9b1ee7611327e7378a Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Sun, 14 Aug 2016 11:48:59 +0200 Subject: Update readme.md --- keyboards/s60-x/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md index d01e1a12e..150962565 100644 --- a/keyboards/s60-x/readme.md +++ b/keyboards/s60-x/readme.md @@ -230,7 +230,7 @@ The HHKB keymap emulates original HHKB layers. └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -### 8 [Custom](keymaps/custom/keymap.c] +### 8 [Custom](keymaps/custom/keymap.c) The custom keymap is where I tested all the switches, not being concerned with a specific layout or layers. It's a plain layout option with the extra keys used on ISO & HHKB layouts being assigned some other keys. #### 8.0 Default layer -- cgit v1.2.3-24-g4f1b From df01d502d4b531cc29b3277e093dcf3b63150647 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Sun, 14 Aug 2016 13:07:03 +0200 Subject: Ported all keymaps Old TMK keymaps were ported and confirmed to compile All keymaps compiled and added to zip-archive. Documentation was updated. --- keyboards/s60-x/keymaps/custom/keymap.c | 6 ++--- keyboards/s60-x/keymaps/default/keymap.c | 8 +++--- keyboards/s60-x/keymaps/hasu/keymap.c | 20 +++++++-------- keyboards/s60-x/keymaps/hhkb/keymap.c | 24 ++++++++--------- keyboards/s60-x/keymaps/iso/keymap.c | 8 +++--- keyboards/s60-x/keymaps/jpec/keymap.c | 4 +-- keyboards/s60-x/keymaps/plain/keymap.c | 6 ++--- keyboards/s60-x/keymaps/poker/keymap.c | 40 ++++++++++++++--------------- keyboards/s60-x/keymaps/poker_bit/keymap.c | 14 +++++----- keyboards/s60-x/keymaps/poker_set/keymap.c | 20 +++++++-------- keyboards/s60-x/keymaps/spacefn/keymap.c | 8 +++--- keyboards/s60-x/readme.md | 32 +++++++++++++---------- keyboards/s60-x/s60-x.h | 17 ++++++++++++ keyboards/s60-x/s60-x_precompiled.zip | Bin 0 -> 276106 bytes 14 files changed, 115 insertions(+), 92 deletions(-) create mode 100644 keyboards/s60-x/s60-x_precompiled.zip diff --git a/keyboards/s60-x/keymaps/custom/keymap.c b/keyboards/s60-x/keymaps/custom/keymap.c index 59361241f..fb2a40b85 100644 --- a/keyboards/s60-x/keymaps/custom/keymap.c +++ b/keyboards/s60-x/keymaps/custom/keymap.c @@ -1,4 +1,4 @@ -#include "keymap_common.h" +#include "s60-x.h" /* Main layer: Test layout, using all keys. @@ -16,9 +16,9 @@ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: ANSI qwerty */ - KEYMAP(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, PGUP, BSPC, \ + LEGACY_KEYMAP(GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, PGUP, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, PGDN, ENT , \ LSFT, HOME, Z, X, C, V, B, N, M, COMM, DOT, SLSH, END, RSFT, UP, \ diff --git a/keyboards/s60-x/keymaps/default/keymap.c b/keyboards/s60-x/keymaps/default/keymap.c index be7a71aff..eb0c6b056 100644 --- a/keyboards/s60-x/keymaps/default/keymap.c +++ b/keyboards/s60-x/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "keymap_common.h" +#include "s60-x.h" /* 0: Main layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠@@ -14,9 +14,9 @@ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: ANSI qwerty */ - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + LEGACY_KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT , \ LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ @@ -35,7 +35,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, PGDN, PSCR, SLCK, PAUS, TRNS, \ TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ diff --git a/keyboards/s60-x/keymaps/hasu/keymap.c b/keyboards/s60-x/keymaps/hasu/keymap.c index 46ea81fea..cbeaae028 100644 --- a/keyboards/s60-x/keymaps/hasu/keymap.c +++ b/keyboards/s60-x/keymaps/hasu/keymap.c @@ -1,9 +1,9 @@ -#include "keymap_common.h" +#include "s60-x.h" /* * Hasu */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Default Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ @@ -17,7 +17,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ Fn3 │ Fn3 │ Fn0 │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ CAPS, A, S, D, F, G, H, J, K, L, FN2, QUOT, NO, ENT, \ @@ -36,7 +36,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ Fn0 │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, F, P, G, J, L, U, Y, SCLN, LBRC, RBRC, BSLS, \ BSPC, A, R, S, T, D, H, N, E, I, O, QUOT, NO, ENT, \ @@ -55,7 +55,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ FN0 │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC, RBRC, NO, BSPC, \ TAB, QUOT, COMM, DOT, P, Y, F, G, C, R, L, SLSH, EQL, BSLS, \ CAPS, A, O, E, U, I, D, H, T, N, S, MINS, NO, ENT, \ @@ -74,7 +74,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│R_WIN│ APP │ FN0 │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, D, R, W, B, J, F, U, P, SCLN, LBRC, RBRC, BSLS, \ BSPC, A, S, H, T, G, Y, N, E, O, I, QUOT, NO, ENT, \ @@ -93,7 +93,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_GUI│L_ALT│█████│█████│█████│Space│█████│█████│█████│R_ALT│R_GUI│ App │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUS, UP, TRNS, INS, \ LCTL, VOLD, VOLU, MUTE, TRNS, TRNS, PAST, PSLS, HOME, PGUP, LEFT, RGHT, TRNS, ENT, \ @@ -112,7 +112,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_GUI│L_ALT│█████│█████│█████│Space│█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, BSPC, \ TAB, HOME, PGDN, UP, PGUP, END, HOME, PGDN, PGUP, END, TRNS, TRNS, TRNS, TRNS, \ LCTL, TRNS, LEFT, DOWN, RGHT, TRNS, LEFT, DOWN, UP, RGHT, TRNS, TRNS, TRNS, ENT, \ @@ -132,7 +132,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel */ - KEYMAP( + LEGACY_KEYMAP( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, BSPC, \ TAB, TRNS, TRNS, TRNS, TRNS, TRNS, WH_L, WH_D, WH_U, WH_R, TRNS, TRNS, TRNS, TRNS, \ LCTL, TRNS, ACL0, ACL1, ACL2, TRNS, MS_L, MS_D, MS_U, MS_R, TRNS, TRNS, TRNS, ENT, \ @@ -157,7 +157,7 @@ Ld: set Dvorak layout Lw: set Workman layout */ - KEYMAP( + LEGACY_KEYMAP( FN5, FN6, FN7, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, FN5, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, FN7, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ diff --git a/keyboards/s60-x/keymaps/hhkb/keymap.c b/keyboards/s60-x/keymaps/hhkb/keymap.c index a6e5b3279..9afd1247f 100644 --- a/keyboards/s60-x/keymaps/hhkb/keymap.c +++ b/keyboards/s60-x/keymaps/hhkb/keymap.c @@ -1,9 +1,9 @@ -#include "keymap_common.h" +#include "s60-x.h" /* * HHKB Layout */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: Default layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ @@ -17,12 +17,12 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │▒▒▒▒▒│ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│▒▒▒▒▒│ Alt │ Gui │▒▒▒▒▒│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSLS, GRV, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSPC, \ + LEGACY_KEYMAP( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSLS, GRV, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSPC, \ LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, FN0, \ - NO, LGUI, LALT, SPC, NO, RALT, RGUI, NO), + NO, LGUI, LALT, SPC, NO, RALT, RGUI, NO), /* 1: HHKB Fn layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ @@ -36,12 +36,12 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │▒▒▒▒▒│ │ │█████│█████│█████│ │█████│█████│█████│▒▒▒▒▒│ │ │▒▒▒▒▒│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( - PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ - CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUS, UP, TRNS, TRNS, \ - TRNS, VOLD, VOLU, MUTE, EJCT, TRNS, PAST, PSLS, HOME, PGUP, LEFT, RGHT, NO, PENT, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PPLS, PMNS, END, PGDN, DOWN, NO, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + LEGACY_KEYMAP( + PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ + CAPS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PSCR, SLCK, PAUS, UP, TRNS, TRNS, \ + TRNS, VOLD, VOLU, MUTE, EJCT, TRNS, PAST, PSLS, HOME, PGUP, LEFT, RGHT, NO, PENT, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PPLS, PMNS, END, PGDN, DOWN, NO, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), }; /* diff --git a/keyboards/s60-x/keymaps/iso/keymap.c b/keyboards/s60-x/keymaps/iso/keymap.c index ad597cd7d..43a9c48b0 100644 --- a/keyboards/s60-x/keymaps/iso/keymap.c +++ b/keyboards/s60-x/keymaps/iso/keymap.c @@ -1,4 +1,4 @@ -#include "keymap_common.h" +#include "s60-x.h" /* 0: Main layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠@@ -14,9 +14,9 @@ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: ANSI qwerty */ - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + LEGACY_KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, NO, \ CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT , \ LSFT, BSLS, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ @@ -35,7 +35,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ TRNS, TRNS, UP, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, PGDN, PSCR, SLCK, PAUS, TRNS, \ TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ diff --git a/keyboards/s60-x/keymaps/jpec/keymap.c b/keyboards/s60-x/keymaps/jpec/keymap.c index 3b680c307..c8fc13328 100644 --- a/keyboards/s60-x/keymaps/jpec/keymap.c +++ b/keyboards/s60-x/keymaps/jpec/keymap.c @@ -30,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Fn1 |Gui |Alt | SpaceFn |Alt |Gui |App |Ctrl| * `-----------------------------------------------------------' */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BSPC, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NUHS, ENT, \ @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ - KEYMAP( + LEGACY_KEYMAP( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ TRNS, MPRV, MPLY, MNXT, MSTP, TRNS, TRNS, PGUP, UP, PGDN, TRNS, SLCK, PAUS, INS, \ TRNS, VOLD, MUTE, VOLU, TRNS, TRNS, HOME, LEFT, DOWN, RGHT, END, TRNS, TRNS, PENT, \ diff --git a/keyboards/s60-x/keymaps/plain/keymap.c b/keyboards/s60-x/keymaps/plain/keymap.c index 0f0cdee2a..790ac88e7 100644 --- a/keyboards/s60-x/keymaps/plain/keymap.c +++ b/keyboards/s60-x/keymaps/plain/keymap.c @@ -1,4 +1,4 @@ -#include "keymap_common.h" +#include "s60-x.h" /* Main layer: ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠@@ -14,9 +14,9 @@ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty */ - KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ + LEGACY_KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ LSFT, NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, RSFT, NO, \ diff --git a/keyboards/s60-x/keymaps/poker/keymap.c b/keyboards/s60-x/keymaps/poker/keymap.c index 5fc970a04..0a8691792 100644 --- a/keyboards/s60-x/keymaps/poker/keymap.c +++ b/keyboards/s60-x/keymaps/poker/keymap.c @@ -1,6 +1,6 @@ -#include "keymap_common.h" +#include "s60-x.h" -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ @@ -14,7 +14,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ @@ -33,7 +33,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, F, P, G, J, L, U, Y, SCLN, LBRC, RBRC, BSLS, \ BSPC, A, R, S, T, D, H, N, E, I, O, QUOT, NO, ENT, \ @@ -52,7 +52,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC, RBRC, NO, BSPC, \ TAB, QUOT, COMM, DOT, P, Y, F, G, C, R, L, SLSH, EQL, BSLS, \ CAPS, A, O, E, U, I, D, H, T, N, S, MINS, NO, ENT, \ @@ -71,7 +71,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, D, R, W, B, J, F, U, P, SCLN, LBRC, RBRC, BSLS, \ BSPC, A, S, H, T, G, Y, N, E, O, I, QUOT, NO, ENT, \ @@ -90,7 +90,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ │Left │Down │Right│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ @@ -109,12 +109,12 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), /* 6: Poker Fn ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│ │ @@ -134,8 +134,8 @@ FnQ: toggle Esc overlay FnS: toggle Arrow overlay */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + LEGACY_KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ TRNS, FN2, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, FN4, \ TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN3, END, TRNS, TRNS, \ TRNS, TRNS, DEL, TRNS, WHOM, MUTE, VOLU, VOLD, TRNS, PGUP, PGDN, DEL, TRNS, TRNS, TRNS, \ @@ -159,12 +159,12 @@ Ld: set Dvorak layout Lw: set Workman layout */ - KEYMAP( - FN5, FN6, FN7, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, FN5, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, FN7, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, FN6, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + LEGACY_KEYMAP( + FN5, FN6, FN7, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, FN5, FN8, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, FN7, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, FN6, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), }; const uint16_t PROGMEM fn_actions[] = { /* Poker Layout */ diff --git a/keyboards/s60-x/keymaps/poker_bit/keymap.c b/keyboards/s60-x/keymaps/poker_bit/keymap.c index 4a4cfd1be..7626038f4 100644 --- a/keyboards/s60-x/keymaps/poker_bit/keymap.c +++ b/keyboards/s60-x/keymaps/poker_bit/keymap.c @@ -1,9 +1,9 @@ -#include "keymap_common.h" +#include "s60-x.h" // Poker fix with toggle and bit operation // Fn + Esc = ` // Fn + {left, down, up, right} = {home, pgdown, pgup, end} -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ @@ -17,7 +17,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ @@ -36,7 +36,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ Fn1 │█████│█████│█████│ │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - [4] = KEYMAP( + [4] = LEGACY_KEYMAP( TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ CAPS, FN2, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN4, END, TRNS, TRNS, \ @@ -55,7 +55,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn3 │Home │PgDwn│ End │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ @@ -74,7 +74,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ @@ -93,7 +93,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ │Left │Down │Right│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ diff --git a/keyboards/s60-x/keymaps/poker_set/keymap.c b/keyboards/s60-x/keymaps/poker_set/keymap.c index 0c1ef1a9b..09423e75b 100644 --- a/keyboards/s60-x/keymaps/poker_set/keymap.c +++ b/keyboards/s60-x/keymaps/poker_set/keymap.c @@ -1,9 +1,9 @@ -#include "keymap_common.h" +#include "s60-x.h" // Poker fix with set(state transition) // Fn + Esc = ` // Fn + {left, down, up, right} = {home, pgdown, pgup, end} -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* 0: qwerty ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│GRAVE│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ @@ -17,7 +17,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_WIN│L_ALT│█████│█████│█████│ SPC │█████│█████│█████│ Fn0 │R_WIN│ APP │RCTRL│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ LCTL, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ @@ -36,7 +36,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn1 │Left │Down │Right│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ @@ -55,7 +55,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn2 │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ @@ -74,7 +74,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ Fn3 │Left │Down │Right│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( ESC, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, \ @@ -93,7 +93,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ Fn5 │█████│█████│█████│ Fn4 │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ TRNS, FN6, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ @@ -112,7 +112,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ Fn4 │█████│█████│█████│ Fn5 │Home │PgDwn│ End │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ TRNS, FN7, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ @@ -131,7 +131,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ Fn7 │█████│█████│█████│ Fn6 │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ TRNS, FN4, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ @@ -150,7 +150,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ Fn6 │█████│█████│█████│ Fn7 │Home │PgDwn│ End │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ TRNS, FN5, UP, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, CALC, TRNS, HOME, INS, TRNS, \ TRNS, LEFT, DOWN, RGHT, TRNS, TRNS, PSCR, SLCK, PAUS, TRNS, FN8, END, TRNS, TRNS, \ diff --git a/keyboards/s60-x/keymaps/spacefn/keymap.c b/keyboards/s60-x/keymaps/spacefn/keymap.c index c93070532..b6dc7ca7e 100644 --- a/keyboards/s60-x/keymaps/spacefn/keymap.c +++ b/keyboards/s60-x/keymaps/spacefn/keymap.c @@ -1,10 +1,10 @@ -#include "keymap_common.h" +#include "s60-x.h" /* * SpaceFN * http://geekhack.org/index.php?topic=51069.0 */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Default Layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┠│ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│ @@ -18,7 +18,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │LCTRL│L_GUI│L_ALT│█████│█████│█████Spc/Fn0█████│█████│█████│R_ALT│R_GUI│ APP │RCTRL│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, NO, BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, \ CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, NO, ENT, \ @@ -38,7 +38,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - KEYMAP( + LEGACY_KEYMAP( GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, DEL, \ TRNS, TRNS, TRNS, ESC, TRNS, TRNS, TRNS, HOME, UP, END, PSCR, SLCK, PAUS, INS, \ TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, PGUP, LEFT, DOWN, RGHT, TRNS, TRNS, TRNS, TRNS, \ diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md index 150962565..4bba4b68f 100644 --- a/keyboards/s60-x/readme.md +++ b/keyboards/s60-x/readme.md @@ -5,19 +5,10 @@ DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps ## S60X Resources - [Massdrop page](https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open) -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/readme.md). - -## Keymap -Several versions of keymaps are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_.c` and see keymap document (you can find in top README.md) and existent keymap files. - -To build firmware binary hex file with a certain keymap just run `make` with the `keymap` option like: - - $ make keymap=[custom|poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|] - -File [S60-X_pre-compiled_firmwares.zip](S60-X_pre-compiled_firmwares.zip) contains pre-compiled firmwares for all keymaps available. Not all of them are tested. +## Quickstart +If you just want to test a few layouts, the archive [s60-x_precompiled.zip](s60-x_precompiled.zip) contains pre-compiled .hex-files for all available keymaps. Not all of them are tested. +You only need to flash them onto your keyboard, which is explained below, there's no need to setup a build environment. For a full list ## Flashing your keyboard The recommended programs for flashing your keyboard are [Atmel FLIP](http://www.atmel.com/tools/FLIP.aspx) (Windows) and [dfu-programmer](http://dfu-programmer.sourceforge.net/) (Linux/Windows). @@ -29,7 +20,7 @@ The recommended programs for flashing your keyboard are [Atmel FLIP](http://www. **Programming the firmware (Windows)** 1. download and install FLIP (http://www.atmel.com/tools/FLIP.aspx) -2. connect the keyboard, press the program button (S1) and wait until it enumerates +2. connect the keyboard, press the program button on the underside of the board (S1) and wait until it enumerates (you'll hear the "disconnect" and "connect" sound) 3. go to device manager, find the atmega32u4 chip and click "update driver" 4. choose location manually: folder named "usb" inside the installation directory of FLIP 5. once the driver is installed, run flip @@ -49,6 +40,21 @@ The recommended programs for flashing your keyboard are [Atmel FLIP](http://www. 3. `sudo dfu-programmer atmega32u4 start` 3. The keyboard should start working. If it doesn't, reconnect the cable. +## Building the firmware + +To build firmware binary hex file with a certain keymap just run `make` with the `keymap` option like: + + $ make keymap=[custom|poker|poker_set|poker_bit|plain|hasu|spacefn|hhkb|] + +For a more detailed explanation of the build process and the environment setup, see the ["Getting Started" section](/readme.md#getting-started). + +## List of included Keymaps + +Several versions of keymaps are available in advance but you are recommended to define your favorite layout yourself. +To define your own keymap, copy the [default keymap template](/quantum/template/keymaps/default) directory into the `keymaps` directory and start modifying the `keymap.c` file. Some options might require you to change the `config.h` or `Makefile` as well, refer to the main documentation for more information on those. +If you want to later merge your finalised keymap into this repository to make it available for everyone, make sure to also modify the `readme.md` in your keymap directory to show a visual version of your keymap. + +Here's a list of the standard layouts that are provided with the precompiled .hex-files. ### 0 Initial explanations The █████ blocks on the layouts hides the switch positions that do not exist physically on the PCB. If you feel like hacking the keyboard and adding new keys, those are the positions that can be used. You'll have to modify the [keymap_common.h](keymap_common.h) file for that. diff --git a/keyboards/s60-x/s60-x.h b/keyboards/s60-x/s60-x.h index 91e7b67f3..29a2a27b2 100644 --- a/keyboards/s60-x/s60-x.h +++ b/keyboards/s60-x/s60-x.h @@ -49,4 +49,21 @@ along with this program. If not, see . { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, KC_NO } \ } +/*This special definition is used for S60-X keymaps that were ported from TMK + * QMK has a lot of keycodes that don't start with KC_, so using the regular KEYMAP macro is recommended + */ +#define LEGACY_KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_NO }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_NO }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E }, \ + { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_NO, KC_##K46, KC_NO, KC_NO, KC_NO, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_NO } \ +} + #endif diff --git a/keyboards/s60-x/s60-x_precompiled.zip b/keyboards/s60-x/s60-x_precompiled.zip new file mode 100644 index 000000000..00d99ca8a Binary files /dev/null and b/keyboards/s60-x/s60-x_precompiled.zip differ -- cgit v1.2.3-24-g4f1b From 5705a403205c0c1e7c585e1a2edda21e79134ee6 Mon Sep 17 00:00:00 2001 From: Toni Date: Sun, 14 Aug 2016 20:06:47 +0200 Subject: increased readability with a defince --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 32 +++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index 9f838ba61..68cc6755e 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -2,6 +2,7 @@ // this is the style you want to emulate. #include "satan.h" +// TODO: replace your ugly german brckets with #defines // Each layer gets a name for readability, which is then used in the keymap matrix below. // The underscores don't mean anything - you can have a layer called STUFF or any other name. @@ -12,6 +13,9 @@ #define _TAB 2 #define _SFX 3 +// increase readability +#define _______ KC_TRNS + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer * ,-----------------------------------------------------------. @@ -48,10 +52,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_SPC] = KEYMAP_ISO_SPLITRSHIFT( KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_TRNS, KC_PAUS, KC_UP, RALT(KC_8), RALT(KC_9), KC_TRNS, KC_TRNS, LSFT(KC_8), LSFT(KC_9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NUBS, LSFT(KC_NUBS), KC_SPACE,M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), + _______, KC_PAUS, KC_UP, RALT(KC_8), RALT(KC_9), _______, _______, LSFT(KC_8), LSFT(KC_9), _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ + _______, _______, _______, _______, KC_NUBS, LSFT(KC_NUBS), KC_SPACE,M(0), _______, _______, _______, _______, _______, KC_VOLU, \ + _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) * ,-----------------------------------------------------------. @@ -67,11 +71,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_TAB] = KEYMAP_ISO_SPLITRSHIFT( - KC_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RALT(KC_7), RALT(KC_0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, _______, RALT(KC_7), RALT(KC_0), _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, _______, KC_PGUP, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) * ,-----------------------------------------------------------. @@ -87,11 +91,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_SFX] = KEYMAP_ISO_SPLITRSHIFT( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, \ - KC_TRNS, F(2), F(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \ - KC_TRNS, F(4), F(5), F(6), F(7), F(8), F(9), KC_TRNS, KC_TRNS, KC_0, KC_TRNS, KC_SLSH, KC_TRNS, KC_UP, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT), + RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \ + _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, KC_NO, KC_ENT, \ + _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, _______, KC_UP, \ + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT), }; enum function_id { -- cgit v1.2.3-24-g4f1b From c6c2c3fc14736e4d226c5f410d8c3faf3d36629f Mon Sep 17 00:00:00 2001 From: di0ib Date: Sun, 14 Aug 2016 10:58:10 -1000 Subject: minorca minirca with RGB keymap --- keyboards/minorca/Makefile | 71 ++++++++++++++++++++++++ keyboards/minorca/config.h | 80 ++++++++++++++++++++++++++++ keyboards/minorca/keymaps/default/Makefile | 25 +++++++++ keyboards/minorca/keymaps/default/config.h | 12 +++++ keyboards/minorca/keymaps/default/keymap.c | 44 +++++++++++++++ keyboards/minorca/keymaps/default/readme.md | 5 ++ keyboards/minorca/keymaps/readme.md | 23 ++++++++ keyboards/minorca/keymaps/rgb/Makefile | 25 +++++++++ keyboards/minorca/keymaps/rgb/config.h | 20 +++++++ keyboards/minorca/keymaps/rgb/example.jpg | Bin 0 -> 72737 bytes keyboards/minorca/keymaps/rgb/keymap.c | 65 ++++++++++++++++++++++ keyboards/minorca/keymaps/rgb/readme.md | 23 ++++++++ keyboards/minorca/keymaps/rgb/wiring1.jpg | Bin 0 -> 119547 bytes keyboards/minorca/keymaps/rgb/wiring2.jpg | Bin 0 -> 94987 bytes keyboards/minorca/minorca.c | 6 +++ keyboards/minorca/minorca.h | 6 +++ keyboards/minorca/readme.md | 31 +++++++++++ 17 files changed, 436 insertions(+) create mode 100644 keyboards/minorca/Makefile create mode 100644 keyboards/minorca/config.h create mode 100644 keyboards/minorca/keymaps/default/Makefile create mode 100644 keyboards/minorca/keymaps/default/config.h create mode 100644 keyboards/minorca/keymaps/default/keymap.c create mode 100644 keyboards/minorca/keymaps/default/readme.md create mode 100644 keyboards/minorca/keymaps/readme.md create mode 100644 keyboards/minorca/keymaps/rgb/Makefile create mode 100644 keyboards/minorca/keymaps/rgb/config.h create mode 100644 keyboards/minorca/keymaps/rgb/example.jpg create mode 100644 keyboards/minorca/keymaps/rgb/keymap.c create mode 100644 keyboards/minorca/keymaps/rgb/readme.md create mode 100644 keyboards/minorca/keymaps/rgb/wiring1.jpg create mode 100644 keyboards/minorca/keymaps/rgb/wiring2.jpg create mode 100644 keyboards/minorca/minorca.c create mode 100644 keyboards/minorca/minorca.h create mode 100644 keyboards/minorca/readme.md diff --git a/keyboards/minorca/Makefile b/keyboards/minorca/Makefile new file mode 100644 index 000000000..8cff00049 --- /dev/null +++ b/keyboards/minorca/Makefile @@ -0,0 +1,71 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= yes # 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 +NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../Makefile +endif \ No newline at end of file diff --git a/keyboards/minorca/config.h b/keyboards/minorca/config.h new file mode 100644 index 000000000..4cdafcbd2 --- /dev/null +++ b/keyboards/minorca/config.h @@ -0,0 +1,80 @@ +/* +Copyright 2012 Jun Wako + +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 0x6660 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ME +#define PRODUCT MinOrca +#define DESCRIPTION Tiny Whale + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* MinOrca PCB default pin-out */ +#define MATRIX_COL_PINS { D4, D6, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } +#define MATRIX_ROW_PINS { B0, B1, B2, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* 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 DEBOUNCING_DELAY 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)) \ +) + +/* + * 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 + +#endif diff --git a/keyboards/minorca/keymaps/default/Makefile b/keyboards/minorca/keymaps/default/Makefile new file mode 100644 index 000000000..8dc851fdd --- /dev/null +++ b/keyboards/minorca/keymaps/default/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/minorca/keymaps/default/config.h b/keyboards/minorca/keymaps/default/config.h new file mode 100644 index 000000000..bf40376c1 --- /dev/null +++ b/keyboards/minorca/keymaps/default/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* bootmagic salt key */ +#define BOOTMAGIC_KEY_SALT KC_ESC + +/* skip bootmagic and eeconfig */ +#define BOOTMAGIC_KEY_SKIP KC_SPACE + +#endif diff --git a/keyboards/minorca/keymaps/default/keymap.c b/keyboards/minorca/keymaps/default/keymap.c new file mode 100644 index 000000000..a55d578e4 --- /dev/null +++ b/keyboards/minorca/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "minorca.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = { /* Base */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT }, + {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, KC_SPC, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_DOT, KC_SLSH, KC_NO } + }, + [1] = { /* First */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT }, + {KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX, KC_LGUI }, + {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } + }, + [2] = { /* Second */ + {KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT }, + {KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX, KC_ENT }, + {KC_CAPS, XXXXXXX, KC_LSFT, KC_RSFT, KC_PAUSE,KC_F10, KC_F11, KC_F12, KC_NO, KC_UP, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } + }, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to First overlay + [1] = ACTION_LAYER_MOMENTARY(2), // to Second overlay + +}; \ No newline at end of file diff --git a/keyboards/minorca/keymaps/default/readme.md b/keyboards/minorca/keymaps/default/readme.md new file mode 100644 index 000000000..6ed31f82b --- /dev/null +++ b/keyboards/minorca/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# The Default Minorca Layout + +Copied from https://github.com/pancinteractive/qmk_firmware/blob/master/keyboard/minorca_mkV/keymaps/default/keymap.c + +It looks incomplete. \ No newline at end of file diff --git a/keyboards/minorca/keymaps/readme.md b/keyboards/minorca/keymaps/readme.md new file mode 100644 index 000000000..54fb5f6d9 --- /dev/null +++ b/keyboards/minorca/keymaps/readme.md @@ -0,0 +1,23 @@ +# How to add your own keymap + +Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`: + + _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author] + +\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements + +and contain the following files: + +* `keymap.c` +* `readme.md` *recommended* +* `config.h` *optional*, found automatically when compiling +* `Makefile` *optional*, found automatically when compling + +When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format: + + * **folder_name** description + +# List of Planck keymaps + +* **default** default Planck layout +* **cbbrowne** cbbrowne's Planck layout \ No newline at end of file diff --git a/keyboards/minorca/keymaps/rgb/Makefile b/keyboards/minorca/keymaps/rgb/Makefile new file mode 100644 index 000000000..230f75a62 --- /dev/null +++ b/keyboards/minorca/keymaps/rgb/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/minorca/keymaps/rgb/config.h b/keyboards/minorca/keymaps/rgb/config.h new file mode 100644 index 000000000..deaac2e26 --- /dev/null +++ b/keyboards/minorca/keymaps/rgb/config.h @@ -0,0 +1,20 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* bootmagic salt key */ +#define BOOTMAGIC_KEY_SALT KC_ESC + +/* skip bootmagic and eeconfig */ +#define BOOTMAGIC_KEY_SKIP KC_SPACE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D5 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 13 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif diff --git a/keyboards/minorca/keymaps/rgb/example.jpg b/keyboards/minorca/keymaps/rgb/example.jpg new file mode 100644 index 000000000..a04c8d37d Binary files /dev/null and b/keyboards/minorca/keymaps/rgb/example.jpg differ diff --git a/keyboards/minorca/keymaps/rgb/keymap.c b/keyboards/minorca/keymaps/rgb/keymap.c new file mode 100644 index 000000000..9002afbb8 --- /dev/null +++ b/keyboards/minorca/keymaps/rgb/keymap.c @@ -0,0 +1,65 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "minorca.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _TB 3 + +// Macro name shortcuts +#define QWERTY M(_QWERTY) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {FUNC(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_QUOT}, + {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, FUNC(1)}, + {KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, FUNC(2), XXXXXXX, XXXXXXX, FUNC(3), XXXXXXX, KC_RALT, KC_APP, KC_RCTL} +}, + +[_RAISE] = { + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), XXXXXXX, S(KC_BSLS)}, + {KC_TRNS, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT}, + {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_MNXT, KC_MUTE, KC_MPLY} +}, + +[_LOWER] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, XXXXXXX, KC_BSLS}, + {KC_TRNS, XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT}, + {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_HOME, KC_PGDN, KC_END} +}, + +[_TB] = { /* Tab */ + {KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, KC_TRNS}, + {KC_TRNS, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT}, + {BL_STEP, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_TB, KC_TAB), + [1] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [2] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), + [3] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), +}; diff --git a/keyboards/minorca/keymaps/rgb/readme.md b/keyboards/minorca/keymaps/rgb/readme.md new file mode 100644 index 000000000..50806068c --- /dev/null +++ b/keyboards/minorca/keymaps/rgb/readme.md @@ -0,0 +1,23 @@ +#RGB backlight for MinOrca + +![wiring](example.jpg) + +Exmaple of adding WS2812b LEDs to a MinOrca. + +http://www.40percent.club/2016/08/tiny-whale.html + +The keymap is a work in progress. The RGB functions are accessed by holding down the TAB key. + +Tab + Z Toggle on/off +Tab + X Mode +Tab + C Hue+ +Tab + V Hue- +Tab + B Saturation+ +Tab + N Saturation- +Tab + M Brightness+ +Tab + , Brightness- + +Example wiring: + +![wiring](wiring1.jpg) +![wiring closeup](wiring2.jpg) diff --git a/keyboards/minorca/keymaps/rgb/wiring1.jpg b/keyboards/minorca/keymaps/rgb/wiring1.jpg new file mode 100644 index 000000000..7dcbe80c5 Binary files /dev/null and b/keyboards/minorca/keymaps/rgb/wiring1.jpg differ diff --git a/keyboards/minorca/keymaps/rgb/wiring2.jpg b/keyboards/minorca/keymaps/rgb/wiring2.jpg new file mode 100644 index 000000000..fd91d3e1c Binary files /dev/null and b/keyboards/minorca/keymaps/rgb/wiring2.jpg differ diff --git a/keyboards/minorca/minorca.c b/keyboards/minorca/minorca.c new file mode 100644 index 000000000..24e72c2a5 --- /dev/null +++ b/keyboards/minorca/minorca.c @@ -0,0 +1,6 @@ +#include "minorca.h" + +void matrix_init_kb(void) { + + matrix_init_user(); +} \ No newline at end of file diff --git a/keyboards/minorca/minorca.h b/keyboards/minorca/minorca.h new file mode 100644 index 000000000..158e5b4c5 --- /dev/null +++ b/keyboards/minorca/minorca.h @@ -0,0 +1,6 @@ +#ifndef MINORCA_H +#define MINORCA_H + +#include "quantum.h" + +#endif diff --git a/keyboards/minorca/readme.md b/keyboards/minorca/readme.md new file mode 100644 index 000000000..1d655dfe4 --- /dev/null +++ b/keyboards/minorca/readme.md @@ -0,0 +1,31 @@ +minorca keyboard firmware +====================== +Handwired 40% keyboard + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. + +### Notable forks (which some of the keymap files are from) +- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) +- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) +- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) +- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) -- cgit v1.2.3-24-g4f1b From dde9ee572cf01609aaebbc6cbe1f326e7f89b7f4 Mon Sep 17 00:00:00 2001 From: di0ib Date: Sun, 14 Aug 2016 11:06:46 -1000 Subject: clean up readnme --- keyboards/minorca/keymaps/rgb/readme.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/keyboards/minorca/keymaps/rgb/readme.md b/keyboards/minorca/keymaps/rgb/readme.md index 50806068c..051ffe3c6 100644 --- a/keyboards/minorca/keymaps/rgb/readme.md +++ b/keyboards/minorca/keymaps/rgb/readme.md @@ -8,16 +8,18 @@ http://www.40percent.club/2016/08/tiny-whale.html The keymap is a work in progress. The RGB functions are accessed by holding down the TAB key. -Tab + Z Toggle on/off -Tab + X Mode -Tab + C Hue+ -Tab + V Hue- -Tab + B Saturation+ -Tab + N Saturation- -Tab + M Brightness+ -Tab + , Brightness- +*Tab + Z Toggle on/off +*Tab + X Mode +*Tab + C Hue+ +*Tab + V Hue- +*Tab + B Saturation+ +*Tab + N Saturation- +*Tab + M Brightness+ +*Tab + , Brightness- Example wiring: +WS2812 data pin is connected to D2 + ![wiring](wiring1.jpg) ![wiring closeup](wiring2.jpg) -- cgit v1.2.3-24-g4f1b From 65060ad000930b4d735760cd8951ae0f462d5f14 Mon Sep 17 00:00:00 2001 From: di0ib Date: Sun, 14 Aug 2016 11:07:35 -1000 Subject: Fix list --- keyboards/minorca/keymaps/rgb/readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/keyboards/minorca/keymaps/rgb/readme.md b/keyboards/minorca/keymaps/rgb/readme.md index 051ffe3c6..00b6d6cd8 100644 --- a/keyboards/minorca/keymaps/rgb/readme.md +++ b/keyboards/minorca/keymaps/rgb/readme.md @@ -2,20 +2,20 @@ ![wiring](example.jpg) -Exmaple of adding WS2812b LEDs to a MinOrca. +Example of adding WS2812b LEDs to a MinOrca. http://www.40percent.club/2016/08/tiny-whale.html The keymap is a work in progress. The RGB functions are accessed by holding down the TAB key. -*Tab + Z Toggle on/off -*Tab + X Mode -*Tab + C Hue+ -*Tab + V Hue- -*Tab + B Saturation+ -*Tab + N Saturation- -*Tab + M Brightness+ -*Tab + , Brightness- +* Tab + Z Toggle on/off +* Tab + X Mode +* Tab + C Hue+ +* Tab + V Hue- +* Tab + B Saturation+ +* Tab + N Saturation- +* Tab + M Brightness+ +* Tab + , Brightness- Example wiring: -- cgit v1.2.3-24-g4f1b From 1eaa685872745d3ae01afb79bad8f25a4fd1029d Mon Sep 17 00:00:00 2001 From: di0ib Date: Sun, 14 Aug 2016 11:08:15 -1000 Subject: Correct data pin to D5 --- keyboards/minorca/keymaps/rgb/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/minorca/keymaps/rgb/readme.md b/keyboards/minorca/keymaps/rgb/readme.md index 00b6d6cd8..f50dfa546 100644 --- a/keyboards/minorca/keymaps/rgb/readme.md +++ b/keyboards/minorca/keymaps/rgb/readme.md @@ -19,7 +19,7 @@ The keymap is a work in progress. The RGB functions are accessed by holding down Example wiring: -WS2812 data pin is connected to D2 +WS2812 data pin is connected to D5 ![wiring](wiring1.jpg) ![wiring closeup](wiring2.jpg) -- cgit v1.2.3-24-g4f1b From f58a67c991fa15f6177ebb9ec74e831b851bb38e Mon Sep 17 00:00:00 2001 From: di0ib Date: Sun, 14 Aug 2016 11:10:12 -1000 Subject: cleanup readme --- keyboards/minorca/keymaps/readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/minorca/keymaps/readme.md b/keyboards/minorca/keymaps/readme.md index 54fb5f6d9..058923ba2 100644 --- a/keyboards/minorca/keymaps/readme.md +++ b/keyboards/minorca/keymaps/readme.md @@ -17,7 +17,7 @@ When adding your keymap to this list, keep it organised alphabetically (select l * **folder_name** description -# List of Planck keymaps +# List of Minorca keymaps -* **default** default Planck layout -* **cbbrowne** cbbrowne's Planck layout \ No newline at end of file +* **default** default Minorca layout +* **rgb** layout with WS2812b control -- cgit v1.2.3-24-g4f1b From 503ec7f9f6f9c15049f02c3753afdfe2d0db629b Mon Sep 17 00:00:00 2001 From: di0ib Date: Sun, 14 Aug 2016 11:15:46 -1000 Subject: Updated readme Added link to Minorca/Sebright blog. --- keyboards/minorca/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/minorca/readme.md b/keyboards/minorca/readme.md index 1d655dfe4..93c767954 100644 --- a/keyboards/minorca/readme.md +++ b/keyboards/minorca/readme.md @@ -2,6 +2,8 @@ minorca keyboard firmware ====================== Handwired 40% keyboard +http://www.panc.co/blog/minorcasebright-information-page + ## Quantum MK Firmware For the full Quantum feature list, see [the parent readme.md](/readme.md). -- cgit v1.2.3-24-g4f1b From 959c48e146ec3c2192e8d261d78d27b80342ad30 Mon Sep 17 00:00:00 2001 From: di0ib Date: Sun, 14 Aug 2016 14:13:58 -1000 Subject: moved to handwired folder --- keyboards/handwired/minorca/Makefile | 71 ++++++++++++++++++ keyboards/handwired/minorca/config.h | 80 +++++++++++++++++++++ .../handwired/minorca/keymaps/default/Makefile | 25 +++++++ .../handwired/minorca/keymaps/default/config.h | 12 ++++ .../handwired/minorca/keymaps/default/keymap.c | 44 ++++++++++++ .../handwired/minorca/keymaps/default/readme.md | 5 ++ keyboards/handwired/minorca/keymaps/readme.md | 23 ++++++ keyboards/handwired/minorca/keymaps/rgb/Makefile | 25 +++++++ keyboards/handwired/minorca/keymaps/rgb/config.h | 20 ++++++ .../handwired/minorca/keymaps/rgb/example.jpg | Bin 0 -> 72737 bytes keyboards/handwired/minorca/keymaps/rgb/keymap.c | 65 +++++++++++++++++ keyboards/handwired/minorca/keymaps/rgb/readme.md | 25 +++++++ .../handwired/minorca/keymaps/rgb/wiring1.jpg | Bin 0 -> 119547 bytes .../handwired/minorca/keymaps/rgb/wiring2.jpg | Bin 0 -> 94987 bytes keyboards/handwired/minorca/minorca.c | 6 ++ keyboards/handwired/minorca/minorca.h | 6 ++ keyboards/handwired/minorca/readme.md | 33 +++++++++ keyboards/minorca/Makefile | 71 ------------------ keyboards/minorca/config.h | 80 --------------------- keyboards/minorca/keymaps/default/Makefile | 25 ------- keyboards/minorca/keymaps/default/config.h | 12 ---- keyboards/minorca/keymaps/default/keymap.c | 44 ------------ keyboards/minorca/keymaps/default/readme.md | 5 -- keyboards/minorca/keymaps/readme.md | 23 ------ keyboards/minorca/keymaps/rgb/Makefile | 25 ------- keyboards/minorca/keymaps/rgb/config.h | 20 ------ keyboards/minorca/keymaps/rgb/example.jpg | Bin 72737 -> 0 bytes keyboards/minorca/keymaps/rgb/keymap.c | 65 ----------------- keyboards/minorca/keymaps/rgb/readme.md | 25 ------- keyboards/minorca/keymaps/rgb/wiring1.jpg | Bin 119547 -> 0 bytes keyboards/minorca/keymaps/rgb/wiring2.jpg | Bin 94987 -> 0 bytes keyboards/minorca/minorca.c | 6 -- keyboards/minorca/minorca.h | 6 -- keyboards/minorca/readme.md | 33 --------- 34 files changed, 440 insertions(+), 440 deletions(-) create mode 100644 keyboards/handwired/minorca/Makefile create mode 100644 keyboards/handwired/minorca/config.h create mode 100644 keyboards/handwired/minorca/keymaps/default/Makefile create mode 100644 keyboards/handwired/minorca/keymaps/default/config.h create mode 100644 keyboards/handwired/minorca/keymaps/default/keymap.c create mode 100644 keyboards/handwired/minorca/keymaps/default/readme.md create mode 100644 keyboards/handwired/minorca/keymaps/readme.md create mode 100644 keyboards/handwired/minorca/keymaps/rgb/Makefile create mode 100644 keyboards/handwired/minorca/keymaps/rgb/config.h create mode 100644 keyboards/handwired/minorca/keymaps/rgb/example.jpg create mode 100644 keyboards/handwired/minorca/keymaps/rgb/keymap.c create mode 100644 keyboards/handwired/minorca/keymaps/rgb/readme.md create mode 100644 keyboards/handwired/minorca/keymaps/rgb/wiring1.jpg create mode 100644 keyboards/handwired/minorca/keymaps/rgb/wiring2.jpg create mode 100644 keyboards/handwired/minorca/minorca.c create mode 100644 keyboards/handwired/minorca/minorca.h create mode 100644 keyboards/handwired/minorca/readme.md delete mode 100644 keyboards/minorca/Makefile delete mode 100644 keyboards/minorca/config.h delete mode 100644 keyboards/minorca/keymaps/default/Makefile delete mode 100644 keyboards/minorca/keymaps/default/config.h delete mode 100644 keyboards/minorca/keymaps/default/keymap.c delete mode 100644 keyboards/minorca/keymaps/default/readme.md delete mode 100644 keyboards/minorca/keymaps/readme.md delete mode 100644 keyboards/minorca/keymaps/rgb/Makefile delete mode 100644 keyboards/minorca/keymaps/rgb/config.h delete mode 100644 keyboards/minorca/keymaps/rgb/example.jpg delete mode 100644 keyboards/minorca/keymaps/rgb/keymap.c delete mode 100644 keyboards/minorca/keymaps/rgb/readme.md delete mode 100644 keyboards/minorca/keymaps/rgb/wiring1.jpg delete mode 100644 keyboards/minorca/keymaps/rgb/wiring2.jpg delete mode 100644 keyboards/minorca/minorca.c delete mode 100644 keyboards/minorca/minorca.h delete mode 100644 keyboards/minorca/readme.md diff --git a/keyboards/handwired/minorca/Makefile b/keyboards/handwired/minorca/Makefile new file mode 100644 index 000000000..155c1f9a2 --- /dev/null +++ b/keyboards/handwired/minorca/Makefile @@ -0,0 +1,71 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= yes # 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 +NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/handwired/minorca/config.h b/keyboards/handwired/minorca/config.h new file mode 100644 index 000000000..4cdafcbd2 --- /dev/null +++ b/keyboards/handwired/minorca/config.h @@ -0,0 +1,80 @@ +/* +Copyright 2012 Jun Wako + +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 0x6660 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ME +#define PRODUCT MinOrca +#define DESCRIPTION Tiny Whale + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* MinOrca PCB default pin-out */ +#define MATRIX_COL_PINS { D4, D6, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } +#define MATRIX_ROW_PINS { B0, B1, B2, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* 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 DEBOUNCING_DELAY 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)) \ +) + +/* + * 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 + +#endif diff --git a/keyboards/handwired/minorca/keymaps/default/Makefile b/keyboards/handwired/minorca/keymaps/default/Makefile new file mode 100644 index 000000000..a573488a5 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/default/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../../Makefile +endif diff --git a/keyboards/handwired/minorca/keymaps/default/config.h b/keyboards/handwired/minorca/keymaps/default/config.h new file mode 100644 index 000000000..bf40376c1 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/default/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* bootmagic salt key */ +#define BOOTMAGIC_KEY_SALT KC_ESC + +/* skip bootmagic and eeconfig */ +#define BOOTMAGIC_KEY_SKIP KC_SPACE + +#endif diff --git a/keyboards/handwired/minorca/keymaps/default/keymap.c b/keyboards/handwired/minorca/keymaps/default/keymap.c new file mode 100644 index 000000000..a55d578e4 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "minorca.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = { /* Base */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT }, + {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, KC_SPC, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_DOT, KC_SLSH, KC_NO } + }, + [1] = { /* First */ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT }, + {KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX, KC_LGUI }, + {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } + }, + [2] = { /* Second */ + {KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT }, + {KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX, KC_ENT }, + {KC_CAPS, XXXXXXX, KC_LSFT, KC_RSFT, KC_PAUSE,KC_F10, KC_F11, KC_F12, KC_NO, KC_UP, KC_FN1, KC_FN0 }, + {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } + }, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to First overlay + [1] = ACTION_LAYER_MOMENTARY(2), // to Second overlay + +}; \ No newline at end of file diff --git a/keyboards/handwired/minorca/keymaps/default/readme.md b/keyboards/handwired/minorca/keymaps/default/readme.md new file mode 100644 index 000000000..6ed31f82b --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# The Default Minorca Layout + +Copied from https://github.com/pancinteractive/qmk_firmware/blob/master/keyboard/minorca_mkV/keymaps/default/keymap.c + +It looks incomplete. \ No newline at end of file diff --git a/keyboards/handwired/minorca/keymaps/readme.md b/keyboards/handwired/minorca/keymaps/readme.md new file mode 100644 index 000000000..058923ba2 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/readme.md @@ -0,0 +1,23 @@ +# How to add your own keymap + +Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`: + + _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author] + +\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements + +and contain the following files: + +* `keymap.c` +* `readme.md` *recommended* +* `config.h` *optional*, found automatically when compiling +* `Makefile` *optional*, found automatically when compling + +When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format: + + * **folder_name** description + +# List of Minorca keymaps + +* **default** default Minorca layout +* **rgb** layout with WS2812b control diff --git a/keyboards/handwired/minorca/keymaps/rgb/Makefile b/keyboards/handwired/minorca/keymaps/rgb/Makefile new file mode 100644 index 000000000..2b2af1335 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/rgb/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../../Makefile +endif diff --git a/keyboards/handwired/minorca/keymaps/rgb/config.h b/keyboards/handwired/minorca/keymaps/rgb/config.h new file mode 100644 index 000000000..deaac2e26 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/rgb/config.h @@ -0,0 +1,20 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* bootmagic salt key */ +#define BOOTMAGIC_KEY_SALT KC_ESC + +/* skip bootmagic and eeconfig */ +#define BOOTMAGIC_KEY_SKIP KC_SPACE + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D5 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 13 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif diff --git a/keyboards/handwired/minorca/keymaps/rgb/example.jpg b/keyboards/handwired/minorca/keymaps/rgb/example.jpg new file mode 100644 index 000000000..a04c8d37d Binary files /dev/null and b/keyboards/handwired/minorca/keymaps/rgb/example.jpg differ diff --git a/keyboards/handwired/minorca/keymaps/rgb/keymap.c b/keyboards/handwired/minorca/keymaps/rgb/keymap.c new file mode 100644 index 000000000..9002afbb8 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/rgb/keymap.c @@ -0,0 +1,65 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "minorca.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _TB 3 + +// Macro name shortcuts +#define QWERTY M(_QWERTY) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = { /* Qwerty */ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {FUNC(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_QUOT}, + {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, FUNC(1)}, + {KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, FUNC(2), XXXXXXX, XXXXXXX, FUNC(3), XXXXXXX, KC_RALT, KC_APP, KC_RCTL} +}, + +[_RAISE] = { + {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), XXXXXXX, S(KC_BSLS)}, + {KC_TRNS, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT}, + {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_MNXT, KC_MUTE, KC_MPLY} +}, + +[_LOWER] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, XXXXXXX, KC_BSLS}, + {KC_TRNS, XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT}, + {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_HOME, KC_PGDN, KC_END} +}, + +[_TB] = { /* Tab */ + {KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, KC_TRNS}, + {KC_TRNS, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT}, + {BL_STEP, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT} +} +}; + + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_KEY(_TB, KC_TAB), + [1] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [2] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), + [3] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), +}; diff --git a/keyboards/handwired/minorca/keymaps/rgb/readme.md b/keyboards/handwired/minorca/keymaps/rgb/readme.md new file mode 100644 index 000000000..f50dfa546 --- /dev/null +++ b/keyboards/handwired/minorca/keymaps/rgb/readme.md @@ -0,0 +1,25 @@ +#RGB backlight for MinOrca + +![wiring](example.jpg) + +Example of adding WS2812b LEDs to a MinOrca. + +http://www.40percent.club/2016/08/tiny-whale.html + +The keymap is a work in progress. The RGB functions are accessed by holding down the TAB key. + +* Tab + Z Toggle on/off +* Tab + X Mode +* Tab + C Hue+ +* Tab + V Hue- +* Tab + B Saturation+ +* Tab + N Saturation- +* Tab + M Brightness+ +* Tab + , Brightness- + +Example wiring: + +WS2812 data pin is connected to D5 + +![wiring](wiring1.jpg) +![wiring closeup](wiring2.jpg) diff --git a/keyboards/handwired/minorca/keymaps/rgb/wiring1.jpg b/keyboards/handwired/minorca/keymaps/rgb/wiring1.jpg new file mode 100644 index 000000000..7dcbe80c5 Binary files /dev/null and b/keyboards/handwired/minorca/keymaps/rgb/wiring1.jpg differ diff --git a/keyboards/handwired/minorca/keymaps/rgb/wiring2.jpg b/keyboards/handwired/minorca/keymaps/rgb/wiring2.jpg new file mode 100644 index 000000000..fd91d3e1c Binary files /dev/null and b/keyboards/handwired/minorca/keymaps/rgb/wiring2.jpg differ diff --git a/keyboards/handwired/minorca/minorca.c b/keyboards/handwired/minorca/minorca.c new file mode 100644 index 000000000..24e72c2a5 --- /dev/null +++ b/keyboards/handwired/minorca/minorca.c @@ -0,0 +1,6 @@ +#include "minorca.h" + +void matrix_init_kb(void) { + + matrix_init_user(); +} \ No newline at end of file diff --git a/keyboards/handwired/minorca/minorca.h b/keyboards/handwired/minorca/minorca.h new file mode 100644 index 000000000..158e5b4c5 --- /dev/null +++ b/keyboards/handwired/minorca/minorca.h @@ -0,0 +1,6 @@ +#ifndef MINORCA_H +#define MINORCA_H + +#include "quantum.h" + +#endif diff --git a/keyboards/handwired/minorca/readme.md b/keyboards/handwired/minorca/readme.md new file mode 100644 index 000000000..93c767954 --- /dev/null +++ b/keyboards/handwired/minorca/readme.md @@ -0,0 +1,33 @@ +minorca keyboard firmware +====================== +Handwired 40% keyboard + +http://www.panc.co/blog/minorcasebright-information-page + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. + +### Notable forks (which some of the keymap files are from) +- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) +- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) +- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) +- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) diff --git a/keyboards/minorca/Makefile b/keyboards/minorca/Makefile deleted file mode 100644 index 8cff00049..000000000 --- a/keyboards/minorca/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= yes # 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 -NKRO_ENABLE ?= yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../Makefile -endif \ No newline at end of file diff --git a/keyboards/minorca/config.h b/keyboards/minorca/config.h deleted file mode 100644 index 4cdafcbd2..000000000 --- a/keyboards/minorca/config.h +++ /dev/null @@ -1,80 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 0x6660 -#define DEVICE_VER 0x0001 -#define MANUFACTURER ME -#define PRODUCT MinOrca -#define DESCRIPTION Tiny Whale - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - -/* MinOrca PCB default pin-out */ -#define MATRIX_COL_PINS { D4, D6, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } -#define MATRIX_ROW_PINS { B0, B1, B2, B3 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* 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 DEBOUNCING_DELAY 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)) \ -) - -/* - * 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 - -#endif diff --git a/keyboards/minorca/keymaps/default/Makefile b/keyboards/minorca/keymaps/default/Makefile deleted file mode 100644 index 8dc851fdd..000000000 --- a/keyboards/minorca/keymaps/default/Makefile +++ /dev/null @@ -1,25 +0,0 @@ - - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = yes # 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 -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/minorca/keymaps/default/config.h b/keyboards/minorca/keymaps/default/config.h deleted file mode 100644 index bf40376c1..000000000 --- a/keyboards/minorca/keymaps/default/config.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* bootmagic salt key */ -#define BOOTMAGIC_KEY_SALT KC_ESC - -/* skip bootmagic and eeconfig */ -#define BOOTMAGIC_KEY_SKIP KC_SPACE - -#endif diff --git a/keyboards/minorca/keymaps/default/keymap.c b/keyboards/minorca/keymaps/default/keymap.c deleted file mode 100644 index a55d578e4..000000000 --- a/keyboards/minorca/keymaps/default/keymap.c +++ /dev/null @@ -1,44 +0,0 @@ -// This is the canonical layout file for the Quantum project. If you want to add another keyboard, -// this is the style you want to emulate. - -#include "minorca.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { /* Base */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT }, - {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, KC_SPC, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_DOT, KC_SLSH, KC_NO } - }, - [1] = { /* First */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT }, - {KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX, KC_LGUI }, - {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } - }, - [2] = { /* Second */ - {KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT }, - {KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX, KC_ENT }, - {KC_CAPS, XXXXXXX, KC_LSFT, KC_RSFT, KC_PAUSE,KC_F10, KC_F11, KC_F12, KC_NO, KC_UP, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } - }, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to First overlay - [1] = ACTION_LAYER_MOMENTARY(2), // to Second overlay - -}; \ No newline at end of file diff --git a/keyboards/minorca/keymaps/default/readme.md b/keyboards/minorca/keymaps/default/readme.md deleted file mode 100644 index 6ed31f82b..000000000 --- a/keyboards/minorca/keymaps/default/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# The Default Minorca Layout - -Copied from https://github.com/pancinteractive/qmk_firmware/blob/master/keyboard/minorca_mkV/keymaps/default/keymap.c - -It looks incomplete. \ No newline at end of file diff --git a/keyboards/minorca/keymaps/readme.md b/keyboards/minorca/keymaps/readme.md deleted file mode 100644 index 058923ba2..000000000 --- a/keyboards/minorca/keymaps/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# How to add your own keymap - -Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`: - - _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author] - -\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements - -and contain the following files: - -* `keymap.c` -* `readme.md` *recommended* -* `config.h` *optional*, found automatically when compiling -* `Makefile` *optional*, found automatically when compling - -When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format: - - * **folder_name** description - -# List of Minorca keymaps - -* **default** default Minorca layout -* **rgb** layout with WS2812b control diff --git a/keyboards/minorca/keymaps/rgb/Makefile b/keyboards/minorca/keymaps/rgb/Makefile deleted file mode 100644 index 230f75a62..000000000 --- a/keyboards/minorca/keymaps/rgb/Makefile +++ /dev/null @@ -1,25 +0,0 @@ - - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = yes # 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 -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/minorca/keymaps/rgb/config.h b/keyboards/minorca/keymaps/rgb/config.h deleted file mode 100644 index deaac2e26..000000000 --- a/keyboards/minorca/keymaps/rgb/config.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* bootmagic salt key */ -#define BOOTMAGIC_KEY_SALT KC_ESC - -/* skip bootmagic and eeconfig */ -#define BOOTMAGIC_KEY_SKIP KC_SPACE - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D5 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 13 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - -#endif diff --git a/keyboards/minorca/keymaps/rgb/example.jpg b/keyboards/minorca/keymaps/rgb/example.jpg deleted file mode 100644 index a04c8d37d..000000000 Binary files a/keyboards/minorca/keymaps/rgb/example.jpg and /dev/null differ diff --git a/keyboards/minorca/keymaps/rgb/keymap.c b/keyboards/minorca/keymaps/rgb/keymap.c deleted file mode 100644 index 9002afbb8..000000000 --- a/keyboards/minorca/keymaps/rgb/keymap.c +++ /dev/null @@ -1,65 +0,0 @@ -// This is the canonical layout file for the Quantum project. If you want to add another keyboard, -// this is the style you want to emulate. - -#include "minorca.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// Each layer gets a name for readability, which is then used in the keymap matrix below. -// The underscores don't mean anything - you can have a layer called STUFF or any other name. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _TB 3 - -// Macro name shortcuts -#define QWERTY M(_QWERTY) -#define LOWER M(_LOWER) -#define RAISE M(_RAISE) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[_QWERTY] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {FUNC(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_QUOT}, - {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, FUNC(1)}, - {KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, FUNC(2), XXXXXXX, XXXXXXX, FUNC(3), XXXXXXX, KC_RALT, KC_APP, KC_RCTL} -}, - -[_RAISE] = { - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), XXXXXXX, S(KC_BSLS)}, - {KC_TRNS, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT}, - {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_MNXT, KC_MUTE, KC_MPLY} -}, - -[_LOWER] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, XXXXXXX, KC_BSLS}, - {KC_TRNS, XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT}, - {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_HOME, KC_PGDN, KC_END} -}, - -[_TB] = { /* Tab */ - {KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, KC_TRNS}, - {KC_TRNS, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT}, - {BL_STEP, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT} -} -}; - - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(_TB, KC_TAB), - [1] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), - [2] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), - [3] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), -}; diff --git a/keyboards/minorca/keymaps/rgb/readme.md b/keyboards/minorca/keymaps/rgb/readme.md deleted file mode 100644 index f50dfa546..000000000 --- a/keyboards/minorca/keymaps/rgb/readme.md +++ /dev/null @@ -1,25 +0,0 @@ -#RGB backlight for MinOrca - -![wiring](example.jpg) - -Example of adding WS2812b LEDs to a MinOrca. - -http://www.40percent.club/2016/08/tiny-whale.html - -The keymap is a work in progress. The RGB functions are accessed by holding down the TAB key. - -* Tab + Z Toggle on/off -* Tab + X Mode -* Tab + C Hue+ -* Tab + V Hue- -* Tab + B Saturation+ -* Tab + N Saturation- -* Tab + M Brightness+ -* Tab + , Brightness- - -Example wiring: - -WS2812 data pin is connected to D5 - -![wiring](wiring1.jpg) -![wiring closeup](wiring2.jpg) diff --git a/keyboards/minorca/keymaps/rgb/wiring1.jpg b/keyboards/minorca/keymaps/rgb/wiring1.jpg deleted file mode 100644 index 7dcbe80c5..000000000 Binary files a/keyboards/minorca/keymaps/rgb/wiring1.jpg and /dev/null differ diff --git a/keyboards/minorca/keymaps/rgb/wiring2.jpg b/keyboards/minorca/keymaps/rgb/wiring2.jpg deleted file mode 100644 index fd91d3e1c..000000000 Binary files a/keyboards/minorca/keymaps/rgb/wiring2.jpg and /dev/null differ diff --git a/keyboards/minorca/minorca.c b/keyboards/minorca/minorca.c deleted file mode 100644 index 24e72c2a5..000000000 --- a/keyboards/minorca/minorca.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "minorca.h" - -void matrix_init_kb(void) { - - matrix_init_user(); -} \ No newline at end of file diff --git a/keyboards/minorca/minorca.h b/keyboards/minorca/minorca.h deleted file mode 100644 index 158e5b4c5..000000000 --- a/keyboards/minorca/minorca.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef MINORCA_H -#define MINORCA_H - -#include "quantum.h" - -#endif diff --git a/keyboards/minorca/readme.md b/keyboards/minorca/readme.md deleted file mode 100644 index 93c767954..000000000 --- a/keyboards/minorca/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -minorca keyboard firmware -====================== -Handwired 40% keyboard - -http://www.panc.co/blog/minorcasebright-information-page - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/readme.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default -To build with the default keymap, simply run `make`. - -### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: -``` -$ make KEYMAP=[default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. - -### Notable forks (which some of the keymap files are from) -- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) -- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) -- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) -- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck_grid) -- cgit v1.2.3-24-g4f1b From 055b887b0dd7f64bf7d134df3e13cbe1f2a069c2 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Sun, 14 Aug 2016 20:25:52 -0700 Subject: Setup the bottom-row modifiers to be mac-like in their arrangement. --- keyboards/phantom/keymaps/xyverz/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/phantom/keymaps/xyverz/keymap.c b/keyboards/phantom/keymaps/xyverz/keymap.c index aa6af18b1..4a1522638 100644 --- a/keyboards/phantom/keymaps/xyverz/keymap.c +++ b/keyboards/phantom/keymaps/xyverz/keymap.c @@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN}, {KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, - {KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT} }, [_DV] = { /* Layer 1: Dvorak */ @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN}, {KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, {KC_LSFT, XXXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, - {KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT} }, [_CM] = { /* Layer 2: Colemak */ @@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN}, {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, XXXXXXX, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX}, {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, XXXXXXX, KC_RSFT, XXXXXXX, KC_UP, XXXXXXX}, - {KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, XXXXXXX, KC_RGUI, KC_RALT, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT} }, [_FL] = { /* Layer 3: Functions */ -- cgit v1.2.3-24-g4f1b From 63e5782d2cdf0ee282ad434c773463d9da9db6b3 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 13 Aug 2016 10:43:22 +0200 Subject: process_unicode: Small refactor & linux fix This moves the unicode input start / end sequences into their own functions, so keymaps and other functionality can build on it too. At the same time, it changes how the Linux variant works, to match reality: CTRL+SHIFT must be unregistered too, and we close the thing with a Space instead. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_unicode.c | 76 ++++++++++++++++++------------- quantum/process_keycode/process_unicode.h | 3 ++ 2 files changed, 48 insertions(+), 31 deletions(-) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 3fcac15ce..55e47f179 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -18,40 +18,54 @@ void set_unicode_input_mode(uint8_t os_target) input_mode = os_target; } +void unicode_input_start (void) { + switch(input_mode) { + case UC_OSX: + register_code(KC_LALT); + break; + case UC_LNX: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + break; + case UC_WIN: + register_code(KC_LALT); + register_code(KC_PPLS); + unregister_code(KC_PPLS); + break; + } +} + +void unicode_input_finish (void) { + switch(input_mode) { + case UC_OSX: + case UC_WIN: + unregister_code(KC_LALT); + break; + case UC_LNX: + register_code(KC_SPC); + unregister_code(KC_SPC); + break; + } +} + +void register_hex(uint16_t hex) { + for(int i = 3; i >= 0; i--) { + uint8_t digit = ((hex >> (i*4)) & 0xF); + register_code(hex_to_keycode(digit)); + unregister_code(hex_to_keycode(digit)); + } +} + bool process_unicode(uint16_t keycode, keyrecord_t *record) { if (keycode > QK_UNICODE && record->event.pressed) { uint16_t unicode = keycode & 0x7FFF; - switch(input_mode) { - case UC_OSX: - register_code(KC_LALT); - break; - case UC_LNX: - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_U); - unregister_code(KC_U); - break; - case UC_WIN: - register_code(KC_LALT); - register_code(KC_PPLS); - unregister_code(KC_PPLS); - break; - } - for(int i = 3; i >= 0; i--) { - uint8_t digit = ((unicode >> (i*4)) & 0xF); - register_code(hex_to_keycode(digit)); - unregister_code(hex_to_keycode(digit)); - } - switch(input_mode) { - case UC_OSX: - case UC_WIN: - unregister_code(KC_LALT); - break; - case UC_LNX: - unregister_code(KC_LCTL); - unregister_code(KC_LSFT); - break; - } + unicode_input_start(); + register_hex(unicode); + unicode_input_finish(); } return true; } \ No newline at end of file diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index ca17f8f66..f719a1226 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -9,6 +9,9 @@ #define UC_BSD 3 void set_unicode_input_mode(uint8_t os_target); +void unicode_input_start(void); +void unicode_input_finish(void); +void register_hex(uint16_t hex); bool process_unicode(uint16_t keycode, keyrecord_t *record); -- cgit v1.2.3-24-g4f1b From fa06a163607e8c6c4bd0968c2de96a9a298b777c Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 13 Aug 2016 10:46:38 +0200 Subject: process_unicode: Add a way to enter unicode symbols by name The purpose of this change is to allow keymaps to specify a dictionary of unicode symbol name to code mappings, and let the person at the keyboard enter unicode symbols by name. This is done by having a way to trigger unicode symbol input mode, when all keys are cached until Esc, Enter or Space are pressed. Once that happens, we try to look up the symbol from our lookup table. If found, we erase back, and type the unicode magic in to get that symbol. If not found, we still erase back, start unicode input mode, and replay what the user typed in. Signed-off-by: Gergely Nagy --- Makefile | 7 ++- quantum/process_keycode/process_unicode.c | 93 ++++++++++++++++++++++++++++++- quantum/process_keycode/process_unicode.h | 29 +++++++++- 3 files changed, 126 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 053c8532a..693edc9f0 100644 --- a/Makefile +++ b/Makefile @@ -198,6 +198,11 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes) SRC += $(QUANTUM_DIR)/audio/luts.c endif +ifeq ($(strip $(UCIS_ENABLE)), yes) + OPT_DEFS += -DUCIS_ENABLE + UNICODE_ENABLE = yes +endif + ifeq ($(strip $(UNICODE_ENABLE)), yes) OPT_DEFS += -DUNICODE_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c @@ -273,4 +278,4 @@ BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") OPT_DEFS += -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" $(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(QUANTUM_PATH)/version.h) -$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(QUANTUM_PATH)/version.h) \ No newline at end of file +$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(QUANTUM_PATH)/version.h) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 55e47f179..8a6509300 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -68,4 +68,95 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record) { unicode_input_finish(); } return true; -} \ No newline at end of file +} + +#ifdef UCIS_ENABLE +void qk_ucis_start(void) { + qk_ucis_state.count = 0; + qk_ucis_state.in_progress = true; + + unicode_input_start(); + register_hex(0x2328); + unicode_input_finish(); +} + +static bool is_uni_seq(char *seq) { + uint8_t i; + + for (i = 0; seq[i]; i++) { + uint16_t code; + if (('1' <= seq[i]) && (seq[i] <= '0')) + code = seq[i] - '1' + KC_1; + else + code = seq[i] - 'a' + KC_A; + + if (i > qk_ucis_state.count || qk_ucis_state.codes[i] != code) + return false; + } + + return (qk_ucis_state.codes[i] == KC_ENT || + qk_ucis_state.codes[i] == KC_SPC); +} + +__attribute__((weak)) +void qk_ucis_symbol_fallback (void) { + for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) { + uint8_t code = qk_ucis_state.codes[i]; + register_code(code); + unregister_code(code); + } +} + +bool process_record_ucis (uint16_t keycode, keyrecord_t *record) { + uint8_t i; + + if (!qk_ucis_state.in_progress || !record->event.pressed) + return true; + + qk_ucis_state.codes[qk_ucis_state.count] = keycode; + qk_ucis_state.count++; + + if (keycode == KC_BSPC) { + if (qk_ucis_state.count >= 2) { + qk_ucis_state.count -= 2; + return true; + } else { + qk_ucis_state.count--; + return false; + } + } + + if (keycode == KC_ENT || keycode == KC_SPC || keycode == KC_ESC) { + bool symbol_found = false; + + for (i = qk_ucis_state.count; i > 0; i--) { + register_code (KC_BSPC); + unregister_code (KC_BSPC); + } + + if (keycode == KC_ESC) { + qk_ucis_state.in_progress = false; + return false; + } + + unicode_input_start(); + for (i = 0; ucis_symbol_table[i].symbol; i++) { + if (is_uni_seq (ucis_symbol_table[i].symbol)) { + symbol_found = true; + for (uint8_t j = 0; ucis_symbol_table[i].codes[j]; j++) { + register_hex(ucis_symbol_table[i].codes[j]); + } + break; + } + } + if (!symbol_found) { + qk_ucis_symbol_fallback(); + } + unicode_input_finish(); + + qk_ucis_state.in_progress = false; + return false; + } + return true; +} +#endif diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index f719a1226..372ea2f0d 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -15,6 +15,33 @@ void register_hex(uint16_t hex); bool process_unicode(uint16_t keycode, keyrecord_t *record); +#ifdef UCIS_ENABLE +#ifndef UCIS_MAX_SYMBOL_LENGTH +#define UCIS_MAX_SYMBOL_LENGTH 32 +#endif + +typedef struct { + char *symbol; + uint16_t codes[4]; +} qk_ucis_symbol_t; + +struct { + uint8_t count; + uint16_t codes[UCIS_MAX_SYMBOL_LENGTH]; + bool in_progress:1; +} qk_ucis_state; + +#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, {}}} +#define UCIS_SYM(name, ...) {name, {__VA_ARGS__, 0}} + +extern const qk_ucis_symbol_t ucis_symbol_table[]; + +void qk_ucis_start(void); +void qk_ucis_symbol_fallback (void); +bool process_record_ucis (uint16_t keycode, keyrecord_t *record); + +#endif + #define UC_BSPC UC(0x0008) #define UC_SPC UC(0x0020) @@ -122,4 +149,4 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record); #define UC_TILD UC(0x007E) #define UC_DEL UC(0x007F) -#endif \ No newline at end of file +#endif -- cgit v1.2.3-24-g4f1b From 0b6861827faea747345ea38202d64c8004ab128c Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 13 Aug 2016 11:11:22 +0200 Subject: process_unicode: Handle too long UCIS symbol names If the symbol name being entered is longer than the max, stop recording it, and stop processing keycodes apart from the ones that can delete, finish or cancel the sequence. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_unicode.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 8a6509300..851a96eaa 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -110,7 +110,15 @@ void qk_ucis_symbol_fallback (void) { bool process_record_ucis (uint16_t keycode, keyrecord_t *record) { uint8_t i; - if (!qk_ucis_state.in_progress || !record->event.pressed) + if (!qk_ucis_state.in_progress) + return true; + + if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH && + !(keycode == KC_BSPC || keycode == KC_ESC || keycode == KC_SPC || keycode == KC_ENT)) { + return false; + } + + if (!record->event.pressed) return true; qk_ucis_state.codes[qk_ucis_state.count] = keycode; -- cgit v1.2.3-24-g4f1b From 857aa5bef6a74f8785a7039feea5286c07bf7067 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 13 Aug 2016 11:14:42 +0200 Subject: process_unicode: Call process_ucis() automatically If UCIS is enabled, call process_ucis() automatically from process_record_quantum(). Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_unicode.c | 2 +- quantum/process_keycode/process_unicode.h | 2 +- quantum/quantum.c | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 851a96eaa..d71434411 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -107,7 +107,7 @@ void qk_ucis_symbol_fallback (void) { } } -bool process_record_ucis (uint16_t keycode, keyrecord_t *record) { +bool process_ucis (uint16_t keycode, keyrecord_t *record) { uint8_t i; if (!qk_ucis_state.in_progress) diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index 372ea2f0d..c5005897e 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -38,7 +38,7 @@ extern const qk_ucis_symbol_t ucis_symbol_table[]; void qk_ucis_start(void); void qk_ucis_symbol_fallback (void); -bool process_record_ucis (uint16_t keycode, keyrecord_t *record); +bool process_ucis (uint16_t keycode, keyrecord_t *record); #endif diff --git a/quantum/quantum.c b/quantum/quantum.c index bc2da510f..a4c5c2ddb 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -86,6 +86,9 @@ bool process_record_quantum(keyrecord_t *record) { #endif #ifdef UNICODE_ENABLE process_unicode(keycode, record) && + #endif + #ifdef UCIS_ENABLE + process_ucis(keycode, record) && #endif true)) { return false; -- cgit v1.2.3-24-g4f1b From 234dd276cf03be6fd6961473e9d9c8f35deec682 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 14 Aug 2016 10:37:51 +0200 Subject: process_unicode: Make the startup overridable Extract out the part of `qk_ucis_start` that inputs the placeholder symbol, and make it weak, so it can be overridden. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_unicode.c | 5 +++++ quantum/process_keycode/process_unicode.h | 1 + 2 files changed, 6 insertions(+) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index d71434411..c474483e7 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -75,6 +75,11 @@ void qk_ucis_start(void) { qk_ucis_state.count = 0; qk_ucis_state.in_progress = true; + qk_ucis_start_user(); +} + +__attribute__((weak)) +void qk_ucis_start_user(void) { unicode_input_start(); register_hex(0x2328); unicode_input_finish(); diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index c5005897e..75607e40e 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -37,6 +37,7 @@ struct { extern const qk_ucis_symbol_t ucis_symbol_table[]; void qk_ucis_start(void); +void qk_ucis_start_user(void); void qk_ucis_symbol_fallback (void); bool process_ucis (uint16_t keycode, keyrecord_t *record); -- cgit v1.2.3-24-g4f1b From a312cbf712764277e0dbbbb99410c2f6fc6c7484 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sun, 14 Aug 2016 14:34:52 +0200 Subject: process_unicode: Use uint32_t for UCIS purposes Use a single uint32_t to store the unicode of a symbol, instead of an array of uint16_ts. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_unicode.c | 12 +++++++++--- quantum/process_keycode/process_unicode.h | 7 ++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index c474483e7..698cc3c02 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -60,6 +60,14 @@ void register_hex(uint16_t hex) { } } +void register_hex32(uint32_t hex) { + for(int i = 7; i >= 0; i--) { + uint8_t digit = ((hex >> (i*8)) & 0xF); + register_code(hex_to_keycode(digit)); + unregister_code(hex_to_keycode(digit)); + } +} + bool process_unicode(uint16_t keycode, keyrecord_t *record) { if (keycode > QK_UNICODE && record->event.pressed) { uint16_t unicode = keycode & 0x7FFF; @@ -156,9 +164,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { for (i = 0; ucis_symbol_table[i].symbol; i++) { if (is_uni_seq (ucis_symbol_table[i].symbol)) { symbol_found = true; - for (uint8_t j = 0; ucis_symbol_table[i].codes[j]; j++) { - register_hex(ucis_symbol_table[i].codes[j]); - } + register_hex32(ucis_symbol_table[i].code); break; } } diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index 75607e40e..dd6dd7138 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -12,6 +12,7 @@ void set_unicode_input_mode(uint8_t os_target); void unicode_input_start(void); void unicode_input_finish(void); void register_hex(uint16_t hex); +void register_hex32(uint32_t hex); bool process_unicode(uint16_t keycode, keyrecord_t *record); @@ -22,7 +23,7 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record); typedef struct { char *symbol; - uint16_t codes[4]; + uint32_t code; } qk_ucis_symbol_t; struct { @@ -31,8 +32,8 @@ struct { bool in_progress:1; } qk_ucis_state; -#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, {}}} -#define UCIS_SYM(name, ...) {name, {__VA_ARGS__, 0}} +#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, 0}} +#define UCIS_SYM(name, code) {name, code} extern const qk_ucis_symbol_t ucis_symbol_table[]; -- cgit v1.2.3-24-g4f1b From 43d08629cf275d0b32281ffe8785258fff226b49 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 15 Aug 2016 10:02:05 +0200 Subject: process_unicode: Replace register_hex32 It turns out that register_hex32 did not work reliably, and some systems only allow 7 chars after the unicode magic sequence, while others allow 8. To remedy the situation, store the codes as strings, and type those in instead of doing bit shifting magic. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_unicode.c | 37 +++++++++++++++++++++++-------- quantum/process_keycode/process_unicode.h | 8 +++---- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index 698cc3c02..d8a0f667c 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -60,14 +60,6 @@ void register_hex(uint16_t hex) { } } -void register_hex32(uint32_t hex) { - for(int i = 7; i >= 0; i--) { - uint8_t digit = ((hex >> (i*8)) & 0xF); - register_code(hex_to_keycode(digit)); - unregister_code(hex_to_keycode(digit)); - } -} - bool process_unicode(uint16_t keycode, keyrecord_t *record) { if (keycode > QK_UNICODE && record->event.pressed) { uint16_t unicode = keycode & 0x7FFF; @@ -120,6 +112,33 @@ void qk_ucis_symbol_fallback (void) { } } +void register_ucis(const char *hex) { + for(int i = 0; hex[i]; i++) { + uint8_t kc = 0; + char c = hex[i]; + + switch (c) { + case '0': + kc = KC_0; + break; + case '1' ... '9': + kc = c - '1' + KC_1; + break; + case 'a' ... 'f': + kc = c - 'a' + KC_A; + break; + case 'A' ... 'F': + kc = c - 'A' + KC_A; + break; + } + + if (kc) { + register_code (kc); + unregister_code (kc); + } + } +} + bool process_ucis (uint16_t keycode, keyrecord_t *record) { uint8_t i; @@ -164,7 +183,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { for (i = 0; ucis_symbol_table[i].symbol; i++) { if (is_uni_seq (ucis_symbol_table[i].symbol)) { symbol_found = true; - register_hex32(ucis_symbol_table[i].code); + register_ucis(ucis_symbol_table[i].code + 2); break; } } diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index dd6dd7138..be24ddc2b 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -12,7 +12,6 @@ void set_unicode_input_mode(uint8_t os_target); void unicode_input_start(void); void unicode_input_finish(void); void register_hex(uint16_t hex); -void register_hex32(uint32_t hex); bool process_unicode(uint16_t keycode, keyrecord_t *record); @@ -23,7 +22,7 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record); typedef struct { char *symbol; - uint32_t code; + char *code; } qk_ucis_symbol_t; struct { @@ -32,14 +31,15 @@ struct { bool in_progress:1; } qk_ucis_state; -#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, 0}} -#define UCIS_SYM(name, code) {name, code} +#define UCIS_TABLE(...) {__VA_ARGS__, {NULL, NULL}} +#define UCIS_SYM(name, code) {name, #code} extern const qk_ucis_symbol_t ucis_symbol_table[]; void qk_ucis_start(void); void qk_ucis_start_user(void); void qk_ucis_symbol_fallback (void); +void register_ucis(const char *hex); bool process_ucis (uint16_t keycode, keyrecord_t *record); #endif -- cgit v1.2.3-24-g4f1b From e8845f0daf8dc7a7674dc5420cc5a684bbbea09b Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 15 Aug 2016 10:07:13 +0200 Subject: process_unicode: Introduce a slight delay When entering unicode codes, use some delay, so the OS has time to process the information. This is not needed on all systems, but some seem to require it. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_unicode.c | 4 ++++ quantum/process_keycode/process_unicode.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index d8a0f667c..72c809c30 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -37,6 +37,7 @@ void unicode_input_start (void) { unregister_code(KC_PPLS); break; } + wait_ms(UNICODE_TYPE_DELAY); } void unicode_input_finish (void) { @@ -109,6 +110,7 @@ void qk_ucis_symbol_fallback (void) { uint8_t code = qk_ucis_state.codes[i]; register_code(code); unregister_code(code); + wait_ms(UNICODE_TYPE_DELAY); } } @@ -135,6 +137,7 @@ void register_ucis(const char *hex) { if (kc) { register_code (kc); unregister_code (kc); + wait_ms (UNICODE_TYPE_DELAY); } } } @@ -172,6 +175,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { for (i = qk_ucis_state.count; i > 0; i--) { register_code (KC_BSPC); unregister_code (KC_BSPC); + wait_ms(UNICODE_TYPE_DELAY); } if (keycode == KC_ESC) { diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index be24ddc2b..85364e8eb 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -8,6 +8,10 @@ #define UC_WIN 2 #define UC_BSD 3 +#ifndef UNICODE_TYPE_DELAY +#define UNICODE_TYPE_DELAY 10 +#endif + void set_unicode_input_mode(uint8_t os_target); void unicode_input_start(void); void unicode_input_finish(void); -- cgit v1.2.3-24-g4f1b From 8e2d69d5a27adfb3ec1e288e8099a408ac72bc84 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 15 Aug 2016 06:28:39 -0700 Subject: Adding u/treasuredfrog's hack to use LT() with the RAISE and LOWER macros. --- keyboards/planck/keymaps/xyverz/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/xyverz/keymap.c b/keyboards/planck/keymaps/xyverz/keymap.c index 90529428d..6d10083fe 100644 --- a/keyboards/planck/keymaps/xyverz/keymap.c +++ b/keyboards/planck/keymaps/xyverz/keymap.c @@ -27,8 +27,8 @@ enum planck_keycodes { COLEMAK, DVORAK, PLOVER, - LOWER, - RAISE, + LOWER = LT(_LOWER, KC_BSPC), + RAISE = LT(_RAISE, KC_ENT), BACKLIT, EXT_PLV }; @@ -89,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT}, {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } }, @@ -225,7 +225,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); } - return false; + //return false; break; case RAISE: if (record->event.pressed) { @@ -235,7 +235,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_RAISE); update_tri_layer(_LOWER, _RAISE, _ADJUST); } - return false; + //return false; break; case BACKLIT: if (record->event.pressed) { @@ -311,4 +311,4 @@ void music_scale_user(void) PLAY_NOTE_ARRAY(music_scale, false, 0); } -#endif \ No newline at end of file +#endif -- cgit v1.2.3-24-g4f1b From 5c5c3e626b7f2e4a5835988c069c7154f347c4ca Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 15 Aug 2016 06:57:24 -0700 Subject: Adding KC_BSPC to the LT() macro for LOWER resulted in a backspace stroke being sent if the LOWER key was used too quickly. Switching back to original LOWER macro, but keeping the new RAISE macro. --- keyboards/planck/keymaps/xyverz/keymap.c | 62 +++-------------------------- keyboards/planck/keymaps/xyverz/makefile.mk | 4 +- 2 files changed, 7 insertions(+), 59 deletions(-) diff --git a/keyboards/planck/keymaps/xyverz/keymap.c b/keyboards/planck/keymaps/xyverz/keymap.c index 6d10083fe..e57746e6a 100644 --- a/keyboards/planck/keymaps/xyverz/keymap.c +++ b/keyboards/planck/keymaps/xyverz/keymap.c @@ -19,18 +19,15 @@ extern keymap_config_t keymap_config; #define _DVORAK 2 #define _LOWER 3 #define _RAISE 4 -#define _PLOVER 5 #define _ADJUST 16 enum planck_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, - PLOVER, - LOWER = LT(_LOWER, KC_BSPC), + LOWER, RAISE = LT(_RAISE, KC_ENT), - BACKLIT, - EXT_PLV + BACKLIT }; // Fillers to make layering more clear @@ -129,30 +126,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {BACKLIT, _______, KC_HOME, KC_END, _______, KC_DEL, KC_INS, _______, KC_PGUP, KC_PGDN, _______, _______} }, -/* Plover layer (http://opensteno.org) - * ,-----------------------------------------------------------------------------------. - * | # | # | # | # | # | # | # | # | # | # | # | # | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | S | T | P | H | * | * | F | P | L | T | D | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Exit | | | A | O | | E | U | | | | - * `-----------------------------------------------------------------------------------' - */ - -[_PLOVER] = { - {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, - {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, - {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} -}, - /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. * | | Reset| | | | | | | | | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | * |------+------+------+------+------+------|------+------+------+------+------+------| * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -161,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = { {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, - {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} } @@ -175,8 +153,6 @@ float tone_startup[][2] = SONG(STARTUP_SOUND); float tone_qwerty[][2] = SONG(QWERTY_SOUND); float tone_dvorak[][2] = SONG(DVORAK_SOUND); float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float tone_plover[][2] = SONG(PLOVER_SOUND); -float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); float tone_goodbye[][2] = SONG(GOODBYE_SOUND); @@ -225,7 +201,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); } - //return false; + return false; break; case RAISE: if (record->event.pressed) { @@ -248,34 +224,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case PLOVER: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_NOTE_ARRAY(tone_plover, false, 0); - #endif - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); - #endif - layer_off(_PLOVER); - } - return false; - break; } return true; } diff --git a/keyboards/planck/keymaps/xyverz/makefile.mk b/keyboards/planck/keymaps/xyverz/makefile.mk index 0f4953888..93a89bb4a 100644 --- a/keyboards/planck/keymaps/xyverz/makefile.mk +++ b/keyboards/planck/keymaps/xyverz/makefile.mk @@ -9,10 +9,10 @@ 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 -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # Audio output on port C6 +AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -- cgit v1.2.3-24-g4f1b From f89aec98aebc3831e4c51acd5990b2025efc7758 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 20:32:45 +0200 Subject: removed my personal stuff --- keyboards/satan/keymaps/iso_split_rshift/.gitignore | 3 +++ keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 keyboards/satan/keymaps/iso_split_rshift/.gitignore delete mode 100755 keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh diff --git a/keyboards/satan/keymaps/iso_split_rshift/.gitignore b/keyboards/satan/keymaps/iso_split_rshift/.gitignore new file mode 100644 index 000000000..4d652661c --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/.gitignore @@ -0,0 +1,3 @@ +updatemerge.sh +clear_flash.hex +resetboard.sh diff --git a/keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh b/keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh deleted file mode 100755 index d17ec76ec..000000000 --- a/keyboards/satan/keymaps/iso_split_rshift/updatemerge.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -git checkout iso_split_rshift # gets you "on branch dmgr2" -git fetch origin # gets you up to date with origin -git merge origin/master -- cgit v1.2.3-24-g4f1b From ca4968bc44c39eb50752a289224568e27fce8281 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 20:46:38 +0200 Subject: readme.md added --- keyboards/satan/keymaps/iso_split_rshift/readme.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 keyboards/satan/keymaps/iso_split_rshift/readme.md diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md new file mode 100644 index 000000000..25ef62b57 --- /dev/null +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -0,0 +1,16 @@ +toneman77's Satan Layout +===================== + +##Quantum MK Firmware +For the full Quantum feature list, see the parent readme.md. + +* heavily modified ISO (!) layout with split right shift key +* spaceFn +* Dual-Role keys: +* Lockable layer for LED functions and numpad +* WS2812 RGB Underglow Support (not needed anymore to solder directly to the atmega) + + +### Additional Credits +Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan) + -- cgit v1.2.3-24-g4f1b From 77f3efbef6cc19ffd1b0b4cd3813285a18031de1 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 20:59:50 +0200 Subject: more information. first steps in markdown --- keyboards/satan/keymaps/iso_split_rshift/readme.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md index 25ef62b57..411dbce32 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/readme.md +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -7,10 +7,24 @@ For the full Quantum feature list, see the parent readme.md. * heavily modified ISO (!) layout with split right shift key * spaceFn * Dual-Role keys: + | Original key | when tapped | when held | + | ---------------- | ------------- | ------------- | + | Space | Space | layer change | + | Caps lock | Escape | Control | + | Tab | Tab | layer change | + | Enter | Enter | Control | * Lockable layer for LED functions and numpad +* vim-style arrow keys on hjkl (spacefn layer) +* corresponding Home/PgDn/PgUp/End on hjkl (tab layer) +* bonus arrow keys in the bottom right corner on Alt/Win/Menu/rCtrl/Shift +* more bonus arrow keys on wasd (spacefn layer) +* media keys prev/next/play/vol+/vol- (spacefn layer) +* formware bootloader button * WS2812 RGB Underglow Support (not needed anymore to solder directly to the atmega) +* additional brackets that only work in german layout due to horrible placement +in the default qwertz layout ### Additional Credits Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan) - +ce visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) -- cgit v1.2.3-24-g4f1b From 5cf5e27dcd908ca538208292491e11cd00e38c57 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 21:02:07 +0200 Subject: Update readme.md attempt to prettify the table --- keyboards/satan/keymaps/iso_split_rshift/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md index 411dbce32..862b44eb1 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/readme.md +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -7,12 +7,14 @@ For the full Quantum feature list, see the parent readme.md. * heavily modified ISO (!) layout with split right shift key * spaceFn * Dual-Role keys: +* | Original key | when tapped | when held | | ---------------- | ------------- | ------------- | | Space | Space | layer change | | Caps lock | Escape | Control | | Tab | Tab | layer change | | Enter | Enter | Control | + * Lockable layer for LED functions and numpad * vim-style arrow keys on hjkl (spacefn layer) * corresponding Home/PgDn/PgUp/End on hjkl (tab layer) -- cgit v1.2.3-24-g4f1b From 14de76ea8079321ab97f0f187d6f598886171540 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 21:02:40 +0200 Subject: Update readme.md typo --- keyboards/satan/keymaps/iso_split_rshift/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md index 862b44eb1..65dd26bbe 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/readme.md +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -29,4 +29,4 @@ in the default qwertz layout ### Additional Credits Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan) -ce visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) +nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) -- cgit v1.2.3-24-g4f1b From 94ff9c9fa54749ebcf6eb06f9c1b27076c7e23b4 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 21:04:11 +0200 Subject: more prettyness --- keyboards/satan/keymaps/iso_split_rshift/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md index 65dd26bbe..53db78188 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/readme.md +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -28,5 +28,5 @@ in the default qwertz layout ### Additional Credits -Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan) -nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) +* Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan) +* nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) -- cgit v1.2.3-24-g4f1b From 396b59f256d8cbf77d359a2b9677f9f7b1d0a021 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 21:12:49 +0200 Subject: readme now with picture --- .../satan/keymaps/iso_split_rshift/LEDpinSatan.jpg | Bin 0 -> 793980 bytes keyboards/satan/keymaps/iso_split_rshift/readme.md | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg diff --git a/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg b/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg new file mode 100644 index 000000000..7616693f9 Binary files /dev/null and b/keyboards/satan/keymaps/iso_split_rshift/LEDpinSatan.jpg differ diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md index 53db78188..c08cddba2 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/readme.md +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -30,3 +30,5 @@ in the default qwertz layout ### Additional Credits * Keymap has been based on TerryMathews' fork of Aqoush's fork of qmk-satan-rgb. [here](https://github.com/TerryMathews/qmk-satan-rgb/tree/master/keyboard/satan) * nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) +* no-need-to-solder-on-chip picture: +![no need to solder directly on the chip anymore](LEDpinSatan.jpg) -- cgit v1.2.3-24-g4f1b From b8cbf7c9c0766b1f51373368bc3644b2c48c598f Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 21:18:25 +0200 Subject: script now waits for the user to press the button --- keyboards/satan/keymaps/iso_split_rshift/build.sh | 28 +++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/build.sh b/keyboards/satan/keymaps/iso_split_rshift/build.sh index 9523f6716..6b4b4568f 100755 --- a/keyboards/satan/keymaps/iso_split_rshift/build.sh +++ b/keyboards/satan/keymaps/iso_split_rshift/build.sh @@ -1,16 +1,40 @@ #!/bin/bash # adjust for cpu # -j 16 gave best result on a hyperthreaded quad core core i7 + +LIMIT=10 THREADS="-j 16" KMAP=iso_split_rshift + echo "We need sudo later" sudo ls 2>&1 /dev/null + +function wait_bootloader { + echo "Waiting for Bootloader..." + local STARTTIME=$(date +"%s") + local REMIND=0 + local EXEC=dfu-programmer + local TARGET=atmega32u4 + while true + do + sudo $EXEC $TARGET get > /dev/null 2>&1 + [ $? -eq 0 ] && break + ENDTIME=$(date +"%s") + DURATION=$(($ENDTIME-$STARTTIME)) + if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ] + then + echo "Did you forget to press the reset button?" + REMIND=1 + fi + sleep 1 + done +} make clean make KEYMAP=${KMAP} ${THREADS} if [[ $? -eq 0 ]] then - echo "please trigger flashing! you have 5 seconds" - sleep 5 + echo "please trigger flashing!" + wait_bootloader sudo make KEYMAP=${KMAP} dfu ${THREADS} else echo "make failed" -- cgit v1.2.3-24-g4f1b From 7e1be3ae7c5b1839ce03fcedcc180e19836d3200 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 21:44:20 +0200 Subject: reference to reddit post and Terry Mathews --- keyboards/satan/keymaps/iso_split_rshift/readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md index c08cddba2..1eec0e13e 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/readme.md +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -32,3 +32,5 @@ in the default qwertz layout * nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) * no-need-to-solder-on-chip picture: ![no need to solder directly on the chip anymore](LEDpinSatan.jpg) +* special thanks to /u/TerryMathews who suggested the pin PB2 so soldering +directly on the atmega is not needed anymore [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/4ghq9z/photos_satan_rgb60_w1976/d2k5tra) -- cgit v1.2.3-24-g4f1b From 68005ce60232c487a6b2ff78925c070881c240b5 Mon Sep 17 00:00:00 2001 From: Toni Date: Mon, 15 Aug 2016 21:47:07 +0200 Subject: grammar --- keyboards/satan/keymaps/iso_split_rshift/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md index 1eec0e13e..116ae9160 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/readme.md +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -33,4 +33,4 @@ in the default qwertz layout * no-need-to-solder-on-chip picture: ![no need to solder directly on the chip anymore](LEDpinSatan.jpg) * special thanks to /u/TerryMathews who suggested the pin PB2 so soldering -directly on the atmega is not needed anymore [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/4ghq9z/photos_satan_rgb60_w1976/d2k5tra) +directly on the atmega is not needed anymore. Happened on [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/4ghq9z/photos_satan_rgb60_w1976/d2k5tra) -- cgit v1.2.3-24-g4f1b From faa3fd48aefb6b9386852b23eb433bafb413755b Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Mon, 15 Aug 2016 22:57:26 +0200 Subject: Minor changes to felix keymap --- keyboards/s60-x/keymaps/felix/Makefile | 8 +++--- keyboards/s60-x/keymaps/felix/config.h | 14 ++++++++++ keyboards/s60-x/keymaps/felix/keymap.c | 49 +++++++++++++++++++++++++--------- 3 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 keyboards/s60-x/keymaps/felix/config.h diff --git a/keyboards/s60-x/keymaps/felix/Makefile b/keyboards/s60-x/keymaps/felix/Makefile index 251e4631d..6a078bcc3 100644 --- a/keyboards/s60-x/keymaps/felix/Makefile +++ b/keyboards/s60-x/keymaps/felix/Makefile @@ -2,12 +2,12 @@ # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) +CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 diff --git a/keyboards/s60-x/keymaps/felix/config.h b/keyboards/s60-x/keymaps/felix/config.h new file mode 100644 index 000000000..6c01d579f --- /dev/null +++ b/keyboards/s60-x/keymaps/felix/config.h @@ -0,0 +1,14 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// keymap needs oneshot functionality +#undef NO_ACTION_ONESHOT + +#undef IS_COMMAND +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/felix/keymap.c b/keyboards/s60-x/keymaps/felix/keymap.c index 9c620527b..6e40d4839 100644 --- a/keyboards/s60-x/keymaps/felix/keymap.c +++ b/keyboards/s60-x/keymaps/felix/keymap.c @@ -20,6 +20,26 @@ along with this program. If not, see . #define _______ KC_TRNS #define XXXXXXX KC_NO +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 1 + +//Special keycodes for better readability +//SpaceFN +//OneShot LeftShift +//GamingMode Lock (disables SpaceFn and OneShot LShift) +//Function +#define KC_SPACEFN KC_FN0 +#define KC_OSLS KC_FN3 +#define KC_GMLK KC_FN1 +#define KC_FUNC KC_FN2 + +enum function_codes { + F_SPACEFN = 0, + F_OSLS = 3, + F_GMLK = 1, + F_FUNC = 2 +}; + enum layer_names { DEFAULT, GAMING, @@ -52,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | * |-----------------------------------------------------------| - * |Shift | Y| X| C| V| B| N| M| ,| .| /| Up |RSft| + * |Shift OS| Y| X| C| V| B| N| M| ,| .| /| Up |RSft| * |-----------------------------------------------------------| * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| * `-----------------------------------------------------------' @@ -61,8 +81,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ - KC_LSFT, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_RSFT, \ - KC_FN2, KC_LGUI, KC_LALT, KC_FN0, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), + KC_OSLS, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_RSFT, \ + KC_FUNC, KC_LGUI, KC_LALT, KC_SPACEFN, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT + ), /* Layout 1: Gaming Layer, SpaceFn disabled * ,-----------------------------------------------------------. @@ -72,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * | | | | | | | | | | | | | | * |-----------------------------------------------------------| - * | | | | | | | | | | | | |Fn1 | + * |SFTnonOS| | | | | | | | | | | |Fn1 | * |-----------------------------------------------------------| * | | NOP| | Space | | | | | * `-----------------------------------------------------------' @@ -81,8 +102,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_FN1, \ - _______, XXXXXXX, _______, KC_SPC, _______, _______, _______, _______), + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GMLK, \ + _______, XXXXXXX, _______, KC_SPC, _______, _______, _______, _______ + ), /* Layout 2: Function Layer * ,-----------------------------------------------------------. @@ -92,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * | | Ä | ß | |Vl-|Mut|Vl+| | | | | |PEnt | * |-----------------------------------------------------------| - * | | | | | |Cal| | | | |Pau |PUp |Fn1 | + * | CpsLck | | | | |Cal| | | | |Pau |PUp |Fn1 | * |-----------------------------------------------------------| * | | | | | |Home|PDn |End | * `-----------------------------------------------------------' @@ -101,17 +123,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, RESET, \ _______, _______, KC_C_WM, KC_C_EM, KC_MPRV, KC_MPLY, KC_MNXT, KC_C_UM, KC_C_IM, KC_C_OM, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ _______, KC_C_AM, KC_C_SM, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, _______, _______, KC_PENT, \ - _______, KC_C_YM, _______, _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_FN1, \ - _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), + KC_CAPS, KC_C_YM, _______, _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_GMLK, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), }; /* * Fn action definition */ const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), /* SpaceFn layout 1 */ - [1] = ACTION_LAYER_TOGGLE(1), /* Disable SpaceFn */ - [2] = ACTION_LAYER_MOMENTARY(2) /* SpaceFn layout 1 */ + [F_SPACEFN] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), // SpaceFn layout 1 + [F_GMLK] = ACTION_LAYER_TOGGLE(1), // Disable SpaceFn and Oneshot Shift + [F_FUNC] = ACTION_LAYER_MOMENTARY(2), // SpaceFn layout 1 + [F_OSLS] = ACTION_MODS_ONESHOT(MOD_LSFT) // Oneshot Leftshift }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) @@ -119,7 +143,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; - void matrix_init_user(void) { } -- cgit v1.2.3-24-g4f1b From f5ed3e5155474e1fefee41374dc8b09ed114a67e Mon Sep 17 00:00:00 2001 From: Matt <7395051@gmail.com> Date: Mon, 15 Aug 2016 17:26:01 -0500 Subject: Added my custom Planck layout called Circuit. * Layout has image and readme, as well as documentation in the code. --- keyboards/planck/keymaps/circuit/Makefile | 25 ++ keyboards/planck/keymaps/circuit/Readme.md | 44 ++++ keyboards/planck/keymaps/circuit/config.h | 91 ++++++++ .../planck/keymaps/circuit/keyboard-layout.png | Bin 0 -> 154368 bytes keyboards/planck/keymaps/circuit/keymap.c | 258 +++++++++++++++++++++ 5 files changed, 418 insertions(+) create mode 100644 keyboards/planck/keymaps/circuit/Makefile create mode 100644 keyboards/planck/keymaps/circuit/Readme.md create mode 100644 keyboards/planck/keymaps/circuit/config.h create mode 100644 keyboards/planck/keymaps/circuit/keyboard-layout.png create mode 100644 keyboards/planck/keymaps/circuit/keymap.c diff --git a/keyboards/planck/keymaps/circuit/Makefile b/keyboards/planck/keymaps/circuit/Makefile new file mode 100644 index 000000000..1ed0ff956 --- /dev/null +++ b/keyboards/planck/keymaps/circuit/Makefile @@ -0,0 +1,25 @@ + +# Build Options +# change to "no" to disable the options, or define them in the makefile.mk in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/circuit/Readme.md b/keyboards/planck/keymaps/circuit/Readme.md new file mode 100644 index 000000000..cbdf5de4e --- /dev/null +++ b/keyboards/planck/keymaps/circuit/Readme.md @@ -0,0 +1,44 @@ +##Design goals: +1. Arrow keys always available. +2. As close to a to my US layout 107-key QWERTY keyboard as I could manage, (i.e. as few arbitrary decisions as possible). +3. Togglable DVORAK keyboard. +4. most frequently used things in the easiest to reach places. +5. Ability to game on it, just for fun. + +My layout differs from most in the placement the ARROW keys, `ESC`, VOL keys, use of double-tap `CAPS`, and the GAME LOCK function. + +I put the layer buttons in the usual spots. I originally wanted only function/symbols layer, but that proved detrimental. I use some timed press actions to save some space, but this has been accounted for, (see GAME LOCK below). I'm not fully satisfied with the current product (see NOTES below), so it may change in the future. + +##Effective layers: +* Default later is obviously your letters and modifiers. +* Lower layer [NUMBER] is your numbers and punctuation. +* Upper layer [ACTION] is your symbols and actions. +* Function layer is the infrequently used function keys, layout toggle, game lock, and reset. + +There is also a toggle for the DVORAK/QWERTY layers, but in normal typing this is not of concern. + +###Special keys: +* `RSHFT` and `ENTER` are combined. Tap once for `ENTER` and hold for `RSHFT`. `ENTER` will be registered on release if released within 200 ms, else `RSHFT` is registered starting at 201 ms until release. +* If for some reason, this interferes with the normal usage of the `ENTER` key in any way, (some problem that may never happen), I have added a regular non-modified `ENTER` key on the same key in the [ACTION] layer. +* `LSHFT` and `CAPS` are also combined. The key works like a normal `LSHFT` unless double-tapped, in which case it counts as `CAPS`. This functionality unfortunately delays all key presses by at most 200 ms, but I have added ways to disable this both temporarily or permanently, described below. +* A failsafe `CAPS` key is on the same key in the [ACTION] layer. +* There are `UNDO`, `CUT`, `COPY`, and `PASTE` keys. This was intended to be a universal way to use these commands since in macOS cut is `⌘ + C` but in Windows it is `⌃ + C`. Unfortunately these special keys only work in Windows. ¯\\\_(ツ)\_/¯ + +##Game lock: +**TL;DR** the game lock toggle disables the double-tap `CAPS`, and disables `GUI` keys (WINDOWS key). + +I wished for this keyboard to be fully usable in the most demanding of games. The most demanding game I know of is ARMA 3 which has a binding to practically every individual key of a 107-key keyboard. This means I need to have pretty much every key possible somewhere. I also wanted the keyboard to be responsive in games for every critical keypress. This means having a way to disable features that introduce an inherent delay to registering keys, such as double-tap. + +I do not expect to see this used by the pros, but I enjoyed making it. As for use in ARMA 3, I got a little ways into the APEX campaign, but I found a few flaws. For Example, I cannot enable my HUD GPS since that requires `RCTRL`+`M` but `RCTRL` is not bound. The obvious fix is to rebind the action to a new key, but I still take this as a shortcoming of my layout. + +###If you wish to disable double-tap +####Disable it temporarily +Turn on the game lock. While on, it registers as normal `LSHFT` and has no delay. Whether in game mode or not, `CAPS` is on the same key in the [ACTION] layer. + +####Disable it permanently +Open the `Makefile` and set `TAP_DANCE_ENABLE = no`. I wrote the layout to compensate for this change, and no further changes to the code should be necessary. Whether or not it's disabled, `CAPS` is on the same key in the [ACTION] layer. + +##Notes: +* `ALT` and `GUI` are reversed compared to the normal US layout. I will also be using my Planck on my mac, and that's the standard in the Apple ecosystem. I may add a special compiler flag in the future to swap the two. +* The DVORAK `Z` key is to the right of the `S` key instead of under it as part of a compromise I made to keep the ARROW keys available on the default layer. I prioritize the ARROW keys, so the DVORAK layout is the one to suffer. +* I also support the little tones that the default Planck layout features, identical to them too, (minus those for layouts I don't support). To enable it, open the `Makefile` and set `AUDIO_ENABLE = yes`. diff --git a/keyboards/planck/keymaps/circuit/config.h b/keyboards/planck/keymaps/circuit/config.h new file mode 100644 index 000000000..22244f4a7 --- /dev/null +++ b/keyboards/planck/keymaps/circuit/config.h @@ -0,0 +1,91 @@ +/* +Copyright 2012 Jun Wako + +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" + +/* Tap-dance interval definition */ +#define TAPPING_TERM 200 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define MANUFACTURER Ortholinear Keyboards +#define PRODUCT The Planck Keyboard +#define DESCRIPTION A compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { D0, D5, B5, B6 } +#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* 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 DEBOUNCING_DELAY 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)) \ +) + +/* + * 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 + +#ifdef SUBPROJECT_rev3 + #include "rev3/config.h" +#endif +#ifdef SUBPROJECT_rev4 + #include "rev4/config.h" +#endif + +#endif diff --git a/keyboards/planck/keymaps/circuit/keyboard-layout.png b/keyboards/planck/keymaps/circuit/keyboard-layout.png new file mode 100644 index 000000000..e9296a6d9 Binary files /dev/null and b/keyboards/planck/keymaps/circuit/keyboard-layout.png differ diff --git a/keyboards/planck/keymaps/circuit/keymap.c b/keyboards/planck/keymaps/circuit/keymap.c new file mode 100644 index 000000000..5096decb9 --- /dev/null +++ b/keyboards/planck/keymaps/circuit/keymap.c @@ -0,0 +1,258 @@ +// Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _DVORAK 1 +#define _LOCKED 2 +#define _NUMBER 3 +#define _ACTION 4 +#define _FUNCTN 5 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + NUMBER, + ACTION +}; + +// Key code names +#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift +#define LOCK FUNC(1) +#define KC_PSTE KC_PASTE +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#ifdef TAP_DANCE_ENABLE +#define SFT_CAP TD(0) // Left shift, double tap for caps +#endif +#ifndef TAP_DANCE_ENABLE +#define SFT_CAP KC_LSFT // Regular left shift +#endif + +// Tap Dance Definitions +#ifdef TAP_DANCE_ENABLE +const qk_tap_dance_action_t tap_dance_actions[] = { + [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; +#endif + +// Function definitions +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [1] = ACTION_LAYER_TOGGLE(_LOCKED) +}; + +// Layout definitions +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | BKSP | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |*Shift| Z | X | C | V | B | N | M | , | . | Up |SftEnt| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | Alt | Cmd | Vol- | ACTN | Space | NUMS | Vol+ | Left | Down | Left | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, + {KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT} +}, + +/* DVORAK + * ,-----------------------------------------------------------------------------------. + * | | ' | , | . | P | Y | F | G | C | R | L | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | A | O | E | U | I | D | H | T | N | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ; | Q | J | K | X | B | M | W | V | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______}, + {_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z }, + {_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* LOCK + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | NULL | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOCKED] = { + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* NUMBERS + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ~ | NULL | NULL | NULL | | | _ | + | { | } | ? | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | ` | NULL | NULL | NULL | \ | - | = | [ | ] | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | NULL | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NUMBER] = { + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {_______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH}, + {_______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______}, + {_______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______} +}, + +/* ACTIONS + * ,-----------------------------------------------------------------------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | Undo | Cut | Copy | Paste| NULL | NULL | NULL | NULL | NULL | PgUp | Enter| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | Mute | | NULL | | NULL | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_ACTION] = { + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT }, + {_______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END } +}, + +/* FUNCTIONS + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | F23 | F24 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | NULL | NULL | NULL | NULL | NULL |QWERTY|DVORAK| NULL | NULL | NULL | NULL | NULL | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Reset| NULL | Lock | NULL | | NULL | | NULL | NULL | NULL | NULL | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTN] = { + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, + {KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 }, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} +} + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + if (IS_LAYER_ON(_DVORAK)) { +#ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); +#endif + layer_off(_DVORAK); + } + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + if (!IS_LAYER_ON(_DVORAK)) { +#ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); +#endif + layer_on(_DVORAK); + } + } + return false; + break; + case NUMBER: + if (record->event.pressed) { + layer_on(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + case ACTION: + if (record->event.pressed) { + layer_on(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { +#ifdef AUDIO_ENABLE + startup_user(); +#endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif -- cgit v1.2.3-24-g4f1b From 5abb05ca402a3ffbce1d4a0a7e3e4eba1ebc9d1b Mon Sep 17 00:00:00 2001 From: premek Date: Tue, 16 Aug 2016 00:44:58 +0200 Subject: premek split layout --- keyboards/planck/keymaps/premek/Makefile | 25 ++++ keyboards/planck/keymaps/premek/keymap.c | 231 ++++++++++++++++++++++++++++++ keyboards/planck/keymaps/premek/readme.md | 2 + 3 files changed, 258 insertions(+) create mode 100644 keyboards/planck/keymaps/premek/Makefile create mode 100644 keyboards/planck/keymaps/premek/keymap.c create mode 100644 keyboards/planck/keymaps/premek/readme.md diff --git a/keyboards/planck/keymaps/premek/Makefile b/keyboards/planck/keymaps/premek/Makefile new file mode 100644 index 000000000..0f4953888 --- /dev/null +++ b/keyboards/planck/keymaps/premek/Makefile @@ -0,0 +1,25 @@ + + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/planck/keymaps/premek/keymap.c b/keyboards/planck/keymaps/premek/keymap.c new file mode 100644 index 000000000..9b212ab25 --- /dev/null +++ b/keyboards/planck/keymaps/premek/keymap.c @@ -0,0 +1,231 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = { + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_DEL, KC_Y, KC_U, KC_I, KC_O, KC_P }, + {KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH}, + {KC_LGUI, _______, _______, KC_LALT, LOWER, KC_SPC, KC_ENT, KC_SPC, RAISE, KC_RALT, _______, KC_RGUI} +}, +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, +[_LOWER] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0}, + {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END }, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_F12, KC_PLUS, KC_PIPE, KC_LCBR, KC_RCBR}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, +[_RAISE] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN}, + {_______, _______, _______, KC_QUOT, KC_MINS, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}, + {_______, KC_TILD, KC_GRV, KC_PLUS, KC_EQL, KC_PIPE, _______, KC_BSLS, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/planck/keymaps/premek/readme.md b/keyboards/planck/keymaps/premek/readme.md new file mode 100644 index 000000000..de9680b49 --- /dev/null +++ b/keyboards/planck/keymaps/premek/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + -- cgit v1.2.3-24-g4f1b From a75d4bd593491ea628a271aaddfc4268a241a68f Mon Sep 17 00:00:00 2001 From: premek Date: Tue, 16 Aug 2016 00:50:35 +0200 Subject: premek split layout --- keyboards/planck/keymaps/premek/readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/planck/keymaps/premek/readme.md b/keyboards/planck/keymaps/premek/readme.md index de9680b49..df6053d6f 100644 --- a/keyboards/planck/keymaps/premek/readme.md +++ b/keyboards/planck/keymaps/premek/readme.md @@ -1,2 +1,3 @@ -# The Default Planck Layout +# Split Layout +Inspired by TECK -- cgit v1.2.3-24-g4f1b From 2ebfdcac404e4898110da40c4d2f86394595246d Mon Sep 17 00:00:00 2001 From: PÅ™emek Vyhnal Date: Tue, 16 Aug 2016 01:07:34 +0200 Subject: Update readme.md --- keyboards/planck/keymaps/premek/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/planck/keymaps/premek/readme.md b/keyboards/planck/keymaps/premek/readme.md index df6053d6f..16debdd63 100644 --- a/keyboards/planck/keymaps/premek/readme.md +++ b/keyboards/planck/keymaps/premek/readme.md @@ -1,3 +1,4 @@ # Split Layout Inspired by TECK +[Layout](http://www.keyboard-layout-editor.com/##@_switchMount=cherry&switchBrand=gateron&switchType=KS-3-Tea&pcb:true%3B&@_c=%23e6e6e6&t=%23757575&a:7&fa@:5%3B%3B&=Esc&_a:4&fa@:5&:0&:0&:0&:0&:0&:0&:0&:0&:5%3B%3B&=%0A%0A!%0A1%0A%0A%0A%0A%0A%0AQ&=%0A%0A%2F@%0A2%0A%0A%0A%0A%0A%0AW&=%0A%0A%23%0A3%0A%0A%0A%0A%0A%0AE&=%0A%0A$%0A4%0A%0A%0A%0A%0A%0AR&=%0A%0A%25%0A5%0A%0A%0A%0A%0A%0AT&_c=%23e3b02d&a:7%3B&=Del&_c=%23e6e6e6&a:4%3B&=%0A%0A%5E%0A6%0A%0A%0A%0A%0A%0AY&=%0A%0A%2F&%0A7%0A%0A%0A%0A%0A%0AU&=%0A%0A*%0A8%0A%0A%0A%0A%0A%0AI&=%0A%0A(%0A9%0A%0A%0A%0A%0A%0AO&=%0A%0A)%0A0%0A%0A%0A%0A%0A%0AP%3B&@_a:7%3B&=Shift&_a:4%3B&=%0A%0A%0AF1%0A%0A%0A%0A%0A%0AA&=%0A%0A%0AF2%0A%0A%0A%0A%0A%0AS&=%0A%0A'%0AF3%0A%0A%0A%0A%0A%0AD&_c=%23e3b02d&n:true%3B&=%0A%0A-%0AF4%0A%0A%0A%0A%0A%0AF&_c=%23e6e6e6%3B&=%0A%0A%0AF5%0A%0A%0A%0A%0A%0AG&_c=%23e3b02d&a:7%3B&=Tab&_c=%23e6e6e6&a:4%3B&=%0A%0A%0AF6%0A%0A%0A%0A%0A%0AH&_c=%23e3b02d&n:true%3B&=%0A%0A%2F&larr%2F%3B%0AHom%0A%0A%0A%0A%0A%0AJ&_c=%23e6e6e6%3B&=%0A%0A%2F&darr%2F%3B%0APgD%0A%0A%0A%0A%0A%0AK&=%0A%0A%2F&uarr%2F%3B%0APgU%0A%0A%0A%0A%0A%0AL&=%0A%0A%2F&rarr%2F%3B%0AEnd%0A%0A%0A%0A%0A%0A%2F%3B%3B&@_a:7%3B&=Ctrl&_a:4%3B&=%0A%0A~%0AF7%0A%0A%0A%0A%0A%0AZ&=%0A%0A%60%0AF8%0A%0A%0A%0A%0A%0AX&=%0A%0A+%0AF9%0A%0A%0A%0A%0A%0AC&=%0A%0A%2F=%0AF10%0A%0A%0A%0A%0A%0AV&=%0A%0A%7C%0AF11%0A%0A%0A%0A%0A%0AB&_c=%23e3b02d&a:7%3B&=BSp&_c=%23e6e6e6&a:4%3B&=%0A%0A%5C%0AF12%0A%0A%0A%0A%0A%0AN&=%0A%0A%5B%0A%0A%0A%0A%0A%0A%0AM&=%0A%0A%5D%0A%0A%0A%0A%0A%0A%0A,&=%0A%0A%7B%0A%0A%0A%0A%0A%0A%0A.&=%0A%0A%7D%0A%0A%0A%0A%0A%0A%0A%2F%2F%3B&@_a:7%3B&=&=&=&=Alt&_c=%23e3b02d%3B&=%2F&dArr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&crarr%2F%3B&_c=%23e6e6e6%3B&=spc&_c=%23e3b02d%3B&=%2F&uArr%2F%3B&_c=%23e6e6e6%3B&=Alt&=&=) -- cgit v1.2.3-24-g4f1b From b1ac91a040a464b595b819417fb1a04c5f9d8926 Mon Sep 17 00:00:00 2001 From: Toni Date: Tue, 16 Aug 2016 16:32:42 +0200 Subject: big cleanup and minor refactoring. thanks iFreilicht. --- keyboards/satan/keymaps/iso_split_rshift/Makefile | 27 +++---- keyboards/satan/keymaps/iso_split_rshift/config.h | 7 +- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 53 +++++++++---- keyboards/satan/keymaps/iso_split_rshift/satan.c | 30 ------- keyboards/satan/keymaps/iso_split_rshift/satan.h | 96 ----------------------- keyboards/satan/satan.h | 27 +++++++ 6 files changed, 77 insertions(+), 163 deletions(-) delete mode 100644 keyboards/satan/keymaps/iso_split_rshift/satan.c delete mode 100644 keyboards/satan/keymaps/iso_split_rshift/satan.h diff --git a/keyboards/satan/keymaps/iso_split_rshift/Makefile b/keyboards/satan/keymaps/iso_split_rshift/Makefile index e25515b69..9187df44c 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/Makefile +++ b/keyboards/satan/keymaps/iso_split_rshift/Makefile @@ -1,18 +1,15 @@ -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE = no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/satan/keymaps/iso_split_rshift/config.h b/keyboards/satan/keymaps/iso_split_rshift/config.h index 39eec4b59..5e79e07f5 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/config.h +++ b/keyboards/satan/keymaps/iso_split_rshift/config.h @@ -20,12 +20,7 @@ along with this program. If not, see . #include "../../config.h" - +// only change #define RGB_DI_PIN B2 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 8 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 #endif diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index 68cc6755e..f04036d10 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -13,8 +13,29 @@ #define _TAB 2 #define _SFX 3 +// dual-role shortcuts +#define TABDUAL LT(_TAB, KC_TAB) +#define CAPSDUAL CTL_T(KC_ESC) +#define SPACEDUAL LT(_SPC, KC_SPACE) +#define ENTERDUAL CTL_T(KC_ENT) +// arrow cluster duality bottom right corner +#define ARRLEFT ALT_T(KC_LEFT) +#define ARRDOWN GUI_T(KC_DOWN) +#define ARRUP SFT_T(KC_UP) +#define ARRRIGHT CTL_T(KC_RIGHT) +// german brackets +#define GER_CUR_L RALT(KC_7) // [ +#define GER_CUR_R RALT(KC_9) // ] +#define GER_PAR_L LSFT(KC_8) // ( +#define GER_PAR_R LSFT(KC_9) // ) +#define GER_ANG_L KC_NUBS // < +#define GER_ANG_R LSFT(KC_NUBS) // > +#define GER_BRC_L RALT(KC_8) // [ +#define GER_BRC_R RALT(KC_9) // ] + // increase readability #define _______ KC_TRNS +#define XXXXXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _DEF: Default Layer @@ -31,11 +52,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' LEFT DWN RIGHT */ [_DEF] = KEYMAP_ISO_SPLITRSHIFT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - LT(_TAB,KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, CTL_T(KC_ENT), \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), SFT_T(KC_UP), \ - KC_LCTL, KC_LGUI, KC_LALT, LT(_SPC,KC_SPACE), KC_RALT, ALT_T(KC_LEFT), GUI_T(KC_DOWN), CTL_T(KC_RIGHT)), + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + TABDUAL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), ARRUP, \ + KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT), /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) * ,-----------------------------------------------------------. @@ -51,11 +72,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_SPC] = KEYMAP_ISO_SPLITRSHIFT( - KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - _______, KC_PAUS, KC_UP, RALT(KC_8), RALT(KC_9), _______, _______, LSFT(KC_8), LSFT(KC_9), _______, _______, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ - _______, _______, _______, _______, KC_NUBS, LSFT(KC_NUBS), KC_SPACE,M(0), _______, _______, _______, _______, _______, KC_VOLU, \ - _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + _______, KC_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ + _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, _______, KC_VOLU, \ + _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) * ,-----------------------------------------------------------. @@ -71,11 +92,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_TAB] = KEYMAP_ISO_SPLITRSHIFT( - KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ - _______, _______, _______, _______, _______, _______, _______, RALT(KC_7), RALT(KC_0), _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ - _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, _______, KC_PGUP, \ - _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), + KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, _______, KC_PGUP, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) * ,-----------------------------------------------------------. @@ -93,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_SFX] = KEYMAP_ISO_SPLITRSHIFT( RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \ _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \ - _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, KC_NO, KC_ENT, \ + _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, _______, KC_UP, \ _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT), }; diff --git a/keyboards/satan/keymaps/iso_split_rshift/satan.c b/keyboards/satan/keymaps/iso_split_rshift/satan.c deleted file mode 100644 index d2c5d5c20..000000000 --- a/keyboards/satan/keymaps/iso_split_rshift/satan.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "satan.h" -#include "led.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - led_init_ports(); -}; - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -}; - -void led_init_ports(void) { - // * Set our LED pins as output - DDRB |= (1<<2); -} - -void led_set_kb(uint8_t usb_led) { - if (usb_led & (1< Date: Tue, 16 Aug 2016 16:35:57 +0200 Subject: minor grammer fixes --- keyboards/satan/keymaps/iso_split_rshift/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/readme.md b/keyboards/satan/keymaps/iso_split_rshift/readme.md index 116ae9160..ec6123d8a 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/readme.md +++ b/keyboards/satan/keymaps/iso_split_rshift/readme.md @@ -21,7 +21,7 @@ For the full Quantum feature list, see the parent readme.md. * bonus arrow keys in the bottom right corner on Alt/Win/Menu/rCtrl/Shift * more bonus arrow keys on wasd (spacefn layer) * media keys prev/next/play/vol+/vol- (spacefn layer) -* formware bootloader button +* firmware bootloader button * WS2812 RGB Underglow Support (not needed anymore to solder directly to the atmega) * additional brackets that only work in german layout due to horrible placement in the default qwertz layout @@ -32,5 +32,5 @@ in the default qwertz layout * nice visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) * no-need-to-solder-on-chip picture: ![no need to solder directly on the chip anymore](LEDpinSatan.jpg) -* special thanks to /u/TerryMathews who suggested the pin PB2 so soldering +* special thanks to /u/TerryMathews who suggested the pin PB2, so soldering directly on the atmega is not needed anymore. Happened on [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/4ghq9z/photos_satan_rgb60_w1976/d2k5tra) -- cgit v1.2.3-24-g4f1b From deedd2f40890807931d45422aab2beef702925c4 Mon Sep 17 00:00:00 2001 From: Toni Date: Tue, 16 Aug 2016 16:44:12 +0200 Subject: in accordance to keymap_makefile_example.mk --- keyboards/satan/keymaps/iso_split_rshift/Makefile | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/Makefile b/keyboards/satan/keymaps/iso_split_rshift/Makefile index 9187df44c..d1e07da3f 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/Makefile +++ b/keyboards/satan/keymaps/iso_split_rshift/Makefile @@ -1,15 +1,15 @@ -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= yes # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID ifndef QUANTUM_DIR include ../../../../Makefile -- cgit v1.2.3-24-g4f1b From 8e142d8cbe8a749878d6b8ee5b6316341f1dfbb6 Mon Sep 17 00:00:00 2001 From: Toni Date: Tue, 16 Aug 2016 17:35:03 +0200 Subject: no more warning thanks to iFreilicht's tip with undef --- keyboards/satan/keymaps/iso_split_rshift/config.h | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/satan/keymaps/iso_split_rshift/config.h b/keyboards/satan/keymaps/iso_split_rshift/config.h index 5e79e07f5..27c1372da 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/config.h +++ b/keyboards/satan/keymaps/iso_split_rshift/config.h @@ -21,6 +21,7 @@ along with this program. If not, see . #include "../../config.h" // only change +#undef RGB_DI_PIN #define RGB_DI_PIN B2 #endif -- cgit v1.2.3-24-g4f1b From d78058cc75a9b05a6885991506d5f807ebb2a9f9 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 17 Aug 2016 10:28:08 +0200 Subject: tap-dance: Include action_tapping.h for TAPPING_TERM Include `action_tapping.h`, so the keymap does not have to define a `TAPPING_TERM` for us, and we can use the default. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_tap_dance.c | 1 + 1 file changed, 1 insertion(+) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 5429e3438..bab5c4dbd 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -1,4 +1,5 @@ #include "quantum.h" +#include "action_tapping.h" static qk_tap_dance_state_t qk_tap_dance_state; bool td_debug_enable = false; -- cgit v1.2.3-24-g4f1b From 29f64d7a93d941167c6c6e95f893ab84586b2205 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 17 Aug 2016 13:04:50 +0200 Subject: tap-dance: Major rework, to make it more reliable This reworks how the tap-dance feature works: instead of one global state, we have a state for each tap-dance key, so we can cancel them when another tap-dance key is in flight. This fixes #527. Since we have a state for each key, we can avoid situation where a keyup would mess with our global state. This fixes #563. And while here, we also make sure to fire events only once, and this fixes #574. There is one breaking change, though: tap-dance debugging support was removed, because dumping the whole state would increase the firmware size too much. Any keymap that made use of this, will have to be updated (but there's no such keymap in the repo). Also, there's a nice trick used in this rework: we need to iterate through tap_dance_actions in a few places, to check for timeouts, and so on. For this, we'd need to know the size of the array. We can't discover that at compile-time, because tap-dance gets compiled separately. We'd like to avoid having to terminate the list with a sentinel value, because that would require updates to all keymaps that use the feature. So, we keep track of the highest tap-dance code seen so far, and iterate until that index. Signed-off-by: Gergely Nagy --- keyboards/ergodox/keymaps/algernon/keymap.c | 2 +- keyboards/preonic/keymaps/kinesis/keymap.c | 2 +- quantum/process_keycode/process_tap_dance.c | 121 ++++++++++++++-------------- quantum/process_keycode/process_tap_dance.h | 9 ++- readme.md | 4 +- 5 files changed, 70 insertions(+), 68 deletions(-) diff --git a/keyboards/ergodox/keymaps/algernon/keymap.c b/keyboards/ergodox/keymaps/algernon/keymap.c index 244bfb51f..144030e2e 100644 --- a/keyboards/ergodox/keymaps/algernon/keymap.c +++ b/keyboards/ergodox/keymaps/algernon/keymap.c @@ -853,7 +853,7 @@ void ang_tap_dance_ta_reset (qk_tap_dance_state_t *state, void *user_data) { td_ta->finished_once = false; } -const qk_tap_dance_action_t tap_dance_actions[] = { +qk_tap_dance_action_t tap_dance_actions[] = { [CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_cln_finished, ang_tap_dance_cln_reset) ,[CT_MNS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ang_tap_dance_mns_finished, ang_tap_dance_mns_reset) ,[CT_TA] = { diff --git a/keyboards/preonic/keymaps/kinesis/keymap.c b/keyboards/preonic/keymaps/kinesis/keymap.c index 1cd6eb993..9691be91d 100644 --- a/keyboards/preonic/keymaps/kinesis/keymap.c +++ b/keyboards/preonic/keymaps/kinesis/keymap.c @@ -123,7 +123,7 @@ void music_scale_user(void) } -const qk_tap_dance_action_t tap_dance_actions[] = { +qk_tap_dance_action_t tap_dance_actions[] = { //Tap once for equal, twice for hyper + X (alfred lock) [TD_EQ_LOCK] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, HYPR(KC_X)), //Tap once for minus, twice for time.heals.nothing diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index bab5c4dbd..e152f2350 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -1,19 +1,8 @@ #include "quantum.h" #include "action_tapping.h" -static qk_tap_dance_state_t qk_tap_dance_state; -bool td_debug_enable = false; - -#if CONSOLE_ENABLE -#define td_debug(s) if (td_debug_enable) \ - { \ - xprintf ("D:tap_dance:%s:%s = { keycode = %d, count = %d, active = %d, pressed = %d }\n", __FUNCTION__, s, \ - qk_tap_dance_state.keycode, qk_tap_dance_state.count, \ - qk_tap_dance_state.active, qk_tap_dance_state.pressed); \ - } -#else -#define td_debug(s) -#endif +static uint16_t last_td; +static int8_t highest_td = -1; void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; @@ -36,98 +25,110 @@ void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data) { } static inline void _process_tap_dance_action_fn (qk_tap_dance_state_t *state, - void *user_data, - qk_tap_dance_user_fn_t fn) + void *user_data, + qk_tap_dance_user_fn_t fn) { if (fn) { fn(state, user_data); } } -static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t action) +static inline void process_tap_dance_action_on_each_tap (qk_tap_dance_action_t *action) { - td_debug("trigger"); - _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_each_tap); + _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_each_tap); } -static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_action_t action) +static inline void process_tap_dance_action_on_dance_finished (qk_tap_dance_action_t *action) { - td_debug("trigger"); - _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_dance_finished); + if (action->state.finished) + return; + action->state.finished = true; + _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_dance_finished); } -static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t action) +static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *action) { - td_debug("trigger") - _process_tap_dance_action_fn (&qk_tap_dance_state, action.user_data, action.fn.on_reset); + _process_tap_dance_action_fn (&action->state, action->user_data, action->fn.on_reset); } bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { - bool r = true; uint16_t idx = keycode - QK_TAP_DANCE; - qk_tap_dance_action_t action; + qk_tap_dance_action_t *action; + + if (last_td && last_td != keycode) { + (&tap_dance_actions[last_td - QK_TAP_DANCE])->state.interrupted = true; + } switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: - action = tap_dance_actions[idx]; - - process_tap_dance_action_on_each_tap (action); - if (qk_tap_dance_state.keycode && qk_tap_dance_state.keycode != keycode) { - process_tap_dance_action_on_dance_finished (action); - } else if (qk_tap_dance_state.active && qk_tap_dance_state.pressed) { - reset_tap_dance (&qk_tap_dance_state); - } else { - r = false; - } + if ((int16_t)idx > highest_td) + highest_td = idx; + action = &tap_dance_actions[idx]; - qk_tap_dance_state.active = true; - qk_tap_dance_state.pressed = record->event.pressed; + action->state.keycode = keycode; + action->state.pressed = record->event.pressed; if (record->event.pressed) { - qk_tap_dance_state.keycode = keycode; - qk_tap_dance_state.timer = timer_read (); - qk_tap_dance_state.count++; + action->state.count++; + action->state.timer = timer_read(); + + if (last_td && last_td != keycode) { + qk_tap_dance_action_t *paction = &tap_dance_actions[last_td - QK_TAP_DANCE]; + paction->state.interrupted = true; + process_tap_dance_action_on_dance_finished (paction); + reset_tap_dance (&paction->state); + } } + last_td = keycode; + break; default: - if (qk_tap_dance_state.keycode) { - // if we are here, the tap dance was interrupted by a different key - idx = qk_tap_dance_state.keycode - QK_TAP_DANCE; - action = tap_dance_actions[idx]; + if (!record->event.pressed) + return true; + + if (highest_td == -1) + return true; - process_tap_dance_action_on_each_tap (action); + for (int i = 0; i <= highest_td; i++) { + action = &tap_dance_actions[i]; + if (action->state.count == 0) + continue; + action->state.interrupted = true; process_tap_dance_action_on_dance_finished (action); - reset_tap_dance (&qk_tap_dance_state); - qk_tap_dance_state.active = false; + reset_tap_dance (&action->state); } break; } - return r; + return true; } void matrix_scan_tap_dance () { - if (qk_tap_dance_state.active && timer_elapsed (qk_tap_dance_state.timer) > TAPPING_TERM) { - // if we are here, the tap dance was timed out - uint16_t idx = qk_tap_dance_state.keycode - QK_TAP_DANCE; - qk_tap_dance_action_t action = tap_dance_actions[idx]; + if (highest_td == -1) + return; + + for (int i = 0; i <= highest_td; i++) { + qk_tap_dance_action_t *action = &tap_dance_actions[i]; - process_tap_dance_action_on_dance_finished (action); - reset_tap_dance (&qk_tap_dance_state); + if (action->state.count && timer_elapsed (action->state.timer) > TAPPING_TERM) { + process_tap_dance_action_on_dance_finished (action); + reset_tap_dance (&action->state); + } } } void reset_tap_dance (qk_tap_dance_state_t *state) { - uint16_t idx = state->keycode - QK_TAP_DANCE; - qk_tap_dance_action_t action; + qk_tap_dance_action_t *action; if (state->pressed) return; - action = tap_dance_actions[idx]; + action = &tap_dance_actions[state->keycode - QK_TAP_DANCE]; + process_tap_dance_action_on_reset (action); - state->keycode = 0; state->count = 0; - state->active = false; + state->interrupted = false; + state->finished = false; + last_td = 0; } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index 6a1258067..d7b857bdc 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -11,8 +11,9 @@ typedef struct uint8_t count; uint16_t keycode; uint16_t timer; - bool active:1; - bool pressed:1; + bool interrupted; + bool pressed; + bool finished; } qk_tap_dance_state_t; #define TD(n) (QK_TAP_DANCE + n) @@ -26,6 +27,7 @@ typedef struct qk_tap_dance_user_fn_t on_dance_finished; qk_tap_dance_user_fn_t on_reset; } fn; + qk_tap_dance_state_t state; void *user_data; } qk_tap_dance_action_t; @@ -48,8 +50,7 @@ typedef struct .fn = { user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_reset } \ } -extern const qk_tap_dance_action_t tap_dance_actions[]; -extern bool td_debug_enable; +extern qk_tap_dance_action_t tap_dance_actions[]; /* To be used internally */ diff --git a/readme.md b/readme.md index e2221e749..8c07a5d1f 100644 --- a/readme.md +++ b/readme.md @@ -431,7 +431,7 @@ enum { }; //Tap Dance Definitions -const qk_tap_dance_action_t tap_dance_actions[] = { +qk_tap_dance_action_t tap_dance_actions[] = { //Tap once for Esc, twice for Caps Lock [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) // Other declarations would go here, separated by commas, if you have them @@ -517,7 +517,7 @@ void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) { ergodox_right_led_3_off(); } -const qk_tap_dance_action_t tap_dance_actions[] = { +qk_tap_dance_action_t tap_dance_actions[] = { [CT_SE] = ACTION_TAP_DANCE_DOUBLE (KC_SPC, KC_ENT) ,[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset) ,[CT_EGG] = ACTION_TAP_DANCE_FN (dance_egg) -- cgit v1.2.3-24-g4f1b From c024de4a879cdab04f0473c29c6e9c4f6f28cbae Mon Sep 17 00:00:00 2001 From: Toni Date: Wed, 17 Aug 2016 15:33:14 +0200 Subject: wring keypress for german iso fixed. prettified --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index f04036d10..bc5bfe2e6 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -14,18 +14,18 @@ #define _SFX 3 // dual-role shortcuts -#define TABDUAL LT(_TAB, KC_TAB) -#define CAPSDUAL CTL_T(KC_ESC) +#define TABDUAL LT(_TAB, KC_TAB) +#define CAPSDUAL CTL_T(KC_ESC) #define SPACEDUAL LT(_SPC, KC_SPACE) #define ENTERDUAL CTL_T(KC_ENT) // arrow cluster duality bottom right corner -#define ARRLEFT ALT_T(KC_LEFT) -#define ARRDOWN GUI_T(KC_DOWN) -#define ARRUP SFT_T(KC_UP) +#define ARRLEFT ALT_T(KC_LEFT) +#define ARRDOWN GUI_T(KC_DOWN) +#define ARRUP SFT_T(KC_UP) #define ARRRIGHT CTL_T(KC_RIGHT) // german brackets #define GER_CUR_L RALT(KC_7) // [ -#define GER_CUR_R RALT(KC_9) // ] +#define GER_CUR_R RALT(KC_0) // ] #define GER_PAR_L LSFT(KC_8) // ( #define GER_PAR_R LSFT(KC_9) // ) #define GER_ANG_L KC_NUBS // < -- cgit v1.2.3-24-g4f1b From e3486caf870b4e4adf915f490e3905d4e24ce2ac Mon Sep 17 00:00:00 2001 From: Xyverz Date: Wed, 17 Aug 2016 14:54:05 -0700 Subject: Create readme.md --- keyboards/ergodox/keymaps/xyverz/readme.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 keyboards/ergodox/keymaps/xyverz/readme.md diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md new file mode 100644 index 000000000..9cb22bde6 --- /dev/null +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -0,0 +1,5 @@ +# PLEASE NOTE + +## This keymap is optomised for the EZ and Original ergodox. + +It will need modification in order to work on the Infinity. -- cgit v1.2.3-24-g4f1b From ef95c10c6659ecc5e23b126d9ac4f3b2d169efb2 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Wed, 17 Aug 2016 14:55:01 -0700 Subject: Update readme.md --- keyboards/ergodox/keymaps/xyverz/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md index 9cb22bde6..22e771b09 100644 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -2,4 +2,4 @@ ## This keymap is optomised for the EZ and Original ergodox. -It will need modification in order to work on the Infinity. +It will need **substantial** modification in order to work on the Infinity. -- cgit v1.2.3-24-g4f1b From 644c8c79271db8cf1bd934b9a80a0215585e46e7 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Thu, 18 Aug 2016 01:34:05 +0200 Subject: Fix the process_record_nocache function This function relies on checking the disable_action_cache static variable before accessing the layer cache. --- quantum/quantum.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index a4c5c2ddb..cb1ba04ff 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -46,18 +46,20 @@ bool process_record_quantum(keyrecord_t *record) { uint16_t keycode; #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) - uint8_t layer; + /* TODO: Use store_or_get_action() or a similar function. */ + if (!disable_action_cache) { + uint8_t layer; - if (record->event.pressed) { - layer = layer_switch_get_layer(key); - update_source_layers_cache(key, layer); - } else { - layer = read_source_layers_cache(key); - } - keycode = keymap_key_to_keycode(layer, key); - #else - keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key); + if (record->event.pressed) { + layer = layer_switch_get_layer(key); + update_source_layers_cache(key, layer); + } else { + layer = read_source_layers_cache(key); + } + keycode = keymap_key_to_keycode(layer, key); + } else #endif + keycode = keymap_key_to_keycode(layer_switch_get_layer(key), key); // This is how you use actions here // if (keycode == KC_LEAD) { -- cgit v1.2.3-24-g4f1b From 39e8e61258b51a2c33a94dd877e983f0b1dae0c1 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Thu, 18 Aug 2016 01:37:13 +0200 Subject: Implement the dynamic macros that are recorded in runtime --- quantum/dynamic_macro.h | 226 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 226 insertions(+) create mode 100644 quantum/dynamic_macro.h diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h new file mode 100644 index 000000000..a3ad61bc7 --- /dev/null +++ b/quantum/dynamic_macro.h @@ -0,0 +1,226 @@ +/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */ +#ifndef DYNAMIC_MACROS_H +#define DYNAMIC_MACROS_H + +#include "action_layer.h" + +#ifndef DYNAMIC_MACRO_SIZE +/* May be overridden with a custom value. Be aware that the effective + * macro length is half of this value: each keypress is recorded twice + * because of the down-event and up-event. This is not a bug, it's the + * intended behavior. */ +#define DYNAMIC_MACRO_SIZE 256 +#endif + +/* DYNAMIC_MACRO_RANGE must be set as the last element of user's + * "planck_keycodes" enum prior to including this header. This allows + * us to 'extend' it. + */ +enum dynamic_macro_keycodes { + DYN_REC_START1 = DYNAMIC_MACRO_RANGE, + DYN_REC_START2, + DYN_MACRO_PLAY1, + DYN_MACRO_PLAY2, +}; + +/* Blink the LEDs to notify the user about some event. */ +void dynamic_macro_led_blink(void) +{ + backlight_toggle(); + _delay_ms(100); + backlight_toggle(); +} + +/** + * Start recording of the dynamic macro. + * + * @param[out] macro_pointer The new macro buffer iterator. + * @param[in] macro_buffer The macro buffer used to initialize macro_pointer. + */ +void dynamic_macro_record_start( + keyrecord_t **macro_pointer, keyrecord_t *macro_buffer) +{ + dynamic_macro_led_blink(); + + clear_keyboard(); + layer_clear(); + *macro_pointer = macro_buffer; +} + +/** + * Play the dynamic macro. + * + * @param macro_buffer[in] The beginning of the macro buffer being played. + * @param macro_end[in] The element after the last macro buffer element. + * @param direction[in] Either +1 or -1, which way to iterate the buffer. + */ +void dynamic_macro_play( + keyrecord_t *macro_buffer, keyrecord_t *macro_end, int8_t direction) +{ + uint32_t saved_layer_state = layer_state; + + clear_keyboard(); + layer_clear(); + + while (macro_buffer != macro_end) { + process_record(macro_buffer); + macro_buffer += direction; + } + + clear_keyboard(); + + layer_state = saved_layer_state; +} + +/** + * Record a single key in a dynamic macro. + * + * @param macro_pointer[in,out] The current buffer position. + * @param macro_end2[in] The end of the other macro which shouldn't be overwritten. + * @param direction[in] Either +1 or -1, which way to iterate the buffer. + * @param record[in] The current keypress. + */ +void dynamic_macro_record_key( + keyrecord_t **macro_pointer, + keyrecord_t *macro_end2, + int8_t direction, + keyrecord_t *record) +{ + if (*macro_pointer + direction != macro_end2) { + **macro_pointer = *record; + *macro_pointer += direction; + } else { + /* Notify about the end of buffer. The blinks are paired + * because they should happen on both down and up events. */ + backlight_toggle(); + } +} + +/** + * End recording of the dynamic macro. Essentially just update the + * pointer to the end of the macro. + */ +void dynamic_macro_record_end(keyrecord_t *macro_pointer, keyrecord_t **macro_end) +{ + dynamic_macro_led_blink(); + + *macro_end = macro_pointer; +} + +/* Handle the key events related to the dynamic macros. Should be + * called from process_record_user() like this: + * + * bool process_record_user(uint16_t keycode, keyrecord_t *record) { + * if (!process_record_dynamic_macro(keycode, record)) { + * return false; + * } + * <...THE REST OF THE FUNCTION...> + * } + */ +bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record) +{ + /* Both macros use the same buffer but read/write on different + * ends of it. + * + * Macro1 is written left-to-right starting from the beginning of + * the buffer. + * + * Macro2 is written right-to-left starting from the end of the + * buffer. + * + * ¯o_buffer macro_end + * v v + * +------------------------------------------------------------+ + * |>>>>>> MACRO1 >>>>>>| |<<<<<<<<<<<<< MACRO2 <<<<<<<<<<<<<| + * +------------------------------------------------------------+ + * ^ ^ + * r_macro_end r_macro_buffer + * + * During the recording when one macro encounters the end of the + * other macro, the recording is stopped. Apart from this, there + * are no arbitrary limits for the macros' length in relation to + * each other: for example one can either have two medium sized + * macros or one long macro and one short macro. Or even one empty + * and one using the whole buffer. + */ + static keyrecord_t macro_buffer[DYNAMIC_MACRO_SIZE]; + + /* Pointer to the first buffer element after the first macro. + * Initially points to the very beginning of the buffer since the + * macro is empty. */ + static keyrecord_t *macro_end = macro_buffer; + + /* The other end of the macro buffer. Serves as the beginning of + * the second macro. */ + static keyrecord_t *const r_macro_buffer = macro_buffer + DYNAMIC_MACRO_SIZE - 1; + + /* Like macro_end but for the second macro. */ + static keyrecord_t *r_macro_end = r_macro_buffer; + + /* A persistent pointer to the current macro position (iterator) + * used during the recording. */ + static keyrecord_t *macro_pointer = NULL; + + /* 0 - no macro is being recorded right now + * 1,2 - either macro 1 or 2 is being recorded */ + static uint8_t macro_id = 0; + + if (macro_id == 0) { + /* No macro recording in progress. */ + if (!record->event.pressed) { + switch (keycode) { + case DYN_REC_START1: + dynamic_macro_record_start(¯o_pointer, macro_buffer); + macro_id = 1; + return false; + case DYN_REC_START2: + dynamic_macro_record_start(¯o_pointer, r_macro_buffer); + macro_id = 2; + return false; + case DYN_MACRO_PLAY1: + dynamic_macro_play(macro_buffer, macro_end, +1); + return false; + case DYN_MACRO_PLAY2: + dynamic_macro_play(r_macro_buffer, r_macro_end, -1); + return false; + } + } + } else { + /* A macro is being recorded right now. */ + switch (keycode) { + case MO(_DYN): + /* Use the layer key used to access the macro recording as + * a stop button. */ + if (record->event.pressed) { /* Ignore the initial release + * just after the recoding + * starts. */ + switch (macro_id) { + case 1: + dynamic_macro_record_end(macro_pointer, ¯o_end); + break; + case 2: + dynamic_macro_record_end(macro_pointer, &r_macro_end); + break; + } + macro_id = 0; + } + return false; + default: + /* Store the key in the macro buffer and process it normally. */ + switch (macro_id) { + case 1: + dynamic_macro_record_key(¯o_pointer, r_macro_end, +1, record); + break; + case 2: + dynamic_macro_record_key(¯o_pointer, macro_end, -1, record); + break; + } + return true; + break; + } + } + + return true; +} + +#endif -- cgit v1.2.3-24-g4f1b From 950755edaf766a420376f8d11ac47ab087e7fa99 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Thu, 18 Aug 2016 01:40:54 +0200 Subject: Add the dynamic macros documentation to the readme --- readme.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/readme.md b/readme.md index e2221e749..5252de5df 100644 --- a/readme.md +++ b/readme.md @@ -695,6 +695,49 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) And then, to assign this macro to a key on your keyboard layout, you just use `M(0)` on the key you want to press for copy/paste. +## Dynamic macros: record and replay macros in runtime + +In addition to the static macros described above, you may enable the dynamic macros which you may record while writing. They are forgotten as soon as the keyboard is unplugged. Only two such macros may be stored at the same time, with the total length of 128 keypresses. + +To enable them, first add a new element to the `planck_keycodes` enum -- `DYNAMIC_MACRO_RANGE`: + + enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + DYNAMIC_MACRO_RANGE, + }; + +Afterwards create a new layer called `_DYN`: + + #define _DYN 6 /* almost any other free number should be ok */ + +Below these two modifications include the `dynamic_macro.h` header: + + #include "dynamic_macro.h"` + +Then define the `_DYN` layer with the following keys: `DYN_REC_START1`, `DYN_REC_PLAY1`,`DYN_REC_START2` and `DYN_REC_PLAY2`. It may also contain other keys, it doesn't matter apart from the fact that you won't be able to record these keys in the dynamic macros. + + [_DYN]= { + {_______, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + }, + +Add the following code to the very beginning of your `process_record_user()` function: + + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + +The usage should be pretty self-explanatory. For the details, please read the comments in the `dynamic_macro.h` header. + ## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) Everything is assuming you're in Qwerty (in software) by default, but there is built-in support for using a Colemak or Dvorak layout by including this at the top of your keymap: -- cgit v1.2.3-24-g4f1b From 47beb763e824341c82ad2f9e23b57ecbd4e38308 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 18 Aug 2016 00:05:24 -0700 Subject: Returned RAISE and LOWER buttons to their original functions - too many inopportune ENTER inputs. :-( --- keyboards/planck/keymaps/xyverz/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/planck/keymaps/xyverz/keymap.c b/keyboards/planck/keymaps/xyverz/keymap.c index e57746e6a..192933b18 100644 --- a/keyboards/planck/keymaps/xyverz/keymap.c +++ b/keyboards/planck/keymaps/xyverz/keymap.c @@ -26,7 +26,7 @@ enum planck_keycodes { COLEMAK, DVORAK, LOWER, - RAISE = LT(_RAISE, KC_ENT), + RAISE, BACKLIT }; @@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DVORAK] = { {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH}, {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)}, {KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_UP, KC_DOWN, KC_RGUI, KC_ENT } }, @@ -211,7 +211,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_RAISE); update_tri_layer(_LOWER, _RAISE, _ADJUST); } - //return false; + return false; break; case BACKLIT: if (record->event.pressed) { -- cgit v1.2.3-24-g4f1b From 035290b7d84e1f2c4d473d585b66e1dde9b3bdee Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 18 Aug 2016 00:22:56 -0700 Subject: Added a readme, tidied up comments in the keymap. --- keyboards/ergodox/keymaps/xyverz/keymap.c | 53 ++++++------- keyboards/ergodox/keymaps/xyverz/readme.md | 123 ++++++++++++++++++++++++++++- 2 files changed, 147 insertions(+), 29 deletions(-) diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c index c5ce99dd2..7a16367bf 100644 --- a/keyboards/ergodox/keymaps/xyverz/keymap.c +++ b/keyboards/ergodox/keymaps/xyverz/keymap.c @@ -1,4 +1,10 @@ /* + * PLEASE NOTE: This keymap will NOT work with the Infinity ErgoDox due to the fact that the mappings are + * based on the Matrix Layout in the ez.h file. If you want to use this for the infinity, you'll need to + * figure out where the keys are in the matrix and redo the layout arrays below. + * + * About this keymap: + * * The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak * software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner * keys. I've decided to continue using this layout with my ErgoDox. @@ -33,8 +39,9 @@ extern keymap_config_t keymap_config; #define COLEMAK M(_CM) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Keymap 0: Dvorak layer - * + +[_DV] = { // layer 0 : Dvorak +/* * ,--------------------------------------------------. ,--------------------------------------------------. * | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| @@ -55,9 +62,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' * */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[_DV] = { // layer 0 : Dvorak // left hand {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, KC_NO }, {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV, KC_END }, @@ -77,8 +81,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI, KC_NO } }, -/* Keymap 1: QWERTY layer - * + +[_QW] = { // layer 1 : QWERTY +/* * ,--------------------------------------------------. ,--------------------------------------------------. * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| @@ -98,9 +103,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | End | | PgDn | | | * `--------------------' `--------------------' */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[_QW] = { // layer 1 : QWERTY // left hand {KC_EQL, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, KC_NO }, {KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END }, @@ -120,8 +122,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, KC_NO } }, -/* Keymap 2: Colemak layer - * + +[_CM] = { // layer 2 : Colemak +/* * ,--------------------------------------------------. ,--------------------------------------------------. * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| @@ -141,9 +144,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | End | | PgDn | | | * `--------------------' `--------------------' */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[_CM] = { // layer 2 : Colemak // left hand {KC_EQL, KC_TAB, KC_BSPC, KC_LSFT, KC_LGUI, KC_NO }, {KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END }, @@ -163,15 +163,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, KC_NO } }, -/* Keymap 3: Symbol Layer - * + +[_MD] = { // layer 3 : Media layer +/* * ,--------------------------------------------------. ,--------------------------------------------------. * | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | PrSc | ScLk | Paus | | FN4 | | FN5 | | Mute | Vol- | Vol+ | | | + * | | | PrSc | ScLk | Paus | | | | | | Mute | Vol- | Vol+ | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | - * |--------+------+------+------+------+------| FN4 | | FN5 |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | |Dvorak|Qwerty|Colemk| | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | | | | | | @@ -184,8 +185,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ -// Media Layer -[_MD] = { // layer 3 : Media layer // left hand {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO }, {KC_F1, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, @@ -205,15 +204,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO } }, -/* Keymap 4: Keypad layer - * + +[_KP] = { // layer 4 : Keypad layer +/* * ,--------------------------------------------------. ,--------------------------------------------------. * | Power | | | | | | | | | | NmLk | KP / | KP * | KP - | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Sleep | | | | | | FN5 | | FN4 | | KP 7 | KP 8 | KP 9 | KP + | | + * | Sleep | | | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | - * |--------+------+------+------+------+------| FN5 | | FN4 |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | | | | | | | KP 0 | | KP . |KP Ent| | @@ -226,8 +226,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ -// Keypad Layer -[_KP] = { // layer 4 : Keypad layer // left hand {KC_PWR, KC_SLEP, KC_WAKE, KC_TRNS, KC_TRNS, KC_NO }, {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, @@ -247,6 +245,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO } }, + }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md index 22e771b09..42ae8fe53 100644 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -1,5 +1,124 @@ -# PLEASE NOTE +# Xyverz's ErgoDox EZ Keymap -## This keymap is optomised for the EZ and Original ergodox. +## Please Note: It will need **substantial** modification in order to work on the Infinity. + +PLEASE NOTE: This keymap will NOT work with the Infinity ErgoDox due to the fact that the mappings are based on the Matrix Layout in the ez.h file. If you want to use this for the infinity, you'll need to figure out where the keys are in the matrix and redo the layout arrays below. + +## About this keymap: + +The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. I've decided to continue using this layout with my ErgoDox. + +The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, with the additional keys as shown in the diagrams. The Colemak layout is merely an adaptation of that. + +I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts. + +For a better explanation of the layout matrices shown below, take a look at ../../ez/ez.h where the keymap is defined, beginning on line 81. + +### Layer 0: Dvorak layer + +,--------------------------------------------------. ,--------------------------------------------------. +| ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | ' | , | . | Y | Y | | | | F | G | C | R | L | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | +|--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| +| LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | LCtr | LAlt | | Ralt | RCtr | + ,------|------|------| |------+------+------. + | | | Home | | PgUp | | | + | BkSp | Del |------| |------| Enter| Space| + | | | End | | PgDn | | | + `--------------------' `--------------------' + +### Layer 1: QWERTY layer + +,--------------------------------------------------. ,--------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | +|--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| +| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | LCtr | LAlt | | Ralt | RCtr | + ,------|------|------| |------+------+------. + | | | Home | | PgUp | | | + | BkSp | Del |------| |------| Enter| Space| + | | | End | | PgDn | | | + `--------------------' `--------------------' + +### Keymap 2: Colemak layer + +,--------------------------------------------------. ,--------------------------------------------------. +| = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | +|--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| +| LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | LCtr | LAlt | | Ralt | RCtr | + ,------|------|------| |------+------+------. + | | | Home | | PgUp | | | + | BkSp | Del |------| |------| Enter| Space| + | | | End | | PgDn | | | + `--------------------' `--------------------' + +### layer 3 : Media layer + +,--------------------------------------------------. ,--------------------------------------------------. +| TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| | | PrSc | ScLk | Paus | | | | | | Mute | Vol- | Vol+ | | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | |Dvorak|Qwerty|Colemk| | | | | | | | | | | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' + + + +### Keymap 4: Keypad layer + +,--------------------------------------------------. ,--------------------------------------------------. +| Power | | | | | | | | | | NmLk | KP / | KP| KP - | | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Sleep | | | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | +|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | KP 0 | | KP . |KP Ent| | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' -- cgit v1.2.3-24-g4f1b From 4dd641a128aa93f9decec3387b7c34a01007eb4a Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 18 Aug 2016 00:27:54 -0700 Subject: Hopefully this fixes the layout diagrams. --- keyboards/ergodox/keymaps/xyverz/readme.md | 182 ++++++++++++++--------------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md index 42ae8fe53..8bcf5b303 100644 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -18,107 +18,107 @@ For a better explanation of the layout matrices shown below, take a look at ../. ### Layer 0: Dvorak layer -,--------------------------------------------------. ,--------------------------------------------------. -| ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Tab | ' | , | . | Y | Y | | | | F | G | C | R | L | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | -|--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| -| LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCtr | LAlt | | Ralt | RCtr | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' + ,--------------------------------------------------. ,--------------------------------------------------. + | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Tab | ' | , | . | Y | Y | | | | F | G | C | R | L | \ | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | + |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | LCtr | LAlt | | Ralt | RCtr | + ,------|------|------| |------+------+------. + | | | Home | | PgUp | | | + | BkSp | Del |------| |------| Enter| Space| + | | | End | | PgDn | | | + `--------------------' `--------------------' ### Layer 1: QWERTY layer -,--------------------------------------------------. ,--------------------------------------------------. -| = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | -|--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| -| LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCtr | LAlt | | Ralt | RCtr | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' - + ,--------------------------------------------------. ,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | LCtr | LAlt | | Ralt | RCtr | + ,------|------|------| |------+------+------. + | | | Home | | PgUp | | | + | BkSp | Del |------| |------| Enter| Space| + | | | End | | PgDn | | | + `--------------------' `--------------------' + ### Keymap 2: Colemak layer -,--------------------------------------------------. ,--------------------------------------------------. -| = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | -|--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| -| LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCtr | LAlt | | Ralt | RCtr | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' + ,--------------------------------------------------. ,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | + |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | LCtr | LAlt | | Ralt | RCtr | + ,------|------|------| |------+------+------. + | | | Home | | PgUp | | | + | BkSp | Del |------| |------| Enter| Space| + | | | End | | PgDn | | | + `--------------------' `--------------------' ### layer 3 : Media layer -,--------------------------------------------------. ,--------------------------------------------------. -| TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| | | PrSc | ScLk | Paus | | | | | | Mute | Vol- | Vol+ | | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | |Dvorak|Qwerty|Colemk| | | | | | | | | | | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' + ,--------------------------------------------------. ,--------------------------------------------------. + | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | | | PrSc | ScLk | Paus | | | | | | Mute | Vol- | Vol+ | | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | |Dvorak|Qwerty|Colemk| | | | | | | | | | | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' ### Keymap 4: Keypad layer -,--------------------------------------------------. ,--------------------------------------------------. -| Power | | | | | | | | | | NmLk | KP / | KP| KP - | | -|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| -| Sleep | | | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | -|--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | -`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | KP 0 | | KP . |KP Ent| | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' + ,--------------------------------------------------. ,--------------------------------------------------. + | Power | | | | | | | | | | NmLk | KP / | KP| KP - | | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Sleep | | | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | KP 0 | | KP . |KP Ent| | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' -- cgit v1.2.3-24-g4f1b From 118ad691c46454df8d8aa810190cfa4e21f8952b Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 18 Aug 2016 00:34:22 -0700 Subject: more formatting changes --- keyboards/ergodox/keymaps/xyverz/readme.md | 180 ++++++++++++++--------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md index 8bcf5b303..32e569b38 100644 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -18,107 +18,107 @@ For a better explanation of the layout matrices shown below, take a look at ../. ### Layer 0: Dvorak layer - ,--------------------------------------------------. ,--------------------------------------------------. - | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | ' | , | . | Y | Y | | | | F | G | C | R | L | \ | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | - |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| - | LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCtr | LAlt | | Ralt | RCtr | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' + ,--------------------------------------------------.,--------------------------------------------------. + | ] | 1 | 2 | 3 | 4 | 5 | ESC || ESC | 6 | 7 | 8 | 9 | 0 | [ | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | Tab | ' | , | . | Y | Y | || | F | G | C | R | L | \ | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | CapsLk | A | O | E | U | I |------||------| D | H | T | N | S | - | + |--------+------+------+------+------+------| _MD || _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | X | || | B | M | W | V | Z | RShift | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | LCtr | LAlt || Ralt | RCtr | + ,------|------|------||------+------+------. + | | | Home || PgUp | | | + | BkSp | Del |------||------| Enter| Space| + | | | End || PgDn | | | + `--------------------'`--------------------' ### Layer 1: QWERTY layer - ,--------------------------------------------------. ,--------------------------------------------------. - | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| - | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCtr | LAlt | | Ralt | RCtr | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' + ,--------------------------------------------------.,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | ESC || ESC | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | || | Y | U | I | O | P | \ | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | CapsLk | A | S | D | F | G |------||------| H | J | K | L | ; | ' | + |--------+------+------+------+------+------| _MD || _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | || | N | M | , | . | / | RShift | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | LCtr | LAlt || Ralt | RCtr | + ,------|------|------||------+------+------. + | | | Home || PgUp | | | + | BkSp | Del |------||------| Enter| Space| + | | | End || PgDn | | | + `--------------------'`--------------------' ### Keymap 2: Colemak layer - ,--------------------------------------------------. ,--------------------------------------------------. - | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| - | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | LCtr | LAlt | | Ralt | RCtr | - ,------|------|------| |------+------+------. - | | | Home | | PgUp | | | - | BkSp | Del |------| |------| Enter| Space| - | | | End | | PgDn | | | - `--------------------' `--------------------' + ,--------------------------------------------------.,--------------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | ESC || ESC | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | Tab | Q | W | F | P | G | || | J | L | U | Y | ; | \ | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | BkSpc | A | R | S | T | D |------||------| H | N | E | I | O | ' | + |--------+------+------+------+------+------| _MD || _KP |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | || | K | M | , | . | / | RShift | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | LCtr | LAlt || Ralt | RCtr | + ,------|------|------||------+------+------. + | | | Home || PgUp | | | + | BkSp | Del |------||------| Enter| Space| + | | | End || PgDn | | | + `--------------------'`--------------------' ### layer 3 : Media layer - ,--------------------------------------------------. ,--------------------------------------------------. - | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | | | PrSc | ScLk | Paus | | | | | | Mute | Vol- | Vol+ | | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | |Dvorak|Qwerty|Colemk| | | | | | | | | | | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | | | | | | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' + ,--------------------------------------------------.,--------------------------------------------------. + | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 || F12 | F6 | F7 | F8 | F9 | F10 | | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | | | PrSc | ScLk | Paus | | || | | Mute | Vol- | Vol+ | | | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | | | | | | |------||------| Stop | Prev | Play | Next | Sel | | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | | |Dvorak|Qwerty|Colemk| | || | | | | | | | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | | || | | + ,------|------|------||------+------+------. + | | | || | | | + | | |------||------| | | + | | | || | | | + `--------------------'`--------------------' ### Keymap 4: Keypad layer - ,--------------------------------------------------. ,--------------------------------------------------. - | Power | | | | | | | | | | NmLk | KP / | KP| KP - | | - |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - | Sleep | | | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | - |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | - `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - | | | | | | | KP 0 | | KP . |KP Ent| | - `----------------------------------' `----------------------------------' - ,-------------. ,-------------. - | | | | | | - ,------|------|------| |------+------+------. - | | | | | | | | - | | |------| |------| | | - | | | | | | | | - `--------------------' `--------------------' + ,--------------------------------------------------.,--------------------------------------------------. + | Power | | | | | | || | | NmLk | KP / | KP| KP - | | + |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| + | Sleep | | | | | | || | | KP 7 | KP 8 | KP 9 | KP + | | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | Wake | | | | | |------||------| | KP 4 | KP 5 | KP 6 | KP + | | + |--------+------+------+------+------+------| || |------+------+------+------+------+--------| + | | | | | | | || | | KP 1 | KP 2 | KP 3 |KP Ent| | + `--------+------+------+------+------+-------------'`-------------+------+------+------+------+--------' + | | | | | | | KP 0 | | KP . |KP Ent| | + `----------------------------------' `----------------------------------' + ,-------------.,-------------. + | | || | | + ,------|------|------||------+------+------. + | | | || | | | + | | |------||------| | | + | | | || | | | + `--------------------'`--------------------' \ No newline at end of file -- cgit v1.2.3-24-g4f1b From eb81978ecbeaa203c20df70c0c4fc56cb816ab6c Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 18 Aug 2016 00:35:32 -0700 Subject: One last formatting change --- keyboards/ergodox/keymaps/xyverz/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md index 32e569b38..89ac8cb04 100644 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -105,7 +105,7 @@ For a better explanation of the layout matrices shown below, take a look at ../. ### Keymap 4: Keypad layer ,--------------------------------------------------.,--------------------------------------------------. - | Power | | | | | | || | | NmLk | KP / | KP| KP - | | + | Power | | | | | | || | | NmLk | KP / | KP * | KP - | | |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| | Sleep | | | | | | || | | KP 7 | KP 8 | KP 9 | KP + | | |--------+------+------+------+------+------| || |------+------+------+------+------+--------| -- cgit v1.2.3-24-g4f1b From aa37a57e0f55694291290f9db61d8ff352d42454 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 18 Aug 2016 00:38:25 -0700 Subject: One last change to the readme. --- keyboards/ergodox/keymaps/xyverz/readme.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md index 89ac8cb04..255749323 100644 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -2,9 +2,7 @@ ## Please Note: -It will need **substantial** modification in order to work on the Infinity. - -PLEASE NOTE: This keymap will NOT work with the Infinity ErgoDox due to the fact that the mappings are based on the Matrix Layout in the ez.h file. If you want to use this for the infinity, you'll need to figure out where the keys are in the matrix and redo the layout arrays below. +This keymap will probably **not** work with the Infinity ErgoDox. It will need **substantial** modification in order to work on the Infinity. This is due to the fact that the mappings are based on the matrix positions in the keymap definition in the ez.h file. If you want to use this for the infinity, you'll need to figure out where the keys are in the matrix and redo the layout arrays below. ## About this keymap: -- cgit v1.2.3-24-g4f1b From 64ecb1531067f7711a8c48e821eab546f1129757 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 18 Aug 2016 09:56:11 +0200 Subject: corrected the split rshift key to reality fixed my keymap in the process to adjust to that --- keyboards/satan/keymaps/iso_split_rshift/keymap.c | 16 ++++++++-------- keyboards/satan/satan.h | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/keyboards/satan/keymaps/iso_split_rshift/keymap.c b/keyboards/satan/keymaps/iso_split_rshift/keymap.c index bc5bfe2e6..cf938e07d 100644 --- a/keyboards/satan/keymaps/iso_split_rshift/keymap.c +++ b/keyboards/satan/keymaps/iso_split_rshift/keymap.c @@ -52,11 +52,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' LEFT DWN RIGHT */ [_DEF] = KEYMAP_ISO_SPLITRSHIFT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - TABDUAL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \ - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TG(_SFX), ARRUP, \ - KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT), + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + TABDUAL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, ARRUP, TG(_SFX), \ + KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT), /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) * ,-----------------------------------------------------------. @@ -75,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ _______, KC_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \ _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ - _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, _______, KC_VOLU, \ + _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \ _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) @@ -95,7 +95,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ _______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ - _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, _______, KC_PGUP, \ + _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, KC_PGUP, _______, \ _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) @@ -115,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \ _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \ _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ - _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, _______, KC_UP, \ + _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \ _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT), }; diff --git a/keyboards/satan/satan.h b/keyboards/satan/satan.h index cbc8c91bd..6b45c955b 100644 --- a/keyboards/satan/satan.h +++ b/keyboards/satan/satan.h @@ -74,12 +74,14 @@ * |-----------------------------------------------------------| * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | * `-----------------------------------------------------------' + + swap 3c and 3d. 3c is right of 3d in reality */ #define KEYMAP_ISO_SPLITRSHIFT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ -- cgit v1.2.3-24-g4f1b From 07924511f33599267209b1f0d1ebddf400f7987d Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 10:01:46 +0200 Subject: Small changes, renamed keymap Added MicMute Revived all dead keys Removed OS Shift --- keyboards/s60-x/keymaps/ansi_qwertz/Makefile | 21 +++ keyboards/s60-x/keymaps/ansi_qwertz/config.h | 14 ++ keyboards/s60-x/keymaps/ansi_qwertz/keymap.c | 236 +++++++++++++++++++++++++++ keyboards/s60-x/keymaps/felix/Makefile | 21 --- keyboards/s60-x/keymaps/felix/config.h | 14 -- keyboards/s60-x/keymaps/felix/keymap.c | 213 ------------------------ 6 files changed, 271 insertions(+), 248 deletions(-) create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/Makefile create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/config.h create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/keymap.c delete mode 100644 keyboards/s60-x/keymaps/felix/Makefile delete mode 100644 keyboards/s60-x/keymaps/felix/config.h delete mode 100644 keyboards/s60-x/keymaps/felix/keymap.c diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/Makefile b/keyboards/s60-x/keymaps/ansi_qwertz/Makefile new file mode 100644 index 000000000..6a078bcc3 --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/config.h b/keyboards/s60-x/keymaps/ansi_qwertz/config.h new file mode 100644 index 000000000..6c01d579f --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/config.h @@ -0,0 +1,14 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// keymap needs oneshot functionality +#undef NO_ACTION_ONESHOT + +#undef IS_COMMAND +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c b/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c new file mode 100644 index 000000000..9f59f12fa --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c @@ -0,0 +1,236 @@ +/* +Copyright 2016 Julien Pecqueur +Copyright 2016 Felix Uhl + +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 . +*/ + +#include "s60-x.h" + +//make keymap a little easier to read +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 1 + +//uncomment to activate dead keys +//#define DONT_REVIVE_DEADKEYS 1 + +//Function keycodes for better readability +//SpaceFN +//OneShot LeftShift +//GamingMode Lock (disables SpaceFn and OneShot LShift) +//Function +//Mute microphone +#define KC_SPACEFN KC_FN0 +#define KC_OSLS KC_FN3 +#define KC_GMLK KC_FN1 +#define KC_FUNC KC_FN2 +#define MICMUTE RCTL(KC_LCTL) + +enum function_codes { + F_SPACEFN = 0, + F_OSLS = 3, + F_GMLK = 1, + F_FUNC = 2 +}; + +enum layer_names { + DEFAULT, + GAMING, + FUNCTION +}; + +enum languages { + GERMAN +}; + +#define LANGUAGE GERMAN + +enum custom_keycodes { + KC_CM_A = SAFE_RANGE, +// KC_CM_B, + KC_CM_C, +// KC_CM_D, + KC_CM_E, +// KC_CM_F, + KC_CM_G, +// KC_CM_H, + KC_CM_I, +// KC_CM_J, + KC_CM_K, + KC_CM_L, + KC_CM_M, + KC_CM_N, + KC_CM_O, + KC_CM_P, +// KC_CM_Q, + KC_CM_R, + KC_CM_S, +// KC_CM_T, + KC_CM_U, +// KC_CM_V, + KC_CM_W, +// KC_CM_X, +// KC_CM_Y, + KC_CM_Z +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layout 0: Default Layer + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del| + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Z| U| I| O| P| [| ]|BckSp| + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Y| X| C| V| B| N| M| ,| .| /| Up |RSft| + * |-----------------------------------------------------------| + * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| + * `-----------------------------------------------------------' + */ + [DEFAULT] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ + KC_LSFT, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_RSFT, \ + KC_FUNC, KC_LGUI, KC_LALT, KC_SPACEFN, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Layout 1: Gaming Layer, SpaceFn disabled + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | |Fn1 | + * |-----------------------------------------------------------| + * | |RSft| | Space | | | | | + * `-----------------------------------------------------------' + */ + [GAMING] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GMLK, \ + _______, KC_RSFT, _______, KC_SPC, _______, _______, _______, _______ + ), + + /* Layout 2: Function Layer + * MicMute requires special software to be installed. Check readme.md for more information + * ,-----------------------------------------------------------. + * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|RES| + * |-----------------------------------------------------------| + * | | | | |Prv|Ply|Nxt| Ü | | Ö | |Prt|Slk|Pau | + * |-----------------------------------------------------------| + * | | Ä | ß | |Vl-|Mut|Vl+| | | | | |PEnt | + * |-----------------------------------------------------------| + * | | | | |MicMut|Cal| | | | |Pau |PUp |Fn1 | + * |-----------------------------------------------------------| + * | | | | | |Home|PDn |End | + * `-----------------------------------------------------------' + */ + [FUNCTION] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, RESET, \ + _______, _______, KC_CM_W, KC_CM_E, KC_MPRV, KC_MPLY, KC_MNXT, KC_CM_U, KC_CM_I, KC_CM_O, KC_CM_P KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, KC_CM_A, KC_CM_S, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_CM_K, KC_CM_L, _______, _______, _______, KC_PENT, \ + _______, _______, KC_CM_Y, _______, KC_CM_C, MICMUTE, KC_CALC, KC_CM_N, KC_CM_M, _______, _______, _______, _______, KC_PGUP, KC_GMLK, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), +}; + +/* +* Fn action definition +*/ +const uint16_t PROGMEM fn_actions[] = { + [F_SPACEFN] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), // SpaceFn layout 1 + [F_GMLK] = ACTION_LAYER_TOGGLE(1), // Disable SpaceFn and Oneshot Shift + [F_FUNC] = ACTION_LAYER_MOMENTARY(2), // SpaceFn layout 1 + [F_OSLS] = ACTION_MODS_ONESHOT(MOD_LSFT) // Oneshot Leftshift +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_german(uint16_t keycode, keyrecord_t *record) { + uint16_t send_code = 0; + if (record->event.pressed) { + switch (keycode) { + case KC_C_AM: + send_code = KC_Q; + break; + case KC_C_OM: + send_code = KC_P; + break; + case KC_C_UM: + send_code = KC_Y; + break; + case KC_C_SM: + send_code = KC_S; + break; + } + + if (send_code == 0) { + return true; + } + else { + register_code(KC_RALT); + register_code(send_code); + unregister_code(send_code); + unregister_code(KC_RALT); + return false; + } + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //revive dead keys +#ifndef DONT_REVIVE_DEADKEYS + bool shift_active = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_LSFT)); + bool altgr_active = keyboard_report->mods & (MOD_BIT(KC_RALT)); + if ((keycode == KC_QUOT && !altgr_active) || + keycode == KC_GRV || + (keycode == KC_6 && shift_active)) + { + if (record->event.pressed) { + register_code(keycode); + unregister_code(keycode); + register_code(KC_SPACE); + unregister_code(KC_SPACE); + } + return false; + } +#endif +#if LANGUAGE == GERMAN + return process_german(keycode, record); +#else + return true; +#endif +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/felix/Makefile b/keyboards/s60-x/keymaps/felix/Makefile deleted file mode 100644 index 6a078bcc3..000000000 --- a/keyboards/s60-x/keymaps/felix/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/felix/config.h b/keyboards/s60-x/keymaps/felix/config.h deleted file mode 100644 index 6c01d579f..000000000 --- a/keyboards/s60-x/keymaps/felix/config.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// keymap needs oneshot functionality -#undef NO_ACTION_ONESHOT - -#undef IS_COMMAND -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif \ No newline at end of file diff --git a/keyboards/s60-x/keymaps/felix/keymap.c b/keyboards/s60-x/keymaps/felix/keymap.c deleted file mode 100644 index 6e40d4839..000000000 --- a/keyboards/s60-x/keymaps/felix/keymap.c +++ /dev/null @@ -1,213 +0,0 @@ -/* -Copyright 2016 Julien Pecqueur -Copyright 2016 Felix Uhl - -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 . -*/ - -#include "s60-x.h" - -//make keymap a little easier to read -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -#define ONESHOT_TAP_TOGGLE 2 -#define ONESHOT_TIMEOUT 1 - -//Special keycodes for better readability -//SpaceFN -//OneShot LeftShift -//GamingMode Lock (disables SpaceFn and OneShot LShift) -//Function -#define KC_SPACEFN KC_FN0 -#define KC_OSLS KC_FN3 -#define KC_GMLK KC_FN1 -#define KC_FUNC KC_FN2 - -enum function_codes { - F_SPACEFN = 0, - F_OSLS = 3, - F_GMLK = 1, - F_FUNC = 2 -}; - -enum layer_names { - DEFAULT, - GAMING, - FUNCTION -}; - -enum languages { - GERMAN -}; - -#define LANGUAGE GERMAN - -enum custom_keycodes { - KC_C_AM = SAFE_RANGE, - KC_C_EM, - KC_C_IM, - KC_C_OM, - KC_C_UM, - KC_C_SM, - KC_C_YM, - KC_C_WM -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layout 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|Del| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Z| U| I| O| P| [| ]|BckSp| - * |-----------------------------------------------------------| - * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return | - * |-----------------------------------------------------------| - * |Shift OS| Y| X| C| V| B| N| M| ,| .| /| Up |RSft| - * |-----------------------------------------------------------| - * |Fn2 |Gui |Alt | SpaceFn |Alt |Left|Down|Right| - * `-----------------------------------------------------------' - */ - [DEFAULT] = KEYMAP( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Z, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \ - KC_OSLS, KC_NUBS, KC_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_UP, KC_RSFT, \ - KC_FUNC, KC_LGUI, KC_LALT, KC_SPACEFN, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT - ), - - /* Layout 1: Gaming Layer, SpaceFn disabled - * ,-----------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | | | | | | | - * |-----------------------------------------------------------| - * | | | | | | | | | | | | | | - * |-----------------------------------------------------------| - * |SFTnonOS| | | | | | | | | | | |Fn1 | - * |-----------------------------------------------------------| - * | | NOP| | Space | | | | | - * `-----------------------------------------------------------' - */ - [GAMING] = KEYMAP( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GMLK, \ - _______, XXXXXXX, _______, KC_SPC, _______, _______, _______, _______ - ), - - /* Layout 2: Function Layer - * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|RES| - * |-----------------------------------------------------------| - * | | | | |Prv|Ply|Nxt| Ü | | Ö | |Prt|Slk|Pau | - * |-----------------------------------------------------------| - * | | Ä | ß | |Vl-|Mut|Vl+| | | | | |PEnt | - * |-----------------------------------------------------------| - * | CpsLck | | | | |Cal| | | | |Pau |PUp |Fn1 | - * |-----------------------------------------------------------| - * | | | | | |Home|PDn |End | - * `-----------------------------------------------------------' - */ - [FUNCTION] = KEYMAP( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, RESET, \ - _______, _______, KC_C_WM, KC_C_EM, KC_MPRV, KC_MPLY, KC_MNXT, KC_C_UM, KC_C_IM, KC_C_OM, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ - _______, KC_C_AM, KC_C_SM, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, _______, _______, KC_PENT, \ - KC_CAPS, KC_C_YM, _______, _______, _______, _______, KC_CALC, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_GMLK, \ - _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END - ), -}; - -/* -* Fn action definition -*/ -const uint16_t PROGMEM fn_actions[] = { - [F_SPACEFN] = ACTION_LAYER_TAP_KEY(2, KC_SPACE), // SpaceFn layout 1 - [F_GMLK] = ACTION_LAYER_TOGGLE(1), // Disable SpaceFn and Oneshot Shift - [F_FUNC] = ACTION_LAYER_MOMENTARY(2), // SpaceFn layout 1 - [F_OSLS] = ACTION_MODS_ONESHOT(MOD_LSFT) // Oneshot Leftshift -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -}; - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_german(uint16_t keycode, keyrecord_t *record) { - uint16_t send_code = 0; - switch (keycode) { - case KC_C_AM: - if (record->event.pressed) { - send_code = KC_Q; - } - break; - - case KC_C_OM: - if (record->event.pressed) { - send_code = KC_P; - } - break; - - case KC_C_UM: - if (record->event.pressed) { - send_code = KC_Y; - } - break; - - case KC_C_SM: - if (record->event.pressed) { - send_code = KC_S; - } - break; - } - - if (send_code == 0) { - return true; - } - else { - register_code(KC_RALT); - register_code(send_code); - unregister_code(send_code); - unregister_code(KC_RALT); - return false; - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (keycode == KC_QUOT) { - if (record->event.pressed) { - register_code(KC_QUOT); - unregister_code(KC_QUOT); - register_code(KC_SPACE); - unregister_code(KC_SPACE); - } - return false; - } -#if LANGUAGE == GERMAN - return process_german(keycode, record); -#else - return true; -#endif -} - -void led_set_user(uint8_t usb_led) { - -} \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 864e26f4399e3531f3672b6494d4f47548829b88 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 18 Aug 2016 10:06:13 +0200 Subject: cleanup, readability , shift swap in ISO_SPLIT_RSHIFT --- keyboards/satan/satan.h | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/keyboards/satan/satan.h b/keyboards/satan/satan.h index 6b45c955b..33a10292c 100644 --- a/keyboards/satan/satan.h +++ b/keyboards/satan/satan.h @@ -3,6 +3,9 @@ #include "quantum.h" +// readability +#define XXX KC_NO + /* Satan GH60 matrix layout * ,-----------------------------------------------------------. * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | @@ -26,11 +29,11 @@ k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO, k2d}, \ - {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d}, \ - {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ } /* Satan HHKB matrix layout @@ -51,15 +54,15 @@ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ - k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO, k2d}, \ - {k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ - {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, k49, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ } /* ISO w/ split right shift key matrix layout @@ -70,7 +73,7 @@ * |-----------------------------------------------------------| * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c|2d | * |-----------------------------------------------------------| - * | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c| 3d | + * | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | 3c| * |-----------------------------------------------------------| * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | * `-----------------------------------------------------------' @@ -85,11 +88,11 @@ k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ - {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ - {k40, k41, k42, KC_NO, KC_NO, k45, KC_NO, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ } void matrix_init_user(void); -- cgit v1.2.3-24-g4f1b From 2618260b34acade9e3239e6116a94bcfc726c00a Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 10:37:32 +0200 Subject: Documentation overhaul. --- .../docs/KB_US-International-Alternative.png | Bin 0 -> 54748 bytes .../docs/KB_US-International-Alternative.svg | 1046 +++++++++++++++++++ ...ional-Alternative.svg.2016_08_18_09_06_36.0.svg | 1049 ++++++++++++++++++++ .../ansi_qwertz/docs/KB_US-International.png | Bin 0 -> 54041 bytes .../ansi_qwertz/docs/KB_US-International.svg | 935 +++++++++++++++++ .../s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG | Bin 0 -> 29411 bytes .../keymaps/ansi_qwertz/docs/function_layer.PNG | Bin 0 -> 25567 bytes .../keymaps/ansi_qwertz/docs/gaming_layer.PNG | Bin 0 -> 17895 bytes keyboards/s60-x/keymaps/ansi_qwertz/readme.md | 108 ++ keyboards/s60-x/keymaps/felix/readme.md | 9 - 10 files changed, 3138 insertions(+), 9 deletions(-) create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG create mode 100644 keyboards/s60-x/keymaps/ansi_qwertz/readme.md delete mode 100644 keyboards/s60-x/keymaps/felix/readme.md diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png new file mode 100644 index 000000000..168780c82 Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.png differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg new file mode 100644 index 000000000..f03858993 --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg @@ -0,0 +1,1046 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shift + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ë + ¯ + Ë› + ˘ + o + . + ˇ + Ë™ + + + diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg new file mode 100644 index 000000000..2304b2a4c --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International-Alternative.svg.2016_08_18_09_06_36.0.svg @@ -0,0 +1,1049 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shift + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ë + ¯ + Ë› + ˘ + o + . + ˇ + Ë™ + + + diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png new file mode 100644 index 000000000..875eb3652 Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.png differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg new file mode 100644 index 000000000..1ca6a9c87 --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/docs/KB_US-International.svg @@ -0,0 +1,935 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shift + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG b/keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG new file mode 100644 index 000000000..c730c2d65 Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/base_layer.PNG differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG b/keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG new file mode 100644 index 000000000..fae2439ca Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/function_layer.PNG differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG b/keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG new file mode 100644 index 000000000..59b202be2 Binary files /dev/null and b/keyboards/s60-x/keymaps/ansi_qwertz/docs/gaming_layer.PNG differ diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md new file mode 100644 index 000000000..050040e23 --- /dev/null +++ b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md @@ -0,0 +1,108 @@ +# ANSI_QWERTZ + +This keymap was specifically designed to support keycaps with ANSI layout and legends, while retaining the possibility of inputting characters +with diacritics that are normally not used in the english language. + +It currently relies on the US-International keyboard layout, which can be installed in any current operating system without the use of third party hardware. + +##Features + +* Input of letters with diacritics on familiar QWERTZ layout +* Support for ANSI-legend keycaps +* Option to "revive" all dead keys +* SpaceFN for easy access to Function keys and diacritic input +* Locking "Gaming Mode" that disables SpaceFN and allows to bind GUI key in Games +* Reset key binding, no need to press hardware reset button to program +* Microphone Mute key (requires 3rd-party software, see below) + +###Languages + +The US-International Layout is currently required for the support of non-english languages. This keymap swaps Y and Z to provide the familiar QWERTZ position for characters. +All diacritic characters are input by either holding the Spacebar or the Fn key and pressing the corresponding key. For languages that aren't yet supported explicitly, +one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](#Revive-Dead-Keys). + +The illustration below shows the "US International" layout available in the Language settings of Windows, Linux and Mac OS. + +![KB_US-International](docs/KB_US-International.png) + +Not all languages are supported by this layout. Linux also offers the "US International Alternative" layout, +which contains more dead keys to input pretty much every diacritic character in a language using latin letters. + +![KB_US-International-Alternative](docs/KB_US-International-Alternative.png) + +####Explicitly Supported Languages + +* German + +####Implicitly Supported Languages + +This list only applys to Windows. Linux systems support all languages, see above. + +This list might be incomplete! Please add your language if you find it's supported. + +* French + +###SpaceFN + +SpaceFN basically means that Space acts as a normal spacebar when tapped, but acts as a layer-key when held down. +This means that you can't hold space to output multiple spaces consecutively and that space only registers once released. +The advantage is that the spacebar is easier to reach than any other Fn-key could be. + +###"Gaming Mode" + +To alleviate the problems SpaceFN would cause when gaming, the Gaming Mode is pretty much a layer that can be turned on by pressing Fn+RShift. +This will turn the double-role Spacebar into a normal one, so the Fn-layer (and thus function and media keys) can only be accessed with the Fn-key. +It also turns the GUI-key (aka Win-key aka Super-key) into Right Shift, so it can be bound in Games. This is especially useful when playing with ESDF instead of WASD. + +###Mute Microphone + +The function layer has a "Mute Microphone"-key. As this is not an existing media key and you can't normally set a shortcut to this function, +you need to set this up in software before using it, see below. This key is bound to `Right Control` + `Left Control`, a keycombination that +no other program in existence uses for anything, at least to my knowledge. It also can't be pressed with this keymap in any other way. + +####Linux + +Follow [these instructions](http://askubuntu.com/a/13364). + +#####Windows (Requires 3rd Party Software) + +*DISCLAIMER: I take no responsibility for any potential harm caused by third party applications!* + +You'll need a utility called "MicMute". It is available on [Sourceforge](https://sourceforge.net/projects/micmute/). +After installing and running the tool, you only need to use the "Setup Shortcut" option to bind the key to muting the microphone +and check whether your microphone is selected under "Devices". + +###Revive Dead Keys + +Some diacritics that are commonly used are dead keys on the international layouts, for example `` ` ``, `'`, or `"`. +The dead keys on the regular international layout (shown in red [here](#Languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. +If you don't want this to be the case, uncomment the following line in `keymap.c` prior to compiling: + +``` +//#define DONT_REVIVE_DEADKEYS 1 +``` + +##Layers + +###Base Layer + +The base layer is shown here for ANSI keys and an HHKB-style right shift. +Again, the Y and Z keys are swapped, so you get the QWERTZ-positions of Y and Z when using the US-International layout. + +![base_layer](docs/base_layer.png) + +###Gaming layer + +To turn this layer on, please use the combination Fn+RShift, not Space+Rshift. If you do the latter, the Function layer + +![gaming_layer](docs/gaming_layer.png) + +###Function Layer + +This is the function layer for German diacritics. It can be accessed via the Fn-key or by holding space on the base layer. + +![function_layer](docs/function_layer.png) + + + + diff --git a/keyboards/s60-x/keymaps/felix/readme.md b/keyboards/s60-x/keymaps/felix/readme.md deleted file mode 100644 index 7f083dfd0..000000000 --- a/keyboards/s60-x/keymaps/felix/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -# A non-US ANSI QWERTZ keymap - -This keymap was specifically designed to support ANSI keycaps while retaining the possibility of inputting characters with diacritics that are normally not used in the english language. - -It relies on the US-International keyboard layout, which can be installed in any current operating system without the use of third party hardware. - -Currently, it explicitly supports the following languages, though other languages are readily useable using the AltGr modifier. -- German - -- cgit v1.2.3-24-g4f1b From a8659955958a0a7eb94c904469767b6cf5241ccc Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 11:11:42 +0200 Subject: Fixed pictures and links --- keyboards/s60-x/keymaps/ansi_qwertz/readme.md | 28 +++++++++++++-------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md index 050040e23..f46c28795 100644 --- a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md +++ b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md @@ -17,9 +17,9 @@ It currently relies on the US-International keyboard layout, which can be instal ###Languages -The US-International Layout is currently required for the support of non-english languages. This keymap swaps Y and Z to provide the familiar QWERTZ position for characters. -All diacritic characters are input by either holding the Spacebar or the Fn key and pressing the corresponding key. For languages that aren't yet supported explicitly, -one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](#Revive-Dead-Keys). +The US-International Layout is currently required for the support of non-english languages. This keymap swaps Y and Z to provide the familiar QWERTZ position for characters when using that layout. +All diacritic characters are input by either holding `Space` or `Fn` and pressing the corresponding key. For languages that aren't yet supported explicitly, +one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](readme.md#Revive-Dead-Keys). The illustration below shows the "US International" layout available in the Language settings of Windows, Linux and Mac OS. @@ -36,17 +36,15 @@ which contains more dead keys to input pretty much every diacritic character in ####Implicitly Supported Languages -This list only applys to Windows. Linux systems support all languages, see above. - -This list might be incomplete! Please add your language if you find it's supported. +This list only applies to Windows. Linux systems support all languages, see above. This list might be incomplete! Please add your language if you find it's supported. * French ###SpaceFN -SpaceFN basically means that Space acts as a normal spacebar when tapped, but acts as a layer-key when held down. +SpaceFN basically means that `Space` acts as a normal spacebar when tapped, but acts as a layer-key when held down. This means that you can't hold space to output multiple spaces consecutively and that space only registers once released. -The advantage is that the spacebar is easier to reach than any other Fn-key could be. +The advantage is that the spacebar is easier to reach than any other `Fn`-key could be. ###"Gaming Mode" @@ -75,7 +73,7 @@ and check whether your microphone is selected under "Devices". ###Revive Dead Keys Some diacritics that are commonly used are dead keys on the international layouts, for example `` ` ``, `'`, or `"`. -The dead keys on the regular international layout (shown in red [here](#Languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. +The dead keys on the regular international layout (shown in red [here](readme.md#Languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. If you don't want this to be the case, uncomment the following line in `keymap.c` prior to compiling: ``` @@ -86,22 +84,22 @@ If you don't want this to be the case, uncomment the following line in `keymap.c ###Base Layer -The base layer is shown here for ANSI keys and an HHKB-style right shift. +The base layer is shown here for ANSI keysm, HHKB-style right shift and split backspace. If you use a 2U backspace key there, `Del` will not be available. Again, the Y and Z keys are swapped, so you get the QWERTZ-positions of Y and Z when using the US-International layout. -![base_layer](docs/base_layer.png) +![base_layer](docs/base_layer.PNG) ###Gaming layer -To turn this layer on, please use the combination Fn+RShift, not Space+Rshift. If you do the latter, the Function layer +To turn this layer on, please use the combination `Fn+RShift`, not `Space+RShift`. If you do the latter, the Function layer will become stuck. You can press `Fn` once to unstick it if this happens to you. A solution is being worked on. -![gaming_layer](docs/gaming_layer.png) +![gaming_layer](docs/gaming_layer.PNG) ###Function Layer -This is the function layer for German diacritics. It can be accessed via the Fn-key or by holding space on the base layer. +This is the function layer for German diacritics. It can be accessed via the `Fn` or by holding `Space` on the base layer. -![function_layer](docs/function_layer.png) +![function_layer](docs/function_layer.PNG) -- cgit v1.2.3-24-g4f1b From c5f13e5836563dc546edea1f14ea74dc3b94fa3f Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 11:16:10 +0200 Subject: Fixed links again --- keyboards/s60-x/keymaps/ansi_qwertz/readme.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md index f46c28795..0938e49c8 100644 --- a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md +++ b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md @@ -1,5 +1,7 @@ # ANSI_QWERTZ +[Click here to go to the layers directly.](readme.md#layers) + This keymap was specifically designed to support keycaps with ANSI layout and legends, while retaining the possibility of inputting characters with diacritics that are normally not used in the english language. @@ -19,7 +21,7 @@ It currently relies on the US-International keyboard layout, which can be instal The US-International Layout is currently required for the support of non-english languages. This keymap swaps Y and Z to provide the familiar QWERTZ position for characters when using that layout. All diacritic characters are input by either holding `Space` or `Fn` and pressing the corresponding key. For languages that aren't yet supported explicitly, -one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](readme.md#Revive-Dead-Keys). +one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](readme.md#revive-dead-keys). The illustration below shows the "US International" layout available in the Language settings of Windows, Linux and Mac OS. @@ -55,7 +57,7 @@ It also turns the GUI-key (aka Win-key aka Super-key) into Right Shift, so it ca ###Mute Microphone The function layer has a "Mute Microphone"-key. As this is not an existing media key and you can't normally set a shortcut to this function, -you need to set this up in software before using it, see below. This key is bound to `Right Control` + `Left Control`, a keycombination that +you need to set this up in software before using it, see below. This key is bound to `RCtrl+LCtrl`, a keycombination that no other program in existence uses for anything, at least to my knowledge. It also can't be pressed with this keymap in any other way. ####Linux @@ -73,7 +75,7 @@ and check whether your microphone is selected under "Devices". ###Revive Dead Keys Some diacritics that are commonly used are dead keys on the international layouts, for example `` ` ``, `'`, or `"`. -The dead keys on the regular international layout (shown in red [here](readme.md#Languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. +The dead keys on the regular international layout (shown in red [here](readme.md#languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. If you don't want this to be the case, uncomment the following line in `keymap.c` prior to compiling: ``` -- cgit v1.2.3-24-g4f1b From 0d28787c5cf2173d12f57b397515f91cffaa820a Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 18 Aug 2016 11:29:53 +0200 Subject: Add a register/unregister_code16 pair of functions These functions register not only the 8bit keycode, but the modifiers too. It doesn't handle the full range of the upper 8bits, just the mods, but that's a good start. Changed the tap-dance pair functions to use these, so one can do: `ACTION_TAP_DANCE_DOUBLE (KC_COLN, KC_SCLN)` ...and that will do the right thing. Signed-off-by: Gergely Nagy --- quantum/process_keycode/process_tap_dance.c | 8 +++---- quantum/quantum.c | 37 +++++++++++++++++++++++++++++ quantum/quantum.h | 3 +++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index e152f2350..07de3ecb8 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -8,9 +8,9 @@ void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; if (state->count == 1) { - register_code (pair->kc1); + register_code16 (pair->kc1); } else if (state->count == 2) { - register_code (pair->kc2); + register_code16 (pair->kc2); } } @@ -18,9 +18,9 @@ void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; if (state->count == 1) { - unregister_code (pair->kc1); + unregister_code16 (pair->kc1); } else if (state->count == 2) { - unregister_code (pair->kc2); + unregister_code16 (pair->kc2); } } diff --git a/quantum/quantum.c b/quantum/quantum.c index cb1ba04ff..e3a20f43e 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -1,5 +1,42 @@ #include "quantum.h" +static void do_code16 (uint16_t code, void (*f) (uint8_t)) { + switch (code) { + case QK_MODS ... QK_MODS_MAX: + break; + default: + return; + } + + if (code & QK_LCTL) + f(KC_LCTL); + if (code & QK_LSFT) + f(KC_LSFT); + if (code & QK_LALT) + f(KC_LALT); + if (code & QK_LGUI) + f(KC_LGUI); + + if (code & QK_RCTL) + f(KC_RCTL); + if (code & QK_RSFT) + f(KC_RSFT); + if (code & QK_RALT) + f(KC_RALT); + if (code & QK_RGUI) + f(KC_RGUI); +} + +void register_code16 (uint16_t code) { + do_code16 (code, register_code); + register_code (code); +} + +void unregister_code16 (uint16_t code) { + unregister_code (code); + do_code16 (code, unregister_code); +} + __attribute__ ((weak)) bool process_action_kb(keyrecord_t *record) { return true; diff --git a/quantum/quantum.h b/quantum/quantum.h index 6e3fbcc79..0c6046649 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -83,6 +83,9 @@ void reset_keyboard(void); void startup_user(void); void shutdown_user(void); +void register_code16 (uint16_t code); +void unregister_code16 (uint16_t code); + #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void); -- cgit v1.2.3-24-g4f1b From 738151d12a6fe947096b974b34e70a8ab62f953c Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 11:38:04 +0200 Subject: Minor documentation changes --- keyboards/s60-x/keymaps/ansi_qwertz/readme.md | 42 +++++++++------------------ keyboards/s60-x/readme.md | 7 +++++ 2 files changed, 21 insertions(+), 28 deletions(-) diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md index 0938e49c8..50651896f 100644 --- a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md +++ b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md @@ -1,27 +1,26 @@ # ANSI_QWERTZ -[Click here to go to the layers directly.](readme.md#layers) +[Click here to go to the layers directly.](readme.md#1.0-layers) This keymap was specifically designed to support keycaps with ANSI layout and legends, while retaining the possibility of inputting characters with diacritics that are normally not used in the english language. It currently relies on the US-International keyboard layout, which can be installed in any current operating system without the use of third party hardware. -##Features - +##0. Features * Input of letters with diacritics on familiar QWERTZ layout * Support for ANSI-legend keycaps * Option to "revive" all dead keys +* Dedicated arrow cluster * SpaceFN for easy access to Function keys and diacritic input * Locking "Gaming Mode" that disables SpaceFN and allows to bind GUI key in Games * Reset key binding, no need to press hardware reset button to program * Microphone Mute key (requires 3rd-party software, see below) -###Languages - +###0.0 Languages The US-International Layout is currently required for the support of non-english languages. This keymap swaps Y and Z to provide the familiar QWERTZ position for characters when using that layout. All diacritic characters are input by either holding `Space` or `Fn` and pressing the corresponding key. For languages that aren't yet supported explicitly, -one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](readme.md#revive-dead-keys). +one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](readme.md#0.4-revive-dead-keys). The illustration below shows the "US International" layout available in the Language settings of Windows, Linux and Mac OS. @@ -32,73 +31,60 @@ which contains more dead keys to input pretty much every diacritic character in ![KB_US-International-Alternative](docs/KB_US-International-Alternative.png) -####Explicitly Supported Languages - +####0.0.0 Explicitly Supported Languages * German -####Implicitly Supported Languages - +####0.0.1 Implicitly Supported Languages This list only applies to Windows. Linux systems support all languages, see above. This list might be incomplete! Please add your language if you find it's supported. * French -###SpaceFN - +###0.1 SpaceFN SpaceFN basically means that `Space` acts as a normal spacebar when tapped, but acts as a layer-key when held down. This means that you can't hold space to output multiple spaces consecutively and that space only registers once released. The advantage is that the spacebar is easier to reach than any other `Fn`-key could be. -###"Gaming Mode" - +###0.2 "Gaming Mode" To alleviate the problems SpaceFN would cause when gaming, the Gaming Mode is pretty much a layer that can be turned on by pressing Fn+RShift. This will turn the double-role Spacebar into a normal one, so the Fn-layer (and thus function and media keys) can only be accessed with the Fn-key. It also turns the GUI-key (aka Win-key aka Super-key) into Right Shift, so it can be bound in Games. This is especially useful when playing with ESDF instead of WASD. -###Mute Microphone - +###0.3 Mute Microphone The function layer has a "Mute Microphone"-key. As this is not an existing media key and you can't normally set a shortcut to this function, you need to set this up in software before using it, see below. This key is bound to `RCtrl+LCtrl`, a keycombination that no other program in existence uses for anything, at least to my knowledge. It also can't be pressed with this keymap in any other way. -####Linux - +####0.3.0 Linux Follow [these instructions](http://askubuntu.com/a/13364). -#####Windows (Requires 3rd Party Software) - +#####0.3.1 Windows (Requires 3rd Party Software) *DISCLAIMER: I take no responsibility for any potential harm caused by third party applications!* You'll need a utility called "MicMute". It is available on [Sourceforge](https://sourceforge.net/projects/micmute/). After installing and running the tool, you only need to use the "Setup Shortcut" option to bind the key to muting the microphone and check whether your microphone is selected under "Devices". -###Revive Dead Keys - +###0.4 Revive Dead Keys Some diacritics that are commonly used are dead keys on the international layouts, for example `` ` ``, `'`, or `"`. -The dead keys on the regular international layout (shown in red [here](readme.md#languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. +The dead keys on the regular international layout (shown in red [here](readme.md#0.1-languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. If you don't want this to be the case, uncomment the following line in `keymap.c` prior to compiling: - ``` //#define DONT_REVIVE_DEADKEYS 1 ``` ##Layers - ###Base Layer - The base layer is shown here for ANSI keysm, HHKB-style right shift and split backspace. If you use a 2U backspace key there, `Del` will not be available. Again, the Y and Z keys are swapped, so you get the QWERTZ-positions of Y and Z when using the US-International layout. ![base_layer](docs/base_layer.PNG) ###Gaming layer - To turn this layer on, please use the combination `Fn+RShift`, not `Space+RShift`. If you do the latter, the Function layer will become stuck. You can press `Fn` once to unstick it if this happens to you. A solution is being worked on. ![gaming_layer](docs/gaming_layer.PNG) ###Function Layer - This is the function layer for German diacritics. It can be accessed via the `Fn` or by holding `Space` on the base layer. ![function_layer](docs/function_layer.PNG) diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md index 4bba4b68f..0c4dc10f8 100644 --- a/keyboards/s60-x/readme.md +++ b/keyboards/s60-x/readme.md @@ -251,3 +251,10 @@ The custom keymap is where I tested all the switches, not being concerned with a ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +### 9. [ANSI_QWERTZ](keymap/ansi_qwertz/keymap.c) + +This keymap was designed for inputting characters with diacritics with ANSI keycaps. +It provides toggleable SpaceFn functionality, a dedicated arrow cluster and a microphone mute key on the function layer as well as a bootloader reset key. + +For more info, [check here](keymap/ansi_qwertz). \ No newline at end of file -- cgit v1.2.3-24-g4f1b From d34c0a2fc1f4da162a06afa76d98e57d864da22c Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 11:40:05 +0200 Subject: Fixed dead link --- keyboards/s60-x/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md index 0c4dc10f8..4bf0930e7 100644 --- a/keyboards/s60-x/readme.md +++ b/keyboards/s60-x/readme.md @@ -257,4 +257,4 @@ The custom keymap is where I tested all the switches, not being concerned with a This keymap was designed for inputting characters with diacritics with ANSI keycaps. It provides toggleable SpaceFn functionality, a dedicated arrow cluster and a microphone mute key on the function layer as well as a bootloader reset key. -For more info, [check here](keymap/ansi_qwertz). \ No newline at end of file +For more info, [check here](keymap/ansi_qwertz/readme.md). -- cgit v1.2.3-24-g4f1b From aa71ebfbba49727bed275ba07d09f74917a2a6ca Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 11:41:52 +0200 Subject: Fixed links again Note to self: check before commiting. --- keyboards/s60-x/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/s60-x/readme.md b/keyboards/s60-x/readme.md index 4bf0930e7..099d58699 100644 --- a/keyboards/s60-x/readme.md +++ b/keyboards/s60-x/readme.md @@ -252,9 +252,9 @@ The custom keymap is where I tested all the switches, not being concerned with a │Ctrl │ Gui │ Alt │█████│█████│█████│Space│█████│█████│█████│ Alt │ Gui │ App │Ctrl │█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -### 9. [ANSI_QWERTZ](keymap/ansi_qwertz/keymap.c) +### 9. [ANSI_QWERTZ](keymaps/ansi_qwertz/keymap.c) This keymap was designed for inputting characters with diacritics with ANSI keycaps. It provides toggleable SpaceFn functionality, a dedicated arrow cluster and a microphone mute key on the function layer as well as a bootloader reset key. -For more info, [check here](keymap/ansi_qwertz/readme.md). +For more info, [check here](keymaps/ansi_qwertz/readme.md). -- cgit v1.2.3-24-g4f1b From 406ae1a2eb8ee6e90c2585c522d4fbf26d94e363 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 11:43:32 +0200 Subject: More link fixing --- keyboards/s60-x/keymaps/ansi_qwertz/readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md index 50651896f..47e4049c3 100644 --- a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md +++ b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md @@ -1,13 +1,13 @@ # ANSI_QWERTZ -[Click here to go to the layers directly.](readme.md#1.0-layers) +[Click here to go to the layers directly.](readme.md#1-layers) This keymap was specifically designed to support keycaps with ANSI layout and legends, while retaining the possibility of inputting characters with diacritics that are normally not used in the english language. It currently relies on the US-International keyboard layout, which can be installed in any current operating system without the use of third party hardware. -##0. Features +##0 Features * Input of letters with diacritics on familiar QWERTZ layout * Support for ANSI-legend keycaps * Option to "revive" all dead keys @@ -72,19 +72,19 @@ If you don't want this to be the case, uncomment the following line in `keymap.c //#define DONT_REVIVE_DEADKEYS 1 ``` -##Layers -###Base Layer +##1 Layers +###1.0 Base Layer The base layer is shown here for ANSI keysm, HHKB-style right shift and split backspace. If you use a 2U backspace key there, `Del` will not be available. Again, the Y and Z keys are swapped, so you get the QWERTZ-positions of Y and Z when using the US-International layout. ![base_layer](docs/base_layer.PNG) -###Gaming layer +###1.1 Gaming layer To turn this layer on, please use the combination `Fn+RShift`, not `Space+RShift`. If you do the latter, the Function layer will become stuck. You can press `Fn` once to unstick it if this happens to you. A solution is being worked on. ![gaming_layer](docs/gaming_layer.PNG) -###Function Layer +###1.2 Function Layer This is the function layer for German diacritics. It can be accessed via the `Fn` or by holding `Space` on the base layer. ![function_layer](docs/function_layer.PNG) -- cgit v1.2.3-24-g4f1b From a72dc6da70923aa6f5127e719529e9631bce20f0 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 11:45:56 +0200 Subject: Final link fix --- keyboards/s60-x/keymaps/ansi_qwertz/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md index 47e4049c3..2ed1af1e0 100644 --- a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md +++ b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md @@ -20,7 +20,7 @@ It currently relies on the US-International keyboard layout, which can be instal ###0.0 Languages The US-International Layout is currently required for the support of non-english languages. This keymap swaps Y and Z to provide the familiar QWERTZ position for characters when using that layout. All diacritic characters are input by either holding `Space` or `Fn` and pressing the corresponding key. For languages that aren't yet supported explicitly, -one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](readme.md#0.4-revive-dead-keys). +one can also use AltGr to input the characters as intended by the US-Intl layout or the dead keys, if they're kept from being [revived](readme.md#04-revive-dead-keys). The illustration below shows the "US International" layout available in the Language settings of Windows, Linux and Mac OS. @@ -66,7 +66,7 @@ and check whether your microphone is selected under "Devices". ###0.4 Revive Dead Keys Some diacritics that are commonly used are dead keys on the international layouts, for example `` ` ``, `'`, or `"`. -The dead keys on the regular international layout (shown in red [here](readme.md#0.1-languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. +The dead keys on the regular international layout (shown in red [here](readme.md#00-languages)) are revived with this keymap by automatically inserting a space if one of those characters is typed. If you don't want this to be the case, uncomment the following line in `keymap.c` prior to compiling: ``` //#define DONT_REVIVE_DEADKEYS 1 -- cgit v1.2.3-24-g4f1b From 73f13c8f26f7f3777cec9d3036628a7dd6021ee9 Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 11:56:44 +0200 Subject: Bugfixes --- keyboards/s60-x/keymaps/ansi_qwertz/keymap.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c b/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c index 9f59f12fa..317a245be 100644 --- a/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c +++ b/keyboards/s60-x/keymaps/ansi_qwertz/keymap.c @@ -82,7 +82,7 @@ enum custom_keycodes { // KC_CM_V, KC_CM_W, // KC_CM_X, -// KC_CM_Y, + KC_CM_Y, KC_CM_Z }; @@ -145,7 +145,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [FUNCTION] = KEYMAP( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, RESET, \ - _______, _______, KC_CM_W, KC_CM_E, KC_MPRV, KC_MPLY, KC_MNXT, KC_CM_U, KC_CM_I, KC_CM_O, KC_CM_P KC_PSCR, KC_SLCK, KC_PAUS, \ + _______, _______, KC_CM_W, KC_CM_E, KC_MPRV, KC_MPLY, KC_MNXT, KC_CM_U, KC_CM_I, KC_CM_O, KC_CM_P, KC_PSCR, KC_SLCK, KC_PAUS, \ _______, KC_CM_A, KC_CM_S, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_CM_K, KC_CM_L, _______, _______, _______, KC_PENT, \ _______, _______, KC_CM_Y, _______, KC_CM_C, MICMUTE, KC_CALC, KC_CM_N, KC_CM_M, _______, _______, _______, _______, KC_PGUP, KC_GMLK, \ _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END @@ -179,16 +179,16 @@ bool process_german(uint16_t keycode, keyrecord_t *record) { uint16_t send_code = 0; if (record->event.pressed) { switch (keycode) { - case KC_C_AM: + case KC_CM_A: send_code = KC_Q; break; - case KC_C_OM: + case KC_CM_O: send_code = KC_P; break; - case KC_C_UM: + case KC_CM_U: send_code = KC_Y; break; - case KC_C_SM: + case KC_CM_S: send_code = KC_S; break; } @@ -204,6 +204,7 @@ bool process_german(uint16_t keycode, keyrecord_t *record) { return false; } } + return true; } bool process_record_user(uint16_t keycode, keyrecord_t *record) { -- cgit v1.2.3-24-g4f1b From dbfb27326bce824ea922410ab02f9f7f54a639ba Mon Sep 17 00:00:00 2001 From: Felix Uhl Date: Thu, 18 Aug 2016 12:15:10 +0200 Subject: Added info to docs --- keyboards/s60-x/keymaps/ansi_qwertz/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md index 2ed1af1e0..b22010612 100644 --- a/keyboards/s60-x/keymaps/ansi_qwertz/readme.md +++ b/keyboards/s60-x/keymaps/ansi_qwertz/readme.md @@ -27,7 +27,7 @@ The illustration below shows the "US International" layout available in the Lang ![KB_US-International](docs/KB_US-International.png) Not all languages are supported by this layout. Linux also offers the "US International Alternative" layout, -which contains more dead keys to input pretty much every diacritic character in a language using latin letters. +which contains more dead keys to input pretty much every diacritic character in a language using latin letters. More information can be found [here](http://web.archive.org/web/20160818101234/http://dry.sailingissues.com/us-international-keyboard-layout.html). ![KB_US-International-Alternative](docs/KB_US-International-Alternative.png) -- cgit v1.2.3-24-g4f1b From 387bd772e1a6f24be2239b910979c0a309425400 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 18 Aug 2016 13:06:16 +0200 Subject: initial commit for the AMJ60 PCB --- keyboards/amj60/Makefile | 70 ++++++++++ keyboards/amj60/amj60.c | 30 ++++ keyboards/amj60/amj60.h | 153 +++++++++++++++++++++ keyboards/amj60/config.h | 94 +++++++++++++ keyboards/amj60/keymaps/iso_split_rshift/Makefile | 23 ++++ keyboards/amj60/keymaps/iso_split_rshift/build.sh | 42 ++++++ keyboards/amj60/keymaps/iso_split_rshift/keymap.c | 147 ++++++++++++++++++++ .../amj60/keymaps/iso_split_rshift/updatemerge.sh | 4 + 8 files changed, 563 insertions(+) create mode 100644 keyboards/amj60/Makefile create mode 100644 keyboards/amj60/amj60.c create mode 100644 keyboards/amj60/amj60.h create mode 100644 keyboards/amj60/config.h create mode 100644 keyboards/amj60/keymaps/iso_split_rshift/Makefile create mode 100755 keyboards/amj60/keymaps/iso_split_rshift/build.sh create mode 100644 keyboards/amj60/keymaps/iso_split_rshift/keymap.c create mode 100755 keyboards/amj60/keymaps/iso_split_rshift/updatemerge.sh diff --git a/keyboards/amj60/Makefile b/keyboards/amj60/Makefile new file mode 100644 index 000000000..1f695aa4d --- /dev/null +++ b/keyboards/amj60/Makefile @@ -0,0 +1,70 @@ + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE ?= yes # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID + +ifndef QUANTUM_DIR + include ../../Makefile +endif diff --git a/keyboards/amj60/amj60.c b/keyboards/amj60/amj60.c new file mode 100644 index 000000000..993a5917d --- /dev/null +++ b/keyboards/amj60/amj60.c @@ -0,0 +1,30 @@ +#include "amj60.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + DDRB |= (1<<2); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1< + +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 0x6066 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Han Chen +#define PRODUCT AMJ60 +#define DESCRIPTION qmk port of AMJ60 PCB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS { F7, F6, F5, F4, D5} +#define MATRIX_COL_PINS { F1, F0, E6, C7, C6, B0, D4, B1, B7, B5, B4, D7, D6, B3} +#define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 4 + +/* Underlight configuration + */ + +#define RGB_DI_PIN E2 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +/* + * 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 + +#endif diff --git a/keyboards/amj60/keymaps/iso_split_rshift/Makefile b/keyboards/amj60/keymaps/iso_split_rshift/Makefile new file mode 100644 index 000000000..0d8416bbc --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/Makefile @@ -0,0 +1,23 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/amj60/keymaps/iso_split_rshift/build.sh b/keyboards/amj60/keymaps/iso_split_rshift/build.sh new file mode 100755 index 000000000..6b4b4568f --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/build.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# adjust for cpu +# -j 16 gave best result on a hyperthreaded quad core core i7 + +LIMIT=10 +THREADS="-j 16" +KMAP=iso_split_rshift + +echo "We need sudo later" +sudo ls 2>&1 /dev/null + +function wait_bootloader { + echo "Waiting for Bootloader..." + local STARTTIME=$(date +"%s") + local REMIND=0 + local EXEC=dfu-programmer + local TARGET=atmega32u4 + while true + do + sudo $EXEC $TARGET get > /dev/null 2>&1 + [ $? -eq 0 ] && break + ENDTIME=$(date +"%s") + DURATION=$(($ENDTIME-$STARTTIME)) + if [ $REMIND -eq 0 -a $DURATION -gt $LIMIT ] + then + echo "Did you forget to press the reset button?" + REMIND=1 + fi + sleep 1 + done +} +make clean +make KEYMAP=${KMAP} ${THREADS} +if [[ $? -eq 0 ]] +then + echo "please trigger flashing!" + wait_bootloader + sudo make KEYMAP=${KMAP} dfu ${THREADS} +else + echo "make failed" + exit 77 +fi diff --git a/keyboards/amj60/keymaps/iso_split_rshift/keymap.c b/keyboards/amj60/keymaps/iso_split_rshift/keymap.c new file mode 100644 index 000000000..60fb0bfb0 --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/keymap.c @@ -0,0 +1,147 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "amj60.h" + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _DEF 0 +#define _SPC 1 +#define _TAB 2 +#define _SFX 3 + +// dual-role shortcuts +#define TABDUAL LT(_TAB, KC_TAB) +#define CAPSDUAL CTL_T(KC_ESC) +#define SPACEDUAL LT(_SPC, KC_SPACE) +#define ENTERDUAL CTL_T(KC_ENT) +// arrow cluster duality bottom right corner +#define ARRLEFT ALT_T(KC_LEFT) +#define ARRDOWN GUI_T(KC_DOWN) +#define ARRUP SFT_T(KC_UP) +#define ARRRIGHT CTL_T(KC_RIGHT) +// german brackets +#define GER_CUR_L RALT(KC_7) // [ +#define GER_CUR_R RALT(KC_0) // ] +#define GER_PAR_L LSFT(KC_8) // ( +#define GER_PAR_R LSFT(KC_9) // ) +#define GER_ANG_L KC_NUBS // < +#define GER_ANG_R LSFT(KC_NUBS) // > +#define GER_BRC_L RALT(KC_8) // [ +#define GER_BRC_R RALT(KC_9) // ] + +// increase readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _DEF: Default Layer + * ,-----------------------------------------------------------. + * |Grv| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Tab is Fn1 + * |-----------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return | + * |-----------------------------------------------------------| + * |Sft | < | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn2| RShift is UP + * |-----------------------------------------------------------| + * |Ctrl|Win |Alt | Space/Fn0 |Alt |Win |Menu|RCtl| Gui Menu, RCtrl is + * `-----------------------------------------------------------' LEFT DWN RIGHT + */ + [_DEF] = KEYMAP_ISO_SPLITRSHIFT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + TABDUAL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + CAPSDUAL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, ENTERDUAL, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, ARRUP, TG(_SFX), \ + KC_LCTL, KC_LGUI, KC_LALT, SPACEDUAL, KC_RALT, ARRLEFT, ARRDOWN, ARRRIGHT), + + /* Keymap 1: F-and-vim Layer, modified with Space (by holding space) + * ,-----------------------------------------------------------. + * |PrSc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete| + * |-----------------------------------------------------------| + * | |Paus| Up| [ | ] | | | | ( | ) | | | | | + * |-----------------------------------------------------------| + * | |Lft|Dwn|Rgt| | |Left|Down|Right|Up| | | PLAY | + * |-----------------------------------------------------------| + * | | | | | < | > | |M0 | | | | | Vol+ | | + * |-----------------------------------------------------------| + * | | | | |Alt |Prev|Vol-|Next| + * `-----------------------------------------------------------' + */ + [_SPC] = KEYMAP_ISO_SPLITRSHIFT( + KC_PSCR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + _______, KC_PAUS, KC_UP, GER_BRC_L, GER_BRC_R, _______, _______, GER_PAR_L, GER_PAR_R, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, KC_MPLY, \ + _______, _______, _______, _______, GER_ANG_L, GER_ANG_R, KC_SPACE, M(0), _______, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + + /* Keymap 2: Tab Layer w/ vim pageup, modified with Tab (by holding tab) + * ,-----------------------------------------------------------. + * |WAKE| | | | | | | | | | | | |Insert| TAB+GRC = WAKE + * |-----------------------------------------------------------| + * | | | | | | | | | { | } | | | | | + * |-----------------------------------------------------------| + * | | | | | | |Pos1|PgDn|PgUp|End| | |Retrn | + * |-----------------------------------------------------------| + * | | | | | | | |AF2| | | | | PgUp | | + * |-----------------------------------------------------------| + * | | | | |Alt |Pos1|PgDn|End | + * `-----------------------------------------------------------' + */ + [_TAB] = KEYMAP_ISO_SPLITRSHIFT( + KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, _______, GER_CUR_L, GER_CUR_R, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, M(1), _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), + + /* Keymap 3: Split right shift Numpad toggle Layer (by tapping the split rshift key) + * ,-----------------------------------------------------------. + * |RSET| | | | | | | 7| 8| 9| | | |Backsp | + * |-----------------------------------------------------------| + * | | | | | | | | 4 | 5 | 6 | | | | \ | + * |-----------------------------------------------------------| + * | | L | L | | | | | 1 | 2 | 3 | | | Return | + * |-----------------------------------------------------------| + * | | | L | L | L | L | L | L | | 0 | | /| Up | | All "L"s represent + * |-----------------------------------------------------------| LED controlling + * |Ctrl|Win |Alt | |Alt |Left|Down|Right| + * `-----------------------------------------------------------' + */ + [_SFX] = KEYMAP_ISO_SPLITRSHIFT( + RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \ + _______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \ + _______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \ + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT), +}; + +enum function_id { + LAUNCH, + RGBLED_TOGGLE, +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_FUNCTION(LAUNCH), + [10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + return (record->event.pressed ? + MACRO( D(RALT), T(SPC), U(RALT), END ) + :MACRO( END )); + break; + case 1: + return (record->event.pressed ? + MACRO( D(LALT), T(F2), U(LALT), END ) + :MACRO( END )); + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/amj60/keymaps/iso_split_rshift/updatemerge.sh b/keyboards/amj60/keymaps/iso_split_rshift/updatemerge.sh new file mode 100755 index 000000000..da5457e19 --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/updatemerge.sh @@ -0,0 +1,4 @@ +#!/bin/bash +git checkout amj60 # gets you on branch amj60 +git fetch origin # gets you up to date with origin +git merge origin/master -- cgit v1.2.3-24-g4f1b From 068e76bbf048236aa4b48adefe979024b39b6a65 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 18 Aug 2016 13:10:02 +0200 Subject: uniform whitespace --- keyboards/amj60/amj60.h | 90 ++++++++++++++++++++++++------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/keyboards/amj60/amj60.h b/keyboards/amj60/amj60.h index f966a2ba0..a0cb47331 100644 --- a/keyboards/amj60/amj60.h +++ b/keyboards/amj60/amj60.h @@ -21,17 +21,17 @@ */ #define KEYMAP( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49,\ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ - k40, k41, k42, k45, k4a, k4b, k4c, k4d \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ - {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ - {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ } /* @@ -50,17 +50,17 @@ */ #define KEYMAP_ANSI( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ - k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ - k40, k41, k42, k45, k4a, k4b, k4c, k4d \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ - {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d}, \ - {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ } /* AMJ60 HHKB matrix layout @@ -79,17 +79,17 @@ #define KEYMAP_HHKB( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ - k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ - k40, k41, k42, k45, k4a, k4b, k4c, k4d \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ - {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ - {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ } /* ISO @@ -107,17 +107,17 @@ */ #define KEYMAP_ISO( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ - k40, k41, k42, k45, k4a, k4b, k4c, k4d \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ - {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, XXX}, \ - {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, XXX}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ } /* ISO w/ split right shift key matrix layout * ,-----------------------------------------------------------. @@ -134,17 +134,17 @@ */ #define KEYMAP_ISO_SPLITRSHIFT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ - k40, k41, k42, k45, k4a, k4b, k4c, k4d \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ - {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ - {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ - {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ } void matrix_init_user(void); -- cgit v1.2.3-24-g4f1b From 0d9d4b8658e27f54188bfd9952b43b384f53a257 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 18 Aug 2016 13:20:25 +0200 Subject: planck/circuit: Update after the latest tap-dance change Fixes #653. Signed-off-by: Gergely Nagy --- keyboards/planck/keymaps/circuit/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/planck/keymaps/circuit/keymap.c b/keyboards/planck/keymaps/circuit/keymap.c index 5096decb9..63e01f389 100644 --- a/keyboards/planck/keymaps/circuit/keymap.c +++ b/keyboards/planck/keymaps/circuit/keymap.c @@ -43,7 +43,7 @@ enum planck_keycodes { // Tap Dance Definitions #ifdef TAP_DANCE_ENABLE -const qk_tap_dance_action_t tap_dance_actions[] = { +qk_tap_dance_action_t tap_dance_actions[] = { [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) }; #endif -- cgit v1.2.3-24-g4f1b From 0edf7c7cad356e85cae2d91b8811216006f0be14 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 18 Aug 2016 15:22:34 +0200 Subject: first attempt at documentation for the amj60 board --- keyboards/amj60/readme.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 keyboards/amj60/readme.md diff --git a/keyboards/amj60/readme.md b/keyboards/amj60/readme.md new file mode 100644 index 000000000..6c9c634b1 --- /dev/null +++ b/keyboards/amj60/readme.md @@ -0,0 +1,57 @@ +AMJ60 keyboard firmware +====================== +DIY/Assembled compact 60% keyboard. + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/amj60 +folder. Once your dev env is setup, you'll be able to type `make` to generate +your .hex - you can then use `make dfu` to program your PCB once you hit the +reset button. + +Depending on which keymap you would like to use, you will have to compile +slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to +define your favorite layout yourself. To define your own keymap create file +named `.c` in the keymaps folder, and see keymap document (you can find +in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with +`KEYMAP` option like: +`` +$ make KEYMAP=[default|jack|] +`` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` +folder. + +## Variations +KEYMAP macros for the following layouts are available: + +* default, for all the available, possible keys +* ANSI, for 60% ANSI keyboard +* ISO +* ISO w/ split right shift key +* HHKB + +Remark: all but "ISO w/ split tight shift key" are untested and were done to the best of my knowledge. + +### Original tmk firmware +The original firmware that was used to port to qmk can be found [here](https://github.com/AMJKeyboard/AMJ60). + +## Further information +Since information and documentation for this board are sparse, (at least for non-chinese speaking ppl) here is everything that could be found + +* [geekhack discussion](https://geekhack.org/index.php?topic=53070.0) +* [chinese discussion](https://www.v2ex.com/t/161887) +* Board has [dedicated pinouts](https://i.imgur.com/D0sWhyh.jpg?1) for a bluetooth module +* has pins for external power [picture](https://i.imgur.com/00VrtIp.jpg?1). +* most information comes from [reddit](https://www.reddit.com/r/MechanicalKeyboards/comments/32oonr/gh60_pcb_for_your_custom_keyboard/) -- cgit v1.2.3-24-g4f1b From 0e86c852412030eaba16b2eaab65a6827d150119 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 18 Aug 2016 15:30:52 +0200 Subject: amj60 variant of the readme --- keyboards/amj60/keymaps/iso_split_rshift/readme.md | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 keyboards/amj60/keymaps/iso_split_rshift/readme.md diff --git a/keyboards/amj60/keymaps/iso_split_rshift/readme.md b/keyboards/amj60/keymaps/iso_split_rshift/readme.md new file mode 100644 index 000000000..2113d93e4 --- /dev/null +++ b/keyboards/amj60/keymaps/iso_split_rshift/readme.md @@ -0,0 +1,30 @@ +toneman77's custom spacefn Layout +===================== + +##Quantum MK Firmware +For the full Quantum feature list, see the parent readme.md. + +# Features +* heavily modified ISO (!) layout with split right shift key +* spaceFn +* Dual-Role keys: +* + | Original key | when tapped | when held | + | ---------------- | ------------- | ------------- | + | Space | Space | layer change | + | Caps lock | Escape | Control | + | Tab | Tab | layer change | + | Enter | Enter | Control | + +* vim-style arrow keys on hjkl (spacefn layer) +* corresponding Home/PgDn/PgUp/End on hjkl (tab layer) +* bonus arrow keys in the bottom right corner on Alt/Win/Menu/rCtrl/Shift +* more bonus arrow keys on wasd (spacefn layer) +* media keys prev/next/play/vol+/vol- (spacefn layer) +* firmware bootloader button +* additional brackets that only work in german layout due to horrible placement +in the default qwertz layout + + +### Additional Credits +* visualization of the layers [here](http://www.keyboard-layout-editor.com/#/gists/aba4e4396459ede85bc66a22cee88e48) (without the LED keys) -- cgit v1.2.3-24-g4f1b From fe906538861c5ee30a75d6f955e611dd38d93977 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 18 Aug 2016 15:32:06 +0200 Subject: smyll typo fixed --- keyboards/amj60/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/amj60/readme.md b/keyboards/amj60/readme.md index 6c9c634b1..0896134e0 100644 --- a/keyboards/amj60/readme.md +++ b/keyboards/amj60/readme.md @@ -42,7 +42,7 @@ KEYMAP macros for the following layouts are available: * ISO w/ split right shift key * HHKB -Remark: all but "ISO w/ split tight shift key" are untested and were done to the best of my knowledge. +Remark: all but "ISO w/ split right shift key" are untested and were done to the best of my knowledge. ### Original tmk firmware The original firmware that was used to port to qmk can be found [here](https://github.com/AMJKeyboard/AMJ60). -- cgit v1.2.3-24-g4f1b From 21dc8381d1d428f7b0f6eb4ebe5c6536e3bd2b57 Mon Sep 17 00:00:00 2001 From: Toni Date: Thu, 18 Aug 2016 15:57:17 +0200 Subject: made a correct default KEYMAP. moved the old one to KEYMAP_ANSI fixed all layouts that were referencing KEYMAP to KEYMAP_ANSI whitespace prettyfying --- keyboards/satan/keymaps/default/keymap.c | 4 +-- keyboards/satan/keymaps/denolfe/keymap.c | 36 +++++++++++----------- keyboards/satan/keymaps/poker/keymap.c | 46 ++++++++++++++--------------- keyboards/satan/keymaps/stanleylai/keymap.c | 22 +++++++------- keyboards/satan/satan.h | 37 +++++++++++++++++++---- 5 files changed, 86 insertions(+), 59 deletions(-) diff --git a/keyboards/satan/keymaps/default/keymap.c b/keyboards/satan/keymaps/default/keymap.c index 3806137e7..2bf49d2e6 100644 --- a/keyboards/satan/keymaps/default/keymap.c +++ b/keyboards/satan/keymaps/default/keymap.c @@ -27,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | * `-----------------------------------------------------------' */ -[_BL] = KEYMAP( +[_BL] = KEYMAP_ANSI( F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ @@ -47,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ -[_FL] = KEYMAP( +[_FL] = KEYMAP_ANSI( #ifdef RGBLIGHT_ENABLE KC_GRV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG, \ diff --git a/keyboards/satan/keymaps/denolfe/keymap.c b/keyboards/satan/keymaps/denolfe/keymap.c index 2f6c8d8f4..5f189d78a 100644 --- a/keyboards/satan/keymaps/denolfe/keymap.c +++ b/keyboards/satan/keymaps/denolfe/keymap.c @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | * `-----------------------------------------------------------' */ -[_BL] = KEYMAP( +[_BL] = KEYMAP_ANSI( F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ @@ -49,27 +49,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ -[_FL] = KEYMAP( +[_FL] = KEYMAP_ANSI( #ifdef RGBLIGHT_ENABLE - KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, F(1), F(2), F(3), F(4), F(5), F(6), F(7), F(8), KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #else - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, KC_END, KC_MPRV, KC_MNXT, KC_MPLY, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_HOME, LCTL(KC_LEFT), LCTL(KC_END), LCTL(KC_RIGHT), KC_TRNS, RESET, \ - KC_TRNS, KC_TRNS, F(9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, KC_END, KC_MPRV, KC_MNXT, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_HOME, LCTL(KC_LEFT), LCTL(KC_END), LCTL(KC_RIGHT), KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, F(9), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #endif -[_SL] = KEYMAP( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, LSFT(KC_END), KC_MPRV, KC_MNXT, KC_MPLY, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_UP), LSFT(KC_RIGHT), KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, LSFT(KC_HOME), LCTL(LSFT(KC_LEFT)), LCTL(LSFT(KC_END)), LCTL(LSFT(KC_RIGHT)), KC_TRNS, RESET, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +[_SL] = KEYMAP_ANSI( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_PGUP, KC_TRNS, LSFT(KC_END), KC_MPRV, KC_MNXT, KC_MPLY, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_LEFT), LSFT(KC_DOWN), LSFT(KC_UP), LSFT(KC_RIGHT), KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, LSFT(KC_HOME), LCTL(LSFT(KC_LEFT)), LCTL(LSFT(KC_END)), LCTL(LSFT(KC_RIGHT)), KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; enum function_id { diff --git a/keyboards/satan/keymaps/poker/keymap.c b/keyboards/satan/keymaps/poker/keymap.c index 8181955cf..9da7d29b7 100644 --- a/keyboards/satan/keymaps/poker/keymap.c +++ b/keyboards/satan/keymaps/poker/keymap.c @@ -25,12 +25,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | * `-----------------------------------------------------------' */ -[_BL] = KEYMAP( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, MO(_RL), MO(_FL), KC_RCTL), +[_BL] = KEYMAP_ANSI( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_RL), MO(_FL), KC_RCTL), /* Keymap _FL: Function Layer * ,-----------------------------------------------------------. @@ -45,12 +45,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ -[_FL] = KEYMAP( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ - KC_TRNS,KC_TRNS, KC_UP, KC_TRNS,KC_TRNS,KC_TRNS, KC_CALC,KC_TRNS,KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ - KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +[_FL] = KEYMAP_ANSI( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), /* Keymap _RL: Function Layer * ,-----------------------------------------------------------. @@ -65,19 +65,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ -[_RL] = KEYMAP( +[_RL] = KEYMAP_ANSI( #ifdef RGBLIGHT_ENABLE - KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #else - KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ - KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_INC, BL_TOGG, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #endif }; diff --git a/keyboards/satan/keymaps/stanleylai/keymap.c b/keyboards/satan/keymaps/stanleylai/keymap.c index 623427e97..979c122e5 100644 --- a/keyboards/satan/keymaps/stanleylai/keymap.c +++ b/keyboards/satan/keymaps/stanleylai/keymap.c @@ -26,25 +26,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Function layer [_FL] = KEYMAP_HHKB( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, \ - KC_NO, KC_MPRV, KC_UP, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LT(_RGBL, KC_PGUP), KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, \ + KC_NO, KC_MPRV, KC_UP, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LT(_RGBL, KC_PGUP), KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_HOME, KC_PGDN, KC_END), // RGB Layer [_RGBL] = KEYMAP_HHKB( #ifdef RGBLIGHT_ENABLE RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_NO, KC_NO, KC_TRNS, KC_TRNS,\ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_NO, KC_NO, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #else RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS,\ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_NO, BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), #endif }; diff --git a/keyboards/satan/satan.h b/keyboards/satan/satan.h index 33a10292c..f3cbd5305 100644 --- a/keyboards/satan/satan.h +++ b/keyboards/satan/satan.h @@ -6,15 +6,15 @@ // readability #define XXX KC_NO -/* Satan GH60 matrix layout +/* Satan GH60 matrix layout (3c is right of 3d, 3d is shift) * ,-----------------------------------------------------------. - * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | + * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d| 49| * |-----------------------------------------------------------| * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | * |-----------------------------------------------------------| - * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2c|2d | * |-----------------------------------------------------------| - * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | + * | 30 | 31| 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | 3c | * |-----------------------------------------------------------| * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | * `-----------------------------------------------------------' @@ -22,10 +22,37 @@ // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array #define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k49,\ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ +} +/* Satan GH60 ANSI layout + * ,-----------------------------------------------------------. + * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | + * |-----------------------------------------------------------| + * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | + * |-----------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | + * |-----------------------------------------------------------| + * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | + * |-----------------------------------------------------------| + * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | + * `-----------------------------------------------------------' + */ +#define KEYMAP_ANSI( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ - k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ k40, k41, k42, k45, k4a, k4b, k4c, k4d \ ) \ { \ -- cgit v1.2.3-24-g4f1b From a5e6da7aa8173bb4cac8569d01b64ea2839474af Mon Sep 17 00:00:00 2001 From: Damien Date: Thu, 18 Aug 2016 22:25:13 +0200 Subject: Added dbroqua layout for planck keyboard --- keyboards/planck/keymaps/dbroqua/keymap.c | 314 ++++++++++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 keyboards/planck/keymaps/dbroqua/keymap.c diff --git a/keyboards/planck/keymaps/dbroqua/keymap.c b/keyboards/planck/keymaps/dbroqua/keymap.c new file mode 100644 index 000000000..775f1d56f --- /dev/null +++ b/keyboards/planck/keymaps/dbroqua/keymap.c @@ -0,0 +1,314 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE +#include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | | Alt |Lower | Space |Raise |AltGr | [ | ] | \ | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_LCTL, KC_LGUI, _______, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, KC_LBRC, KC_RBRC, KC_BSLS} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | Home | PgDwn| PgUp | End | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | |Insert| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| | | | | | | | | | Del | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, + {_______,_______,_______,_______,_______,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END,_______,_______}, + {_______, _______, _______, _______, _______, _______, _______,_______,_______,_______, _______, KC_INS}, + {BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | - | = | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | Left | Down | Up | Right| | ` | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | Mute | Vol+ | Vol- | | | |Insert| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Prev | Play | Next | Del | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL}, + {_______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_GRV}, + {_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD, _______, _______, _______, KC_INS}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_DEL} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif -- cgit v1.2.3-24-g4f1b From ea7115534afb23571f11af38c19b4835e1699c7e Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Fri, 19 Aug 2016 00:17:57 +0200 Subject: Improve the dynamic macro documentation --- readme.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 119995a5c..37f140839 100644 --- a/readme.md +++ b/readme.md @@ -721,7 +721,7 @@ Below these two modifications include the `dynamic_macro.h` header: #include "dynamic_macro.h"` -Then define the `_DYN` layer with the following keys: `DYN_REC_START1`, `DYN_REC_PLAY1`,`DYN_REC_START2` and `DYN_REC_PLAY2`. It may also contain other keys, it doesn't matter apart from the fact that you won't be able to record these keys in the dynamic macros. +Then define the `_DYN` layer with the following keys: `DYN_REC_START1`, `DYN_MACRO_PLAY1`,`DYN_REC_START2` and `DYN_MACRO_PLAY2`. It may also contain other keys, it doesn't matter apart from the fact that you won't be able to record these keys in the dynamic macros. [_DYN]= { {_______, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, _______, _______, _______, _______, _______}, @@ -736,7 +736,11 @@ Add the following code to the very beginning of your `process_record_user()` fun return false; } -The usage should be pretty self-explanatory. For the details, please read the comments in the `dynamic_macro.h` header. +To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `_DYN` layer button. The handler awaits specifically for the `MO(_DYN)` keycode as the "stop signal" so please don't use any fancy ways to access this layer, use the regular `MO()` modifier. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`. + +If the LED-s start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 256; please read the comments for it in the header). + +For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header. ## Additional keycode aliases for software-implemented layouts (Colemak, Dvorak, etc) -- cgit v1.2.3-24-g4f1b From ed1291bfbddc19c410e9c6d7bc4775b638b3e316 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Thu, 18 Aug 2016 22:43:31 -0700 Subject: Added compatibility for the Infinity ErgoDox to my Ergodox keymap. Updated readme.md to reflect this change. --- keyboards/ergodox/keymaps/xyverz/keymap.c | 225 ++++++++++++++++++++++------- keyboards/ergodox/keymaps/xyverz/readme.md | 6 +- 2 files changed, 178 insertions(+), 53 deletions(-) diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c index 7a16367bf..397c8566f 100644 --- a/keyboards/ergodox/keymaps/xyverz/keymap.c +++ b/keyboards/ergodox/keymaps/xyverz/keymap.c @@ -1,7 +1,7 @@ /* - * PLEASE NOTE: This keymap will NOT work with the Infinity ErgoDox due to the fact that the mappings are - * based on the Matrix Layout in the ez.h file. If you want to use this for the infinity, you'll need to - * figure out where the keys are in the matrix and redo the layout arrays below. + * PLEASE NOTE: This keymap has been updated to work with the Infinity ErgoDox. To build for the Infinity, + * simply append `SUBPROJECT=infinity` to the end of your `make` statement. This keymap file is untested + * on the Infinity ErgoDox. * * About this keymap: * @@ -38,6 +38,11 @@ extern keymap_config_t keymap_config; #define QWERTY M(_QW) #define COLEMAK M(_CM) +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_DV] = { // layer 0 : Dvorak @@ -62,24 +67,48 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' * */ +#ifdef SUBPROJECT_infinity // Infinity Ergodox + // left hand + {XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_HOME}, + {XXXXXXX, XXXXXXX, XXXXXXX, KC_LCTL, KC_END }, + {KC_6, MO(_KP), XXXXXXX, MO(_MD), KC_DEL }, + {KC_5, KC_Y, KC_I, KC_X, KC_BSPC}, + {KC_4, KC_P, KC_U, KC_K, KC_RGHT}, + {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT}, + {KC_2, KC_COMM, KC_O, KC_Q, KC_INS }, + {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV }, + {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI}, + + //Right Hand + {XXXXXXX, XXXXXXX, XXXXXXX, KC_RALT, KC_PGUP}, + {XXXXXXX, XXXXXXX, XXXXXXX, KC_RCTL, KC_PGDN}, + {KC_ESC, MO(_MD), XXXXXXX, MO(_KP), KC_ENT }, + {KC_6, KC_F, KC_D, KC_B, KC_SPC }, + {KC_7, KC_G, KC_H, KC_M, KC_UP }, + {KC_8, KC_C, KC_T, KC_W, KC_DOWN}, + {KC_9, KC_R, KC_N, KC_V, KC_SLSH}, + {KC_0, KC_L, KC_S, KC_Z, KC_EQL }, + {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI} +#else // Ergodox and Ergodox EZ // left hand - {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, KC_NO }, + {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, XXXXXXX}, {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV, KC_END }, {KC_2, KC_COMM, KC_O, KC_Q, KC_INS, KC_DEL }, {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT, KC_BSPC}, {KC_4, KC_P, KC_U, KC_K, KC_RGHT, KC_HOME}, - {KC_5, KC_Y, KC_I, KC_X, KC_NO, KC_LCTL}, - {KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT}, + {KC_5, KC_Y, KC_I, KC_X, XXXXXXX, KC_LCTL}, + {KC_ESC, XXXXXXX, XXXXXXX, MO(_MD), XXXXXXX, KC_LALT}, // right hand - {KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT}, - {KC_6, KC_F, KC_D, KC_B, KC_NO, KC_RCTL}, + {KC_ESC, XXXXXXX, XXXXXXX, MO(_KP), XXXXXXX, KC_RALT}, + {KC_6, KC_F, KC_D, KC_B, XXXXXXX, KC_RCTL}, {KC_7, KC_G, KC_H, KC_M, KC_UP, KC_PGUP}, {KC_8, KC_C, KC_T, KC_W, KC_DOWN, KC_SPC }, {KC_9, KC_R, KC_N, KC_V, KC_SLSH, KC_ENT }, {KC_0, KC_L, KC_S, KC_Z, KC_EQL, KC_PGDN}, - {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI, KC_NO } -}, + {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI, XXXXXXX} +#endif + }, [_QW] = { // layer 1 : QWERTY @@ -103,23 +132,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | End | | PgDn | | | * `--------------------' `--------------------' */ +#ifdef SUBPROJECT_infinity // Infinity Ergodox + // left hand + {XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_HOME}, + {XXXXXXX, XXXXXXX, XXXXXXX, KC_LCTL, KC_END }, + {KC_6, MO(_KP), XXXXXXX, MO(_MD), KC_DEL }, + {KC_5, KC_Y, KC_I, KC_X, KC_BSPC}, + {KC_4, KC_P, KC_U, KC_K, KC_RGHT}, + {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT}, + {KC_2, KC_COMM, KC_O, KC_Q, KC_INS }, + {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV }, + {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI}, + + //Right Hand + {XXXXXXX, XXXXXXX, XXXXXXX, KC_RALT, KC_PGUP}, + {XXXXXXX, XXXXXXX, XXXXXXX, KC_RCTL, KC_PGDN}, + {KC_ESC, MO(_MD), XXXXXXX, MO(_KP), KC_ENT }, + {KC_6, KC_F, KC_D, KC_B, KC_SPC }, + {KC_7, KC_G, KC_H, KC_M, KC_UP }, + {KC_8, KC_C, KC_T, KC_W, KC_DOWN}, + {KC_9, KC_R, KC_N, KC_V, KC_SLSH}, + {KC_0, KC_L, KC_S, KC_Z, KC_EQL }, + {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI} +#else // Ergodox and Ergodox EZ // left hand - {KC_EQL, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, KC_NO }, + {KC_EQL, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, XXXXXXX}, {KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END }, {KC_2, KC_W, KC_S, KC_X, KC_INS, KC_DEL }, {KC_3, KC_E, KC_D, KC_C, KC_LEFT, KC_BSPC}, {KC_4, KC_R, KC_F, KC_V, KC_RGHT, KC_HOME}, - {KC_5, KC_T, KC_G, KC_B, KC_NO, KC_LCTL}, - {KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT}, + {KC_5, KC_T, KC_G, KC_B, XXXXXXX, KC_LCTL}, + {KC_ESC, XXXXXXX, XXXXXXX, MO(_MD), XXXXXXX, KC_LALT}, // right hand - {KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT}, - {KC_6, KC_Y, KC_H, KC_N, KC_NO, KC_RCTL}, + {KC_ESC, XXXXXXX, XXXXXXX, MO(_KP), XXXXXXX, KC_RALT}, + {KC_6, KC_Y, KC_H, KC_N, XXXXXXX, KC_RCTL}, {KC_7, KC_U, KC_J, KC_M, KC_UP, KC_PGUP}, {KC_8, KC_I, KC_K, KC_COMM, KC_DOWN, KC_SPC }, {KC_9, KC_O, KC_L, KC_DOT, KC_LBRC, KC_ENT }, {KC_0, KC_P, KC_SCLN, KC_SLSH, KC_RBRC, KC_PGDN}, - {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, KC_NO } + {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, XXXXXXX} +#endif }, @@ -144,23 +197,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | End | | PgDn | | | * `--------------------' `--------------------' */ +#ifdef SUBPROJECT_infinity // Infinity Ergodox + // left hand + {XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_HOME}, + {XXXXXXX, XXXXXXX, XXXXXXX, KC_LCTL, KC_END }, + {KC_6, MO(_KP), XXXXXXX, MO(_MD), KC_DEL }, + {KC_5, KC_Y, KC_I, KC_X, KC_BSPC}, + {KC_4, KC_P, KC_U, KC_K, KC_RGHT}, + {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT}, + {KC_2, KC_COMM, KC_O, KC_Q, KC_INS }, + {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV }, + {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI}, + + //Right Hand + {XXXXXXX, XXXXXXX, XXXXXXX, KC_RALT, KC_PGUP}, + {XXXXXXX, XXXXXXX, XXXXXXX, KC_RCTL, KC_PGDN}, + {KC_ESC, MO(_MD), XXXXXXX, MO(_KP), KC_ENT }, + {KC_6, KC_F, KC_D, KC_B, KC_SPC }, + {KC_7, KC_G, KC_H, KC_M, KC_UP }, + {KC_8, KC_C, KC_T, KC_W, KC_DOWN}, + {KC_9, KC_R, KC_N, KC_V, KC_SLSH}, + {KC_0, KC_L, KC_S, KC_Z, KC_EQL }, + {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI} +#else // Ergodox and Ergodox EZ // left hand - {KC_EQL, KC_TAB, KC_BSPC, KC_LSFT, KC_LGUI, KC_NO }, + {KC_EQL, KC_TAB, KC_BSPC, KC_LSFT, KC_LGUI, XXXXXXX}, {KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END }, {KC_2, KC_W, KC_R, KC_X, KC_INS, KC_DEL }, {KC_3, KC_F, KC_S, KC_C, KC_LEFT, KC_BSPC}, {KC_4, KC_P, KC_T, KC_V, KC_RGHT, KC_HOME}, - {KC_5, KC_G, KC_D, KC_B, KC_NO, KC_LCTL}, - {KC_ESC, KC_NO, KC_NO, MO(_MD), KC_NO, KC_LALT}, + {KC_5, KC_G, KC_D, KC_B, XXXXXXX, KC_LCTL}, + {KC_ESC, XXXXXXX, XXXXXXX, MO(_MD), XXXXXXX, KC_LALT}, // right hand - {KC_ESC, KC_NO, KC_NO, MO(_KP), KC_NO, KC_RALT}, - {KC_6, KC_J, KC_H, KC_K, KC_NO, KC_RCTL}, + {KC_ESC, XXXXXXX, XXXXXXX, MO(_KP), XXXXXXX, KC_RALT}, + {KC_6, KC_J, KC_H, KC_K, XXXXXXX, KC_RCTL}, {KC_7, KC_L, KC_N, KC_M, KC_UP, KC_PGUP}, {KC_8, KC_U, KC_E, KC_COMM, KC_DOWN, KC_SPC }, {KC_9, KC_Y, KC_I, KC_DOT, KC_LBRC, KC_ENT }, {KC_0, KC_SCLN, KC_O, KC_SLSH, KC_RBRC, KC_PGDN}, - {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, KC_NO } + {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, XXXXXXX} +#endif }, @@ -185,23 +262,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ +#ifdef SUBPROJECT_infinity // Infinity Ergodox + // left hand + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, + {KC_F11, _______, XXXXXXX, _______, _______}, + {KC_F5, _______, _______, _______, _______}, + {KC_F4, KC_PAUS, _______, COLEMAK, _______}, + {KC_F3, KC_SLCK, _______, QWERTY, _______}, + {KC_F2, KC_PSCR, _______, DVORAK, _______}, + {KC_F1, _______, _______, _______, _______}, + {RESET, _______, _______, _______, _______}, + + //Right Hand + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, + {KC_F12, _______, XXXXXXX, _______, _______}, + {KC_F6, _______, KC_MSTP, _______, _______}, + {KC_F7, KC_VOLU, KC_MPRV, _______, _______}, + {KC_F8, KC_VOLD, KC_MPLY, _______, _______}, + {KC_F9, KC_MUTE, KC_MNXT, _______, _______}, + {KC_F10, _______, KC_MSEL, _______, _______}, + {_______, _______, _______, _______, _______}, +#else // Ergodox and Ergodox EZ // left hand - {RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO }, - {KC_F1, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_F2, KC_PSCR, KC_TRNS, DVORAK, KC_TRNS, KC_TRNS}, - {KC_F3, KC_SLCK, KC_TRNS, QWERTY, KC_TRNS, KC_TRNS}, - {KC_F4, KC_PAUS, KC_TRNS, COLEMAK, KC_TRNS, KC_TRNS}, - {KC_F5, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS}, - {KC_F11, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS}, + {RESET, _______, _______, _______, _______, XXXXXXX}, + {KC_F1, _______, _______, _______, _______, _______}, + {KC_F2, KC_PSCR, _______, DVORAK, _______, _______}, + {KC_F3, KC_SLCK, _______, QWERTY, _______, _______}, + {KC_F4, KC_PAUS, _______, COLEMAK, _______, _______}, + {KC_F5, _______, _______, _______, XXXXXXX, _______}, + {KC_F11, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______}, // right hand - {KC_F12, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS}, - {KC_F6, KC_TRNS, KC_MSTP, KC_TRNS, KC_NO, KC_TRNS}, - {KC_F7, KC_MUTE, KC_MPRV, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_F8, KC_VOLD, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_F9, KC_VOLU, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_F10, KC_TRNS, KC_MSEL, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO } + {KC_F12, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______}, + {KC_F6, _______, KC_MSTP, _______, XXXXXXX, _______}, + {KC_F7, KC_MUTE, KC_MPRV, _______, _______, _______}, + {KC_F8, KC_VOLD, KC_MPLY, _______, _______, _______}, + {KC_F9, KC_VOLU, KC_MNXT, _______, _______, _______}, + {KC_F10, _______, KC_MSEL, _______, _______, _______}, + {_______, _______, _______, _______, _______, XXXXXXX} +#endif }, @@ -226,23 +327,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ +#ifdef SUBPROJECT_infinity // Infinity Ergodox + // left hand + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, + {_______, _______, XXXXXXX, _______, _______}, + {_______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______}, + {KC_PWR, KC_SLEP, KC_WAKE, _______, _______}, + + //Right Hand + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, + {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, + {_______, _______, XXXXXXX, _______, _______}, + {_______, _______, KC_MSTP, _______, _______}, + {KC_NLCK, KC_P7, KC_P4, KC_P1, KC_P0 }, + {KC_PSLS, KC_P8, KC_P5, KC_P2, _______}, + {KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT}, + {KC_PMNS, KC_PPLS, KC_PPLS, KC_PENT, KC_PENT}, + {_______, _______, _______, _______, _______}, +#else // Ergodox and Ergodox EZ // left hand - {KC_PWR, KC_SLEP, KC_WAKE, KC_TRNS, KC_TRNS, KC_NO }, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS}, - {KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS}, + {KC_PWR, KC_SLEP, KC_WAKE, _______, _______, XXXXXXX}, + {_______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, XXXXXXX, _______}, + {_______, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______}, // right hand - {KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS}, - {KC_NLCK, KC_P7, KC_P4, KC_P1, KC_P0, KC_TRNS}, - {KC_PSLS, KC_P8, KC_P5, KC_P2, KC_NO, KC_TRNS}, - {KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, KC_TRNS}, - {KC_PMNS, KC_PPLS, KC_PPLS, KC_PENT, KC_PENT, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO } + {_______, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______}, + {_______, _______, _______, _______, XXXXXXX, _______}, + {KC_NLCK, KC_P7, KC_P4, KC_P1, KC_P0, _______}, + {KC_PSLS, KC_P8, KC_P5, KC_P2, XXXXXXX, _______}, + {KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, _______}, + {KC_PMNS, KC_PPLS, KC_PPLS, KC_PENT, KC_PENT, _______}, + {_______, _______, _______, _______, XXXXXXX, XXXXXXX} +#endif }, diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md index 255749323..e6cb582c5 100644 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -2,7 +2,7 @@ ## Please Note: -This keymap will probably **not** work with the Infinity ErgoDox. It will need **substantial** modification in order to work on the Infinity. This is due to the fact that the mappings are based on the matrix positions in the keymap definition in the ez.h file. If you want to use this for the infinity, you'll need to figure out where the keys are in the matrix and redo the layout arrays below. +This keymap has been updated to work with the Infinity ErgoDox. To build for the Infinity, simply append `SUBPROJECT=infinity` to the end of your `make` statement. This keymap file builds cleanly as is but as of this writing has not been tested on the Infinity ErgoDox. YMMV. ## About this keymap: @@ -12,7 +12,7 @@ The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts. -For a better explanation of the layout matrices shown below, take a look at ../../ez/ez.h where the keymap is defined, beginning on line 81. +For a better explanation of the layout matrices shown below, take a look at ../../ez/ez.h where the keymap is defined beginning on line 81, or in ../../infinity/infinity.h beginning at line 72. ### Layer 0: Dvorak layer @@ -119,4 +119,4 @@ For a better explanation of the layout matrices shown below, take a look at ../. | | | || | | | | | |------||------| | | | | | || | | | - `--------------------'`--------------------' \ No newline at end of file + `--------------------'`--------------------' -- cgit v1.2.3-24-g4f1b From bc0bd11430d09423208d5df17dec21e64854cb9a Mon Sep 17 00:00:00 2001 From: Toni Date: Fri, 19 Aug 2016 10:24:48 +0200 Subject: forgot media keys --- keyboards/amj60/keymaps/iso_split_rshift/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/amj60/keymaps/iso_split_rshift/Makefile b/keyboards/amj60/keymaps/iso_split_rshift/Makefile index 0d8416bbc..2969ed8ae 100644 --- a/keyboards/amj60/keymaps/iso_split_rshift/Makefile +++ b/keyboards/amj60/keymaps/iso_split_rshift/Makefile @@ -4,7 +4,7 @@ # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -- cgit v1.2.3-24-g4f1b From a1da23d827df80de1771dc7277dbba803507dabf Mon Sep 17 00:00:00 2001 From: zs Date: Fri, 19 Aug 2016 21:59:08 +0200 Subject: Add the workman-dead layout for kc60 --- keyboards/kc60/keymaps/workman-dead/README.md | 17 ++ .../kc60/keymaps/workman-dead/kc60-wm-dead.png | Bin 0 -> 117155 bytes keyboards/kc60/keymaps/workman-dead/keymap.c | 183 +++++++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100644 keyboards/kc60/keymaps/workman-dead/README.md create mode 100644 keyboards/kc60/keymaps/workman-dead/kc60-wm-dead.png create mode 100644 keyboards/kc60/keymaps/workman-dead/keymap.c diff --git a/keyboards/kc60/keymaps/workman-dead/README.md b/keyboards/kc60/keymaps/workman-dead/README.md new file mode 100644 index 000000000..f1fcdc960 --- /dev/null +++ b/keyboards/kc60/keymaps/workman-dead/README.md @@ -0,0 +1,17 @@ +# Workman dead with spacefn (kc60 @ QMK) + +## Layout reference +![workman dead with spacefn](./kc60-wm-dead.png) + +## Build + +To build this keymap, simply run `make KEYMAP=workman-dead`. + +## Notes + +* the default layout is `workman` (try it out, it's awesome!), but it can be changed to `qwerty` with the `rebel` key (the function layer won't change though) +* `comma` acts as a dead key, that means tapping/holding it will activate the **oneshot** `dead key` layer (marked red in the reference) +* hold `space` to access the `function` layer (marked blue in the reference) +* hold `tab` to activate the mouse layer +* the `function` layer contains mostly osx specific shortcuts +* on the right side of the bottom row `alt` and `super` are switched compared to a standard layout diff --git a/keyboards/kc60/keymaps/workman-dead/kc60-wm-dead.png b/keyboards/kc60/keymaps/workman-dead/kc60-wm-dead.png new file mode 100644 index 000000000..cc6a630a5 Binary files /dev/null and b/keyboards/kc60/keymaps/workman-dead/kc60-wm-dead.png differ diff --git a/keyboards/kc60/keymaps/workman-dead/keymap.c b/keyboards/kc60/keymaps/workman-dead/keymap.c new file mode 100644 index 000000000..103adeef6 --- /dev/null +++ b/keyboards/kc60/keymaps/workman-dead/keymap.c @@ -0,0 +1,183 @@ +#include "kc60.h" + +#define _WM 0 +#define _QW 1 +#define _DK 2 +#define _FUN 3 +#define _MS 4 + +#define _______ KC_NO +#define XXXXXXX KC_TRNS + +#define _DK_ACT 0 +#define _DK_REL 1 +#define _KC_COMS 2 +#define _KC_CENT 3 + +#define DK_ACT M(_DK_ACT) // activate dead key layer +#define DK_REL M(_DK_REL) // release dead key layer +#define KC_COMS M(_KC_COMS) // comma + space +#define KC_CENT M(_KC_CENT) // comma + enter +#define KC_TABM LT(_MS, KC_TAB) // press for tab, hold for mouse layer +#define KC_SPFN LT(_FUN, KC_SPC) // press for space, hold for function layer (aka spacefn) +#define KC_DFQW DF(_QW) // set default layer to qwerty +#define KC_DFWM DF(_WM) // set default layer to workman +#define KC_CMDQ LGUI(KC_Q) // command + q +#define KC_CMDD LGUI(KC_D) // command + d +#define KC_CMDA LGUI(KC_A) // command + a +#define KC_CMDS LGUI(KC_S) // command + s +#define KC_CMDZ LGUI(KC_Z) // command + z +#define KC_CMDX LGUI(KC_X) // command + x +#define KC_CMDC LGUI(KC_C) // command + c +#define KC_CMDV LGUI(KC_V) // command + v +#define KC_CSTB S(RCTL(KC_TAB)) // shift + control + tab +#define KC_C_TB RCTL(KC_TAB) // control + tab +#define KC_C_LF RCTL(KC_LEFT) // control + left +#define KC_C_RT RCTL(KC_RGHT) // control + right + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Workman +/* +* ,-----------------------------------------------------------. +* |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bsp | +* |-----------------------------------------------------------| +* |Tab/M| Q| D| R| W| B| J| F| U| P| ;| [| ]| \ | +* |-----------------------------------------------------------| +* |Ctrl | A| S| H| T| G| Y| N| E| O| I| '| Return | +* |-----------------------------------------------------------| +* |Shift | Z| X| M| C| V| K| L| ,| .| /| Shift | +* |-----------------------------------------------------------| +* |Ctrl | Alt | GUI | Space/FN | Alt | GUI | Ctrl | qwerty | +* `-----------------------------------------------------------' +*/ +[_WM] = KEYMAP( /* Workman */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TABM, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_LCTL, KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOT, _______, KC_ENT, \ + KC_LSFT, _______, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, DK_ACT, KC_DOT, KC_SLSH, _______, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPFN, KC_RALT, KC_RGUI, KC_RCTL, KC_DFQW), + +// QWERTY +/* +* ,-----------------------------------------------------------. +* |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bsp | +* |-----------------------------------------------------------| +* |Tab/M| Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | +* |-----------------------------------------------------------| +* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return | +* |-----------------------------------------------------------| +* |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | +* |-----------------------------------------------------------| +* |Ctrl | Alt | GUI | Space/FN | Alt | GUI | Ctrl | workman | +* `-----------------------------------------------------------' +*/ +[_QW] = KEYMAP( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TABM, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, _______, KC_ENT, \ + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, DK_ACT, KC_DOT, KC_SLSH, _______, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPFN, KC_RALT, KC_RGUI, KC_RCTL, KC_DOWN), + +// dead key layer +/* +* ,-----------------------------------------------------------. +* | | | | | | | | | | | | | | Bsp | +* |-----------------------------------------------------------| +* | | %| &| ?| +| @| $| _| [| ]| !| ~| ^| | +* |-----------------------------------------------------------| +* | | #| (| =| 0| {| }| 1| *| )| -| `| Return | +* |-----------------------------------------------------------| +* | | 6| 7| 8| 9| || \| 2| 3| 4| 5| | +* |-----------------------------------------------------------| +* |Ctrl | Alt | GUI | , | Alt | GUI | Ctrl | | +* `-----------------------------------------------------------' +*/ +[_DK] = KEYMAP( /* dead key layer */ + XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, \ + XXXXXXX, KC_PERC, KC_AMPR, KC_QUES, KC_PLUS, KC_AT, KC_DLR, KC_UNDS, KC_LBRC, KC_RBRC, KC_EXLM, KC_TILD, KC_CIRC, _______, \ + _______, KC_HASH, KC_LPRN, KC_EQL, KC_0, KC_LCBR, KC_RCBR, KC_1, KC_ASTR, KC_RPRN, KC_MINS, KC_GRV, _______, KC_CENT, \ + _______, _______, KC_6, KC_7, KC_8, KC_9, KC_PIPE, KC_BSLS, KC_2, DK_REL, KC_4, KC_5, _______, _______, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_COMS, KC_RALT, KC_RGUI, KC_RCTL, _______), + +// function layer +/* +* ,-----------------------------------------------------------. +* | | F1| F2| F3| F4| F5| F6| F7| F8| F9| F10| F11| F12|Del | +* |-----------------------------------------------------------| +* |Esc | Cq| Cd|cstb|ctb| | |pgd| up|pgu| | | |ins | +* |-----------------------------------------------------------| +* |Shift | Ca| Cs|clt|crt| | | lt| dw| rt|home|end| Bsp | +* |-----------------------------------------------------------| +* |Shift | Cz| Cx| | Cc| Cv| V-| V+|mute| | | | +* |-----------------------------------------------------------| +* |Ctrl | Alt | GUI | | Alt | GUI | Ctrl | Reset | +* `-----------------------------------------------------------' +*/ +[_FUN] = KEYMAP( /* function layer */ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, \ + KC_ESC, KC_CMDQ, KC_CMDD, KC_CSTB, KC_C_TB, _______, _______, KC_PGDN, KC_UP, KC_PGUP, _______, _______, _______, KC_INS, \ + KC_LSFT, KC_CMDA, KC_CMDS, KC_C_LF, KC_C_RT, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, KC_END, _______, KC_BSPC, \ + KC_LSFT, _______, KC_CMDZ, KC_CMDX, _______, KC_CMDC, KC_CMDV, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_RALT, KC_RGUI, KC_RCTL, RESET), + +// mouse layer +/* +* ,-----------------------------------------------------------. +* | | | | | | | | | | | | | | | +* |-----------------------------------------------------------| +* | |fast|med|slow| | | | | up| | | | | | +* |-----------------------------------------------------------| +* | | | | | | | | lt| dw| rt| rc| | | +* |-----------------------------------------------------------| +* | | | | | | | | | | | | | +* |-----------------------------------------------------------| +* | | | | lc | | | | | +* `-----------------------------------------------------------' +*/ +[_MS] = KEYMAP( /* mouse layer */ + XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + XXXXXXX, KC_ACL2, KC_ACL1, KC_ACL0, _______, _______, _______, _______, KC_MS_U, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN2, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_BTN1, _______, _______, _______, _______), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _KC_COMS: + if (record->event.pressed) { + return MACRO(T(COMM), T(SPC), END); // comma + space + } + break; + case _KC_CENT: + if (record->event.pressed) { + return MACRO(T(COMM), T(ENT), END); // comma + enter + } + break; + case _DK_ACT: + if (record->event.pressed) { + if (keyboard_report->mods & MOD_BIT(KC_LSFT) || keyboard_report->mods & MOD_BIT(KC_RSFT)) { // act as comma when shift is pressed (eg <) + register_code(KC_COMM); + } else { // activate oneshot dead key layer otherwise + layer_on(_DK); + set_oneshot_layer(_DK, ONESHOT_START); + } + } else { // make sure to deactive dead key layer on key release + clear_oneshot_layer_state(ONESHOT_PRESSED); + unregister_code(KC_COMM); + } + break; + case _DK_REL: + if (record->event.pressed) { // act as 3 on keypress + register_code(KC_3); + } else { // make sure to deactive dead key layer on key release + clear_oneshot_layer_state(ONESHOT_PRESSED); + unregister_code(KC_3); + } + break; + } + + return MACRO_NONE; +}; -- cgit v1.2.3-24-g4f1b From 50531068b3aa1b4aced20a1488e3ae052925f651 Mon Sep 17 00:00:00 2001 From: Sean Reifschneider Date: Fri, 19 Aug 2016 14:42:41 -0600 Subject: Adding jafo layout. --- keyboards/ergodox/keymaps/jafo/jafo-Notes | 10 ++ keyboards/ergodox/keymaps/jafo/jafo-layout.pdf | Bin 0 -> 185426 bytes keyboards/ergodox/keymaps/jafo/jafo_highres.png | Bin 0 -> 179460 bytes keyboards/ergodox/keymaps/jafo/keymap.c | 184 ++++++++++++++++++++++++ keyboards/ergodox/keymaps/jafo/readme.md | 20 +++ 5 files changed, 214 insertions(+) create mode 100644 keyboards/ergodox/keymaps/jafo/jafo-Notes create mode 100644 keyboards/ergodox/keymaps/jafo/jafo-layout.pdf create mode 100644 keyboards/ergodox/keymaps/jafo/jafo_highres.png create mode 100644 keyboards/ergodox/keymaps/jafo/keymap.c create mode 100644 keyboards/ergodox/keymaps/jafo/readme.md diff --git a/keyboards/ergodox/keymaps/jafo/jafo-Notes b/keyboards/ergodox/keymaps/jafo/jafo-Notes new file mode 100644 index 000000000..9376125e9 --- /dev/null +++ b/keyboards/ergodox/keymaps/jafo/jafo-Notes @@ -0,0 +1,10 @@ +These are notes on how to build and deploy the firmware to Ez, but they are +from before the qmk restructuring. + +cd qmk_firmware/keyboard/ergodox_ez +make KEYMAP=jafo +cp ergodox_ez.hex keymaps/jafo/ +/tmp/teensy.64bit +Open hex keymap file +Program +Upload diff --git a/keyboards/ergodox/keymaps/jafo/jafo-layout.pdf b/keyboards/ergodox/keymaps/jafo/jafo-layout.pdf new file mode 100644 index 000000000..189b49b12 Binary files /dev/null and b/keyboards/ergodox/keymaps/jafo/jafo-layout.pdf differ diff --git a/keyboards/ergodox/keymaps/jafo/jafo_highres.png b/keyboards/ergodox/keymaps/jafo/jafo_highres.png new file mode 100644 index 000000000..e3d7cef85 Binary files /dev/null and b/keyboards/ergodox/keymaps/jafo/jafo_highres.png differ diff --git a/keyboards/ergodox/keymaps/jafo/keymap.c b/keyboards/ergodox/keymaps/jafo/keymap.c new file mode 100644 index 000000000..c5f21bd82 --- /dev/null +++ b/keyboards/ergodox/keymaps/jafo/keymap.c @@ -0,0 +1,184 @@ +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Grv | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | = | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Esc/Cmd| A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |--------+------+------+------+------+------| L2 | | L2 |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" | Del | Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Ctrl/Esc| Alt| | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = KEYMAP( // layer 0 : default + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + GUI_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(MDIA), + LT(SYMB,KC_GRV),KC_QUOT, KC_DELT, KC_LEFT,KC_RGHT, + CTL_T(KC_ESC), KC_LALT, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + TG(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = KEYMAP( + // left hand + KC_TRNS,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| LEFT | DOWN | UP | RIGHT| | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | Lclk | Mclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN3, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/jafo/readme.md b/keyboards/ergodox/keymaps/jafo/readme.md new file mode 100644 index 000000000..c870dfd05 --- /dev/null +++ b/keyboards/ergodox/keymaps/jafo/readme.md @@ -0,0 +1,20 @@ +# ErgoDox EZ "jafo" Configuration + +This is a layout based on the ErgoDox Ez default layout, but with some +customizations I made for my use-case. I use Linux, vi and the i3 window +manager, so I made these changes: + +- Arrow keys laid out in vi positions in media layer. + +- Esc (tap) and Win (held) to the left of A. i3 uses Win key for navigation + and having that be symmetric on the left and right makes it easier. + +- Grave accent below equals, I was having a hard time using ~ + +- Layer 2 switch below the L1 switch, so I can go into a mode where I get + arrow keys under my vi motion fingers. + +- Making the Ctrl (held) and Esc (tap) on my thumbs symmetric. Not sure I + need that with the Esc left of A and Ctrl on the Z and / keys when held... + +![Jafo](jafo_highres.png) -- cgit v1.2.3-24-g4f1b From a25480b3b58f1fb779fe6d441023eeb3c72811f5 Mon Sep 17 00:00:00 2001 From: Sean Reifschneider Date: Fri, 19 Aug 2016 20:55:50 -0600 Subject: Bringing over changes from default map. --- keyboards/ergodox/keymaps/jafo/keymap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/keyboards/ergodox/keymaps/jafo/keymap.c b/keyboards/ergodox/keymaps/jafo/keymap.c index c5f21bd82..4f1428f2b 100644 --- a/keyboards/ergodox/keymaps/jafo/keymap.c +++ b/keyboards/ergodox/keymaps/jafo/keymap.c @@ -1,6 +1,7 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "debug.h" #include "action_layer.h" +#include "version.h" #define BASE 0 // default layer #define SYMB 1 // symbols @@ -145,9 +146,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) switch(id) { case 0: if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); } break; } -- cgit v1.2.3-24-g4f1b From 8f78ba1f739ac585d7b211bab473f6820452bc45 Mon Sep 17 00:00:00 2001 From: Nicholas Keene Date: Fri, 19 Aug 2016 23:38:13 -0500 Subject: The Ordinary Layout is boring because all the keys are where you expect them to be --- keyboards/ergodox/keymaps/ordinary/keymap.c | 118 ++++++++++----------- .../ergodox/keymaps/ordinary/ordinary-base.png | Bin 76549 -> 98200 bytes .../ergodox/keymaps/ordinary/ordinary-media.png | Bin 96205 -> 123435 bytes .../ergodox/keymaps/ordinary/ordinary-special.png | Bin 68418 -> 68292 bytes .../ergodox/keymaps/ordinary/ordinary-special.txt | 14 +-- .../ergodox/keymaps/ordinary/ordinary-symbol.png | Bin 73009 -> 101255 bytes .../ergodox/keymaps/ordinary/ordinary-symbol.txt | 12 +-- keyboards/ergodox/keymaps/ordinary/readme.md | 65 +++++------- 8 files changed, 98 insertions(+), 111 deletions(-) diff --git a/keyboards/ergodox/keymaps/ordinary/keymap.c b/keyboards/ergodox/keymaps/ordinary/keymap.c index eda45b7cb..302c41cc8 100644 --- a/keyboards/ergodox/keymaps/ordinary/keymap.c +++ b/keyboards/ergodox/keymaps/ordinary/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox_ez.h" +#include "ergodox.h" #include "led.h" #include "debug.h" #include "action_layer.h" @@ -31,31 +31,31 @@ * If you use or modify this layout I would love to hear from you. * * Details: readme.md - * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary + * https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/******* Base Layer ******************************************************************************************************** +/******* Base Layer **************************************************************************************************** * - * ,------------------------------------------------------. ,------------------------------------------------------. - * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | - * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| - * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | - * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| - * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | - * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| - * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | - * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' - * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Home | End | | Left | Right| - * ,------|------|------| |------+------+------. - * | | | PgUp | | Up | | | - * |Backsp| Del |------| |------| Enter| Space| - * | | | PgDn | | Down | | | - * `--------------------' `--------------------' + * ,------------------------------------------------------. ,------------------------------------------------------. + * | Special `~ | 1 | 2 | 3 | 4 | 5 | ESC | | - | 6 | 7 | 8 | 9 | 0 | =+ Special | + * |------------+------+------+------+------+-------------| |------+------+------+------+------+------+------------| + * | Media Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \| Media | + * |------------+------+------+------+------+------| | | |------+------+------+------+------+------------| + * | Symbol | A | S | D | F | G |------| |------| H | J | K | L | ; | '" Symbol | + * |------------+------+------+------+------+------|Shift | | Tab |------+------+------+------+------+------------| + * | Capitals | Z | X | C | V | B | -Tab | | | N | M | , | . | / | Capitals | + * `------------+------+------+------+------+-------------' `-------------+------+------+------+------+------------' + * | LCtrl | Meh |Hyper | LAlt | LGui | | RGui | RAlt | Hyper| Meh | RCtrl | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | Home | End | | Left | Right| + * ,------|------|------| |------+------+------. + * | | | PgUp | | Up | | | + * |Backsp| Del |------| |------| Enter| Space| + * | | | PgDn | | Down | | | + * `--------------------' `--------------------' */ [BASE] = KEYMAP( // left hand @@ -67,37 +67,37 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_HOME,KC_END ,KC_PGUP ,KC_BSPC,KC_DEL ,KC_PGDN - // right hand - ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) - ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) - ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) - ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT - ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL - ,KC_LEFT ,KC_RGHT - ,KC_UP - ,KC_DOWN ,KC_ENT ,KC_SPC + // right hand + ,KC_MINS ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,F(RSpec) + ,KC_RBRC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,F(RMdia) + ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,F(RSymb) + ,KC_TAB ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH ,KC_RSFT + ,KC_RGUI,KC_RALT,KC_HYPR ,KC_MEH ,KC_RCTL + ,KC_LEFT ,KC_RGHT + ,KC_UP + ,KC_DOWN ,KC_ENT ,KC_SPC ), -/******* Symbols Layer ***************************************************************************************************** +/******* Symbols Layer ************************************************************************************************* * - * ,-----------------------------------------------------. ,-----------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | - * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| - * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | - * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| - * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | - * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| - * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | - * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' - * | LCtrl | Meh |Hyper | LAlt | LGui | | 0 | . | = | + | Ent | - * `-----------------------------------' `-----------------------------------' - * ,-------------. ,-------------. - * | Left | Right| | Home | End | - * ,------|------|------| |------+------+------. - * | | | Up | | PgUp | | | - * |Space |Enter |------| |------|BackSp| Del | - * | | | Down | | PgDn | | | - * `--------------------' `--------------------' + * ,-----------------------------------------------------. ,-----------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | Esc | | - | F6 | F7 | F8 | F9 | F10 | | + * |-----------+------+------+------+------+-------------| |------+------+------+------+------+------+-----------| + * | | ! | @ | { | } | & | < | | > | | | 7 | 8 | 9 | / | | + * |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------| + * | | # | $ | ( | ) | ` |------| |------| / | 4 | 5 | 6 | * | | + * |-----------+------+------+------+------+------| Tab | | Shift|------+------+------+------+------+-----------| + * | | % | ^ | [ | ] | ~ | | | -Tab| \ | 1 | 2 | 3 | - | | + * `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------' + * | LCtrl | Meh |Hyper | LAlt | LGui | | 0 | . | = | + | Ent | + * `-----------------------------------' `-----------------------------------' + * ,-------------. ,-------------. + * | Left | Right| | Home | End | + * ,------|------|------| |------+------+------. + * | | | Up | | PgUp | | | + * |Space |Enter |------| |------|BackSp| Del | + * | | | Down | | PgDn | | | + * `--------------------' `--------------------' */ [SYMB] = KEYMAP( // left hand @@ -105,19 +105,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,KC_TRNS ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_AMPR ,LSFT(KC_COMM) ,KC_TRNS ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_GRV ,KC_TRNS ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_TILD ,KC_TAB -,KC_LCTL ,KC_MEH ,KC_HYPR,KC_LALT ,KC_LGUI +,KC_LCTL ,KC_MEH ,KC_HYPR ,KC_LALT ,KC_LGUI ,KC_LEFT ,KC_RGHT ,KC_UP ,KC_SPC ,KC_ENT ,KC_DOWN - // right hand - ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS - ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS - ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS - ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS - ,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT - ,KC_HOME ,KC_END - ,KC_PGUP - ,KC_PGDN ,KC_BSPC ,KC_DEL + // right hand + ,KC_MINS ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_TRNS + ,LSFT(KC_DOT),KC_PIPE ,KC_7 ,KC_8 ,KC_9 ,KC_SLSH ,KC_TRNS + ,KC_SLSH ,KC_4 ,KC_5 ,KC_6 ,KC_ASTR ,KC_TRNS + ,LSFT(KC_TAB),KC_BSLS ,KC_1 ,KC_2 ,KC_3 ,KC_MINS ,KC_TRNS + ,KC_0 ,KC_DOT ,KC_EQL,KC_PLUS ,KC_ENT + ,KC_HOME ,KC_END + ,KC_PGUP + ,KC_PGDN ,KC_BSPC ,KC_DEL ), /******* Media Layer ******************************************************************************************************* diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-base.png b/keyboards/ergodox/keymaps/ordinary/ordinary-base.png index 7f8c1b5c1..831db4f5d 100644 Binary files a/keyboards/ergodox/keymaps/ordinary/ordinary-base.png and b/keyboards/ergodox/keymaps/ordinary/ordinary-base.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-media.png b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png index bb78b7c7a..5ff3f5338 100644 Binary files a/keyboards/ergodox/keymaps/ordinary/ordinary-media.png and b/keyboards/ergodox/keymaps/ordinary/ordinary-media.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-special.png b/keyboards/ergodox/keymaps/ordinary/ordinary-special.png index 399c5fc75..4fb9d1d16 100644 Binary files a/keyboards/ergodox/keymaps/ordinary/ordinary-special.png and b/keyboards/ergodox/keymaps/ordinary/ordinary-special.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt index 6f9d8ef04..97f40f9db 100644 --- a/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-special.txt @@ -1,21 +1,21 @@ [{x:3.5,a:7},"",{x:10.5},""], [{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"_\n\n\n\n\n\n-"], [{y:-0.875,x:5.5,a:7},"",{c:"#ff4444",a:4},"Esc",{x:4.5,c:"#cccccc",a:7},"",""], -[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#54d6de"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], +[{y:-0.875,c:"#000000",t:"#ff0000",a:4,w:1.5},"Special\n\n\n\n\n\nShift",{c:"#ff4444",t:"#000000"},"Esc",{x:14.5,c:"#ff8500"},"Back\n\n\n\n\n\nspace",{c:"#000000",t:"#ff0000",w:1.5},"\n\nSpecial\n\n\n\n\nShift"], [{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], [{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1,a:4},"{\n["], [{y:-0.875,x:5.5,a:7},"",{h:1.5},"",{x:4.5,h:1.5},"",""], -[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Media\n\n\n\n\n\nLock",{c:"#cccccc",a:7},"",{x:14.5,a:4},"\n\n}\n]",{c:"#2277ff",w:1.5},"Media\n\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#cccccc",a:7},"",{x:10.5},""], +[{y:-0.875,c:"#c6c600",t:"#002299",a:4,w:1.5},"Media\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5,a:4},"\n\n}\n]",{c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], [{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], [{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock",{c:"#cccccc",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock"], -[{y:-0.625,x:6.5,c:"#cccccc",a:7,h:1.5},"",{x:4.5,h:1.5},""], +[{y:-0.875,c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#007d00",a:4,w:1.5},"Symbols\n\n\n\n\n\nLock"], +[{y:-0.625,x:6.5,c:"#cccccc",t:"#000000",a:7,h:1.5},"",{x:4.5,h:1.5},""], [{y:-0.75,x:3.5},"",{x:10.5},""], [{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], [{y:-0.875,x:5.5},"",{x:6.5},""], -[{y:-0.875,c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock",{c:"#cccccc",a:7},"",{x:14.5},"",{c:"#2277ff",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock"], -[{y:-0.375,x:3.5,c:"#cccccc",a:7},"",{x:10.5},""], +[{y:-0.875,c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock",{c:"#cccccc",t:"#000000",a:7},"",{x:14.5},"",{c:"#c6c600",t:"#9e0000",a:4,w:1.5},"Capitals\n\n\n\n\n\nLock"], +[{y:-0.375,x:3.5,c:"#cccccc",t:"#000000",a:7},"",{x:10.5},""], [{y:-0.875,x:2.5},"",{x:1},"",{x:8.5},"",{x:1},""], [{y:-0.75,x:0.5},"","",{x:14.5},"",""], [{r:30,rx:6.5,ry:4.25,y:-1,x:1},"",""], diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png index 48cda5f6b..dd9086329 100644 Binary files a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png and b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.png differ diff --git a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt index 5c5bc155a..001bf370d 100644 --- a/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt +++ b/keyboards/ergodox/keymaps/ordinary/ordinary-symbol.txt @@ -1,11 +1,11 @@ [{x:3.5,c:"#99de2a"},"F3",{x:10.5},"F8"], [{y:-0.875,x:2.5},"F2",{x:1},"F4",{x:8.5},"F7",{x:1},"F9"], [{y:-0.875,x:5.5},"F5",{c:"#ff4444"},"Esc",{x:4.5,c:"#bbddbb"},"_\n\n\n\n\n\n-",{c:"#99de2a"},"F6"], -[{y:-0.875,c:"#dddd77",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#dddd77",w:1.5},"\n\nShift\n\n\n\n\nLock"], +[{y:-0.875,c:"#c6c600",w:1.5},"Shift\n\n\n\n\n\nLock",{c:"#99de2a"},"F1",{x:14.5},"F10",{c:"#c6c600",w:1.5},"\n\nShift\n\n\n\n\nLock"], [{y:-0.375,x:3.5,c:"#bbddbb"},"{",{x:10.5,c:"#89b087"},"8"], [{y:-0.875,x:2.5,c:"#bbddbb"},"@",{x:1},"}",{x:8.5,c:"#89b087"},"7",{x:1},"9"], [{y:-0.875,x:5.5,c:"#bbddbb"},"&",{h:1.5},"<",{x:4.5,h:1.5},">","|"], -[{y:-0.875,c:"#dddd77",t:"#002299",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"!",{x:14.5,c:"#89b087"},"/",{c:"#dddd77",t:"#002299",w:1.5},"\n\nMedia\n\n\n\n\nShift"], +[{y:-0.875,c:"#c6c600",t:"#002299",w:1.5},"Media\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"!",{x:14.5,c:"#89b087"},"/",{c:"#c6c600",t:"#002299",w:1.5},"\n\nMedia\n\n\n\n\nShift"], [{y:-0.375,x:3.5,c:"#bbddbb",t:"#000000"},"(",{x:10.5,c:"#89b087"},"5"], [{y:-0.875,x:2.5,c:"#bbddbb"},"$",{x:1},")",{x:8.5,c:"#89b087"},"4",{x:1},"6"], [{y:-0.875,x:5.5,c:"#bbddbb"},"`",{x:6.5},"/"], @@ -14,10 +14,10 @@ [{y:-0.75,x:3.5,c:"#bbddbb"},"[",{x:10.5,c:"#89b087"},"2"], [{y:-0.875,x:2.5,c:"#bbddbb"},"^",{x:1},"]",{x:8.5,c:"#89b087"},"1",{x:1},"3"], [{y:-0.875,x:5.5,c:"#bbddbb"},"~",{x:6.5},"\\"], -[{y:-0.875,c:"#dddd77",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#dddd77",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], -[{y:-0.375,x:3.5,c:"#c6c600",t:"#000000"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},"."], -[{y:-0.875,x:2.5,c:"#c6c600"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0",{x:1},"="], -[{y:-0.75,x:0.5,c:"#c6c600"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+","Enter"], +[{y:-0.875,c:"#c6c600",t:"#9e0000",w:1.5},"Capitals\n\n\n\n\n\nShift",{c:"#bbddbb",t:"#000000"},"%",{x:14.5,c:"#89b087"},"-",{c:"#c6c600",t:"#9e0000",w:1.5},"\n\nCapitals\n\n\n\n\nShift"], +[{y:-0.375,x:3.5,c:"#dddd77",t:"#000000"},"Option\n\n\nLAlt",{x:10.5,c:"#89b087"},"."], +[{y:-0.875,x:2.5,c:"#dddd77"},"Hyper",{x:1},"Cmd\n\n\nSuper",{x:8.5,c:"#89b087"},"0",{x:1},"="], +[{y:-0.75,x:0.5,c:"#dddd77"},"Ctrl\n\n\nLCtrl","Meh",{x:14.5,c:"#89b087"},"+","Enter"], [{r:30,rx:6.5,ry:4.25,y:-1,x:1,c:"#ff8500"},"Left","Right"], [{h:2},"Space",{h:2},"Enter","Up"], [{x:2},"Down"], diff --git a/keyboards/ergodox/keymaps/ordinary/readme.md b/keyboards/ergodox/keymaps/ordinary/readme.md index 21d40477c..9c5294c5b 100644 --- a/keyboards/ergodox/keymaps/ordinary/readme.md +++ b/keyboards/ergodox/keymaps/ordinary/readme.md @@ -10,66 +10,51 @@ no rights reserved, use for any purposes, credit me if you are a nice person ## The Base Layout ## -* The light blue keys are modifiers: traditional Control, Option, and Command keys, plus Hyper and Meh -* The dark blue keys are Shift keys: Capitals Shift (traditional shift), Symbol Shift, and Media Shift; plus a Shift Lock key -* Several dark blue keys double for entry of characters which would typically be in those locations -* The turquoise keys are text navigation and manipulation -* The red keys is Escape and it is always found in that location no matter what +* *White Keys* are all the normal characters and symbols in all the normal locations (except for the brackets). +* *Modifier Keys* are light yellow and in the traditional location: Control, Option, Command, plus Hyper and Meh. +* *Shift Keys* are dark yellow, found on the outsides of the keyboard. Capitals Shift (traditional shift) is found in the usual place and above that is found Symbol Shift, Media Shift, and Special Shift (Shift Lock). +* Several of the shift keys double for entry of characters which would typically be in those locations. +* *Thumb Keys* shown in orange are for text navigation and manipulation. +* *Escape* is red and it is always found in that location no matter what. ![Ordinary base layout](ordinary-base.png) -This layout puts the modifier keys along the bottom of the keyboard where they are on most keyboards. They are in the regular order, with the addition of Hyper and Meh keys. The modifier keys are all in the same place on all layers, although some layers also assign symbols on those buttons. On the outside edges are the Shift keys. The traditional shift key is called Capitals Shift and it is in the normal location. Above that are Symbols Shift and Media Shift. Each Shift key momentarily switches the layout to that layer, and if you use the Shift Lock button you can lock the layout to that layer. - -Touch typists will also find tilde, tab, equals/plus, slash/pipe, and quote/double-quote sharing space on those Shift keys where they would probably be on a common keyboard. Other than the turquoise keys the only buttons which move to new locations are the Brackets and Dash and Escape. Most touch typists dont touch-type brackets or dash anyway so only Escape really requires retraining of muscle memory, and see below for the Special Escape Sequence. - -The four big turquoise keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. +The four big orane keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. ## The Symbols Layer ## -* The light green keys are the eponymous symbols -* The bright green keys are F-Keys -* The dark green keys constitute a number pad -* The turquoise keys are the *reverse* of the turquoise keys on the base layer +* *Symbols* shown in light green. All kinds of brackets are available on this layer. Ampersand and Pipe justapose each other. Pipe, slash, and backslash are arranged in a column. +* *F-Keys* are bright green and overlay the row of numerals. +* *Number pad* in dark green under the right hand includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads so that NumLock is not needed. +* *Thumb keys* on this layer are the *reverse* of the orange keys on the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. ![Ordinary symbol layout](ordinary-symbol.png) -The Ergodox EZ ships with the "Coder Layer" which I like to call the Symbols layer. There are some significant improvements in The Ordinary Layout over the default layout. - -The symbol keys are mostly the same as on the default layout, which did a good job in this regard, but with a few enhancements: - -* Angle brackets on this layer mean that curly, square, and angle brackets are all available on different layers of the same two buttons. Also, they mean that all kinds of brackets, including parentheses, are available on both the Base and Symbols layers. -* The slash, backslash, and pipe characters are grouped together as a memory aid. -* The & and | symbols are juxtaposed as a memory aid - -The number pad area here, in green, includes all four arithmetic operations in the same order found on most number pads and features an Enter key. The keycodes emitted here are normal numeric keycodes, not the number-pad specific keycodes emitted by most number pads, because this layout does not use a Num Lock key to switch the buttons between numeric keycodes and navigational keycodes. See the explanation in The Media Layout section about navigation using these same buttons. - -Finally, consider the turquoise text-nav keys. Here in the Symbols layer, these are *reversed* from the base layer, with the keys either mirrored or shifted. This is powerful! Often I find myself using the mouse with my right hand, and the left hand needs to press Enter. Instead of reaching the left hand over to the right side of the keyboard, now I simply tap Symbols to reverse the turquoise keys, and Enter is right where it should be. +The Symbols Layer is based on the Coder Layer from the default Ergodox EZ layout. I slightly rearranged the symbols, added some symbols, expanded the number pad, and straightened out the F-Keys. It's very handy to have the symbols directly underneath the normal typing keys. ## The Media Layer ## -* The dark orange keys on the left move the mouse cursor -* The dark orange keys on the right move the text cursor -* The light orange keys are for scrolling and paging -* The bright green keys are more F-keys -* The dark yellow keys signal Web and Audio applications -* The light yellow keys signal the operating system +* *Mouse Cursor Keys* are under the left hand, shown in dark blue. Diagonal keys won't automatically repeat unless combined with other keys. Buttons to left- middle- and right-click the mouse are also featured. +* *Text Cursor Keys* are under the right hand, shown in dark blue. They overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. +* *Scrolling and Paging* keys are shown in light blue and have some useful redundancy across the layout. +* Higher-order *F-Keys* are shown in bright green overylaying the numerals. +* *Application Keys* to control web browsers and audio players are dark purple but don't get too excited because these have weak support on operating systems I've looked at. Good luck. +* The light purple keys are various operating system keys such as NumLock and Mute and a button to navigate to My Computer (usually your home dir). * The dark gray keys do nothing in case you bump them by accident ![Ordinary media layout](ordinary-media.png) -This layer was inspired by the Media layer on the Ergodox EZ but takes it farther. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. +This layer is a substantial extension of the Media layer on the Ergodox EZ default layout. The Fingerworks TouchStream keyboard had a very useful feature for controlling the text cursor easily and this layer does something similar. The left hand can move the mouse, the right hand moves the text cursor, in all four directions, in small or large increments. This greatly enhances navigation in text documents. -Moreover, the orange keys on the right overlay the numberpad from the Symbols Layer, such that in the Media Layer the same keys can be used as if they were a number pad in navigational mode (Num Lock off). For instance, in traditional number pads the '3' key became 'Page Down', and so it is here. This means a user can do text navigation without moving either hand. - -Alas, the yellow keys have at best spotty success with common software. Good luck with those but don't expect too much. +Keys to directly interact with the operating system are also found on this layer, such as volume and shutdown. ## Switching Between Layers ## In addition to Symbols and Media there is the Capitals layer which is exactly the same as pressing the shift key. Each layer is accessed by a shift key on each edge of the keyboard and corresponds to one of the three LEDs on the keyboard: Capitals (red), Symbols (green), Media (blue). The color of a layer illuminates when the layer is active. -Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. Lock the shift keys using the Shift Lock button, which is the same as the Special Shift button. You can press the shift and shift-lock buttons in either order. +Shift buttons work in the expected way: press them and all of the keys switch to that layer; release them and the keys switch back to the base layer. Lock the shift keys using the Shift Lock button, which is the same as the Special Shift button. Multiple layers can be turned on at once. The Capitals layer will affect characters on other layers to capitalize. Other layers, however, don't 'mix': Symbols blankets the base layout; Media blankets Symbols. @@ -77,6 +62,8 @@ Multiple layers can be turned on at once. The Capitals layer will affect charact ![Ordinary special layout](ordinary-special.png) +The Special Shift layer is mostly used to lock the shift keys but in order to make this layout more _ordinary_ there are a few special sequences which put some keys near their most common traditional locations. + ### Escape ### The One True Location for the Escape key is segregated way up on the top left of the keyboard. The Ergodox does not have a physical button in such a location and the nearest one is home to the tilde (er, grave) which is commonly found there. In the Ordinary layout the Escape key is found on all layers in the prominent location in the corner next to the 5, which is easy to remember, and yet it isn't natural for those of us with muscle memory flicking our wrists up and to the left looking for Escape. @@ -85,7 +72,7 @@ The Ordinary layout offers as a consolation prize a Special sequence for Escape: ### Backspace ### -At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence, using the 0 key, to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. +At the top right corner of the Ergodox EZ you can a gesture similar to the special Escape sequence using the 0 key to produce a Backspace. Users of this keyboard and this layout are well advised to learn to use their thumbs for deleting text, but sometimes you are doing other computery things and just want to flick your digits up to the right and press backspace a bunch times. ### Other Characters ### @@ -93,11 +80,11 @@ The Escape and Backspace special sequences are so useful why not have a few more **** -The Ordinary Layout for the Ergodox EZ keyboard, v4 +The Ordinary Layout for the Ergodox EZ keyboard, v4.20 Modifications from default by Nicholas Keene ergodoxez@nicholaskeene.com No rights reserved. This software is in the public domain. Credit me if you are friendly but if you're a jerk don't bother. Details: readme.md - https://github.com/nrrkeene/qmk_firmware/tree/master/keyboard/ergodox_ez/keymaps/ordinary + https://github.com/nrrkeene/qmk_firmware/tree/master/keyboards/ergodox/keymaps/ordinary -- cgit v1.2.3-24-g4f1b From 6a9a6b9477749d9fc80cad8f026140b52715b5ec Mon Sep 17 00:00:00 2001 From: Nicholas Keene Date: Fri, 19 Aug 2016 23:44:08 -0500 Subject: The Ordinary Layout is boring because all the keys are where you expect them to be --- keyboards/ergodox/keymaps/ordinary/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox/keymaps/ordinary/readme.md b/keyboards/ergodox/keymaps/ordinary/readme.md index 9c5294c5b..820b80b45 100644 --- a/keyboards/ergodox/keymaps/ordinary/readme.md +++ b/keyboards/ergodox/keymaps/ordinary/readme.md @@ -19,7 +19,7 @@ no rights reserved, use for any purposes, credit me if you are a nice person ![Ordinary base layout](ordinary-base.png) -The four big orane keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. +The four big orange keys are arranged differently than in the default Ergodox EZ layout. The Ordinary Layout here copies the design of the old Fingerworks TouchStream keyboard, but also reflects the natural presumptions of the author -- me! I type the space character with my right hand, and to me it makes sense for the two delete keys to be next to one another. The Forward Tab and Backward Tab keys are in their locations mostly because I ended up with two extra buttons and needed something to do with them. My muscle memory from using the Truly Ergonomic Keyboard makes me look for the Tab key with my right index finger, so it is handy to have this redundant Tab, and the idea with the Backward Tab key is that it becomes easy to navigate text fields in forms, or to indent/unindent code. -- cgit v1.2.3-24-g4f1b From aff792545d70fbf281e64757b74d0ed776187bb2 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Fri, 19 Aug 2016 22:30:34 -0700 Subject: Changed my keymap to match normal keymaps. --- keyboards/ergodox/keymaps/xyverz/keymap.c | 512 ++++++++++++------------------ 1 file changed, 198 insertions(+), 314 deletions(-) diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c index 397c8566f..5927de33f 100644 --- a/keyboards/ergodox/keymaps/xyverz/keymap.c +++ b/keyboards/ergodox/keymaps/xyverz/keymap.c @@ -45,331 +45,215 @@ extern keymap_config_t keymap_config; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_DV] = { // layer 0 : Dvorak -/* - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | ' | , | . | Y | Y | | | | F | G | C | R | L | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | - * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | X | | | | B | M | W | V | Z | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCtr | LAlt | | Ralt | RCtr | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * | BkSp | Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' +/* Layer 0 : Dvorak + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ] | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | [ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | ' | , | . | P | Y | | | | F | G | C | R | L | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CapsLk | A | O | E | U | I |------| |------| D | H | T | N | S | - | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCTL | LALT | | RALT | RCTL | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' * */ -#ifdef SUBPROJECT_infinity // Infinity Ergodox - // left hand - {XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_HOME}, - {XXXXXXX, XXXXXXX, XXXXXXX, KC_LCTL, KC_END }, - {KC_6, MO(_KP), XXXXXXX, MO(_MD), KC_DEL }, - {KC_5, KC_Y, KC_I, KC_X, KC_BSPC}, - {KC_4, KC_P, KC_U, KC_K, KC_RGHT}, - {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT}, - {KC_2, KC_COMM, KC_O, KC_Q, KC_INS }, - {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV }, - {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI}, - - //Right Hand - {XXXXXXX, XXXXXXX, XXXXXXX, KC_RALT, KC_PGUP}, - {XXXXXXX, XXXXXXX, XXXXXXX, KC_RCTL, KC_PGDN}, - {KC_ESC, MO(_MD), XXXXXXX, MO(_KP), KC_ENT }, - {KC_6, KC_F, KC_D, KC_B, KC_SPC }, - {KC_7, KC_G, KC_H, KC_M, KC_UP }, - {KC_8, KC_C, KC_T, KC_W, KC_DOWN}, - {KC_9, KC_R, KC_N, KC_V, KC_SLSH}, - {KC_0, KC_L, KC_S, KC_Z, KC_EQL }, - {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI} -#else // Ergodox and Ergodox EZ +[_DV] = KEYMAP( // left hand - {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, XXXXXXX}, - {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV, KC_END }, - {KC_2, KC_COMM, KC_O, KC_Q, KC_INS, KC_DEL }, - {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT, KC_BSPC}, - {KC_4, KC_P, KC_U, KC_K, KC_RGHT, KC_HOME}, - {KC_5, KC_Y, KC_I, KC_X, XXXXXXX, KC_LCTL}, - {KC_ESC, XXXXXXX, XXXXXXX, MO(_MD), XXXXXXX, KC_LALT}, - - // right hand - {KC_ESC, XXXXXXX, XXXXXXX, MO(_KP), XXXXXXX, KC_RALT}, - {KC_6, KC_F, KC_D, KC_B, XXXXXXX, KC_RCTL}, - {KC_7, KC_G, KC_H, KC_M, KC_UP, KC_PGUP}, - {KC_8, KC_C, KC_T, KC_W, KC_DOWN, KC_SPC }, - {KC_9, KC_R, KC_N, KC_V, KC_SLSH, KC_ENT }, - {KC_0, KC_L, KC_S, KC_Z, KC_EQL, KC_PGDN}, - {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI, XXXXXXX} -#endif - }, - - -[_QW] = { // layer 1 : QWERTY -/* - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCtr | LAlt | | Ralt | RCtr | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * | BkSp | Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' + KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, XXXXXXX, + KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, MO(_MD), + KC_LGUI, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, + XXXXXXX, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, + MO(_KP), KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_UP, KC_DOWN, KC_SLSH, KC_EQL, KC_RGUI, + KC_RALT, KC_RCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), + + +/* Layer 1: QWERTY + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCTL | LALT | | RALT | RCTL | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' */ -#ifdef SUBPROJECT_infinity // Infinity Ergodox - // left hand - {XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_HOME}, - {XXXXXXX, XXXXXXX, XXXXXXX, KC_LCTL, KC_END }, - {KC_6, MO(_KP), XXXXXXX, MO(_MD), KC_DEL }, - {KC_5, KC_Y, KC_I, KC_X, KC_BSPC}, - {KC_4, KC_P, KC_U, KC_K, KC_RGHT}, - {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT}, - {KC_2, KC_COMM, KC_O, KC_Q, KC_INS }, - {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV }, - {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI}, - - //Right Hand - {XXXXXXX, XXXXXXX, XXXXXXX, KC_RALT, KC_PGUP}, - {XXXXXXX, XXXXXXX, XXXXXXX, KC_RCTL, KC_PGDN}, - {KC_ESC, MO(_MD), XXXXXXX, MO(_KP), KC_ENT }, - {KC_6, KC_F, KC_D, KC_B, KC_SPC }, - {KC_7, KC_G, KC_H, KC_M, KC_UP }, - {KC_8, KC_C, KC_T, KC_W, KC_DOWN}, - {KC_9, KC_R, KC_N, KC_V, KC_SLSH}, - {KC_0, KC_L, KC_S, KC_Z, KC_EQL }, - {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI} -#else // Ergodox and Ergodox EZ +[_QW] = KEYMAP( // left hand - {KC_EQL, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI, XXXXXXX}, - {KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END }, - {KC_2, KC_W, KC_S, KC_X, KC_INS, KC_DEL }, - {KC_3, KC_E, KC_D, KC_C, KC_LEFT, KC_BSPC}, - {KC_4, KC_R, KC_F, KC_V, KC_RGHT, KC_HOME}, - {KC_5, KC_T, KC_G, KC_B, XXXXXXX, KC_LCTL}, - {KC_ESC, XXXXXXX, XXXXXXX, MO(_MD), XXXXXXX, KC_LALT}, - - // right hand - {KC_ESC, XXXXXXX, XXXXXXX, MO(_KP), XXXXXXX, KC_RALT}, - {KC_6, KC_Y, KC_H, KC_N, XXXXXXX, KC_RCTL}, - {KC_7, KC_U, KC_J, KC_M, KC_UP, KC_PGUP}, - {KC_8, KC_I, KC_K, KC_COMM, KC_DOWN, KC_SPC }, - {KC_9, KC_O, KC_L, KC_DOT, KC_LBRC, KC_ENT }, - {KC_0, KC_P, KC_SCLN, KC_SLSH, KC_RBRC, KC_PGDN}, - {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, XXXXXXX} -#endif - }, - - -[_CM] = { // layer 2 : Colemak -/* - * ,--------------------------------------------------. ,--------------------------------------------------. - * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | - * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| - * | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LGUI | ` | INS | Left | Rght | | Up | Dn | [ | ] | RGUI | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCtr | LAlt | | Ralt | RCtr | - * ,------|------|------| |------+------+------. - * | | | Home | | PgUp | | | - * | BkSp | Del |------| |------| Enter| Space| - * | | | End | | PgDn | | | - * `--------------------' `--------------------' + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(_MD), + KC_LGUI, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + XXXXXXX, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + MO(_KP), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_RGUI, + KC_LALT, KC_LCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), + + +/* Layer 2 : Colemak + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | ESC | | ESC | 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | F | P | G | | | | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSpc | A | R | S | T | D |------| |------| H | N | E | I | O | ' | + * |--------+------+------+------+------+------| _MD | | _KP |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | K | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LGUI | ` | INS | Left | Rght | | Up | Dn | / | = | RGUI | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | LCTL | LALT | | RALT | RCTL | + * ,------|------|------| |------+------+------. + * | | | Home | | PgUp | | | + * | BkSp | Del |------| |------| Enter| Space| + * | | | End | | PgDn | | | + * `--------------------' `--------------------' */ -#ifdef SUBPROJECT_infinity // Infinity Ergodox - // left hand - {XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_HOME}, - {XXXXXXX, XXXXXXX, XXXXXXX, KC_LCTL, KC_END }, - {KC_6, MO(_KP), XXXXXXX, MO(_MD), KC_DEL }, - {KC_5, KC_Y, KC_I, KC_X, KC_BSPC}, - {KC_4, KC_P, KC_U, KC_K, KC_RGHT}, - {KC_3, KC_DOT, KC_E, KC_J, KC_LEFT}, - {KC_2, KC_COMM, KC_O, KC_Q, KC_INS }, - {KC_1, KC_QUOT, KC_A, KC_SCLN, KC_GRV }, - {KC_RBRC, KC_TAB, KC_CAPS, KC_LSFT, KC_LGUI}, - - //Right Hand - {XXXXXXX, XXXXXXX, XXXXXXX, KC_RALT, KC_PGUP}, - {XXXXXXX, XXXXXXX, XXXXXXX, KC_RCTL, KC_PGDN}, - {KC_ESC, MO(_MD), XXXXXXX, MO(_KP), KC_ENT }, - {KC_6, KC_F, KC_D, KC_B, KC_SPC }, - {KC_7, KC_G, KC_H, KC_M, KC_UP }, - {KC_8, KC_C, KC_T, KC_W, KC_DOWN}, - {KC_9, KC_R, KC_N, KC_V, KC_SLSH}, - {KC_0, KC_L, KC_S, KC_Z, KC_EQL }, - {KC_LBRC, KC_BSLS, KC_MINS, KC_RSFT, KC_RGUI} -#else // Ergodox and Ergodox EZ +[_CM] = KEYMAP( // left hand - {KC_EQL, KC_TAB, KC_BSPC, KC_LSFT, KC_LGUI, XXXXXXX}, - {KC_1, KC_Q, KC_A, KC_Z, KC_GRV, KC_END }, - {KC_2, KC_W, KC_R, KC_X, KC_INS, KC_DEL }, - {KC_3, KC_F, KC_S, KC_C, KC_LEFT, KC_BSPC}, - {KC_4, KC_P, KC_T, KC_V, KC_RGHT, KC_HOME}, - {KC_5, KC_G, KC_D, KC_B, XXXXXXX, KC_LCTL}, - {KC_ESC, XXXXXXX, XXXXXXX, MO(_MD), XXXXXXX, KC_LALT}, - - // right hand - {KC_ESC, XXXXXXX, XXXXXXX, MO(_KP), XXXXXXX, KC_RALT}, - {KC_6, KC_J, KC_H, KC_K, XXXXXXX, KC_RCTL}, - {KC_7, KC_L, KC_N, KC_M, KC_UP, KC_PGUP}, - {KC_8, KC_U, KC_E, KC_COMM, KC_DOWN, KC_SPC }, - {KC_9, KC_Y, KC_I, KC_DOT, KC_LBRC, KC_ENT }, - {KC_0, KC_SCLN, KC_O, KC_SLSH, KC_RBRC, KC_PGDN}, - {KC_MINS, KC_BSLS, KC_QUOT, KC_RSFT, KC_RGUI, XXXXXXX} -#endif - }, - - -[_MD] = { // layer 3 : Media layer -/* - * ,--------------------------------------------------. ,--------------------------------------------------. - * | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | PrSc | ScLk | Paus | | | | | | Mute | Vol- | Vol+ | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |Dvorak|Qwerty|Colemk| | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, XXXXXXX, + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(_MD), + KC_LGUI, KC_GRV, KC_INS, KC_LEFT, KC_RGHT, + KC_LCTL, KC_LALT, + KC_HOME, + KC_BSPC, KC_DEL, KC_END, + // right hand + KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + XXXXXXX, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + MO(_KP), KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_RGUI, + KC_LALT, KC_LCTL, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPC + ), + + +/* Layer 3 : Media layer + * ,--------------------------------------------------. ,--------------------------------------------------. + * | TEENSY | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | PrSc | ScLk | Paus | | | | | | Mute | Vol- | Vol+ | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| Stop | Prev | Play | Next | Sel | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |Dvorak|Qwerty|Colemk| | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' */ -#ifdef SUBPROJECT_infinity // Infinity Ergodox - // left hand - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, - {KC_F11, _______, XXXXXXX, _______, _______}, - {KC_F5, _______, _______, _______, _______}, - {KC_F4, KC_PAUS, _______, COLEMAK, _______}, - {KC_F3, KC_SLCK, _______, QWERTY, _______}, - {KC_F2, KC_PSCR, _______, DVORAK, _______}, - {KC_F1, _______, _______, _______, _______}, - {RESET, _______, _______, _______, _______}, - - //Right Hand - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, - {KC_F12, _______, XXXXXXX, _______, _______}, - {KC_F6, _______, KC_MSTP, _______, _______}, - {KC_F7, KC_VOLU, KC_MPRV, _______, _______}, - {KC_F8, KC_VOLD, KC_MPLY, _______, _______}, - {KC_F9, KC_MUTE, KC_MNXT, _______, _______}, - {KC_F10, _______, KC_MSEL, _______, _______}, - {_______, _______, _______, _______, _______}, -#else // Ergodox and Ergodox EZ +[_MD] = KEYMAP( // left hand - {RESET, _______, _______, _______, _______, XXXXXXX}, - {KC_F1, _______, _______, _______, _______, _______}, - {KC_F2, KC_PSCR, _______, DVORAK, _______, _______}, - {KC_F3, KC_SLCK, _______, QWERTY, _______, _______}, - {KC_F4, KC_PAUS, _______, COLEMAK, _______, _______}, - {KC_F5, _______, _______, _______, XXXXXXX, _______}, - {KC_F11, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______}, - - // right hand - {KC_F12, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______}, - {KC_F6, _______, KC_MSTP, _______, XXXXXXX, _______}, - {KC_F7, KC_MUTE, KC_MPRV, _______, _______, _______}, - {KC_F8, KC_VOLD, KC_MPLY, _______, _______, _______}, - {KC_F9, KC_VOLU, KC_MNXT, _______, _______, _______}, - {KC_F10, _______, KC_MSEL, _______, _______, _______}, - {_______, _______, _______, _______, _______, XXXXXXX} -#endif - }, - - -[_KP] = { // layer 4 : Keypad layer -/* - * ,--------------------------------------------------. ,--------------------------------------------------. - * | Power | | | | | | | | | | NmLk | KP / | KP * | KP - | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | Sleep | | | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | KP 0 | | KP . |KP Ent| | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ + ), + + +/* Layer 4 : Keypad layer + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Power | | | | | | | | | | NmLk | KP = | KP / | KP * | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Sleep | | | | | | | | | | KP 7 | KP 8 | KP 9 | KP - | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Wake | | | | | |------| |------| | KP 4 | KP 5 | KP 6 | KP + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | KP 0 | | |KP Ent| | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' */ -#ifdef SUBPROJECT_infinity // Infinity Ergodox - // left hand - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, - {_______, _______, XXXXXXX, _______, _______}, - {_______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______}, - {KC_PWR, KC_SLEP, KC_WAKE, _______, _______}, - - //Right Hand - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, - {XXXXXXX, XXXXXXX, XXXXXXX, _______, _______}, - {_______, _______, XXXXXXX, _______, _______}, - {_______, _______, KC_MSTP, _______, _______}, - {KC_NLCK, KC_P7, KC_P4, KC_P1, KC_P0 }, - {KC_PSLS, KC_P8, KC_P5, KC_P2, _______}, - {KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT}, - {KC_PMNS, KC_PPLS, KC_PPLS, KC_PENT, KC_PENT}, - {_______, _______, _______, _______, _______}, -#else // Ergodox and Ergodox EZ +[_KP] = KEYMAP( // left hand - {KC_PWR, KC_SLEP, KC_WAKE, _______, _______, XXXXXXX}, - {_______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, XXXXXXX, _______}, - {_______, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______}, - - // right hand - {_______, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______}, - {_______, _______, _______, _______, XXXXXXX, _______}, - {KC_NLCK, KC_P7, KC_P4, KC_P1, KC_P0, _______}, - {KC_PSLS, KC_P8, KC_P5, KC_P2, XXXXXXX, _______}, - {KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, _______}, - {KC_PMNS, KC_PPLS, KC_PPLS, KC_PENT, KC_PENT, _______}, - {_______, _______, _______, _______, XXXXXXX, XXXXXXX} -#endif - }, - + KC_PWR, _______, _______, _______, _______, _______, _______, + KC_SLEP, _______, _______, _______, _______, _______, _______, + KC_WAKE, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + // right hand + _______, _______, KC_NLCK, KC_PEQL, KC_PSLS, KC_PAST, _______, + _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______, + _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, + _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ + ), }; -- cgit v1.2.3-24-g4f1b From e4984f65decbd005d147d29b56d7a0c7d7a8dafd Mon Sep 17 00:00:00 2001 From: Xyverz Date: Fri, 19 Aug 2016 22:45:20 -0700 Subject: Changed the Ergodox keymap to use the KEYMAP() macro, updated readme.md. --- keyboards/ergodox/keymaps/xyverz/keymap.c | 13 +++---------- keyboards/ergodox/keymaps/xyverz/readme.md | 14 +++++++------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/keyboards/ergodox/keymaps/xyverz/keymap.c b/keyboards/ergodox/keymaps/xyverz/keymap.c index 5927de33f..08ee5aeda 100644 --- a/keyboards/ergodox/keymaps/xyverz/keymap.c +++ b/keyboards/ergodox/keymaps/xyverz/keymap.c @@ -1,8 +1,4 @@ /* - * PLEASE NOTE: This keymap has been updated to work with the Infinity ErgoDox. To build for the Infinity, - * simply append `SUBPROJECT=infinity` to the end of your `make` statement. This keymap file is untested - * on the Infinity ErgoDox. - * * About this keymap: * * The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak @@ -14,9 +10,6 @@ * * I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck * layouts. - * - * For a better explanation of the layout matrices shown below, take a look at ../../ez/ez.h where the - * keymap is defined, beginning on line 81. * */ @@ -197,7 +190,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, + _______, _______, DVORAK, QWERTY, COLEMAK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -224,7 +217,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | KP 1 | KP 2 | KP 3 |KP Ent| | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | KP 0 | | |KP Ent| | + * | | | | | | | KP 0 | | KP . |KP Ent| | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | @@ -249,7 +242,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, - _______, _______, _______, _______, _______, + KC_P0, _______, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______, _______ diff --git a/keyboards/ergodox/keymaps/xyverz/readme.md b/keyboards/ergodox/keymaps/xyverz/readme.md index e6cb582c5..6ecdabc9e 100644 --- a/keyboards/ergodox/keymaps/xyverz/readme.md +++ b/keyboards/ergodox/keymaps/xyverz/readme.md @@ -1,9 +1,5 @@ # Xyverz's ErgoDox EZ Keymap -## Please Note: - -This keymap has been updated to work with the Infinity ErgoDox. To build for the Infinity, simply append `SUBPROJECT=infinity` to the end of your `make` statement. This keymap file builds cleanly as is but as of this writing has not been tested on the Infinity ErgoDox. YMMV. - ## About this keymap: The Dvorak layout shown herestems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. I've decided to continue using this layout with my ErgoDox. @@ -12,7 +8,11 @@ The QWERTY layout shown here is based entirely on the Kinesis Advantage layout, I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts. -For a better explanation of the layout matrices shown below, take a look at ../../ez/ez.h where the keymap is defined beginning on line 81, or in ../../infinity/infinity.h beginning at line 72. +## Still to do: + + * Need to figure out a better position for the ESC key. + * Come up with a function for the empty keys shown in the alpha layers below. + * Fix the CapsLock, NumLock, and ScrLck LEDs. ### Layer 0: Dvorak layer @@ -103,9 +103,9 @@ For a better explanation of the layout matrices shown below, take a look at ../. ### Keymap 4: Keypad layer ,--------------------------------------------------.,--------------------------------------------------. - | Power | | | | | | || | | NmLk | KP / | KP * | KP - | | + | Power | | | | | | || | | NmLk | KP = | KP / | KP * | | |--------+------+------+------+------+-------------||------+------+------+------+------+------+--------| - | Sleep | | | | | | || | | KP 7 | KP 8 | KP 9 | KP + | | + | Sleep | | | | | | || | | KP 7 | KP 8 | KP 9 | KP - | | |--------+------+------+------+------+------| || |------+------+------+------+------+--------| | Wake | | | | | |------||------| | KP 4 | KP 5 | KP 6 | KP + | | |--------+------+------+------+------+------| || |------+------+------+------+------+--------| -- cgit v1.2.3-24-g4f1b