Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
ch3p4ll3 authored Nov 17, 2023
1 parent 473389c commit 529ad02
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions arduino/ESP-Intervallometer/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ Program intervallometerProgram;
void initBLE();
void setCallbacks();
void setDefaults();
void coreTask( void * pvParameters );
#pragma endregion

void coreTask( void * pvParameters ){
while(true){
intervallometer.loop();
}
}

class StatusCallback : public BLECharacteristicCallbacks
{
void onWrite(BLECharacteristic *pCharacteristic)
Expand All @@ -54,12 +61,20 @@ void setup()
setCallbacks();
setDefaults();

xTaskCreatePinnedToCore(
coreTask, /* Function to implement the task */
"coreTask", /* Name of the task */
10000, /* Stack size in words */
NULL, /* Task input parameter */
0, /* Priority of the task */
NULL, /* Task handle. */
taskCore); /* Core where the task should run */

Serial.begin(9600);
}

void loop()
{
intervallometer.loop();
}

void initBLE()
Expand Down Expand Up @@ -105,4 +120,4 @@ void setDefaults(){
AutofocusCharacteristics.setValue("0");
AutofocusDelayCharacteristics.setValue("1500");
StatusCharacteristics.setValue("0");
}
}

0 comments on commit 529ad02

Please sign in to comment.