File tree Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Expand file tree Collapse file tree 4 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -139,11 +139,7 @@ class AnalogDriverArduino : public AnalogDriverBase {
139
139
}
140
140
// setup pins
141
141
setupPins ();
142
- } else {
143
- LOGE (" Not enough memory" );
144
- timer.end ();
145
- return false ;
146
- }
142
+ }
147
143
return true ;
148
144
}
149
145
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ class AnalogConfig : public AudioInfo {
132
132
}
133
133
#else
134
134
AnalogConfig () {
135
- sample_rate = 10000 ;
135
+ sample_rate = 44100 ;
136
136
bits_per_sample = 16 ;
137
137
channels = 2 ;
138
138
buffer_size = ANALOG_BUFFER_SIZE;
Original file line number Diff line number Diff line change @@ -53,8 +53,15 @@ class TimerAlarmRepeatingDriverRenesas : public TimerAlarmRepeatingDriverBase {
53
53
} else {
54
54
LOGI (" rate is %f hz" , rate);
55
55
}
56
+
57
+ // stop timer if it is active
58
+ if (timer_active){
59
+ end ();
60
+ }
61
+
56
62
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;
58
65
59
66
}
60
67
@@ -65,7 +72,9 @@ class TimerAlarmRepeatingDriverRenesas : public TimerAlarmRepeatingDriverBase {
65
72
66
73
// / ends the timer and if necessary the task
67
74
bool end () {
75
+ TRACED ();
68
76
audio_timer.end ();
77
+ timer_active = false ;
69
78
return true ;
70
79
}
71
80
@@ -79,6 +88,7 @@ class TimerAlarmRepeatingDriverRenesas : public TimerAlarmRepeatingDriverBase {
79
88
FspTimer audio_timer;
80
89
my_repeating_timer_callback_t instanceCallback = nullptr ;
81
90
uint8_t timer_type = 0 ; // Should be 0 - but this is currently not working
91
+ bool timer_active = false ;
82
92
83
93
// starts Asynchronous General Purpose Timer (AGT) timer
84
94
bool startAGTTimer (float rate){
Original file line number Diff line number Diff line change @@ -37,7 +37,6 @@ class BaseConverter {
37
37
* @ingroup convert
38
38
* @tparam T
39
39
*/
40
- template <typename T>
41
40
class NOPConverter : public BaseConverter {
42
41
public:
43
42
virtual size_t convert (uint8_t (*src), size_t size) {return size;};
You can’t perform that action at this time.
0 commit comments