Browse Source

remove MULTITASKING preprocessor flag

master
phail 3 years ago
parent
commit
4489665371
  1. 3
      .gitignore
  2. 4
      include/config.h
  3. 20
      platformio.ini
  4. 5
      src/input.cpp
  5. 17
      src/main.cpp
  6. 4
      src/output.cpp

3
.gitignore vendored

@ -2,4 +2,5 @@
.piolibdeps
.clang_complete
.gcc-flags.json
.vscode/*
.vscode
.pio

4
include/config.h

@ -3,10 +3,6 @@
// ############################### Settings ###############################
// Whenever possible, settings should be managed in platformio.ini!
/****************************** System *********************************/
#define MULTITASKING
/****************************** Debug *********************************/
//#define DEBUG_OLED

20
platformio.ini

@ -10,16 +10,16 @@
[platformio]
;env_default = featheresp32_ESPSLAVE
;env_default = TTGO_ESPMASTER
;env_default = TTGO_ESPMASTER_PADDELEC
;env_default = nodemcu-32s_WIFI
;env_default = nodemcu-32s_ESPSLAVE
;env_default = nodemcu-32s_ESPPROTOCOL
;env_default = featheresp32_psycho
;env_default = nodemcu-woodenboard
;env_default = nodemcu-testrun
;env_default = featheresp32_psychoremote
;default_envs = featheresp32_ESPSLAVE
;default_envs = TTGO_ESPMASTER
;default_envs = TTGO_ESPMASTER_PADDELEC
;default_envs = nodemcu-32s_WIFI
;default_envs = nodemcu-32s_ESPSLAVE
;default_envs = nodemcu-32s_ESPPROTOCOL
;default_envs = featheresp32_psycho
;default_envs = nodemcu-woodenboard
;default_envs = nodemcu-testrun
;default_envs = featheresp32_psychoremote
[env:featheresp32_ESPSLAVE]

5
src/input.cpp

@ -85,11 +85,8 @@ void slowReset(volatile double &variable, double goal, double step) {
void mainloop( void *pvparameters ) {
#ifdef MULTITASKING
// int taskno = (int)pvparameters;
while(1) {
#endif //MULTITASKING
deltaMillis = millis() - millisMotorcomm;
millisMotorcomm = millis();
@ -303,8 +300,6 @@ void mainloop( void *pvparameters ) {
} while( u8g2.nextPage() );
#endif
#ifdef MULTITASKING
vTaskDelay(10);
}
#endif //MULTITASKING
}

17
src/main.cpp

@ -6,9 +6,7 @@
#include "serialbridge.h"
#include "ArduinoNunchuk.h"
#ifdef MULTITASKING
TaskHandle_t TaskMainloop, TaskMotorcommunication;
#endif //MULTITASKING
#ifdef DEBUG_OLED
@ -55,7 +53,6 @@ void setup() {
setupOTA();
#endif
#ifdef MULTITASKING
xTaskCreatePinnedToCore(
mainloop, // Task function.
"Main_loop", // name of task.
@ -73,7 +70,6 @@ void setup() {
1, // priority of the task
&TaskMotorcommunication, // Task handle to keep track of created task
1); // Core (0 is used by ESP32 connectivity)
#endif //MULTITASKING
}
@ -92,16 +88,5 @@ void loop() {
#endif
#ifdef MULTITASKING
delay(5);
#else
mainloop( (void *)1 );
motorCommunication( (void *)1 );
delay(MOTORINPUT_PERIOD);
#endif //MULTITASKING
delay(5);
}

4
src/output.cpp

@ -239,10 +239,8 @@ void pollUART() {
#endif
void motorCommunication( void * pvparameters) {
#ifdef MULTITASKING
// int taskno = (int)pvparameters;
while(1) {
#endif //MULTITASKING
#ifdef OUTPUT_ESPNOW
if (SlaveCnt > 0) { // check if slave channel is defined
@ -352,7 +350,6 @@ void motorCommunication( void * pvparameters) {
hbpEspnow.protocolTick();
#endif
#ifdef MULTITASKING
unsigned long start = millis();
while (millis() < start + MOTORINPUT_PERIOD){
#ifdef OUTPUT_PROTOCOL_UART
@ -367,7 +364,6 @@ void motorCommunication( void * pvparameters) {
delayMicroseconds(100);
}
}
#endif //MULTITASKING
}
/*

Loading…
Cancel
Save