Last active
March 15, 2017 09:28
-
-
Save wwqrd/0d0d1fcb81a7fca3b97a8aedfcdac77b to your computer and use it in GitHub Desktop.
Planck woes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ make dfu | |
WARNING: | |
Some git sub-modules are out of date or modified, please consider runnning: | |
git submodule sync --recursive | |
git submodule update --init --recursive | |
You can ignore this warning if you are not compiling any ChibiOS keyboards, | |
or if you have modified the ChibiOS libraries yourself. | |
Making planck/rev3 with keymap ab and target dfu [WARNINGS] | |
In file included from ./tmk_core/common/progmem.h:5:0, | |
from ./tmk_core/common/action_macro.h:20, | |
from ./tmk_core/common/action.h:25, | |
from quantum/keymap.h:23, | |
from quantum/keymap_common.c:18: | |
quantum/keymap_common.c: In function 'keymap_function_id_to_action': | |
quantum/keymap_common.c:182:23: warning: array subscript is above array bounds [-Warray-bounds] | |
return pgm_read_word(&fn_actions[function_id]); | |
^ | |
Bootloader Version: 0x00 (0) | |
Erasing flash... Success | |
Checking memory from 0x0 to 0x6FFF... Empty. | |
Checking memory from 0x0 to 0x56FF... Empty. | |
/bin/sh: line 0: printf: `%': invalid format character | |
0Making planck/rev3 with keymap alexey and target dfu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ make steeeve | |
WARNING: | |
Some git sub-modules are out of date or modified, please consider runnning: | |
git submodule sync --recursive | |
git submodule update --init --recursive | |
You can ignore this warning if you are not compiling any ChibiOS keyboards, | |
or if you have modified the ChibiOS libraries yourself. | |
Making planck/rev4 with keymap steeeve | |
avr-gcc (GCC) 6.2.0 | |
Copyright (C) 2016 Free Software Foundation, Inc. | |
This is free software; see the source for copying conditions. There is NO | |
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
Size before: | |
text data bss dec hex filename | |
0 19612 0 19612 4c9c planck_rev4_steeeve.hex | |
Compiling: keyboards/planck/planck.c [OK] | |
Compiling: keyboards/planck/keymaps/steeeve/keymap.c [OK] | |
Compiling: quantum/quantum.c [OK] | |
Compiling: quantum/keymap_common.c In file included from ./tmk_core/common/progmem.h:5:0, | |
from ./tmk_core/common/action_macro.h:20, | |
from ./tmk_core/common/action.h:25, | |
from quantum/keymap.h:23, | |
from quantum/keymap_common.c:18: | |
quantum/keymap_common.c: In function 'keymap_function_id_to_action': | |
quantum/keymap_common.c:182:23: warning: array subscript is above array bounds [-Warray-bounds] | |
return pgm_read_word(&fn_actions[function_id]); | |
^ | |
[OK] | |
Compiling: quantum/keycode_config.c [OK] | |
Compiling: quantum/process_keycode/process_leader.c [OK] | |
Compiling: keyboards/planck/rev4/rev4.c [OK] | |
Compiling: quantum/matrix.c [OK] | |
Compiling: quantum/api/api_sysex.c [OK] | |
Compiling: quantum/api.c [OK] | |
Compiling: quantum/process_keycode/process_midi.c [OK] | |
Compiling: ./tmk_core/common/host.c [OK] | |
Compiling: ./tmk_core/common/keyboard.c [OK] | |
Compiling: ./tmk_core/common/action.c [OK] | |
Compiling: ./tmk_core/common/action_tapping.c [OK] | |
Compiling: ./tmk_core/common/action_macro.c [OK] | |
Compiling: ./tmk_core/common/action_layer.c [OK] | |
Compiling: ./tmk_core/common/action_util.c [OK] | |
Compiling: ./tmk_core/common/print.c [OK] | |
Compiling: ./tmk_core/common/debug.c [OK] | |
Compiling: ./tmk_core/common/util.c [OK] | |
Compiling: ./tmk_core/common/eeconfig.c [OK] | |
Compiling: ./tmk_core/common/avr/suspend.c [OK] | |
Compiling: ./tmk_core/common/avr/timer.c [OK] | |
Compiling: ./tmk_core/common/avr/bootloader.c [OK] | |
Assembling: ./tmk_core/common/avr/xprintf.S [OK] | |
Compiling: ./tmk_core/common/magic.c [OK] | |
Compiling: ./tmk_core/protocol/midi/midi.c [OK] | |
Compiling: ./tmk_core/protocol/midi/midi_device.c [OK] | |
Compiling: ./tmk_core/protocol/midi/bytequeue/bytequeue.c [OK] | |
Compiling: ./tmk_core/protocol/midi/bytequeue/interrupt_setting.c [OK] | |
Compiling: ./tmk_core/protocol/midi/sysex_tools.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/AudioClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/CDCClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/HIDClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/PrinterClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/lufa.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/descriptor.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/outputselect.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.c [OK] | |
Compiling: ./tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.c [OK] | |
Linking: .build/planck_rev4_steeeve.elf [OK] | |
Creating load file for Flash: .build/planck_rev4_steeeve.hex [OK] | |
Size after: | |
text data bss dec hex filename | |
0 19612 0 19612 4c9c planck_rev4_steeeve.hex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "planck.h" | |
#include "eeconfig.h" | |
extern keymap_config_t keymap_config; | |
#define _QWERTY 0 | |
#define _COLEMAK 1 | |
#define _LOWER 3 | |
#define _RAISE 4 | |
#define _ADJUST 16 | |
// Macro name shortcuts | |
#define QWERTY M(_QWERTY) | |
#define COLEMAK M(_COLEMAK) | |
#define LOWER M(_LOWER) | |
#define RAISE M(_RAISE) | |
// Fillers to make layering more clear | |
#define _______ KC_TRNS | |
#define XXXXXXX KC_NO | |
#define KC_UNDS LSFT(KC_MINS) | |
#define KC_GBP LALT(KC_3) | |
const uint16_t PROGMEM fn_actions[] = { | |
[20] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_QUOT) | |
}; | |
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |
[_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_ENT}, | |
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN20}, | |
{KC_BSLASH, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, } | |
}, | |
[_COLEMAK] = { | |
{KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, | |
{KC_TAB, 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_FN20}, | |
{KC_BSLASH, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT} | |
}, | |
[_LOWER] = { | |
{ KC_BSPC, _______, _______, _______, _______, _______, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______}, | |
{ _______, _______, _______, _______, _______, _______, KC_DLR, KC_PERC, KC_CIRC, KC_LCBR, KC_RCBR, _______}, | |
{ _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_UNDS, KC_PLUS, _______}, | |
{KC_GRAVE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} | |
}, | |
[_RAISE] = { | |
{ KC_BSPC, _______, KC_SLSH, KC_7, KC_8, KC_9, KC_MINS, _______, _______, _______, _______, _______ }, | |
{ _______, _______, KC_ASTR, KC_4, KC_5, KC_6, KC_PLUS, _______, _______, KC_LBRC, KC_RBRC, _______ }, | |
{ _______, _______, KC_0, KC_1, KC_2, KC_3, KC_DOT, _______, _______, KC_MINS, KC_EQL, _______ }, | |
{KC_GRAVE, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLD, KC_VOLU, KC_MNXT} | |
}, | |
[_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, QWERTY, COLEMAK, _______, _______, _______, _______, _______, _______, _______, _______, _______} | |
} | |
}; | |
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) { | |
persistant_default_layer_set(1UL<<_QWERTY); | |
} | |
break; | |
case _COLEMAK: | |
if (record->event.pressed) { | |
persistant_default_layer_set(1UL<<_COLEMAK); | |
} | |
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; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment