2015-04-09 18:32:04 +02:00
|
|
|
/*
|
|
|
|
Copyright 2011 Jun Wako <wakojun@gmail.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
#include "wait.h"
|
2015-04-09 18:32:04 +02:00
|
|
|
#include "keycode.h"
|
|
|
|
#include "host.h"
|
|
|
|
#include "keymap.h"
|
|
|
|
#include "print.h"
|
|
|
|
#include "debug.h"
|
|
|
|
#include "util.h"
|
|
|
|
#include "timer.h"
|
|
|
|
#include "keyboard.h"
|
|
|
|
#include "bootloader.h"
|
|
|
|
#include "action_layer.h"
|
|
|
|
#include "action_util.h"
|
|
|
|
#include "eeconfig.h"
|
|
|
|
#include "sleep_led.h"
|
|
|
|
#include "led.h"
|
|
|
|
#include "command.h"
|
2016-05-24 17:56:53 +02:00
|
|
|
#include "quantum.h"
|
2016-08-08 10:27:15 +02:00
|
|
|
#include "version.h"
|
2015-04-09 18:32:04 +02:00
|
|
|
|
2019-10-17 18:48:58 +02:00
|
|
|
#ifdef BACKLIGHT_ENABLE
|
|
|
|
# include "backlight.h"
|
|
|
|
#endif
|
|
|
|
|
2021-10-06 02:50:23 +02:00
|
|
|
#if defined(MOUSEKEY_ENABLE)
|
2019-08-30 20:19:03 +02:00
|
|
|
# include "mousekey.h"
|
2015-04-09 18:32:04 +02:00
|
|
|
#endif
|
|
|
|
|
2016-04-18 03:14:37 +02:00
|
|
|
#ifdef AUDIO_ENABLE
|
2019-08-30 20:19:03 +02:00
|
|
|
# include "audio.h"
|
2016-04-18 03:14:37 +02:00
|
|
|
#endif /* AUDIO_ENABLE */
|
|
|
|
|
2021-01-17 02:23:58 +01:00
|
|
|
#ifdef VIAL_ENABLE
|
|
|
|
# include "vial.h"
|
|
|
|
#endif
|
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
static bool command_common(uint8_t code);
|
|
|
|
static void command_common_help(void);
|
2016-03-28 07:03:21 +02:00
|
|
|
static void print_version(void);
|
|
|
|
static void print_status(void);
|
2015-04-09 18:32:04 +02:00
|
|
|
static bool command_console(uint8_t code);
|
|
|
|
static void command_console_help(void);
|
2021-10-06 02:50:23 +02:00
|
|
|
#if defined(MOUSEKEY_ENABLE)
|
2015-04-09 18:32:04 +02:00
|
|
|
static bool mousekey_console(uint8_t code);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void switch_default_layer(uint8_t layer);
|
|
|
|
|
|
|
|
command_state_t command_state = ONESHOT;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
bool command_proc(uint8_t code) {
|
2015-04-09 18:32:04 +02:00
|
|
|
switch (command_state) {
|
|
|
|
case ONESHOT:
|
2019-08-30 20:19:03 +02:00
|
|
|
if (!IS_COMMAND()) return false;
|
2015-04-09 18:32:04 +02:00
|
|
|
return (command_extra(code) || command_common(code));
|
|
|
|
break;
|
|
|
|
case CONSOLE:
|
|
|
|
if (IS_COMMAND())
|
|
|
|
return (command_extra(code) || command_common(code));
|
|
|
|
else
|
|
|
|
return (command_console_extra(code) || command_console(code));
|
|
|
|
break;
|
2021-10-06 02:50:23 +02:00
|
|
|
#if defined(MOUSEKEY_ENABLE)
|
2015-04-09 18:32:04 +02:00
|
|
|
case MOUSEKEY:
|
|
|
|
mousekey_console(code);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
command_state = ONESHOT;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO: Refactoring is needed. */
|
|
|
|
/* This allows to define extra commands. return false when not processed. */
|
2019-08-30 20:19:03 +02:00
|
|
|
bool command_extra(uint8_t code) __attribute__((weak));
|
|
|
|
bool command_extra(uint8_t code) {
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
(void)code;
|
2015-04-09 18:32:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
bool command_console_extra(uint8_t code) __attribute__((weak));
|
|
|
|
bool command_console_extra(uint8_t code) {
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
(void)code;
|
2015-04-09 18:32:04 +02:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* Command common
|
|
|
|
***********************************************************/
|
2021-08-07 09:12:57 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
static void command_common_help(void) {
|
2021-08-07 09:12:57 +02:00
|
|
|
print(/* clang-format off */
|
|
|
|
"\n\t- Magic -\n"
|
|
|
|
|
|
|
|
STR(MAGIC_KEY_DEBUG) ": Debug Message Toggle\n"
|
|
|
|
STR(MAGIC_KEY_DEBUG_MATRIX) ": Matrix Debug Mode Toggle"
|
|
|
|
" - Show keypresses in matrix grid\n"
|
|
|
|
STR(MAGIC_KEY_DEBUG_KBD) ": Keyboard Debug Toggle"
|
|
|
|
" - Show keypress report\n"
|
|
|
|
STR(MAGIC_KEY_DEBUG_MOUSE) ": Debug Mouse Toggle\n"
|
|
|
|
STR(MAGIC_KEY_VERSION) ": Version\n"
|
|
|
|
STR(MAGIC_KEY_STATUS) ": Status\n"
|
|
|
|
STR(MAGIC_KEY_CONSOLE) ": Activate Console Mode\n"
|
2016-04-17 19:54:32 +02:00
|
|
|
|
2016-03-28 07:03:21 +02:00
|
|
|
#if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
2021-08-07 09:12:57 +02:00
|
|
|
STR(MAGIC_KEY_LAYER0) ": Switch to Layer 0\n"
|
|
|
|
STR(MAGIC_KEY_LAYER1) ": Switch to Layer 1\n"
|
|
|
|
STR(MAGIC_KEY_LAYER2) ": Switch to Layer 2\n"
|
|
|
|
STR(MAGIC_KEY_LAYER3) ": Switch to Layer 3\n"
|
|
|
|
STR(MAGIC_KEY_LAYER4) ": Switch to Layer 4\n"
|
|
|
|
STR(MAGIC_KEY_LAYER5) ": Switch to Layer 5\n"
|
|
|
|
STR(MAGIC_KEY_LAYER6) ": Switch to Layer 6\n"
|
|
|
|
STR(MAGIC_KEY_LAYER7) ": Switch to Layer 7\n"
|
|
|
|
STR(MAGIC_KEY_LAYER8) ": Switch to Layer 8\n"
|
|
|
|
STR(MAGIC_KEY_LAYER9) ": Switch to Layer 9\n"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
|
2016-04-17 19:54:32 +02:00
|
|
|
#if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
2021-08-07 09:12:57 +02:00
|
|
|
"F1-F10: Switch to Layer 0-9 (F10 = L0)\n"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
|
2016-04-17 19:54:32 +02:00
|
|
|
#if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
2021-08-07 09:12:57 +02:00
|
|
|
"0-9: Switch to Layer 0-9\n"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
STR(MAGIC_KEY_LAYER0_ALT) ": Switch to Layer 0 (alternate)\n"
|
2019-02-18 07:23:32 +01:00
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
STR(MAGIC_KEY_BOOTLOADER) ": Jump to Bootloader\n"
|
|
|
|
STR(MAGIC_KEY_BOOTLOADER_ALT) ": Jump to Bootloader (alternate)\n"
|
2015-05-13 08:29:30 +02:00
|
|
|
|
|
|
|
#ifdef KEYBOARD_LOCK_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
STR(MAGIC_KEY_LOCK) ": Lock Keyboard\n"
|
2015-05-13 08:29:30 +02:00
|
|
|
#endif
|
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
STR(MAGIC_KEY_EEPROM) ": Print EEPROM Settings\n"
|
|
|
|
STR(MAGIC_KEY_EEPROM_CLEAR) ": Clear EEPROM\n"
|
2015-05-13 08:29:30 +02:00
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
#ifdef NKRO_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
STR(MAGIC_KEY_NKRO) ": NKRO Toggle\n"
|
2015-05-13 08:29:30 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SLEEP_LED_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
STR(MAGIC_KEY_SLEEP_LED) ": Sleep LED Test\n"
|
2015-04-09 18:32:04 +02:00
|
|
|
#endif
|
2021-08-07 09:12:57 +02:00
|
|
|
); /* clang-format on */
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
static void print_version(void) {
|
2022-07-07 14:14:09 +02:00
|
|
|
xprintf("%s", /* clang-format off */
|
2021-08-07 09:12:57 +02:00
|
|
|
"\n\t- Version -\n"
|
|
|
|
"VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") "
|
|
|
|
"PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") "
|
|
|
|
"VER: " STR(DEVICE_VER) "\n"
|
|
|
|
"BUILD: (" __DATE__ ")\n"
|
2020-12-31 07:20:56 +01:00
|
|
|
#ifndef SKIP_VERSION
|
2020-02-29 21:00:00 +01:00
|
|
|
# ifdef PROTOCOL_CHIBIOS
|
2021-08-07 09:12:57 +02:00
|
|
|
"CHIBIOS: " STR(CHIBIOS_VERSION)
|
|
|
|
", CONTRIB: " STR(CHIBIOS_CONTRIB_VERSION) "\n"
|
2020-02-29 21:00:00 +01:00
|
|
|
# endif
|
2018-12-15 06:31:56 +01:00
|
|
|
#endif
|
2016-03-28 07:03:21 +02:00
|
|
|
|
|
|
|
/* build options */
|
2021-08-07 09:12:57 +02:00
|
|
|
"OPTIONS:"
|
2016-03-28 07:03:21 +02:00
|
|
|
|
|
|
|
#ifdef PROTOCOL_LUFA
|
2021-08-07 09:12:57 +02:00
|
|
|
" LUFA"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef PROTOCOL_VUSB
|
2021-08-07 09:12:57 +02:00
|
|
|
" VUSB"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef BOOTMAGIC_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
" BOOTMAGIC"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef MOUSEKEY_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
" MOUSEKEY"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef EXTRAKEY_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
" EXTRAKEY"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef CONSOLE_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
" CONSOLE"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef COMMAND_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
" COMMAND"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
#ifdef NKRO_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
" NKRO"
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
2020-08-22 10:21:06 +02:00
|
|
|
#ifdef LTO_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
" LTO"
|
2020-02-29 21:00:00 +01:00
|
|
|
#endif
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
" " STR(BOOTLOADER_SIZE) "\n"
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
"GCC: " STR(__GNUC__)
|
|
|
|
"." STR(__GNUC_MINOR__)
|
|
|
|
"." STR(__GNUC_PATCHLEVEL__)
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
#if defined(__AVR__)
|
2021-08-07 09:12:57 +02:00
|
|
|
" AVR-LIBC: " __AVR_LIBC_VERSION_STRING__
|
|
|
|
" AVR_ARCH: avr" STR(__AVR_ARCH__)
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
#endif
|
2021-08-07 09:12:57 +02:00
|
|
|
"\n"
|
|
|
|
); /* clang-format on */
|
2016-03-28 07:03:21 +02:00
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
static void print_status(void) {
|
2021-08-07 09:12:57 +02:00
|
|
|
xprintf(/* clang-format off */
|
|
|
|
"\n\t- Status -\n"
|
|
|
|
|
|
|
|
"host_keyboard_leds(): %02X\n"
|
|
|
|
#ifndef PROTOCOL_VUSB
|
|
|
|
"keyboard_protocol: %02X\n"
|
|
|
|
"keyboard_idle: %02X\n"
|
|
|
|
#endif
|
|
|
|
#ifdef NKRO_ENABLE
|
|
|
|
"keymap_config.nkro: %02X\n"
|
|
|
|
#endif
|
|
|
|
"timer_read32(): %08lX\n"
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
, host_keyboard_leds()
|
2017-01-21 18:30:06 +01:00
|
|
|
#ifndef PROTOCOL_VUSB
|
2021-08-07 09:12:57 +02:00
|
|
|
/* these aren't set on the V-USB protocol, so we just ignore them for now */
|
|
|
|
, keyboard_protocol
|
|
|
|
, keyboard_idle
|
2017-01-21 18:30:06 +01:00
|
|
|
#endif
|
2016-03-28 07:03:21 +02:00
|
|
|
#ifdef NKRO_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
, keymap_config.nkro
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
2021-08-07 09:12:57 +02:00
|
|
|
, timer_read32()
|
|
|
|
|
|
|
|
); /* clang-format on */
|
2016-03-28 07:03:21 +02:00
|
|
|
}
|
|
|
|
|
2016-09-13 03:20:31 +02:00
|
|
|
#if !defined(NO_PRINT) && !defined(USER_PRINT)
|
2021-08-07 09:12:57 +02:00
|
|
|
static void print_eeconfig(void) {
|
|
|
|
xprintf("eeconfig:\ndefault_layer: %u\n", eeconfig_read_default_layer());
|
2015-04-09 18:32:04 +02:00
|
|
|
|
|
|
|
debug_config_t dc;
|
|
|
|
dc.raw = eeconfig_read_debug();
|
2021-08-07 09:12:57 +02:00
|
|
|
xprintf(/* clang-format off */
|
|
|
|
|
|
|
|
"debug_config.raw: %02X\n"
|
|
|
|
".enable: %u\n"
|
|
|
|
".matrix: %u\n"
|
|
|
|
".keyboard: %u\n"
|
|
|
|
".mouse: %u\n"
|
|
|
|
|
|
|
|
, dc.raw
|
|
|
|
, dc.enable
|
|
|
|
, dc.matrix
|
|
|
|
, dc.keyboard
|
|
|
|
, dc.mouse
|
|
|
|
); /* clang-format on */
|
2015-04-09 18:32:04 +02:00
|
|
|
|
|
|
|
keymap_config_t kc;
|
|
|
|
kc.raw = eeconfig_read_keymap();
|
2021-08-07 09:12:57 +02:00
|
|
|
xprintf(/* clang-format off */
|
|
|
|
|
|
|
|
"keymap_config.raw: %02X\n"
|
|
|
|
".swap_control_capslock: %u\n"
|
|
|
|
".capslock_to_control: %u\n"
|
|
|
|
".swap_lctl_lgui: %u\n"
|
|
|
|
".swap_rctl_rgui: %u\n"
|
|
|
|
".swap_lalt_lgui: %u\n"
|
|
|
|
".swap_ralt_rgui: %u\n"
|
|
|
|
".no_gui: %u\n"
|
|
|
|
".swap_grave_esc: %u\n"
|
|
|
|
".swap_backslash_backspace: %u\n"
|
|
|
|
".nkro: %u\n"
|
2022-07-02 14:08:48 +02:00
|
|
|
".swap_escape_capslock: %u\n"
|
2021-08-07 09:12:57 +02:00
|
|
|
|
|
|
|
, kc.raw
|
|
|
|
, kc.swap_control_capslock
|
|
|
|
, kc.capslock_to_control
|
|
|
|
, kc.swap_lctl_lgui
|
|
|
|
, kc.swap_rctl_rgui
|
|
|
|
, kc.swap_lalt_lgui
|
|
|
|
, kc.swap_ralt_rgui
|
|
|
|
, kc.no_gui
|
|
|
|
, kc.swap_grave_esc
|
|
|
|
, kc.swap_backslash_backspace
|
|
|
|
, kc.nkro
|
2022-07-02 14:08:48 +02:00
|
|
|
, kc.swap_escape_capslock
|
2021-08-07 09:12:57 +02:00
|
|
|
); /* clang-format on */
|
2019-08-30 20:19:03 +02:00
|
|
|
|
|
|
|
# ifdef BACKLIGHT_ENABLE
|
2021-08-07 09:12:57 +02:00
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
backlight_config_t bc;
|
|
|
|
bc.raw = eeconfig_read_backlight();
|
2021-08-07 09:12:57 +02:00
|
|
|
xprintf(/* clang-format off */
|
|
|
|
"backlight_config"
|
|
|
|
|
|
|
|
".raw: %02X\n"
|
|
|
|
".enable: %u\n"
|
|
|
|
".level: %u\n"
|
|
|
|
|
|
|
|
, bc.raw
|
|
|
|
, bc.enable
|
|
|
|
, bc.level
|
2016-04-17 19:54:32 +02:00
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
); /* clang-format on */
|
|
|
|
|
|
|
|
# endif /* BACKLIGHT_ENABLE */
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
2021-08-07 09:12:57 +02:00
|
|
|
#endif /* !NO_PRINT && !USER_PRINT */
|
2015-04-09 18:32:04 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
static bool command_common(uint8_t code) {
|
2016-03-28 07:03:21 +02:00
|
|
|
#ifdef KEYBOARD_LOCK_ENABLE
|
2015-04-09 18:32:04 +02:00
|
|
|
static host_driver_t *host_driver = 0;
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
switch (code) {
|
|
|
|
#ifdef SLEEP_LED_ENABLE
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// test breathing sleep LED
|
2016-03-28 07:03:21 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_SLEEP_LED):
|
|
|
|
print("Sleep LED Test\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
sleep_led_toggle();
|
|
|
|
led_set(host_keyboard_leds());
|
|
|
|
break;
|
|
|
|
#endif
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// print stored eeprom config
|
2016-04-17 19:54:32 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_EEPROM):
|
2021-08-07 09:12:57 +02:00
|
|
|
#if !defined(NO_PRINT) && !defined(USER_PRINT)
|
2015-04-09 18:32:04 +02:00
|
|
|
print_eeconfig();
|
2021-08-07 09:12:57 +02:00
|
|
|
#endif /* !NO_PRINT && !USER_PRINT */
|
2015-04-09 18:32:04 +02:00
|
|
|
break;
|
2019-02-18 07:23:32 +01:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// clear eeprom
|
2019-02-18 07:23:32 +01:00
|
|
|
case MAGIC_KC(MAGIC_KEY_EEPROM_CLEAR):
|
|
|
|
print("Clearing EEPROM\n");
|
2019-08-30 20:19:03 +02:00
|
|
|
eeconfig_init();
|
2019-02-18 07:23:32 +01:00
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2015-05-13 08:29:30 +02:00
|
|
|
#ifdef KEYBOARD_LOCK_ENABLE
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// lock/unlock keyboard
|
2016-03-28 07:03:21 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LOCK):
|
2015-04-09 18:32:04 +02:00
|
|
|
if (host_get_driver()) {
|
|
|
|
host_driver = host_get_driver();
|
|
|
|
clear_keyboard();
|
|
|
|
host_set_driver(0);
|
|
|
|
print("Locked.\n");
|
|
|
|
} else {
|
|
|
|
host_set_driver(host_driver);
|
|
|
|
print("Unlocked.\n");
|
|
|
|
}
|
|
|
|
break;
|
2015-05-13 08:29:30 +02:00
|
|
|
#endif
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// print help
|
2019-02-18 07:23:32 +01:00
|
|
|
case MAGIC_KC(MAGIC_KEY_HELP):
|
|
|
|
case MAGIC_KC(MAGIC_KEY_HELP_ALT):
|
2015-04-09 18:32:04 +02:00
|
|
|
command_common_help();
|
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// activate console
|
2016-03-28 07:03:21 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_CONSOLE):
|
2015-04-09 18:32:04 +02:00
|
|
|
debug_matrix = false;
|
|
|
|
debug_keyboard = false;
|
|
|
|
debug_mouse = false;
|
|
|
|
debug_enable = false;
|
|
|
|
command_console_help();
|
|
|
|
print("C> ");
|
|
|
|
command_state = CONSOLE;
|
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
|
|
|
|
// jump to bootloader
|
|
|
|
case MAGIC_KC(MAGIC_KEY_BOOTLOADER):
|
2019-02-18 07:23:32 +01:00
|
|
|
case MAGIC_KC(MAGIC_KEY_BOOTLOADER_ALT):
|
2016-03-28 07:03:21 +02:00
|
|
|
print("\n\nJumping to bootloader... ");
|
2021-01-17 02:23:58 +01:00
|
|
|
#ifdef VIAL_ENABLE
|
|
|
|
if (vial_unlocked)
|
|
|
|
#endif
|
2020-05-25 14:16:33 +02:00
|
|
|
reset_keyboard();
|
2015-04-09 18:32:04 +02:00
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
|
|
|
|
// debug toggle
|
|
|
|
case MAGIC_KC(MAGIC_KEY_DEBUG):
|
|
|
|
debug_enable = !debug_enable;
|
2015-04-09 18:32:04 +02:00
|
|
|
if (debug_enable) {
|
2016-03-28 07:03:21 +02:00
|
|
|
print("\ndebug: on\n");
|
|
|
|
} else {
|
2015-09-20 03:51:30 +02:00
|
|
|
print("\ndebug: off\n");
|
2016-10-24 06:00:43 +02:00
|
|
|
debug_matrix = false;
|
|
|
|
debug_keyboard = false;
|
|
|
|
debug_mouse = false;
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
|
|
|
|
// debug matrix toggle
|
2016-04-17 19:54:32 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX):
|
2015-04-09 18:32:04 +02:00
|
|
|
debug_matrix = !debug_matrix;
|
|
|
|
if (debug_matrix) {
|
2015-05-13 08:29:30 +02:00
|
|
|
print("\nmatrix: on\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
debug_enable = true;
|
|
|
|
} else {
|
2015-05-13 08:29:30 +02:00
|
|
|
print("\nmatrix: off\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
|
|
|
|
// debug keyboard toggle
|
2016-04-17 19:54:32 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_DEBUG_KBD):
|
2015-04-09 18:32:04 +02:00
|
|
|
debug_keyboard = !debug_keyboard;
|
|
|
|
if (debug_keyboard) {
|
2015-05-13 08:29:30 +02:00
|
|
|
print("\nkeyboard: on\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
debug_enable = true;
|
|
|
|
} else {
|
2015-05-13 08:29:30 +02:00
|
|
|
print("\nkeyboard: off\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
|
|
|
|
// debug mouse toggle
|
|
|
|
case MAGIC_KC(MAGIC_KEY_DEBUG_MOUSE):
|
2015-04-09 18:32:04 +02:00
|
|
|
debug_mouse = !debug_mouse;
|
|
|
|
if (debug_mouse) {
|
2015-05-13 08:29:30 +02:00
|
|
|
print("\nmouse: on\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
debug_enable = true;
|
|
|
|
} else {
|
2019-08-30 20:19:03 +02:00
|
|
|
print("\nmouse: off\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
|
|
|
break;
|
2015-05-13 08:29:30 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// print version
|
2016-03-28 07:03:21 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_VERSION):
|
2019-08-30 20:19:03 +02:00
|
|
|
print_version();
|
|
|
|
break;
|
2015-04-09 18:32:04 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// print status
|
|
|
|
case MAGIC_KC(MAGIC_KEY_STATUS):
|
|
|
|
print_status();
|
2015-04-09 18:32:04 +02:00
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
#ifdef NKRO_ENABLE
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// NKRO toggle
|
2016-03-28 07:03:21 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_NKRO):
|
2022-02-12 19:29:31 +01:00
|
|
|
clear_keyboard(); // clear to prevent stuck keys
|
2016-09-07 06:19:01 +02:00
|
|
|
keymap_config.nkro = !keymap_config.nkro;
|
|
|
|
if (keymap_config.nkro) {
|
2015-05-13 08:29:30 +02:00
|
|
|
print("NKRO: on\n");
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
} else {
|
2015-05-13 08:29:30 +02:00
|
|
|
print("NKRO: off\n");
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
}
|
2015-04-09 18:32:04 +02:00
|
|
|
break;
|
|
|
|
#endif
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
// switch layers
|
2016-03-28 07:03:21 +02:00
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER0_ALT):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(0);
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER0):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(0);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER1):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(1);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER2):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(2);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER3):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(3);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER4):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(4);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER5):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(5);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER6):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(6);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER7):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(7);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER8):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(8);
|
|
|
|
break;
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
case MAGIC_KC(MAGIC_KEY_LAYER9):
|
2016-03-28 07:03:21 +02:00
|
|
|
switch_default_layer(9);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
|
|
|
|
|
|
|
case KC_F1 ... KC_F9:
|
|
|
|
switch_default_layer((code - KC_F1) + 1);
|
|
|
|
break;
|
2015-05-13 08:29:30 +02:00
|
|
|
case KC_F10:
|
2015-04-09 18:32:04 +02:00
|
|
|
switch_default_layer(0);
|
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
case KC_1 ... KC_9:
|
|
|
|
switch_default_layer((code - KC_1) + 1);
|
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
case KC_0:
|
|
|
|
switch_default_layer(0);
|
2015-04-09 18:32:04 +02:00
|
|
|
break;
|
2016-03-28 07:03:21 +02:00
|
|
|
#endif
|
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
default:
|
|
|
|
print("?");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* Command console
|
|
|
|
***********************************************************/
|
2019-08-30 20:19:03 +02:00
|
|
|
static void command_console_help(void) {
|
2015-05-13 08:29:30 +02:00
|
|
|
print("\n\t- Console -\n"
|
|
|
|
"ESC/q: quit\n"
|
2015-04-09 18:32:04 +02:00
|
|
|
#ifdef MOUSEKEY_ENABLE
|
2015-05-13 08:29:30 +02:00
|
|
|
"m: mousekey\n"
|
2015-04-09 18:32:04 +02:00
|
|
|
#endif
|
2015-05-13 08:29:30 +02:00
|
|
|
);
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
static bool command_console(uint8_t code) {
|
2015-04-09 18:32:04 +02:00
|
|
|
switch (code) {
|
|
|
|
case KC_H:
|
|
|
|
case KC_SLASH: /* ? */
|
|
|
|
command_console_help();
|
2021-08-07 09:12:57 +02:00
|
|
|
print("C> ");
|
|
|
|
return true;
|
2015-04-09 18:32:04 +02:00
|
|
|
case KC_Q:
|
|
|
|
case KC_ESC:
|
|
|
|
command_state = ONESHOT;
|
|
|
|
return false;
|
2021-08-07 09:12:57 +02:00
|
|
|
#if defined(MOUSEKEY_ENABLE)
|
2015-04-09 18:32:04 +02:00
|
|
|
case KC_M:
|
|
|
|
command_state = MOUSEKEY;
|
2021-08-07 09:12:57 +02:00
|
|
|
mousekey_console(KC_SLASH /* ? */);
|
2015-04-09 18:32:04 +02:00
|
|
|
return true;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
print("?");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* Mousekey console
|
|
|
|
***********************************************************/
|
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
#if defined(MOUSEKEY_ENABLE)
|
2015-04-09 18:32:04 +02:00
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
# if !defined(NO_PRINT) && !defined(USER_PRINT)
|
|
|
|
static void mousekey_param_print(void) {
|
|
|
|
xprintf(/* clang-format off */
|
|
|
|
|
|
|
|
#ifndef MK_3_SPEED
|
|
|
|
"1: delay(*10ms): %u\n"
|
|
|
|
"2: interval(ms): %u\n"
|
|
|
|
"3: max_speed: %u\n"
|
|
|
|
"4: time_to_max: %u\n"
|
|
|
|
"5: wheel_max_speed: %u\n"
|
|
|
|
"6: wheel_time_to_max: %u\n"
|
|
|
|
|
|
|
|
, mk_delay
|
|
|
|
, mk_interval
|
|
|
|
, mk_max_speed
|
|
|
|
, mk_time_to_max
|
|
|
|
, mk_wheel_max_speed
|
|
|
|
, mk_wheel_time_to_max
|
|
|
|
#else
|
|
|
|
"no knobs sorry\n"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
); /* clang-format on */
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
2021-08-07 09:12:57 +02:00
|
|
|
# endif /* !NO_PRINT && !USER_PRINT */
|
2015-04-09 18:32:04 +02:00
|
|
|
|
2021-08-07 09:12:57 +02:00
|
|
|
# if !defined(NO_PRINT) && !defined(USER_PRINT)
|
2019-08-30 20:19:03 +02:00
|
|
|
static void mousekey_console_help(void) {
|
2021-08-07 09:12:57 +02:00
|
|
|
mousekey_param_print();
|
|
|
|
xprintf(/* clang-format off */
|
|
|
|
"p: print values\n"
|
|
|
|
"d: set defaults\n"
|
|
|
|
"up: +1\n"
|
|
|
|
"dn: -1\n"
|
|
|
|
"lt: +10\n"
|
|
|
|
"rt: -10\n"
|
|
|
|
"ESC/q: quit\n"
|
|
|
|
|
|
|
|
#ifndef MK_3_SPEED
|
|
|
|
"\n"
|
|
|
|
"speed = delta * max_speed * (repeat / time_to_max)\n"
|
|
|
|
"where delta: cursor=%d, wheel=%d\n"
|
|
|
|
"See http://en.wikipedia.org/wiki/Mouse_keys\n"
|
|
|
|
, MOUSEKEY_MOVE_DELTA, MOUSEKEY_WHEEL_DELTA
|
|
|
|
#endif
|
|
|
|
|
|
|
|
); /* clang-format on */
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
2021-08-07 09:12:57 +02:00
|
|
|
# endif /* !NO_PRINT && !USER_PRINT */
|
|
|
|
|
|
|
|
/* Only used by `quantum/command.c` / `command_proc()`. To avoid
|
|
|
|
* any doubt: we return `false` to return to the main console,
|
|
|
|
* which differs from the `bool` that `command_proc()` returns. */
|
|
|
|
bool mousekey_console(uint8_t code) {
|
|
|
|
static uint8_t param = 0;
|
|
|
|
static uint8_t *pp = NULL;
|
|
|
|
static char * desc = NULL;
|
|
|
|
|
|
|
|
# if defined(NO_PRINT) || defined(USER_PRINT) /* -Wunused-parameter */
|
|
|
|
(void)desc;
|
|
|
|
# endif
|
|
|
|
|
|
|
|
int8_t change = 0;
|
2015-04-09 18:32:04 +02:00
|
|
|
|
|
|
|
switch (code) {
|
|
|
|
case KC_H:
|
|
|
|
case KC_SLASH: /* ? */
|
2021-08-07 09:12:57 +02:00
|
|
|
# if !defined(NO_PRINT) && !defined(USER_PRINT)
|
|
|
|
print("\n\t- Mousekey -\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
mousekey_console_help();
|
2021-08-07 09:12:57 +02:00
|
|
|
# endif
|
2015-04-09 18:32:04 +02:00
|
|
|
break;
|
2021-08-07 09:12:57 +02:00
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
case KC_Q:
|
|
|
|
case KC_ESC:
|
2021-08-07 09:12:57 +02:00
|
|
|
print("q\n");
|
|
|
|
if (!param) return false;
|
|
|
|
param = 0;
|
|
|
|
pp = NULL;
|
|
|
|
desc = NULL;
|
2015-05-13 08:29:30 +02:00
|
|
|
break;
|
2021-08-07 09:12:57 +02:00
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
case KC_P:
|
2021-08-07 09:12:57 +02:00
|
|
|
# if !defined(NO_PRINT) && !defined(USER_PRINT)
|
|
|
|
print("\n\t- Values -\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
mousekey_param_print();
|
2021-08-07 09:12:57 +02:00
|
|
|
# endif
|
2015-04-09 18:32:04 +02:00
|
|
|
break;
|
2021-08-07 09:12:57 +02:00
|
|
|
|
|
|
|
case KC_1 ... KC_0: /* KC_0 gives param = 10 */
|
|
|
|
param = 1 + code - KC_1;
|
|
|
|
switch (param) { /* clang-format off */
|
|
|
|
# define PARAM(n, v) case n: pp = &(v); desc = #v; break
|
|
|
|
|
|
|
|
#ifndef MK_3_SPEED
|
|
|
|
PARAM(1, mk_delay);
|
|
|
|
PARAM(2, mk_interval);
|
|
|
|
PARAM(3, mk_max_speed);
|
|
|
|
PARAM(4, mk_time_to_max);
|
|
|
|
PARAM(5, mk_wheel_max_speed);
|
|
|
|
PARAM(6, mk_wheel_time_to_max);
|
|
|
|
#endif /* MK_3_SPEED */
|
|
|
|
|
|
|
|
# undef PARAM
|
|
|
|
default:
|
|
|
|
param = 0;
|
|
|
|
print("?\n");
|
|
|
|
break;
|
|
|
|
} /* clang-format on */
|
|
|
|
if (param) xprintf("%u\n", param);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* clang-format off */
|
|
|
|
case KC_UP: change = +1; break;
|
|
|
|
case KC_DOWN: change = -1; break;
|
|
|
|
case KC_LEFT: change = -10; break;
|
|
|
|
case KC_RIGHT: change = +10; break;
|
|
|
|
/* clang-format on */
|
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
case KC_D:
|
2021-08-07 09:12:57 +02:00
|
|
|
|
|
|
|
# ifndef MK_3_SPEED
|
2019-08-30 20:19:03 +02:00
|
|
|
mk_delay = MOUSEKEY_DELAY / 10;
|
|
|
|
mk_interval = MOUSEKEY_INTERVAL;
|
|
|
|
mk_max_speed = MOUSEKEY_MAX_SPEED;
|
|
|
|
mk_time_to_max = MOUSEKEY_TIME_TO_MAX;
|
|
|
|
mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED;
|
2015-04-09 18:32:04 +02:00
|
|
|
mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX;
|
2021-08-07 09:12:57 +02:00
|
|
|
# endif /* MK_3_SPEED */
|
|
|
|
|
|
|
|
print("defaults\n");
|
2015-04-09 18:32:04 +02:00
|
|
|
break;
|
2021-08-07 09:12:57 +02:00
|
|
|
|
2015-04-09 18:32:04 +02:00
|
|
|
default:
|
2021-08-07 09:12:57 +02:00
|
|
|
print("?\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (change) {
|
|
|
|
if (pp) {
|
|
|
|
int16_t val = *pp + change;
|
|
|
|
if (val > (int16_t)UINT8_MAX)
|
|
|
|
*pp = UINT8_MAX;
|
|
|
|
else if (val < 0)
|
|
|
|
*pp = 0;
|
|
|
|
else
|
|
|
|
*pp = (uint8_t)val;
|
|
|
|
xprintf("= %u\n", *pp);
|
|
|
|
} else {
|
|
|
|
print("?\n");
|
|
|
|
}
|
2015-04-09 18:32:04 +02:00
|
|
|
}
|
2021-08-07 09:12:57 +02:00
|
|
|
|
|
|
|
if (param) {
|
|
|
|
xprintf("M%u:%s> ", param, desc ? desc : "???");
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
} else {
|
2021-08-07 09:12:57 +02:00
|
|
|
print("M> ");
|
Add ChibiOS support for QMK (#465)
* Modularity and gcc warnings fixes.
* Add ChibiOS support (USB stack + support files).
* Make usb_main more USB_DRIVER #define independent.
* Move chibios to tool.
* Implement jump-to-bootloader.
* Small updates.
* Fix bootloader-jump compiling.
* Move AVR specific sleep_led.c into avr.
* Add basic sleep_led for chibios.
* Update chibios README.
* NKRO fixes.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Add ARM Teensies bootloader code.
* Fix chibios/usb_main GET_REPORT handing.
* Add missing #include to keymap.c.
* Make bootmagic.c code portable (_delay_ms -> wait_ms).
* Move declaration of keymap_config.
Should really not declare variables in .h files - since it's included
in different .c files, a proper linker then complains that the same
variable is declared more than once (once for each .c file that the
offending .h is included in).
* Add eeprom support for chibios/kinetis.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Chibios: use WFI in idle. WIP suspend stuff.
* ChibiOS/kinetis: sending remote wakeup.
* ChibiOS/STM32: send remote wakeup.
* Fix report size of boot protocol.
* Fix drop key stroke
Keyboard report should be checked if its transfer finishs successfully.
Otherwise key stroke can be missing when other key event occurs
before the last report transfer is done.
Boot protocol 10ms interval probably causes this problem in case
it receives key events in a row within the period. NKRO protocol
suffers less or nothing due to its interval 1ms.
* Chibios/usb_main: rename a variable for clarity.
* Add correct chibios/bootloader_jump for infinity KB.
* ChibiOS: make reset request more CMSISy.
* Chibios: Add breathing sleep LED on Kinetis MCUs.
* ChibiOS: Update infinity bootloader code to match updated ChibiOS.
* ChibiOS: prettify/document sleep_led code.
* Chibios: Remove the wait in the main loop.
* Add maple mini code.
* Do timeout when writing to CONSOLE EP queue.
Fixes TMK bug #266.
* Chibios: add 'core/protocol' to the makefiles' search path.
* Chibios: Update to new USB API.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Add update for chibios in README
* Chibios: Fix a HardFault bug (wait after start).
* Chibios: cleanup usb_main code.
* Chibios: Revert common.mk change (fix AVR linking problem).
* core: Fix chibios user compile options
Compile options can be defined in project Makefile such as UDEFS, UADEFS, UINCDIR, ULIBDIR and ULIBS.
* Sysv format for ChibiOS arm-none-eabi-size
Some new patches to ChibiOS puts heap as it's own section. So the
berkeley format is now useless, as the heap will be included in the
BSS report. The sysv format displays the bss size correctly.
* Fix hard-coded path of CHIBIOS
* Add support for new version of ChibiOS and Contrib
The Kinetis support has moved to a separate Contrib repository in
the newest version of Chibios. There has also been some structure
changes. So this adds support for those, while maintaining back-
wards compability.
* Update ChibiOS instructions
* Chibios: implement sleep LED for STM32.
* Chibios: Update the main chibios README.
* Chibios: fix STM32_BOOTLOADER_ADDRESS name.
* Chibios: make the default bootloader_jump redefinable (weak).
* Chibios: disable LTO (link-time optimisation).
With LTO enabled, sometimes things fail for mysterious reasons
(e.g. bootloader jump on WF with LEDs enabled), just because the
linker optimisation is too aggressive.
* Chibios: add default location for chibios-contrib.
* ChibiOS: update mk to match chibios/master.
* ChibiOS: update instructions.md.
* Add chibi_onekey example.
* Add comments to chibi_onekey Makefile.
* Rename some Makefile defines.
* Move STM32 bootloader address config to separate .h file.
* Rename chibios example keyboard.
* Move chibios/cortex selection to local Makefiles.
* Add Teensy LC onekey example.
* Chibios: use WFI in idle. WIP suspend stuff.
* Update chibi/teensy instructions.
* Update chibios/Teensy instructions.
* Add infinity_chibios
* Add keymap_hasu.c
* Infinity_chibios: select correct bootloader_jump.
* Infinity_chibios: improve comments.
* Add generic STM32F103C8T6 example.
* Add maple mini code.
* STM32F103x fixes.
* Add maple mini pinout pic.
* Chibios: updates for 3.0.4 git.
* Chibios: rename example stm32_onekey -> stm32_f072_onekey.
* Chibios: add makefiles for Teensy 3.x examples.
* Chibios: update Teensy 3.x instructions.
* Chibios: Tsy LC is cortex-m0plus.
* Chibios: add more guards for transmitting (fix a deadlock bug).
* Change README for chibios
* Chibios: update examples to current chibios git.
Match the changes in mainline chibios:
- update chconf.h
- update supplied ld scripts structure
- update Teensy instructions (switch to official
chibios and introduce contrib)
* Add ChibiOS and ChibiOS-Contrib submodules
Also fix the makefile path for them.
* Moves chibios keyboards to keyboards folder
* First version of ChibiOS compilation
Only the stm32_f072_onkey keyboard is ported at the moment. It
compiles, but still doesn't link.
* More chibios fixes
It now compiles without warnings and links
* Move the teensy_lc_onekey to the keyboards folder
* Clean up the make file rule structure
* Remove keymap_fn_to_action
* Update more ChibiOS keyboards to QMK
Most of them does not compile at the moment though.
* Use older version of Chibios libraries
The newest ones have problems with compilation
* Remove USB_UNCONFIGURED event
It isn't present in the older version of ChibiOS
* Fix the infinity_chibios compilation
* Fix potentially uninitialized variable
* Add missing include
* Fix the ChibiOS makefile
* Fix some Chibios keyboard compilation
* Revert the rules.mk file back to master version
* Combine the chibios and AVR makefiles
With just the required overrides in the respective platform
specific one.
* Slight makefile restrucuring
Platform specific compiler options
* Move avr specific targets out of the main rules
* Fix ChibiOS objcopy
The ChibiOS objcopy needs different parameters, so the parameters
are moved to the corresponding platform rule file
* Fix the objcopy for real this time
The comands were moved around, so chibios used avr and the ohter
way around.
Also change the objsize output format
* Fix the thumb flags
* Fix the infinity hasu keymap
* Per platform cpp flags
* Add gcc-arm-none-eabi package to travis
* Add arm-none-eabi-newlib to travis
* Fix the name of the libnewlib-arm-none-eabi lib
* Fix the ChibiOS paths
So that they are properly relative, and builds don't generate
extra folders
* Fix the board path of stm32_f103_onekey
* Only consider folders with Makefiles as subproject
2016-07-01 16:04:53 +02:00
|
|
|
}
|
2015-04-09 18:32:04 +02:00
|
|
|
return true;
|
|
|
|
}
|
2021-08-07 09:12:57 +02:00
|
|
|
|
|
|
|
#endif /* MOUSEKEY_ENABLE */
|
2015-04-09 18:32:04 +02:00
|
|
|
|
|
|
|
/***********************************************************
|
|
|
|
* Utilities
|
|
|
|
***********************************************************/
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
static void switch_default_layer(uint8_t layer) {
|
2015-05-13 08:29:30 +02:00
|
|
|
xprintf("L%d\n", layer);
|
2021-07-03 09:19:52 +02:00
|
|
|
default_layer_set((layer_state_t)1 << layer);
|
2015-04-09 18:32:04 +02:00
|
|
|
clear_keyboard();
|
|
|
|
}
|