SHOW:
|
|
- or go back to the newest paste.
1 | In keymap_poker.c : | |
2 | ||
3 | #include "keymap_common.h" | |
4 | ||
5 | const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | |
6 | KEYMAP(ESC,KC_KP_SLASH,KC_KP_ASTERISK,KC_KP_MINUS, \ | |
7 | KC_KP_7,KC_KP_8,KC_KP_9, \ | |
8 | KC_KP_4,KC_KP_5,KC_KP_6,KC_KP_PLUS, \ | |
9 | KC_KP_1,KC_KP_2,KC_KP_3, \ | |
10 | KC_KP_ENTER,KC_KP_DOT,KC_KP_0) | |
11 | }; | |
12 | ||
13 | const uint16_t PROGMEM fn_actions[] = { | |
14 | ||
15 | }; | |
16 | ||
17 | --------------------- | |
18 | In keymap_common.h (fixed comma) : | |
19 | ||
20 | extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; | |
21 | //extern const uint16_t fn_actions[]; | |
22 | ||
23 | ||
24 | /* GH60 keymap definition macro | |
25 | * K2C, K31 and K3C are extra keys for ISO | |
26 | */ | |
27 | #define KEYMAP( \ | |
28 | K00, K01, K02, K03, \ | |
29 | K10, K11, K12, \ | |
30 | K20, K21, K22, K23, \ | |
31 | K30, K31, K32, \ | |
32 | K40, K41, K42, \ | |
33 | ) { \ | |
34 | { KC_##K00, KC_##K01, KC_##K02, KC_##K03 }, \ | |
35 | { KC_##K10, KC_##K11, KC_##K12, KC_NO}, \ | |
36 | { KC_##K20, KC_##K21, KC_##K22, KC_##K23 }, \ | |
37 | { KC_##K30, KC_##K31, KC_##K32, KC_NO }, \ | |
38 | { KC_##K40, KC_NO, KC_##K41, KC_##K42} \ | |
39 | } | |
40 | #endif | |
41 | ||
42 | -------------------------- | |
43 | In config.h : | |
44 | /* key matrix size */ | |
45 | #define MATRIX_ROWS 5 | |
46 | #define MATRIX_COLS 4 | |
47 | ------------------------- | |
48 | In config.h : | |
49 | ||
50 | /* Column pin configuration | |
51 | * col: 0 1 2 3 | |
52 | * pin: F4 F1 F5 F6 | |
53 | */ | |
54 | static void init_cols(void) | |
55 | { | |
56 | DDRF &= ~(1<<4 | 1<<1 | 1<<5 | 1<<6); | |
57 | PORTF |= (1<<4 | 1<<1 | 1<<5 | 1<<6); | |
58 | // Input with pull-up(DDR:0, PORT:1) | |
59 | } | |
60 | ||
61 | static matrix_row_t read_cols(void) | |
62 | { | |
63 | return (PINF&(1<<4) ? 0 : (1<<0)) | | |
64 | (PINF&(1<<1) ? 0 : (1<<1)) | | |
65 | (PINF&(1<<5) ? 0 : (1<<2)) | | |
66 | (PINF&(1<<6) ? 0 : (1<<3)); | |
67 | } | |
68 | ||
69 | /* Row pin configuration | |
70 | * row: 0 1 2 3 4 | |
71 | * pin: B1 B2 B3 B7 B0 | |
72 | */ | |
73 | static void unselect_rows(void) | |
74 | { | |
75 | // Hi-Z(DDR:0, PORT:0) to unselect | |
76 | DDRB &= ~0b10001111; | |
77 | - | PORTB &= ~0b00001111; |
77 | + | PORTB &= ~0b10001111; |
78 | } | |
79 | ||
80 | static void select_row(uint8_t row) | |
81 | { | |
82 | // Output low(DDR:1, PORT:0) to select | |
83 | switch (row) { | |
84 | case 0: | |
85 | DDRB |= (1<<1); | |
86 | PORTB &= ~(1<<1); | |
87 | break; | |
88 | case 1: | |
89 | DDRB |= (1<<2); | |
90 | PORTB &= ~(1<<2); | |
91 | break; | |
92 | case 2: | |
93 | DDRB |= (1<<3); | |
94 | PORTB &= ~(1<<3); | |
95 | break; | |
96 | case 3: | |
97 | DDRB |= (1<<7); | |
98 | PORTB &= ~(1<<7); | |
99 | break; | |
100 | case 4: | |
101 | DDRB |= (1<<0); | |
102 | PORTB &= ~(1<<0); | |
103 | break; | |
104 | } | |
105 | } | |
106 | -------------------------- | |
107 | Error from cygwin64: | |
108 | ||
109 | mkdir -p obj_gh60_lufa | |
110 | Compiling C: keymap_poker.c | |
111 | avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DBOOTMAGIC_ENABLE -DMOUSEKEY_ENABLE -DMOUSE_ENABLE -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=unknown -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_gh60_lufa/keymap_poker.lst -I. -I../.. -I../../protocol/lufa -I../../protocol/lufa/LUFA-120730 -I../../common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_gh60_lufa_keymap_poker.o.d keymap_poker.c -o obj_gh60_lufa/keymap_poker.o | |
112 | In file included from keymap_poker.c:1:0: | |
113 | keymap_common.h:46:1: error: parameter name missing | |
114 | ) { \ | |
115 | ^ | |
116 | keymap_poker.c:4:6: warning: implicit declaration of function 'KEYMAP' [-Wimplicit-function-declaration] | |
117 | KEYMAP(ESC,KC_KP_SLASH,KC_KP_ASTERISK,KC_KP_MINUS, \ | |
118 | ^ | |
119 | keymap_poker.c:4:13: error: 'ESC' undeclared here (not in a function) | |
120 | KEYMAP(ESC,KC_KP_SLASH,KC_KP_ASTERISK,KC_KP_MINUS, \ | |
121 | ^ | |
122 | ../../rules.mk:541: recipe for target 'obj_gh60_lufa/keymap_poker.o' failed | |
123 | make: *** [obj_gh60_lufa/keymap_poker.o] Error 1 |