changed compiler to include help message only on 328pb #bugfix
This commit is contained in:
parent
a9d928833a
commit
49bfe7663b
1 changed files with 33 additions and 30 deletions
|
|
@ -16,7 +16,9 @@ void parseData() {
|
||||||
void identifyMarkers() {
|
void identifyMarkers() {
|
||||||
|
|
||||||
char x = Serial.read();
|
char x = Serial.read();
|
||||||
// char y = Wire.read();
|
#ifdef I2C_INPUT
|
||||||
|
char y = Wire.read();
|
||||||
|
#endif // I2C_INPUT
|
||||||
|
|
||||||
if (x == '\n' || x == '\r') {
|
if (x == '\n' || x == '\r') {
|
||||||
serialIncoming = true;
|
serialIncoming = true;
|
||||||
|
|
@ -32,25 +34,18 @@ void identifyMarkers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef I2C_INPUT
|
#ifdef I2C_INPUT
|
||||||
if (y == endMarker) {
|
if (y == '\n' || y == '\r') {
|
||||||
readInProgress = false;
|
|
||||||
serialIncoming = true;
|
serialIncoming = true;
|
||||||
inputBuffer[bytesRecvd] = 0;
|
inputBuffer[bytesRecvd] = 0;
|
||||||
parseData();
|
parseData();
|
||||||
}
|
bytesRecvd = 0;
|
||||||
|
} else {
|
||||||
if (readInProgress) {
|
|
||||||
inputBuffer[bytesRecvd] = y;
|
inputBuffer[bytesRecvd] = y;
|
||||||
bytesRecvd++;
|
bytesRecvd++;
|
||||||
if (bytesRecvd == buffSize) {
|
if (bytesRecvd == buffSize) {
|
||||||
bytesRecvd = buffSize - 1;
|
bytesRecvd = buffSize - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (y == startMarker) {
|
|
||||||
bytesRecvd = 0;
|
|
||||||
readInProgress = true;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -262,24 +257,32 @@ void updateParams() {
|
||||||
serialPrintState();
|
serialPrintState();
|
||||||
}
|
}
|
||||||
else if (strcmp(serialMessageIn, "HELP") == 0) {
|
else if (strcmp(serialMessageIn, "HELP") == 0) {
|
||||||
// Serial.println("To change gain factor: GAIN_F [integer for gain state - see note*]");
|
#if defined(ARDUINO_AVR_ATmega328PB)
|
||||||
// Serial.println("To change voltage follower voltage (low threshold): VFOL [float value]");
|
Serial.println("To change gain factor: GAIN_F [integer for gain state - see note*]");
|
||||||
// Serial.println("To change comparator voltage (high threshold): VCOMP [float value]");
|
Serial.println("To change voltage follower voltage (low threshold): VFOL [float value]");
|
||||||
// Serial.println("To change main loop period: LOOP_D [integer for milliseconds]");
|
Serial.println("To change comparator voltage (high threshold): VCOMP [float value]");
|
||||||
// Serial.println("To change trigger active duration: TRG_D [integer for milliseconds]");
|
Serial.println("To change main loop period: LOOP_D [integer for milliseconds]");
|
||||||
// Serial.println("To change ADC hysteresis value: HYST [integer]");
|
Serial.println("To change trigger active duration: TRG_D [integer for milliseconds]");
|
||||||
// Serial.println("To enable or disable debug output: DEBUG [0|1]");
|
Serial.println("To change the output logic: LOGIC [0|1]");
|
||||||
// Serial.println("To print current config: CONFIG");
|
Serial.println(" (0 for active low, 1 for active high)");
|
||||||
// Serial.println("To set config to defaults: ERASE");
|
Serial.println("To enable piezo plugged detection: PZDET [0|1]");
|
||||||
// Serial.println("To print current state: STATE");
|
Serial.println(" (0 for disabled, 1 for enabled)");
|
||||||
// Serial.println("");
|
Serial.println("To change ADC hysteresis value: HYST [integer in millivolts]");
|
||||||
// Serial.println("Commands are entered in this format:");
|
Serial.println("To enable or disable debug output: DEBUG [0|1]");
|
||||||
// Serial.println("CMD VAL");
|
Serial.println("To print current config: CONFIG");
|
||||||
// Serial.println("Commands are confirmed with Enter key");
|
Serial.println("To set config to defaults: ERASE");
|
||||||
// Serial.println("");
|
Serial.println("To print current state: STATE");
|
||||||
// Serial.println("Examples:");
|
Serial.println("");
|
||||||
// Serial.println("GAIN_F 3 <~ set gain factor to index 3 (6x)");
|
Serial.println("Commands are entered in this format:");
|
||||||
// Serial.println("VFOL 2350 <~ set the vref floor to 2.35V");
|
Serial.println("CMD VAL");
|
||||||
|
Serial.println("Commands are confirmed with Enter key");
|
||||||
|
Serial.println("");
|
||||||
|
Serial.println("Examples:");
|
||||||
|
Serial.println("GAIN_F 3 <~ set gain factor to index 3 (6x)");
|
||||||
|
Serial.println("VFOL 2350 <~ set the vref floor to 2.35V");
|
||||||
|
#else
|
||||||
|
Serial.println("Check docs.pyroballpcbs.com/config")
|
||||||
|
#endif // defined(ARDUINO_AVR_ATmega328PB)
|
||||||
}
|
}
|
||||||
parseData();
|
parseData();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue