bluetooth
This commit is contained in:
parent
40148c430e
commit
c966e7982c
20 changed files with 2329 additions and 319 deletions
|
@ -2,7 +2,7 @@
|
|||
#include "backlight.h"
|
||||
#include "action_layer.h"
|
||||
#include "keymap_midi.h"
|
||||
#include "beeps.h"
|
||||
#include <avr/boot.h>
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = { /* Qwerty */
|
||||
|
@ -53,6 +53,16 @@ const uint16_t PROGMEM fn_actions[] = {
|
|||
|
||||
};
|
||||
|
||||
uint16_t hextokeycode(int hex) {
|
||||
if (hex == 0x0) {
|
||||
return KC_0;
|
||||
} else if (hex < 0xA) {
|
||||
return KC_1 + (hex - 0x1);
|
||||
} else {
|
||||
return KC_A + (hex - 0xA);
|
||||
}
|
||||
}
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
|
@ -64,6 +74,35 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|||
backlight_set(BACKLIGHT_LEVELS);
|
||||
default_layer_and(0);
|
||||
default_layer_or((1<<5));
|
||||
|
||||
uint8_t low = boot_lock_fuse_bits_get(0x0000);
|
||||
uint8_t high = boot_lock_fuse_bits_get(0x0003);
|
||||
uint8_t ext = boot_lock_fuse_bits_get(0x0002);
|
||||
uint8_t lock = boot_lock_fuse_bits_get(0x0001);
|
||||
|
||||
register_code(hextokeycode((low & 0xF0) >> 4));
|
||||
unregister_code(hextokeycode((low & 0xF0) >> 4));
|
||||
register_code(hextokeycode((low & 0x0F)));
|
||||
unregister_code(hextokeycode((low & 0x0F)));
|
||||
|
||||
|
||||
register_code(hextokeycode((high & 0xF0) >> 4));
|
||||
unregister_code(hextokeycode((high & 0xF0) >> 4));
|
||||
register_code(hextokeycode((high & 0x0F)));
|
||||
unregister_code(hextokeycode((high & 0x0F)));
|
||||
|
||||
|
||||
register_code(hextokeycode((ext & 0xF0) >> 4));
|
||||
unregister_code(hextokeycode((ext & 0xF0) >> 4));
|
||||
register_code(hextokeycode((ext & 0x0F)));
|
||||
unregister_code(hextokeycode((ext & 0x0F)));
|
||||
|
||||
|
||||
register_code(hextokeycode((lock & 0xF0) >> 4));
|
||||
unregister_code(hextokeycode((lock & 0xF0) >> 4));
|
||||
register_code(hextokeycode((lock & 0x0F)));
|
||||
unregister_code(hextokeycode((lock & 0x0F)));
|
||||
|
||||
// note(0+12, 20);
|
||||
// note(0+24, 20);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue