Technical debt: ENUM_32_BITS #3874

This commit is contained in:
rusefillc 2022-05-01 13:51:36 -04:00
parent 7dd26a661f
commit 6aa2c54768
2 changed files with 12 additions and 28 deletions

View File

@ -36,12 +36,11 @@ typedef enum __attribute__ ((__packed__))
PIN_INVALID = 0x80
} brain_pin_diag_e;
typedef enum {
typedef enum __attribute__ ((__packed__)) {
ADC_OFF = 0,
ADC_SLOW = 1,
ADC_FAST = 2,
Force_4_bytes_size_adc_channel_mode = ENUM_32_BITS,
} adc_channel_mode_e;
typedef enum {
@ -128,7 +127,7 @@ typedef enum __attribute__ ((__packed__)) {
/**
* This enum is used to select your desired Engine Load calculation algorithm
*/
typedef enum {
typedef enum __attribute__ ((__packed__)) {
/**
* Speed Density algorithm - Engine Load is a function of MAP, VE and target AFR
* http://articles.sae.org/8539/
@ -147,15 +146,13 @@ typedef enum {
// This mode is for unit testing only, so that tests don't have to rely on a particular real airmass mode
LM_MOCK = 100,
Force_4_bytes_size_engine_load_mode = ENUM_32_BITS,
} engine_load_mode_e;
typedef enum {
typedef enum __attribute__ ((__packed__)) {
DM_NONE = 0,
DM_HD44780 = 1,
DM_HD44780_OVER_PCF8574 = 2,
Force_4_bytes_size_display_mode = ENUM_32_BITS,
} display_mode_e;
@ -256,7 +253,7 @@ typedef enum {
/**
* @brief Ignition Mode
*/
typedef enum {
typedef enum __attribute__ ((__packed__)) {
/**
* in this mode only SPARKOUT_1_OUTPUT is used
*/
@ -272,13 +269,12 @@ typedef enum {
*/
IM_TWO_COILS = 3,
Force_4_bytes_size_ignition_mode = ENUM_32_BITS,
} ignition_mode_e;
/**
* @see getNumberOfInjections
*/
typedef enum {
typedef enum __attribute__ ((__packed__)) {
/**
* each cylinder has it's own injector but they all works in parallel
*/
@ -303,17 +299,6 @@ typedef enum {
Force_4_bytes_size_injection_mode = ENUM_32_BITS,
} injection_mode_e;
/**
* @brief Ignition Mode while cranking
*/
typedef enum {
CIM_DEFAULT = 0,
CIM_FIXED_ANGLE = 1,
// todo: make this a one byte enum
Force_4_bytes_size_cranking_ignition_mode = ENUM_32_BITS,
} cranking_ignition_mode_e;
typedef enum __attribute__ ((__packed__)) {
UART_NONE = 0,
UART_DEVICE_1 = 1,
@ -573,10 +558,9 @@ typedef enum {
Force_4bytes_size_launchActivationMode_e = ENUM_32_BITS,
} launchActivationMode_e;
typedef enum {
typedef enum __attribute__ ((__packed__)) {
SWITCH_INPUT_ANTILAG = 0,
ALWAYS_ON_ANTILAG = 1,
Force_4bytes_size_antiLagActivationMode_e = ENUM_32_BITS,
} antiLagActivationMode_e;
typedef enum __attribute__ ((__packed__)) {

View File

@ -529,17 +529,17 @@ end_struct
#define engine_load_mode_e_enum "INVALID", "INVALID", "INVALID", "Speed Density", "MAF Air Charge", "Alpha-N", "Lua"
custom engine_load_mode_e 4 bits, U32, @OFFSET@, [0:2], @@engine_load_mode_e_enum@@
custom engine_load_mode_e 1 bits, U08, @OFFSET@, [0:2], @@engine_load_mode_e_enum@@
engine_load_mode_e fuelAlgorithm;+This setting controls which fuel quantity control algorithm is used.\nAlpha-N means drive by TPS commonly only used for NA engines\nSpeed Density requires MAP sensor and is the default choice for may installs\nMAF air charge is a cylinder filling based method that uses a mass air flow sensor.;
custom injection_mode_e 4 bits, U32, @OFFSET@, [0:1], "Simultaneous", "Sequential", "Batch", "Single Point"
custom injection_mode_e 1 bits, U08, @OFFSET@, [0:1], "Simultaneous", "Sequential", "Batch", "Single Point"
injection_mode_e crankingInjectionMode;+This is the injection strategy during engine start. See Fuel/Injection settings for more detail. It is suggested to use "Simultaneous".
injection_mode_e injectionMode;+This is where the fuel injection type is defined: "Simultaneous" means all injectors will fire together at once. "Sequential" fires the injectors on a per cylinder basis, which requires individually wired injectors. "Batched" will fire the injectors in groups. If your injectors are individually wired you will also need to enable "Two wire batch emulation". \nset injection_mode X\nSee also twoWireBatchInjection
angle_t extraInjectionOffset;+this is about deciding when the injector starts it's squirt\nSee also injectionPhase map\ntodo: do we need even need this since we have the map anyway?;"deg", 1, 0, -720, 720, 2
angle_t crankingTimingAngle;+Ignition advance angle used during engine cranking, 5-10 degrees will work as a base setting for most engines.\nThere is tapering towards running timing advance\nset cranking_timing_angle X;"deg", 1, 0, -30, 30, 0
custom ignition_mode_e 4 bits, U32, @OFFSET@, [0:1], "Single Coil", "Individual Coils", "Wasted Spark", "Two Distributors"
custom ignition_mode_e 1 bits, U08, @OFFSET@, [0:1], "Single Coil", "Individual Coils", "Wasted Spark", "Two Distributors"
ignition_mode_e ignitionMode;+Single coil = distributor\nIndividual coils = one coil per cylinder (COP, coil-near-plug), requires sequential mode\nWasted spark = Fires pairs of cylinders together, either one coil per pair of cylinders or one coil per cylinder\nTwo distributors = A pair of distributors, found on some BMW, Toyota and other engines\nset ignition_mode X
int8_t gapTrackingLengthOverride;How many consecutive gap rations have to match expected ranges for sync to happen;"count", 1, 0, 0, @@GAP_TRACKING_LENGTH@@, 0
@ -569,7 +569,7 @@ can_nbc_e canNbcType;set can_mode X
int canSleepPeriodMs;CANbus thread period in ms;"ms", 1, 0, 0, 1000, 2
custom display_mode_e 4 bits, U32, @OFFSET@, [0:1], "none", "hd44780", "hd44780 over pcf8574", "INVALID"
custom display_mode_e 1 bits, U08, @OFFSET@, [0:1], "none", "hd44780", "hd44780 over pcf8574", "INVALID"
display_mode_e displayMode;
int byFirmwareVersion;;"index", 1, 0, 0, 300, 0
@ -707,7 +707,7 @@ spi_device_e digitalPotentiometerSpiDevice;Digital Potentiometer is used by stoc
Gpio mc33972_cs;
pin_output_mode_e mc33972_csPinMode;
custom adc_channel_mode_e 4 bits, U32, @OFFSET@, [0:1], "Off", "Slow", "Fast"
custom adc_channel_mode_e 1 bits, U08, @OFFSET@, [0:1], "Off", "Slow", "Fast"
adc_channel_e auxFastSensor1_adcChannel;Useful in Research&Development phase
adc_channel_e tps1_2AdcChannel;First throttle body, second sensor.
@ -960,7 +960,7 @@ bit verboseCan2,"Print all","Do not print";Print incoming and outgoing second bu
launchActivationMode_e launchActivationMode;
#define antiLagActivationMode_e_enum "Always Active", "Switch Input"
custom antiLagActivationMode_e 4 bits, S32, @OFFSET@, [0:0], @@antiLagActivationMode_e_enum@@
custom antiLagActivationMode_e 1 bits, S08, @OFFSET@, [0:0], @@antiLagActivationMode_e_enum@@
antiLagActivationMode_e antiLagActivationMode;
int launchSpeedThreshold;+Disabled above this speed;"Kph", 1, 0, 0, 300, 0