rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures | Functions | Variables
electronic_throttle_impl.h File Reference

Detailed Description

Date
Dec 7, 2013
Author
Andrey Belomutskiy, (c) 2012-2020

Definition in file electronic_throttle_impl.h.

Data Structures

class  EtbController
 
class  EtbController1
 
class  EtbController2
 
class  EtbImpl< TBase >
 

Functions

void etbPidReset ()
 
template<typename T , size_t idx>
requires std::is_same_v<T, electronic_throttle_s>
consteval electronic_throttle_s const * getLiveDataConstexpr ()
 

Variables

EtbImpl< EtbController1etb1
 
EtbImpl< EtbController2etb2
 
static constexpr electronic_throttle_s const * etbData1_ptr = &etb1
 
static constexpr electronic_throttle_s const * etbData2_ptr = &etb2
 

Function Documentation

◆ etbPidReset()

void etbPidReset ( )

Definition at line 763 of file electronic_throttle.cpp.

763 {
764 for (int i = 0 ; i < ETB_COUNT; i++) {
765 if (auto controller = engine->etbControllers[i]) {
766 assertNotNullVoid(controller);
767 controller->reset("unit_test");
768 }
769 }
770 ebtResetCounter = 0;
771}
IEtbController * etbControllers[ETB_COUNT]
Definition engine.h:126
int ebtResetCounter
static EngineAccessor engine
Definition engine.h:413

◆ getLiveDataConstexpr()

template<typename T , size_t idx>
requires std::is_same_v<T, electronic_throttle_s>
consteval electronic_throttle_s const * getLiveDataConstexpr ( )

Definition at line 333 of file electronic_throttle_impl.h.

333 {
334#if EFI_ELECTRONIC_THROTTLE_BODY
335
336 static_assert(idx < ETB_COUNT);
337
338 if constexpr (idx == 0) {
339 return etbData1_ptr;
340 }
341
342 return etbData2_ptr;
343#else
344 return nullptr;
345#endif
346}
static constexpr electronic_throttle_s const * etbData2_ptr
static constexpr electronic_throttle_s const * etbData1_ptr

Variable Documentation

◆ etb1

EtbImpl<EtbController1> etb1
extern

Things running on a timer (instead of a thread) don't participate it the RTOS's thread priority system, and operate essentially "first come first serve", which risks starvation. Since ETB is a safety critical device, we need the hard RTOS guarantee that it will be scheduled over other less important tasks.

Definition at line 727 of file electronic_throttle.cpp.

◆ etb2

EtbImpl<EtbController2> etb2
extern

◆ etbData1_ptr

constexpr electronic_throttle_s const* etbData1_ptr = &etb1
staticconstexpr

Definition at line 328 of file electronic_throttle_impl.h.

Referenced by getLiveDataConstexpr().

◆ etbData2_ptr

constexpr electronic_throttle_s const* etbData2_ptr = &etb2
staticconstexpr

Definition at line 329 of file electronic_throttle_impl.h.

Referenced by getLiveDataConstexpr().

Go to the source code of this file.