Deprecate a few older symbols

`KeyboardHardware`, `ROWS`, `COLS`, and `LED_COUNT` have been deprecated.

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

@ -39,8 +39,9 @@ void setup();
#include KALEIDOSCOPE_HARDWARE_H
#include "kaleidoscope/device/key_indexes.h"
#include "kaleidoscope_internal/device.h"
#include "kaleidoscope_internal/deprecations.h"
static constexpr kaleidoscope::Device &KeyboardHardware = kaleidoscope_internal::device;
static constexpr DEPRECATED(KEYBOARDHARDWARE) kaleidoscope::Device &KeyboardHardware = kaleidoscope_internal::device;
#ifdef PER_KEY_DATA_STACKED
#define KEYMAP_STACKED(...) { PER_KEY_DATA_STACKED(XXX, __VA_ARGS__) }
@ -50,9 +51,9 @@ static constexpr kaleidoscope::Device &KeyboardHardware = kaleidoscope_internal:
#define KEYMAP(...) { PER_KEY_DATA(XXX, __VA_ARGS__) }
#endif
static constexpr uint8_t ROWS = kaleidoscope_internal::device.matrix_rows;
static constexpr uint8_t COLS = kaleidoscope_internal::device.matrix_columns;
static constexpr uint8_t LED_COUNT = kaleidoscope_internal::device.led_count;
static constexpr DEPRECATED(ROWS) uint8_t ROWS = kaleidoscope_internal::device.matrix_rows;
static constexpr DEPRECATED(COLS) uint8_t COLS = kaleidoscope_internal::device.matrix_columns;
static constexpr DEPRECATED(LED_COUNT) uint8_t LED_COUNT = kaleidoscope_internal::device.led_count;
#include "kaleidoscope/KeyAddr.h"
#include "kaleidoscope/key_events.h"

@ -27,6 +27,22 @@
/* Messages */
#define _DEPRECATED_MESSAGE_NAMED_HARDWARE __NL__ \
"Named hardware objects are deprecated, please use `KeyboardHardware`\n" __NL__ \
"instead."
#define _DEPRECATED_MESSAGE_NAMED_HARDWARE __NL__ \
"Named hardware objects are deprecated, please use\n" __NL__ \
"`Kaleidoscope.device()` instead."
#define _DEPRECATED_MESSAGE_KEYBOARDHARDWARE \
"`KeyboardHardware` is deprecated, please use\n" __NL__ \
"`Kaleidoscope.device()` instead"
#define _DEPRECATED_MESSAGE_ROWS \
"The `ROWS` macro is deprecated, please use\n" __NL__ \
"`Kaleidoscope.device().matrix_rows` instead."
#define _DEPRECATED_MESSAGE_COLS \
"The `COLS` macro is deprecated, please use \n" __NL__ \
"`Kaleidoscope.device().matrix_columns` instead."
#define _DEPRECATED_MESSAGE_LED_COUNT \
"The `LED_COUNT` macro is deprecated, please use \n" __NL__ \
"`Kaleidoscope.device().led_count` instead."

Loading…
Cancel
Save