Skip to content

Commit

Permalink
Add define to configure motor spin
Browse files Browse the repository at this point in the history
Define if they should spin and at what speed
  • Loading branch information
ToveRumar committed Aug 12, 2024
1 parent 63494a7 commit 373df84
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/deck/drivers/src/test/radiotest.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@
#include "param.h"
#include "platform_defaults.h"


#define SHOULD_SPIN_MOTORS 0

#ifdef CONFIG_MOTORS_DEFAULT_IDLE_THRUST
#define MOTOR_SPEED CONFIG_MOTORS_DEFAULT_IDLE_THRUST
#else
#define MOTOR_SPEED 7000
#endif


//Hardware configuration
static bool isInit;
static uint8_t channel = 80;
Expand All @@ -55,7 +65,7 @@ static void spinMotorsTask(void *param)
paramVarId_t motorPowerSetEnableParam = paramGetVarId("motorPowerSet", "enable");
paramVarId_t motorParams = paramGetVarId("motorPowerSet", "m1");
paramSetInt(motorPowerSetEnableParam, 2);
paramSetInt(motorParams, CONFIG_MOTORS_DEFAULT_IDLE_THRUST);
paramSetInt(motorParams, MOTOR_SPEED);

vTaskDelete(NULL);
}
Expand Down Expand Up @@ -106,7 +116,9 @@ static void radiotestInit(DeckInfo *info)
return;

xTaskCreate(radiotestTask, "RADIOTEST", configMINIMAL_STACK_SIZE, NULL, 1, NULL);
xTaskCreate(spinMotorsTask, "spinMotors", configMINIMAL_STACK_SIZE, NULL, 1, NULL);
if (SHOULD_SPIN_MOTORS) {
xTaskCreate(spinMotorsTask, "spinMotors", configMINIMAL_STACK_SIZE, NULL, 1, NULL);
}
isInit = true;
}

Expand Down

0 comments on commit 373df84

Please sign in to comment.