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