2020-03-19 11:01:07 -07:00
|
|
|
/**
|
|
|
|
* @file can_tx.cpp
|
|
|
|
*
|
|
|
|
* CAN transmission handling. This file handles the dispatch of various outgoing regularly scheduled CAN message types.
|
|
|
|
*
|
|
|
|
* @date Mar 19, 2020
|
|
|
|
* @author Matthew Kennedy, (c) 2020
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "globalaccess.h"
|
|
|
|
#if EFI_CAN_SUPPORT
|
|
|
|
|
|
|
|
#include "engine.h"
|
|
|
|
#include "can.h"
|
|
|
|
#include "can_hw.h"
|
|
|
|
#include "can_dash.h"
|
|
|
|
#include "obd2.h"
|
|
|
|
|
|
|
|
EXTERN_ENGINE;
|
|
|
|
|
|
|
|
CanWrite::CanWrite()
|
|
|
|
: PeriodicController("CAN TX", NORMALPRIO, 50)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void CanWrite::PeriodicTask(efitime_t nowNt) {
|
|
|
|
UNUSED(nowNt);
|
|
|
|
|
2020-03-19 14:58:46 -07:00
|
|
|
if (CONFIG(enableVerboseCanTx)) {
|
|
|
|
void sendCanVerbose();
|
|
|
|
sendCanVerbose();
|
|
|
|
}
|
|
|
|
|
2020-03-19 11:01:07 -07:00
|
|
|
// Transmit dash data, if enabled
|
|
|
|
switch (CONFIG(canNbcType)) {
|
|
|
|
case CAN_BUS_NBC_BMW:
|
|
|
|
canDashboardBMW();
|
|
|
|
break;
|
|
|
|
case CAN_BUS_NBC_FIAT:
|
|
|
|
canDashboardFiat();
|
|
|
|
break;
|
|
|
|
case CAN_BUS_NBC_VAG:
|
|
|
|
canDashboardVAG();
|
|
|
|
break;
|
|
|
|
case CAN_BUS_MAZDA_RX8:
|
|
|
|
canMazdaRX8();
|
|
|
|
break;
|
2020-04-13 05:11:06 -07:00
|
|
|
case CAN_BUS_W202_C180:
|
|
|
|
canDashboardW202();
|
|
|
|
break;
|
2020-06-14 13:59:43 -07:00
|
|
|
case CAN_BUS_BMW_E90:
|
|
|
|
canDashboardBMWE90();
|
|
|
|
break;
|
2020-03-19 11:01:07 -07:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // EFI_CAN_SUPPORT
|