rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
engine_parts.h
Go to the documentation of this file.
1/*
2 * @file engine_parts.h
3 *
4 * @date May 27, 2019
5 * @author Andrey Belomutskiy, (c) 2012-2020
6 */
7
8#pragma once
9
10#include "static_vector.h"
11#include <rusefi/timer.h>
12
13#define MOCK_ADC_SIZE 26
14
16 float lat = 0; // G value
17 float lon = 0;
18 float vert = 0;
19 float yawRate = 0;
20};
21
25
30
31struct warning_t {
34
36
38 : Code(code)
39 {
40 }
41
42 // Equality just checks the code, timer doesn't matter
43 bool operator ==(const warning_t& other) const {
44 return other.Code == Code;
45 }
46
47 // Compare against a plain OBD code
48 bool operator ==(const ObdCode other) const {
49 return other == Code;
50 }
51};
52
54
56public:
58 void addWarningCode(ObdCode code, const char *text = nullptr);
59 bool isWarningNow() const;
60 bool isWarningNow(ObdCode code) const;
61 bool hasWarningMessage();
62 const char* getWarningMessage();
63 void refreshTs();
64 void clear();
67 const char *description;
68
70
71 // text that may be assotiated with some warning and should be reported to TS
74
75 // todo: we need a way to post multiple recent warnings into TS
77};
78
80{
83 uint8_t count = 0;
84};
uint8_t code
Definition bluetooth.cpp:40
gear_e gearSelectorPosition
warningBuffer_t recentWarnings
ObdCode lastErrorCode
warning_t * m_msgWarning
const char * description
critical_msg_t m_msg
const char * getWarningMessage()
Definition engine2.cpp:107
bool hasWarningMessage()
Definition engine2.cpp:102
void addWarningCode(ObdCode code, const char *text=nullptr)
Definition engine2.cpp:38
bool isWarningNow() const
Definition engine2.cpp:114
Timer timeSinceLastWarning
static_vector< warning_t, 24 > warningBuffer_t
char[CRITICAL_BUFFER_SIZE] critical_msg_t
ObdCode
gear_e
efitick_t efidur_t
Accelerometer accelerometer
ObdCode Code
warning_t(ObdCode code)
bool operator==(const warning_t &other) const
Timer LastTriggered