better integrations
This commit is contained in:
parent
6e3c36360e
commit
eb61700912
11 changed files with 402 additions and 329 deletions
|
@ -50,8 +50,7 @@ TMK_DIR = ../../tmk_core
|
|||
TARGET_DIR = .
|
||||
|
||||
# # project specific files
|
||||
SRC = planck.c \
|
||||
backlight.c
|
||||
SRC = planck.c
|
||||
|
||||
ifdef KEYMAP
|
||||
SRC := keymaps/keymap_$(KEYMAP).c $(SRC)
|
||||
|
@ -124,9 +123,13 @@ 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
|
||||
# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = YES # MIDI controls
|
||||
AUDIO_ENABLE = YES # Audio output on port C6
|
||||
# UNICODE_ENABLE = YES # Unicode
|
||||
# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
ifdef BACKLIGHT_ENABLE
|
||||
SRC += backlight.c
|
||||
endif
|
||||
|
||||
# Optimize size but this may cause error "relocation truncated to fit"
|
||||
#EXTRALDFLAGS = -Wl,--relax
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
// this is the style you want to emulate.
|
||||
|
||||
#include "planck.h"
|
||||
#include "backlight.h"
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
#include "backlight.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.
|
||||
|
@ -58,7 +60,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
backlight_step();
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_step();
|
||||
#endif
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#include "keymap_common.h"
|
||||
// #include "backlight.h"
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
#include "backlight.h"
|
||||
#endif
|
||||
#include "action_layer.h"
|
||||
#include "keymap_midi.h"
|
||||
#include "beeps.h"
|
||||
#include "audio.h"
|
||||
#include <avr/boot.h>
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
@ -86,7 +88,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|||
play_notes(&walk_up, 3, false);
|
||||
// play_note(440, 20);
|
||||
// register_code(KC_RSFT);
|
||||
// backlight_set(BACKLIGHT_LEVELS);
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_set(BACKLIGHT_LEVELS);
|
||||
#endif
|
||||
default_layer_and(0);
|
||||
default_layer_or((1<<5));
|
||||
|
||||
|
@ -118,17 +122,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|||
// register_code(hextokeycode((lock & 0x0F)));
|
||||
// unregister_code(hextokeycode((lock & 0x0F)));
|
||||
|
||||
// note(0+12, 20);
|
||||
// note(0+24, 20);
|
||||
} else {
|
||||
unregister_code(KC_RSFT);
|
||||
play_notes(&walk_dn, 3, false);
|
||||
// backlight_set(0);
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_set(0);
|
||||
#endif
|
||||
default_layer_and(0);
|
||||
default_layer_or(0);
|
||||
// note(0+24, 20);
|
||||
// note(0, 20);
|
||||
// play_note(4, 20);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -149,44 +150,5 @@ float start_up[][2] = {
|
|||
|
||||
void * matrix_init_user(void) {
|
||||
init_notes();
|
||||
|
||||
play_notes(&start_up, 9, false);
|
||||
// play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF);
|
||||
// _delay_ms(50);
|
||||
|
||||
// play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF);
|
||||
// _delay_ms(25);
|
||||
// stop_note(((double)261.6*3)*pow(2.0,(48)/12.0));
|
||||
|
||||
// play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF);
|
||||
// _delay_ms(25);
|
||||
// stop_note(((double)261.6*3)*pow(2.0,(48)/12.0));
|
||||
|
||||
|
||||
// stop_note(((double)261.6*3)*pow(2.0,(36)/12.0));
|
||||
|
||||
|
||||
// play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF);
|
||||
// _delay_ms(50);
|
||||
// stop_note(((double)261.6*3)*pow(2.0,(62)/12.0));
|
||||
|
||||
|
||||
// play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF);
|
||||
// _delay_ms(50);
|
||||
// stop_note(((double)261.6*3)*pow(2.0,(64)/12.0));
|
||||
|
||||
}
|
||||
|
||||
|
||||
// void * matrix_scan_user(void) {
|
||||
// if (layer_state & (1<<2)) {
|
||||
// if (!playing_notes)
|
||||
// play_notes(&start_up, 9, true);
|
||||
// } else if (layer_state & (1<<3)) {
|
||||
// if (!playing_notes)
|
||||
// play_notes(&start_up, 9, true);
|
||||
// } else {
|
||||
// if (playing_notes)
|
||||
// stop_all_notes();
|
||||
// }
|
||||
// }
|
||||
}
|
|
@ -3,7 +3,9 @@
|
|||
|
||||
#include "matrix.h"
|
||||
#include "keymap_common.h"
|
||||
// #include "backlight.h"
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
#include "backlight.h"
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
#ifdef MIDI_ENABLE
|
||||
#include <keymap_midi.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue