Speeduino
Loading...
Searching...
No Matches
load_source.h
Go to the documentation of this file.
1#pragma once
2
3#include "statuses.h"
4
20
30 {
31 //Alpha-N
32 return current.TPS * 2U;
33 }
35 {
36 //IMAP / EMAP
37 return ((int16_t)current.MAP * 100) / current.EMAP;
38 } else {
39 // LOAD_SOURCE_MAP (the default). Aka Speed Density
40 return current.MAP;
41 }
42}
static uint32_t rshift(uint32_t a)
Bitwise right shift - generic, unoptimized, case.
Definition bit_shifts.h:349
LoadSource
The load source for various tables.
Definition load_source.h:8
@ LOAD_SOURCE_TPS
Definition load_source.h:14
@ LOAD_SOURCE_IMAPEMAP
Definition load_source.h:18
@ LOAD_SOURCE_MAP
Definition load_source.h:12
static int16_t getLoad(LoadSource algorithm, const statuses &current)
Get the load value, based the supplied algorithm.
Definition load_source.h:28
The statuses struct and related defines.
The status struct with current values for all 'live' variables.
Definition statuses.h:98