removed uneeded debug parameters and preparations for tempomat
This commit is contained in:
Submodule components/bobbycar-protocol updated: 1acdbfe14e...a331746ede
Submodule components/cpputils updated: 79a7f4ef85...89bff1a8dc
Submodule components/espcpputils updated: a504262f39...3dc1efd38d
Submodule components/espwifistack updated: 04ed8200f5...581b478de0
20
main/can.h
20
main/can.h
@ -332,9 +332,9 @@ void sendCanCommands()
|
||||
front.command.buzzer.pattern != lastValues.front.pattern ||
|
||||
back.command.buzzer.freq != lastValues.back.freq ||
|
||||
back.command.buzzer.pattern != lastValues.back.pattern)
|
||||
i = 8;
|
||||
else if (buttonLeds != lastValues.buttonLeds)
|
||||
i = 10;
|
||||
else if (buttonLeds != lastValues.buttonLeds)
|
||||
i = 12;
|
||||
|
||||
switch (i++)
|
||||
{
|
||||
@ -387,6 +387,18 @@ void sendCanCommands()
|
||||
send(MotorController<true, true>::Command::PhaseAdvMax, back.command.right.phaseAdvMax);
|
||||
break;
|
||||
case 8:
|
||||
send(MotorController<false, false>::Command::CruiseCtrlEna, front.command.left.cruiseCtrlEna);
|
||||
send(MotorController<false, true>::Command::CruiseCtrlEna, front.command.right.cruiseCtrlEna);
|
||||
send(MotorController<true, false>::Command::CruiseCtrlEna, back.command.left.cruiseCtrlEna);
|
||||
send(MotorController<true, true>::Command::CruiseCtrlEna, back.command.right.cruiseCtrlEna);
|
||||
break;
|
||||
case 9:
|
||||
send(MotorController<false, false>::Command::CruiseMotTgt, front.command.left.nCruiseMotTgt);
|
||||
send(MotorController<false, true>::Command::CruiseMotTgt, front.command.right.nCruiseMotTgt);
|
||||
send(MotorController<true, false>::Command::CruiseMotTgt, back.command.left.nCruiseMotTgt);
|
||||
send(MotorController<true, true>::Command::CruiseMotTgt, back.command.right.nCruiseMotTgt);
|
||||
break;
|
||||
case 10:
|
||||
if (send(MotorController<false, false>::Command::BuzzerFreq, front.command.buzzer.freq) == ESP_OK)
|
||||
lastValues.front.freq = front.command.buzzer.freq;
|
||||
// if (send(MotorController<false, true>::Command::BuzzerFreq, front.command.buzzer.freq) == ESP_OK)
|
||||
@ -404,7 +416,7 @@ void sendCanCommands()
|
||||
// if (send(MotorController<true, true>::Command::BuzzerPattern, back.command.buzzer.pattern) == ESP_OK)
|
||||
// lastValues.back.pattern = back.command.buzzer.pattern;
|
||||
break;
|
||||
case 9:
|
||||
case 11:
|
||||
send(MotorController<false, false>::Command::Led, front.command.led);
|
||||
//send(MotorController<false, true>::Command::Led, front.command.led);
|
||||
send(MotorController<true, false>::Command::Led, back.command.led);
|
||||
@ -414,7 +426,7 @@ void sendCanCommands()
|
||||
send(MotorController<true, false>::Command::Poweroff, back.command.poweroff);
|
||||
//send(MotorController<true, true>::Command::Poweroff, back.command.poweroff);
|
||||
break;
|
||||
case 10:
|
||||
case 12:
|
||||
if (send(Boardcomputer::Feedback::ButtonLeds, buttonLeds) == ESP_OK)
|
||||
lastValues.buttonLeds = buttonLeds;
|
||||
[[fallthrough]];
|
||||
|
@ -15,10 +15,10 @@ struct ControllerTexts
|
||||
ControllerTexts() = delete;
|
||||
~ControllerTexts() = delete;
|
||||
|
||||
struct BuzzerFreqText : public virtual TextInterface { public: std::string text() const override { return "buzzerFreq: " + std::to_string(controller::get().command.buzzer.freq); } };
|
||||
struct BuzzerPatternText : public virtual TextInterface { public: std::string text() const override { return "buzzerPattern: " + std::to_string(controller::get().command.buzzer.pattern); } };
|
||||
struct PoweroffText : public virtual TextInterface { public: std::string text() const override { return "poweroff: " + std::to_string(controller::get().command.poweroff); } };
|
||||
struct LedText : public virtual TextInterface { public: std::string text() const override { return "led: " + std::to_string(controller::get().command.led); } };
|
||||
struct BuzzerFreqText : public virtual TextInterface { public: std::string text() const override { return fmt::format("buzzerFreq: {}", controller::get().command.buzzer.freq); } };
|
||||
struct BuzzerPatternText : public virtual TextInterface { public: std::string text() const override { return fmt::format("buzzerPattern: {}", controller::get().command.buzzer.pattern); } };
|
||||
struct PoweroffText : public virtual TextInterface { public: std::string text() const override { return fmt::format("poweroff: {}", controller::get().command.poweroff); } };
|
||||
struct LedText : public virtual TextInterface { public: std::string text() const override { return fmt::format("led: {}", controller::get().command.led); } };
|
||||
|
||||
private:
|
||||
struct LeftCommandGetter { static const bobbycar::protocol::serial::MotorState &get() { return controller::get().command.left; } };
|
||||
@ -30,24 +30,26 @@ private:
|
||||
CommandTexts() = delete;
|
||||
~CommandTexts() = delete;
|
||||
|
||||
struct EnableText : public virtual TextInterface { public: std::string text() const override { return "enable: " + std::to_string(MotorStateGetter::get().enable); } };
|
||||
struct PwmText : public virtual TextInterface { public: std::string text() const override { return "pwm: " + std::to_string(MotorStateGetter::get().pwm); } };
|
||||
struct CtrlTypText : public virtual TextInterface { public: std::string text() const override { return "ctrlTyp: " + to_string(MotorStateGetter::get().ctrlTyp); } };
|
||||
struct CtrlModText : public virtual TextInterface { public: std::string text() const override { return "ctrlMod: " + to_string(MotorStateGetter::get().ctrlMod); } };
|
||||
struct IMotMaxText : public virtual TextInterface { public: std::string text() const override { return "iMotMax: " + std::to_string(MotorStateGetter::get().iMotMax); } };
|
||||
struct IDcMaxText : public virtual TextInterface { public: std::string text() const override { return "iDcMax: " + std::to_string(MotorStateGetter::get().iDcMax); } };
|
||||
struct NMotMaxText : public virtual TextInterface { public: std::string text() const override { return "nMotMax: " + std::to_string(MotorStateGetter::get().nMotMax); } };
|
||||
struct FieldWeakMaxText : public virtual TextInterface { public: std::string text() const override { return "fieldWeakMax: " + std::to_string(MotorStateGetter::get().fieldWeakMax); } };
|
||||
struct PhaseAdvMaxText : public virtual TextInterface { public: std::string text() const override { return "phaseAdvMax: " + std::to_string(MotorStateGetter::get().phaseAdvMax); } };
|
||||
struct EnableText : public virtual TextInterface { public: std::string text() const override { return fmt::format("enable: {}", MotorStateGetter::get().enable); } };
|
||||
struct PwmText : public virtual TextInterface { public: std::string text() const override { return fmt::format("pwm: {}", MotorStateGetter::get().pwm); } };
|
||||
struct CtrlTypText : public virtual TextInterface { public: std::string text() const override { return fmt::format("ctrlTyp: {}", to_string(MotorStateGetter::get().ctrlTyp)); } };
|
||||
struct CtrlModText : public virtual TextInterface { public: std::string text() const override { return fmt::format("ctrlMod: {}", to_string(MotorStateGetter::get().ctrlMod)); } };
|
||||
struct IMotMaxText : public virtual TextInterface { public: std::string text() const override { return fmt::format("iMotMax: {}", MotorStateGetter::get().iMotMax); } };
|
||||
struct IDcMaxText : public virtual TextInterface { public: std::string text() const override { return fmt::format("iDcMax: {}", MotorStateGetter::get().iDcMax); } };
|
||||
struct NMotMaxText : public virtual TextInterface { public: std::string text() const override { return fmt::format("nMotMax: {}", MotorStateGetter::get().nMotMax); } };
|
||||
struct FieldWeakMaxText : public virtual TextInterface { public: std::string text() const override { return fmt::format("fieldWeakMax: {}", MotorStateGetter::get().fieldWeakMax); } };
|
||||
struct PhaseAdvMaxText : public virtual TextInterface { public: std::string text() const override { return fmt::format("phaseAdvMax: {}", MotorStateGetter::get().phaseAdvMax); } };
|
||||
struct CruiseCtrlEnaText : public virtual TextInterface { public: std::string text() const override { return fmt::format("cruiseCtrlEna: {}", MotorStateGetter::get().cruiseCtrlEna); } };
|
||||
struct NCruiseMotTgtText : public virtual TextInterface { public: std::string text() const override { return fmt::format("nCruiseMotTgt: {}", MotorStateGetter::get().nCruiseMotTgt); } };
|
||||
};
|
||||
|
||||
public:
|
||||
using LeftCommand = CommandTexts<LeftCommandGetter>;
|
||||
using RightCommand = CommandTexts<LeftCommandGetter>;
|
||||
|
||||
struct BatVoltageText : public virtual TextInterface { public: std::string text() const override { std::string line{"batVoltage: "}; if (controller::get().feedbackValid) line += std::to_string(controller::get().feedback.batVoltage); return line; } };
|
||||
//struct BatVoltageText : public virtual TextInterface { public: std::string text() const override { std::string line{"batVoltage: "}; if (controller::get().feedbackValid) line += std::to_string(controller::get().feedback.batVoltage); return line; } };
|
||||
struct BatVoltageFixedText : public virtual TextInterface { public: std::string text() const override { std::string line{"batVoltage: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}V", fixBatVoltage(controller::get().feedback.batVoltage)); return line; } };
|
||||
struct BoardTempText : public virtual TextInterface { public: std::string text() const override { std::string line{"boardTemp: "}; if (controller::get().feedbackValid) line += std::to_string(controller::get().feedback.boardTemp); return line; } };
|
||||
//struct BoardTempText : public virtual TextInterface { public: std::string text() const override { std::string line{"boardTemp: "}; if (controller::get().feedbackValid) line += std::to_string(controller::get().feedback.boardTemp); return line; } };
|
||||
struct BoardTempFixedText : public virtual TextInterface { public: std::string text() const override { std::string line{"boardTemp: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}C", fixBoardTemp(controller::get().feedback.boardTemp)); return line; } };
|
||||
struct TimeoutCntSerialText : public virtual TextInterface { public: std::string text() const override { std::string line{"timeoutCntSerial: "}; if (controller::get().feedbackValid) line += std::to_string(controller::get().feedback.timeoutCntSerial); return line; } };
|
||||
|
||||
@ -62,16 +64,16 @@ private:
|
||||
~FeedbackTexts() = delete;
|
||||
|
||||
struct AngleText : public virtual TextInterface { public: std::string text() const override { std::string line{"angle: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().angle); return line; } };
|
||||
struct SpeedText : public virtual TextInterface { public: std::string text() const override { std::string line{"speed: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().speed); return line; } };
|
||||
struct SpeedKmhText : public virtual TextInterface { public: std::string text() const override { std::string line{"speed kmh: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}", convertToKmh(MotorFeedbackGetter::get().speed)); return line; } };
|
||||
//struct SpeedText : public virtual TextInterface { public: std::string text() const override { std::string line{"speed: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().speed); return line; } };
|
||||
struct SpeedKmhText : public virtual TextInterface { public: std::string text() const override { std::string line{"speed: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}kmh", convertToKmh(MotorFeedbackGetter::get().speed)); return line; } };
|
||||
struct ErrorText : public virtual TextInterface { public: std::string text() const override { std::string line{"error: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().error); return line; } };
|
||||
struct DcLinkText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcLink: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().dcLink); return line; } };
|
||||
//struct DcLinkText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcLink: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().dcLink); return line; } };
|
||||
struct DcLinkFixedText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcLink: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().dcLink)); return line; } };
|
||||
struct DcPhaAText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaA: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().dcPhaA); return line; } };
|
||||
//struct DcPhaAText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaA: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().dcPhaA); return line; } };
|
||||
struct DcPhaAFixedText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaA: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().dcPhaA)); return line; } };
|
||||
struct DcPhaBText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaB: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().dcPhaB); return line; } };
|
||||
//struct DcPhaBText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaB: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().dcPhaB); return line; } };
|
||||
struct DcPhaBFixedText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaB: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().dcPhaB)); return line; } };
|
||||
struct DcPhaCText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaC: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().dcPhaC); return line; } };
|
||||
//struct DcPhaCText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaC: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().dcPhaC); return line; } };
|
||||
struct DcPhaCFixedText : public virtual TextInterface { public: std::string text() const override { std::string line{"dcPhaC: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().dcPhaC)); return line; } };
|
||||
struct ChopsText : public virtual TextInterface { public: std::string text() const override { std::string line{"chops: "}; if (controller::get().feedbackValid) line += std::to_string(MotorFeedbackGetter::get().chops); return line; } };
|
||||
struct HallText : public virtual TextInterface { public: std::string text() const override { std::string line{"hall: "}; if (controller::get().feedbackValid) line += hallString(MotorFeedbackGetter::get()); return line; } };
|
||||
|
@ -26,9 +26,9 @@ class FeedbackDebugMenu :
|
||||
public:
|
||||
FeedbackDebugMenu()
|
||||
{
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::BatVoltageText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::BatVoltageText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::BatVoltageFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::BoardTempText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::BoardTempText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::BoardTempFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::TimeoutCntSerialText, StaticFont<2>, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&icons::back>>>();
|
||||
|
@ -27,16 +27,16 @@ public:
|
||||
MotorFeedbackDebugMenu()
|
||||
{
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::AngleText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::SpeedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::SpeedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::SpeedKmhText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::ErrorText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcLinkText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcLinkText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcLinkFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaAText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaAText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaAFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaBText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaBText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaBFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaCText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaCText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaCFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::ChopsText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::HallText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||
|
@ -25,15 +25,17 @@ class MotorStateDebugMenu :
|
||||
public:
|
||||
MotorStateDebugMenu()
|
||||
{
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::EnableText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::PwmText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::CtrlTypText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::CtrlModText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::IMotMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::IDcMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::NMotMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::FieldWeakMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::PhaseAdvMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::EnableText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::PwmText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::CtrlTypText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::CtrlModText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::IMotMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::IDcMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::NMotMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::FieldWeakMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::PhaseAdvMaxText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::CruiseCtrlEnaText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::NCruiseMotTgtText, DisabledColor, DummyAction>>();
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&icons::back>>>();
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user