Code formatting unified
This commit is contained in:
parent
03364f7509
commit
ecf28d8972
1 changed files with 13 additions and 26 deletions
|
|
@ -18,8 +18,7 @@ void identifyMarkers() {
|
||||||
char x = Serial.read();
|
char x = Serial.read();
|
||||||
// char y = Wire.read();
|
// char y = Wire.read();
|
||||||
|
|
||||||
if (x == '\n' || x == '\r')
|
if (x == '\n' || x == '\r') {
|
||||||
{
|
|
||||||
serialIncoming = true;
|
serialIncoming = true;
|
||||||
inputBuffer[bytesRecvd] = 0;
|
inputBuffer[bytesRecvd] = 0;
|
||||||
parseData();
|
parseData();
|
||||||
|
|
@ -27,8 +26,7 @@ void identifyMarkers() {
|
||||||
} else {
|
} else {
|
||||||
inputBuffer[bytesRecvd] = x;
|
inputBuffer[bytesRecvd] = x;
|
||||||
bytesRecvd++;
|
bytesRecvd++;
|
||||||
if (bytesRecvd == buffSize)
|
if (bytesRecvd == buffSize) {
|
||||||
{
|
|
||||||
bytesRecvd = buffSize - 1;
|
bytesRecvd = buffSize - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -60,8 +58,7 @@ void identifyMarkers() {
|
||||||
|
|
||||||
void updateGainFactor()
|
void updateGainFactor()
|
||||||
{
|
{
|
||||||
if (serialLong >= 0)
|
if (serialLong >= 0) {
|
||||||
{
|
|
||||||
GAIN_FACTOR = serialLong;
|
GAIN_FACTOR = serialLong;
|
||||||
adjustGain();
|
adjustGain();
|
||||||
EEPROM.put(GAIN_FACTOR_ADDRESS, GAIN_FACTOR);
|
EEPROM.put(GAIN_FACTOR_ADDRESS, GAIN_FACTOR);
|
||||||
|
|
@ -71,8 +68,7 @@ void updateGainFactor()
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
|
|
||||||
void updateVFol() {
|
void updateVFol() {
|
||||||
if (serialLong >= 0)
|
if (serialLong >= 0) {
|
||||||
{
|
|
||||||
followerThrs = serialLong;
|
followerThrs = serialLong;
|
||||||
adjustFollow();
|
adjustFollow();
|
||||||
EEPROM.put(FOLLOWER_THRESHOLD_ADDRESS, followerThrs);
|
EEPROM.put(FOLLOWER_THRESHOLD_ADDRESS, followerThrs);
|
||||||
|
|
@ -81,8 +77,7 @@ void updateVFol() {
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
|
|
||||||
void updateVComp() {
|
void updateVComp() {
|
||||||
if (serialLong >= 0)
|
if (serialLong >= 0) {
|
||||||
{
|
|
||||||
compThrs = serialLong;
|
compThrs = serialLong;
|
||||||
adjustComp();
|
adjustComp();
|
||||||
EEPROM.put(COMP_THRESHOLD_ADDRESS, compThrs);
|
EEPROM.put(COMP_THRESHOLD_ADDRESS, compThrs);
|
||||||
|
|
@ -91,10 +86,8 @@ void updateVComp() {
|
||||||
|
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
|
|
||||||
void updateLoopDuration()
|
void updateLoopDuration() {
|
||||||
{
|
if (serialLong >= 0) {
|
||||||
if (serialLong >= 0)
|
|
||||||
{
|
|
||||||
LOOP_DUR = serialLong;
|
LOOP_DUR = serialLong;
|
||||||
EEPROM.put(LOOP_DUR_ADDRESS, LOOP_DUR);
|
EEPROM.put(LOOP_DUR_ADDRESS, LOOP_DUR);
|
||||||
}
|
}
|
||||||
|
|
@ -102,8 +95,7 @@ void updateLoopDuration()
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
|
|
||||||
void updateTrigDuration() {
|
void updateTrigDuration() {
|
||||||
if (serialLong >= 0)
|
if (serialLong >= 0) {
|
||||||
{
|
|
||||||
TRG_DUR = serialLong;
|
TRG_DUR = serialLong;
|
||||||
EEPROM.put(TRG_DUR_ADDRESS, TRG_DUR);
|
EEPROM.put(TRG_DUR_ADDRESS, TRG_DUR);
|
||||||
}
|
}
|
||||||
|
|
@ -111,8 +103,7 @@ void updateTrigDuration() {
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
|
|
||||||
void updateHysteresis() {
|
void updateHysteresis() {
|
||||||
if (serialLong >= 0)
|
if (serialLong >= 0) {
|
||||||
{
|
|
||||||
Hyst = serialLong;
|
Hyst = serialLong;
|
||||||
EEPROM.put(HYST_ADDRESS, Hyst);
|
EEPROM.put(HYST_ADDRESS, Hyst);
|
||||||
}
|
}
|
||||||
|
|
@ -120,8 +111,7 @@ void updateHysteresis() {
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
|
|
||||||
void updateConstant() {
|
void updateConstant() {
|
||||||
if (serialLong >= 0)
|
if (serialLong >= 0) {
|
||||||
{
|
|
||||||
voltMeterConstant = (long) serialLong;
|
voltMeterConstant = (long) serialLong;
|
||||||
EEPROM.put(VM_CONST_ADDRESS, voltMeterConstant);
|
EEPROM.put(VM_CONST_ADDRESS, voltMeterConstant);
|
||||||
}
|
}
|
||||||
|
|
@ -139,12 +129,10 @@ void updateDebug() {
|
||||||
|
|
||||||
/*------------------------------------------------*/
|
/*------------------------------------------------*/
|
||||||
|
|
||||||
void serialPrintConfig()
|
void serialPrintConfig() {
|
||||||
{
|
|
||||||
Serial.print("GAIN_F ");
|
Serial.print("GAIN_F ");
|
||||||
Serial.print(GAIN_FACTOR);
|
Serial.print(GAIN_FACTOR);
|
||||||
switch (GAIN_FACTOR)
|
switch (GAIN_FACTOR) {
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
Serial.println(" 3x");
|
Serial.println(" 3x");
|
||||||
break;
|
break;
|
||||||
|
|
@ -184,8 +172,7 @@ void serialPrintConfig()
|
||||||
Serial.println(voltMeterConstant);
|
Serial.println(voltMeterConstant);
|
||||||
}
|
}
|
||||||
|
|
||||||
void serialPrintState()
|
void serialPrintState() {
|
||||||
{
|
|
||||||
Serial.print("{");
|
Serial.print("{");
|
||||||
|
|
||||||
Serial.print("\"Vcc\":");
|
Serial.print("\"Vcc\":");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue