From f3648c0f8254a0ea18ae07a6868a790b9598638a Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 6 Jan 2020 17:13:59 +0100 Subject: [PATCH 1/7] docs/UPGRADING.md: Drop the note about OneShot stickability OneShot has dropped the old stickability controls almost a year ago, and that's already part of UPGRADING.md. Remove the note that they will be removed - they already were. Signed-off-by: Gergely Nagy --- docs/UPGRADING.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index d26aa354..f3742eff 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -21,7 +21,6 @@ If any of this does not make sense to you, or you have trouble updating your .in + [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements) - [Removal of Layer.defaultLayer](#removal-of-layerdefaultlayer) - [More clarity in Layer method names](#more-clarity-in-layer-method-names) - - [Finer OneShot stickability control](#finer-oneshot-stickability-control) - [EEPROMKeymap mode](#eepromkeymap-mode) - [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement) * [Removed APIs](#removed-apis) @@ -499,10 +498,6 @@ the firmware to remain backwards compatible, however, these functions are deprec Also a new version of the onKeyswitchEvent-handler has been introduced. The old version is deprecated. -### Finer OneShot stickability control - -The [OneShot plugin](doc/plugin/OneShot.md) has much improved stickability control. Instead of only being able to control if one-shot layers should be stickable too, or disabling the sticky feature in general, it is now possible to control stickiness on a per-key basis with the new `OneShot.enableStickability()` and `OneShot.disableStickablity()` methods. The old properties are still available, but will be removed by **2019-04-30**. - ### EEPROMKeymap mode The [EEPROM-Keymap](doc/plugin/EEPROM-Keymap.md) plugin had its `setup()` method changed, the formerly optional `method` argument is now obsolete and unused. It can be safely removed. Supplying a second argument will continue to work until its scheduled removal by **2019-04-30**. From 653f65fe6efde8dca5f6c928be3ce4b38ffe86aa Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 6 Jan 2020 17:21:30 +0100 Subject: [PATCH 2/7] EEPROM-Keymap: Deprecate the deprecated 2-arg constructor Originally scheduled to be removed by May last year, lets drop it now. Signed-off-by: Gergely Nagy --- docs/UPGRADING.md | 11 ++++++----- src/kaleidoscope/plugin/EEPROM-Keymap.h | 7 ------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index f3742eff..44bee797 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -21,7 +21,6 @@ If any of this does not make sense to you, or you have trouble updating your .in + [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements) - [Removal of Layer.defaultLayer](#removal-of-layerdefaultlayer) - [More clarity in Layer method names](#more-clarity-in-layer-method-names) - - [EEPROMKeymap mode](#eepromkeymap-mode) - [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement) * [Removed APIs](#removed-apis) @@ -498,10 +497,6 @@ the firmware to remain backwards compatible, however, these functions are deprec Also a new version of the onKeyswitchEvent-handler has been introduced. The old version is deprecated. -### EEPROMKeymap mode - -The [EEPROM-Keymap](doc/plugin/EEPROM-Keymap.md) plugin had its `setup()` method changed, the formerly optional `method` argument is now obsolete and unused. It can be safely removed. Supplying a second argument will continue to work until its scheduled removal by **2019-04-30**. - ## keymaps array and KEYMAPS and KEYMAPS_STACKED macros The `keymaps` array has been replaced with a `keymaps_linear` array. This new array treats each layer as a simple one dimensional array of keys, rather than a two dimensional array of arrays of rows. At the same time, the `KEYMAPS` and `KEYMAPS_STACKED` macros that were previously defined in each hardware implmentation class have been replaced with `PER_KEY_DATA` and `PER_KEY_DATA_STACKED` macros in each hardware class. This change should be invisible to users, but will require changes by any plugin that accessed the 'keymaps' variable directly. @@ -533,6 +528,12 @@ The following headers and names have changed: # Removed APIs +### Removed on 2020-01-06 + +### EEPROMKeymap mode + +The [EEPROM-Keymap](doc/plugin/EEPROM-Keymap.md) plugin had its `setup()` method changed, the formerly optional `method` argument is now obsolete and unused. It can be safely removed. + ### Removed on 2019-01-18 ### Removal of Layer.defaultLayer diff --git a/src/kaleidoscope/plugin/EEPROM-Keymap.h b/src/kaleidoscope/plugin/EEPROM-Keymap.h index ac7e4c40..838c07a6 100644 --- a/src/kaleidoscope/plugin/EEPROM-Keymap.h +++ b/src/kaleidoscope/plugin/EEPROM-Keymap.h @@ -20,10 +20,6 @@ #include "kaleidoscope/Runtime.h" #include -#define _DEPRECATED_MESSAGE_EEPROM_KEYMAP_SETUP_MODE \ - "The `mode` argument of EEPROMKeymap.setup() is deprecated and is not\n" \ - "used anymore. You can remove it safely." - namespace kaleidoscope { namespace plugin { class EEPROMKeymap : public kaleidoscope::Plugin { @@ -39,9 +35,6 @@ class EEPROMKeymap : public kaleidoscope::Plugin { EventHandlerResult onFocusEvent(const char *command); static void setup(uint8_t max); - static void setup(uint8_t max, Mode mode) DEPRECATED(EEPROM_KEYMAP_SETUP_MODE) { - setup(max); - } static void max_layers(uint8_t max); From 7aad552ea0ec026043c80f5d745caa3e73efe31b Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 6 Jan 2020 17:22:55 +0100 Subject: [PATCH 3/7] docs/UPGRADING.md: ToC update Remove two entries from the ToC, which were removed. We do not explicitly list items below "Removed APIs", and these two were moved there a while ago. Signed-off-by: Gergely Nagy --- docs/UPGRADING.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 44bee797..1a56c372 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -19,8 +19,6 @@ If any of this does not make sense to you, or you have trouble updating your .in - [TypingBreaks](#typingbreaks) - [Redial](#redial) + [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements) - - [Removal of Layer.defaultLayer](#removal-of-layerdefaultlayer) - - [More clarity in Layer method names](#more-clarity-in-layer-method-names) - [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement) * [Removed APIs](#removed-apis) From 753368dee88fb5c97827377cba683d6ac037d9eb Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 6 Jan 2020 17:25:35 +0100 Subject: [PATCH 4/7] docs/UPGRADING.md: ToC update Add a few items that were in the docs, but not in the table of contents. Signed-off-by: Gergely Nagy --- docs/UPGRADING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 1a56c372..54337348 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -19,6 +19,9 @@ If any of this does not make sense to you, or you have trouble updating your .in - [TypingBreaks](#typingbreaks) - [Redial](#redial) + [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements) + - [Class/global instance Kaleidoscope_/Kaleidoscope renamed to kaleidoscope::Runtime_/kaleidoscope::Runtime](#classglobal-instance-kaleidoscope_kaleidoscope-renamed-to-kaleidoscoperuntime_kaleidoscoperuntime) + - [Transition to linear indexing](#transition-to-linear-indexing) + - [keymaps array and KEYMAPS and KEYMAPS_STACKED macros](#keymaps-array-and-keymaps-and-keymaps_stacked-macros) - [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement) * [Removed APIs](#removed-apis) From f5c95810364086ee0a50ddeab6c40e19d3aeac58 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 6 Jan 2020 17:29:44 +0100 Subject: [PATCH 5/7] Remove the old 2d keymaps array Signed-off-by: Gergely Nagy --- docs/UPGRADING.md | 15 +++++------- src/kaleidoscope/keymaps.h | 49 -------------------------------------- src/kaleidoscope/layers.h | 5 ---- 3 files changed, 6 insertions(+), 63 deletions(-) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 54337348..adc869f2 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -21,7 +21,6 @@ If any of this does not make sense to you, or you have trouble updating your .in + [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements) - [Class/global instance Kaleidoscope_/Kaleidoscope renamed to kaleidoscope::Runtime_/kaleidoscope::Runtime](#classglobal-instance-kaleidoscope_kaleidoscope-renamed-to-kaleidoscoperuntime_kaleidoscoperuntime) - [Transition to linear indexing](#transition-to-linear-indexing) - - [keymaps array and KEYMAPS and KEYMAPS_STACKED macros](#keymaps-array-and-keymaps-and-keymaps_stacked-macros) - [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement) * [Removed APIs](#removed-apis) @@ -498,14 +497,6 @@ the firmware to remain backwards compatible, however, these functions are deprec Also a new version of the onKeyswitchEvent-handler has been introduced. The old version is deprecated. -## keymaps array and KEYMAPS and KEYMAPS_STACKED macros - -The `keymaps` array has been replaced with a `keymaps_linear` array. This new array treats each layer as a simple one dimensional array of keys, rather than a two dimensional array of arrays of rows. At the same time, the `KEYMAPS` and `KEYMAPS_STACKED` macros that were previously defined in each hardware implmentation class have been replaced with `PER_KEY_DATA` and `PER_KEY_DATA_STACKED` macros in each hardware class. This change should be invisible to users, but will require changes by any plugin that accessed the 'keymaps' variable directly. - -Code like `key.raw = pgm_read_word(&(keymaps[layer][row][col])); return key;` should be changed to look like this: `return keyFromKeymap(layer, row, col);` - -The old, deprecated, API will be removed on **2019-08-13**. - ### Source code and namespace rearrangement With the move towards a monorepo-based source, some headers have moved to a new location, and plenty of plugins moved to a new namespace (`kaleidoscope::plugin`). This means that the old headers, and some old names are deprecated. The old names no longer work. @@ -535,6 +526,12 @@ The following headers and names have changed: The [EEPROM-Keymap](doc/plugin/EEPROM-Keymap.md) plugin had its `setup()` method changed, the formerly optional `method` argument is now obsolete and unused. It can be safely removed. +## keymaps array and KEYMAPS and KEYMAPS_STACKED macros + +The `keymaps` array has been replaced with a `keymaps_linear` array. This new array treats each layer as a simple one dimensional array of keys, rather than a two dimensional array of arrays of rows. At the same time, the `KEYMAPS` and `KEYMAPS_STACKED` macros that were previously defined in each hardware implmentation class have been replaced with `PER_KEY_DATA` and `PER_KEY_DATA_STACKED` macros in each hardware class. This change should be invisible to users, but will require changes by any plugin that accessed the 'keymaps' variable directly. + +Code like `key.raw = pgm_read_word(&(keymaps[layer][row][col])); return key;` should be changed to look like this: `return keyFromKeymap(layer, row, col);` + ### Removed on 2019-01-18 ### Removal of Layer.defaultLayer diff --git a/src/kaleidoscope/keymaps.h b/src/kaleidoscope/keymaps.h index 09fdf5c6..3cbfe08f 100644 --- a/src/kaleidoscope/keymaps.h +++ b/src/kaleidoscope/keymaps.h @@ -29,53 +29,4 @@ Key keyFromKeymap(uint8_t layer, KeyAddr key_addr) { return keymaps_linear[layer][key_addr.toInt()].readFromProgmem(); } -namespace internal { - -// This class mimics a three-dimensional array as formerly used to -// store keymap arrays in progmem. It wraps the new one dimentional -// keymap array. - -class Keymaps2DInterface { - - public: - - class KeymapLayer { - - const Key * const keymap_layer_; - - public: - - KeymapLayer(const Key * const keymap_layer) : keymap_layer_(keymap_layer) {} - - class KeymapRow { - - const Key * const keymap_row_; - - public: - KeymapRow(const Key * const keymap_row) : keymap_row_(keymap_row) {} - - const Key &operator[](uint8_t col) { - return keymap_row_[col]; - } - }; - - KeymapRow operator[](uint8_t row) { - return KeymapRow(keymap_layer_ + row * kaleidoscope_internal::device.matrix_columns); - } - }; - - KeymapLayer operator[](uint8_t layer) { - return KeymapLayer(keymaps_linear[layer]); - } -}; - -} } - -#define _DEPRECATED_MESSAGE_2D_KEYMAP_ARRAY \ - "Accessing the keymap array directly is deprecated. Please use the function "\ - "keyFromKeymap() to access keys. The keymap array will be removed in future "\ - "versions of the firmware" - -DEPRECATED(2D_KEYMAP_ARRAY) -extern kaleidoscope::internal::Keymaps2DInterface keymaps; diff --git a/src/kaleidoscope/layers.h b/src/kaleidoscope/layers.h index efdc159f..3236cff8 100644 --- a/src/kaleidoscope/layers.h +++ b/src/kaleidoscope/layers.h @@ -32,11 +32,6 @@ uint8_t layer_count __NL__ \ = sizeof(keymaps_linear) / sizeof(*keymaps_linear); __NL__ \ __NL__ \ - /* This deprecated compatibility wrapper is removed by the linker if __NL__ \ - it is not accessed nowhere. __NL__ \ - */ __NL__ \ - kaleidoscope::internal::Keymaps2DInterface keymaps; __NL__ \ - __NL__ \ _INIT_SKETCH_EXPLORATION __NL__ \ _INIT_HID_GETSHORTNAME From e5c8f722479d2ea939cc99c1760769de8fe918e7 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 6 Jan 2020 17:31:54 +0100 Subject: [PATCH 6/7] docs/UPGRADING.md: Add a removal date for the old row/col based indexing While we added the new APIs and the entry in UPGRADING.md last summer, a removal date was never announced. Lets fix that now, and remove these in March. Signed-off-by: Gergely Nagy --- docs/UPGRADING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index adc869f2..b21fb16c 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -495,7 +495,7 @@ After renaming, some of the original symbols have been deprecated. The deprecate Row/col based indexing was replaced by linear indexing throughout the whole firmware. A compatibility layer of functions was introduced that allows the firmware to remain backwards compatible, however, these functions are deprecated and will be removed in future versions of the firmware. -Also a new version of the onKeyswitchEvent-handler has been introduced. The old version is deprecated. +Also a new version of the onKeyswitchEvent-handler has been introduced. The old version is deprecated, and will be removed after **2020-03-15**. ### Source code and namespace rearrangement From 5697f866a6a73d8fa4b03a86d8765366d6dd8e75 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 6 Jan 2020 17:36:46 +0100 Subject: [PATCH 7/7] docs/UPGRADING.md: Add a removal date for the old device APIs The old device API (`Hardware.h`, basically) along with some other related symbols (`ROWS`, `COLS`, etc) were deprecated, they emit warnings, but not removal date was set. Lets do that now. Signed-off-by: Gergely Nagy --- docs/UPGRADING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index b21fb16c..7838d3bd 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -40,6 +40,8 @@ For end users, this doesn't come with any breaking changes. A few things have be For those wishing to port Kaleidoscope to devices it doesn't support yet, the new API should make most things considerably easier. Please see the (work in progress) documentation in [doc/device-apis.md](doc/device-apis.md). +The old symbols and APIs will be removed by **2020-03-15**. + ### New plugin API #### For end-users