Skip to content

Commit d4d1b45

Browse files
committed
fix: solved merge
1 parent 1494af0 commit d4d1b45

File tree

2 files changed

+0
-142
lines changed

2 files changed

+0
-142
lines changed

src/Arduino_ScienceKitCarrier.cpp

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919

2020
#include "Arduino_ScienceKitCarrier.h"
2121

22-
<<<<<<< HEAD
23-
24-
=======
25-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
2622
#ifdef ARDUINO_NANO_RP2040_CONNECT
2723
short ScienceKitCarrier::sampleBuffer[MICROPHONE_BUFFER_SIZE];
2824
volatile int ScienceKitCarrier::samplesRead;
@@ -90,7 +86,6 @@ ScienceKitCarrier::ScienceKitCarrier(){
9086
external_temperature_is_connected=false;
9187

9288
#ifdef ARDUINO_NANO_RP2040_CONNECT
93-
<<<<<<< HEAD
9489
microphone_rms=0;
9590
rms=0;
9691
#endif
@@ -104,18 +99,6 @@ ScienceKitCarrier::ScienceKitCarrier(){
10499

105100
#ifdef ARDUINO_NANO_ESP32
106101
wire_semaphore = xSemaphoreCreateMutex();
107-
=======
108-
microphone_rms=0;
109-
rms=0;
110-
#endif
111-
112-
round_robin_index=0;
113-
114-
#ifdef ARDUINO_NANO_RP2040_CONNECT
115-
thread_activity_led = new rtos::Thread();
116-
thread_update_bme = new rtos::Thread();
117-
thread_external_temperature = new rtos::Thread();
118-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
119102
#endif
120103

121104
thread_bme_is_running = false;
@@ -186,19 +169,9 @@ int ScienceKitCarrier::begin(const uint8_t auxiliary_threads){
186169
}
187170
#endif
188171

189-
<<<<<<< HEAD
190172
// let's start bme688, external ds18b20 probe and ultrasonic sensor
191173
startAuxiliaryThreads(auxiliary_threads);
192174
return 1;
193-
=======
194-
// let's start ultrasonic and check if it is connected
195-
if (beginUltrasonic()!=0){
196-
return ERR_BEGIN_ULTRASONIC;
197-
}
198-
199-
// let's start bme688 and external ds18b20 probe
200-
//WIP startAuxiliaryThreads(auxiliary_threads);
201-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
202175
}
203176

204177

@@ -272,11 +245,7 @@ int ScienceKitCarrier::beginAnalogInput(){
272245

273246
void ScienceKitCarrier::updateAnalogInput(const uint8_t input_to_update){
274247
if ((input_to_update==UPDATE_INPUT_A)||(input_to_update==UPDATE_ALL)){
275-
<<<<<<< HEAD
276248

277-
=======
278-
/* WIP
279-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
280249
if (!getExternalTemperatureIsConnected()){
281250
inputA=analogRead(inputA_pin)>>board_resolution;
282251
#ifdef ARDUINO_NANO_ESP32
@@ -286,11 +255,7 @@ void ScienceKitCarrier::updateAnalogInput(const uint8_t input_to_update){
286255
else{
287256
inputA=ANALOGIN_DISABLED;
288257
}
289-
<<<<<<< HEAD
290258

291-
=======
292-
*/
293-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
294259
}
295260
if ((input_to_update==UPDATE_INPUT_B)||(input_to_update==UPDATE_ALL)){
296261
inputB=analogRead(inputB_pin)>>board_resolution;
@@ -657,14 +622,6 @@ float ScienceKitCarrier::getMagneticFieldZ(){
657622
}
658623

659624

660-
<<<<<<< HEAD
661-
=======
662-
#ifdef ARDUINO_NANO_RP2040_CONNECT
663-
void ScienceKitCarrier::delay(unsigned long t){
664-
rtos::ThisThread::sleep_for(t);
665-
}
666-
#endif
667-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
668625

669626

670627

@@ -694,7 +651,6 @@ void ScienceKitCarrier::errorTrap(const int error_code){
694651
}
695652
}
696653

697-
<<<<<<< HEAD
698654
#ifdef ARDUINO_NANO_ESP32
699655
void ScienceKitCarrier::setStatusLed(const int led_state){
700656
switch (led_state){
@@ -727,52 +683,6 @@ void ScienceKitCarrier::setStatusLed(const int led_state){
727683
enable_led_red = false;
728684
enable_led_green = false;
729685
enable_led_blue = false;
730-
=======
731-
#ifdef ARDUINO_NANO_RP2040_CONNECT
732-
void ScienceKitCarrier::threadActivityLed(){
733-
while(1){
734-
switch (activity_led_state){
735-
case ACTIVITY_LED_OFF:
736-
digitalWrite(LEDB,LOW);
737-
digitalWrite(LEDG,LOW);
738-
break;
739-
case ACTIVITY_LED_BLE: // blue breathing effect
740-
digitalWrite(LEDG, LOW);
741-
for(int i=255; i>0; i--){
742-
analogWrite(LEDB, i);
743-
rtos::ThisThread::sleep_for(10);
744-
}
745-
for(int i=0; i<255; i++){
746-
analogWrite(LEDB, i);
747-
rtos::ThisThread::sleep_for(10);
748-
}
749-
rtos::ThisThread::sleep_for(100);
750-
break;
751-
case ACTIVITY_LED_PAIRING: // blue-green flashing
752-
for(int i = 255; i>0; i=i-2){
753-
analogWrite(LEDG,i);
754-
rtos::ThisThread::sleep_for(1);
755-
}
756-
for(int i = 0; i<255; i=i+2){
757-
analogWrite(LEDG,i);
758-
rtos::ThisThread::sleep_for(1);
759-
}
760-
for(int i = 255; i>0; i=i-2){
761-
analogWrite(LEDB,i);
762-
rtos::ThisThread::sleep_for(1);
763-
}
764-
for(int i = 0; i<255; i=i+2){
765-
analogWrite(LEDB,i);
766-
rtos::ThisThread::sleep_for(1);
767-
}
768-
digitalWrite(LEDG, LOW);
769-
digitalWrite(LEDB, LOW);
770-
break;
771-
default: // any other value turns off leds
772-
digitalWrite(LEDB,LOW);
773-
digitalWrite(LEDG,LOW);
774-
}
775-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
776686
}
777687
}
778688
#endif
@@ -1019,10 +929,6 @@ void ScienceKitCarrier::freeRTOSExternalTemperature(void * pvParameters){
1019929
/********************************************************************/
1020930
/* Microphone */
1021931
/********************************************************************/
1022-
<<<<<<< HEAD
1023-
1024-
=======
1025-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
1026932
#ifdef ARDUINO_NANO_RP2040_CONNECT
1027933
int ScienceKitCarrier::beginMicrophone(){
1028934
PDM.setGain(50);
@@ -1056,10 +962,6 @@ uint ScienceKitCarrier::getMicrophoneRMS(){
1056962
return microphone_rms;
1057963
}
1058964
#endif
1059-
<<<<<<< HEAD
1060-
1061-
=======
1062-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
1063965

1064966

1065967

src/Arduino_ScienceKitCarrier.h

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@
2222

2323
#include <Arduino.h>
2424

25-
<<<<<<< HEAD
2625
#if !defined(ARDUINO_NANO_RP2040_CONNECT) && !defined(ARDUINO_NANO_ESP32)
2726
#error "This product is compatible only with Arduino® Nano RP2040 Connect and Arduino® Nano ESP32
2827
#endif
2928

30-
=======
31-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
3229
#ifdef ARDUINO_NANO_RP2040_CONNECT
3330
#include "WiFiNINA.h"
3431
#include "mbed.h"
@@ -40,18 +37,11 @@
4037
#include "Arduino_APDS9960.h"
4138
#include "Arduino_APDS9999.h"
4239
#include "INA.h"
43-
<<<<<<< HEAD
4440

4541
#include "bsec2.h"
4642

4743
#include "Arduino_BMI270_BMM150.h"
4844

49-
=======
50-
#include "bsec.h"
51-
#include "Arduino_BMI270_BMM150.h"
52-
#include "Arduino_GroveI2C_Ultrasonic.h"
53-
54-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
5545
#ifdef ARDUINO_NANO_RP2040_CONNECT
5646
#include "../../OneWireNg/src/platform/OneWireNg_PicoRP2040.h" // forces to use gpio instead PIO hw
5747
#define OneWireNg_CurrentPlatform OneWireNg_PicoRP2040
@@ -127,7 +117,6 @@ class ScienceKitCarrier{
127117
static const char channels = MICROPHONE_CHANNELS;
128118
static const int frequency = MICROPHONE_FREQUENCY;
129119

130-
<<<<<<< HEAD
131120
rtos::Thread * thread_status_led;
132121
rtos::Thread * thread_update_bme;
133122
rtos::Thread * thread_external_temperature;
@@ -141,11 +130,6 @@ class ScienceKitCarrier{
141130
TaskHandle_t thread_ultrasonic;
142131
TaskHandle_t thread_led;
143132
SemaphoreHandle_t wire_semaphore;
144-
=======
145-
rtos::Thread * thread_activity_led;
146-
rtos::Thread * thread_update_bme;
147-
rtos::Thread * thread_external_temperature;
148-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
149133
#endif
150134

151135
bool thread_bme_is_running;
@@ -166,15 +150,9 @@ class ScienceKitCarrier{
166150

167151
int begin(const uint8_t auxiliary_threads=START_AUXILIARY_THREADS);
168152
void update(const bool roundrobin=false); // this makes update on: analog in, imu, apds, ina, resistance, round robin enables one sensor update
169-
<<<<<<< HEAD
170-
171-
=======
172-
#ifdef ARDUINO_NANO_RP2040_CONNECT
173-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
174153
void startAuxiliaryThreads(const uint8_t auxiliary_threads=START_AUXILIARY_THREADS);
175154
#endif
176155

177-
<<<<<<< HEAD
178156
/* Blink red alert */
179157
void errorTrap(const int error_code=0);
180158

@@ -184,22 +162,6 @@ class ScienceKitCarrier{
184162
void threadStatusLed();
185163
static void freeRTOSStatusLed(void * pvParameters);
186164
#endif
187-
=======
188-
189-
#ifdef ARDUINO_NANO_RP2040_CONNECT
190-
void delay(unsigned long t); // you must use this instead delay, due threads usage
191-
#endif
192-
193-
194-
/* Blink red alert */
195-
void errorTrap(const int error_code=0);
196-
197-
/* Activity led */
198-
#ifdef ARDUINO_NANO_RP2040_CONNECT
199-
void threadActivityLed();
200-
#endif
201-
void setActivityLed(const int led_state=ACTIVITY_LED_OFF);
202-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
203165

204166

205167

@@ -247,11 +209,8 @@ class ScienceKitCarrier{
247209
float getAirQuality(); // index, if good it is 25.0
248210
#ifdef ARDUINO_NANO_RP2040_CONNECT
249211
void threadBME688(); // thread used to update BME688 automatically in multithread mode
250-
<<<<<<< HEAD
251212
#ifdef ARDUINO_NANO_ESP32
252213
static void freeRTOSInternalTemperature(void * pvParameters);
253-
=======
254-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
255214
#endif
256215

257216

@@ -307,11 +266,8 @@ class ScienceKitCarrier{
307266
float getExternalTemperature(); // celsius
308267
bool getExternalTemperatureIsConnected();
309268
void threadExternalTemperature();
310-
<<<<<<< HEAD
311269
#ifdef ARDUINO_NANO_ESP32
312270
static void freeRTOSExternalTemperature(void * pvParameters);
313-
=======
314-
>>>>>>> dd98cd0 (mod: added ESP example, flag to build, NOTE all 0s on BLE)
315271
#endif
316272

317273
#ifdef ARDUINO_NANO_RP2040_CONNECT

0 commit comments

Comments
 (0)