Speeduino
Loading...
Searching...
No Matches
globals.h
Go to the documentation of this file.
1
25#ifndef GLOBALS_H
26#define GLOBALS_H
27#include "table2d.h"
28#include "table3d.h"
29#include "statuses.h"
30#include "config_pages.h"
31#include "atomic.h"
33
34
35#ifndef UNIT_TEST
36constexpr uint8_t TOOTH_LOG_SIZE = 127U;
37#else
38constexpr uint8_t TOOTH_LOG_SIZE = 2U;
39#endif
40
41extern struct table3d16RpmLoad fuelTable; //16x16 fuel map
42extern struct table3d16RpmLoad fuelTable2; //16x16 fuel map
43extern struct table3d16RpmLoad ignitionTable; //16x16 ignition map
44extern struct table3d16RpmLoad ignitionTable2; //16x16 ignition map
45extern struct table3d16RpmLoad afrTable; //16x16 afr target map
46extern struct table3d8RpmLoad stagingTable; //8x8 fuel staging table
47extern struct table3d8RpmLoad boostTable; //8x8 boost map
48extern struct table3d8RpmLoad boostTableLookupDuty; //8x8 boost map
49extern struct table3d8RpmLoad vvtTable; //8x8 vvt map
50extern struct table3d8RpmLoad vvt2Table; //8x8 vvt map
51extern struct table3d8RpmLoad wmiTable; //8x8 wmi map
52
53using trimTable3d = table3d6RpmLoad;
54
55extern trimTable3d trimTables[INJ_CHANNELS]; //6x6 Fuel trim maps
56
57extern struct table3d4RpmLoad dwellTable; //4x4 Dwell map
58
59extern uint8_t softLimitTime; //The time (in 0.1 seconds, based on seclx10) that the soft limiter started
60extern volatile uint16_t mainLoopCount;
61extern volatile unsigned long ms_counter; //A counter that increments once per ms
62extern uint16_t fixedCrankingOverride;
63extern volatile uint32_t toothHistory[TOOTH_LOG_SIZE];
64extern volatile uint8_t compositeLogHistory[TOOTH_LOG_SIZE];
65extern volatile unsigned int toothHistoryIndex;
66extern unsigned long currentLoopTime;
67extern volatile uint16_t ignitionCount;
68extern volatile uint32_t runSecsX10;
69extern volatile uint32_t seclx10;
72
73extern struct statuses currentStatus; //The global status object
74extern struct config2 configPage2;
75extern struct config4 configPage4;
76extern struct config6 configPage6;
77extern struct config9 configPage9;
78extern struct config10 configPage10;
79extern struct config13 configPage13;
80extern struct config15 configPage15;
81
82bool pinIsOutput(byte pin);
83bool pinIsUsed(byte pin);
84
85#endif // GLOBALS_H
#define INJ_CHANNELS
Definition board_avr2560.h:22
The tune page structs and related defines.
volatile uint16_t ignitionCount
The number of crank degrees that the system track over. Typically 720 divided by the number of squirt...
Definition globals.cpp:32
table3d6RpmLoad trimTable3d
Definition globals.h:53
struct table3d8RpmLoad stagingTable
8x8 fuel staging table
Definition globals.cpp:12
struct statuses currentStatus
Definition globals.cpp:39
volatile uint32_t seclx10
Definition globals.cpp:35
constexpr uint8_t TOOTH_LOG_SIZE
Definition globals.h:36
struct table3d8RpmLoad vvt2Table
8x8 vvt2 map
Definition globals.cpp:16
volatile unsigned int toothHistoryIndex
Current index to toothHistory array.
Definition globals.cpp:30
unsigned long currentLoopTime
Definition globals.cpp:31
volatile uint32_t runSecsX10
Definition globals.cpp:34
uint16_t fixedCrankingOverride
Definition globals.cpp:25
struct table3d16RpmLoad afrTable
16x16 afr target map
Definition globals.cpp:11
pinNumbers_t pinNumbers
Definition globals.cpp:37
struct table3d16RpmLoad ignitionTable2
16x16 ignition map
Definition globals.cpp:10
bool pinIsOutput(byte pin)
Definition globals.cpp:49
struct table3d16RpmLoad fuelTable2
16x16 fuel map
Definition globals.cpp:8
trimTable3d trimTables[INJ_CHANNELS]
Definition globals.cpp:18
struct config15 configPage15
Immediately below max RPM, there is a range within which we can apply a rolling cut.
Definition engineProtection.cpp:286
struct table3d8RpmLoad wmiTable
8x8 wmi map
Definition globals.cpp:17
struct config10 configPage10
Definition corrections.cpp:59
struct table3d4RpmLoad dwellTable
4x4 Dwell map
Definition globals.cpp:19
struct table3d8RpmLoad boostTable
8x8 boost map
Definition globals.cpp:13
struct config9 configPage9
Definition engineProtection.cpp:13
uint8_t softLimitTime
Definition globals.cpp:22
struct table3d16RpmLoad fuelTable
16x16 fuel map
Definition globals.cpp:7
volatile uint8_t compositeLogHistory[TOOTH_LOG_SIZE]
Definition globals.cpp:27
struct config13 configPage13
Definition globals.cpp:45
volatile unsigned long ms_counter
Definition globals.cpp:24
struct config6 configPage6
Definition corrections.cpp:60
volatile uint16_t mainLoopCount
Definition globals.cpp:23
struct config2 configPage2
Definition corrections.cpp:57
struct table3d8RpmLoad boostTableLookupDuty
8x8 boost map lookup table
Definition globals.cpp:14
volatile uint32_t toothHistory[TOOTH_LOG_SIZE]
Tooth trigger history - delta time (in uS) from last tooth (Indexed by toothHistoryIndex)
Definition globals.cpp:26
bool pinIsUsed(byte pin)
Definition globals.cpp:85
struct config4 configPage4
Definition corrections.cpp:54
struct table3d16RpmLoad ignitionTable
16x16 ignition map
Definition globals.cpp:9
struct table3d8RpmLoad vvtTable
8x8 vvt map
Definition globals.cpp:15
The statuses struct and related defines.
Definition config_pages.h:649
Definition config_pages.h:845
Definition config_pages.h:894
Definition config_pages.h:175
Definition config_pages.h:355
Definition config_pages.h:454
Definition config_pages.h:571
Store the pin assignments, as defined by the board.
Definition pinNumbers_t.h:41
The status struct with current values for all 'live' variables.
Definition statuses.h:47
3D table data types and functions