diff options
| author | James Young <18669334+noroadsleft@users.noreply.github.com> | 2021-08-05 22:18:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-05 22:18:17 -0700 |
| commit | b9a1b61f6ac42bbd73123d86058ec8b7048d5da6 (patch) | |
| tree | e26358969037d4dcd0750c20f3ab3de53d58739a /keyboards/flehrad | |
| parent | 28b59c30d2aa73ea56b3f16cf341bdc2883f11d8 (diff) | |
| download | qmk_firmware-b9a1b61f6ac42bbd73123d86058ec8b7048d5da6.tar.gz qmk_firmware-b9a1b61f6ac42bbd73123d86058ec8b7048d5da6.zip | |
Flehrad Tradestation Refactor (#13897)
* add license headers
Apache 2.0 per the included `license` file.
* info.json: use human-friendly formatting
* refactor keymaps
- split `default` keymap into `default` and `tradestation` keymaps (one for each layout)
- remove boilerplate functions
- apply four-space indent
* partial clean up of rules.mk
- update section header comment blocks
Diffstat (limited to 'keyboards/flehrad')
| -rw-r--r-- | keyboards/flehrad/tradestation/config.h | 15 | ||||
| -rw-r--r-- | keyboards/flehrad/tradestation/info.json | 40 | ||||
| -rw-r--r-- | keyboards/flehrad/tradestation/keymaps/default/keymap.c | 76 | ||||
| -rw-r--r-- | keyboards/flehrad/tradestation/keymaps/tradestation/keymap.c | 27 | ||||
| -rw-r--r-- | keyboards/flehrad/tradestation/rules.mk | 9 | ||||
| -rw-r--r-- | keyboards/flehrad/tradestation/tradestation.c | 15 | ||||
| -rw-r--r-- | keyboards/flehrad/tradestation/tradestation.h | 15 |
7 files changed, 132 insertions, 65 deletions
diff --git a/keyboards/flehrad/tradestation/config.h b/keyboards/flehrad/tradestation/config.h index 03c4fb122..6b8f021eb 100644 --- a/keyboards/flehrad/tradestation/config.h +++ b/keyboards/flehrad/tradestation/config.h | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | /* Copyright 2019 flehrad | ||
| 2 | * | ||
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | * you may not use this file except in compliance with the License. | ||
| 5 | * You may obtain a copy of the License at | ||
| 6 | * | ||
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | * | ||
| 9 | * Unless required by applicable law or agreed to in writing, software | ||
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | * See the License for the specific language governing permissions and | ||
| 13 | * limitations under the License. | ||
| 14 | */ | ||
| 15 | |||
| 1 | #pragma once | 16 | #pragma once |
| 2 | 17 | ||
| 3 | #include "config_common.h" | 18 | #include "config_common.h" |
diff --git a/keyboards/flehrad/tradestation/info.json b/keyboards/flehrad/tradestation/info.json index 233eb6282..d90769bed 100644 --- a/keyboards/flehrad/tradestation/info.json +++ b/keyboards/flehrad/tradestation/info.json | |||
| @@ -6,10 +6,46 @@ | |||
| 6 | "height": 4.5, | 6 | "height": 4.5, |
| 7 | "layouts": { | 7 | "layouts": { |
| 8 | "LAYOUT_tradestation": { | 8 | "LAYOUT_tradestation": { |
| 9 | "layout": [{"x":0, "y":0},{"x":1.125, "y":0},{"x":2.25, "y":0},{"x":3.375, "y":0},{"x":0, "y":1.1},{"x":1.125, "y":1.1},{"x":2.25, "y":1.1},{"x":3.375, "y":1.1},{"x":0, "y":2.25, "w":2},{"x":2.25, "y":2.25, "w":2},{"x":0, "y":3.5, "w":2},{"x":2.25, "y":3.5, "w":2}] | 9 | "layout": [ |
| 10 | {"x":0, "y":0}, | ||
| 11 | {"x":1.125, "y":0}, | ||
| 12 | {"x":2.25, "y":0}, | ||
| 13 | {"x":3.375, "y":0}, | ||
| 14 | |||
| 15 | {"x":0, "y":1.1}, | ||
| 16 | {"x":1.125, "y":1.1}, | ||
| 17 | {"x":2.25, "y":1.1}, | ||
| 18 | {"x":3.375, "y":1.1}, | ||
| 19 | |||
| 20 | {"x":0, "y":2.25, "w":2}, | ||
| 21 | {"x":2.25, "y":2.25, "w":2}, | ||
| 22 | |||
| 23 | {"x":0, "y":3.5, "w":2}, | ||
| 24 | {"x":2.25, "y":3.5, "w":2} | ||
| 25 | ] | ||
| 10 | }, | 26 | }, |
| 11 | "LAYOUT_ortho_4x4": { | 27 | "LAYOUT_ortho_4x4": { |
| 12 | "layout": [{"x":0, "y":0},{"x":1.125, "y":0},{"x":2.25, "y":0},{"x":3.375, "y":0},{"x":0, "y":1.1},{"x":1.125, "y":1.1},{"x":2.25, "y":1.1},{"x":3.375, "y":1.1},{"x":0, "y":2.25},{"x":1.125, "y":2.25},{"x":2.25, "y":2.25},{"x":3.375, "y":2.25},{"x":0, "y":3.5},{"x":1.125, "y":3.5},{"x":2.25, "y":3.5},{"x":3.375, "y":3.5}] | 28 | "layout": [ |
| 29 | {"x":0, "y":0}, | ||
| 30 | {"x":1.125, "y":0}, | ||
| 31 | {"x":2.25, "y":0}, | ||
| 32 | {"x":3.375, "y":0}, | ||
| 33 | |||
| 34 | {"x":0, "y":1.1}, | ||
| 35 | {"x":1.125, "y":1.1}, | ||
| 36 | {"x":2.25, "y":1.1}, | ||
| 37 | {"x":3.375, "y":1.1}, | ||
| 38 | |||
| 39 | {"x":0, "y":2.25}, | ||
| 40 | {"x":1.125, "y":2.25}, | ||
| 41 | {"x":2.25, "y":2.25}, | ||
| 42 | {"x":3.375, "y":2.25}, | ||
| 43 | |||
| 44 | {"x":0, "y":3.5}, | ||
| 45 | {"x":1.125, "y":3.5}, | ||
| 46 | {"x":2.25, "y":3.5}, | ||
| 47 | {"x":3.375, "y":3.5} | ||
| 48 | ] | ||
| 13 | } | 49 | } |
| 14 | } | 50 | } |
| 15 | } | 51 | } |
diff --git a/keyboards/flehrad/tradestation/keymaps/default/keymap.c b/keyboards/flehrad/tradestation/keymaps/default/keymap.c index 3497dcb94..e0893d9bd 100644 --- a/keyboards/flehrad/tradestation/keymaps/default/keymap.c +++ b/keyboards/flehrad/tradestation/keymaps/default/keymap.c | |||
| @@ -1,61 +1,27 @@ | |||
| 1 | /* Copyright 2019 flehrad | ||
| 2 | * | ||
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | * you may not use this file except in compliance with the License. | ||
| 5 | * You may obtain a copy of the License at | ||
| 6 | * | ||
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | * | ||
| 9 | * Unless required by applicable law or agreed to in writing, software | ||
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | * See the License for the specific language governing permissions and | ||
| 13 | * limitations under the License. | ||
| 14 | */ | ||
| 15 | |||
| 1 | #include QMK_KEYBOARD_H | 16 | #include QMK_KEYBOARD_H |
| 2 | 17 | ||
| 3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| 4 | 19 | ||
| 5 | LAYOUT_ortho_4x4( | 20 | [0] = LAYOUT_ortho_4x4( |
| 6 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 21 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 7 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 22 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 8 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | 23 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
| 9 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), | 24 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS |
| 25 | ), | ||
| 10 | 26 | ||
| 11 | LAYOUT_tradestation( | ||
| 12 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 13 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 14 | KC_TRNS, KC_TRNS, | ||
| 15 | KC_TRNS, KC_TRNS), | ||
| 16 | }; | 27 | }; |
| 17 | |||
| 18 | |||
| 19 | void matrix_init_user(void) { | ||
| 20 | } | ||
| 21 | |||
| 22 | void matrix_scan_user(void) { | ||
| 23 | } | ||
| 24 | |||
| 25 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 26 | return true; | ||
| 27 | } | ||
| 28 | |||
| 29 | void led_set_user(uint8_t usb_led) { | ||
| 30 | |||
| 31 | if (usb_led & (1 << USB_LED_NUM_LOCK)) { | ||
| 32 | |||
| 33 | } else { | ||
| 34 | |||
| 35 | } | ||
| 36 | |||
| 37 | if (usb_led & (1 << USB_LED_CAPS_LOCK)) { | ||
| 38 | |||
| 39 | } else { | ||
| 40 | |||
| 41 | } | ||
| 42 | |||
| 43 | if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { | ||
| 44 | |||
| 45 | } else { | ||
| 46 | |||
| 47 | } | ||
| 48 | |||
| 49 | if (usb_led & (1 << USB_LED_COMPOSE)) { | ||
| 50 | |||
| 51 | } else { | ||
| 52 | |||
| 53 | } | ||
| 54 | |||
| 55 | if (usb_led & (1 << USB_LED_KANA)) { | ||
| 56 | |||
| 57 | } else { | ||
| 58 | |||
| 59 | } | ||
| 60 | |||
| 61 | } | ||
diff --git a/keyboards/flehrad/tradestation/keymaps/tradestation/keymap.c b/keyboards/flehrad/tradestation/keymaps/tradestation/keymap.c new file mode 100644 index 000000000..344b446f1 --- /dev/null +++ b/keyboards/flehrad/tradestation/keymaps/tradestation/keymap.c | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | /* Copyright 2019 flehrad | ||
| 2 | * | ||
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | * you may not use this file except in compliance with the License. | ||
| 5 | * You may obtain a copy of the License at | ||
| 6 | * | ||
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | * | ||
| 9 | * Unless required by applicable law or agreed to in writing, software | ||
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | * See the License for the specific language governing permissions and | ||
| 13 | * limitations under the License. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 19 | |||
| 20 | [0] = LAYOUT_tradestation( | ||
| 21 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 22 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
| 23 | KC_TRNS, KC_TRNS, | ||
| 24 | KC_TRNS, KC_TRNS | ||
| 25 | ), | ||
| 26 | |||
| 27 | }; | ||
diff --git a/keyboards/flehrad/tradestation/rules.mk b/keyboards/flehrad/tradestation/rules.mk index cf6c47d74..cf3068c02 100644 --- a/keyboards/flehrad/tradestation/rules.mk +++ b/keyboards/flehrad/tradestation/rules.mk | |||
| @@ -2,17 +2,10 @@ | |||
| 2 | MCU = atmega32u4 | 2 | MCU = atmega32u4 |
| 3 | 3 | ||
| 4 | # Bootloader selection | 4 | # Bootloader selection |
| 5 | # Teensy halfkay | ||
| 6 | # Pro Micro caterina | ||
| 7 | # Atmel DFU atmel-dfu | ||
| 8 | # LUFA DFU lufa-dfu | ||
| 9 | # QMK DFU qmk-dfu | ||
| 10 | # ATmega32A bootloadHID | ||
| 11 | # ATmega328P USBasp | ||
| 12 | BOOTLOADER = caterina | 5 | BOOTLOADER = caterina |
| 13 | 6 | ||
| 14 | # Build Options | 7 | # Build Options |
| 15 | # comment out to disable the options. | 8 | # change yes to no to disable |
| 16 | # | 9 | # |
| 17 | BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration(+1000) | 10 | BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration(+1000) |
| 18 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | 11 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) |
diff --git a/keyboards/flehrad/tradestation/tradestation.c b/keyboards/flehrad/tradestation/tradestation.c index a3285a2cc..bd572db83 100644 --- a/keyboards/flehrad/tradestation/tradestation.c +++ b/keyboards/flehrad/tradestation/tradestation.c | |||
| @@ -1 +1,16 @@ | |||
| 1 | /* Copyright 2019 flehrad | ||
| 2 | * | ||
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | * you may not use this file except in compliance with the License. | ||
| 5 | * You may obtain a copy of the License at | ||
| 6 | * | ||
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | * | ||
| 9 | * Unless required by applicable law or agreed to in writing, software | ||
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | * See the License for the specific language governing permissions and | ||
| 13 | * limitations under the License. | ||
| 14 | */ | ||
| 15 | |||
| 1 | #include "tradestation.h" | 16 | #include "tradestation.h" |
diff --git a/keyboards/flehrad/tradestation/tradestation.h b/keyboards/flehrad/tradestation/tradestation.h index 60b53b7dd..806143259 100644 --- a/keyboards/flehrad/tradestation/tradestation.h +++ b/keyboards/flehrad/tradestation/tradestation.h | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | /* Copyright 2019 flehrad | ||
| 2 | * | ||
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | * you may not use this file except in compliance with the License. | ||
| 5 | * You may obtain a copy of the License at | ||
| 6 | * | ||
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | * | ||
| 9 | * Unless required by applicable law or agreed to in writing, software | ||
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | * See the License for the specific language governing permissions and | ||
| 13 | * limitations under the License. | ||
| 14 | */ | ||
| 15 | |||
| 1 | #pragma once | 16 | #pragma once |
| 2 | 17 | ||
| 3 | #include "quantum.h" | 18 | #include "quantum.h" |
