19
19
20
20
#include " Arduino_ScienceKitCarrier.h"
21
21
22
+
22
23
#ifdef ARDUINO_NANO_RP2040_CONNECT
23
24
short ScienceKitCarrier::sampleBuffer[MICROPHONE_BUFFER_SIZE];
24
25
volatile int ScienceKitCarrier::samplesRead;
@@ -87,8 +88,6 @@ ScienceKitCarrier::ScienceKitCarrier(){
87
88
microphone_rms=0 ;
88
89
rms=0 ;
89
90
#endif
90
-
91
- round_robin_index=0 ;
92
91
93
92
#ifdef ARDUINO_NANO_RP2040_CONNECT
94
93
thread_activity_led = new rtos::Thread ();
@@ -97,7 +96,7 @@ ScienceKitCarrier::ScienceKitCarrier(){
97
96
thread_ultrasonic = new rtos::Thread ();
98
97
#endif
99
98
100
- #ifdef ARDUINO_ESP32
99
+ #ifdef ESP32
101
100
wire_semaphore = xSemaphoreCreateMutex ();
102
101
#endif
103
102
@@ -172,6 +171,7 @@ int ScienceKitCarrier::begin(const uint8_t auxiliary_threads){
172
171
173
172
// let's start bme688, external ds18b20 probe and ultrasonic sensor
174
173
startAuxiliaryThreads (auxiliary_threads);
174
+ return 1 ;
175
175
}
176
176
177
177
@@ -940,7 +940,7 @@ void ScienceKitCarrier::startAuxiliaryThreads(const uint8_t auxiliary_threads){
940
940
thread_ultrasonic->start (mbed::callback (this , &ScienceKitCarrier::threadUltrasonic));
941
941
#endif
942
942
#ifdef ESP32
943
- xTaskCreatePinnedToCore (this ->freeRTOSUltrasonic , " update_ultrasonic" , 1024 , this , 1 , &thread_ultrasonic, ULTRASONIC_CORE);
943
+ xTaskCreatePinnedToCore (this ->freeRTOSUltrasonic , " update_ultrasonic" , 10000 , this , 1 , &thread_ultrasonic, ULTRASONIC_CORE);
944
944
#endif
945
945
}
946
946
thread_ultrasonic_is_running = true ;
0 commit comments