6#include <SimplyAtomic.h>
21#define SIMPLE_BOOST_P 1
22#define SIMPLE_BOOST_I 1
23#define SIMPLE_BOOST_D 1
25#if(defined(CORE_TEENSY) || defined(CORE_STM32))
26#define BOOST_PIN_LOW() (digitalWrite(pinBoost, LOW))
27#define BOOST_PIN_HIGH() (digitalWrite(pinBoost, HIGH))
28#define VVT1_PIN_LOW() (digitalWrite(pinVVT_1, LOW))
29#define VVT1_PIN_HIGH() (digitalWrite(pinVVT_1, HIGH))
30#define VVT2_PIN_LOW() (digitalWrite(pinVVT_2, LOW))
31#define VVT2_PIN_HIGH() (digitalWrite(pinVVT_2, HIGH))
32#define FAN_PIN_LOW() (digitalWrite(pinFan, LOW))
33#define FAN_PIN_HIGH() (digitalWrite(pinFan, HIGH))
34#define N2O_STAGE1_PIN_LOW() (digitalWrite(configPage10.n2o_stage1_pin, LOW))
35#define N2O_STAGE1_PIN_HIGH() (digitalWrite(configPage10.n2o_stage1_pin, HIGH))
36#define N2O_STAGE2_PIN_LOW() (digitalWrite(configPage10.n2o_stage2_pin, LOW))
37#define N2O_STAGE2_PIN_HIGH() (digitalWrite(configPage10.n2o_stage2_pin, HIGH))
38#define AIRCON_PIN_LOW() (digitalWrite(pinAirConComp, LOW))
39#define AIRCON_PIN_HIGH() (digitalWrite(pinAirConComp, HIGH))
40#define AIRCON_FAN_PIN_LOW() (digitalWrite(pinAirConFan, LOW))
41#define AIRCON_FAN_PIN_HIGH() (digitalWrite(pinAirConFan, HIGH))
42#define FUEL_PUMP_ON() (digitalWrite(pinFuelPump, HIGH))
43#define FUEL_PUMP_OFF() (digitalWrite(pinFuelPump, LOW))
47#define BOOST_PIN_LOW() ATOMIC() { *boost_pin_port &= ~(boost_pin_mask); }
48#define BOOST_PIN_HIGH() ATOMIC() { *boost_pin_port |= (boost_pin_mask); }
49#define VVT1_PIN_LOW() ATOMIC() { *vvt1_pin_port &= ~(vvt1_pin_mask); }
50#define VVT1_PIN_HIGH() ATOMIC() { *vvt1_pin_port |= (vvt1_pin_mask); }
51#define VVT2_PIN_LOW() ATOMIC() { *vvt2_pin_port &= ~(vvt2_pin_mask); }
52#define VVT2_PIN_HIGH() ATOMIC() { *vvt2_pin_port |= (vvt2_pin_mask); }
53#define N2O_STAGE1_PIN_LOW() ATOMIC() { *n2o_stage1_pin_port &= ~(n2o_stage1_pin_mask); }
54#define N2O_STAGE1_PIN_HIGH() ATOMIC() { *n2o_stage1_pin_port |= (n2o_stage1_pin_mask); }
55#define N2O_STAGE2_PIN_LOW() ATOMIC() { *n2o_stage2_pin_port &= ~(n2o_stage2_pin_mask); }
56#define N2O_STAGE2_PIN_HIGH() ATOMIC() { *n2o_stage2_pin_port |= (n2o_stage2_pin_mask); }
57#define FUEL_PUMP_ON() ATOMIC() { *pump_pin_port |= (pump_pin_mask); }
58#define FUEL_PUMP_OFF() ATOMIC() { *pump_pin_port &= ~(pump_pin_mask); }
61#define FAN_PIN_LOW() *fan_pin_port &= ~(fan_pin_mask)
62#define FAN_PIN_HIGH() *fan_pin_port |= (fan_pin_mask)
63#define AIRCON_PIN_LOW() *aircon_comp_pin_port &= ~(aircon_comp_pin_mask)
64#define AIRCON_PIN_HIGH() *aircon_comp_pin_port |= (aircon_comp_pin_mask)
65#define AIRCON_FAN_PIN_LOW() *aircon_fan_pin_port &= ~(aircon_fan_pin_mask)
66#define AIRCON_FAN_PIN_HIGH() *aircon_fan_pin_port |= (aircon_fan_pin_mask)
70#define AIRCON_ON() ATOMIC() { ((((configPage15.airConCompPol)==1)) ? AIRCON_PIN_LOW() : AIRCON_PIN_HIGH()); BIT_SET(currentStatus.airConStatus, BIT_AIRCON_COMPRESSOR); }
71#define AIRCON_OFF() ATOMIC() { ((((configPage15.airConCompPol)==1)) ? AIRCON_PIN_HIGH() : AIRCON_PIN_LOW()); BIT_CLEAR(currentStatus.airConStatus, BIT_AIRCON_COMPRESSOR); }
72#define AIRCON_FAN_ON() ATOMIC() { ((((configPage15.airConFanPol)==1)) ? AIRCON_FAN_PIN_LOW() : AIRCON_FAN_PIN_HIGH()); BIT_SET(currentStatus.airConStatus, BIT_AIRCON_FAN); }
73#define AIRCON_FAN_OFF() ATOMIC() { ((((configPage15.airConFanPol)==1)) ? AIRCON_FAN_PIN_HIGH() : AIRCON_FAN_PIN_LOW()); BIT_CLEAR(currentStatus.airConStatus, BIT_AIRCON_FAN); }
75#define FAN_ON() ATOMIC() { ((configPage6.fanInv) ? FAN_PIN_LOW() : FAN_PIN_HIGH()); }
76#define FAN_OFF() ATOMIC() { ((configPage6.fanInv) ? FAN_PIN_HIGH() : FAN_PIN_LOW()); }
78#define READ_N2O_ARM_PIN() ((*n2o_arming_pin_port & n2o_arming_pin_mask) ? true : false)
80#define VVT1_PIN_ON() VVT1_PIN_HIGH();
81#define VVT1_PIN_OFF() VVT1_PIN_LOW();
82#define VVT2_PIN_ON() VVT2_PIN_HIGH();
83#define VVT2_PIN_OFF() VVT2_PIN_LOW();
84#define VVT_TIME_DELAY_MULTIPLIER 50
86#define WMI_TANK_IS_EMPTY() ((configPage10.wmiEmptyEnabled) ? ((configPage10.wmiEmptyPolarity) ? digitalRead(pinWMIEmpty) : !digitalRead(pinWMIEmpty)) : 1)
95#if defined(PWM_FAN_AVAILABLE)
96extern uint16_t fan_pwm_max_count;
97void fanInterrupt(
void);
volatile PORT_TYPE * fan_pin_port
Definition auxiliaries.cpp:47
void initialiseAirCon(void)
Definition auxiliaries.cpp:88
void initialiseFan(void)
Definition auxiliaries.cpp:315
void vvtInterrupt(void)
Definition auxiliaries.cpp:1146
volatile PINMASK_TYPE vvt1_pin_mask
Definition auxiliaries.cpp:44
uint16_t vvt_pwm_max_count
Definition auxiliaries.cpp:72
void vvtControl(void)
Definition auxiliaries.cpp:779
volatile PINMASK_TYPE vvt2_pin_mask
Definition auxiliaries.cpp:46
void airConControl(void)
Definition auxiliaries.cpp:137
void boostControl(void)
Definition auxiliaries.cpp:682
volatile PORT_TYPE * vvt2_pin_port
Definition auxiliaries.cpp:45
void wmiControl(void)
Definition auxiliaries.cpp:1032
bool READ_AIRCON_REQUEST(void)
Definition auxiliaries.cpp:213
void fanControl(void)
Definition auxiliaries.cpp:335
volatile PINMASK_TYPE fan_pin_mask
Definition auxiliaries.cpp:48
volatile PORT_TYPE * vvt1_pin_port
Definition auxiliaries.cpp:43
void initialiseAuxPWM(void)
Definition auxiliaries.cpp:448
void nitrousControl(void)
Definition auxiliaries.cpp:975
uint16_t boost_pwm_max_count
Definition auxiliaries.cpp:73
void boostByGear(void)
Definition auxiliaries.cpp:542
void boostInterrupt(void)
Definition auxiliaries.cpp:1116
void boostDisable(void)
Definition auxiliaries.cpp:1104