board can override CAN format

This commit is contained in:
Matthew Kennedy 2023-03-28 00:01:21 -07:00
parent 0b27e6a8e7
commit a588f15808
2 changed files with 11 additions and 1 deletions

View File

@ -22,7 +22,7 @@ void CanTxThread(void*)
while(1)
{
for (int ch = 0; ch < AFR_CHANNELS; ch++) {
SendRusefiFormat(ch);
SendCanForChannel(ch);
}
chThdSleepMilliseconds(10);
@ -161,3 +161,9 @@ void SendRusefiFormat(uint8_t ch)
frame.get().HeaterDuty = GetHeaterDuty(ch) * 255;
}
}
// Weak link so boards can override it
__attribute__((weak)) void SendCanForChannel(uint8_t ch)
{
SendRusefiFormat(ch);
}

View File

@ -20,3 +20,7 @@ enum class HeaterAllow {
HeaterAllow GetHeaterAllowed();
float GetRemoteBatteryVoltage();
// implement this for your board if you want some non-standard behavior
// default implementation simply calls SendRusefiFormat
void SendCanForChannel(uint8_t ch);