Compare commits

...

2 Commits

Author SHA1 Message Date
9bed136cd5 keyboard: Use serial bootloader in Makefile 2019-10-26 22:31:21 +02:00
45e606797b keyboard: Map keys 2019-10-26 22:31:05 +02:00
2 changed files with 36 additions and 20 deletions

View File

@ -1,4 +1,5 @@
MCU=atmega8 MCU=atmega8
PDEV=/dev/ttyUSB1
CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=8000000 CFLAGS=-g -Wall -mcall-prologues -mmcu=$(MCU) -Os -DF_CPU=8000000
LDFLAGS=-Wl,-gc-sections -Wl,-relax LDFLAGS=-Wl,-gc-sections -Wl,-relax
CC=avr-gcc CC=avr-gcc
@ -17,8 +18,7 @@ clean:
$(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@ $(CC) $(CFLAGS) $(OBJECT_FILES) $(LDFLAGS) -o $@
program: $(TARGET).hex program: $(TARGET).hex
avrdude -p $(MCU) -c usbasp -U flash:w:$(TARGET).hex avrdude -p $(MCU) -P $(PDEV) -c arduino -b 19200 -U flash:w:$(TARGET).hex
#avrdude -p $(MCU) -P /dev/ttyUSB1 -c arduino -b 57600 -U flash:w:$(TARGET).hex
fuse: fuse:
avrdude -p m8 -c usbasp -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m avrdude -p m8 -c usbasp -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m

View File

@ -149,28 +149,44 @@
#define SKEY_FN 255 #define SKEY_FN 255
#define KEYCODE_FN 127 #define KEYCODE_FN 127
/*
* Special keys:
* * Control : Code
* * Alt : Del
* * FN : Delword
* * Del : Inhalt
* * ` : SM
* * Escape : Storno
* * Print : Menu
* * Pause : GS End
*
* FN Keymap:
* * F-Keys : Number keys for F1-F10, and ? and ` for F11-F12
* * Home / End / PGUP / PGDN : Arrow keys
* * Sys rq : Print
*/
static uint8_t keycode_translation_matrix[2][9][8] = { static uint8_t keycode_translation_matrix[2][9][8] = {
{ /* Standard keymap */ { /* Standard keymap */
{KEY_4, KEY_3, 3, 4, 5, 6, 7, 8}, {KEY_5, KEY_6, KEY_R, KEY_T, KEY_C, KEY_F, KEY_UP, 0},
{KEY_5, KEY_6, 13, 14, 15, 16, 17, 18}, {KEY_8, KEY_7, KEY_Y, KEY_H, KEY_G, KEY_V, KEY_PAUSE, 0},
{KEY_8, KEY_7, 23, 24, 25, 26, 27, 28}, {KEY_1, KEY_2, KEY_Q, KEY_Z, KEY_A, KEY_S, KEY_CAPSLOCK, 0},
{KEY_1, KEY_2, 33, 34, 35, 36, 37, 38}, {KEY_9, KEY_J, KEY_I, KEY_U, KEY_B, KEY_N, KEY_RIGHT, 0},
{KEY_9, 42, 43, 44, 45, 46, 47, 48}, {KEY_MINUS, KEY_0, KEY_P, KEY_O, KEY_M, KEY_COMMA, 84, 0},
{51, KEY_0, 53, 54, 55, 56, 57, 58}, {KEY_DELETE, KEY_SEMICOLON, KEY_RIGHTBRACE, KEY_LEFTBRACE, KEY_LEFT, KEY_DOWN, 0, KEY_LEFTCTRL},
{61, 62, 63, 64, 65, 66, 67, 68}, {KEY_4, KEY_3, KEY_W, KEY_E, KEY_D, KEY_X, KEY_TAB, 0},
{71, 72, 73, 74, 75, SKEY_FN, 77, 78}, {KEY_GRAVE, KEY_ESC, KEY_ENTER, KEY_BACKSPACE, KEY_LEFTALT, SKEY_FN, KEY_LEFTSHIFT, KEY_SPACE},
{81, 82, 83, 84, 85, 86, 87, 88} {KEY_EQUAL, KEY_L, KEY_BACKSLASH, KEY_K, KEY_DOT, KEY_SLASH, 0, KEY_APOSTROPHE}
}, },
{ /* FN keymap */ { /* FN keymap */
{ 1, 2, 3, 4, 5, 6, 7, 8}, {KEY_F5, KEY_F6, KEY_R, KEY_T, KEY_C, KEY_F, KEY_PAGEUP, 0},
{11, 12, 13, 14, 15, 16, 17, 18}, {KEY_F8, KEY_F7, KEY_Z, KEY_H, KEY_G, KEY_V, KEY_PAUSE, 0},
{21, 22, 23, 24, 25, 26, 27, 28}, {KEY_F1, KEY_F2, KEY_Q, KEY_102ND, KEY_A, KEY_S, KEY_CAPSLOCK, 0},
{31, 32, 33, 34, 35, 36, 37, 38}, {KEY_F9, KEY_J, KEY_I, KEY_U, KEY_B, KEY_N, KEY_END, 0},
{41, 42, 43, 44, 45, 46, 47, 48}, {KEY_F11, KEY_F10, KEY_P, KEY_O, KEY_M, KEY_COMMA, KEY_SYSRQ, 0},
{51, 52, 53, 54, 55, 56, 57, 58}, {KEY_DELETE, KEY_SEMICOLON, KEY_RIGHTBRACE, KEY_LEFTBRACE, KEY_HOME, KEY_PAGEDOWN, 0, KEY_LEFTCTRL},
{61, 62, 63, 64, 65, 66, 67, 68}, {KEY_F4, KEY_F3, KEY_W, KEY_E, KEY_D, KEY_X, KEY_TAB, 0},
{71, 72, 73, 74, 75, SKEY_FN, 77, 78}, {KEY_GRAVE, KEY_ESC, KEY_ENTER, KEY_BACKSPACE, KEY_LEFTALT, SKEY_FN, KEY_LEFTSHIFT, KEY_SPACE},
{81, 82, 83, 84, 85, 86, 87, 88} {KEY_F12, KEY_L, KEY_BACKSLASH, KEY_K, KEY_DOT, KEY_SLASH, 0, KEY_APOSTROPHE}
} }
}; };