Skip to content

Commit

Permalink
When radiotest driver is included spin motors
Browse files Browse the repository at this point in the history
FOr certification the motors should be running during tests. So enable idle thrust speed on propellers
  • Loading branch information
ToveRumar committed Aug 12, 2024
1 parent 515dedc commit 63494a7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/deck/drivers/src/test/radiotest.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "deck.h"
#include "syslink.h"
#include "param.h"
#include "platform_defaults.h"

//Hardware configuration
static bool isInit;
Expand All @@ -47,6 +48,18 @@ static uint8_t old_channel;
static int8_t old_power;
static uint8_t old_contwave;

static void spinMotorsTask(void *param)
{
vTaskDelay(M2T(4000)); // Wait for the ESCs to be ready to recieve signals

paramVarId_t motorPowerSetEnableParam = paramGetVarId("motorPowerSet", "enable");
paramVarId_t motorParams = paramGetVarId("motorPowerSet", "m1");
paramSetInt(motorPowerSetEnableParam, 2);
paramSetInt(motorParams, CONFIG_MOTORS_DEFAULT_IDLE_THRUST);

vTaskDelete(NULL);
}

static void radiotestTask(void *param)
{

Expand Down Expand Up @@ -93,7 +106,7 @@ static void radiotestInit(DeckInfo *info)
return;

xTaskCreate(radiotestTask, "RADIOTEST", configMINIMAL_STACK_SIZE, NULL, 1, NULL);

xTaskCreate(spinMotorsTask, "spinMotors", configMINIMAL_STACK_SIZE, NULL, 1, NULL);
isInit = true;
}

Expand Down

0 comments on commit 63494a7

Please sign in to comment.