ggwave : remove <initializer_list>

This commit is contained in:
Georgi Gerganov
2022-06-11 14:28:50 +03:00
parent c730124f8b
commit 8070f6db11
6 changed files with 6 additions and 29 deletions

View File

@@ -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"));

View File

@@ -1,6 +1,3 @@
// To build this example for Arduino UNO, make sure to install the ArduinoSTL library:
//#include <ArduinoSTL.h>
#include "ggwave/ggwave.h"
const int kPinLed0 = 13;

View File

@@ -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;

View File

@@ -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"));

View File

@@ -388,7 +388,6 @@ public:
#include <stdint.h>
#include <stdio.h>
#include <initializer_list>
class GGWave {
public:
@@ -466,21 +465,11 @@ public:
return data[id];
}
Protocols & operator=(const std::initializer_list<Protocol> & 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<ProtocolId> ids);
static Protocols & kDefault() {
static Protocols protocols;

View File

@@ -355,13 +355,6 @@ void GGWave::Protocols::only(ProtocolId id) {
data[id].enabled = true;
}
void GGWave::Protocols::only(std::initializer_list<ProtocolId> ids) {
disableAll();
for (auto id : ids) {
data[id].enabled = true;
}
}
GGWave::TxProtocols & GGWave::Protocols::tx() {
static TxProtocols protocols = kDefault();