Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Code formatting unified
  • Loading branch information
pyr0ball committed Oct 3, 2019
1 parent 03364f7 commit ecf28d8
Showing 1 changed file with 13 additions and 26 deletions.
39 changes: 13 additions & 26 deletions firmware/AVR-Source/Pyr0_Piezo_Sensor_v2.x.x/src/pP_serial.h
Expand Up @@ -18,17 +18,15 @@ void identifyMarkers() {
char x = Serial.read();
// char y = Wire.read();

if (x == '\n' || x == '\r')
{
if (x == '\n' || x == '\r') {
serialIncoming = true;
inputBuffer[bytesRecvd] = 0;
parseData();
bytesRecvd = 0;
} else {
inputBuffer[bytesRecvd] = x;
bytesRecvd++;
if (bytesRecvd == buffSize)
{
if (bytesRecvd == buffSize) {
bytesRecvd = buffSize - 1;
}
}
Expand Down Expand Up @@ -60,8 +58,7 @@ void identifyMarkers() {

void updateGainFactor()
{
if (serialLong >= 0)
{
if (serialLong >= 0) {
GAIN_FACTOR = serialLong;
adjustGain();
EEPROM.put(GAIN_FACTOR_ADDRESS, GAIN_FACTOR);
Expand All @@ -71,8 +68,7 @@ void updateGainFactor()
/*------------------------------------------------*/

void updateVFol() {
if (serialLong >= 0)
{
if (serialLong >= 0) {
followerThrs = serialLong;
adjustFollow();
EEPROM.put(FOLLOWER_THRESHOLD_ADDRESS, followerThrs);
Expand All @@ -81,8 +77,7 @@ void updateVFol() {
/*------------------------------------------------*/

void updateVComp() {
if (serialLong >= 0)
{
if (serialLong >= 0) {
compThrs = serialLong;
adjustComp();
EEPROM.put(COMP_THRESHOLD_ADDRESS, compThrs);
Expand All @@ -91,37 +86,32 @@ void updateVComp() {

/*------------------------------------------------*/

void updateLoopDuration()
{
if (serialLong >= 0)
{
void updateLoopDuration() {
if (serialLong >= 0) {
LOOP_DUR = serialLong;
EEPROM.put(LOOP_DUR_ADDRESS, LOOP_DUR);
}
}
/*------------------------------------------------*/

void updateTrigDuration() {
if (serialLong >= 0)
{
if (serialLong >= 0) {
TRG_DUR = serialLong;
EEPROM.put(TRG_DUR_ADDRESS, TRG_DUR);
}
}
/*------------------------------------------------*/

void updateHysteresis() {
if (serialLong >= 0)
{
if (serialLong >= 0) {
Hyst = serialLong;
EEPROM.put(HYST_ADDRESS, Hyst);
}
}
/*------------------------------------------------*/

void updateConstant() {
if (serialLong >= 0)
{
if (serialLong >= 0) {
voltMeterConstant = (long) serialLong;
EEPROM.put(VM_CONST_ADDRESS, voltMeterConstant);
}
Expand All @@ -139,12 +129,10 @@ void updateDebug() {

/*------------------------------------------------*/

void serialPrintConfig()
{
void serialPrintConfig() {
Serial.print("GAIN_F ");
Serial.print(GAIN_FACTOR);
switch (GAIN_FACTOR)
{
switch (GAIN_FACTOR) {
case 0:
Serial.println(" 3x");
break;
Expand Down Expand Up @@ -184,8 +172,7 @@ void serialPrintConfig()
Serial.println(voltMeterConstant);
}

void serialPrintState()
{
void serialPrintState() {
Serial.print("{");

Serial.print("\"Vcc\":");
Expand Down

0 comments on commit ecf28d8

Please sign in to comment.