Browse Source

Removal of bootmagic lite terminology (#22979)

pull/22783/merge
Joel Challis 2 months ago
committed by GitHub
parent
commit
e2dbe39b94
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
11 changed files with 103 additions and 78 deletions
  1. +4
    -4
      data/mappings/info_config.hjson
  2. +14
    -14
      docs/feature_bootmagic.md
  3. +5
    -5
      docs/ja/feature_bootmagic.md
  4. +8
    -8
      keyboards/crkbd/post_config.h
  5. +6
    -6
      keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c
  6. +8
    -8
      keyboards/jorne/post_config.h
  7. +4
    -4
      keyboards/junco/rev1/post_config.h
  8. +2
    -2
      keyboards/nullbitsco/scramble/keymaps/oled/config.h
  9. +1
    -1
      keyboards/phoenix/phoenix.c
  10. +32
    -22
      quantum/bootmagic/bootmagic.c
  11. +19
    -4
      quantum/bootmagic/bootmagic.h

+ 4
- 4
data/mappings/info_config.hjson View File

@ -36,10 +36,10 @@
"BACKLIGHT_DEFAULT_LEVEL": {"info_key": "backlight.default.brightness", "value_type": "int"},
// Bootmagic
"BOOTMAGIC_LITE_COLUMN": {"info_key": "bootmagic.matrix.1", "value_type": "int"},
"BOOTMAGIC_LITE_COLUMN_RIGHT": {"info_key": "split.bootmagic.matrix.1", "value_type": "int"},
"BOOTMAGIC_LITE_ROW": {"info_key": "bootmagic.matrix.0", "value_type": "int"},
"BOOTMAGIC_LITE_ROW_RIGHT": {"info_key": "split.bootmagic.matrix.0", "value_type": "int"},
"BOOTMAGIC_COLUMN": {"info_key": "bootmagic.matrix.1", "value_type": "int"},
"BOOTMAGIC_COLUMN_RIGHT": {"info_key": "split.bootmagic.matrix.1", "value_type": "int"},
"BOOTMAGIC_ROW": {"info_key": "bootmagic.matrix.0", "value_type": "int"},
"BOOTMAGIC_ROW_RIGHT": {"info_key": "split.bootmagic.matrix.0", "value_type": "int"},
// Caps Word
"BOTH_SHIFTS_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.both_shifts_turns_on", "value_type": "flag"},


+ 14
- 14
docs/feature_bootmagic.md View File

@ -1,8 +1,8 @@
# Bootmagic Lite :id=bootmagic-lite
# Bootmagic :id=bootmagic
The Bootmagic Lite feature that only handles jumping into the bootloader. This is great for boards that don't have a physical reset button, giving you a way to jump into the bootloader
The Bootmagic feature that only handles jumping into the bootloader. This is great for boards that don't have a physical reset button, giving you a way to jump into the bootloader
On some keyboards Bootmagic Lite is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk` with:
On some keyboards Bootmagic is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk` with:
```make
BOOTMAGIC_ENABLE = yes
@ -11,15 +11,15 @@ BOOTMAGIC_ENABLE = yes
Additionally, you may want to specify which key to use. This is especially useful for keyboards that have unusual matrices. To do so, you need to specify the row and column of the key that you want to use. Add these entries to your `config.h` file:
```c
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 1
#define BOOTMAGIC_ROW 0
#define BOOTMAGIC_COLUMN 1
```
By default, these are set to 0 and 0, which is usually the "ESC" key on a majority of keyboards.
And to trigger the bootloader, you hold this key down when plugging the keyboard in. Just the single key.
!> Using Bootmagic Lite will **always reset** the EEPROM, so you will lose any settings that have been saved.
!> Using Bootmagic will **always reset** the EEPROM, so you will lose any settings that have been saved.
## Split Keyboards
@ -44,35 +44,35 @@ When [handedness](feature_split_keyboard.md#setting-handedness) is predetermined
}
```
If you pick the top right key for the right half, it is `R05` on the top layout. Within the key matrix below, `R05` is located on row 4 columnn 4. To use that key as the right half's Bootmagic Lite trigger, add these entries to your `config.h` file:
If you pick the top right key for the right half, it is `R05` on the top layout. Within the key matrix below, `R05` is located on row 4 columnn 4. To use that key as the right half's Bootmagic trigger, add these entries to your `config.h` file:
```c
#define BOOTMAGIC_LITE_ROW_RIGHT 4
#define BOOTMAGIC_LITE_COLUMN_RIGHT 4
#define BOOTMAGIC_ROW_RIGHT 4
#define BOOTMAGIC_COLUMN_RIGHT 4
```
?> These values are not set by default.
## Advanced Bootmagic Lite
## Advanced Bootmagic
The `bootmagic_lite` function is defined weakly, so that you can replace this in your code, if you need. A great example of this is the Zeal60 boards that have some additional handling needed.
The `bootmagic_scan` function is defined weakly, so that you can replace this in your code, if you need. A great example of this is the Zeal60 boards that have some additional handling needed.
To replace the function, all you need to do is add something like this to your code:
```c
void bootmagic_lite(void) {
void bootmagic_scan(void) {
matrix_scan();
wait_ms(DEBOUNCE * 2);
matrix_scan();
if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) {
if (matrix_get_row(BOOTMAGIC_ROW) & (1 << BOOTMAGIC_COLUMN)) {
// Jump to bootloader.
bootloader_jump();
}
}
```
You can define additional logic here. For instance, resetting the EEPROM or requiring additional keys to be pressed to trigger Bootmagic Lite. Keep in mind that `bootmagic_lite` is called before a majority of features are initialized in the firmware.
You can define additional logic here. For instance, resetting the EEPROM or requiring additional keys to be pressed to trigger Bootmagic. Keep in mind that `bootmagic_scan` is called before a majority of features are initialized in the firmware.
## Addenda


