Merge branch 'master' into pr/5
This commit is contained in:
commit
d8898db9fe
|
@ -10,7 +10,11 @@ table.py
|
|||
reference/hardware/v0.2/~$schematic v0.2_bom.xlsx
|
||||
|
||||
reference/hardware/v0.4/gerbers/Archive.zip
|
||||
speeduino/.vscode
|
||||
speeduino/.build
|
||||
|
||||
.pioenvs
|
||||
.piolibdeps
|
||||
.clang_complete
|
||||
.gcc-flags.json
|
||||
.project
|
||||
|
|
|
@ -2196,6 +2196,7 @@ void triggerSetEndTeeth_Daihatsu()
|
|||
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Code for decoder.ino
|
||||
Name: Harley
|
||||
|
@ -2335,3 +2336,4 @@ void triggerSetEndTeeth_Harley()
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
#define BIT_SET(a,b) ((a) |= (1<<(b)))
|
||||
#define BIT_CLEAR(a,b) ((a) &= ~(1<<(b)))
|
||||
#define BIT_CHECK(var,pos) !!((var) & (1<<(pos)))
|
||||
#define Lo(param) ((char *)¶m)[0]
|
||||
#define Hi(param) ((char *)¶m)[1]
|
||||
#define Higher(param) ((char *)¶m)[2]
|
||||
#define Highest(param) ((char *)¶m)[3]
|
||||
|
||||
#define MS_IN_MINUTE 60000
|
||||
#define US_IN_MINUTE 60000000
|
||||
|
@ -124,7 +128,11 @@
|
|||
#define OFFSET_FUELTRIM 127 //The fuel trim tables are offset by 128 to allow for -128 to +128 values
|
||||
#define OFFSET_IGNITION 40 //Ignition values from the main spark table are offset 40 degrees downards to allow for negative spark timing
|
||||
|
||||
#if defined(CORE_STM32)
|
||||
#define SERIAL_BUFFER_THRESHOLD 64 // When the serial buffer is filled to greater than this threshold value, the serial processing operations will be performed more urgently in order to avoid it overflowing. Serial buffer is 128 bytes long, so the threshold is set at half this as a reasonable figure
|
||||
#else
|
||||
#define SERIAL_BUFFER_THRESHOLD 32 // When the serial buffer is filled to greater than this threshold value, the serial processing operations will be performed more urgently in order to avoid it overflowing. Serial buffer is 64 bytes long, so the threshold is set at half this as a reasonable figure
|
||||
#endif
|
||||
|
||||
#define FUEL_PUMP_ON() *pump_pin_port |= (pump_pin_mask)
|
||||
#define FUEL_PUMP_OFF() *pump_pin_port &= ~(pump_pin_mask)
|
||||
|
@ -207,6 +215,9 @@ int ignition4EndAngle = 0;
|
|||
//This is used across multiple files
|
||||
unsigned long revolutionTime; //The time in uS that one revolution would take at current speed (The time tooth 1 was last seen, minus the time it was seen prior to that)
|
||||
|
||||
volatile byte TIMER_mask;
|
||||
volatile byte LOOP_TIMER;
|
||||
|
||||
//The status struct contains the current values for all 'live' variables
|
||||
//In current version this is 64 bytes
|
||||
struct statuses {
|
||||
|
|
|
@ -105,3 +105,4 @@ ISR(ADC_vect)
|
|||
#endif
|
||||
|
||||
#endif // SENSORS_H
|
||||
|
||||
|
|
|
@ -268,3 +268,4 @@ void flexPulse()
|
|||
{
|
||||
++flexCounter;
|
||||
}
|
||||
|
||||
|
|
|
@ -642,7 +642,8 @@ void loop()
|
|||
//Check for any requets from serial. Serial operations are checked under 2 scenarios:
|
||||
// 1) Every 64 loops (64 Is more than fast enough for TunerStudio). This function is equivalent to ((loopCount % 64) == 1) but is considerably faster due to not using the mod or division operations
|
||||
// 2) If the amount of data in the serial buffer is greater than a set threhold (See globals.h). This is to avoid serial buffer overflow when large amounts of data is being sent
|
||||
if ( (BIT_CHECK(LOOP_TIMER, BIT_TIMER_15HZ)) or (Serial.available() > SERIAL_BUFFER_THRESHOLD) )
|
||||
if ( BIT_CHECK(LOOP_TIMER, BIT_TIMER_15HZ) or (Serial.available() > SERIAL_BUFFER_THRESHOLD) )
|
||||
|
||||
{
|
||||
if (Serial.available() > 0)
|
||||
{
|
||||
|
@ -654,7 +655,8 @@ void loop()
|
|||
//if serial3 interface is enabled then check for serial3 requests.
|
||||
if (configPage10.enable_canbus == 1)
|
||||
{
|
||||
if ( (BIT_CHECK(LOOP_TIMER, BIT_TIMER_15HZ)) or (CANSerial.available() > SERIAL_BUFFER_THRESHOLD) )
|
||||
if ( BIT_CHECK(LOOP_TIMER, BIT_TIMER_15HZ) or (CANSerial.available() > SERIAL_BUFFER_THRESHOLD) )
|
||||
|
||||
{
|
||||
if (CANSerial.available() > 0)
|
||||
{
|
||||
|
@ -668,6 +670,7 @@ void loop()
|
|||
if (configPage10.enable_canbus == 1) //secondary serial interface enabled
|
||||
{
|
||||
if ( (BIT_CHECK(LOOP_TIMER, BIT_TIMER_15HZ)) or (CANSerial.available() > SERIAL_BUFFER_THRESHOLD) )
|
||||
|
||||
{
|
||||
if (CANSerial.available() > 0)
|
||||
{
|
||||
|
@ -743,7 +746,7 @@ void loop()
|
|||
//-----------------------------------------------------------------------------------------------------
|
||||
readMAP();
|
||||
|
||||
if (BIT_CHECK(LOOP_TIMER, BIT_TIMER_15HZ)) //Every 32 loops
|
||||
if ( BIT_CHECK(LOOP_TIMER, BIT_TIMER_15HZ))
|
||||
{
|
||||
BIT_CLEAR(TIMER_mask, BIT_TIMER_15HZ);
|
||||
readTPS(); //TPS reading to be performed every 32 loops (any faster and it can upset the TPSdot sampling time)
|
||||
|
|
|
@ -47,6 +47,9 @@ void initialiseTimers()
|
|||
Timer4.resume(); //Start Timer
|
||||
#endif
|
||||
|
||||
#if defined(CORE_STM32)
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
#endif
|
||||
dwellLimit_uS = (1000 * configPage2.dwellLimit);
|
||||
lastRPM_100ms = 0;
|
||||
}
|
||||
|
|
|
@ -62,3 +62,4 @@ void doUpdates()
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue