1919
2020#include " Arduino_ScienceKitCarrier.h"
2121
22+
2223#ifdef ARDUINO_NANO_RP2040_CONNECT
2324short ScienceKitCarrier::sampleBuffer[MICROPHONE_BUFFER_SIZE];
2425volatile int ScienceKitCarrier::samplesRead;
@@ -87,8 +88,6 @@ ScienceKitCarrier::ScienceKitCarrier(){
8788 microphone_rms=0 ;
8889 rms=0 ;
8990 #endif
90-
91- round_robin_index=0 ;
9291
9392 #ifdef ARDUINO_NANO_RP2040_CONNECT
9493 thread_activity_led = new rtos::Thread ();
@@ -97,7 +96,7 @@ ScienceKitCarrier::ScienceKitCarrier(){
9796 thread_ultrasonic = new rtos::Thread ();
9897 #endif
9998
100- #ifdef ARDUINO_ESP32
99+ #ifdef ESP32
101100 wire_semaphore = xSemaphoreCreateMutex ();
102101 #endif
103102
@@ -172,6 +171,7 @@ int ScienceKitCarrier::begin(const uint8_t auxiliary_threads){
172171
173172 // let's start bme688, external ds18b20 probe and ultrasonic sensor
174173 startAuxiliaryThreads (auxiliary_threads);
174+ return 1 ;
175175}
176176
177177
@@ -940,7 +940,7 @@ void ScienceKitCarrier::startAuxiliaryThreads(const uint8_t auxiliary_threads){
940940 thread_ultrasonic->start (mbed::callback (this , &ScienceKitCarrier::threadUltrasonic));
941941 #endif
942942 #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);
944944 #endif
945945 }
946946 thread_ultrasonic_is_running = true ;
0 commit comments