speeduino/speeduino/auxiliaries.h

114 lines
6.7 KiB
C
Raw Normal View History

2016-10-06 23:34:27 -07:00
#ifndef AUX_H
#define AUX_H
#include BOARD_H //Note that this is not a real file, it is defined in globals.h.
#if defined(CORE_AVR)
#include <util/atomic.h>
#endif
2022-11-05 15:43:29 -07:00
void initialiseAuxPWM(void);
void boostControl(void);
void boostDisable(void);
void boostByGear(void);
void vvtControl(void);
void initialiseFan(void);
void initialiseAirCon(void);
void nitrousControl(void);
void fanControl(void);
void airConControl(void);
bool READ_AIRCON_REQUEST(void);
void wmiControl(void);
#define SIMPLE_BOOST_P 1
#define SIMPLE_BOOST_I 1
#define SIMPLE_BOOST_D 1
#if(defined(CORE_TEENSY) || defined(CORE_STM32))
#define BOOST_PIN_LOW() (digitalWrite(pinBoost, LOW))
#define BOOST_PIN_HIGH() (digitalWrite(pinBoost, HIGH))
#define VVT1_PIN_LOW() (digitalWrite(pinVVT_1, LOW))
#define VVT1_PIN_HIGH() (digitalWrite(pinVVT_1, HIGH))
#define VVT2_PIN_LOW() (digitalWrite(pinVVT_2, LOW))
#define VVT2_PIN_HIGH() (digitalWrite(pinVVT_2, HIGH))
#define FAN_PIN_LOW() (digitalWrite(pinFan, LOW))
#define FAN_PIN_HIGH() (digitalWrite(pinFan, HIGH))
#define N2O_STAGE1_PIN_LOW() (digitalWrite(configPage10.n2o_stage1_pin, LOW))
#define N2O_STAGE1_PIN_HIGH() (digitalWrite(configPage10.n2o_stage1_pin, HIGH))
#define N2O_STAGE2_PIN_LOW() (digitalWrite(configPage10.n2o_stage2_pin, LOW))
#define N2O_STAGE2_PIN_HIGH() (digitalWrite(configPage10.n2o_stage2_pin, HIGH))
Air Conditioning Control - Feature Implementation (#665) * 19.09.2021 * Final testing of AC Control, some idle features fixed AC control feature added, better than the existing idle-up feature (which can still be used for other things, e.g. electrical load detection). Air conditioning is locked out with coolant temp, RPM high/low, and high TPS. So the A/C automatically cuts out when driving hard. Idle step now works correctly with closed loop PWM, open loop PWM, and closed+open loop PWM. Untested with stepper motor, but no reason it shouldn't work. * Fixed mistakenly incremented page sizes * Initial changes as per HWright9 -Renamed engineRunSeconds to acAfterEngineStartDelay -Formatted large if statements better -Fixed acStartDelay overflow bug -Improved readability of logic * Final fixes as per HWright9's feedback -Add high/low RPM lockout delay, similar to the high TPM lockout delay -General tidy-up * Added stand-alone fan, moved config data in EEPROM -Added additional configurable stand-alone A/C fan output, for when there is dedicated cooling fan for the A/C compressor. This is independent of the engine cooling fan logic. -Moved config storage in EEPROM to configPage9, as noisymime's SD card logging has used the (previously unused) bytes I had used in configPage13. -Minor bug fix - rename Aux in 1-16 to Aux in 0-15 * Revert to current master branch - as of master commit 97f8ef795a514c9a5693e85be6cdb8bdee8ef2c5 * A/C Control Re-Integrated from AC-Control-Clean-3 (@Corey-Harding). Tested & ready to merge. Additionally, added @HazuTo25's lines into the update() routine to configure default A/C settings. * Changed updates.ino to just set A/C to disabled * Fix change reverted by mistake - master merge commit 73badbce8ca171faa8c58575947917829adfc1ba * Fix remaining mistakes from previous master merge * Remove test statements left in by mistake * define unusedBits * Remove test statements left in by mistake * Increase timing granularity to 0.1s * idleUpRPMAdder * Remove another line put in by mistake by auto merge * idleUpRPMFixes * Update speeduino.ino * Tweak A/C idle up descriptions * Tweak A/C TS descriptors again * Fixed alignment bug that turned page 15 config values into gobbledegook. This had the symptom of the A/C request never triggering, because when a pin was assigned in TS (e.g. I did 27), a completely different pin would be read from config15 (in my case 22 - connecting the button to pin 22 would work in this case, even though TS was set to 27). * Fix bit count - should be 6 to match ini file * Increase minimum RPM lockout granularity * Change granularity of A/C minimum RPM lockout to 10 RPM; Inline some functions for readability * Add static inline function prototypes to auxiliaries.h as per the style guide. * Fixed page 15 merge errors * Style changes to suit new pinIsUsed() checks in setPinMappings() * Add PWM Fan Control Minimum Clamp Value when A/C Compressor Engaged * Fix comment * Fix bug with stand-alone fan initialisation Pin was unable to be used in prog. I/O even if fan was disabled, because it was always initialised as an output even if it was disabled. Fixed in this commit. * Correction to Fahrenheit temperature scaling * Move A/C updates to correct next release Co-authored-by: shiznit304 <62686180+shiznit304@users.noreply.github.com> Co-authored-by: Josh Stewart <josh@noisymime.org>
2022-09-06 17:23:01 -07:00
#define AIRCON_PIN_LOW() (digitalWrite(pinAirConComp, LOW))
#define AIRCON_PIN_HIGH() (digitalWrite(pinAirConComp, HIGH))
#define AIRCON_FAN_PIN_LOW() (digitalWrite(pinAirConFan, LOW))
#define AIRCON_FAN_PIN_HIGH() (digitalWrite(pinAirConFan, HIGH))
#define FUEL_PUMP_ON() (digitalWrite(pinFuelPump, HIGH))
#define FUEL_PUMP_OFF() (digitalWrite(pinFuelPump, LOW))
#define AIRCON_ON() { (((configPage15.airConCompPol==1)) ? AIRCON_PIN_LOW() : AIRCON_PIN_HIGH()); BIT_SET(currentStatus.airConStatus, BIT_AIRCON_COMPRESSOR); }
#define AIRCON_OFF() { (((configPage15.airConCompPol==1)) ? AIRCON_PIN_HIGH() : AIRCON_PIN_LOW()); BIT_CLEAR(currentStatus.airConStatus, BIT_AIRCON_COMPRESSOR); }
#define AIRCON_FAN_ON() { (((configPage15.airConFanPol==1)) ? AIRCON_FAN_PIN_LOW() : AIRCON_FAN_PIN_HIGH()); BIT_SET(currentStatus.airConStatus, BIT_AIRCON_FAN); }
#define AIRCON_FAN_OFF() { (((configPage15.airConFanPol==1)) ? AIRCON_FAN_PIN_HIGH() : AIRCON_FAN_PIN_LOW()); BIT_CLEAR(currentStatus.airConStatus, BIT_AIRCON_FAN); }
#define FAN_ON() { ((configPage6.fanInv) ? FAN_PIN_LOW() : FAN_PIN_HIGH()); }
#define FAN_OFF() { ((configPage6.fanInv) ? FAN_PIN_HIGH() : FAN_PIN_LOW()); }
#else
#define BOOST_PIN_LOW() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *boost_pin_port &= ~(boost_pin_mask); }
#define BOOST_PIN_HIGH() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *boost_pin_port |= (boost_pin_mask); }
#define VVT1_PIN_LOW() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *vvt1_pin_port &= ~(vvt1_pin_mask); }
#define VVT1_PIN_HIGH() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *vvt1_pin_port |= (vvt1_pin_mask); }
#define VVT2_PIN_LOW() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *vvt2_pin_port &= ~(vvt2_pin_mask); }
#define VVT2_PIN_HIGH() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *vvt2_pin_port |= (vvt2_pin_mask); }
#define N2O_STAGE1_PIN_LOW() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *n2o_stage1_pin_port &= ~(n2o_stage1_pin_mask); }
#define N2O_STAGE1_PIN_HIGH() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *n2o_stage1_pin_port |= (n2o_stage1_pin_mask); }
#define N2O_STAGE2_PIN_LOW() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *n2o_stage2_pin_port &= ~(n2o_stage2_pin_mask); }
#define N2O_STAGE2_PIN_HIGH() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *n2o_stage2_pin_port |= (n2o_stage2_pin_mask); }
#define FUEL_PUMP_ON() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *pump_pin_port |= (pump_pin_mask); }
#define FUEL_PUMP_OFF() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { *pump_pin_port &= ~(pump_pin_mask); }
//Note the below macros cannot use ATOMIC_BLOCK(ATOMIC_RESTORESTATE) as they are called from within ternary operators. The ATOMIC_BLOCK wrapped is instead placed around the ternary call below
#define FAN_PIN_LOW() *fan_pin_port &= ~(fan_pin_mask)
#define FAN_PIN_HIGH() *fan_pin_port |= (fan_pin_mask)
#define AIRCON_PIN_LOW() *aircon_comp_pin_port &= ~(aircon_comp_pin_mask)
#define AIRCON_PIN_HIGH() *aircon_comp_pin_port |= (aircon_comp_pin_mask)
Air Conditioning Control - Feature Implementation (#665) * 19.09.2021 * Final testing of AC Control, some idle features fixed AC control feature added, better than the existing idle-up feature (which can still be used for other things, e.g. electrical load detection). Air conditioning is locked out with coolant temp, RPM high/low, and high TPS. So the A/C automatically cuts out when driving hard. Idle step now works correctly with closed loop PWM, open loop PWM, and closed+open loop PWM. Untested with stepper motor, but no reason it shouldn't work. * Fixed mistakenly incremented page sizes * Initial changes as per HWright9 -Renamed engineRunSeconds to acAfterEngineStartDelay -Formatted large if statements better -Fixed acStartDelay overflow bug -Improved readability of logic * Final fixes as per HWright9's feedback -Add high/low RPM lockout delay, similar to the high TPM lockout delay -General tidy-up * Added stand-alone fan, moved config data in EEPROM -Added additional configurable stand-alone A/C fan output, for when there is dedicated cooling fan for the A/C compressor. This is independent of the engine cooling fan logic. -Moved config storage in EEPROM to configPage9, as noisymime's SD card logging has used the (previously unused) bytes I had used in configPage13. -Minor bug fix - rename Aux in 1-16 to Aux in 0-15 * Revert to current master branch - as of master commit 97f8ef795a514c9a5693e85be6cdb8bdee8ef2c5 * A/C Control Re-Integrated from AC-Control-Clean-3 (@Corey-Harding). Tested & ready to merge. Additionally, added @HazuTo25's lines into the update() routine to configure default A/C settings. * Changed updates.ino to just set A/C to disabled * Fix change reverted by mistake - master merge commit 73badbce8ca171faa8c58575947917829adfc1ba * Fix remaining mistakes from previous master merge * Remove test statements left in by mistake * define unusedBits * Remove test statements left in by mistake * Increase timing granularity to 0.1s * idleUpRPMAdder * Remove another line put in by mistake by auto merge * idleUpRPMFixes * Update speeduino.ino * Tweak A/C idle up descriptions * Tweak A/C TS descriptors again * Fixed alignment bug that turned page 15 config values into gobbledegook. This had the symptom of the A/C request never triggering, because when a pin was assigned in TS (e.g. I did 27), a completely different pin would be read from config15 (in my case 22 - connecting the button to pin 22 would work in this case, even though TS was set to 27). * Fix bit count - should be 6 to match ini file * Increase minimum RPM lockout granularity * Change granularity of A/C minimum RPM lockout to 10 RPM; Inline some functions for readability * Add static inline function prototypes to auxiliaries.h as per the style guide. * Fixed page 15 merge errors * Style changes to suit new pinIsUsed() checks in setPinMappings() * Add PWM Fan Control Minimum Clamp Value when A/C Compressor Engaged * Fix comment * Fix bug with stand-alone fan initialisation Pin was unable to be used in prog. I/O even if fan was disabled, because it was always initialised as an output even if it was disabled. Fixed in this commit. * Correction to Fahrenheit temperature scaling * Move A/C updates to correct next release Co-authored-by: shiznit304 <62686180+shiznit304@users.noreply.github.com> Co-authored-by: Josh Stewart <josh@noisymime.org>
2022-09-06 17:23:01 -07:00
#define AIRCON_FAN_PIN_LOW() *aircon_fan_pin_port &= ~(aircon_fan_pin_mask)
#define AIRCON_FAN_PIN_HIGH() *aircon_fan_pin_port |= (aircon_fan_pin_mask)
#define AIRCON_ON() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ((((configPage15.airConCompPol)==1)) ? AIRCON_PIN_LOW() : AIRCON_PIN_HIGH()); BIT_SET(currentStatus.airConStatus, BIT_AIRCON_COMPRESSOR); }
#define AIRCON_OFF() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ((((configPage15.airConCompPol)==1)) ? AIRCON_PIN_HIGH() : AIRCON_PIN_LOW()); BIT_CLEAR(currentStatus.airConStatus, BIT_AIRCON_COMPRESSOR); }
#define AIRCON_FAN_ON() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ((((configPage15.airConFanPol)==1)) ? AIRCON_FAN_PIN_LOW() : AIRCON_FAN_PIN_HIGH()); BIT_SET(currentStatus.airConStatus, BIT_AIRCON_FAN); }
#define AIRCON_FAN_OFF() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ((((configPage15.airConFanPol)==1)) ? AIRCON_FAN_PIN_HIGH() : AIRCON_FAN_PIN_LOW()); BIT_CLEAR(currentStatus.airConStatus, BIT_AIRCON_FAN); }
#define FAN_ON() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ((configPage6.fanInv) ? FAN_PIN_LOW() : FAN_PIN_HIGH()); }
#define FAN_OFF() ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ((configPage6.fanInv) ? FAN_PIN_HIGH() : FAN_PIN_LOW()); }
#endif
#define READ_N2O_ARM_PIN() ((*n2o_arming_pin_port & n2o_arming_pin_mask) ? true : false)
Air Conditioning Control - Feature Implementation (#665) * 19.09.2021 * Final testing of AC Control, some idle features fixed AC control feature added, better than the existing idle-up feature (which can still be used for other things, e.g. electrical load detection). Air conditioning is locked out with coolant temp, RPM high/low, and high TPS. So the A/C automatically cuts out when driving hard. Idle step now works correctly with closed loop PWM, open loop PWM, and closed+open loop PWM. Untested with stepper motor, but no reason it shouldn't work. * Fixed mistakenly incremented page sizes * Initial changes as per HWright9 -Renamed engineRunSeconds to acAfterEngineStartDelay -Formatted large if statements better -Fixed acStartDelay overflow bug -Improved readability of logic * Final fixes as per HWright9's feedback -Add high/low RPM lockout delay, similar to the high TPM lockout delay -General tidy-up * Added stand-alone fan, moved config data in EEPROM -Added additional configurable stand-alone A/C fan output, for when there is dedicated cooling fan for the A/C compressor. This is independent of the engine cooling fan logic. -Moved config storage in EEPROM to configPage9, as noisymime's SD card logging has used the (previously unused) bytes I had used in configPage13. -Minor bug fix - rename Aux in 1-16 to Aux in 0-15 * Revert to current master branch - as of master commit 97f8ef795a514c9a5693e85be6cdb8bdee8ef2c5 * A/C Control Re-Integrated from AC-Control-Clean-3 (@Corey-Harding). Tested & ready to merge. Additionally, added @HazuTo25's lines into the update() routine to configure default A/C settings. * Changed updates.ino to just set A/C to disabled * Fix change reverted by mistake - master merge commit 73badbce8ca171faa8c58575947917829adfc1ba * Fix remaining mistakes from previous master merge * Remove test statements left in by mistake * define unusedBits * Remove test statements left in by mistake * Increase timing granularity to 0.1s * idleUpRPMAdder * Remove another line put in by mistake by auto merge * idleUpRPMFixes * Update speeduino.ino * Tweak A/C idle up descriptions * Tweak A/C TS descriptors again * Fixed alignment bug that turned page 15 config values into gobbledegook. This had the symptom of the A/C request never triggering, because when a pin was assigned in TS (e.g. I did 27), a completely different pin would be read from config15 (in my case 22 - connecting the button to pin 22 would work in this case, even though TS was set to 27). * Fix bit count - should be 6 to match ini file * Increase minimum RPM lockout granularity * Change granularity of A/C minimum RPM lockout to 10 RPM; Inline some functions for readability * Add static inline function prototypes to auxiliaries.h as per the style guide. * Fixed page 15 merge errors * Style changes to suit new pinIsUsed() checks in setPinMappings() * Add PWM Fan Control Minimum Clamp Value when A/C Compressor Engaged * Fix comment * Fix bug with stand-alone fan initialisation Pin was unable to be used in prog. I/O even if fan was disabled, because it was always initialised as an output even if it was disabled. Fixed in this commit. * Correction to Fahrenheit temperature scaling * Move A/C updates to correct next release Co-authored-by: shiznit304 <62686180+shiznit304@users.noreply.github.com> Co-authored-by: Josh Stewart <josh@noisymime.org>
2022-09-06 17:23:01 -07:00
#define VVT1_PIN_ON() VVT1_PIN_HIGH();
#define VVT1_PIN_OFF() VVT1_PIN_LOW();
#define VVT2_PIN_ON() VVT2_PIN_HIGH();
#define VVT2_PIN_OFF() VVT2_PIN_LOW();
2021-09-10 17:42:39 -07:00
#define VVT_TIME_DELAY_MULTIPLIER 50
2022-01-04 15:33:33 -08:00
#define WMI_TANK_IS_EMPTY() ((configPage10.wmiEmptyEnabled) ? ((configPage10.wmiEmptyPolarity) ? digitalRead(pinWMIEmpty) : !digitalRead(pinWMIEmpty)) : 1)
extern volatile PORT_TYPE *vvt1_pin_port;
extern volatile PINMASK_TYPE vvt1_pin_mask;
extern volatile PORT_TYPE *vvt2_pin_port;
extern volatile PINMASK_TYPE vvt2_pin_mask;
extern volatile PORT_TYPE *fan_pin_port;
extern volatile PINMASK_TYPE fan_pin_mask;
#if defined(PWM_FAN_AVAILABLE)//PWM fan not available on Arduino MEGA
Performance: optimize division (#1082) * Add udiv_32_16 * Apply udiv_32_16() where possible * Convert udiv_32_16 to assembler It's worth 20 loop/s * Remove unused functions * Remove degreesPeruSx2048 - unused * Remove angleToTime - replace with direct calls 1. Drop angleToTime() It's slow, only partially implemented and adds zero value (and has MISRA violations) 2. Consistent function naming 3. Doxygen * triggerPri_Nissan360 shouldn't set timePerDegree. It will be overwritten every loop by doCrankSpeedCalcs() * Use angleToTimeMicroSecPerDegree() instead of timePerDegree No loss in performance Increased injection open/close time accuracy (so unit test values must change) Can remove timePerDegree global. * Hide (encapsulate) crank math globals. * Base all angle to time conversions on decoder computed variables. This is within 2us of the revolution based method and is much faster - which is essentially zero percent change. * Performance: move calculation of degreesPeruSx32768 into decoders. Remove doCrankSpeedCalcs() - it's doing nothing at the moment. * Apply libdivide to triggerSetEndTeeth functions. Since triggerToothAngle is set once at initialization time, we can generate the libdivide struct once and reuse it many times. * Remove lastToothCalcAdvance - unused * Replace 16-bit division with shift * Replace 32-bit divison with 16-bit division * Avoid 32-bit division; use div100() * inline percentage() * Optimize div100() * MISRA fixes * Replace magic numbers with #defs * Replace libdivide structs with inline constants No perf or memory changes * Use fixed types for PWM max count variables * Accurate rounded integer division * Formalise rounding behavior (DIV_ROUND_CORRECT) * Apply DIV_ROUND_CORRECT to DIV_ROUND_CLOSEST(), UDIV_ROUND_CLOSEST(), div100(), div360(), percentage() & halfPercentage() * Add, fix & improve unit tests * Add udiv_32_16_closest() * Perf: Limit percentage calculations to 16-bits * MISRA fixes * Add compare_executiontime() to encapsulate common perf testing code * Signed to unsigned division * Convert ignitionLimits() to an inline function. Slight speed up, probably due to removing multiple evaluations of macro arguments. * Split unit tests up. * udiv_32_16 - check for valid parameters
2023-11-05 14:10:08 -08:00
extern uint16_t fan_pwm_max_count; //Used for variable PWM frequency
2022-11-05 15:43:29 -07:00
void fanInterrupt(void);
#endif
Performance: optimize division (#1082) * Add udiv_32_16 * Apply udiv_32_16() where possible * Convert udiv_32_16 to assembler It's worth 20 loop/s * Remove unused functions * Remove degreesPeruSx2048 - unused * Remove angleToTime - replace with direct calls 1. Drop angleToTime() It's slow, only partially implemented and adds zero value (and has MISRA violations) 2. Consistent function naming 3. Doxygen * triggerPri_Nissan360 shouldn't set timePerDegree. It will be overwritten every loop by doCrankSpeedCalcs() * Use angleToTimeMicroSecPerDegree() instead of timePerDegree No loss in performance Increased injection open/close time accuracy (so unit test values must change) Can remove timePerDegree global. * Hide (encapsulate) crank math globals. * Base all angle to time conversions on decoder computed variables. This is within 2us of the revolution based method and is much faster - which is essentially zero percent change. * Performance: move calculation of degreesPeruSx32768 into decoders. Remove doCrankSpeedCalcs() - it's doing nothing at the moment. * Apply libdivide to triggerSetEndTeeth functions. Since triggerToothAngle is set once at initialization time, we can generate the libdivide struct once and reuse it many times. * Remove lastToothCalcAdvance - unused * Replace 16-bit division with shift * Replace 32-bit divison with 16-bit division * Avoid 32-bit division; use div100() * inline percentage() * Optimize div100() * MISRA fixes * Replace magic numbers with #defs * Replace libdivide structs with inline constants No perf or memory changes * Use fixed types for PWM max count variables * Accurate rounded integer division * Formalise rounding behavior (DIV_ROUND_CORRECT) * Apply DIV_ROUND_CORRECT to DIV_ROUND_CLOSEST(), UDIV_ROUND_CLOSEST(), div100(), div360(), percentage() & halfPercentage() * Add, fix & improve unit tests * Add udiv_32_16_closest() * Perf: Limit percentage calculations to 16-bits * MISRA fixes * Add compare_executiontime() to encapsulate common perf testing code * Signed to unsigned division * Convert ignitionLimits() to an inline function. Slight speed up, probably due to removing multiple evaluations of macro arguments. * Split unit tests up. * udiv_32_16 - check for valid parameters
2023-11-05 14:10:08 -08:00
extern uint16_t vvt_pwm_max_count; //Used for variable PWM frequency
extern uint16_t boost_pwm_max_count; //Used for variable PWM frequency
2022-11-05 15:43:29 -07:00
void boostInterrupt(void);
void vvtInterrupt(void);
2016-05-15 04:05:49 -07:00
Air Conditioning Control - Feature Implementation (#665) * 19.09.2021 * Final testing of AC Control, some idle features fixed AC control feature added, better than the existing idle-up feature (which can still be used for other things, e.g. electrical load detection). Air conditioning is locked out with coolant temp, RPM high/low, and high TPS. So the A/C automatically cuts out when driving hard. Idle step now works correctly with closed loop PWM, open loop PWM, and closed+open loop PWM. Untested with stepper motor, but no reason it shouldn't work. * Fixed mistakenly incremented page sizes * Initial changes as per HWright9 -Renamed engineRunSeconds to acAfterEngineStartDelay -Formatted large if statements better -Fixed acStartDelay overflow bug -Improved readability of logic * Final fixes as per HWright9's feedback -Add high/low RPM lockout delay, similar to the high TPM lockout delay -General tidy-up * Added stand-alone fan, moved config data in EEPROM -Added additional configurable stand-alone A/C fan output, for when there is dedicated cooling fan for the A/C compressor. This is independent of the engine cooling fan logic. -Moved config storage in EEPROM to configPage9, as noisymime's SD card logging has used the (previously unused) bytes I had used in configPage13. -Minor bug fix - rename Aux in 1-16 to Aux in 0-15 * Revert to current master branch - as of master commit 97f8ef795a514c9a5693e85be6cdb8bdee8ef2c5 * A/C Control Re-Integrated from AC-Control-Clean-3 (@Corey-Harding). Tested & ready to merge. Additionally, added @HazuTo25's lines into the update() routine to configure default A/C settings. * Changed updates.ino to just set A/C to disabled * Fix change reverted by mistake - master merge commit 73badbce8ca171faa8c58575947917829adfc1ba * Fix remaining mistakes from previous master merge * Remove test statements left in by mistake * define unusedBits * Remove test statements left in by mistake * Increase timing granularity to 0.1s * idleUpRPMAdder * Remove another line put in by mistake by auto merge * idleUpRPMFixes * Update speeduino.ino * Tweak A/C idle up descriptions * Tweak A/C TS descriptors again * Fixed alignment bug that turned page 15 config values into gobbledegook. This had the symptom of the A/C request never triggering, because when a pin was assigned in TS (e.g. I did 27), a completely different pin would be read from config15 (in my case 22 - connecting the button to pin 22 would work in this case, even though TS was set to 27). * Fix bit count - should be 6 to match ini file * Increase minimum RPM lockout granularity * Change granularity of A/C minimum RPM lockout to 10 RPM; Inline some functions for readability * Add static inline function prototypes to auxiliaries.h as per the style guide. * Fixed page 15 merge errors * Style changes to suit new pinIsUsed() checks in setPinMappings() * Add PWM Fan Control Minimum Clamp Value when A/C Compressor Engaged * Fix comment * Fix bug with stand-alone fan initialisation Pin was unable to be used in prog. I/O even if fan was disabled, because it was always initialised as an output even if it was disabled. Fixed in this commit. * Correction to Fahrenheit temperature scaling * Move A/C updates to correct next release Co-authored-by: shiznit304 <62686180+shiznit304@users.noreply.github.com> Co-authored-by: Josh Stewart <josh@noisymime.org>
2022-09-06 17:23:01 -07:00
#endif