Format codebase with `clang-format`

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1143/head
Michael Richters 3 years ago
parent dfd9bff7bd
commit e5d67efd58
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -34,7 +34,6 @@ class AppSwitcher : public kaleidoscope::Plugin {
private: private:
KeyAddr active_addr_ = KeyAddr::none(); KeyAddr active_addr_ = KeyAddr::none();
}; };
} // namespace plugin } // namespace plugin

@ -62,8 +62,7 @@ void AutoShift::disable() {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// Test for whether or not to apply AutoShift to a given `Key`. This function // Test for whether or not to apply AutoShift to a given `Key`. This function
// can be overridden from the user sketch. // can be overridden from the user sketch.
__attribute__((weak)) __attribute__((weak)) bool AutoShift::isAutoShiftable(Key key) {
bool AutoShift::isAutoShiftable(Key key) {
return enabledForKey(key); return enabledForKey(key);
} }

@ -72,7 +72,8 @@ class AutoShift : public Plugin {
public: public:
// Basic un-checked constructor // Basic un-checked constructor
constexpr Categories(uint8_t raw_bits) : raw_bits_(raw_bits) {} constexpr Categories(uint8_t raw_bits)
: raw_bits_(raw_bits) {}
static constexpr Categories letterKeys() { static constexpr Categories letterKeys() {
return Categories(LETTERS); return Categories(LETTERS);

@ -131,13 +131,15 @@ CharShift::KeyPair CharShift::decodeCharShiftKey(Key key) {
// This should be overridden if the KeyPairs array is stored in EEPROM // This should be overridden if the KeyPairs array is stored in EEPROM
__attribute__((weak)) __attribute__((weak))
uint8_t CharShift::numKeyPairs() { uint8_t
CharShift::numKeyPairs() {
return numProgmemKeyPairs(); return numProgmemKeyPairs();
} }
// This should be overridden if the KeyPairs array is stored in EEPROM // This should be overridden if the KeyPairs array is stored in EEPROM
__attribute__((weak)) __attribute__((weak))
CharShift::KeyPair CharShift::readKeyPair(uint8_t n) { CharShift::KeyPair
CharShift::readKeyPair(uint8_t n) {
return readKeyPairFromProgmem(n); return readKeyPairFromProgmem(n);
} }

@ -59,7 +59,8 @@ class CharShift : public Plugin {
/// ///
/// This constructor is used when defining an array of `KeyPair` objects in /// This constructor is used when defining an array of `KeyPair` objects in
/// PROGMEM (though it can also be used elsewhere). /// PROGMEM (though it can also be used elsewhere).
constexpr KeyPair(Key lower, Key upper) : lower(lower), upper(upper) {} constexpr KeyPair(Key lower, Key upper)
: lower(lower), upper(upper) {}
/// Constructor for reading from PROGMEM /// Constructor for reading from PROGMEM
/// ///
@ -125,10 +126,10 @@ extern kaleidoscope::plugin::CharShift CharShift;
/// defines them as an array in PROGMEM, and configures `CharShift` to use that /// defines them as an array in PROGMEM, and configures `CharShift` to use that
/// array, automatically setting the count correctly to prevent out-of-bounds /// array, automatically setting the count correctly to prevent out-of-bounds
/// lookups. /// lookups.
#define CS_KEYS(keypairs...) { \ #define CS_KEYS(keypairs...) \
{ \
static kaleidoscope::plugin::CharShift::KeyPair const kp_table[] PROGMEM = { \ static kaleidoscope::plugin::CharShift::KeyPair const kp_table[] PROGMEM = { \
keypairs \ keypairs}; \
}; \
CharShift.setProgmemKeyPairs(kp_table); \ CharShift.setProgmemKeyPairs(kp_table); \
} }

@ -68,8 +68,7 @@ EventHandlerResult ColormapEffect::onLayerChange() {
} }
EventHandlerResult ColormapEffect::onFocusEvent(const char *command) { EventHandlerResult ColormapEffect::onFocusEvent(const char *command) {
return ::LEDPaletteTheme.themeFocusEvent(command, PSTR("colormap.map"), return ::LEDPaletteTheme.themeFocusEvent(command, PSTR("colormap.map"), map_base_, max_layers_);
map_base_, max_layers_);
} }
} // namespace plugin } // namespace plugin

@ -44,21 +44,20 @@ class ColormapEffect : public Plugin,
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
// //
explicit TransientLEDMode(const ColormapEffect *parent) : parent_(parent) {} explicit TransientLEDMode(const ColormapEffect *parent)
: parent_(parent) {}
protected: protected:
friend class ColormapEffect; friend class ColormapEffect;
void onActivate(void) final; void onActivate(void) final;
void refreshAt(KeyAddr key_addr) final; void refreshAt(KeyAddr key_addr) final;
private:
private:
const ColormapEffect *parent_; const ColormapEffect *parent_;
}; };

@ -113,8 +113,7 @@ uint8_t Cycle::toModFlag(uint8_t keyCode) {
} // namespace plugin } // namespace plugin
} // namespace kaleidoscope } // namespace kaleidoscope
__attribute__((weak)) __attribute__((weak)) void cycleAction(Key previous_key, uint8_t cycle_count) {
void cycleAction(Key previous_key, uint8_t cycle_count) {
} }
kaleidoscope::plugin::Cycle Cycle; kaleidoscope::plugin::Cycle Cycle;

@ -62,8 +62,7 @@ EventHandlerResult CycleTimeReport::afterEachCycle() {
} // namespace kaleidoscope } // namespace kaleidoscope
__attribute__((weak)) void cycleTimeReport(void) { __attribute__((weak)) void cycleTimeReport(void) {
Focus.send(Focus.COMMENT, F("average loop time:"), CycleTimeReport.average_loop_time, Focus.send(Focus.COMMENT, F("average loop time:"), CycleTimeReport.average_loop_time, Focus.NEWLINE);
Focus.NEWLINE);
} }
kaleidoscope::plugin::CycleTimeReport CycleTimeReport; kaleidoscope::plugin::CycleTimeReport CycleTimeReport;

