1
0
Fork 0

bluetooth

This commit is contained in:
Jack Humbert 2015-10-22 13:37:45 -04:00
parent 40148c430e
commit c966e7982c
20 changed files with 2329 additions and 319 deletions

View file

@ -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 {