File tree Expand file tree Collapse file tree 1 file changed +20
-7
lines changed
src/AudioTools/CoreAudio/AudioAnalog Expand file tree Collapse file tree 1 file changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class AnalogDriverESP32V1 : public AnalogDriverBase {
38
38
// / Start the Analog driver
39
39
// / ----------------------------------------------------------
40
40
bool begin (AnalogConfigESP32V1 cfg) {
41
- // TRACEI();
41
+ TRACEI ();
42
42
bool result = true ;
43
43
this ->cfg = cfg;
44
44
@@ -68,12 +68,10 @@ class AnalogDriverESP32V1 : public AnalogDriverBase {
68
68
// / Stop and uninstalls the driver
69
69
// / ----------------------------------------------------------
70
70
void end () override {
71
- // TRACEI();
72
- #ifdef HAS_ESP32_DAC
71
+ TRACEI ();
73
72
if (active_tx) {
74
- dac_continuous_del_channels (dac_handle );
73
+ cleanup_tx ( );
75
74
}
76
- #endif
77
75
if (active_rx) {
78
76
cleanup_rx ();
79
77
}
@@ -612,8 +610,23 @@ class AnalogDriverESP32V1 : public AnalogDriverBase {
612
610
return true ;
613
611
}
614
612
615
- // Cleanup Analog to Digital Converter
616
- // ----------------------------------------------------------
613
+ // / Cleanup dac
614
+ bool cleanup_tx () {
615
+ bool ok = true ;
616
+ #ifdef HAS_ESP32_DAC
617
+ if (dac_continuous_disable (dac_handle) != ESP_OK){
618
+ ok = false ;
619
+ LOGE (" dac_continuous_disable failed" );
620
+ }
621
+ if (dac_continuous_del_channels (dac_handle) != ESP_OK){
622
+ ok = false ;
623
+ LOGE (" dac_continuous_del_channels failed" );
624
+ }
625
+ #endif
626
+ return ok;
627
+ }
628
+
629
+ // / Cleanup Analog to Digital Converter
617
630
bool cleanup_rx () {
618
631
619
632
adc_continuous_stop (adc_handle);
You can’t perform that action at this time.
0 commit comments