mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-29 22:20:37 +00:00
a lot of thread housekeeping. Switch them off when not needed / disabled.
This commit is contained in:
@@ -54,7 +54,7 @@ int32_t RotaryEncoderInterruptBase::runOnce()
|
||||
|
||||
this->action = ROTARY_ACTION_NONE;
|
||||
|
||||
return 30000; // TODO: technically this can be MAX_INT
|
||||
return INT32_MAX;
|
||||
}
|
||||
|
||||
void RotaryEncoderInterruptBase::intPressHandler()
|
||||
|
||||
@@ -7,7 +7,7 @@ enum RotaryEncoderInterruptBaseStateType { ROTARY_EVENT_OCCURRED, ROTARY_EVENT_C
|
||||
|
||||
enum RotaryEncoderInterruptBaseActionType { ROTARY_ACTION_NONE, ROTARY_ACTION_PRESSED, ROTARY_ACTION_CW, ROTARY_ACTION_CCW };
|
||||
|
||||
class RotaryEncoderInterruptBase : public Observable<const InputEvent *>, private concurrency::OSThread
|
||||
class RotaryEncoderInterruptBase : public Observable<const InputEvent *>, public concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
explicit RotaryEncoderInterruptBase(const char *name);
|
||||
|
||||
@@ -9,6 +9,8 @@ void RotaryEncoderInterruptImpl1::init()
|
||||
{
|
||||
if (!moduleConfig.canned_message.rotary1_enabled) {
|
||||
// Input device is disabled.
|
||||
setInterval(INT32_MAX);
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ void CardKbI2cImpl::init()
|
||||
if (cardkb_found != CARDKB_ADDR)
|
||||
{
|
||||
// Input device is not detected.
|
||||
setInterval(INT32_MAX);
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
class KbI2cBase :
|
||||
public Observable<const InputEvent *>,
|
||||
private concurrency::OSThread
|
||||
public concurrency::OSThread
|
||||
{
|
||||
public:
|
||||
explicit KbI2cBase(const char *name);
|
||||
|
||||
Reference in New Issue
Block a user