Added handbremse variable (statusdisplay.cpp)
This commit is contained in:
@ -327,6 +327,7 @@ set(sources
|
||||
esptexthelpers.cpp
|
||||
feedbackparser.cpp
|
||||
globals.cpp
|
||||
handbremse.cpp
|
||||
icons/alert.cpp
|
||||
icons/battery.cpp
|
||||
icons/bluetooth.cpp
|
||||
|
@ -70,7 +70,7 @@ void StatusDisplay::initScreen()
|
||||
void StatusDisplay::redraw()
|
||||
{
|
||||
Base::redraw();
|
||||
if (modes::defaultMode.overrideHandbremse)
|
||||
if (modes::defaultMode.overrideHandbremse || handbremse::handbremseAngezogen)
|
||||
tft.fillRect(0, 0, tft.width(), 2, TFT_RED);
|
||||
else
|
||||
tft.fillRect(0, 0, tft.width(), 2, TFT_BLACK);
|
||||
|
4
main/handbremse.cpp
Normal file
4
main/handbremse.cpp
Normal file
@ -0,0 +1,4 @@
|
||||
#include "handbremse.h"
|
||||
namespace handbremse {
|
||||
bool handbremseAngezogen{false};
|
||||
} // namespace
|
@ -11,3 +11,7 @@
|
||||
x(OPENMODE) \
|
||||
x(SPEED_0)
|
||||
DECLARE_TYPESAFE_ENUM(HandbremseMode, : uint8_t, HandbremseModeValues)
|
||||
|
||||
namespace handbremse {
|
||||
extern bool handbremseAngezogen;
|
||||
} // namespace
|
||||
|
@ -69,6 +69,7 @@ void DefaultMode::update()
|
||||
}
|
||||
else if ((abs(avgSpeedKmh) <= 2) && (overrideHandbremse || espchrono::ago(*m_stillSince) >= espchrono::milliseconds32(settings.handbremse.triggerTimeout)))
|
||||
{
|
||||
handbremse::handbremseAngezogen = true;
|
||||
fixCommonParams();
|
||||
|
||||
for (bobbycar::protocol::serial::MotorState &motor : motors())
|
||||
@ -95,6 +96,7 @@ void DefaultMode::update()
|
||||
else
|
||||
{
|
||||
hell:
|
||||
handbremse::handbremseAngezogen = false;
|
||||
float pwm;
|
||||
if (gas_processed >= settings.defaultMode.add_schwelle)
|
||||
{
|
||||
|
Reference in New Issue
Block a user