Eliminate CAN_SHUNT_SELECTED define

This commit is contained in:
Jaakko Haakana 2025-06-09 22:29:52 +03:00
parent 9c13d94af1
commit 75c66cb6d3
4 changed files with 12 additions and 10 deletions

View file

@ -2,7 +2,6 @@
#define BMW_SBOX_CONTROL_H #define BMW_SBOX_CONTROL_H
#include "../include.h" #include "../include.h"
#define CAN_SHUNT_SELECTED
#define SELECTED_SHUNT_CLASS BmwSbox #define SELECTED_SHUNT_CLASS BmwSbox
#include "Shunt.h" #include "Shunt.h"

View file

@ -11,6 +11,9 @@ class CanShunt : public Transmitter, CanReceiver {
virtual void transmit_can(unsigned long currentMillis) = 0; virtual void transmit_can(unsigned long currentMillis) = 0;
virtual void handle_incoming_can_frame(CAN_frame rx_frame) = 0; virtual void handle_incoming_can_frame(CAN_frame rx_frame) = 0;
// The name of the comm interface the shunt is using.
virtual String interface_name() { return getCANInterfaceName(can_config.shunt); }
void transmit(unsigned long currentMillis) { void transmit(unsigned long currentMillis) {
if (allowed_to_send_CAN) { if (allowed_to_send_CAN) {
transmit_can(currentMillis); transmit_can(currentMillis);

View file

@ -40,10 +40,10 @@ String settings_processor(const String& var) {
String(inverter->interface_name()) + "</span></h4>"; String(inverter->interface_name()) + "</span></h4>";
} }
#ifdef CAN_SHUNT_SELECTED if (shunt) {
content += "<h4 style='color: white;'>Shunt Interface: <span id='Shunt'>" + content +=
String(getCANInterfaceName(can_config.shunt)) + "</span></h4>"; "<h4 style='color: white;'>Shunt Interface: <span id='Shunt'>" + shunt->interface_name() + "</span></h4>";
#endif //CAN_SHUNT_SELECTED }
// Close the block // Close the block
content += "</div>"; content += "</div>";

View file

@ -960,11 +960,11 @@ String processor(const String& var) {
} }
content += "</h4>"; content += "</h4>";
#ifdef CAN_SHUNT_SELECTED if (shunt) {
content += "<h4 style='color: white;'>Shunt protocol: "; content += "<h4 style='color: white;'>Shunt protocol: ";
content += datalayer.system.info.shunt_protocol; content += datalayer.system.info.shunt_protocol;
content += "</h4>"; content += "</h4>";
#endif }
if (charger) { if (charger) {
content += "<h4 style='color: white;'>Charger protocol: "; content += "<h4 style='color: white;'>Charger protocol: ";