rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions
CanWrite Class Referencefinal

#include <can.h>

Inheritance diagram for CanWrite:
Inheritance graph
[legend]
Collaboration diagram for CanWrite:
Collaboration graph
[legend]

Public Member Functions

 CanWrite ()
 
void PeriodicTask (efitick_t nowNt) override
 Called periodically. Override this method to do work for your controller.
 
- Public Member Functions inherited from PeriodicController< 512 >
 PeriodicController (const char *name, tprio_t priority, float frequencyHz)
 
 PeriodicController (const char *name)
 
void setPeriod (int periodMs)
 
- Public Member Functions inherited from ThreadController< TStackSize >
 ThreadController (const char *name, tprio_t priority)
 
void start ()
 Start the thread.
 
void stop ()
 Request thread termination and waits for termination.
 

Additional Inherited Members

- Protected Member Functions inherited from PeriodicController< 512 >
virtual void OnStarted ()
 Called before running the periodic task. Optionally override this method to set up.
 
- Protected Member Functions inherited from ThreadController< TStackSize >
void main () override
 
- Protected Attributes inherited from ThreadController< TStackSize >
const char *const m_name
 

Detailed Description

Definition at line 67 of file can.h.

Constructor & Destructor Documentation

◆ CanWrite()

CanWrite::CanWrite ( )

Definition at line 27 of file can_tx.cpp.

28 : PeriodicController("CAN TX", PRIO_CAN_TX, CAN_CYCLE_FREQ)
29{
30}
Base class for a controller that needs to run periodically to perform work.

Member Function Documentation

◆ PeriodicTask()

void CanWrite::PeriodicTask ( efitick_t  nowNt)
overridevirtual

Called periodically. Override this method to do work for your controller.

Implements PeriodicController< 512 >.

Definition at line 53 of file can_tx.cpp.

53 {
56
57 //in case we have Verbose Can enabled, we should keep user configured period
59 // slow down verbose CAN while in serial CAN
60 int canSleepPeriodMs = (engine->pauseCANdueToSerial ? 5 : 1) * engineConfiguration->canSleepPeriodMs;
61
62 auto roundedInterval = roundTxPeriodToCycle(canSleepPeriodMs);
63 if (cycle.isInterval(roundedInterval)) {
64 void sendCanVerbose();
66 }
67 }
68
70
71 while (current) {
72 current = current->request();
73 }
74
75 if (cycle.isInterval(CI::_MAX_Cycle)) {
76 //we now reset cycleCount since we reached max cycle count
77 m_cycleCount = 0;
78 }
79
80 updateDash(cycle);
81
83 if (cycle.isInterval(CI::_100ms)) {
86#ifdef HW_HELLEN_8CHAN
89#endif
90 }
91
92 if (cycle.isInterval(CI::_250ms)) {
94#ifdef HW_HELLEN_8CHAN
95 sendQcBenchBoardStatus(/*bus*/1);
96#endif
99 }
100 }
101
104 }
105
106 m_cycleCount++;
107}
void sendQcBenchButtonCounters()
bool isHwQcMode()
void sendQcBenchRawAnalogValues(size_t bus)
void sendQcBenchBoardStatus(size_t bus)
void sendQcBenchAuxDigitalCounters()
void sendQcBenchEventCounters(size_t bus)
void updateDash(CanCycle cycle)
Definition can_dash.cpp:622
CanListener * canListeners_head
Definition can_rx.cpp:69
static uint16_t m_cycleCount
Definition can_tx.cpp:46
static CI roundTxPeriodToCycle(uint16_t period)
Definition can_tx.cpp:32
void sendCanVerbose()
Definition can.h:92
virtual CanListener * request()
bool pauseCANdueToSerial
Definition engine.h:127
static EngineAccessor engine
Definition engine.h:421
static constexpr engine_configuration_s * engineConfiguration
bool boardEnableSendWidebandInfo()
@ CanThreadTx
void sendWidebandInfo()
Here is the call graph for this function:

The documentation for this class was generated from the following files: