We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36fa3fc commit c9687b4Copy full SHA for c9687b4
src/AudioLibs/R2ROutput.h
@@ -87,6 +87,7 @@ class R2RConfig : public AudioInfo {
87
uint16_t buffer_count = 2; // double buffer
88
R2RDriverBase *driver = &r2r_driver; // by default use Arduino driver
89
bool is_blocking = true;
90
+ int timer_id = 0;
91
};
92
93
/**
@@ -137,8 +138,11 @@ class R2ROutput : public AudioOutput {
137
138
}
139
buffer.resize(rcfg.buffer_size, rcfg.buffer_count);
140
rcfg.driver->setupPins(rcfg.channel1_pins, rcfg.channel2_pins);
141
+
142
+ // setup timer
143
timer.setCallbackParameter(this);
144
timer.setIsSave(true);
145
+ timer.setTimer(rcfg.timer_id);
146
return timer.begin(r2r_timer_callback, cfg.sample_rate, HZ);
147
148
0 commit comments