mirror of https://github.com/rusefi/speeduino.git
Bring formatting in line with standards
This commit is contained in:
parent
4d0fe1836a
commit
b739618ebc
|
@ -4,14 +4,14 @@
|
||||||
#define veMapPage 1
|
#define veMapPage 1
|
||||||
|
|
||||||
|
|
||||||
uint8_t currentcanPage = 1;//Not the same as the speeduino config page numbers
|
uint8_t currentCanPage = 1;//Not the same as the speeduino config page numbers
|
||||||
uint8_t nCanretry = 0; //no of retrys
|
uint8_t nCanretry = 0; //no of retrys
|
||||||
uint8_t cancmdfail = 0; //command fail yes/no
|
uint8_t cancmdfail = 0; //command fail yes/no
|
||||||
uint8_t canlisten = 0;
|
uint8_t canlisten = 0;
|
||||||
uint8_t Lbuffer[8]; //8 byte buffer to store incomng can data
|
uint8_t Lbuffer[8]; //8 byte buffer to store incomng can data
|
||||||
|
|
||||||
|
|
||||||
void Cancommand();//This is the heart of the Command Line Interpeter. All that needed to be done was to make it human readable.
|
void canCommand();//This is the heart of the Command Line Interpeter. All that needed to be done was to make it human readable.
|
||||||
void sendCancommand(uint8_t cmdtype , uint16_t canadddress, uint8_t candata1, uint8_t candata2);
|
void sendCancommand(uint8_t cmdtype , uint16_t canadddress, uint8_t candata1, uint8_t candata2);
|
||||||
void testCanComm();
|
void testCanComm();
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ sendcancommand is called when a comman d is to be sent via serial3 to the Can in
|
||||||
//#include "globals.h"
|
//#include "globals.h"
|
||||||
//#include "storage.h"
|
//#include "storage.h"
|
||||||
|
|
||||||
void Cancommand()
|
void canCommand()
|
||||||
{
|
{
|
||||||
switch (Serial3.read())
|
switch (Serial3.read())
|
||||||
{
|
{
|
||||||
|
|
|
@ -215,7 +215,7 @@ struct config1 {
|
||||||
byte algorithm : 1; //"Speed Density", "Alpha-N"
|
byte algorithm : 1; //"Speed Density", "Alpha-N"
|
||||||
byte baroCorr : 1;
|
byte baroCorr : 1;
|
||||||
byte injLayout : 2;
|
byte injLayout : 2;
|
||||||
byte canenable : 1; //is can interface enabled
|
byte canEnable : 1; //is can interface enabled
|
||||||
|
|
||||||
byte primePulse;
|
byte primePulse;
|
||||||
byte dutyLim;
|
byte dutyLim;
|
||||||
|
|
|
@ -187,7 +187,7 @@ page = 2
|
||||||
algorithm = bits, U08, 38, [2:2], "Speed Density", "Alpha-N"
|
algorithm = bits, U08, 38, [2:2], "Speed Density", "Alpha-N"
|
||||||
baroCorr = bits, U08, 38, [3:3], "Off", "On"
|
baroCorr = bits, U08, 38, [3:3], "Off", "On"
|
||||||
injLayout = bits, U08, 38, [4:5], "Bank", "Semi-Sequential", "INVALID", "INVALID"
|
injLayout = bits, U08, 38, [4:5], "Bank", "Semi-Sequential", "INVALID", "INVALID"
|
||||||
canenable = bits, U08, 38, [6:6], "Disable", "Enable"
|
canEnable = bits, U08, 38, [6:6], "Disable", "Enable"
|
||||||
|
|
||||||
primePulse = scalar, U08, 39, "ms", 0.1, 0.0, 0.0, 25.5, 1
|
primePulse = scalar, U08, 39, "ms", 0.1, 0.0, 0.0, 25.5, 1
|
||||||
dutyLim = scalar, U08, 40, "%", 1.0, 0.0, 0.0, 100.0, 0
|
dutyLim = scalar, U08, 40, "%", 1.0, 0.0, 0.0, 100.0, 0
|
||||||
|
@ -591,7 +591,7 @@ menuDialog = main
|
||||||
subMenu = std_separator
|
subMenu = std_separator
|
||||||
subMenu = tacho, "Tacho Output"
|
subMenu = tacho, "Tacho Output"
|
||||||
subMenu = std_separator
|
subMenu = std_separator
|
||||||
subMenu = canio, "Canbus Interface"
|
subMenu = canIO, "Canbus Interface"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -716,8 +716,8 @@ menuDialog = main
|
||||||
dialog = tacho, "Tacho"
|
dialog = tacho, "Tacho"
|
||||||
field = "Output pin", tachoPin
|
field = "Output pin", tachoPin
|
||||||
|
|
||||||
dialog = canio, "CanBus interface"
|
dialog = canIO, "CanBus interface"
|
||||||
field = "Enable/Disable", canenable
|
field = "Enable/Disable", canEnable
|
||||||
|
|
||||||
dialog = accelEnrichments_center, ""
|
dialog = accelEnrichments_center, ""
|
||||||
field = "TPSdot Threshold", tpsThresh
|
field = "TPSdot Threshold", tpsThresh
|
||||||
|
|
|
@ -126,7 +126,7 @@ static inline unsigned int setQueue(volatile Schedule *queue[], Schedule *schedu
|
||||||
//Sort the queues. Both queues are kept in sync.
|
//Sort the queues. Both queues are kept in sync.
|
||||||
//This implementes a sorting networking based on the Bose-Nelson sorting network
|
//This implementes a sorting networking based on the Bose-Nelson sorting network
|
||||||
//See: http://pages.ripco.net/~jgamble/nw.html
|
//See: http://pages.ripco.net/~jgamble/nw.html
|
||||||
#define SWAP(x,y) if(tmpQueue[y] < tmpQueue[x]) { unsigned int tmp = tmpQueue[x]; tmpQueue[x] = tmpQueue[y]; tmpQueue[y] = tmp; Schedule *tmpS = queue[x]; queue[x] = queue[y]; queue[y] = tmpS; }
|
#define SWAP(x,y) if(tmpQueue[y] < tmpQueue[x]) { unsigned int tmp = tmpQueue[x]; tmpQueue[x] = tmpQueue[y]; tmpQueue[y] = tmp; volatile Schedule *tmpS = queue[x]; queue[x] = queue[y]; queue[y] = tmpS; }
|
||||||
//SWAP(0, 1); //Likely not needed
|
//SWAP(0, 1); //Likely not needed
|
||||||
//SWAP(2, 3); //Likely not needed
|
//SWAP(2, 3); //Likely not needed
|
||||||
SWAP(0, 2);
|
SWAP(0, 2);
|
||||||
|
|
|
@ -150,6 +150,7 @@ volatile bool fpPrimed = false; //Tracks whether or not the fuel pump priming ha
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
if (configPage1.canEnable) { Serial3.begin(115200); }
|
||||||
|
|
||||||
//Setup the dummy fuel and ignition tables
|
//Setup the dummy fuel and ignition tables
|
||||||
//dummyFuelTable(&fuelTable);
|
//dummyFuelTable(&fuelTable);
|
||||||
|
@ -161,7 +162,6 @@ void setup()
|
||||||
table3D_setSize(&vvtTable, 8);
|
table3D_setSize(&vvtTable, 8);
|
||||||
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
if (configPage1.canenable ==1){Serial3.begin(115200);}
|
|
||||||
|
|
||||||
//Repoint the 2D table structs to the config pages that were just loaded
|
//Repoint the 2D table structs to the config pages that were just loaded
|
||||||
taeTable.valueSize = SIZE_BYTE; //Set this table to use byte values
|
taeTable.valueSize = SIZE_BYTE; //Set this table to use byte values
|
||||||
|
@ -755,13 +755,13 @@ void loop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if Can interface is enabled then check for serial3 requests.
|
//if Can interface is enabled then check for serial3 requests.
|
||||||
if (configPage1.canenable == 1)
|
if (configPage1.canEnable)
|
||||||
{
|
{
|
||||||
if ( ((mainLoopCount & 31) == 1) or (Serial3.available() > SERIAL_BUFFER_THRESHOLD) )
|
if ( ((mainLoopCount & 31) == 1) or (Serial3.available() > SERIAL_BUFFER_THRESHOLD) )
|
||||||
{
|
{
|
||||||
if (Serial3.available() > 0)
|
if (Serial3.available() > 0)
|
||||||
{
|
{
|
||||||
Cancommand();
|
canCommand();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue