Speeduino
Loading...
Searching...
No Matches
Typedefs | Functions | Variables
globals.h File Reference
#include "table2d.h"
#include "table3d.h"
#include "statuses.h"
#include "config_pages.h"
#include "atomic.h"
#include "src/pins/pinNumbers_t.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

using trimTable3d = table3d6RpmLoad
 

Functions

bool pinIsOutput (byte pin)
 
bool pinIsUsed (byte pin)
 

Variables

constexpr uint8_t TOOTH_LOG_SIZE = 127U
 
struct table3d16RpmLoad fuelTable
 16x16 fuel map
 
struct table3d16RpmLoad fuelTable2
 16x16 fuel map
 
struct table3d16RpmLoad ignitionTable
 16x16 ignition map
 
struct table3d16RpmLoad ignitionTable2
 16x16 ignition map
 
struct table3d16RpmLoad afrTable
 16x16 afr target map
 
struct table3d8RpmLoad stagingTable
 8x8 fuel staging table
 
struct table3d8RpmLoad boostTable
 8x8 boost map
 
struct table3d8RpmLoad boostTableLookupDuty
 8x8 boost map lookup table
 
struct table3d8RpmLoad vvtTable
 8x8 vvt map
 
struct table3d8RpmLoad vvt2Table
 8x8 vvt2 map
 
struct table3d8RpmLoad wmiTable
 8x8 wmi map
 
trimTable3d trimTables [INJ_CHANNELS]
 
struct table3d4RpmLoad dwellTable
 4x4 Dwell map
 
uint8_t softLimitTime
 
volatile uint16_t mainLoopCount
 
volatile unsigned long ms_counter
 
uint16_t fixedCrankingOverride
 
volatile uint32_t toothHistory [TOOTH_LOG_SIZE]
 Tooth trigger history - delta time (in uS) from last tooth (Indexed by toothHistoryIndex)
 
volatile uint8_t compositeLogHistory [TOOTH_LOG_SIZE]
 
volatile unsigned int toothHistoryIndex
 Current index to toothHistory array.
 
unsigned long currentLoopTime
 
volatile uint16_t ignitionCount
 The number of crank degrees that the system track over. Typically 720 divided by the number of squirts per cycle (Eg 360 for wasted 2 squirt and 720 for sequential single squirt)
 
volatile uint32_t runSecsX10
 
volatile uint32_t seclx10
 
pinNumbers_t pinNumbers
 
struct statuses currentStatus
 
struct config2 configPage2
 
struct config4 configPage4
 
struct config6 configPage6
 
struct config9 configPage9
 
struct config10 configPage10
 
struct config13 configPage13
 
struct config15 configPage15
 Immediately below max RPM, there is a range within which we can apply a rolling cut.
 

Detailed Description

Global defines, macros, struct definitions (statuses, config2, config4, config*), extern-definitions (for globally accessible vars).

Note on configuration struct layouts

Once the struct members have been assigned to certain "role" (in certain SW version), they should not be "moved around" as the structs are stored onto EEPROM as-is and the offset and size of member needs to remain constant. Also removing existing struct members would disturb layouts. Because of this a certain amount unused old members will be left into the structs. For the storage related reasons also the bit fields are defined in byte-size (or multiple of ...) chunks.

Config Structs and 2D, 3D Tables

The config* structures contain information coming from tuning SW (e.g. TS) for 2D and 3D tables, where looked up value is not a result of direct array lookup, but from interpolation algorithm. Because of standard, reusable interpolation routines associated with structs table2D and table3D, the values from config are copied from config* structs to table2D (table3D destined configurations are not stored in config* structures).

Board choice

There's a C-preprocessor based "#if defined" logic present in this header file based on the Arduino IDE compiler set CPU (+board?) type, e.g. __AVR_ATmega2560__. This respectively drives (withi it's "#if defined ..." block):

Typedef Documentation

◆ trimTable3d

