mirror of
https://github.com/meshtastic/firmware.git
synced 2025-10-29 07:36:46 +00:00
Format
This commit is contained in:
parent
15a22ee50d
commit
2c6414827e
@ -32,8 +32,7 @@
|
||||
#define _TCA8418_REG_LCK_EC_KLEC_0 0x01 // Key event count bit 0
|
||||
|
||||
TCA8418KeyboardBase::TCA8418KeyboardBase(uint8_t rows, uint8_t columns)
|
||||
: rows(rows), columns(columns), queue(""), m_wire(nullptr), m_addr(0), readCallback(nullptr),
|
||||
writeCallback(nullptr)
|
||||
: rows(rows), columns(columns), queue(""), m_wire(nullptr), m_addr(0), readCallback(nullptr), writeCallback(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -46,9 +45,7 @@ void TCA8418KeyboardBase::begin(uint8_t addr, TwoWire *wire)
|
||||
|
||||
#ifdef KB_INT
|
||||
interruptInstance = this;
|
||||
auto interruptHandler = []() {
|
||||
interruptInstance->notifyObservers(interruptInstance);
|
||||
};
|
||||
auto interruptHandler = []() { interruptInstance->notifyObservers(interruptInstance); };
|
||||
|
||||
::pinMode(KB_INT, INPUT_PULLUP);
|
||||
attachInterrupt(KB_INT, interruptHandler, FALLING);
|
||||
@ -309,7 +306,7 @@ void TCA8418KeyboardBase::disableInterrupts()
|
||||
writeRegister(TCA8418_REG_CFG, value);
|
||||
};
|
||||
|
||||
TCA8418KeyboardBase* TCA8418KeyboardBase::interruptInstance;
|
||||
TCA8418KeyboardBase *TCA8418KeyboardBase::interruptInstance;
|
||||
|
||||
void TCA8418KeyboardBase::enableMatrixOverflow()
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// Based on the MPR121 Keyboard and Adafruit TCA8418 library
|
||||
#include "configuration.h"
|
||||
#include <Wire.h>
|
||||
#include "kbInterrupt.h"
|
||||
#include <Wire.h>
|
||||
|
||||
/**
|
||||
* @brief TCA8418KeyboardBase is the base class for TCA8418 keyboard handling.
|
||||
@ -143,7 +143,7 @@ class TCA8418KeyboardBase : public KbInterruptObservable
|
||||
// enable / disable interrupts for matrix and GPI pins
|
||||
void enableInterrupts();
|
||||
void disableInterrupts();
|
||||
static TCA8418KeyboardBase* interruptInstance;
|
||||
static TCA8418KeyboardBase *interruptInstance;
|
||||
|
||||
// ignore key events when FIFO buffer is full or not.
|
||||
void enableMatrixOverflow();
|
||||
|
||||
@ -62,7 +62,8 @@ static const uint8_t TDeckProTapMap[_TCA8418_NUM_KEYS][5] = {
|
||||
static bool TDeckProHeldMap[_TCA8418_NUM_KEYS] = {};
|
||||
|
||||
TDeckProKeyboard::TDeckProKeyboard()
|
||||
: TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), modifierFlag(0), pressedKeysCount(0), onlyOneModifierPressed(false), persistedPreviousModifier(false)
|
||||
: TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), modifierFlag(0), pressedKeysCount(0), onlyOneModifierPressed(false),
|
||||
persistedPreviousModifier(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ class TDeckProKeyboard : public TCA8418KeyboardBase
|
||||
void toggleBacklight(void);
|
||||
|
||||
private:
|
||||
uint8_t modifierFlag; // Flag to indicate if a modifier key is pressed
|
||||
uint8_t modifierFlag; // Flag to indicate if a modifier key is pressed
|
||||
uint8_t pressedKeysCount;
|
||||
bool onlyOneModifierPressed;
|
||||
bool persistedPreviousModifier;
|
||||
|
||||
@ -67,7 +67,8 @@ static const uint8_t TLoraPagerTapMap[_TCA8418_NUM_KEYS][3] = {
|
||||
static bool TLoraPagerHeldMap[_TCA8418_NUM_KEYS] = {};
|
||||
|
||||
TLoraPagerKeyboard::TLoraPagerKeyboard()
|
||||
: TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), modifierFlag(0), pressedKeysCount(0), onlyOneModifierPressed(false), persistedPreviousModifier(false)
|
||||
: TCA8418KeyboardBase(_TCA8418_ROWS, _TCA8418_COLS), modifierFlag(0), pressedKeysCount(0), onlyOneModifierPressed(false),
|
||||
persistedPreviousModifier(false)
|
||||
{
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
|
||||
ledcAttach(KB_BL_PIN, LEDC_BACKLIGHT_FREQ, LEDC_BACKLIGHT_BIT_WIDTH);
|
||||
|
||||
@ -19,7 +19,7 @@ class TLoraPagerKeyboard : public TCA8418KeyboardBase
|
||||
void toggleBacklight(bool off = false);
|
||||
|
||||
private:
|
||||
uint8_t modifierFlag; // Flag to indicate if a modifier key is pressed
|
||||
uint8_t modifierFlag; // Flag to indicate if a modifier key is pressed
|
||||
uint8_t pressedKeysCount;
|
||||
bool onlyOneModifierPressed;
|
||||
bool persistedPreviousModifier;
|
||||
|
||||
@ -2,10 +2,10 @@
|
||||
|
||||
#include "Observer.h"
|
||||
|
||||
class KbInterruptObservable : public Observable<KbInterruptObservable*>
|
||||
class KbInterruptObservable : public Observable<KbInterruptObservable *>
|
||||
{
|
||||
};
|
||||
|
||||
class KbInterruptObserver : public Observer<KbInterruptObservable*>
|
||||
class KbInterruptObserver : public Observer<KbInterruptObservable *>
|
||||
{
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user