+ 5
- 5
docs/ja/feature_bootmagic.md View File

@ -139,8 +139,8 @@ BOOTMAGIC_ENABLE = lite
さらに、どのキーを使うかを指定したほうが良いかもしれません。これは普通ではないマトリックスを持つキーボードで特に便利です。そのためには、使いたいキーの行と列を指定する必要があります。`config.h` ファイルにこれらのエントリを追加します:
```c
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 1
#define BOOTMAGIC_ROW 0
#define BOOTMAGIC_COLUMN 1
```
デフォルトでは、これらは 0 と 0 に設定されます。これは通常はほとんどのキーボードで "ESC" キーです。
@ -154,8 +154,8 @@ BOOTMAGIC_ENABLE = lite
`SPLIT_HAND_PIN` のようなオプションで、左右の設定があらかじめ決められている場合は、キーボードの左右で別のキーを設定する必要があるかもしれません。これを行うには、`config.h` ファイルに以下のエントリを追加します。
```c
#define BOOTMAGIC_LITE_ROW_RIGHT 4
#define BOOTMAGIC_LITE_COLUMN_RIGHT 1
#define BOOTMAGIC_ROW_RIGHT 4
#define BOOTMAGIC_COLUMN_RIGHT 1
```
デフォルトでは、これらの値は設定されていません。
@ -172,7 +172,7 @@ void bootmagic_lite(void) {
wait_ms(DEBOUNCE * 2);
matrix_scan();
if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) {
if (matrix_get_row(BOOTMAGIC_ROW) & (1 << BOOTMAGIC_COLUMN)) {
// ブートローダにジャンプする。
bootloader_jump();
}


+ 8
- 8
keyboards/crkbd/post_config.h View File

@ -16,18 +16,18 @@
#pragma once
#ifndef BOOTMAGIC_LITE_ROW
# define BOOTMAGIC_LITE_ROW 0
#ifndef BOOTMAGIC_ROW
# define BOOTMAGIC_ROW 0
#endif
#ifndef BOOTMAGIC_LITE_COLUMN
# define BOOTMAGIC_LITE_COLUMN 1
#ifndef BOOTMAGIC_COLUMN
# define BOOTMAGIC_COLUMN 1
#endif
#ifndef BOOTMAGIC_LITE_ROW_RIGHT
# define BOOTMAGIC_LITE_ROW_RIGHT 4
#ifndef BOOTMAGIC_ROW_RIGHT
# define BOOTMAGIC_ROW_RIGHT 4
#endif
#ifndef BOOTMAGIC_LITE_COLUMN_RIGHT
# define BOOTMAGIC_LITE_COLUMN_RIGHT 1
#ifndef BOOTMAGIC_COLUMN_RIGHT
# define BOOTMAGIC_COLUMN_RIGHT 1
#endif
#ifdef RGBLIGHT_ENABLE


+ 6
- 6
keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c View File

@ -24,7 +24,7 @@ void matrix_scan_sub_kb(void) {
}
}
__attribute__((weak)) void bootmagic_lite(void) {
__attribute__((weak)) void bootmagic_scan(void) {
// We need multiple scans because debouncing can't be turned off.
matrix_scan();
#if defined(DEBOUNCE) && DEBOUNCE > 0
@ -34,13 +34,13 @@ __attribute__((weak)) void bootmagic_lite(void) {
#endif
matrix_scan();
uint8_t row = BOOTMAGIC_LITE_ROW;
uint8_t col = BOOTMAGIC_LITE_COLUMN;
uint8_t row = BOOTMAGIC_ROW;
uint8_t col = BOOTMAGIC_COLUMN;
#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_LITE_ROW_RIGHT) && defined(BOOTMAGIC_LITE_COLUMN_RIGHT)
#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_ROW_RIGHT) && defined(BOOTMAGIC_COLUMN_RIGHT)
if (!is_keyboard_left()) {
row = BOOTMAGIC_LITE_ROW_RIGHT;
col = BOOTMAGIC_LITE_COLUMN_RIGHT;
row = BOOTMAGIC_ROW_RIGHT;
col = BOOTMAGIC_COLUMN_RIGHT;
}
#endif


+ 8
- 8
keyboards/jorne/post_config.h View File

@ -2,18 +2,18 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#ifndef BOOTMAGIC_LITE_ROW
# define BOOTMAGIC_LITE_ROW 0
#ifndef BOOTMAGIC_ROW
# define BOOTMAGIC_ROW 0
#endif
#ifndef BOOTMAGIC_LITE_COLUMN
# define BOOTMAGIC_LITE_COLUMN 1
#ifndef BOOTMAGIC_COLUMN
# define BOOTMAGIC_COLUMN 1
#endif
#ifndef BOOTMAGIC_LITE_ROW_RIGHT
# define BOOTMAGIC_LITE_ROW_RIGHT 4
#ifndef BOOTMAGIC_ROW_RIGHT
# define BOOTMAGIC_ROW_RIGHT 4
#endif
#ifndef BOOTMAGIC_LITE_COLUMN_RIGHT
# define BOOTMAGIC_LITE_COLUMN_RIGHT 1
#ifndef BOOTMAGIC_COLUMN_RIGHT
# define BOOTMAGIC_COLUMN_RIGHT 1
#endif
#ifdef RGBLIGHT_ENABLE


+ 4
- 4
keyboards/junco/rev1/post_config.h View File

@ -7,9 +7,9 @@
// Top left for left side is default in core
// Top right for right side
#ifndef BOOTMAGIC_LITE_ROW_RIGHT
# define BOOTMAGIC_LITE_ROW_RIGHT 5
#ifndef BOOTMAGIC_ROW_RIGHT
# define BOOTMAGIC_ROW_RIGHT 5
#endif
#ifndef BOOTMAGIC_LITE_COLUMN_RIGHT
# define BOOTMAGIC_LITE_COLUMN_RIGHT 0
#ifndef BOOTMAGIC_COLUMN_RIGHT
# define BOOTMAGIC_COLUMN_RIGHT 0
#endif

+ 2
- 2
keyboards/nullbitsco/scramble/keymaps/oled/config.h View File

@ -18,5 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
// Alternate boot pins for accessing the bootloader,
// since the boot switch is blocked by the OLED.
#define BOOTMAGIC_LITE_ROW 1
#define BOOTMAGIC_LITE_COLUMN 2
#define BOOTMAGIC_ROW 1
#define BOOTMAGIC_COLUMN 2

+ 1
- 1
keyboards/phoenix/phoenix.c View File

@ -2,7 +2,7 @@
#include "usb_main.h"
#include "phoenix.h"
void bootmagic_lite(void) {
void bootmagic_scan(void) {
matrix_scan();
wait_ms(5);
matrix_scan();


+ 32
- 22
quantum/bootmagic/bootmagic.c View File

@ -20,44 +20,54 @@
#include "eeconfig.h"
#include "bootloader.h"
#ifndef BOOTMAGIC_DEBOUNCE
# if defined(DEBOUNCE) && DEBOUNCE > 0
# define BOOTMAGIC_DEBOUNCE (DEBOUNCE * 2)
# else
# define BOOTMAGIC_DEBOUNCE 30
# endif
#endif
/** \brief Reset eeprom
*
* ...just incase someone wants to only change the eeprom behaviour
*/
__attribute__((weak)) void bootmagic_lite_reset_eeprom(void) {
__attribute__((weak)) void bootmagic_reset_eeprom(void) {
eeconfig_disable();
}
/** \brief The lite version of TMK's bootmagic based on Wilba.
*
* 100% less potential for accidentally making the keyboard do stupid things.
/** \brief Decide reboot based on current matrix state
*/
__attribute__((weak)) void bootmagic_lite(void) {
// We need multiple scans because debouncing can't be turned off.
matrix_scan();
#if defined(DEBOUNCE) && DEBOUNCE > 0
wait_ms(DEBOUNCE * 2);
#else
wait_ms(30);
#endif
matrix_scan();
__attribute__((weak)) bool bootmagic_should_reset(void) {
// If the configured key (commonly Esc) is held down on power up,
// reset the EEPROM valid state and jump to bootloader.
// This isn't very generalized, but we need something that doesn't
// rely on user's keymaps in firmware or EEPROM.
uint8_t row = BOOTMAGIC_LITE_ROW;
uint8_t col = BOOTMAGIC_LITE_COLUMN;
uint8_t row = BOOTMAGIC_ROW;
uint8_t col = BOOTMAGIC_COLUMN;
#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_LITE_ROW_RIGHT) && defined(BOOTMAGIC_LITE_COLUMN_RIGHT)
#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_ROW_RIGHT) && defined(BOOTMAGIC_COLUMN_RIGHT)
if (!is_keyboard_left()) {
row = BOOTMAGIC_LITE_ROW_RIGHT;
col = BOOTMAGIC_LITE_COLUMN_RIGHT;
row = BOOTMAGIC_ROW_RIGHT;
col = BOOTMAGIC_COLUMN_RIGHT;
}
#endif
if (matrix_get_row(row) & (1 << col)) {
bootmagic_lite_reset_eeprom();
return matrix_get_row(row) & (1 << col);
}
/** \brief The abridged version of TMK's bootmagic based on Wilba.
*
* 100% less potential for accidentally making the keyboard do stupid things.
*/
__attribute__((weak)) void bootmagic_scan(void) {
// We need multiple scans because debouncing can't be turned off.
matrix_scan();
wait_ms(BOOTMAGIC_DEBOUNCE);
matrix_scan();
if (bootmagic_should_reset()) {
bootmagic_reset_eeprom();
// Jump to bootloader.
bootloader_jump();
@ -65,5 +75,5 @@ __attribute__((weak)) void bootmagic_lite(void) {
}
void bootmagic(void) {
bootmagic_lite();
bootmagic_scan();
}

+ 19
- 4
quantum/bootmagic/bootmagic.h View File

@ -15,11 +15,26 @@
*/
#pragma once
#ifndef BOOTMAGIC_LITE_COLUMN
# define BOOTMAGIC_LITE_COLUMN 0
// ======== DEPRECATED DEFINES - DO NOT USE ========
#ifdef BOOTMAGIC_LITE_ROW
# define BOOTMAGIC_ROW BOOTMAGIC_LITE_ROW
#endif
#ifndef BOOTMAGIC_LITE_ROW
# define BOOTMAGIC_LITE_ROW 0
#ifdef BOOTMAGIC_LITE_COLUMN
# define BOOTMAGIC_COLUMN BOOTMAGIC_LITE_COLUMN
#endif
#ifdef BOOTMAGIC_LITE_ROW_RIGHT
# define BOOTMAGIC_ROW_RIGHT BOOTMAGIC_LITE_ROW_RIGHT
#endif
#ifdef BOOTMAGIC_LITE_COLUMN_RIGHT
# define BOOTMAGIC_COLUMN_RIGHT BOOTMAGIC_LITE_COLUMN_RIGHT
#endif
// ========
#ifndef BOOTMAGIC_COLUMN
# define BOOTMAGIC_COLUMN 0
#endif
#ifndef BOOTMAGIC_ROW
# define BOOTMAGIC_ROW 0
#endif
void bootmagic(void);

Loading…
Cancel
Save