mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-07 01:11:22 +08:00
ggwave : remove <initializer_list>
This commit is contained in:
@@ -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"));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user