Remove the deprecated `LEDControl.paused` property

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/853/head
Gergely Nagy 4 years ago
parent e8c1a3bfb4
commit c800d2e425
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -13,7 +13,6 @@ If any of this does not make sense to you, or you have trouble updating your .in
- [Consistent timing](#consistent-timing)
+ [Breaking changes](#breaking-changes)
- [Implementation of type Key internally changed from C++ union to class](#implementation-of-type-key-internally-changed-from-union-to-class)
- [`LEDControl.paused` has been deprecated](#ledcontrolpaused-has-been-deprecated)
- [The `RxCy` macros and peeking into the keyswitch state](#the-rxcy-macros-and-peeking-into-the-keyswitch-state)
- [HostOS](#hostos)
- [MagicCombo](#magiccombo)
@ -354,44 +353,6 @@ k.setKeyCode(Key_A.getKeyCode());
k.setFlags(Key_A.getFlags());
```
### `LEDControl.paused` has been deprecated
Wherever we used `LEDControl.paused`, we'll need to use one of
`LEDControl.disable()`, `LEDControl.enable()`, or `LEDControl.isEnabled()`
instead. `LEDControl.paused` will still compile, but will emit deprecation
warnings, and will be removed after **2020-03-15**.
Keep in mind that `.enable()` and `.disable()` do more than what `paused` did:
they will refresh and turn off LEDs too, respectively.
A few examples to show how to transition to the new APIs follow, old use first, new second.
```c++
if (someCondition) {
LEDControl.set_all_leds_to({0, 0, 0});
LEDControl.syncLeds();
LEDControl.paused = true;
} else if (someOtherCondition) {
LEDControl.paused = false;
LEDControl.refreshAll();
}
if (LEDControl.paused) {
// do things...
}
```
```c++
if (someCondition) {
LEDControl.disable();
} else if (someOtherCondition) {
LEDControl.enable();
}
if (!LEDControl.isEnabled()) {
// do things...
}
```
### The `RxCy` macros and peeking into the keyswitch state
The `RxCy` macros changed from being indexes into a per-hand bitmap to being an
@ -574,6 +535,43 @@ After the introduction of the new device API, the old APIs (`ROWS`, `COLS`, `LED
Since March of 2019, this method has been deprecated, and turned into a no-op. While no removal date was posted at the time, after more than a year of deprecation, it has been removed on **2020-06-16**.
#### `LEDControl.paused`
Wherever we used `LEDControl.paused`, we'll need to use one of
`LEDControl.disable()`, `LEDControl.enable()`, or `LEDControl.isEnabled()`
instead. `LEDControl.paused` has been removed on **2020-06-16**.
Keep in mind that `.enable()` and `.disable()` do more than what `paused` did:
they will refresh and turn off LEDs too, respectively.
A few examples to show how to transition to the new APIs follow, old use first, new second.
```c++
if (someCondition) {
LEDControl.set_all_leds_to({0, 0, 0});
LEDControl.syncLeds();
LEDControl.paused = true;
} else if (someOtherCondition) {
LEDControl.paused = false;
LEDControl.refreshAll();
}
if (LEDControl.paused) {
// do things...
}
```
```c++
if (someCondition) {
LEDControl.disable();
} else if (someOtherCondition) {
LEDControl.enable();
}
if (!LEDControl.isEnabled()) {
// do things...
}
```
### Removed on 2020-01-06
#### EEPROMKeymap mode

@ -117,34 +117,6 @@ class LEDControl : public kaleidoscope::Plugin {
return Runtime.device().ledDriver().getBrightness();
}
// The data proxy objects are required to only emit deprecation
// messages when the `paused` property is accessed directly.
//
// Once the deprecation period elapsed, the proxy class and the proxied
// `paused` property can be safely removed.
class DataProxy {
public:
DataProxy() = default;
//constexpr DataProxy(bool value) : value_{value} {}
DEPRECATED(DIRECT_LEDCONTROL_PAUSED_ACCESS)
DataProxy &operator=(bool value) {
if (value)
disable();
else
enable();
return *this;
}
DEPRECATED(DIRECT_LEDCONTROL_PAUSED_ACCESS)
operator bool () const {
return !isEnabled();
}
};
DataProxy paused;
private:
static uint16_t syncTimer;
static uint8_t mode_id;

@ -39,13 +39,6 @@
"For further information and examples on how to do that, \n" \
"please see UPGRADING.md."
#define _DEPRECATED_MESSAGE_DIRECT_LEDCONTROL_PAUSED_ACCESS \
"Direct access to `LEDControl.paused` is deprecated.\n" \
"Please use `LEDControl.disable()` and `LEDControl.enable()` instead.\n" \
"\n" \
"For further information and examples on how to do that, please see\n" \
"UPGRADING.md"
#define _DEPRECATED_MESSAGE_KEY_MEMBER_RAW_ACCESS \
"The member variable `raw` of class Key had to be removed. Please \n" \
"use `Key::setRaw()`/`Key::getRaw()` to set and get raw data.\n" \

Loading…
Cancel
Save