From 8070f6db11dfb6fa19d08df1642113a8f5fcf47f Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 11 Jun 2022 14:28:50 +0300 Subject: [PATCH] ggwave : remove --- examples/arduino-rx-web/arduino-rx-web.cpp | 5 ++--- examples/arduino-tx2/arduino-tx2.ino | 3 --- examples/r2t2/main.cpp | 4 ++-- examples/r2t2/r2t2-rx.cpp | 5 ++--- include/ggwave/ggwave.h | 11 ----------- src/ggwave.cpp | 7 ------- 6 files changed, 6 insertions(+), 29 deletions(-) diff --git a/examples/arduino-rx-web/arduino-rx-web.cpp b/examples/arduino-rx-web/arduino-rx-web.cpp index 9eafa3a..b798353 100644 --- a/examples/arduino-rx-web/arduino-rx-web.cpp +++ b/examples/arduino-rx-web/arduino-rx-web.cpp @@ -333,15 +333,14 @@ int main(int argc, char** argv) { printf("\n"); #endif - auto & protocols = GGWave::Protocols::rx(); - protocols = { + GGWave::Protocols::rx() = { { { "[R2T2] Normal", 64, 9, 1, 2, true, }, { "[R2T2] Fast", 64, 6, 1, 2, true, }, { "[R2T2] Fastest", 64, 3, 1, 2, true, }, { "[R2T2] Low Normal", 16, 9, 1, 2, true, }, { "[R2T2] Low Fast", 16, 6, 1, 2, true, }, { "[R2T2] Low Fastest", 16, 3, 1, 2, true, }, - }; + } }; const auto argm = parseCmdArguments(argc, argv); const int captureId = argm.count("c") == 0 ? 0 : std::stoi(argm.at("c")); diff --git a/examples/arduino-tx2/arduino-tx2.ino b/examples/arduino-tx2/arduino-tx2.ino index a53791d..6a89c70 100644 --- a/examples/arduino-tx2/arduino-tx2.ino +++ b/examples/arduino-tx2/arduino-tx2.ino @@ -1,6 +1,3 @@ -// To build this example for Arduino UNO, make sure to install the ArduinoSTL library: -//#include - #include "ggwave/ggwave.h" const int kPinLed0 = 13; diff --git a/examples/r2t2/main.cpp b/examples/r2t2/main.cpp index 1f44689..b5f387d 100644 --- a/examples/r2t2/main.cpp +++ b/examples/r2t2/main.cpp @@ -54,14 +54,14 @@ int main(int argc, char** argv) { printf("\n"); auto & protocols = GGWave::Protocols::tx(); - protocols = { + protocols = { { { "[R2T2] Normal", 64, 9, 1, 2, true, }, { "[R2T2] Fast", 64, 6, 1, 2, true, }, { "[R2T2] Fastest", 64, 3, 1, 2, true, }, { "[R2T2] Low Normal", 16, 9, 1, 2, true, }, { "[R2T2] Low Fast", 16, 6, 1, 2, true, }, { "[R2T2] Low Fastest", 16, 3, 1, 2, true, }, - }; + } }; const auto argm = parseCmdArguments(argc, argv); const bool printTones = argm.count("p") > 0; diff --git a/examples/r2t2/r2t2-rx.cpp b/examples/r2t2/r2t2-rx.cpp index 310b691..7d00b0b 100644 --- a/examples/r2t2/r2t2-rx.cpp +++ b/examples/r2t2/r2t2-rx.cpp @@ -324,15 +324,14 @@ int main(int argc, char** argv) { printf("\n"); #endif - auto & protocols = GGWave::Protocols::rx(); - protocols = { + GGWave::Protocols::rx() = { { { "[R2T2] Normal", 64, 9, 1, 2, true, }, { "[R2T2] Fast", 64, 6, 1, 2, true, }, { "[R2T2] Fastest", 64, 3, 1, 2, true, }, { "[R2T2] Low Normal", 16, 9, 1, 2, true, }, { "[R2T2] Low Fast", 16, 6, 1, 2, true, }, { "[R2T2] Low Fastest", 16, 3, 1, 2, true, }, - }; + } }; const auto argm = parseCmdArguments(argc, argv); const int captureId = argm.count("c") == 0 ? 0 : std::stoi(argm.at("c")); diff --git a/include/ggwave/ggwave.h b/include/ggwave/ggwave.h index 7512917..6991a0b 100644 --- a/include/ggwave/ggwave.h +++ b/include/ggwave/ggwave.h @@ -388,7 +388,6 @@ public: #include #include -#include class GGWave { public: @@ -466,21 +465,11 @@ public: return data[id]; } - Protocols & operator=(const std::initializer_list & list) { - int i = 0; - disableAll(); - for (auto & p : list) { - data[i++] = p; - } - return *this; - } - void enableAll(); void disableAll(); void toggle(ProtocolId id, bool state); void only(ProtocolId id); - void only(std::initializer_list ids); static Protocols & kDefault() { static Protocols protocols; diff --git a/src/ggwave.cpp b/src/ggwave.cpp index 300a51d..70a5406 100644 --- a/src/ggwave.cpp +++ b/src/ggwave.cpp @@ -355,13 +355,6 @@ void GGWave::Protocols::only(ProtocolId id) { data[id].enabled = true; } -void GGWave::Protocols::only(std::initializer_list ids) { - disableAll(); - for (auto id : ids) { - data[id].enabled = true; - } -} - GGWave::TxProtocols & GGWave::Protocols::tx() { static TxProtocols protocols = kDefault();