Function Documentation

◆ pinIsOutput()

bool pinIsOutput ( byte  pin)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pinIsUsed()

bool pinIsUsed ( byte  pin)
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ afrTable

struct table3d16RpmLoad afrTable
extern

16x16 afr target map

◆ boostTable

struct table3d8RpmLoad boostTable
extern

8x8 boost map

◆ boostTableLookupDuty

struct table3d8RpmLoad boostTableLookupDuty
extern

8x8 boost map lookup table

◆ compositeLogHistory

volatile uint8_t compositeLogHistory[TOOTH_LOG_SIZE]
extern

◆ configPage10

struct config10 configPage10
externconstexpr

◆ configPage13

struct config13 configPage13
extern

◆ configPage15

struct config15 configPage15
extern

Immediately below max RPM, there is a range within which we can apply a rolling cut.

The rolling cut table defines a series of relative negative RPM offsets that define the window and percent cut for each offset. I.e. RPM 0---------------------—|++++++++++++++++++++|<- max RPM | rolling cut window |

◆ configPage2

struct config2 configPage2
extern

◆ configPage4

struct config4 configPage4
extern

◆ configPage6

struct config6 configPage6
externconstexpr

◆ configPage9

struct config9 configPage9
extern

◆ currentLoopTime

unsigned long currentLoopTime
extern

The time (in uS) that the current mainloop started

◆ currentStatus

struct statuses currentStatus
extern

The master global "live" status struct. Contains all values that are updated frequently and used across modules

◆ dwellTable

struct table3d4RpmLoad dwellTable
extern

4x4 Dwell map

◆ fixedCrankingOverride

uint16_t fixedCrankingOverride
extern

◆ fuelTable

struct table3d16RpmLoad fuelTable
extern

16x16 fuel map

◆ fuelTable2

struct table3d16RpmLoad fuelTable2
extern

16x16 fuel map

◆ ignitionCount

volatile uint16_t ignitionCount
extern

The number of crank degrees that the system track over. Typically 720 divided by the number of squirts per cycle (Eg 360 for wasted 2 squirt and 720 for sequential single squirt)

The count of ignition events that have taken place since the engine started

◆ ignitionTable

struct table3d16RpmLoad ignitionTable
extern

16x16 ignition map

◆ ignitionTable2

struct table3d16RpmLoad ignitionTable2
extern

16x16 ignition map

◆ mainLoopCount

volatile uint16_t mainLoopCount
extern

◆ ms_counter

volatile unsigned long ms_counter
extern

◆ pinNumbers

pinNumbers_t pinNumbers
extern

◆ runSecsX10

volatile uint32_t runSecsX10
extern

Counter of seconds since cranking commenced (similar to runSecs) but in increments of 0.1 seconds

◆ seclx10

volatile uint32_t seclx10
extern

Counter of seconds since powered commenced (similar to secl) but in increments of 0.1 seconds

◆ softLimitTime

uint8_t softLimitTime
extern

◆ stagingTable

struct table3d8RpmLoad stagingTable
extern

8x8 fuel staging table

◆ TOOTH_LOG_SIZE

constexpr uint8_t TOOTH_LOG_SIZE = 127U
constexpr

◆ toothHistory

volatile uint32_t toothHistory[TOOTH_LOG_SIZE]
extern

Tooth trigger history - delta time (in uS) from last tooth (Indexed by toothHistoryIndex)

◆ toothHistoryIndex

volatile unsigned int toothHistoryIndex
extern

Current index to toothHistory array.

◆ trimTables

trimTable3d trimTables[INJ_CHANNELS]
extern

◆ vvt2Table

struct table3d8RpmLoad vvt2Table
extern

8x8 vvt2 map

◆ vvtTable

struct table3d8RpmLoad vvtTable
extern

8x8 vvt map

◆ wmiTable

struct table3d8RpmLoad wmiTable
extern

8x8 wmi map