Merge pull request #787 from keyboardio/remove-deprecated-stuff

Remove deprecated interfaces and update UPGRADING.md
pull/802/head
Jesse Vincent 5 years ago committed by GitHub
commit 6ab2ad6374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,10 +19,8 @@ If any of this does not make sense to you, or you have trouble updating your .in
- [TypingBreaks](#typingbreaks) - [TypingBreaks](#typingbreaks)
- [Redial](#redial) - [Redial](#redial)
+ [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements) + [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements)
- [Removal of Layer.defaultLayer](#removal-of-layerdefaultlayer) - [Class/global instance Kaleidoscope_/Kaleidoscope renamed to kaleidoscope::Runtime_/kaleidoscope::Runtime](#classglobal-instance-kaleidoscope_kaleidoscope-renamed-to-kaleidoscoperuntime_kaleidoscoperuntime)
- [More clarity in Layer method names](#more-clarity-in-layer-method-names) - [Transition to linear indexing](#transition-to-linear-indexing)
- [Finer OneShot stickability control](#finer-oneshot-stickability-control)
- [EEPROMKeymap mode](#eepromkeymap-mode)
- [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement) - [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement)
* [Removed APIs](#removed-apis) * [Removed APIs](#removed-apis)
@ -42,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). 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 ### New plugin API
#### For end-users #### For end-users
@ -497,23 +497,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 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. 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**.
### 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**.
## 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 ### Source code and namespace rearrangement
@ -538,6 +522,18 @@ The following headers and names have changed:
# Removed APIs # 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.
## 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 ### Removed on 2019-01-18
### Removal of Layer.defaultLayer ### Removal of Layer.defaultLayer

@ -29,53 +29,4 @@ Key keyFromKeymap(uint8_t layer, KeyAddr key_addr) {
return keymaps_linear[layer][key_addr.toInt()].readFromProgmem(); 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;

@ -32,11 +32,6 @@
uint8_t layer_count __NL__ \ uint8_t layer_count __NL__ \
= sizeof(keymaps_linear) / sizeof(*keymaps_linear); __NL__ \ = sizeof(keymaps_linear) / sizeof(*keymaps_linear); __NL__ \
__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_SKETCH_EXPLORATION __NL__ \
_INIT_HID_GETSHORTNAME _INIT_HID_GETSHORTNAME

@ -20,10 +20,6 @@
#include "kaleidoscope/Runtime.h" #include "kaleidoscope/Runtime.h"
#include <Kaleidoscope-EEPROM-Settings.h> #include <Kaleidoscope-EEPROM-Settings.h>
#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 kaleidoscope {
namespace plugin { namespace plugin {
class EEPROMKeymap : public kaleidoscope::Plugin { class EEPROMKeymap : public kaleidoscope::Plugin {
@ -39,9 +35,6 @@ class EEPROMKeymap : public kaleidoscope::Plugin {
EventHandlerResult onFocusEvent(const char *command); EventHandlerResult onFocusEvent(const char *command);
static void setup(uint8_t max); 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); static void max_layers(uint8_t max);

Loading…
Cancel
Save