Skip to content

Commit af85cc0

Browse files
committed
begin threads
1 parent 7c660a7 commit af85cc0

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

examples/ScienceJournal/ScienceJournal.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void setup() {
1515
pinMode(8,OUTPUT);
1616
pinMode(7,OUTPUT);
1717

18-
science_kit.begin();
18+
science_kit.begin(NO_AUXILIARY_THREADS); // Doesn't start the BME688 thread for the moment
1919

2020
if (!BLE.begin()) {
2121
while(1);
@@ -56,7 +56,7 @@ void setup() {
5656

5757
BLE.addService(service);
5858
BLE.advertise();
59-
science_kit.startAuxiliaryThreads();
59+
science_kit.startAuxiliaryThreads(); // start the bme688 thread
6060
_t.start(loop_data);
6161
_tu.start(update);
6262
}

src/Arduino_ScienceKitCarrier.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ScienceKitCarrier::ScienceKitCarrier(){
7979

8080

8181

82-
int ScienceKitCarrier::begin(){
82+
int ScienceKitCarrier::begin(const bool auxiliary_threads){
8383
pinMode(LEDR,OUTPUT);
8484
digitalWrite(LEDR,LOW);
8585
pinMode(LEDG,OUTPUT);
@@ -116,7 +116,9 @@ int ScienceKitCarrier::begin(){
116116
}
117117

118118
// let's start activity led and bme688
119-
//startAuxiliaryThreads();
119+
if (auxiliary_threads){
120+
startAuxiliaryThreads();
121+
}
120122
}
121123

122124

src/Arduino_ScienceKitCarrier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ScienceKitCarrier{
7272
public:
7373
ScienceKitCarrier();
7474

75-
int begin();
75+
int begin(const bool auxiliary_threads=true);
7676
void update(const bool roundrobin=false); // this makes update on: analog in, imu, apds, ina, resistance, round robin enables one sensor update
7777
void startAuxiliaryThreads();
7878

src/utils/Arduino_ScienceKitCarrier_definitions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ const uint16_t MAXIMUM_AMPS{1}; // 1A
6464
#define ROUND_ROBIN_ENABLED 1
6565
#define ROUND_ROBIN_DISABLED 0
6666

67+
#define START_AUXILIARY_THREADS 1
68+
#define NO_AUXILIARY_THREADS 0
69+
6770

6871

6972
#endif

0 commit comments

Comments
 (0)