Reenable LED indicator on the calibration routing
This commit is contained in:
parent
be7e8359bc
commit
73f4058f6b
|
@ -93,8 +93,9 @@ upload_protocol = sam-ba
|
||||||
|
|
||||||
[platformio]
|
[platformio]
|
||||||
src_dir=speeduino
|
src_dir=speeduino
|
||||||
default_envs = black_F407VE
|
default_envs = megaatmega2560
|
||||||
;The following lines are for testing / experimentation only. Comment the line above to try them out
|
;The following lines are for testing / experimentation only. Comment the line above to try them out
|
||||||
|
;default_envs = black_F407VE
|
||||||
;env_default = teensy35
|
;env_default = teensy35
|
||||||
;env_default = LaunchPad_tm4c1294ncpdt
|
;env_default = LaunchPad_tm4c1294ncpdt
|
||||||
;env_default = genericSTM32F103RB
|
;env_default = genericSTM32F103RB
|
||||||
|
|
|
@ -1641,10 +1641,14 @@ void receiveCalibration(byte tableID)
|
||||||
bool every2nd = true;
|
bool every2nd = true;
|
||||||
int x;
|
int x;
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
// stm32 board has buildin led used as fuel pump
|
bool useLEDIndicator = false;
|
||||||
// pinMode(LED_BUILTIN, OUTPUT); //pinMode(13, OUTPUT);
|
if (pinIsOutput(LED_BUILTIN) == false)
|
||||||
|
{
|
||||||
|
pinMode(LED_BUILTIN, OUTPUT);
|
||||||
|
digitalWrite(LED_BUILTIN, LOW);
|
||||||
|
useLEDIndicator = true;
|
||||||
|
}
|
||||||
|
|
||||||
// digitalWrite(LED_BUILTIN, LOW); //digitalWrite(13, LOW);
|
|
||||||
for (x = 0; x < 1024; x++)
|
for (x = 0; x < 1024; x++)
|
||||||
{
|
{
|
||||||
//UNlike what is listed in the protocol documentation, the O2 sensor values are sent as bytes rather than ints
|
//UNlike what is listed in the protocol documentation, the O2 sensor values are sent as bytes rather than ints
|
||||||
|
@ -1681,13 +1685,14 @@ void receiveCalibration(byte tableID)
|
||||||
storeCalibrationValue(y, (byte)tempValue);
|
storeCalibrationValue(y, (byte)tempValue);
|
||||||
|
|
||||||
every2nd = false;
|
every2nd = false;
|
||||||
|
if(useLEDIndicator == true)
|
||||||
|
{
|
||||||
#if defined(CORE_STM32)
|
#if defined(CORE_STM32)
|
||||||
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
|
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
|
||||||
#elif defined(CORE_STM32_OFFICIAL)
|
|
||||||
//Of core offical do nothing. led is reserved for fuel pump
|
|
||||||
#else
|
#else
|
||||||
analogWrite(LED_BUILTIN, (counter % 50) ); //analogWrite(13, (counter % 50) );
|
analogWrite(LED_BUILTIN, (counter % 50) );
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -379,6 +379,13 @@ byte resetControl = RESET_CONTROL_DISABLED;
|
||||||
volatile byte TIMER_mask;
|
volatile byte TIMER_mask;
|
||||||
volatile byte LOOP_TIMER;
|
volatile byte LOOP_TIMER;
|
||||||
|
|
||||||
|
//These functions all do checks on a pin to determine if it is already in use by another (higher importance) function
|
||||||
|
#define pinIsInjector(pin) ( ((pin) == pinInjector1) || ((pin) == pinInjector2) || ((pin) == pinInjector3) || ((pin) == pinInjector4) )
|
||||||
|
#define pinIsIgnition(pin) ( ((pin) == pinCoil1) || ((pin) == pinCoil2) || ((pin) == pinCoil3) || ((pin) == pinCoil4) )
|
||||||
|
#define pinIsSensor(pin) ( ((pin) == pinCLT) || ((pin) == pinIAT) || ((pin) == pinMAP) || ((pin) == pinTPS) || ((pin) == pinO2) || ((pin) == pinBat) )
|
||||||
|
#define pinIsUsed(pin) ( pinIsInjector((pin)) || pinIsIgnition((pin)) || pinIsSensor((pin)) )
|
||||||
|
#define pinIsOutput(pin) ( ((pin) == pinFuelPump) || ((pin) == pinFan) || ((pin) == pinVVT_1) || ((pin) == pinVVT_2) || ((pin) == pinBoost) || ((pin) == pinIdle1) || ((pin) == pinIdle2) || ((pin) == pinTachOut) )
|
||||||
|
|
||||||
//The status struct contains the current values for all 'live' variables
|
//The status struct contains the current values for all 'live' variables
|
||||||
//In current version this is 64 bytes
|
//In current version this is 64 bytes
|
||||||
struct statuses {
|
struct statuses {
|
||||||
|
@ -1022,7 +1029,7 @@ byte pinSpareLOut4;
|
||||||
byte pinSpareLOut5;
|
byte pinSpareLOut5;
|
||||||
byte pinBoost;
|
byte pinBoost;
|
||||||
byte pinVVT_1; // vvt output 1
|
byte pinVVT_1; // vvt output 1
|
||||||
byte pinVVt_2; // vvt output 2
|
byte pinVVT_2; // vvt output 2
|
||||||
byte pinFan; // Cooling fan output
|
byte pinFan; // Cooling fan output
|
||||||
byte pinStepperDir; //Direction pin for the stepper motor driver
|
byte pinStepperDir; //Direction pin for the stepper motor driver
|
||||||
byte pinStepperStep; //Step pin for the stepper motor driver
|
byte pinStepperStep; //Step pin for the stepper motor driver
|
||||||
|
|
|
@ -54,11 +54,6 @@ byte cltErrorCount = 0;
|
||||||
* But removes the use of floats and uses 8 bits of fixed precision.
|
* But removes the use of floats and uses 8 bits of fixed precision.
|
||||||
*/
|
*/
|
||||||
#define ADC_FILTER(input, alpha, prior) (((long)input * (256 - alpha) + ((long)prior * alpha))) >> 8
|
#define ADC_FILTER(input, alpha, prior) (((long)input * (256 - alpha) + ((long)prior * alpha))) >> 8
|
||||||
//These functions all do checks on a pin to determine if it is already in use by another (higher importance) function
|
|
||||||
#define pinIsInjector(pin) ( ((pin) == pinInjector1) || ((pin) == pinInjector2) || ((pin) == pinInjector3) || ((pin) == pinInjector4) )
|
|
||||||
#define pinIsIgnition(pin) ( ((pin) == pinCoil1) || ((pin) == pinCoil2) || ((pin) == pinCoil3) || ((pin) == pinCoil4) )
|
|
||||||
#define pinIsSensor(pin) ( ((pin) == pinCLT) || ((pin) == pinIAT) || ((pin) == pinMAP) || ((pin) == pinTPS) || ((pin) == pinO2) || ((pin) == pinBat) )
|
|
||||||
#define pinIsUsed(pin) ( pinIsInjector((pin)) || pinIsIgnition((pin)) || pinIsSensor((pin)) )
|
|
||||||
|
|
||||||
static inline void instanteneousMAPReading() __attribute__((always_inline));
|
static inline void instanteneousMAPReading() __attribute__((always_inline));
|
||||||
static inline void readMAP() __attribute__((always_inline));
|
static inline void readMAP() __attribute__((always_inline));
|
||||||
|
|
Loading…
Reference in New Issue