Skip to content

Commit 14a50a7

Browse files
committed
Arduino UNO R4 corrections
1 parent 2b416e0 commit 14a50a7

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

src/AudioAnalog/AnalogAudioArduino.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,7 @@ class AnalogDriverArduino : public AnalogDriverBase {
139139
}
140140
// setup pins
141141
setupPins();
142-
} else {
143-
LOGE("Not enough memory");
144-
timer.end();
145-
return false;
146-
}
142+
}
147143
return true;
148144
}
149145

src/AudioAnalog/AnalogAudioBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class AnalogConfig : public AudioInfo {
132132
}
133133
#else
134134
AnalogConfig() {
135-
sample_rate = 10000;
135+
sample_rate = 44100;
136136
bits_per_sample = 16;
137137
channels = 2;
138138
buffer_size = ANALOG_BUFFER_SIZE;

src/AudioTimer/AudioTimerRenesas.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ class TimerAlarmRepeatingDriverRenesas : public TimerAlarmRepeatingDriverBase {
5353
} else {
5454
LOGI("rate is %f hz", rate);
5555
}
56+
57+
// stop timer if it is active
58+
if (timer_active){
59+
end();
60+
}
61+
5662
LOGI("Using %s", timer_type==1 ? "AGT": "GPT")
57-
return timer_type==1 ? startAGTTimer(rate) : startGPTTimer(rate);
63+
timer_active = timer_type==1 ? startAGTTimer(rate) : startGPTTimer(rate);
64+
return timer_active;
5865

5966
}
6067

@@ -65,7 +72,9 @@ class TimerAlarmRepeatingDriverRenesas : public TimerAlarmRepeatingDriverBase {
6572

6673
/// ends the timer and if necessary the task
6774
bool end() {
75+
TRACED();
6876
audio_timer.end();
77+
timer_active = false;
6978
return true;
7079
}
7180

@@ -79,6 +88,7 @@ class TimerAlarmRepeatingDriverRenesas : public TimerAlarmRepeatingDriverBase {
7988
FspTimer audio_timer;
8089
my_repeating_timer_callback_t instanceCallback = nullptr;
8190
uint8_t timer_type = 0; // Should be 0 - but this is currently not working
91+
bool timer_active = false;
8292

8393
// starts Asynchronous General Purpose Timer (AGT) timer
8494
bool startAGTTimer(float rate){

src/AudioTools/BaseConverter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class BaseConverter {
3737
* @ingroup convert
3838
* @tparam T
3939
*/
40-
template<typename T>
4140
class NOPConverter : public BaseConverter {
4241
public:
4342
virtual size_t convert(uint8_t(*src), size_t size) {return size;};

0 commit comments

Comments
 (0)