Skip to content

Commit

Permalink
R2ROutput use std::vector
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Aug 24, 2024
1 parent ae4df9c commit df3ad65
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/AudioLibs/R2ROutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "AudioTools/AudioLogger.h"
#include "AudioTools/AudioOutput.h"
#include "AudioTools/Buffers.h"
#include "vector"

namespace audio_tools {

Expand All @@ -16,8 +17,8 @@ namespace audio_tools {

class R2RConfig : public AudioInfo {
public:
Vector<int> channel1_pins{0};
Vector<int> channel2_pins{0};
std::vector<int> channel1_pins;
std::vector<int> channel2_pins;
};

/**
Expand Down Expand Up @@ -80,13 +81,13 @@ class R2ROutput : public AudioOutput {

void setupPins() {
TRACED();
for (int j = 0; j < rcfg.channel1_pins.size(); j++) {
LOGI("Setup pin %d", rcfg.channel1_pins[j]);
pinMode(rcfg.channel1_pins[j], OUTPUT);
for (auto pin : rcfg.channel1_pins) {
LOGI("Setup channel1 pin %d", pin);
pinMode(pin, OUTPUT);
}
for (int j = 0; j < rcfg.channel2_pins.size(); j++) {
LOGI("Setup pin %d", rcfg.channel1_pins[j]);
pinMode(rcfg.channel2_pins[j], OUTPUT);
for (int pin : rcfg.channel2_pins) {
LOGI("Setup channel2 pin %d", pin);
pinMode(pin, OUTPUT);
}
}

Expand Down

0 comments on commit df3ad65

Please sign in to comment.