Skip to content

Commit df3ad65

Browse files
committed
R2ROutput use std::vector
1 parent ae4df9c commit df3ad65

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/AudioLibs/R2ROutput.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "AudioTools/AudioLogger.h"
66
#include "AudioTools/AudioOutput.h"
77
#include "AudioTools/Buffers.h"
8+
#include "vector"
89

910
namespace audio_tools {
1011

@@ -16,8 +17,8 @@ namespace audio_tools {
1617

1718
class R2RConfig : public AudioInfo {
1819
public:
19-
Vector<int> channel1_pins{0};
20-
Vector<int> channel2_pins{0};
20+
std::vector<int> channel1_pins;
21+
std::vector<int> channel2_pins;
2122
};
2223

2324
/**
@@ -80,13 +81,13 @@ class R2ROutput : public AudioOutput {
8081

8182
void setupPins() {
8283
TRACED();
83-
for (int j = 0; j < rcfg.channel1_pins.size(); j++) {
84-
LOGI("Setup pin %d", rcfg.channel1_pins[j]);
85-
pinMode(rcfg.channel1_pins[j], OUTPUT);
84+
for (auto pin : rcfg.channel1_pins) {
85+
LOGI("Setup channel1 pin %d", pin);
86+
pinMode(pin, OUTPUT);
8687
}
87-
for (int j = 0; j < rcfg.channel2_pins.size(); j++) {
88-
LOGI("Setup pin %d", rcfg.channel1_pins[j]);
89-
pinMode(rcfg.channel2_pins[j], OUTPUT);
88+
for (int pin : rcfg.channel2_pins) {
89+
LOGI("Setup channel2 pin %d", pin);
90+
pinMode(pin, OUTPUT);
9091
}
9192
}
9293

0 commit comments

Comments
 (0)