diff --git a/components/bobbycar-protocol b/components/bobbycar-protocol index a74791e..701243a 160000 --- a/components/bobbycar-protocol +++ b/components/bobbycar-protocol @@ -1 +1 @@ -Subproject commit a74791e2aa333f92306d0b0c0e0df5e3baa77fb9 +Subproject commit 701243ad89a3efead1fba2dbd5c9228ea7d407e5 diff --git a/main/can.cpp b/main/can.cpp index bfc0fa7..b86e148 100644 --- a/main/can.cpp +++ b/main/can.cpp @@ -161,6 +161,18 @@ bool parseMotorControllerCanMessage(const twai_message_t &message, Controller &c case MotorController::Feedback::Temp: controller.feedback.boardTemp = *((int16_t*)message.data); return true; + case MotorController::Feedback::Id: + controller.feedback.left.id = *((int16_t*)message.data); + return true; + case MotorController::Feedback::Id: + controller.feedback.right.id = *((int16_t*)message.data); + return true; + case MotorController::Feedback::Iq: + controller.feedback.left.iq = *((int16_t*)message.data); + return true; + case MotorController::Feedback::Iq: + controller.feedback.right.iq = *((int16_t*)message.data); + return true; } return false; diff --git a/main/debugtexthelpers.h b/main/debugtexthelpers.h index bdaa1a2..a57f9d4 100644 --- a/main/debugtexthelpers.h +++ b/main/debugtexthelpers.h @@ -77,6 +77,8 @@ private: 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; } }; + struct IdText : public virtual TextInterface { public: std::string text() const override { std::string line{"id: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().id)); return line; } }; + struct IqText : public virtual TextInterface { public: std::string text() const override { std::string line{"iq: "}; if (controller::get().feedbackValid) line += fmt::format("{:.2f}A", fixCurrent(MotorFeedbackGetter::get().iq)); return line; } }; }; public: diff --git a/main/displays/menus/motorfeedbackdebugmenu.h b/main/displays/menus/motorfeedbackdebugmenu.h index 303ebdd..9b67f35 100644 --- a/main/displays/menus/motorfeedbackdebugmenu.h +++ b/main/displays/menus/motorfeedbackdebugmenu.h @@ -35,6 +35,8 @@ public: constructMenuItem, DummyAction>>(); constructMenuItem, DummyAction>>(); constructMenuItem, DummyAction>>(); + constructMenuItem, DummyAction>>(); + constructMenuItem, DummyAction>>(); constructMenuItem, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>(); }