1
0
Fork 0
forked from forks/qmk_firmware
qmk_firmware/keyboards/tmo50/keymaps/talljoe/keymap.c
Joe Wasson 7ce5402417
Updates to Talljoe's Keymaps (#10115)
* Minor Tweak

* Refactor spacebar defines.

* Add TMO50 layout

* Rename Atreus keymap.

* Refactor Atreus for readability.

* Eliminate tapdance quote and tweak maltroff.

* Factor out tapdance.

* Add some fancy combos and keys.

* Remove combos for now because they cause pain.

* WIP visualizer

* Alternate method for reset

* WIP2 visualizer

* Layer text tweak.

* Add made-up layout Nortron as a combination of Norman and Maltron.

* Add backspace.

* Add Talljoe keymap to Prime E.

* Fix double-colon so it doesn't press enter if shift is released early.

* Use new make command.

* Bring some modern standards into code and add licenses.

* Remove QMK_KEYBOARD_CONFIG_H and fixup QMK_KEYBOARD_H.

* Move from `biton32` to `get_highest_layer`.

* Remove PREVENT_STUCK_MODIFIERS

* Update keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/config.h
2020-11-06 17:16:22 -08:00

45 lines
920 B
C

#include "quantum.h"
#include "talljoe.h"
bool process_indicator_led_user(uint32_t state){
return false;
}
#define LED_MASK (_BV(PB0) | _BV(PB1) | _BV(PB2) | _BV(PB3))
#define WHITE (_BV(PB0))
#define YELLOW (_BV(PB1))
#define MAGENTA (_BV(PB2))
#define RED (_BV(PB3))
void matrix_scan_keymap(void) {
uint32_t lights = WHITE;
switch(get_highest_layer(layer_state))
{
case _NAV:
lights |= YELLOW;
break;
case _NUM:
lights |= MAGENTA;
break;
case _ADJUST:
lights |= RED;
break;
default: {
uint8_t default_layer = get_highest_layer(default_layer_state);
lights = 0; // no white LED by default.
if(default_layer & 1)
lights |= YELLOW;
if(default_layer & 2)
lights |= MAGENTA;
if(default_layer & 4)
lights |= RED;
}
}
uint32_t port = PORTB;
port |= LED_MASK;
port &= ~lights;
PORTB = port;
}