diff --git a/src/config/config.h b/src/config/config.h index e77e9f1f7a..6988267880 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -193,7 +193,7 @@ #define UART2_TASK_STACKSIZE configMINIMAL_STACK_SIZE #define CRTP_SRV_TASK_STACKSIZE configMINIMAL_STACK_SIZE #define PLATFORM_SRV_TASK_STACKSIZE configMINIMAL_STACK_SIZE -#define PASSTHROUGH_TASK_STACKSIZE configMINIMAL_STACK_SIZE +#define PASSTHROUGH_TASK_STACKSIZE (2 * configMINIMAL_STACK_SIZE) #define BQ_OSD_TASK_STACKSIZE configMINIMAL_STACK_SIZE #define GTGPS_DECK_TASK_STACKSIZE configMINIMAL_STACK_SIZE #define UART1_TEST_TASK_STACKSIZE configMINIMAL_STACK_SIZE diff --git a/src/modules/src/vcp_esc_passthrough.c b/src/modules/src/vcp_esc_passthrough.c index 685b25c711..89f328e1c5 100644 --- a/src/modules/src/vcp_esc_passthrough.c +++ b/src/modules/src/vcp_esc_passthrough.c @@ -47,7 +47,6 @@ static TaskHandle_t passthroughTaskHandle; STATIC_MEM_TASK_ALLOC(passthroughTask, PASSTHROUGH_TASK_STACKSIZE); static bool isInit; -static paramVarId_t motorPowerSetEnableParam; // Passthorugh queues to handle VCP data. static xQueueHandle ptRxQueue; @@ -75,8 +74,6 @@ void passthroughInit() ptTxQueue = STATIC_MEM_QUEUE_CREATE(ptTxQueue); DEBUG_QUEUE_MONITOR_REGISTER(ptRxQueue); - motorPowerSetEnableParam = paramGetVarId("motorPowerSet", "enable"); - passthroughTaskHandle = STATIC_MEM_TASK_CREATE(passthroughTask, passthroughTask, PASSTHROUGH_TASK_NAME, NULL, PASSTHROUGH_TASK_PRI); } @@ -154,6 +151,8 @@ void passthroughTask(void *param) // The ability to set the powers of the motors directly might be changed // during the 4way process (for instance while using the motor sliders in ESC Configurator ). // Here we'll just make sure that the ability is set to false, so we don't accidentally start the motors. + paramVarId_t motorPowerSetEnableParam; + motorPowerSetEnableParam = paramGetVarId("motorPowerSet", "enable"); paramSetInt(motorPowerSetEnableParam, 0); // Clear any notifications that was queued during 4way process.