Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
matejkarasek committed Jan 9, 2024
1 parent bce9a0a commit d448764
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
8 changes: 3 additions & 5 deletions src/deck/drivers/src/bigquad.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

#include "FreeRTOS.h"
#include "task.h"
#include "servo.h"

#define BIGQUAD_BAT_VOLT_PIN DECK_GPIO_MISO
#define BIGQUAD_BAT_VOLT_MULT (CONFIG_DECK_BIGQUAD_BAT_VOLT_MULT_MV / 1000.0)
Expand All @@ -53,7 +52,6 @@

//Hardware configuration
static bool isInit;
//static int8_t s_servo_angle = 0;

#ifdef CONFIG_DECK_BIGQUAD_ENABLE_OSD
static MspObject s_MspObject;
Expand Down Expand Up @@ -84,7 +82,7 @@ static void bigquadInit(DeckInfo *info)

DEBUG_PRINT("Switching to brushless.\n");
motorsInit(motorMapBigQuadDeck);
// extRxInit();
extRxInit();

// Ignore charging/charged state to allow low-battery warning.
pmIgnoreChargedState(true);
Expand All @@ -101,7 +99,6 @@ static void bigquadInit(DeckInfo *info)
BQ_OSD_TASK_STACKSIZE, NULL, BQ_OSD_TASK_PRI, NULL);
#endif

servoInit();
isInit = true;
}

Expand All @@ -124,7 +121,7 @@ static const DeckDriver bigquad_deck = {

.usedPeriph = DECK_USING_TIMER3 | DECK_USING_TIMER14,
.usedGpio = DECK_USING_PA2 | DECK_USING_PA3 | DECK_USING_IO_3 |
DECK_USING_IO_2 | DECK_USING_PA7 | DECK_USING_IO_4,
DECK_USING_IO_2 | DECK_USING_PA7,
.init = bigquadInit,
.test = bigquadTest,
};
Expand All @@ -137,6 +134,7 @@ PARAM_GROUP_START(deck)
* @brief Nonzero if [BigQuad deck](%https://www.bitcraze.io/products/bigquad-deck) is attached
*/
PARAM_ADD_CORE(PARAM_UINT8 | PARAM_RONLY, bcBigQuad, &isInit)

PARAM_GROUP_STOP(deck)

#endif // CONFIG_DECK_BIGQUAD
2 changes: 1 addition & 1 deletion src/drivers/src/motors_def.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,4 +830,4 @@ const MotorPerifDef* motorMapCF21Brushless[NBR_OF_MOTORS] =
/**
* Servo mapped to the Bigquad CPPM (MOSI) port
*/
const MotorPerifDef* servoMapMOSI = &MOTORS_PA7_TIM14_CH1_SERVO;
const MotorPerifDef* servoMapMOSI = &MOTORS_PA7_TIM14_CH1_SERVO;
2 changes: 1 addition & 1 deletion src/drivers/src/servo.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,4 @@ PARAM_GROUP_START(servo)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, servoInitialized, &isInit)
PARAM_ADD_WITH_CALLBACK(PARAM_UINT8 , servoAngle, &s_servo_angle, &servoAngleCallBack)

PARAM_GROUP_STOP(servo)
PARAM_GROUP_STOP(servo)
6 changes: 0 additions & 6 deletions src/modules/src/supervisor.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,32 +259,26 @@ static supervisorConditionBits_t updateAndPopulateConditions(SupervisorMem_t* th

const bool isTumbled = isTumbledCheck(this, sensors, currentTick);
if (isTumbled) {
DEBUG_PRINT("Is Tumbled!\n");
conditions |= SUPERVISOR_CB_IS_TUMBLED;
}

const uint32_t setpointAge = currentTick - setpoint->timestamp;
if (setpointAge > COMMANDER_WDT_TIMEOUT_STABILIZE) {
DEBUG_PRINT("Setpoint is old!\n");
conditions |= SUPERVISOR_CB_COMMANDER_WDT_WARNING;
}
if (setpointAge > COMMANDER_WDT_TIMEOUT_SHUTDOWN) {
DEBUG_PRINT("Setpoint is old! Timeout!\n");
conditions |= SUPERVISOR_CB_COMMANDER_WDT_TIMEOUT;
}

if (!checkEmergencyStopWatchdog(currentTick)) {
DEBUG_PRINT("Emergency Stop!\n");
conditions |= SUPERVISOR_CB_EMERGENCY_STOP;
}

if (locSrvIsEmergencyStopRequested()) {
DEBUG_PRINT("Loc Srv Emergency stop!\n");
conditions |= SUPERVISOR_CB_EMERGENCY_STOP;
}

if (this->paramEmergencyStop) {
DEBUG_PRINT("Param Emergency stop!\n");
conditions |= SUPERVISOR_CB_EMERGENCY_STOP;
}

Expand Down

0 comments on commit d448764

Please sign in to comment.