From 07ef8db4523c2dd417ad1fd7d81c0865cc505da9 Mon Sep 17 00:00:00 2001 From: Vegar Westerlund Date: Mon, 10 Jun 2019 16:17:42 +0200 Subject: [PATCH] White space cleanup --- .../AmsToMqttBridge/AmsToMqttBridge.ino | 10 ++-- .../HanReader/src/HanReader.cpp | 26 ++++---- .../HanReader/src/Kamstrup.h | 60 +++++++++---------- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Arduino Code/AmsToMqttBridge/AmsToMqttBridge.ino b/Arduino Code/AmsToMqttBridge/AmsToMqttBridge.ino index 132b4184..d9c27473 100644 --- a/Arduino Code/AmsToMqttBridge/AmsToMqttBridge.ino +++ b/Arduino Code/AmsToMqttBridge/AmsToMqttBridge.ino @@ -125,7 +125,7 @@ void loop() { // Continously flash the LED when AP mode if (millis() / 1000 % 2 == 0) led_on(); - else led_off(); + else led_off(); } } @@ -133,9 +133,9 @@ void loop() void led_on() { #if LED_ACTIVE_HIGH - digitalWrite(LED_PIN, HIGH); + digitalWrite(LED_PIN, HIGH); #else - digitalWrite(LED_PIN, LOW); + digitalWrite(LED_PIN, LOW); #endif } @@ -143,9 +143,9 @@ void led_on() void led_off() { #if LED_ACTIVE_HIGH - digitalWrite(LED_PIN, LOW); + digitalWrite(LED_PIN, LOW); #else - digitalWrite(LED_PIN, HIGH); + digitalWrite(LED_PIN, HIGH); #endif } diff --git a/Arduino Code/Arduino Libraries/HanReader/src/HanReader.cpp b/Arduino Code/Arduino Libraries/HanReader/src/HanReader.cpp index 5bf5c89e..6012a432 100644 --- a/Arduino Code/Arduino Libraries/HanReader/src/HanReader.cpp +++ b/Arduino Code/Arduino Libraries/HanReader/src/HanReader.cpp @@ -62,20 +62,20 @@ bool HanReader::read(byte data) void HanReader::debugPrint(byte *buffer, int start, int length) { - for (int i = start; i < start + length; i++) - { - if (buffer[i] < 0x10) - debug->print("0"); - debug->print(buffer[i], HEX); - debug->print(" "); - if ((i - start + 1) % 16 == 0) - debug->println(""); - else if ((i - start + 1) % 4 == 0) - debug->print(" "); + for (int i = start; i < start + length; i++) + { + if (buffer[i] < 0x10) + debug->print("0"); + debug->print(buffer[i], HEX); + debug->print(" "); + if ((i - start + 1) % 16 == 0) + debug->println(""); + else if ((i - start + 1) % 4 == 0) + debug->print(" "); - yield(); // Let other get some resources too - } - debug->println(""); + yield(); // Let other get some resources too + } + debug->println(""); } bool HanReader::read() diff --git a/Arduino Code/Arduino Libraries/HanReader/src/Kamstrup.h b/Arduino Code/Arduino Libraries/HanReader/src/Kamstrup.h index 9eef8cb8..71513916 100644 --- a/Arduino Code/Arduino Libraries/HanReader/src/Kamstrup.h +++ b/Arduino Code/Arduino Libraries/HanReader/src/Kamstrup.h @@ -8,8 +8,8 @@ enum class Kamstrup { List3PhaseShort = 0x19, List3PhaseLong = 0x23, - List1PhaseShort = 0x11, - List1PhaseLong = 0x1B + List1PhaseShort = 0x11, + List1PhaseLong = 0x1B }; enum class Kamstrup_List3Phase @@ -54,34 +54,34 @@ enum class Kamstrup_List3Phase enum class Kamstrup_List1Phase { - ListSize, - ListVersionIdentifier, - MeterID_OBIS, - MeterID, - MeterType_OBIS, - MeterType, - ActiveImportPower_OBIS, - ActiveImportPower, - ActiveExportPower_OBIS, - ActiveExportPower, - ReactiveImportPower_OBIS, - ReactiveImportPower, - ReactiveExportPower_OBIS, - ReactiveExportPower, - CurrentL1_OBIS, - CurrentL1, - VoltageL1_OBIS, - VoltageL1, - MeterClock_OBIS, - MeterClock, - CumulativeActiveImportEnergy_OBIS, - CumulativeActiveImportEnergy, - CumulativeActiveExportEnergy_OBIS, - CumulativeActiveExportEnergy, - CumulativeReactiveImportEnergy_OBIS, - CumulativeReactiveImportEnergy, - CumulativeReactiveExportEnergy_OBIS, - CumulativeReactiveExportEnergy + ListSize, + ListVersionIdentifier, + MeterID_OBIS, + MeterID, + MeterType_OBIS, + MeterType, + ActiveImportPower_OBIS, + ActiveImportPower, + ActiveExportPower_OBIS, + ActiveExportPower, + ReactiveImportPower_OBIS, + ReactiveImportPower, + ReactiveExportPower_OBIS, + ReactiveExportPower, + CurrentL1_OBIS, + CurrentL1, + VoltageL1_OBIS, + VoltageL1, + MeterClock_OBIS, + MeterClock, + CumulativeActiveImportEnergy_OBIS, + CumulativeActiveImportEnergy, + CumulativeActiveExportEnergy_OBIS, + CumulativeActiveExportEnergy, + CumulativeReactiveImportEnergy_OBIS, + CumulativeReactiveImportEnergy, + CumulativeReactiveExportEnergy_OBIS, + CumulativeReactiveExportEnergy }; #endif