verbose CAN bits picker (#3628)

* verbose bits picker

* s
This commit is contained in:
Matthew Kennedy 2021-11-28 11:59:26 -08:00 committed by GitHub
parent 0c578dde4a
commit a071e2a168
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 11 deletions

View File

@ -146,14 +146,15 @@ static void populateFrame(Fueling2& msg) {
void sendCanVerbose() {
auto base = engineConfiguration->verboseCanBaseAddress;
auto isExt = engineConfiguration->rusefiVerbose29b;
transmitStruct<Status> (base + 0);
transmitStruct<Speeds> (base + 1);
transmitStruct<PedalAndTps> (base + CAN_PEDAL_TPS_OFFSET);
transmitStruct<Sensors1> (base + CAN_SENSOR_1_OFFSET);
transmitStruct<Sensors2> (base + 4);
transmitStruct<Fueling> (base + 5);
transmitStruct<Fueling2> (base + 6);
transmitStruct<Status> (base + 0, isExt);
transmitStruct<Speeds> (base + 1, isExt);
transmitStruct<PedalAndTps> (base + CAN_PEDAL_TPS_OFFSET, isExt);
transmitStruct<Sensors1> (base + CAN_SENSOR_1_OFFSET, isExt);
transmitStruct<Sensors2> (base + 4, isExt);
transmitStruct<Fueling> (base + 5, isExt);
transmitStruct<Fueling2> (base + 6, isExt);
}
#endif // EFI_CAN_SUPPORT

View File

@ -82,7 +82,7 @@ class CanTxTyped final : public CanTxMessage
#endif // EFI_CAN_SUPPORT
public:
explicit CanTxTyped(uint32_t eid) : CanTxMessage(eid, sizeof(TData)) { }
explicit CanTxTyped(uint32_t id, bool isExtended) : CanTxMessage(id, sizeof(TData), isExtended) { }
#if EFI_CAN_SUPPORT
/**
@ -103,9 +103,9 @@ public:
};
template <typename TData>
void transmitStruct(uint32_t eid)
void transmitStruct(uint32_t id, bool isExtended)
{
CanTxTyped<TData> frame(eid);
CanTxTyped<TData> frame(id, isExtended);
// Destruction of an instance of CanTxMessage will transmit the message over the wire.
// see CanTxMessage::~CanTxMessage()
populateFrame(frame.get());

View File

@ -733,7 +733,7 @@ bit is_enabled_spi_1
bit is_enabled_spi_2
bit is_enabled_spi_3
bit isSdCardEnabled;enable sd/disable sd
bit unused744b4
bit rusefiVerbose29b,"29 bit","11 bit";+Use 11 bit (standard) or 29 bit (extended) IDs for rusEFI verbose CAN format.
bit isEngineControlEnabled
bit isHip9011Enabled
bit isVerboseAlternator

View File

@ -3191,6 +3191,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
field = "inertia measurement unit", imuType
field = "Enable rusEFI CAN broadcast", enableVerboseCanTx
field = "rusEFI CAN data base address", verboseCanBaseAddress
field = "rusEFI CAN data address type", rusefiVerbose29b
field = "rusEFI CAN data period", canSleepPeriodMs
field = "RX pin", canRxPin @@if_ts_show_can_pins
field = "TX pin", canTxPin @@if_ts_show_can_pins