From 27afac80ff5b18e577b88bc6d98e55c9e0153505 Mon Sep 17 00:00:00 2001 From: Balz Guenat Date: Tue, 10 Oct 2017 22:39:24 +0200 Subject: [PATCH 1/4] restructure converters each converter is its own keyboard and different hardware variants are different subprojects. remove (seemingly) old method of loading layouts from main Makefile --- Makefile | 32 +++++++++++-------- keyboards/converter/converter.c | 1 - keyboards/converter/converter.h | 1 - .../converter/ibm_terminal/ibm_terminal.c | 6 ---- keyboards/converter/rules.mk | 0 keyboards/converter/usb_usb/usb_usb.c | 1 - .../README | 8 ++--- .../config.h | 0 .../ibm_terminal_converter.c | 1 + .../ibm_terminal_converter.h} | 4 +-- .../keymaps/default/config.h | 0 .../keymaps/default/keymap.c | 2 +- .../keymaps/default/rules.mk | 0 .../keymaps/priyadi/config.h | 0 .../keymaps/priyadi/keymap.c | 2 +- .../keymaps/priyadi/rules.mk | 0 .../led.c | 0 .../matrix.c | 0 .../rules.mk | 0 .../usb_usb => usb_usb_converter}/README.md | 17 ++++++---- .../usb_usb => usb_usb_converter}/config.h | 0 .../custom_matrix.cpp | 0 keyboards/usb_usb_converter/hasu/hasu.c | 1 + keyboards/usb_usb_converter/hasu/hasu.h | 6 ++++ keyboards/usb_usb_converter/hasu/rules.mk | 1 + .../usb_usb => usb_usb_converter}/keymap.c | 0 .../keymaps/coloneljesus/config.h | 0 .../keymaps/coloneljesus/keymap.c | 2 +- .../keymaps/default/config.h | 0 .../keymaps/default/keymap.c | 2 +- .../usb_usb => usb_usb_converter}/main.c | 0 .../usb_usb => usb_usb_converter}/matrix.c | 0 .../usb_usb_converter/pro_micro/pro_micro.c | 1 + .../usb_usb_converter/pro_micro/pro_micro.h | 6 ++++ .../usb_usb_converter/pro_micro/rules.mk | 1 + .../usb_usb => usb_usb_converter}/rules.mk | 8 ++++- .../usb_usb_converter/usb_usb_converter.c | 1 + .../usb_usb_converter.h} | 4 +-- 38 files changed, 66 insertions(+), 42 deletions(-) delete mode 100644 keyboards/converter/converter.c delete mode 100644 keyboards/converter/converter.h delete mode 100644 keyboards/converter/ibm_terminal/ibm_terminal.c delete mode 100644 keyboards/converter/rules.mk delete mode 100644 keyboards/converter/usb_usb/usb_usb.c rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/README (86%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/config.h (100%) create mode 100644 keyboards/ibm_terminal_converter/ibm_terminal_converter.c rename keyboards/{converter/ibm_terminal/ibm_terminal.h => ibm_terminal_converter/ibm_terminal_converter.h} (98%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/keymaps/default/config.h (100%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/keymaps/default/keymap.c (99%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/keymaps/default/rules.mk (100%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/keymaps/priyadi/config.h (100%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/keymaps/priyadi/keymap.c (99%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/keymaps/priyadi/rules.mk (100%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/led.c (100%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/matrix.c (100%) rename keyboards/{converter/ibm_terminal => ibm_terminal_converter}/rules.mk (100%) rename keyboards/{converter/usb_usb => usb_usb_converter}/README.md (82%) rename keyboards/{converter/usb_usb => usb_usb_converter}/config.h (100%) rename keyboards/{converter/usb_usb => usb_usb_converter}/custom_matrix.cpp (100%) create mode 100644 keyboards/usb_usb_converter/hasu/hasu.c create mode 100644 keyboards/usb_usb_converter/hasu/hasu.h create mode 100644 keyboards/usb_usb_converter/hasu/rules.mk rename keyboards/{converter/usb_usb => usb_usb_converter}/keymap.c (100%) rename keyboards/{converter/usb_usb => usb_usb_converter}/keymaps/coloneljesus/config.h (100%) rename keyboards/{converter/usb_usb => usb_usb_converter}/keymaps/coloneljesus/keymap.c (99%) rename keyboards/{converter/usb_usb => usb_usb_converter}/keymaps/default/config.h (100%) rename keyboards/{converter/usb_usb => usb_usb_converter}/keymaps/default/keymap.c (99%) rename keyboards/{converter/usb_usb => usb_usb_converter}/main.c (100%) rename keyboards/{converter/usb_usb => usb_usb_converter}/matrix.c (100%) create mode 100644 keyboards/usb_usb_converter/pro_micro/pro_micro.c create mode 100644 keyboards/usb_usb_converter/pro_micro/pro_micro.h create mode 100644 keyboards/usb_usb_converter/pro_micro/rules.mk rename keyboards/{converter/usb_usb => usb_usb_converter}/rules.mk (86%) create mode 100644 keyboards/usb_usb_converter/usb_usb_converter.c rename keyboards/{converter/usb_usb/usb_usb.h => usb_usb_converter/usb_usb_converter.h} (99%) diff --git a/Makefile b/Makefile index 1ca9876a2895..e8f47f3e2f1a 100644 --- a/Makefile +++ b/Makefile @@ -316,21 +316,21 @@ define PARSE_SUBPROJECT ifneq ($$(CURRENT_SP),allsp) # get a list of all keymaps KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.))) - LAYOUTS := - $$(eval -include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/rules.mk) - KEYBOARD_LAYOUTS := $$(LAYOUTS) - ifneq ($$(CURRENT_SP),) - # if the subproject is defined, then also look for keymaps inside the subproject folder - SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.))) - KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS)) - # $$(eval -include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/rules.mk) - # KEYBOARD_LAYOUTS := $$(sort $$(KEYBOARD_LAYOUTS) $$(LAYOUTS)) - endif - - LAYOUT_KEYMAPS := - $$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.))))) + # LAYOUTS := + # $$(eval -include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/rules.mk) + # KEYBOARD_LAYOUTS := $$(LAYOUTS) + # ifneq ($$(CURRENT_SP),) + # # if the subproject is defined, then also look for keymaps inside the subproject folder + # SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.))) + # KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS)) + # # $$(eval -include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/rules.mk) + # # KEYBOARD_LAYOUTS := $$(sort $$(KEYBOARD_LAYOUTS) $$(LAYOUTS)) + # endif + + # LAYOUT_KEYMAPS := + # $$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.))))) - KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS)) + KEYMAPS := $$(sort $$(KEYMAPS)) # if the rule after removing the start of it is empty (we haven't specified a kemap or target) # compile all the keymaps ifeq ($$(RULE),) @@ -556,6 +556,10 @@ test: test-all .PHONY: test-clean test-clean: test-all-clean +.PHONY: clean +clean: + rm -r .build + lib/%: git submodule sync $? git submodule update --init $? diff --git a/keyboards/converter/converter.c b/keyboards/converter/converter.c deleted file mode 100644 index aa4bef63a956..000000000000 --- a/keyboards/converter/converter.c +++ /dev/null @@ -1 +0,0 @@ -#include "converter.h" \ No newline at end of file diff --git a/keyboards/converter/converter.h b/keyboards/converter/converter.h deleted file mode 100644 index 7a4a4835e61e..000000000000 --- a/keyboards/converter/converter.h +++ /dev/null @@ -1 +0,0 @@ -#include "quantum.h" \ No newline at end of file diff --git a/keyboards/converter/ibm_terminal/ibm_terminal.c b/keyboards/converter/ibm_terminal/ibm_terminal.c deleted file mode 100644 index 17296864a30e..000000000000 --- a/keyboards/converter/ibm_terminal/ibm_terminal.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "ibm_terminal.h" - -// void matrix_init_kb(void) { - -// matrix_init_user(); -// } \ No newline at end of file diff --git a/keyboards/converter/rules.mk b/keyboards/converter/rules.mk deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/keyboards/converter/usb_usb/usb_usb.c b/keyboards/converter/usb_usb/usb_usb.c deleted file mode 100644 index e7657938d2e2..000000000000 --- a/keyboards/converter/usb_usb/usb_usb.c +++ /dev/null @@ -1 +0,0 @@ -#include "usb_usb.h" \ No newline at end of file diff --git a/keyboards/converter/ibm_terminal/README b/keyboards/ibm_terminal_converter/README similarity index 86% rename from keyboards/converter/ibm_terminal/README rename to keyboards/ibm_terminal_converter/README index 6b7aff2c842f..7911a9d1ae24 100644 --- a/keyboards/converter/ibm_terminal/README +++ b/keyboards/ibm_terminal_converter/README @@ -6,7 +6,7 @@ This is a port of TMK's converter/terminal_usb to QMK. It supports PS/2 Scan Code Set 3 and runs on USB AVR chips such like PJRC Teensy. I tested the converter on ATMega32U4 with 1392595(102keys) and 6110345(122keys). -Source code: https://github.com/tmk/tmk_keyboard +Source code: https://github.com/qmk/qmk_firmware.git Article: http://geekhack.org/index.php?topic=27272.0 @@ -22,9 +22,9 @@ And VCC and GND, of course. See RESOURCE for keyboard connector pin assign. BUILD ----- -$ git clone https://github.com/tmk/tmk_keyboard.git -$ cd converter/terminal_usb -$ make +$ git clone https://github.com/qmk/qmk_firmware.git +$ cd qmk_firmware +$ make ibm_terminal_converter RESOURCE diff --git a/keyboards/converter/ibm_terminal/config.h b/keyboards/ibm_terminal_converter/config.h similarity index 100% rename from keyboards/converter/ibm_terminal/config.h rename to keyboards/ibm_terminal_converter/config.h diff --git a/keyboards/ibm_terminal_converter/ibm_terminal_converter.c b/keyboards/ibm_terminal_converter/ibm_terminal_converter.c new file mode 100644 index 000000000000..9d7d70dde341 --- /dev/null +++ b/keyboards/ibm_terminal_converter/ibm_terminal_converter.c @@ -0,0 +1 @@ +#include "ibm_terminal_converter.h" diff --git a/keyboards/converter/ibm_terminal/ibm_terminal.h b/keyboards/ibm_terminal_converter/ibm_terminal_converter.h similarity index 98% rename from keyboards/converter/ibm_terminal/ibm_terminal.h rename to keyboards/ibm_terminal_converter/ibm_terminal_converter.h index c6468349ca23..d61b96e46efc 100644 --- a/keyboards/converter/ibm_terminal/ibm_terminal.h +++ b/keyboards/ibm_terminal_converter/ibm_terminal_converter.h @@ -1,5 +1,5 @@ -#ifndef IBM_TERMINAL_H -#define IBM_TERMINAL_H +#ifndef IBM_TERMINAL_CONVERTER_H +#define IBM_TERMINAL_CONVERTER_H #include "quantum.h" diff --git a/keyboards/converter/ibm_terminal/keymaps/default/config.h b/keyboards/ibm_terminal_converter/keymaps/default/config.h similarity index 100% rename from keyboards/converter/ibm_terminal/keymaps/default/config.h rename to keyboards/ibm_terminal_converter/keymaps/default/config.h diff --git a/keyboards/converter/ibm_terminal/keymaps/default/keymap.c b/keyboards/ibm_terminal_converter/keymaps/default/keymap.c similarity index 99% rename from keyboards/converter/ibm_terminal/keymaps/default/keymap.c rename to keyboards/ibm_terminal_converter/keymaps/default/keymap.c index 2beb51106ec6..c899121e1a6f 100644 --- a/keyboards/converter/ibm_terminal/keymaps/default/keymap.c +++ b/keyboards/ibm_terminal_converter/keymaps/default/keymap.c @@ -21,7 +21,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" #include "util.h" -#include "ibm_terminal.h" +#include "ibm_terminal_converter.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Layer 0 diff --git a/keyboards/converter/ibm_terminal/keymaps/default/rules.mk b/keyboards/ibm_terminal_converter/keymaps/default/rules.mk similarity index 100% rename from keyboards/converter/ibm_terminal/keymaps/default/rules.mk rename to keyboards/ibm_terminal_converter/keymaps/default/rules.mk diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h b/keyboards/ibm_terminal_converter/keymaps/priyadi/config.h similarity index 100% rename from keyboards/converter/ibm_terminal/keymaps/priyadi/config.h rename to keyboards/ibm_terminal_converter/keymaps/priyadi/config.h diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c b/keyboards/ibm_terminal_converter/keymaps/priyadi/keymap.c similarity index 99% rename from keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c rename to keyboards/ibm_terminal_converter/keymaps/priyadi/keymap.c index 47a5181ddef3..28702e6e7404 100644 --- a/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c +++ b/keyboards/ibm_terminal_converter/keymaps/priyadi/keymap.c @@ -19,7 +19,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" #include "util.h" -#include "ibm_terminal.h" +#include "ibm_terminal_converter.h" #include "action_layer.h" // Fillers to make layering clearer diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk b/keyboards/ibm_terminal_converter/keymaps/priyadi/rules.mk similarity index 100% rename from keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk rename to keyboards/ibm_terminal_converter/keymaps/priyadi/rules.mk diff --git a/keyboards/converter/ibm_terminal/led.c b/keyboards/ibm_terminal_converter/led.c similarity index 100% rename from keyboards/converter/ibm_terminal/led.c rename to keyboards/ibm_terminal_converter/led.c diff --git a/keyboards/converter/ibm_terminal/matrix.c b/keyboards/ibm_terminal_converter/matrix.c similarity index 100% rename from keyboards/converter/ibm_terminal/matrix.c rename to keyboards/ibm_terminal_converter/matrix.c diff --git a/keyboards/converter/ibm_terminal/rules.mk b/keyboards/ibm_terminal_converter/rules.mk similarity index 100% rename from keyboards/converter/ibm_terminal/rules.mk rename to keyboards/ibm_terminal_converter/rules.mk diff --git a/keyboards/converter/usb_usb/README.md b/keyboards/usb_usb_converter/README.md similarity index 82% rename from keyboards/converter/usb_usb/README.md rename to keyboards/usb_usb_converter/README.md index c1904a8122ff..96983ba579a3 100644 --- a/keyboards/converter/usb_usb/README.md +++ b/keyboards/usb_usb_converter/README.md @@ -9,17 +9,22 @@ Hardware Availability: [GH thread](https://geekhack.org/index.php?topic=72052.0) Make example for this keyboard (after setting up your build environment): - make converter-usb_usb-default + make usb_usb-pro_micro-default See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +Note that you have to choose the right hardware variant as your subproject, otherwise you will probably have issues. + Troubleshooting & Known Issues ------------------------------ -The Pro Micro variant runs at 8MHz, hence the following line in `usb_usb/rules.mk`: -`F_CPU ?= 8000000` -If the firmware doesn't work, try changing that line to -`F_CPU ?= 16000000` -or override the `F_CPU` variable in the `rules.mk` of your keymap. +If something doesn't work, it's probably because of the CPU clock. +Be sure to select the correct subproject (the middle part of the `make` argument) according to your hardware. +If you are sure you have this correct, try changeing the default in `usb_usb/rules.mk` or overriding the value in the `rules.mk` of your keymap. + +The Pro Micro variant uses a 3.3V Pro Micro and thus runs at 8MHz, hence the following line in `usb_usb/pro_micro/rules.mk`: +`F_CPU = 8000000` +The converter sold by Hasu runs at 16MHz and so the corresponding line in `usb_usb/hasurules.mk` is: +`F_CPU = 16000000` Getting the Hardware -------------------- diff --git a/keyboards/converter/usb_usb/config.h b/keyboards/usb_usb_converter/config.h similarity index 100% rename from keyboards/converter/usb_usb/config.h rename to keyboards/usb_usb_converter/config.h diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/usb_usb_converter/custom_matrix.cpp similarity index 100% rename from keyboards/converter/usb_usb/custom_matrix.cpp rename to keyboards/usb_usb_converter/custom_matrix.cpp diff --git a/keyboards/usb_usb_converter/hasu/hasu.c b/keyboards/usb_usb_converter/hasu/hasu.c new file mode 100644 index 000000000000..3357735ffda8 --- /dev/null +++ b/keyboards/usb_usb_converter/hasu/hasu.c @@ -0,0 +1 @@ +#include "hasu.h" diff --git a/keyboards/usb_usb_converter/hasu/hasu.h b/keyboards/usb_usb_converter/hasu/hasu.h new file mode 100644 index 000000000000..d5e78558608e --- /dev/null +++ b/keyboards/usb_usb_converter/hasu/hasu.h @@ -0,0 +1,6 @@ +#ifndef HASU_H +#define HASU_H + +#include QMK_KEYBOARD_H + +#endif diff --git a/keyboards/usb_usb_converter/hasu/rules.mk b/keyboards/usb_usb_converter/hasu/rules.mk new file mode 100644 index 000000000000..27d8af7683e8 --- /dev/null +++ b/keyboards/usb_usb_converter/hasu/rules.mk @@ -0,0 +1 @@ +F_CPU = 16000000 diff --git a/keyboards/converter/usb_usb/keymap.c b/keyboards/usb_usb_converter/keymap.c similarity index 100% rename from keyboards/converter/usb_usb/keymap.c rename to keyboards/usb_usb_converter/keymap.c diff --git a/keyboards/converter/usb_usb/keymaps/coloneljesus/config.h b/keyboards/usb_usb_converter/keymaps/coloneljesus/config.h similarity index 100% rename from keyboards/converter/usb_usb/keymaps/coloneljesus/config.h rename to keyboards/usb_usb_converter/keymaps/coloneljesus/config.h diff --git a/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c b/keyboards/usb_usb_converter/keymaps/coloneljesus/keymap.c similarity index 99% rename from keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c rename to keyboards/usb_usb_converter/keymaps/coloneljesus/keymap.c index 0cc66fd53dca..1aae1ad49e9d 100644 --- a/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c +++ b/keyboards/usb_usb_converter/keymaps/coloneljesus/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb.h" +#include "usb_usb_converter.h" const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching diff --git a/keyboards/converter/usb_usb/keymaps/default/config.h b/keyboards/usb_usb_converter/keymaps/default/config.h similarity index 100% rename from keyboards/converter/usb_usb/keymaps/default/config.h rename to keyboards/usb_usb_converter/keymaps/default/config.h diff --git a/keyboards/converter/usb_usb/keymaps/default/keymap.c b/keyboards/usb_usb_converter/keymaps/default/keymap.c similarity index 99% rename from keyboards/converter/usb_usb/keymaps/default/keymap.c rename to keyboards/usb_usb_converter/keymaps/default/keymap.c index 9817a607d38b..92acf5febc50 100644 --- a/keyboards/converter/usb_usb/keymaps/default/keymap.c +++ b/keyboards/usb_usb_converter/keymaps/default/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb.h" +#include "usb_usb_converter.h" const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching diff --git a/keyboards/converter/usb_usb/main.c b/keyboards/usb_usb_converter/main.c similarity index 100% rename from keyboards/converter/usb_usb/main.c rename to keyboards/usb_usb_converter/main.c diff --git a/keyboards/converter/usb_usb/matrix.c b/keyboards/usb_usb_converter/matrix.c similarity index 100% rename from keyboards/converter/usb_usb/matrix.c rename to keyboards/usb_usb_converter/matrix.c diff --git a/keyboards/usb_usb_converter/pro_micro/pro_micro.c b/keyboards/usb_usb_converter/pro_micro/pro_micro.c new file mode 100644 index 000000000000..f10142f81a31 --- /dev/null +++ b/keyboards/usb_usb_converter/pro_micro/pro_micro.c @@ -0,0 +1 @@ +#include "pro_micro.h" diff --git a/keyboards/usb_usb_converter/pro_micro/pro_micro.h b/keyboards/usb_usb_converter/pro_micro/pro_micro.h new file mode 100644 index 000000000000..566df9f20fd8 --- /dev/null +++ b/keyboards/usb_usb_converter/pro_micro/pro_micro.h @@ -0,0 +1,6 @@ +#ifndef PRO_MICRO_H +#define PRO_MICRO_H + +#include QMK_KEYBOARD_H + +#endif diff --git a/keyboards/usb_usb_converter/pro_micro/rules.mk b/keyboards/usb_usb_converter/pro_micro/rules.mk new file mode 100644 index 000000000000..7c04fa34fd24 --- /dev/null +++ b/keyboards/usb_usb_converter/pro_micro/rules.mk @@ -0,0 +1 @@ +F_CPU = 8000000 diff --git a/keyboards/converter/usb_usb/rules.mk b/keyboards/usb_usb_converter/rules.mk similarity index 86% rename from keyboards/converter/usb_usb/rules.mk rename to keyboards/usb_usb_converter/rules.mk index 4ee6cdb1ce63..5bf37d59b972 100644 --- a/keyboards/converter/usb_usb/rules.mk +++ b/keyboards/usb_usb_converter/rules.mk @@ -13,7 +13,13 @@ MCU ?= atmega32u4 # does not *change* the processor frequency - it should merely be updated to # reflect the processor speed set externally so that the code can use accurate # software delays. -F_CPU ?= 8000000 + +# Since there are different hardware variations of these adapters and since these +# have different CPU clocks, the clock speed should be set in the rules.mk file of the +# respective hardware variantion (i.e. subproject). For example, in /pro_micro/rules.mk +# this is set to 8000000. +# The value here is only a fallback and is ignored if it is defined in the subproject. +F_CPU ?= 16000000 # diff --git a/keyboards/usb_usb_converter/usb_usb_converter.c b/keyboards/usb_usb_converter/usb_usb_converter.c new file mode 100644 index 000000000000..ddef96f9abaf --- /dev/null +++ b/keyboards/usb_usb_converter/usb_usb_converter.c @@ -0,0 +1 @@ +#include "usb_usb_converter.h" diff --git a/keyboards/converter/usb_usb/usb_usb.h b/keyboards/usb_usb_converter/usb_usb_converter.h similarity index 99% rename from keyboards/converter/usb_usb/usb_usb.h rename to keyboards/usb_usb_converter/usb_usb_converter.h index c31fae1d0fa3..0ba1a8291b58 100644 --- a/keyboards/converter/usb_usb/usb_usb.h +++ b/keyboards/usb_usb_converter/usb_usb_converter.h @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef USB_USB_H -#define USB_USB_H +#ifndef USB_USB_CONVERTER_H +#define USB_USB_CONVERTER_H #include "quantum.h" From 51be454982d5172424567475c376a02e0ab1a223 Mon Sep 17 00:00:00 2001 From: Balz Guenat Date: Sat, 30 Sep 2017 00:43:06 +0200 Subject: [PATCH 2/4] call led_set_kb() from overridden led_set() --- keyboards/converter/usb_usb/custom_matrix.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp index 93d13edf0b55..bbe298d023a5 100644 --- a/keyboards/converter/usb_usb/custom_matrix.cpp +++ b/keyboards/converter/usb_usb/custom_matrix.cpp @@ -233,6 +233,7 @@ extern "C" kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); + led_set_kb(usb_led); } }; From 976c4d72d633ab8b662d152211bd4cacd0d1af2a Mon Sep 17 00:00:00 2001 From: Balz Guenat Date: Tue, 7 Nov 2017 23:49:15 +0100 Subject: [PATCH 3/4] put converter back into one folder --- .../{ibm_terminal_converter => converter/ibm_terminal}/README | 0 .../ibm_terminal}/config.h | 0 .../ibm_terminal}/ibm_terminal_converter.c | 0 .../ibm_terminal}/ibm_terminal_converter.h | 0 .../ibm_terminal}/keymaps/default/config.h | 0 .../ibm_terminal}/keymaps/default/keymap.c | 0 .../ibm_terminal}/keymaps/default/rules.mk | 0 .../ibm_terminal}/keymaps/priyadi/config.h | 0 .../ibm_terminal}/keymaps/priyadi/keymap.c | 0 .../ibm_terminal}/keymaps/priyadi/rules.mk | 0 .../{ibm_terminal_converter => converter/ibm_terminal}/led.c | 0 .../ibm_terminal}/matrix.c | 0 .../ibm_terminal}/rules.mk | 0 keyboards/{usb_usb_converter => converter/usb_usb}/README.md | 0 keyboards/{usb_usb_converter => converter/usb_usb}/config.h | 0 .../usb_usb}/custom_matrix.cpp | 0 .../{usb_usb_converter => converter/usb_usb}/hasu/hasu.c | 0 .../{usb_usb_converter => converter/usb_usb}/hasu/hasu.h | 0 .../{usb_usb_converter => converter/usb_usb}/hasu/rules.mk | 0 keyboards/{usb_usb_converter => converter/usb_usb}/keymap.c | 0 .../usb_usb}/keymaps/coloneljesus/config.h | 0 .../usb_usb}/keymaps/coloneljesus/keymap.c | 0 .../usb_usb}/keymaps/default/config.h | 0 .../usb_usb}/keymaps/default/keymap.c | 0 keyboards/{usb_usb_converter => converter/usb_usb}/main.c | 0 keyboards/{usb_usb_converter => converter/usb_usb}/matrix.c | 0 .../usb_usb}/pro_micro/pro_micro.c | 0 .../usb_usb}/pro_micro/pro_micro.h | 0 .../usb_usb}/pro_micro/rules.mk | 0 keyboards/{usb_usb_converter => converter/usb_usb}/rules.mk | 4 +++- .../usb_usb}/usb_usb_converter.c | 0 .../usb_usb}/usb_usb_converter.h | 0 32 files changed, 3 insertions(+), 1 deletion(-) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/README (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/config.h (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/ibm_terminal_converter.c (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/ibm_terminal_converter.h (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/keymaps/default/config.h (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/keymaps/default/keymap.c (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/keymaps/default/rules.mk (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/keymaps/priyadi/config.h (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/keymaps/priyadi/keymap.c (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/keymaps/priyadi/rules.mk (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/led.c (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/matrix.c (100%) rename keyboards/{ibm_terminal_converter => converter/ibm_terminal}/rules.mk (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/README.md (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/config.h (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/custom_matrix.cpp (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/hasu/hasu.c (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/hasu/hasu.h (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/hasu/rules.mk (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/keymap.c (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/keymaps/coloneljesus/config.h (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/keymaps/coloneljesus/keymap.c (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/keymaps/default/config.h (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/keymaps/default/keymap.c (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/main.c (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/matrix.c (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/pro_micro/pro_micro.c (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/pro_micro/pro_micro.h (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/pro_micro/rules.mk (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/rules.mk (97%) rename keyboards/{usb_usb_converter => converter/usb_usb}/usb_usb_converter.c (100%) rename keyboards/{usb_usb_converter => converter/usb_usb}/usb_usb_converter.h (100%) diff --git a/keyboards/ibm_terminal_converter/README b/keyboards/converter/ibm_terminal/README similarity index 100% rename from keyboards/ibm_terminal_converter/README rename to keyboards/converter/ibm_terminal/README diff --git a/keyboards/ibm_terminal_converter/config.h b/keyboards/converter/ibm_terminal/config.h similarity index 100% rename from keyboards/ibm_terminal_converter/config.h rename to keyboards/converter/ibm_terminal/config.h diff --git a/keyboards/ibm_terminal_converter/ibm_terminal_converter.c b/keyboards/converter/ibm_terminal/ibm_terminal_converter.c similarity index 100% rename from keyboards/ibm_terminal_converter/ibm_terminal_converter.c rename to keyboards/converter/ibm_terminal/ibm_terminal_converter.c diff --git a/keyboards/ibm_terminal_converter/ibm_terminal_converter.h b/keyboards/converter/ibm_terminal/ibm_terminal_converter.h similarity index 100% rename from keyboards/ibm_terminal_converter/ibm_terminal_converter.h rename to keyboards/converter/ibm_terminal/ibm_terminal_converter.h diff --git a/keyboards/ibm_terminal_converter/keymaps/default/config.h b/keyboards/converter/ibm_terminal/keymaps/default/config.h similarity index 100% rename from keyboards/ibm_terminal_converter/keymaps/default/config.h rename to keyboards/converter/ibm_terminal/keymaps/default/config.h diff --git a/keyboards/ibm_terminal_converter/keymaps/default/keymap.c b/keyboards/converter/ibm_terminal/keymaps/default/keymap.c similarity index 100% rename from keyboards/ibm_terminal_converter/keymaps/default/keymap.c rename to keyboards/converter/ibm_terminal/keymaps/default/keymap.c diff --git a/keyboards/ibm_terminal_converter/keymaps/default/rules.mk b/keyboards/converter/ibm_terminal/keymaps/default/rules.mk similarity index 100% rename from keyboards/ibm_terminal_converter/keymaps/default/rules.mk rename to keyboards/converter/ibm_terminal/keymaps/default/rules.mk diff --git a/keyboards/ibm_terminal_converter/keymaps/priyadi/config.h b/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h similarity index 100% rename from keyboards/ibm_terminal_converter/keymaps/priyadi/config.h rename to keyboards/converter/ibm_terminal/keymaps/priyadi/config.h diff --git a/keyboards/ibm_terminal_converter/keymaps/priyadi/keymap.c b/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c similarity index 100% rename from keyboards/ibm_terminal_converter/keymaps/priyadi/keymap.c rename to keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c diff --git a/keyboards/ibm_terminal_converter/keymaps/priyadi/rules.mk b/keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk similarity index 100% rename from keyboards/ibm_terminal_converter/keymaps/priyadi/rules.mk rename to keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk diff --git a/keyboards/ibm_terminal_converter/led.c b/keyboards/converter/ibm_terminal/led.c similarity index 100% rename from keyboards/ibm_terminal_converter/led.c rename to keyboards/converter/ibm_terminal/led.c diff --git a/keyboards/ibm_terminal_converter/matrix.c b/keyboards/converter/ibm_terminal/matrix.c similarity index 100% rename from keyboards/ibm_terminal_converter/matrix.c rename to keyboards/converter/ibm_terminal/matrix.c diff --git a/keyboards/ibm_terminal_converter/rules.mk b/keyboards/converter/ibm_terminal/rules.mk similarity index 100% rename from keyboards/ibm_terminal_converter/rules.mk rename to keyboards/converter/ibm_terminal/rules.mk diff --git a/keyboards/usb_usb_converter/README.md b/keyboards/converter/usb_usb/README.md similarity index 100% rename from keyboards/usb_usb_converter/README.md rename to keyboards/converter/usb_usb/README.md diff --git a/keyboards/usb_usb_converter/config.h b/keyboards/converter/usb_usb/config.h similarity index 100% rename from keyboards/usb_usb_converter/config.h rename to keyboards/converter/usb_usb/config.h diff --git a/keyboards/usb_usb_converter/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp similarity index 100% rename from keyboards/usb_usb_converter/custom_matrix.cpp rename to keyboards/converter/usb_usb/custom_matrix.cpp diff --git a/keyboards/usb_usb_converter/hasu/hasu.c b/keyboards/converter/usb_usb/hasu/hasu.c similarity index 100% rename from keyboards/usb_usb_converter/hasu/hasu.c rename to keyboards/converter/usb_usb/hasu/hasu.c diff --git a/keyboards/usb_usb_converter/hasu/hasu.h b/keyboards/converter/usb_usb/hasu/hasu.h similarity index 100% rename from keyboards/usb_usb_converter/hasu/hasu.h rename to keyboards/converter/usb_usb/hasu/hasu.h diff --git a/keyboards/usb_usb_converter/hasu/rules.mk b/keyboards/converter/usb_usb/hasu/rules.mk similarity index 100% rename from keyboards/usb_usb_converter/hasu/rules.mk rename to keyboards/converter/usb_usb/hasu/rules.mk diff --git a/keyboards/usb_usb_converter/keymap.c b/keyboards/converter/usb_usb/keymap.c similarity index 100% rename from keyboards/usb_usb_converter/keymap.c rename to keyboards/converter/usb_usb/keymap.c diff --git a/keyboards/usb_usb_converter/keymaps/coloneljesus/config.h b/keyboards/converter/usb_usb/keymaps/coloneljesus/config.h similarity index 100% rename from keyboards/usb_usb_converter/keymaps/coloneljesus/config.h rename to keyboards/converter/usb_usb/keymaps/coloneljesus/config.h diff --git a/keyboards/usb_usb_converter/keymaps/coloneljesus/keymap.c b/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c similarity index 100% rename from keyboards/usb_usb_converter/keymaps/coloneljesus/keymap.c rename to keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c diff --git a/keyboards/usb_usb_converter/keymaps/default/config.h b/keyboards/converter/usb_usb/keymaps/default/config.h similarity index 100% rename from keyboards/usb_usb_converter/keymaps/default/config.h rename to keyboards/converter/usb_usb/keymaps/default/config.h diff --git a/keyboards/usb_usb_converter/keymaps/default/keymap.c b/keyboards/converter/usb_usb/keymaps/default/keymap.c similarity index 100% rename from keyboards/usb_usb_converter/keymaps/default/keymap.c rename to keyboards/converter/usb_usb/keymaps/default/keymap.c diff --git a/keyboards/usb_usb_converter/main.c b/keyboards/converter/usb_usb/main.c similarity index 100% rename from keyboards/usb_usb_converter/main.c rename to keyboards/converter/usb_usb/main.c diff --git a/keyboards/usb_usb_converter/matrix.c b/keyboards/converter/usb_usb/matrix.c similarity index 100% rename from keyboards/usb_usb_converter/matrix.c rename to keyboards/converter/usb_usb/matrix.c diff --git a/keyboards/usb_usb_converter/pro_micro/pro_micro.c b/keyboards/converter/usb_usb/pro_micro/pro_micro.c similarity index 100% rename from keyboards/usb_usb_converter/pro_micro/pro_micro.c rename to keyboards/converter/usb_usb/pro_micro/pro_micro.c diff --git a/keyboards/usb_usb_converter/pro_micro/pro_micro.h b/keyboards/converter/usb_usb/pro_micro/pro_micro.h similarity index 100% rename from keyboards/usb_usb_converter/pro_micro/pro_micro.h rename to keyboards/converter/usb_usb/pro_micro/pro_micro.h diff --git a/keyboards/usb_usb_converter/pro_micro/rules.mk b/keyboards/converter/usb_usb/pro_micro/rules.mk similarity index 100% rename from keyboards/usb_usb_converter/pro_micro/rules.mk rename to keyboards/converter/usb_usb/pro_micro/rules.mk diff --git a/keyboards/usb_usb_converter/rules.mk b/keyboards/converter/usb_usb/rules.mk similarity index 97% rename from keyboards/usb_usb_converter/rules.mk rename to keyboards/converter/usb_usb/rules.mk index 5bf37d59b972..4f8e51fa8cab 100644 --- a/keyboards/usb_usb_converter/rules.mk +++ b/keyboards/converter/usb_usb/rules.mk @@ -19,7 +19,9 @@ MCU ?= atmega32u4 # respective hardware variantion (i.e. subproject). For example, in /pro_micro/rules.mk # this is set to 8000000. # The value here is only a fallback and is ignored if it is defined in the subproject. -F_CPU ?= 16000000 +# F_CPU ?= 16000000 + +DEFAULT_FOLDER = converter/usb_usb/hasu # diff --git a/keyboards/usb_usb_converter/usb_usb_converter.c b/keyboards/converter/usb_usb/usb_usb_converter.c similarity index 100% rename from keyboards/usb_usb_converter/usb_usb_converter.c rename to keyboards/converter/usb_usb/usb_usb_converter.c diff --git a/keyboards/usb_usb_converter/usb_usb_converter.h b/keyboards/converter/usb_usb/usb_usb_converter.h similarity index 100% rename from keyboards/usb_usb_converter/usb_usb_converter.h rename to keyboards/converter/usb_usb/usb_usb_converter.h From 1856b237c6cd2124f0827ff1046fa8b867814e74 Mon Sep 17 00:00:00 2001 From: Balz Guenat Date: Wed, 8 Nov 2017 01:05:37 +0100 Subject: [PATCH 4/4] revert some structure changes to bring in line with #1784. Also attempt to get the BLE thing more properly integrated. Also also fix led_set() to call led_set_kb(). --- .../ibm_terminal/{README => README.md} | 2 +- .../converter/ibm_terminal/ibm_terminal.c | 1 + ...bm_terminal_converter.h => ibm_terminal.h} | 4 +- .../ibm_terminal/ibm_terminal_converter.c | 1 - .../ibm_terminal/keymaps/default/keymap.c | 2 +- .../ibm_terminal/keymaps/priyadi/keymap.c | 2 +- keyboards/converter/usb_usb/README.md | 2 +- .../usb_usb/{keymaps => }/ble/README.md | 0 keyboards/converter/usb_usb/ble/ble.c | 1 + keyboards/converter/usb_usb/ble/ble.h | 6 +++ keyboards/converter/usb_usb/ble/config.h | 13 +++++++ keyboards/converter/usb_usb/ble/rules.mk | 4 ++ keyboards/converter/usb_usb/config.h | 1 + keyboards/converter/usb_usb/custom_matrix.cpp | 37 ++++++++++--------- .../converter/usb_usb/keymaps/ble/config.h | 9 ----- .../converter/usb_usb/keymaps/ble/rules.mk | 3 -- .../usb_usb/keymaps/coloneljesus/keymap.c | 2 +- .../usb_usb/keymaps/default/keymap.c | 2 +- keyboards/converter/usb_usb/rules.mk | 2 +- keyboards/converter/usb_usb/usb_usb.c | 1 + .../{usb_usb_converter.h => usb_usb.h} | 4 +- .../converter/usb_usb/usb_usb_converter.c | 1 - 22 files changed, 58 insertions(+), 42 deletions(-) rename keyboards/converter/ibm_terminal/{README => README.md} (96%) create mode 100644 keyboards/converter/ibm_terminal/ibm_terminal.c rename keyboards/converter/ibm_terminal/{ibm_terminal_converter.h => ibm_terminal.h} (98%) delete mode 100644 keyboards/converter/ibm_terminal/ibm_terminal_converter.c rename keyboards/converter/usb_usb/{keymaps => }/ble/README.md (100%) create mode 100644 keyboards/converter/usb_usb/ble/ble.c create mode 100644 keyboards/converter/usb_usb/ble/ble.h create mode 100644 keyboards/converter/usb_usb/ble/config.h create mode 100644 keyboards/converter/usb_usb/ble/rules.mk delete mode 100644 keyboards/converter/usb_usb/keymaps/ble/rules.mk create mode 100644 keyboards/converter/usb_usb/usb_usb.c rename keyboards/converter/usb_usb/{usb_usb_converter.h => usb_usb.h} (99%) delete mode 100644 keyboards/converter/usb_usb/usb_usb_converter.c diff --git a/keyboards/converter/ibm_terminal/README b/keyboards/converter/ibm_terminal/README.md similarity index 96% rename from keyboards/converter/ibm_terminal/README rename to keyboards/converter/ibm_terminal/README.md index 7911a9d1ae24..dff26e0594f9 100644 --- a/keyboards/converter/ibm_terminal/README +++ b/keyboards/converter/ibm_terminal/README.md @@ -24,7 +24,7 @@ BUILD ----- $ git clone https://github.com/qmk/qmk_firmware.git $ cd qmk_firmware -$ make ibm_terminal_converter +$ make converter/ibm_terminal:default RESOURCE diff --git a/keyboards/converter/ibm_terminal/ibm_terminal.c b/keyboards/converter/ibm_terminal/ibm_terminal.c new file mode 100644 index 000000000000..fd64a21ace49 --- /dev/null +++ b/keyboards/converter/ibm_terminal/ibm_terminal.c @@ -0,0 +1 @@ +#include "ibm_terminal.h" diff --git a/keyboards/converter/ibm_terminal/ibm_terminal_converter.h b/keyboards/converter/ibm_terminal/ibm_terminal.h similarity index 98% rename from keyboards/converter/ibm_terminal/ibm_terminal_converter.h rename to keyboards/converter/ibm_terminal/ibm_terminal.h index d61b96e46efc..c6468349ca23 100644 --- a/keyboards/converter/ibm_terminal/ibm_terminal_converter.h +++ b/keyboards/converter/ibm_terminal/ibm_terminal.h @@ -1,5 +1,5 @@ -#ifndef IBM_TERMINAL_CONVERTER_H -#define IBM_TERMINAL_CONVERTER_H +#ifndef IBM_TERMINAL_H +#define IBM_TERMINAL_H #include "quantum.h" diff --git a/keyboards/converter/ibm_terminal/ibm_terminal_converter.c b/keyboards/converter/ibm_terminal/ibm_terminal_converter.c deleted file mode 100644 index 9d7d70dde341..000000000000 --- a/keyboards/converter/ibm_terminal/ibm_terminal_converter.c +++ /dev/null @@ -1 +0,0 @@ -#include "ibm_terminal_converter.h" diff --git a/keyboards/converter/ibm_terminal/keymaps/default/keymap.c b/keyboards/converter/ibm_terminal/keymaps/default/keymap.c index c899121e1a6f..2beb51106ec6 100644 --- a/keyboards/converter/ibm_terminal/keymaps/default/keymap.c +++ b/keyboards/converter/ibm_terminal/keymaps/default/keymap.c @@ -21,7 +21,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" #include "util.h" -#include "ibm_terminal_converter.h" +#include "ibm_terminal.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Layer 0 diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c b/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c index 28702e6e7404..47a5181ddef3 100644 --- a/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c +++ b/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c @@ -19,7 +19,7 @@ along with this program. If not, see . #include "print.h" #include "debug.h" #include "util.h" -#include "ibm_terminal_converter.h" +#include "ibm_terminal.h" #include "action_layer.h" // Fillers to make layering clearer diff --git a/keyboards/converter/usb_usb/README.md b/keyboards/converter/usb_usb/README.md index 82607eb4d77d..b529fbd28d65 100644 --- a/keyboards/converter/usb_usb/README.md +++ b/keyboards/converter/usb_usb/README.md @@ -23,7 +23,7 @@ If you are sure you have this correct, try changeing the default in `usb_usb/rul The Pro Micro variant uses a 3.3V Pro Micro and thus runs at 8MHz, hence the following line in `usb_usb/pro_micro/rules.mk`: `F_CPU = 8000000` -The converter sold by Hasu runs at 16MHz and so the corresponding line in `usb_usb/hasurules.mk` is: +The converter sold by Hasu runs at 16MHz and so the corresponding line in `usb_usb/hasu/rules.mk` is: `F_CPU = 16000000` Getting the Hardware diff --git a/keyboards/converter/usb_usb/keymaps/ble/README.md b/keyboards/converter/usb_usb/ble/README.md similarity index 100% rename from keyboards/converter/usb_usb/keymaps/ble/README.md rename to keyboards/converter/usb_usb/ble/README.md diff --git a/keyboards/converter/usb_usb/ble/ble.c b/keyboards/converter/usb_usb/ble/ble.c new file mode 100644 index 000000000000..387eb8166c00 --- /dev/null +++ b/keyboards/converter/usb_usb/ble/ble.c @@ -0,0 +1 @@ +#include "ble.h" diff --git a/keyboards/converter/usb_usb/ble/ble.h b/keyboards/converter/usb_usb/ble/ble.h new file mode 100644 index 000000000000..d28629643a9d --- /dev/null +++ b/keyboards/converter/usb_usb/ble/ble.h @@ -0,0 +1,6 @@ +#ifndef BLE_H +#define BLE_H + +#include QMK_KEYBOARD_H + +#endif diff --git a/keyboards/converter/usb_usb/ble/config.h b/keyboards/converter/usb_usb/ble/config.h new file mode 100644 index 000000000000..45aa778d571d --- /dev/null +++ b/keyboards/converter/usb_usb/ble/config.h @@ -0,0 +1,13 @@ +#ifndef CONFIG_BLE_H +#define CONFIG_BLE_H + +#undef PRODUCT +#define PRODUCT QMK BLE Adapter +#undef DESCRIPTION +#define DESCRIPTION + +// Turn off the mode leds on the BLE module +#define ADAFRUIT_BLE_ENABLE_MODE_LEDS 0 +#define ADAFRUIT_BLE_ENABLE_POWER_LED 0 + +#endif diff --git a/keyboards/converter/usb_usb/ble/rules.mk b/keyboards/converter/usb_usb/ble/rules.mk new file mode 100644 index 000000000000..c951780e2092 --- /dev/null +++ b/keyboards/converter/usb_usb/ble/rules.mk @@ -0,0 +1,4 @@ +BLUETOOTH = AdafruitBLE +ADAFRUIT_BLE_ENABLE = yes +OPT_DEFS += -DCATERINA_BOOTLOADER +F_CPU = 8000000 diff --git a/keyboards/converter/usb_usb/config.h b/keyboards/converter/usb_usb/config.h index 591d80f32dd8..deee35948bfe 100644 --- a/keyboards/converter/usb_usb/config.h +++ b/keyboards/converter/usb_usb/config.h @@ -21,6 +21,7 @@ along with this program. If not, see . // do not #include "config_common.h" because the pin names conflict with the USB HID code. // CUSTOM_MATRIX is defined it that file, though, and we need it, so we define it ourselves. // It's a hack, yeah... + #define CUSTOM_MATRIX 2 /* USB Device descriptor parameter */ diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp index bbe298d023a5..fba107c7cbac 100644 --- a/keyboards/converter/usb_usb/custom_matrix.cpp +++ b/keyboards/converter/usb_usb/custom_matrix.cpp @@ -35,6 +35,9 @@ along with this program. If not, see . #include "host.h" #include "keyboard.h" +extern "C" { +#include "quantum.h" +} /* KEY CODE to Matrix * @@ -62,7 +65,7 @@ along with this program. If not, see . // Integrated key state of all keyboards -static report_keyboard_t keyboard_report; +static report_keyboard_t local_keyboard_report; static bool matrix_is_mod = false; @@ -98,13 +101,13 @@ extern "C" } static void or_report(report_keyboard_t report) { - // integrate reports into keyboard_report - keyboard_report.mods |= report.mods; + // integrate reports into local_keyboard_report + local_keyboard_report.mods |= report.mods; for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { if (IS_ANY(report.keys[i])) { for (uint8_t j = 0; j < KEYBOARD_REPORT_KEYS; j++) { - if (! keyboard_report.keys[j]) { - keyboard_report.keys[j] = report.keys[i]; + if (! local_keyboard_report.keys[j]) { + local_keyboard_report.keys[j] = report.keys[i]; break; } } @@ -130,7 +133,7 @@ extern "C" last_time_stamp4 = kbd_parser4.time_stamp; // clear and integrate all reports - keyboard_report = {}; + local_keyboard_report = {}; or_report(kbd_parser1.report); or_report(kbd_parser2.report); or_report(kbd_parser3.report); @@ -138,9 +141,9 @@ extern "C" matrix_is_mod = true; - dprintf("state: %02X %02X", keyboard_report.mods, keyboard_report.reserved); + dprintf("state: %02X %02X", local_keyboard_report.mods, local_keyboard_report.reserved); for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - dprintf(" %02X", keyboard_report.keys[i]); + dprintf(" %02X", local_keyboard_report.keys[i]); } dprint("\r\n"); } else { @@ -177,12 +180,12 @@ extern "C" uint8_t code = CODE(row, col); if (IS_MOD(code)) { - if (keyboard_report.mods & ROW_BITS(code)) { + if (local_keyboard_report.mods & ROW_BITS(code)) { return true; } } for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - if (keyboard_report.keys[i] == code) { + if (local_keyboard_report.keys[i] == code) { return true; } } @@ -192,14 +195,14 @@ extern "C" matrix_row_t matrix_get_row(uint8_t row) { uint16_t row_bits = 0; - if (IS_MOD(CODE(row, 0)) && keyboard_report.mods) { - row_bits |= keyboard_report.mods; + if (IS_MOD(CODE(row, 0)) && local_keyboard_report.mods) { + row_bits |= local_keyboard_report.mods; } for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - if (IS_ANY(keyboard_report.keys[i])) { - if (row == ROW(keyboard_report.keys[i])) { - row_bits |= ROW_BITS(keyboard_report.keys[i]); + if (IS_ANY(local_keyboard_report.keys[i])) { + if (row == ROW(local_keyboard_report.keys[i])) { + row_bits |= ROW_BITS(local_keyboard_report.keys[i]); } } } @@ -209,9 +212,9 @@ extern "C" uint8_t matrix_key_count(void) { uint8_t count = 0; - count += bitpop(keyboard_report.mods); + count += bitpop(local_keyboard_report.mods); for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - if (IS_ANY(keyboard_report.keys[i])) { + if (IS_ANY(local_keyboard_report.keys[i])) { count++; } } diff --git a/keyboards/converter/usb_usb/keymaps/ble/config.h b/keyboards/converter/usb_usb/keymaps/ble/config.h index c1859b7f1a6f..7fa3bf328ec9 100644 --- a/keyboards/converter/usb_usb/keymaps/ble/config.h +++ b/keyboards/converter/usb_usb/keymaps/ble/config.h @@ -3,13 +3,4 @@ #include "../../config.h" -#undef PRODUCT -#define PRODUCT QMK BLE Adapter -#undef DESCRIPTION -#define DESCRIPTION - -// Turn off the mode leds on the BLE module -#define ADAFRUIT_BLE_ENABLE_MODE_LEDS 0 -#define ADAFRUIT_BLE_ENABLE_POWER_LED 0 - #endif diff --git a/keyboards/converter/usb_usb/keymaps/ble/rules.mk b/keyboards/converter/usb_usb/keymaps/ble/rules.mk deleted file mode 100644 index 3beda3f44515..000000000000 --- a/keyboards/converter/usb_usb/keymaps/ble/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -BLUETOOTH = AdafruitBLE -ADAFRUIT_BLE_ENABLE = yes -OPT_DEFS += -DCATERINA_BOOTLOADER \ No newline at end of file diff --git a/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c b/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c index 1aae1ad49e9d..0cc66fd53dca 100644 --- a/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c +++ b/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb_converter.h" +#include "usb_usb.h" const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching diff --git a/keyboards/converter/usb_usb/keymaps/default/keymap.c b/keyboards/converter/usb_usb/keymaps/default/keymap.c index 92acf5febc50..9817a607d38b 100644 --- a/keyboards/converter/usb_usb/keymaps/default/keymap.c +++ b/keyboards/converter/usb_usb/keymaps/default/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb_converter.h" +#include "usb_usb.h" const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching diff --git a/keyboards/converter/usb_usb/rules.mk b/keyboards/converter/usb_usb/rules.mk index baf8592ab955..b0e07c76491e 100644 --- a/keyboards/converter/usb_usb/rules.mk +++ b/keyboards/converter/usb_usb/rules.mk @@ -19,7 +19,7 @@ MCU = atmega32u4 # respective hardware variantion (i.e. subproject). For example, in /pro_micro/rules.mk # this is set to 8000000. # The value here is only a fallback and is ignored if it is defined in the subproject. -# F_CPU ?= 16000000 +F_CPU ?= 16000000 DEFAULT_FOLDER = converter/usb_usb/hasu diff --git a/keyboards/converter/usb_usb/usb_usb.c b/keyboards/converter/usb_usb/usb_usb.c new file mode 100644 index 000000000000..e8f224ad46bf --- /dev/null +++ b/keyboards/converter/usb_usb/usb_usb.c @@ -0,0 +1 @@ +#include "usb_usb.h" diff --git a/keyboards/converter/usb_usb/usb_usb_converter.h b/keyboards/converter/usb_usb/usb_usb.h similarity index 99% rename from keyboards/converter/usb_usb/usb_usb_converter.h rename to keyboards/converter/usb_usb/usb_usb.h index 0ba1a8291b58..c31fae1d0fa3 100644 --- a/keyboards/converter/usb_usb/usb_usb_converter.h +++ b/keyboards/converter/usb_usb/usb_usb.h @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef USB_USB_CONVERTER_H -#define USB_USB_CONVERTER_H +#ifndef USB_USB_H +#define USB_USB_H #include "quantum.h" diff --git a/keyboards/converter/usb_usb/usb_usb_converter.c b/keyboards/converter/usb_usb/usb_usb_converter.c deleted file mode 100644 index ddef96f9abaf..000000000000 --- a/keyboards/converter/usb_usb/usb_usb_converter.c +++ /dev/null @@ -1 +0,0 @@ -#include "usb_usb_converter.h"