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 58 of file can.h.

Constructor & Destructor Documentation

◆ CanWrite()

CanWrite::CanWrite ( )

Definition at line 24 of file can_tx.cpp.

25 : PeriodicController("CAN TX", PRIO_CAN_TX, CAN_CYCLE_FREQ)
26{
27}
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 50 of file can_tx.cpp.

50 {
53
54 //in case we have Verbose Can enabled, we should keep user configured period
56 // slow down verbose CAN while in serial CAN
57 int canSleepPeriodMs = (engine->pauseCANdueToSerial ? 5 : 1) * engineConfiguration->canSleepPeriodMs;
58
59 auto roundedInterval = roundTxPeriodToCycle(canSleepPeriodMs);
60 if (cycle.isInterval(roundedInterval)) {
61 void sendCanVerbose();
63 }
64 }
65
67
68 while (current) {
69 current = current->request();
70 }
71
72 if (cycle.isInterval(CI::_MAX_Cycle)) {
73 //we now reset cycleCount since we reached max cycle count
74 m_cycleCount = 0;
75 }
76
77 updateDash(cycle);
78
80 if (cycle.isInterval(CI::_100ms)) {
83#ifdef HW_HELLEN_8CHAN
86#endif
87 }
88
89 if (cycle.isInterval(CI::_250ms)) {
91#ifdef HW_HELLEN_8CHAN
92 sendQcBenchBoardStatus(/*bus*/1);
93#endif
96 }
97 }
98
101 }
102
103 m_cycleCount++;
104}
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:616
CanListener * canListeners_head
Definition can_rx.cpp:69
static uint16_t m_cycleCount
Definition can_tx.cpp:43
static CI roundTxPeriodToCycle(uint16_t period)
Definition can_tx.cpp:29
void sendCanVerbose()
Definition can.h:83
virtual CanListener * request()
bool pauseCANdueToSerial
Definition engine.h:123
static EngineAccessor engine
Definition engine.h:413
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: