@ -158,6 +158,7 @@ struct CenterOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t
|
|||||||
struct SmallOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.smallOffset; } };
|
struct SmallOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.smallOffset; } };
|
||||||
struct BigOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.bigOffset; } };
|
struct BigOffsetAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.bigOffset; } };
|
||||||
struct DeziampereAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.deziampere; } };
|
struct DeziampereAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.ledstrip.deziampere; } };
|
||||||
|
struct EnableBeepWhenBlinkAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.ledstrip.enableBeepWhenBlink; } };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct LockscreenAllowPresetSwitchAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.lockscreen.allowPresetSwitch; } };
|
struct LockscreenAllowPresetSwitchAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.lockscreen.allowPresetSwitch; } };
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// local includes
|
// local includes
|
||||||
#include "menudisplay.h"
|
#include "menudisplay.h"
|
||||||
#include "menuitem.h"
|
#include "menuitem.h"
|
||||||
|
@ -39,6 +39,11 @@ void updateLedStrip()
|
|||||||
|
|
||||||
if (espchrono::millis_clock::now().time_since_epoch() % 750ms < 375ms)
|
if (espchrono::millis_clock::now().time_since_epoch() % 750ms < 375ms)
|
||||||
{
|
{
|
||||||
|
if (settings.ledstrip.enableBeepWhenBlink)
|
||||||
|
{
|
||||||
|
for (Controller &controller : controllers)
|
||||||
|
controller.command.buzzer.freq = 3;
|
||||||
|
}
|
||||||
auto color = CRGB{255, 255, 0};
|
auto color = CRGB{255, 255, 0};
|
||||||
const auto center = (std::begin(leds) + (leds.size() / 2) + settings.ledstrip.centerOffset);
|
const auto center = (std::begin(leds) + (leds.size() / 2) + settings.ledstrip.centerOffset);
|
||||||
|
|
||||||
@ -53,6 +58,12 @@ void updateLedStrip()
|
|||||||
if (blinkAnimation != LEDSTRIP_OVERWRITE_BLINKRIGHT)
|
if (blinkAnimation != LEDSTRIP_OVERWRITE_BLINKRIGHT)
|
||||||
std::fill(center + settings.ledstrip.smallOffset, center + settings.ledstrip.bigOffset, color);
|
std::fill(center + settings.ledstrip.smallOffset, center + settings.ledstrip.bigOffset, color);
|
||||||
#endif
|
#endif
|
||||||
|
} else {
|
||||||
|
if (settings.ledstrip.enableBeepWhenBlink)
|
||||||
|
{
|
||||||
|
for (Controller &controller : controllers)
|
||||||
|
controller.command.buzzer.freq = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -232,12 +232,12 @@ constexpr Settings::Ledstrip defaultLedstrip {
|
|||||||
.smallOffset = 4,
|
.smallOffset = 4,
|
||||||
.bigOffset = 10,
|
.bigOffset = 10,
|
||||||
.deziampere = 30,
|
.deziampere = 30,
|
||||||
|
.enableBeepWhenBlink = false,
|
||||||
#ifdef LEDSTRIP_ANIMATION_DEFAULT
|
#ifdef LEDSTRIP_ANIMATION_DEFAULT
|
||||||
.animationType = LEDSTRIP_ANIMATION_DEFAULT
|
.animationType = LEDSTRIP_ANIMATION_DEFAULT
|
||||||
#else
|
#else
|
||||||
.animationType = LEDSTRIP_ANIMATION_TYPE_DEFAULTRAINBOW
|
.animationType = LEDSTRIP_ANIMATION_TYPE_DEFAULTRAINBOW
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -161,6 +161,7 @@ struct Settings
|
|||||||
int16_t smallOffset;
|
int16_t smallOffset;
|
||||||
int16_t bigOffset;
|
int16_t bigOffset;
|
||||||
int16_t deziampere;
|
int16_t deziampere;
|
||||||
|
bool enableBeepWhenBlink;
|
||||||
int16_t animationType;
|
int16_t animationType;
|
||||||
} ledstrip;
|
} ledstrip;
|
||||||
#endif
|
#endif
|
||||||
@ -260,8 +261,9 @@ void Settings::executeForEveryCommonSetting(T &&callable)
|
|||||||
callable("centerOffset", ledstrip.centerOffset);
|
callable("centerOffset", ledstrip.centerOffset);
|
||||||
callable("smallOffset", ledstrip.smallOffset);
|
callable("smallOffset", ledstrip.smallOffset);
|
||||||
callable("bigOffset", ledstrip.bigOffset);
|
callable("bigOffset", ledstrip.bigOffset);
|
||||||
//callable("deziampere", ledstrip.deziampere);
|
callable("deziampere", ledstrip.deziampere);
|
||||||
callable("animationType", ledstrip.animationType);
|
callable("beeppwhenblink", ledstrip.enableBeepWhenBlink);
|
||||||
|
// callable("animationType", ledstrip.animationType);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
callable("lockAlwPresetSw", lockscreen.allowPresetSwitch);
|
callable("lockAlwPresetSw", lockscreen.allowPresetSwitch);
|
||||||
|
@ -249,6 +249,7 @@ constexpr char TEXT_CENTEROFFSET[] = "Center Offset";
|
|||||||
constexpr char TEXT_SMALLOFFSET[] = "Small Offset";
|
constexpr char TEXT_SMALLOFFSET[] = "Small Offset";
|
||||||
constexpr char TEXT_BIGOFFSET[] = "Big Offset";
|
constexpr char TEXT_BIGOFFSET[] = "Big Offset";
|
||||||
constexpr char TEXT_LEDSTRIP_MILLIAMP[] = "Ledstrip 0.1A";
|
constexpr char TEXT_LEDSTRIP_MILLIAMP[] = "Ledstrip 0.1A";
|
||||||
|
constexpr char TEXT_BLINKBEEP[] = "Blink Beep";
|
||||||
//constexpr char TEXT_BACK[] = "Back";
|
//constexpr char TEXT_BACK[] = "Back";
|
||||||
|
|
||||||
//LedstripSelectAnimationMenu
|
//LedstripSelectAnimationMenu
|
||||||
|
Reference in New Issue
Block a user