rusEFI
The most advanced open source ECU
Public Member Functions | Data Fields
SerialRead Class Referencefinal

#include <serial.h>

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

Public Member Functions

 SerialRead ()
 
void ThreadTask ()
 
- Public Member Functions inherited from ThreadController< 256 >
 ThreadController (const char *name, tprio_t priority)
 
void start ()
 Start the thread. More...
 
void stop ()
 Request thread termination and waits for termination. More...
 

Data Fields

uint16_t len
 

Additional Inherited Members

- Protected Member Functions inherited from ThreadController< 256 >
void main () override
 
- Protected Attributes inherited from ThreadController< 256 >
const char *const m_name
 

Detailed Description

Definition at line 29 of file serial.h.

Constructor & Destructor Documentation

◆ SerialRead()

SerialRead::SerialRead ( )

Definition at line 25 of file serial_rx.cpp.

26  : ThreadController("AUX Serial RX", PRIO_AUX_SERIAL) {
27 }
ThreadController(const char *name, tprio_t priority)

Member Function Documentation

◆ ThreadTask()

void SerialRead::ThreadTask ( )
virtual

Implements ThreadController< 256 >.

Definition at line 29 of file serial_rx.cpp.

29  {
30  while (true) {
33  }
34 
35  if (len >= SERBUFFLEN)
36  len = SERBUFFLEN;
37 
38  if (sdReadTimeout(AUX_SERIAL_DEVICE, &ser_buffer[sb], len, TIME_100MSEC) == len) {
40  } else {
42  }
43 
44  //clear buffer every frame to avoid parsing old data
45  if (clear_ser_buffer) {
47  clear_ser_buffer = false;
48  }
49  }
50 }
uint16_t len
Definition: serial.h:34
engine_configuration_s * engineConfiguration
size_t innovate_msg_len
Definition: serial_rx.cpp:20
uint8_t sb
Definition: serial_rx.cpp:22
bool clear_ser_buffer
Definition: serial_rx.cpp:23
uint8_t ser_buffer[SERBUFFLEN]
Definition: serial_rx.cpp:19
void ResetSerialSensor()
void ParseSerialData()
void ClearSerialBuffer()
Here is the call graph for this function:

Field Documentation

◆ len

uint16_t SerialRead::len

Definition at line 34 of file serial.h.

Referenced by ThreadTask().


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