@ -72,24 +72,19 @@ struct string {
#endif #endif
}; };
template <typename TSourceString, size_t remainingLength, template<typename TSourceString, size_t remainingLength, char... collectedChars>
char... collectedChars>
struct string_maker { struct string_maker {
using result = using result =
typename string_maker < TSourceString, remainingLength - 1, typename string_maker<TSourceString, remainingLength - 1, TSourceString::data()[remainingLength - 1], collectedChars...>::result;
TSourceString::data()[remainingLength - 1],
collectedChars... >::result;
}; };
#if ARDUINOTRACE_ENABLE_FULLPATH == 0 #if ARDUINOTRACE_ENABLE_FULLPATH == 0
template <typename TSourceString, size_t remainingLength, template<typename TSourceString, size_t remainingLength, char... collectedChars>
char... collectedChars>
struct string_maker<TSourceString, remainingLength, '/', collectedChars...> { struct string_maker<TSourceString, remainingLength, '/', collectedChars...> {
using result = string<collectedChars..., '\0'>; using result = string<collectedChars..., '\0'>;
}; };
template <typename TSourceString, size_t remainingLength, template<typename TSourceString, size_t remainingLength, char... collectedChars>
char... collectedChars>
struct string_maker<TSourceString, remainingLength, '\\', collectedChars...> { struct string_maker<TSourceString, remainingLength, '\\', collectedChars...> {
using result = string<collectedChars..., '\0'>; using result = string<collectedChars..., '\0'>;
}; };
@ -173,9 +168,7 @@ struct Printer {
// However, if you use it at global scope, you need to call ARDUINOTRACE_INIT() // However, if you use it at global scope, you need to call ARDUINOTRACE_INIT()
// first, otherwise, the Serial port will not be ready. // first, otherwise, the Serial port will not be ready.
#define TRACE() \ #define TRACE() \
ARDUINOTRACE_PRINT(__COUNTER__, __FILE__, \ ARDUINOTRACE_PRINT(__COUNTER__, __FILE__, ARDUINOTRACE_TRACE_PREFIX(__LINE__), ARDUINOTRACE_FUNCTION_NAME)
ARDUINOTRACE_TRACE_PREFIX(__LINE__), \
ARDUINOTRACE_FUNCTION_NAME)
// Prints the value of a variable. // Prints the value of a variable.
// //
@ -183,8 +176,7 @@ struct Printer {
// Serial. If you use it at global scope, you need to call ARDUINOTRACE_INIT() // Serial. If you use it at global scope, you need to call ARDUINOTRACE_INIT()
// first, otherwise, the Serial port will not be ready. // first, otherwise, the Serial port will not be ready.
#define DUMP(variable) \ #define DUMP(variable) \
ARDUINOTRACE_PRINT(__COUNTER__, __FILE__, \ ARDUINOTRACE_PRINT(__COUNTER__, __FILE__, ARDUINOTRACE_DUMP_PREFIX(__LINE__, variable), variable)
ARDUINOTRACE_DUMP_PREFIX(__LINE__, variable), variable)
#else // ie ARDUINOTRACE_ENABLE == 0 #else // ie ARDUINOTRACE_ENABLE == 0

@ -68,8 +68,7 @@ void DynamicTapDance::updateDynamicTapDanceCache() {
} }
} }
bool DynamicTapDance::dance(uint8_t tap_dance_index, KeyAddr key_addr, bool DynamicTapDance::dance(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, TapDance::ActionType tap_dance_action) {
uint8_t tap_count, TapDance::ActionType tap_dance_action) {
uint16_t pos = map_[tap_dance_index - offset_] + ((tap_count - 1) * 2); uint16_t pos = map_[tap_dance_index - offset_] + ((tap_count - 1) * 2);
uint16_t next_pos = map_[tap_dance_index - offset_ + 1]; uint16_t next_pos = map_[tap_dance_index - offset_ + 1];
if (next_pos <= pos || (tap_dance_index > offset_ + dance_count_)) if (next_pos <= pos || (tap_dance_index > offset_ + dance_count_))

@ -37,8 +37,7 @@ class DynamicTapDance: public kaleidoscope::Plugin {
static void setup(uint8_t dynamic_offset, uint16_t size); static void setup(uint8_t dynamic_offset, uint16_t size);
static bool dance(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, static bool dance(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, TapDance::ActionType tap_dance_action);
TapDance::ActionType tap_dance_action);
private: private:
static uint16_t storage_base_; static uint16_t storage_base_;

@ -28,8 +28,7 @@
#include "crc.h" #include "crc.h"
void void CRC_::reflect(uint8_t len) {
CRC_::reflect(uint8_t len) {
uint8_t i; uint8_t i;
uint16_t newCRC; uint16_t newCRC;
@ -42,8 +41,7 @@ CRC_::reflect(uint8_t len) {
crc = newCRC; crc = newCRC;
} }
void void CRC_::update(const void *data, uint8_t len) {
CRC_::update(const void *data, uint8_t len) {
const uint8_t *d = (const uint8_t *)data; const uint8_t *d = (const uint8_t *)data;
uint8_t i; uint8_t i;
bool bit; bool bit;

@ -28,8 +28,7 @@ namespace kaleidoscope {
namespace plugin { namespace plugin {
EscapeOneShot::Settings EscapeOneShot::settings_ = { EscapeOneShot::Settings EscapeOneShot::settings_ = {
.cancel_oneshot_key = Key_Escape .cancel_oneshot_key = Key_Escape};
};
EventHandlerResult EscapeOneShot::onKeyEvent(KeyEvent &event) { EventHandlerResult EscapeOneShot::onKeyEvent(KeyEvent &event) {
// We only act on an escape key (or `cancel_oneshot_key_`, if that has been // We only act on an escape key (or `cancel_oneshot_key_`, if that has been

@ -37,6 +37,7 @@ class FirmwareDump : public kaleidoscope::Plugin {
EventHandlerResult onSetup(); EventHandlerResult onSetup();
EventHandlerResult onFocusEvent(const char *command); EventHandlerResult onFocusEvent(const char *command);
private: private:
uint16_t bootloader_size_; uint16_t bootloader_size_;
}; };

@ -44,10 +44,7 @@ EventHandlerResult FocusSerial::afterEachCycle() {
do { do {
command_[buf_cursor_++] = Runtime.serialPort().read(); command_[buf_cursor_++] = Runtime.serialPort().read();
} while (command_[buf_cursor_ - 1] != SEPARATOR } while (command_[buf_cursor_ - 1] != SEPARATOR && buf_cursor_ < sizeof(command_) && Runtime.serialPort().available() && (Runtime.serialPort().peek() != NEWLINE));
&& buf_cursor_ < sizeof(command_)
&& Runtime.serialPort().available()
&& (Runtime.serialPort().peek() != NEWLINE));
// If there was no command, there's nothing to do // If there was no command, there's nothing to do
@ -57,9 +54,7 @@ EventHandlerResult FocusSerial::afterEachCycle() {
return EventHandlerResult::OK; return EventHandlerResult::OK;
} }
if ((command_[buf_cursor_ - 1] != SEPARATOR) && (Runtime.serialPort().peek() != NEWLINE) if ((command_[buf_cursor_ - 1] != SEPARATOR) && (Runtime.serialPort().peek() != NEWLINE) && buf_cursor_ < sizeof(command_)) {
&& buf_cursor_ < sizeof(command_)
) {
// We don't have enough command to work with yet. // We don't have enough command to work with yet.
// Let's leave the buffer around for another cycle // Let's leave the buffer around for another cycle
return EventHandlerResult::OK; return EventHandlerResult::OK;
@ -86,7 +81,6 @@ EventHandlerResult FocusSerial::afterEachCycle() {
buf_cursor_ = 0; buf_cursor_ = 0;
memset(command_, 0, sizeof(command_)); memset(command_, 0, sizeof(command_));
return EventHandlerResult::OK; return EventHandlerResult::OK;
} }
bool FocusSerial::handleHelp(const char *command, bool FocusSerial::handleHelp(const char *command,

@ -23,7 +23,8 @@
#include "kaleidoscope/device/dygma/raise/RaiseSide.h" #include "kaleidoscope/device/dygma/raise/RaiseSide.h"
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r, g, b) \
(cRGB) { b, g, r }
#include "kaleidoscope/device/Base.h" #include "kaleidoscope/device/Base.h"
#include "kaleidoscope/driver/bootloader/samd/Bossac.h" #include "kaleidoscope/driver/bootloader/samd/Bossac.h"
@ -67,6 +68,7 @@ class RaiseLEDDriver : public kaleidoscope::driver::led::Base<RaiseLEDDriverProp
static uint8_t getBrightness(); static uint8_t getBrightness();
static void updateNeuronLED(); static void updateNeuronLED();
private: private:
static bool isLEDChangedNeuron; static bool isLEDChangedNeuron;
static uint8_t isLEDChangedLeft[LED_BANKS]; static uint8_t isLEDChangedLeft[LED_BANKS];
@ -126,6 +128,7 @@ class RaiseKeyScanner : public kaleidoscope::driver::keyscanner::Base<RaiseKeySc
private: private:
typedef RaiseKeyScanner ThisType; typedef RaiseKeyScanner ThisType;
typedef RaiseKeyScannerProps Props_; typedef RaiseKeyScannerProps Props_;
public: public:
static void setup(); static void setup();
static void scanMatrix(); static void scanMatrix();
@ -177,6 +180,7 @@ struct RaiseProps : kaleidoscope::device::BaseProps {
class Raise : public kaleidoscope::device::Base<RaiseProps> { class Raise : public kaleidoscope::device::Base<RaiseProps> {
private: private:
static RaiseProps::SideFlasher SideFlasher; static RaiseProps::SideFlasher SideFlasher;
public: public:
static void setup(); static void setup();

@ -57,7 +57,8 @@ typedef union {
class RaiseSide { class RaiseSide {
public: public:
explicit RaiseSide(uint8_t ad01) : ad01_(ad01), twi_(i2c_addr_base_ | ad01) {} explicit RaiseSide(uint8_t ad01)
: ad01_(ad01), twi_(i2c_addr_base_ | ad01) {}
int readVersion(); int readVersion();
int readSLEDVersion(); int readSLEDVersion();

@ -32,6 +32,7 @@ template <typename _Firmware>
class SideFlash : public kaleidoscope::Plugin { class SideFlash : public kaleidoscope::Plugin {
private: private:
_Firmware firmware; _Firmware firmware;
public: public:
EventHandlerResult onFocusEvent(const char *command) { EventHandlerResult onFocusEvent(const char *command) {
if (::Focus.handleHelp(command, PSTR("hardware.flash_left_side\nhardware.flash_right_side\nhardware.verify_left_side\nhardware.verify_right_side"))) if (::Focus.handleHelp(command, PSTR("hardware.flash_left_side\nhardware.flash_right_side\nhardware.verify_left_side\nhardware.verify_right_side")))

@ -29,7 +29,8 @@ namespace raise {
class TWI { class TWI {
public: public:
explicit TWI(int addr) : addr_(addr), crc_errors_(0) {} explicit TWI(int addr)
: addr_(addr), crc_errors_(0) {}
uint8_t writeTo(uint8_t *data, size_t length); uint8_t writeTo(uint8_t *data, size_t length);
uint8_t readFrom(uint8_t *data, size_t length); uint8_t readFrom(uint8_t *data, size_t length);

@ -148,9 +148,8 @@ void ErgoDox::setStatusLED(uint8_t led, bool state) {
} }
void ErgoDox::setStatusLEDBrightness(uint8_t led, uint8_t brightness) { void ErgoDox::setStatusLEDBrightness(uint8_t led, uint8_t brightness) {
(led == 1) ? (OCR1A = brightness) : (led == 1) ? (OCR1A = brightness) : (led == 2) ? (OCR1B = brightness)
(led == 2) ? (OCR1B = brightness) : : (OCR1C = brightness);
(OCR1C = brightness);
} }
uint8_t ErgoDox::debounceMaskForRow(uint8_t row) { uint8_t ErgoDox::debounceMaskForRow(uint8_t row) {

@ -33,7 +33,8 @@ struct cRGB {
uint8_t r, g, b; uint8_t r, g, b;
}; };
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r, g, b) \
(cRGB) { b, g, r }
#include "kaleidoscope/device/ATmega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
#include "kaleidoscope/driver/bootloader/avr/HalfKay.h" #include "kaleidoscope/driver/bootloader/avr/HalfKay.h"
@ -51,7 +52,6 @@ struct ErgoDoxProps : public kaleidoscope::device::ATmega32U4KeyboardProps {
static constexpr uint8_t matrix_rows = 14; static constexpr uint8_t matrix_rows = 14;
static constexpr uint8_t matrix_columns = 6; static constexpr uint8_t matrix_columns = 6;
typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr; typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr;
}; };
typedef kaleidoscope::driver::bootloader::avr::HalfKay Bootloader; typedef kaleidoscope::driver::bootloader::avr::HalfKay Bootloader;
static constexpr const char *short_name = "ErgoDox-EZ"; static constexpr const char *short_name = "ErgoDox-EZ";

@ -90,8 +90,7 @@ out:
return status; return status;
} }
void void ErgoDoxScanner::begin() {
ErgoDoxScanner::begin() {
expander_error_ = initExpander(); expander_error_ = initExpander();
// Init columns // Init columns
@ -156,8 +155,7 @@ out:
} }
} }
void void ErgoDoxScanner::reattachExpanderOnError() {
ErgoDoxScanner::reattachExpanderOnError() {
static uint32_t start_time = millis(); static uint32_t start_time = millis();
if (!expander_error_) if (!expander_error_)

@ -53,7 +53,8 @@ unsigned char i2c_start(unsigned char address) {
TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN); TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN);
// wait until transmission completed // wait until transmission completed
while (!(TWCR & (1 << TWINT))); while (!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits. // check value of TWI Status Register. Mask prescaler bits.
twst = TW_STATUS & 0xF8; twst = TW_STATUS & 0xF8;
@ -64,7 +65,8 @@ unsigned char i2c_start(unsigned char address) {
TWCR = (1 << TWINT) | (1 << TWEN); TWCR = (1 << TWINT) | (1 << TWEN);
// wail until transmission completed and ACK/NACK has been received // wail until transmission completed and ACK/NACK has been received
while (!(TWCR & (1 << TWINT))); while (!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits. // check value of TWI Status Register. Mask prescaler bits.
twst = TW_STATUS & 0xF8; twst = TW_STATUS & 0xF8;
@ -90,7 +92,8 @@ void i2c_start_wait(unsigned char address) {
TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN); TWCR = (1 << TWINT) | (1 << TWSTA) | (1 << TWEN);
// wait until transmission completed // wait until transmission completed
while (!(TWCR & (1 << TWINT))); while (!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits. // check value of TWI Status Register. Mask prescaler bits.
twst = TW_STATUS & 0xF8; twst = TW_STATUS & 0xF8;
@ -101,7 +104,8 @@ void i2c_start_wait(unsigned char address) {
TWCR = (1 << TWINT) | (1 << TWEN); TWCR = (1 << TWINT) | (1 << TWEN);
// wail until transmission completed // wail until transmission completed
while (!(TWCR & (1 << TWINT))); while (!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits. // check value of TWI Status Register. Mask prescaler bits.
twst = TW_STATUS & 0xF8; twst = TW_STATUS & 0xF8;
@ -110,7 +114,8 @@ void i2c_start_wait(unsigned char address) {
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO); TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);
// wait until stop condition is executed and bus released // wait until stop condition is executed and bus released
while (TWCR & (1 << TWSTO)); while (TWCR & (1 << TWSTO))
;
continue; continue;
} }
@ -143,7 +148,8 @@ void i2c_stop(void) {
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO); TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWSTO);
// wait until stop condition is executed and bus released // wait until stop condition is executed and bus released
while (TWCR & (1 << TWSTO)); while (TWCR & (1 << TWSTO))
;
} /* i2c_stop */ } /* i2c_stop */
@ -163,7 +169,8 @@ unsigned char i2c_write(unsigned char data) {
TWCR = (1 << TWINT) | (1 << TWEN); TWCR = (1 << TWINT) | (1 << TWEN);
// wait until transmission completed // wait until transmission completed
while (!(TWCR & (1 << TWINT))); while (!(TWCR & (1 << TWINT)))
;
// check value of TWI Status Register. Mask prescaler bits // check value of TWI Status Register. Mask prescaler bits
twst = TW_STATUS & 0xF8; twst = TW_STATUS & 0xF8;
@ -180,7 +187,8 @@ unsigned char i2c_write(unsigned char data) {
*************************************************************************/ *************************************************************************/
unsigned char i2c_readAck(void) { unsigned char i2c_readAck(void) {
TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWEA); TWCR = (1 << TWINT) | (1 << TWEN) | (1 << TWEA);
while (!(TWCR & (1 << TWINT))); while (!(TWCR & (1 << TWINT)))
;
return TWDR; return TWDR;
@ -194,7 +202,8 @@ unsigned char i2c_readAck(void) {
*************************************************************************/ *************************************************************************/
unsigned char i2c_readNak(void) { unsigned char i2c_readNak(void) {
TWCR = (1 << TWINT) | (1 << TWEN); TWCR = (1 << TWINT) | (1 << TWEN);
while (!(TWCR & (1 << TWINT))); while (!(TWCR & (1 << TWINT)))
;
return TWDR; return TWDR;

@ -42,6 +42,7 @@ class KeyScanner: public kaleidoscope::driver::keyscanner::Base<KeyScannerProps>
private: private:
typedef KeyScanner ThisType; typedef KeyScanner ThisType;
typedef KeyScannerProps Props_; typedef KeyScannerProps Props_;
public: public:
static bool do_scan; static bool do_scan;
@ -55,6 +56,7 @@ class KeyScanner: public kaleidoscope::driver::keyscanner::Base<KeyScannerProps>
static bool wasKeyswitchPressed(KeyAddr key_addr); static bool wasKeyswitchPressed(KeyAddr key_addr);
static uint8_t previousPressedKeyswitchCount(); static uint8_t previousPressedKeyswitchCount();
private: private:
/* /*
each of these variables are storing the state for a row of keys each of these variables are storing the state for a row of keys

@ -44,7 +44,8 @@ constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns];
// `KeyScanner` here refers to the alias set up above, just like in the // `KeyScanner` here refers to the alias set up above, just like in the
// `KeyScannerProps` case above. // `KeyScannerProps` case above.
template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; template<>
KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {};
// We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this
// cannot be in a header-only driver, and must be placed here. // cannot be in a header-only driver, and must be placed here.

@ -45,7 +45,8 @@ constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns];
// `KeyScanner` here refers to the alias set up above, just like in the // `KeyScanner` here refers to the alias set up above, just like in the
// `KeyScannerProps` case above. // `KeyScannerProps` case above.
template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; template<>
KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {};
// We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this
// cannot be in a header-only driver, and must be placed here. // cannot be in a header-only driver, and must be placed here.

@ -71,7 +71,8 @@ constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns];
// `KeyScanner` here refers to the alias set up above, just like in the // `KeyScanner` here refers to the alias set up above, just like in the
// `KeyScannerProps` case above. // `KeyScannerProps` case above.
template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; template<>
KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {};
// We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this
// cannot be in a header-only driver, and must be placed here. // cannot be in a header-only driver, and must be placed here.
@ -190,7 +191,6 @@ void ImagoLEDDriver::setAllPwmTo(uint8_t step) {
// PWM Register 0 is 0x00 to 0xB3 // PWM Register 0 is 0x00 to 0xB3
for (auto i = 1; i <= 0xB4; i++) { for (auto i = 1; i <= 0xB4; i++) {
data[i] = step; data[i] = step;
} }
twi_writeTo(LED_DRIVER_ADDR, data, 0xB5, 1, 0); twi_writeTo(LED_DRIVER_ADDR, data, 0xB5, 1, 0);
@ -198,7 +198,6 @@ void ImagoLEDDriver::setAllPwmTo(uint8_t step) {
// PWM Register 1 is 0x00 to 0xAA // PWM Register 1 is 0x00 to 0xAA
for (auto i = 1; i <= LED_REGISTER_PWM1_SIZE; i++) { for (auto i = 1; i <= LED_REGISTER_PWM1_SIZE; i++) {
data[i] = step; data[i] = step;
} }
twi_writeTo(LED_DRIVER_ADDR, data, 0xAC, 1, 0); twi_writeTo(LED_DRIVER_ADDR, data, 0xAC, 1, 0);
} }

@ -27,7 +27,8 @@ struct cRGB {
uint8_t r; uint8_t r;
}; };
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r, g, b) \
(cRGB) { b, g, r }
#include "kaleidoscope/device/ATmega32U4Keyboard.h" #include "kaleidoscope/device/ATmega32U4Keyboard.h"
#include "kaleidoscope/driver/bootloader/avr/Caterina.h" #include "kaleidoscope/driver/bootloader/avr/Caterina.h"

@ -30,7 +30,8 @@
#include "kaleidoscope/MatrixAddr.h" // for MatrixAddr #include "kaleidoscope/MatrixAddr.h" // for MatrixAddr
#include "kaleidoscope/macro_helpers.h" // for RESTRICT_AR... #include "kaleidoscope/macro_helpers.h" // for RESTRICT_AR...
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r, g, b) \
(cRGB) { b, g, r }
struct cRGB { struct cRGB {
uint8_t b; uint8_t b;
@ -91,6 +92,7 @@ struct Model01KeyScannerProps : public kaleidoscope::driver::keyscanner::BasePro
class Model01KeyScanner : public kaleidoscope::driver::keyscanner::Base<Model01KeyScannerProps> { class Model01KeyScanner : public kaleidoscope::driver::keyscanner::Base<Model01KeyScannerProps> {
private: private:
typedef Model01KeyScanner ThisType; typedef Model01KeyScanner ThisType;
public: public:
static void setup(); static void setup();
static void scanMatrix(); static void scanMatrix();

@ -82,8 +82,6 @@ uint8_t Model01Side::setKeyscanInterval(uint8_t delay) {
} }
// returns -1 on error, otherwise returns the scanner version integer // returns -1 on error, otherwise returns the scanner version integer
int Model01Side::readVersion() { int Model01Side::readVersion() {
return readRegister(TWI_CMD_VERSION); return readRegister(TWI_CMD_VERSION);
@ -113,7 +111,6 @@ uint8_t Model01Side::setLEDSPIFrequency(uint8_t frequency) {
} }
int Model01Side::readRegister(uint8_t cmd) { int Model01Side::readRegister(uint8_t cmd) {
uint8_t return_value = 0; uint8_t return_value = 0;
@ -122,7 +119,6 @@ int Model01Side::readRegister(uint8_t cmd) {
uint8_t result = twi_writeTo(addr, data, ELEMENTS(data), 1, 0); uint8_t result = twi_writeTo(addr, data, ELEMENTS(data), 1, 0);
delayMicroseconds(15); // We may be able to drop this in the future delayMicroseconds(15); // We may be able to drop this in the future
// but will need to verify with correctly // but will need to verify with correctly
// sized pull-ups on both the left and right // sized pull-ups on both the left and right
@ -137,7 +133,6 @@ int Model01Side::readRegister(uint8_t cmd) {
} else { } else {
return -1; return -1;
} }
} }
@ -195,8 +190,7 @@ void Model01Side::setAllLEDsTo(cRGB color) {
uint8_t data[] = {TWI_CMD_LED_SET_ALL_TO, uint8_t data[] = {TWI_CMD_LED_SET_ALL_TO,
pgm_read_byte(&gamma8[color.b]), pgm_read_byte(&gamma8[color.b]),
pgm_read_byte(&gamma8[color.g]), pgm_read_byte(&gamma8[color.g]),
pgm_read_byte(&gamma8[color.r]) pgm_read_byte(&gamma8[color.r])};
};
uint8_t result = twi_writeTo(addr, data, ELEMENTS(data), 1, 0); uint8_t result = twi_writeTo(addr, data, ELEMENTS(data), 1, 0);
} }
@ -205,10 +199,8 @@ void Model01Side::setOneLEDTo(uint8_t led, cRGB color) {
led, led,
pgm_read_byte(&gamma8[color.b]), pgm_read_byte(&gamma8[color.b]),
pgm_read_byte(&gamma8[color.g]), pgm_read_byte(&gamma8[color.g]),
pgm_read_byte(&gamma8[color.r]) pgm_read_byte(&gamma8[color.r])};
};
uint8_t result = twi_writeTo(addr, data, ELEMENTS(data), 1, 0); uint8_t result = twi_writeTo(addr, data, ELEMENTS(data), 1, 0);
} }
} // namespace keyboardio } // namespace keyboardio

@ -34,7 +34,8 @@ struct cRGB {
uint8_t g; uint8_t g;
uint8_t r; uint8_t r;
}; };
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r, g, b) \
(cRGB) { b, g, r }
#endif #endif
#define LED_BANKS 4 #define LED_BANKS 4

@ -48,7 +48,6 @@ void Model100Hands::setup(void) {
Model100KeyScanner::enableScannerPower(); Model100KeyScanner::enableScannerPower();
Wire.begin(); Wire.begin();
Wire.setClock(400000); Wire.setClock(400000);
} }
/********* LED Driver *********/ /********* LED Driver *********/
@ -141,7 +140,6 @@ void Model100KeyScanner::disableScannerPower(void) {
} }
void Model100KeyScanner::setup() { void Model100KeyScanner::setup() {
enableScannerPower(); enableScannerPower();
delay(250); delay(250);

@ -25,7 +25,8 @@
#include <Arduino.h> #include <Arduino.h>
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r, g, b) \
(cRGB) { b, g, r }
struct cRGB { struct cRGB {
uint8_t b; uint8_t b;
@ -92,6 +93,7 @@ struct Model100KeyScannerProps : public kaleidoscope::driver::keyscanner::BasePr
class Model100KeyScanner : public kaleidoscope::driver::keyscanner::Base<Model100KeyScannerProps> { class Model100KeyScanner : public kaleidoscope::driver::keyscanner::Base<Model100KeyScannerProps> {
private: private:
typedef Model100KeyScanner ThisType; typedef Model100KeyScanner ThisType;
public: public:
static void setup(); static void setup();
static void scanMatrix(); static void scanMatrix();

@ -75,8 +75,6 @@ uint8_t Model100Side::setKeyscanInterval(uint8_t delay) {
} }
// returns -1 on error, otherwise returns the scanner version integer // returns -1 on error, otherwise returns the scanner version integer
int Model100Side::readVersion() { int Model100Side::readVersion() {
return readRegister(TWI_CMD_VERSION); return readRegister(TWI_CMD_VERSION);
@ -134,7 +132,6 @@ bool Model100Side::isDeviceAvailable() {
// we've decremented the counter, but it's not time to probe for the device yet. // we've decremented the counter, but it's not time to probe for the device yet.
return false; return false;
} }
} }
void Model100Side::markDeviceUnavailable() { void Model100Side::markDeviceUnavailable() {
@ -180,7 +177,6 @@ int Model100Side::readRegister(uint8_t cmd) {
markDeviceUnavailable(); markDeviceUnavailable();
return -1; return -1;
} }
} }
@ -245,8 +241,7 @@ void Model100Side::setAllLEDsTo(cRGB color) {
uint8_t data[] = {TWI_CMD_LED_SET_ALL_TO, uint8_t data[] = {TWI_CMD_LED_SET_ALL_TO,
color.b, color.b,
color.g, color.g,
color.r color.r};
};
uint8_t result = writeData(data, ELEMENTS(data)); uint8_t result = writeData(data, ELEMENTS(data));
} }
@ -255,10 +250,8 @@ void Model100Side::setOneLEDTo(uint8_t led, cRGB color) {
led, led,
color.b, color.b,
color.g, color.g,
color.r color.r};
};
uint8_t result = writeData(data, ELEMENTS(data)); uint8_t result = writeData(data, ELEMENTS(data));
} }
} // namespace keyboardio } // namespace keyboardio

@ -34,7 +34,8 @@ struct cRGB {
uint8_t g; uint8_t g;
uint8_t r; uint8_t r;
}; };
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r, g, b) \
(cRGB) { b, g, r }
#endif #endif
#define LED_BANKS 4 #define LED_BANKS 4

@ -45,7 +45,8 @@ constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns];
// `KeyScanner` here refers to the alias set up above, just like in the // `KeyScanner` here refers to the alias set up above, just like in the
// `KeyScannerProps` case above. // `KeyScannerProps` case above.
template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; template<>
KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {};
// We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this
// cannot be in a header-only driver, and must be placed here. // cannot be in a header-only driver, and must be placed here.

@ -52,7 +52,8 @@ constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns];
// `KeyScanner` here refers to the alias set up above, just like in the // `KeyScanner` here refers to the alias set up above, just like in the
// `KeyScannerProps` case above. // `KeyScannerProps` case above.
template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; template<>
KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {};
// We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this
// cannot be in a header-only driver, and must be placed here. // cannot be in a header-only driver, and must be placed here.

@ -55,7 +55,8 @@ constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns];
// `KeyScanner` here refers to the alias set up above, just like in the // `KeyScanner` here refers to the alias set up above, just like in the
// `KeyScannerProps` case above. // `KeyScannerProps` case above.
template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; template<>
KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {};
// We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this
// cannot be in a header-only driver, and must be placed here. // cannot be in a header-only driver, and must be placed here.

@ -45,7 +45,8 @@ constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns];
// `KeyScanner` here refers to the alias set up above, just like in the // `KeyScanner` here refers to the alias set up above, just like in the
// `KeyScannerProps` case above. // `KeyScannerProps` case above.
template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; template<>
KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {};
// We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this
// cannot be in a header-only driver, and must be placed here. // cannot be in a header-only driver, and must be placed here.

@ -45,7 +45,8 @@ constexpr uint8_t KeyScannerProps::matrix_col_pins[matrix_columns];
// `KeyScanner` here refers to the alias set up above, just like in the // `KeyScanner` here refers to the alias set up above, just like in the
// `KeyScannerProps` case above. // `KeyScannerProps` case above.
template<> KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {}; template<>
KeyScanner::row_state_t KeyScanner::matrix_state_[KeyScannerProps::matrix_rows] = {};
// We set up the TIMER1 interrupt vector here. Due to dependency reasons, this // We set up the TIMER1 interrupt vector here. Due to dependency reasons, this
// cannot be in a header-only driver, and must be placed here. // cannot be in a header-only driver, and must be placed here.

@ -75,11 +75,9 @@ void HardwareTestMode::testLeds(void) {
setLeds(blue); setLeds(blue);
setLeds(green); setLeds(green);
setLeds(red); setLeds(red);
} }
void HardwareTestMode::testMatrix() { void HardwareTestMode::testMatrix() {
// Reset bad keys from previous tests. // Reset bad keys from previous tests.
chatter_data state[Runtime.device().numKeys()] = {{0, 0, 0}}; chatter_data state[Runtime.device().numKeys()] = {{0, 0, 0}};

@ -26,7 +26,6 @@ namespace plugin {
class HardwareTestMode : public kaleidoscope::Plugin { class HardwareTestMode : public kaleidoscope::Plugin {
public: public:
typedef struct { typedef struct {
uint8_t bad : 1, uint8_t bad : 1,
tested : 1, tested : 1,
@ -38,6 +37,7 @@ class HardwareTestMode : public kaleidoscope::Plugin {
static void runTests(); static void runTests();
static void setActionKey(uint8_t key); static void setActionKey(uint8_t key);
private: private:
static void testLeds(); static void testLeds();
static void testMatrix(); static void testMatrix();

@ -47,8 +47,7 @@ Heatmap::TransientLEDMode::TransientLEDMode(const Heatmap *parent)
// max of heatmap_ (we divide by it so we start at 1) // max of heatmap_ (we divide by it so we start at 1)
highest_(1), highest_(1),
// last heatmap computation time // last heatmap computation time
last_heatmap_comp_time_(Runtime.millisAtCycleStart()) last_heatmap_comp_time_(Runtime.millisAtCycleStart()) {}
{}
cRGB Heatmap::TransientLEDMode::computeColor(float v) { cRGB Heatmap::TransientLEDMode::computeColor(float v) {
// compute the color corresponding to a value between 0 and 1 // compute the color corresponding to a value between 0 and 1

@ -48,7 +48,6 @@ class Heatmap : public Plugin,
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -60,11 +59,9 @@ class Heatmap : public Plugin,
EventHandlerResult beforeEachCycle(); EventHandlerResult beforeEachCycle();
protected: protected:
void update() final; void update() final;
private: private:
uint16_t heatmap_[Runtime.device().numKeys()]; uint16_t heatmap_[Runtime.device().numKeys()];
uint16_t highest_; uint16_t highest_;
uint16_t last_heatmap_comp_time_; uint16_t last_heatmap_comp_time_;

@ -51,6 +51,7 @@ class PersistentIdleLEDs : public IdleLEDs {
EventHandlerResult onFocusEvent(const char *command); EventHandlerResult onFocusEvent(const char *command);
static void setIdleTimeoutSeconds(uint32_t new_limit); static void setIdleTimeoutSeconds(uint32_t new_limit);
private: private:
static uint16_t settings_base_; static uint16_t settings_base_;
}; };

@ -34,8 +34,7 @@ const cRGB *LEDActiveLayerColorEffect::colormap_;
LEDActiveLayerColorEffect::TransientLEDMode::TransientLEDMode( LEDActiveLayerColorEffect::TransientLEDMode::TransientLEDMode(
const LEDActiveLayerColorEffect *parent) const LEDActiveLayerColorEffect *parent)
: parent_(parent), : parent_(parent),
active_color_{0, 0, 0} active_color_{0, 0, 0} {}
{}
void LEDActiveLayerColorEffect::setColormap(const cRGB colormap[]) { void LEDActiveLayerColorEffect::setColormap(const cRGB colormap[]) {
colormap_ = colormap; colormap_ = colormap;

@ -40,7 +40,6 @@ class LEDActiveLayerColorEffect : public Plugin,
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -48,12 +47,10 @@ class LEDActiveLayerColorEffect : public Plugin,
explicit TransientLEDMode(const LEDActiveLayerColorEffect *parent); explicit TransientLEDMode(const LEDActiveLayerColorEffect *parent);
protected: protected:
void onActivate(void) final; void onActivate(void) final;
void refreshAt(KeyAddr key_addr) final; void refreshAt(KeyAddr key_addr) final;
private: private:
const LEDActiveLayerColorEffect *parent_; const LEDActiveLayerColorEffect *parent_;
cRGB active_color_; cRGB active_color_;
@ -64,7 +61,6 @@ class LEDActiveLayerColorEffect : public Plugin,
}; };
private: private:
static const cRGB *colormap_; static const cRGB *colormap_;
}; };

@ -67,8 +67,7 @@ static const uint16_t alphabet[] PROGMEM = {
ALPHASQUARE_SYMBOL_7, ALPHASQUARE_SYMBOL_7,
ALPHASQUARE_SYMBOL_8, ALPHASQUARE_SYMBOL_8,
ALPHASQUARE_SYMBOL_9, ALPHASQUARE_SYMBOL_9,
ALPHASQUARE_SYMBOL_0 ALPHASQUARE_SYMBOL_0};
};
cRGB AlphaSquare::color = {0x80, 0x80, 0x80}; cRGB AlphaSquare::color = {0x80, 0x80, 0x80};

@ -42,7 +42,6 @@ namespace kaleidoscope {
namespace plugin { namespace plugin {
class AlphaSquare : public kaleidoscope::Plugin { class AlphaSquare : public kaleidoscope::Plugin {
public: public:
AlphaSquare(void) {} AlphaSquare(void) {}
static void display(Key key, KeyAddr key_addr, cRGB key_color); static void display(Key key, KeyAddr key_addr, cRGB key_color);

@ -37,8 +37,7 @@ uint16_t AlphaSquareEffect::length = 1000;
AlphaSquareEffect::TransientLEDMode::TransientLEDMode(AlphaSquareEffect * /*parent*/) // NOLINT(readability/casting) AlphaSquareEffect::TransientLEDMode::TransientLEDMode(AlphaSquareEffect * /*parent*/) // NOLINT(readability/casting)
: last_key_left_(Key_NoKey), : last_key_left_(Key_NoKey),
last_key_right_(Key_NoKey) last_key_right_(Key_NoKey) {}
{}
void AlphaSquareEffect::TransientLEDMode::update(void) { void AlphaSquareEffect::TransientLEDMode::update(void) {
if (!Runtime.has_leds) if (!Runtime.has_leds)

@ -44,7 +44,8 @@ class LEDPaletteTheme : public kaleidoscope::Plugin {
EventHandlerResult onFocusEvent(const char *command); EventHandlerResult onFocusEvent(const char *command);
EventHandlerResult themeFocusEvent(const char *command, EventHandlerResult themeFocusEvent(const char *command,
const char *expected_command, const char *expected_command,
uint16_t theme_base, uint8_t max_themes); uint16_t theme_base,
uint8_t max_themes);
private: private:
static uint16_t palette_base_; static uint16_t palette_base_;

@ -34,14 +34,12 @@ namespace plugin {
StalkerEffect::ColorComputer *StalkerEffect::variant; StalkerEffect::ColorComputer *StalkerEffect::variant;
uint16_t StalkerEffect::step_length = 50; uint16_t StalkerEffect::step_length = 50;
cRGB StalkerEffect::inactive_color = (cRGB){ cRGB StalkerEffect::inactive_color = (cRGB){
0, 0, 0 0, 0, 0};
};
StalkerEffect::TransientLEDMode::TransientLEDMode(const StalkerEffect *parent) StalkerEffect::TransientLEDMode::TransientLEDMode(const StalkerEffect *parent)
: parent_(parent), : parent_(parent),
step_start_time_(0), step_start_time_(0),
map_{} map_{} {}
{}
EventHandlerResult StalkerEffect::onKeyEvent(KeyEvent &event) { EventHandlerResult StalkerEffect::onKeyEvent(KeyEvent &event) {
if (!Runtime.has_leds) if (!Runtime.has_leds)

@ -53,7 +53,6 @@ class StalkerEffect : public Plugin,
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -61,11 +60,9 @@ class StalkerEffect : public Plugin,
explicit TransientLEDMode(const StalkerEffect *parent); explicit TransientLEDMode(const StalkerEffect *parent);
protected: protected:
void update() final; void update() final;
private: private:
const StalkerEffect *parent_; const StalkerEffect *parent_;
uint16_t step_start_time_; uint16_t step_start_time_;
@ -80,9 +77,11 @@ namespace stalker {
class Haunt : public StalkerEffect::ColorComputer { class Haunt : public StalkerEffect::ColorComputer {
public: public:
explicit Haunt(const cRGB highlight_color); explicit Haunt(const cRGB highlight_color);
Haunt(void) : Haunt(CRGB(0x40, 0x80, 0x80)) {} Haunt(void)
: Haunt(CRGB(0x40, 0x80, 0x80)) {}
cRGB compute(uint8_t *step) final; cRGB compute(uint8_t *step) final;
private: private:
static cRGB highlight_color_; static cRGB highlight_color_;
}; };

@ -55,8 +55,7 @@ PROGMEM const uint8_t WavepoolEffect::TransientLEDMode::rc2pos[Runtime.device().
WavepoolEffect::TransientLEDMode::TransientLEDMode(const WavepoolEffect *parent) WavepoolEffect::TransientLEDMode::TransientLEDMode(const WavepoolEffect *parent)
: frames_since_event_(0), : frames_since_event_(0),
surface_{}, surface_{},
page_(0) page_(0) {}
{}
EventHandlerResult WavepoolEffect::onKeyEvent(KeyEvent &event) { EventHandlerResult WavepoolEffect::onKeyEvent(KeyEvent &event) {
if (!event.addr.isValid()) if (!event.addr.isValid())
@ -137,9 +136,7 @@ void WavepoolEffect::TransientLEDMode::update(void) {
raindrop(prev_x, prev_y, oldpg); raindrop(prev_x, prev_y, oldpg);
prev_x = prev_y = -1; prev_x = prev_y = -1;
} }
if (frames_since_event_ if (frames_since_event_ >= (frames_till_next_drop + (idle_timeout / MS_PER_FRAME))) {
>= (frames_till_next_drop
+ (idle_timeout / MS_PER_FRAME))) {
frames_till_next_drop = 4 + (wp_rand() % FRAMES_PER_DROP); frames_till_next_drop = 4 + (wp_rand() % FRAMES_PER_DROP);
frames_since_event_ = idle_timeout / MS_PER_FRAME; frames_since_event_ = idle_timeout / MS_PER_FRAME;
@ -239,7 +236,6 @@ void WavepoolEffect::TransientLEDMode::update(void) {
// swap pages every frame // swap pages every frame
page_ ^= 1; page_ ^= 1;
#endif #endif
} }
} // namespace plugin } // namespace plugin

@ -55,7 +55,6 @@ class WavepoolEffect : public Plugin,
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -65,11 +64,9 @@ class WavepoolEffect : public Plugin,
EventHandlerResult onKeyEvent(KeyEvent &event); EventHandlerResult onKeyEvent(KeyEvent &event);
protected: protected:
void update() final; void update() final;
private: private:
uint8_t frames_since_event_; uint8_t frames_since_event_;
int8_t surface_[2][WP_WID * WP_HGT]; int8_t surface_[2][WP_WID * WP_HGT];
uint8_t page_; uint8_t page_;

@ -47,8 +47,7 @@ const uint8_t BootAnimationEffect::greeting_[11] PROGMEM = {
Key_D.getKeyCode(), Key_D.getKeyCode(),
Key_Period.getKeyCode(), Key_Period.getKeyCode(),
Key_I.getKeyCode(), Key_I.getKeyCode(),
Key_O.getKeyCode() Key_O.getKeyCode()};
};
EventHandlerResult BootAnimationEffect::onSetup() { EventHandlerResult BootAnimationEffect::onSetup() {
return EventHandlerResult::OK; return EventHandlerResult::OK;

@ -36,7 +36,6 @@ class LEDBreatheEffect : public Plugin,
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -48,7 +47,6 @@ class LEDBreatheEffect : public Plugin,
void update(void) final; void update(void) final;
private: private:
const LEDBreatheEffect *parent_; const LEDBreatheEffect *parent_;
static constexpr uint8_t update_interval_ = 50; static constexpr uint8_t update_interval_ = 50;

@ -47,7 +47,6 @@ class LEDChaseEffect : public Plugin,
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -56,11 +55,9 @@ class LEDChaseEffect : public Plugin,
: parent_(parent), last_update_(Runtime.millisAtCycleStart()) {} : parent_(parent), last_update_(Runtime.millisAtCycleStart()) {}
protected: protected:
void update() final; void update() final;
private: private:
const LEDChaseEffect *parent_; const LEDChaseEffect *parent_;
uint8_t pos_ = uint8_t(0); uint8_t pos_ = uint8_t(0);

@ -42,7 +42,6 @@ class LEDRainbowEffect : public Plugin,
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -53,7 +52,6 @@ class LEDRainbowEffect : public Plugin,
void update() final; void update() final;
private: private:
const LEDRainbowEffect *parent_; const LEDRainbowEffect *parent_;
uint16_t rainbow_hue = 0; // stores 0 to 614 uint16_t rainbow_hue = 0; // stores 0 to 614
@ -87,7 +85,6 @@ class LEDRainbowWaveEffect : public Plugin, public LEDModeInterface {
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -98,7 +95,6 @@ class LEDRainbowWaveEffect : public Plugin, public LEDModeInterface {
void update() final; void update() final;
private: private:
const LEDRainbowWaveEffect *parent_; const LEDRainbowWaveEffect *parent_;
uint16_t rainbow_hue = 0; // stores 0 to 614 uint16_t rainbow_hue = 0; // stores 0 to 614

@ -28,16 +28,13 @@ namespace plugin {
class LEDSolidColor : public Plugin, class LEDSolidColor : public Plugin,
public LEDModeInterface { public LEDModeInterface {
public: public:
LEDSolidColor(uint8_t r, uint8_t g, uint8_t b) LEDSolidColor(uint8_t r, uint8_t g, uint8_t b)
: r_(r), g_(g), b_(b) : r_(r), g_(g), b_(b) {}
{}
// This class' instance has dynamic lifetime // This class' instance has dynamic lifetime
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -50,12 +47,10 @@ class LEDSolidColor : public Plugin,
void refreshAt(KeyAddr key_addr) final; void refreshAt(KeyAddr key_addr) final;
private: private:
const LEDSolidColor *parent_; const LEDSolidColor *parent_;
}; };
private: private:
uint8_t r_, g_, b_; uint8_t r_, g_, b_;
}; };

@ -28,13 +28,13 @@ class TriColor : public Plugin,
public LEDModeInterface { public LEDModeInterface {
public: public:
TriColor(cRGB base_color, cRGB mod_color, cRGB esc_color); TriColor(cRGB base_color, cRGB mod_color, cRGB esc_color);
TriColor(cRGB base_color, cRGB mod_color) : TriColor(base_color, mod_color, mod_color) {} TriColor(cRGB base_color, cRGB mod_color)
: TriColor(base_color, mod_color, mod_color) {}
// This class' instance has dynamic lifetime // This class' instance has dynamic lifetime
// //
class TransientLEDMode : public LEDMode { class TransientLEDMode : public LEDMode {
public: public:
// Please note that storing the parent ptr is only required // Please note that storing the parent ptr is only required
// for those LED modes that require access to // for those LED modes that require access to
// members of their parent class. Most LED modes can do without. // members of their parent class. Most LED modes can do without.
@ -43,11 +43,9 @@ class TriColor : public Plugin,
: parent_(parent) {} : parent_(parent) {}
protected: protected:
void update(void) final; void update(void) final;
private: private:
const TriColor *parent_; const TriColor *parent_;
}; };

@ -75,8 +75,7 @@ int8_t Leader::lookup(void) {
if (!match) if (!match)
continue; continue;
seq_key seq_key = dictionary[seq_index].sequence[sequence_pos_ + 1].readFromProgmem();
= dictionary[seq_index].sequence[sequence_pos_ + 1].readFromProgmem();
if (seq_key == Key_NoKey) { if (seq_key == Key_NoKey) {
return seq_index; return seq_index;
} else { } else {

@ -46,8 +46,12 @@
#define LEAD(n) kaleidoscope::plugin::LeaderKey(n) #define LEAD(n) kaleidoscope::plugin::LeaderKey(n)
#define LEADER_SEQ(...) { __VA_ARGS__, Key_NoKey } #define LEADER_SEQ(...) \
#define LEADER_DICT(...) { __VA_ARGS__, {{Key_NoKey}, NULL} } { __VA_ARGS__, Key_NoKey }
#define LEADER_DICT(...) \
{ \
__VA_ARGS__, { {Key_NoKey}, NULL } \
}
namespace kaleidoscope { namespace kaleidoscope {
namespace plugin { namespace plugin {

@ -32,7 +32,8 @@
// ============================================================================= // =============================================================================
// Default `macroAction()` function definitions // Default `macroAction()` function definitions
__attribute__((weak)) __attribute__((weak))
const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { const macro_t *
macroAction(uint8_t macro_id, KeyEvent &event) {
return MACRO_NONE; return MACRO_NONE;
} }

@ -42,7 +42,6 @@ namespace plugin {
class Macros : public kaleidoscope::Plugin { class Macros : public kaleidoscope::Plugin {
public: public:
/// Send a key press event from a Macro /// Send a key press event from a Macro
/// ///
/// Generates a new `KeyEvent` and calls `Runtime.handleKeyEvent()` with the /// Generates a new `KeyEvent` and calls `Runtime.handleKeyEvent()` with the
@ -105,7 +104,6 @@ class Macros : public kaleidoscope::Plugin {
return true; return true;
return false; return false;
} }
}; };
} // namespace plugin } // namespace plugin

@ -49,8 +49,7 @@ typedef uint8_t macro_t;
{ \ { \
static const macro_t __m[] PROGMEM = { \ static const macro_t __m[] PROGMEM = { \
__VA_ARGS__, \ __VA_ARGS__, \
MACRO_ACTION_END \ MACRO_ACTION_END}; \
}; \
&__m[0]; \ &__m[0]; \
}) })

@ -69,7 +69,6 @@ class MouseKeys : public kaleidoscope::Plugin {
void sendMouseWarpReport(const KeyEvent &event) const; void sendMouseWarpReport(const KeyEvent &event) const;
void sendMouseMoveReport(); void sendMouseMoveReport();
void sendMouseWheelReport(); void sendMouseWheelReport();
}; };
} // namespace plugin } // namespace plugin

@ -122,14 +122,18 @@ void MouseWrapper::move(int8_t x, int8_t y) {
if (x != 0) { if (x != 0) {
moveX = remainderX + (x * acceleration(accel_step)); moveX = remainderX + (x * acceleration(accel_step));
if (moveX > effectiveSpeedLimit) moveX = effectiveSpeedLimit; if (moveX > effectiveSpeedLimit)
else if (moveX < -effectiveSpeedLimit) moveX = -effectiveSpeedLimit; moveX = effectiveSpeedLimit;
else if (moveX < -effectiveSpeedLimit)
moveX = -effectiveSpeedLimit;
} }
if (y != 0) { if (y != 0) {
moveY = remainderY + (y * acceleration(accel_step)); moveY = remainderY + (y * acceleration(accel_step));
if (moveY > effectiveSpeedLimit) moveY = effectiveSpeedLimit; if (moveY > effectiveSpeedLimit)
else if (moveY < -effectiveSpeedLimit) moveY = -effectiveSpeedLimit; moveY = effectiveSpeedLimit;
else if (moveY < -effectiveSpeedLimit)
moveY = -effectiveSpeedLimit;
} }
endWarping(); endWarping();

@ -39,7 +39,6 @@ class NumPad : public kaleidoscope::Plugin {
EventHandlerResult afterEachCycle(); EventHandlerResult afterEachCycle();
private: private:
void setKeyboardLEDColors(void); void setKeyboardLEDColors(void);
static KeyAddr numpadLayerToggleKeyAddr; static KeyAddr numpadLayerToggleKeyAddr;

@ -94,8 +94,7 @@ bool OneShot::isSticky() const {
// could potentially use three different color values for the three // could potentially use three different color values for the three
// states (sticky | active && !sticky | pressed && !active). // states (sticky | active && !sticky | pressed && !active).
__attribute__((weak)) __attribute__((weak)) bool OneShot::isStickable(Key key) const {
bool OneShot::isStickable(Key key) const {
return isStickableDefault(key); return isStickableDefault(key);
} }
@ -274,7 +273,6 @@ EventHandlerResult OneShot::onKeyEvent(KeyEvent& event) {
// event. This is handled in the `beforeReportingState()` hook below. // event. This is handled in the `beforeReportingState()` hook below.
return EventHandlerResult::ABORT; return EventHandlerResult::ABORT;
} }
} }
return EventHandlerResult::OK; return EventHandlerResult::OK;
@ -379,8 +377,7 @@ void OneShot::holdKey(KeyAddr key_addr) const {
Runtime.handleKeyEvent(event); Runtime.handleKeyEvent(event);
} }
__attribute__((always_inline)) inline __attribute__((always_inline)) inline void OneShot::releaseKey(KeyAddr key_addr) {
void OneShot::releaseKey(KeyAddr key_addr) {
glue_addrs_.clear(key_addr); glue_addrs_.clear(key_addr);
temp_addrs_.clear(key_addr); temp_addrs_.clear(key_addr);

@ -191,7 +191,6 @@ class OneShot : public kaleidoscope::Plugin {
EventHandlerResult afterEachCycle(); EventHandlerResult afterEachCycle();
private: private:
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
// Constants // Constants
static constexpr uint8_t oneshot_key_count = 16; static constexpr uint8_t oneshot_key_count = 16;

@ -42,7 +42,6 @@ class OneShotMetaKeys : public kaleidoscope::Plugin {
private: private:
static bool isMetaStickyActive(); static bool isMetaStickyActive();
}; };
} // namespace plugin } // namespace plugin

@ -32,6 +32,7 @@ class PersistentLEDMode: public kaleidoscope::Plugin {
EventHandlerResult onSetup(); EventHandlerResult onSetup();
EventHandlerResult onLEDModeChange(); EventHandlerResult onLEDModeChange();
private: private:
static uint16_t settings_base_; static uint16_t settings_base_;
static uint8_t cached_mode_index_; static uint8_t cached_mode_index_;

@ -66,7 +66,8 @@ EventHandlerResult Qukeys::onKeyswitchEvent(KeyEvent &event) {
// If we can't trivially ignore the event, just add it to the queue. // If we can't trivially ignore the event, just add it to the queue.
event_queue_.append(event); event_queue_.append(event);
// In order to prevent overflowing the queue, process it now. // In order to prevent overflowing the queue, process it now.
while (processQueue()); while (processQueue())
;
// Any event that gets added to the queue gets re-processed later, so we // Any event that gets added to the queue gets re-processed later, so we
// need to abort processing now. // need to abort processing now.
return EventHandlerResult::ABORT; return EventHandlerResult::ABORT;
@ -97,13 +98,13 @@ EventHandlerResult Qukeys::afterEachCycle() {
if (Runtime.hasTimeExpired(event_queue_.timestamp(0), hold_timeout_)) { if (Runtime.hasTimeExpired(event_queue_.timestamp(0), hold_timeout_)) {
// If it's a SpaceCadet-type key, it takes on its primary value, otherwise // If it's a SpaceCadet-type key, it takes on its primary value, otherwise
// it takes on its secondary value. // it takes on its secondary value.
Key event_key = isModifierKey(queue_head_.primary_key) ? Key event_key = isModifierKey(queue_head_.primary_key) ? queue_head_.primary_key : queue_head_.alternate_key;
queue_head_.primary_key : queue_head_.alternate_key;
flushEvent(event_key); flushEvent(event_key);
} }
// Process as many events as we can from the queue. // Process as many events as we can from the queue.
while (processQueue()); while (processQueue())
;
return EventHandlerResult::OK; return EventHandlerResult::OK;
} }
@ -205,8 +206,7 @@ bool Qukeys::processQueue() {
// flush it now. Its state depends on whether or not it's a // flush it now. Its state depends on whether or not it's a
// SpaceCadet-type key. // SpaceCadet-type key.
if (next_keypress_index == 0 || overlap_threshold_ == 0) { if (next_keypress_index == 0 || overlap_threshold_ == 0) {
Key event_key = qukey_is_spacecadet ? Key event_key = qukey_is_spacecadet ? queue_head_.alternate_key : queue_head_.primary_key;
queue_head_.alternate_key : queue_head_.primary_key;
// A qukey just got released in primary state; this might turn out to be // A qukey just got released in primary state; this might turn out to be
// the beginning of a tap-repeat sequence, so we set the tap-repeat // the beginning of a tap-repeat sequence, so we set the tap-repeat
// address and start time to the time of the initial press event before // address and start time to the time of the initial press event before

@ -66,13 +66,11 @@ struct Qukey {
// This is the constructor that should be used when creating a Qukey object in // This is the constructor that should be used when creating a Qukey object in
// the PROGMEM array that will be used by Qukeys (i.e. in the `QUKEYS()` // the PROGMEM array that will be used by Qukeys (i.e. in the `QUKEYS()`
// macro). // macro).
constexpr constexpr Qukey(int8_t layer, KeyAddr k, Key alternate_key)
Qukey(int8_t layer, KeyAddr k, Key alternate_key)
: layer(layer), addr(k), alternate_key(alternate_key) {} : layer(layer), addr(k), alternate_key(alternate_key) {}
// This constructor is here so that we can create an empty Qukey object in RAM // This constructor is here so that we can create an empty Qukey object in RAM
// into which we can copy the values from a PROGMEM Qukey object. // into which we can copy the values from a PROGMEM Qukey object.
Qukey() = default; Qukey() = default;
}; };
@ -239,9 +237,9 @@ extern kaleidoscope::plugin::Qukeys Qukeys;
// guarantee that the count is set correctly. This is considerably less // guarantee that the count is set correctly. This is considerably less
// important than it used to be, with the `configureQukeys()` function taking // important than it used to be, with the `configureQukeys()` function taking
// care of guaranteeing the correct count setting. // care of guaranteeing the correct count setting.
#define QUKEYS(qukey_defs...) { \ #define QUKEYS(qukey_defs...) \
{ \
static kaleidoscope::plugin::Qukey const qk_table[] PROGMEM = { \ static kaleidoscope::plugin::Qukey const qk_table[] PROGMEM = { \
qukey_defs \ qukey_defs}; \
}; \
Qukeys.configureQukeys(qk_table); \ Qukeys.configureQukeys(qk_table); \
} }

@ -80,8 +80,7 @@ SpaceCadet::SpaceCadet() {
{Key_LeftControl, Key_LeftBracket, 250}, {Key_LeftControl, Key_LeftBracket, 250},
{Key_RightControl, Key_RightBracket, 250}, {Key_RightControl, Key_RightBracket, 250},
*/ */
SPACECADET_MAP_END SPACECADET_MAP_END};
};
map = initialmap; map = initialmap;
} }

@ -29,7 +29,8 @@
#include "kaleidoscope/plugin.h" // for Plugin #include "kaleidoscope/plugin.h" // for Plugin
#ifndef SPACECADET_MAP_END #ifndef SPACECADET_MAP_END
#define SPACECADET_MAP_END (kaleidoscope::plugin::SpaceCadet::KeyBinding) { Key_NoKey, Key_NoKey, 0 } #define SPACECADET_MAP_END \
(kaleidoscope::plugin::SpaceCadet::KeyBinding) { Key_NoKey, Key_NoKey, 0 }
#endif #endif
constexpr Key Key_SpaceCadetEnable = Key(kaleidoscope::ranges::SC_FIRST); constexpr Key Key_SpaceCadetEnable = Key(kaleidoscope::ranges::SC_FIRST);

@ -170,8 +170,7 @@ EventHandlerResult TapDance::afterEachCycle() {
} // namespace plugin } // namespace plugin
} // namespace kaleidoscope } // namespace kaleidoscope
__attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, __attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, kaleidoscope::plugin::TapDance::ActionType tap_dance_action) {
kaleidoscope::plugin::TapDance::ActionType tap_dance_action) {
} }
kaleidoscope::plugin::TapDance TapDance; kaleidoscope::plugin::TapDance TapDance;

@ -33,8 +33,7 @@
#define tapDanceActionKeys(tap_count, tap_dance_action, ...) ({ \ #define tapDanceActionKeys(tap_count, tap_dance_action, ...) ({ \
static const Key __k[] PROGMEM = {__VA_ARGS__}; \ static const Key __k[] PROGMEM = {__VA_ARGS__}; \
TapDance.actionKeys(tap_count, tap_dance_action, \ TapDance.actionKeys(tap_count, tap_dance_action, sizeof(__k) / sizeof(Key), &__k[0]); \
sizeof (__k) / sizeof (Key), &__k[0]); \
}) })
namespace kaleidoscope { namespace kaleidoscope {
@ -82,13 +81,11 @@ class TapDance : public kaleidoscope::Plugin {
static uint8_t tap_count_; static uint8_t tap_count_;
void flushQueue(KeyAddr ignored_addr = KeyAddr::none()); void flushQueue(KeyAddr ignored_addr = KeyAddr::none());
}; };
} // namespace plugin } // namespace plugin
} // namespace kaleidoscope } // namespace kaleidoscope
void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, kaleidoscope::plugin::TapDance::ActionType tap_dance_action);
kaleidoscope::plugin::TapDance::ActionType tap_dance_action);
extern kaleidoscope::plugin::TapDance TapDance; extern kaleidoscope::plugin::TapDance TapDance;

@ -37,8 +37,7 @@ TypingBreaks::settings_t TypingBreaks::settings = {
.lock_time_out = 2700, // 45m .lock_time_out = 2700, // 45m
.lock_length = 300, // 5m .lock_length = 300, // 5m
.left_hand_max_keys = 0, .left_hand_max_keys = 0,
.right_hand_max_keys = 0 .right_hand_max_keys = 0};
};
bool TypingBreaks::keyboard_locked_{false}; bool TypingBreaks::keyboard_locked_{false};
uint32_t TypingBreaks::session_start_time_; uint32_t TypingBreaks::session_start_time_;

@ -48,6 +48,7 @@ class Unicode : public kaleidoscope::Plugin {
static Key getLinuxKey() { static Key getLinuxKey() {
return linux_key_; return linux_key_;
} }
private: private:
static Key linux_key_; static Key linux_key_;
static uint8_t input_delay_; static uint8_t input_delay_;

@ -31,6 +31,7 @@ class WinKeyToggle: public kaleidoscope::Plugin {
void toggle() { void toggle() {
enabled_ = !enabled_; enabled_ = !enabled_;
} }
private: private:
static bool enabled_; static bool enabled_;
}; };

@ -53,18 +53,15 @@ void setup();
struct { \ struct { \
static_assert(CONVERT_TO_KEY(KEY) != kaleidoscope::bad_keymap_key, \ static_assert(CONVERT_TO_KEY(KEY) != kaleidoscope::bad_keymap_key, \
"Bad key definition: \'" #KEY "\'"); \ "Bad key definition: \'" #KEY "\'"); \
} \ }){}, \
){}, \ CONVERT_TO_KEY(KEY))
CONVERT_TO_KEY(KEY) \
)
#ifdef PER_KEY_DATA_STACKED #ifdef PER_KEY_DATA_STACKED
#define KEYMAP_STACKED(...) \ #define KEYMAP_STACKED(...) \
{ \ { \
MAP_LIST( \ MAP_LIST( \
CONVERT_AND_CHECK_KEY, \ CONVERT_AND_CHECK_KEY, \
PER_KEY_DATA_STACKED(XXX, __VA_ARGS__) \ PER_KEY_DATA_STACKED(XXX, __VA_ARGS__)) \
) \
} }
#endif #endif
@ -74,8 +71,7 @@ void setup();
{ \ { \
MAP_LIST( \ MAP_LIST( \
CONVERT_AND_CHECK_KEY, \ CONVERT_AND_CHECK_KEY, \
PER_KEY_DATA(XXX, __VA_ARGS__) \ PER_KEY_DATA(XXX, __VA_ARGS__)) \
) \
} }
#endif #endif
@ -124,8 +120,7 @@ void setup();
#define xstr(a) str(a) #define xstr(a) str(a)
#define str(a) #a #define str(a) #a
static_assert(KALEIDOSCOPE_REQUIRED_API_VERSION == KALEIDOSCOPE_API_VERSION, static_assert(KALEIDOSCOPE_REQUIRED_API_VERSION == KALEIDOSCOPE_API_VERSION,
"Kaleidoscope API version mismatch! We have version " xstr(KALEIDOSCOPE_API_VERSION) "Kaleidoscope API version mismatch! We have version " xstr(KALEIDOSCOPE_API_VERSION) " available, but version " xstr(KALEIDOSCOPE_REQUIRED_API_VERSION) " is required.");
" available, but version " xstr(KALEIDOSCOPE_REQUIRED_API_VERSION) " is required.");
#endif #endif
// Use this function macro to register plugins with Kaleidoscope's // Use this function macro to register plugins with Kaleidoscope's

@ -40,7 +40,6 @@ constexpr _WidthType bitfieldSize(_WidthType n) {
class KeyAddrBitfield { class KeyAddrBitfield {
public: public:
static constexpr uint8_t size = KeyAddr::upper_limit; static constexpr uint8_t size = KeyAddr::upper_limit;
static constexpr uint8_t block_size = 8 * sizeof(uint8_t); static constexpr uint8_t block_size = 8 * sizeof(uint8_t);
static constexpr uint8_t total_blocks = bitfieldSize<uint8_t>(size); static constexpr uint8_t total_blocks = bitfieldSize<uint8_t>(size);
@ -100,7 +99,6 @@ class KeyAddrBitfield {
} }
private: private:
uint8_t data_[total_blocks] = {}; uint8_t data_[total_blocks] = {};
@ -173,7 +171,7 @@ class KeyAddrBitfield {
} __attribute__((packed)); // class KeyAddrBitfield { } __attribute__((packed)); // class KeyAddrBitfield {
} // namespace kaleidoscope { } // namespace kaleidoscope
// ================================================================================ // ================================================================================

@ -89,6 +89,7 @@ class KeyAddrMap {
++key_addr_; ++key_addr_;
return *this; return *this;
} }
private: private:
ThisType &map_; ThisType &map_;
KeyAddr key_addr_; KeyAddr key_addr_;

@ -30,11 +30,11 @@ struct KeyEvent {
public: public:
// Constructor for plugin use when regenerating an event with specific ID: // Constructor for plugin use when regenerating an event with specific ID:
KeyEvent(KeyAddr addr, uint8_t state, KeyEvent(KeyAddr addr, uint8_t state, Key key = Key_Undefined, KeyEventId id = last_id_)
Key key = Key_Undefined, KeyEventId id = last_id_)
: addr(addr), state(state), key(key), id_(id) {} : addr(addr), state(state), key(key), id_(id) {}
KeyEvent() : id_(last_id_) {} KeyEvent()
: id_(last_id_) {}
// For use by keyscanner creating a new event from a physical keyswitch toggle // For use by keyscanner creating a new event from a physical keyswitch toggle
// on or off. // on or off.

@ -97,7 +97,6 @@ class KeyEventTracker {
} }
return false; return false;
} }
}; };
} // namespace kaleidoscope } // namespace kaleidoscope

@ -25,11 +25,9 @@ namespace kaleidoscope {
template<uint8_t rows__, uint8_t cols__> template<uint8_t rows__, uint8_t cols__>
class MatrixAddr { class MatrixAddr {
private: private:
uint8_t offset_; uint8_t offset_;
public: public:
typedef MatrixAddr<rows__, cols__> ThisType; typedef MatrixAddr<rows__, cols__> ThisType;
static constexpr uint8_t rows = rows__; static constexpr uint8_t rows = rows__;
@ -43,7 +41,8 @@ class MatrixAddr {
"MatrixAddr<rows, cols> exceeds the supported total number \n" "MatrixAddr<rows, cols> exceeds the supported total number \n"
"of 255 keys"); "of 255 keys");
constexpr MatrixAddr() : offset_(invalid_state) {} constexpr MatrixAddr()
: offset_(invalid_state) {}
constexpr MatrixAddr(uint8_t row, uint8_t col) constexpr MatrixAddr(uint8_t row, uint8_t col)
: offset_(row * cols + col) {} : offset_(row * cols + col) {}
@ -240,8 +239,7 @@ bool operator!=(const MatrixAddr1__ & a1, const MatrixAddr2__ & a2) {
template<typename MatrixAddr1__, typename MatrixAddr2__> template<typename MatrixAddr1__, typename MatrixAddr2__>
bool operator>(const MatrixAddr1__ &a1, const MatrixAddr2__ &a2) { bool operator>(const MatrixAddr1__ &a1, const MatrixAddr2__ &a2) {
return (a1.row() > a2.row()) return (a1.row() > a2.row()) || ((a1.row() == a2.row()) && (a1.col() > a2.col()));
|| ((a1.row() == a2.row()) && (a1.col() > a2.col()));
} }
template<typename MatrixAddr1__, typename MatrixAddr2__> template<typename MatrixAddr1__, typename MatrixAddr2__>

@ -36,8 +36,7 @@ Runtime_::Runtime_(void) {
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void void Runtime_::setup(void) {
Runtime_::setup(void) {
// We are explicitly initializing the Serial port as early as possible to // We are explicitly initializing the Serial port as early as possible to
// (temporarily, hopefully) work around an issue on OSX. If we initialize // (temporarily, hopefully) work around an issue on OSX. If we initialize
// Serial too late, no matter what we do, we'll end up reading garbage from // Serial too late, no matter what we do, we'll end up reading garbage from
@ -60,8 +59,7 @@ Runtime_::setup(void) {
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void void Runtime_::loop(void) {
Runtime_::loop(void) {
millis_at_cycle_start_ = millis(); millis_at_cycle_start_ = millis();
kaleidoscope::Hooks::beforeEachCycle(); kaleidoscope::Hooks::beforeEachCycle();
@ -79,8 +77,7 @@ Runtime_::loop(void) {
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void void Runtime_::handleKeyswitchEvent(KeyEvent event) {
Runtime_::handleKeyswitchEvent(KeyEvent event) {
// This function strictly handles physical key events. Any event without a // This function strictly handles physical key events. Any event without a
// valid `KeyAddr` gets ignored. // valid `KeyAddr` gets ignored.
@ -123,8 +120,7 @@ Runtime_::handleKeyswitchEvent(KeyEvent event) {
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void void Runtime_::handleKeyEvent(KeyEvent event) {
Runtime_::handleKeyEvent(KeyEvent event) {
// For events that didn't begin with `handleKeyswitchEvent()`, we need to look // For events that didn't begin with `handleKeyswitchEvent()`, we need to look
// up the `Key` value from the keymap (maybe overridden by `live_keys`). // up the `Key` value from the keymap (maybe overridden by `live_keys`).
@ -191,8 +187,7 @@ Runtime_::handleKeyEvent(KeyEvent event) {
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void void Runtime_::prepareKeyboardReport(const KeyEvent &event) {
Runtime_::prepareKeyboardReport(const KeyEvent &event) {
// before building the new report, start clean // before building the new report, start clean
device().hid().keyboard().releaseAllKeys(); device().hid().keyboard().releaseAllKeys();
@ -220,8 +215,7 @@ Runtime_::prepareKeyboardReport(const KeyEvent &event) {
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void void Runtime_::addToReport(Key key) {
Runtime_::addToReport(Key key) {
// First, call any relevant plugin handlers, to give them a chance to add // First, call any relevant plugin handlers, to give them a chance to add
// other values to the HID report directly and/or to abort the automatic // other values to the HID report directly and/or to abort the automatic
// adding of keycodes below. // adding of keycodes below.
@ -252,8 +246,7 @@ Runtime_::addToReport(Key key) {
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void void Runtime_::sendKeyboardReport(const KeyEvent &event) {
Runtime_::sendKeyboardReport(const KeyEvent &event) {
// If the keycode for this key is already in the report, we need to send an // If the keycode for this key is already in the report, we need to send an
// extra report without that keycode in order to correctly process the // extra report without that keycode in order to correctly process the
// rollover. It might be better to exempt modifiers from this rule, but it's // rollover. It might be better to exempt modifiers from this rule, but it's

@ -134,7 +134,9 @@
#endif #endif
/* converting pins to ports */ /* converting pins to ports */
enum { PIN_OFFSET, DDR_OFFSET, PORT_OFFSET}; enum { PIN_OFFSET,
DDR_OFFSET,
PORT_OFFSET };
#define PIN_ADDRESS_MASK 0xF #define PIN_ADDRESS_MASK 0xF
@ -158,4 +160,3 @@ enum { PIN_OFFSET, DDR_OFFSET, PORT_OFFSET};
#define OUTPUT_TOGGLE(pin) (PORT_REG_FOR_PIN(pin) ^= (PIN_MASK_FOR_PIN(pin))) #define OUTPUT_TOGGLE(pin) (PORT_REG_FOR_PIN(pin) ^= (PIN_MASK_FOR_PIN(pin)))
#define READ_PIN(pin) (!!(PIN_REG_FOR_PIN(pin) & PIN_MASK_FOR_PIN(pin))) #define READ_PIN(pin) (!!(PIN_REG_FOR_PIN(pin) & PIN_MASK_FOR_PIN(pin)))

@ -57,8 +57,7 @@ void DefaultHIDReportConsumer::processHIDReport(
return; return;
} }
const HID_KeyboardReport_Data_t &report_data const HID_KeyboardReport_Data_t &report_data = *static_cast<const HID_KeyboardReport_Data_t *>(data);
= *static_cast<const HID_KeyboardReport_Data_t *>(data);
std::stringstream keypresses; std::stringstream keypresses;
bool anything = false; bool anything = false;

@ -24,9 +24,7 @@ namespace kaleidoscope {
class DefaultHIDReportConsumer { class DefaultHIDReportConsumer {
public: public:
static void processHIDReport(uint8_t id, const void *data, int len, int result);
static void processHIDReport(uint8_t id, const void *data,
int len, int result);
}; };
} // namespace kaleidoscope } // namespace kaleidoscope

@ -67,9 +67,12 @@ bool HID_::setup(USBSetup &setup) {
return true; return true;
} }
HID_::HID_(void) : PluggableUSBModule(1, 1, epType), HID_::HID_(void)
rootNode(NULL), descriptorSize(0), : PluggableUSBModule(1, 1, epType),
protocol(HID_REPORT_PROTOCOL), idle(1) { rootNode(NULL),
descriptorSize(0),
protocol(HID_REPORT_PROTOCOL),
idle(1) {
setReportData.reportId = 0; setReportData.reportId = 0;
setReportData.leds = 0; setReportData.leds = 0;
epType[0] = EP_TYPE_INTERRUPT_IN; epType[0] = EP_TYPE_INTERRUPT_IN;

@ -48,26 +48,22 @@ extern bool verboseOutputEnabled();
#ifdef KALEIDOSCOPE_HARDWARE_VIRTUAL_NO_LOGGING #ifdef KALEIDOSCOPE_HARDWARE_VIRTUAL_NO_LOGGING
template<typename... Args__> template<typename... Args__>
inline inline void log_debug(Args__ &&...args) {}
void log_debug(Args__&&... args) {}
template<typename... Args__> template<typename... Args__>
inline inline void log_info(Args__ &&...args) {}
void log_info(Args__&&... args) {}
#else // #ifdef KALEIDOSCOPE_HARDWARE_VIRTUAL_NO_LOGGING #else // #ifdef KALEIDOSCOPE_HARDWARE_VIRTUAL_NO_LOGGING
template<typename... Args__> template<typename... Args__>
inline inline void log_debug(Args__ &&...args) {
void log_debug(Args__&&... args) {
if (verboseOutputEnabled()) { if (verboseOutputEnabled()) {
fprintf(stdout, std::forward<Args__>(args)...); fprintf(stdout, std::forward<Args__>(args)...);
} }
} }
template<typename... Args__> template<typename... Args__>
inline inline void log_info(Args__ &&...args) {
void log_info(Args__&&... args) {
if (verboseOutputEnabled()) { if (verboseOutputEnabled()) {
fprintf(stdout, std::forward<Args__>(args)...); fprintf(stdout, std::forward<Args__>(args)...);
} }
@ -76,14 +72,12 @@ void log_info(Args__&&... args) {
#endif // #ifdef KALEIDOSCOPE_HARDWARE_VIRTUAL_NO_LOGGING #endif // #ifdef KALEIDOSCOPE_HARDWARE_VIRTUAL_NO_LOGGING
template<typename... Args__> template<typename... Args__>
inline inline void log_error(Args__ &&...args) {
void log_error(Args__&&... args) {
fprintf(stderr, std::forward<Args__>(args)...); fprintf(stderr, std::forward<Args__>(args)...);
} }
template<typename... Args__> template<typename... Args__>
inline inline void log_critical(Args__ &&...args) {
void log_critical(Args__&&... args) {
fprintf(stderr, std::forward<Args__>(args)...); fprintf(stderr, std::forward<Args__>(args)...);
} }

@ -203,8 +203,7 @@ void VirtualKeyScanner::readMatrix() {
} else { } else {
key_addr = KeyAddr( key_addr = KeyAddr(
(uint8_t)std::stoi(token.substr(1, commapos - 1)), (uint8_t)std::stoi(token.substr(1, commapos - 1)),
(uint8_t)std::stoi(token.substr(commapos + 1, token.length() - commapos - 1)) (uint8_t)std::stoi(token.substr(commapos + 1, token.length() - commapos - 1)));
);
if (!key_addr.isValid()) { if (!key_addr.isValid()) {
log_error("Bad coordinates: %s\n", token.c_str()); log_error("Bad coordinates: %s\n", token.c_str());
@ -223,9 +222,8 @@ void VirtualKeyScanner::readMatrix() {
} }
keystates_[key_addr.toInt()] = keystates_[key_addr.toInt()] =
(mode == M_DOWN) ? KeyState::Pressed : (mode == M_DOWN) ? KeyState::Pressed : (mode == M_UP) ? KeyState::NotPressed
(mode == M_UP) ? KeyState::NotPressed : : KeyState::Tap;
KeyState::Tap;
} }
} }
} }
@ -285,7 +283,6 @@ uint8_t VirtualKeyScanner::pressedKeyswitchCount() const {
bool VirtualKeyScanner::isKeyswitchPressed(KeyAddr key_addr) const { bool VirtualKeyScanner::isKeyswitchPressed(KeyAddr key_addr) const {
if (keystates_[key_addr.toInt()] == KeyState::NotPressed) { if (keystates_[key_addr.toInt()] == KeyState::NotPressed) {
return false; return false;
} }
return true; return true;
} }
@ -296,7 +293,6 @@ uint8_t VirtualKeyScanner::previousPressedKeyswitchCount() const {
bool VirtualKeyScanner::wasKeyswitchPressed(KeyAddr key_addr) const { bool VirtualKeyScanner::wasKeyswitchPressed(KeyAddr key_addr) const {
if (keystates_prev_[key_addr.toInt()] == KeyState::NotPressed) { if (keystates_prev_[key_addr.toInt()] == KeyState::NotPressed) {
return false; return false;
} }
return true; return true;
@ -364,5 +360,4 @@ cRGB VirtualLEDDriver::getCrgbAt(uint8_t i) const {
} // namespace kaleidoscope } // namespace kaleidoscope
#endif // ifdef KALEIDOSCOPE_VIRTUAL_BUILD #endif // ifdef KALEIDOSCOPE_VIRTUAL_BUILD

@ -42,12 +42,10 @@ namespace virt {
class VirtualKeyScanner class VirtualKeyScanner
: public kaleidoscope::driver::keyscanner::Base<kaleidoscope::DeviceProps::KeyScannerProps> { : public kaleidoscope::driver::keyscanner::Base<kaleidoscope::DeviceProps::KeyScannerProps> {
private: private:
typedef VirtualKeyScanner ThisType; typedef VirtualKeyScanner ThisType;
typedef kaleidoscope::driver::keyscanner::Base<kaleidoscope::DeviceProps::KeyScannerProps> ParentType; typedef kaleidoscope::driver::keyscanner::Base<kaleidoscope::DeviceProps::KeyScannerProps> ParentType;
public: public:
typedef typename ParentType::KeyAddr KeyAddr; typedef typename ParentType::KeyAddr KeyAddr;
enum class KeyState { enum class KeyState {
@ -83,11 +81,9 @@ class VirtualKeyScanner
KeyState getKeystate(KeyAddr keyAddr) const; KeyState getKeystate(KeyAddr keyAddr) const;
private: private:
bool anythingHeld(); bool anythingHeld();
private: private:
uint8_t n_pressed_switches_, uint8_t n_pressed_switches_,
n_previously_pressed_switches_; n_previously_pressed_switches_;
@ -95,13 +91,11 @@ class VirtualKeyScanner
KeyState keystates_[matrix_rows * matrix_columns]; // NOLINT(runtime/arrays) KeyState keystates_[matrix_rows * matrix_columns]; // NOLINT(runtime/arrays)
KeyState keystates_prev_[matrix_rows * matrix_columns]; // NOLINT(runtime/arrays) KeyState keystates_prev_[matrix_rows * matrix_columns]; // NOLINT(runtime/arrays)
}; };
class VirtualLEDDriver class VirtualLEDDriver
: public driver::led::Base<kaleidoscope::DeviceProps::LEDDriverProps> { : public driver::led::Base<kaleidoscope::DeviceProps::LEDDriverProps> {
public: public:
typedef driver::led::Base<kaleidoscope::DeviceProps::LEDDriverProps> typedef driver::led::Base<kaleidoscope::DeviceProps::LEDDriverProps>
ParentType; ParentType;
@ -113,7 +107,6 @@ class VirtualLEDDriver
cRGB getCrgbAt(uint8_t i) const; cRGB getCrgbAt(uint8_t i) const;
private: private:
cRGB led_states_[led_count]; // NOLINT(runtime/arrays) cRGB led_states_[led_count]; // NOLINT(runtime/arrays)
}; };
@ -149,7 +142,6 @@ struct VirtualProps : public kaleidoscope::DeviceProps {
class VirtualDevice class VirtualDevice
: public kaleidoscope::device::Base<device::virt::VirtualProps> { : public kaleidoscope::device::Base<device::virt::VirtualProps> {
public: public:
auto serialPort() -> decltype(Serial) & { auto serialPort() -> decltype(Serial) & {
return Serial; return Serial;
} }

@ -25,23 +25,7 @@ namespace driver {
namespace color { namespace color {
const uint8_t PROGMEM gamma_correction[] = { const uint8_t PROGMEM gamma_correction[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50, 51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89, 90, 92, 93, 95, 96, 98, 99, 101, 102, 104, 105, 107, 109, 110, 112, 114, 115, 117, 119, 120, 122, 124, 126, 127, 129, 131, 133, 135, 137, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 167, 169, 171, 173, 175, 177, 180, 182, 184, 186, 189, 191, 193, 196, 198, 200, 203, 205, 208, 210, 213, 215, 218, 220, 223, 225, 228, 231, 233, 236, 239, 241, 244, 247, 249, 252, 255};
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5,
5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10,
10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16,
17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25,
25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
37, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50,
51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68,
69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89,
90, 92, 93, 95, 96, 98, 99, 101, 102, 104, 105, 107, 109, 110, 112, 114,
115, 117, 119, 120, 122, 124, 126, 127, 129, 131, 133, 135, 137, 138, 140, 142,
144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 167, 169, 171, 173, 175,
177, 180, 182, 184, 186, 189, 191, 193, 196, 198, 200, 203, 205, 208, 210, 213,
215, 218, 220, 223, 225, 228, 231, 233, 236, 239, 241, 244, 247, 249, 252, 255
};
} }
} // namespace driver } // namespace driver

@ -45,6 +45,7 @@ template <typename _Props>
class AbsoluteMouse { class AbsoluteMouse {
private: private:
typename _Props::AbsoluteMouse absolute_mouse_; typename _Props::AbsoluteMouse absolute_mouse_;
public: public:
AbsoluteMouse() {} AbsoluteMouse() {}

@ -135,6 +135,7 @@ class Keyboard {
typename _Props::NKROKeyboard nkro_keyboard_; typename _Props::NKROKeyboard nkro_keyboard_;
typename _Props::ConsumerControl consumer_control_; typename _Props::ConsumerControl consumer_control_;
typename _Props::SystemControl system_control_; typename _Props::SystemControl system_control_;
public: public:
Keyboard() {} Keyboard() {}
@ -330,7 +331,6 @@ class Keyboard {
releaseRawKey(Key_LeftGui); releaseRawKey(Key_LeftGui);
} }
} }
}; };
} // namespace base } // namespace base

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save