Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ def configure_target(TARGET):
INCLUDES = " ".join("-I" + include for include in INCLUDE_DIRS)

LTO_FLAGS = "-flto -fuse-linker-plugin"
#DEBUG_FLAGS = "-ggdb3 -DDEBUG -O0"
DEBUG_FLAGS = "-ggdb3 -DDEBUG -Og"

CFLAGS = " ".join([
Expand Down
2 changes: 2 additions & 0 deletions src/flight_controller/inc/telemetry/dshotTwoWay.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ typedef struct
uint32_t motorCommMask;
} dshot_command_handler;

extern volatile int dShotFeedTheDog;
extern volatile dshot_command_handler dshotCommandHandler;

extern void DshotInit(int offlineMode);
extern int InitDshotCommandState(void);
extern int HandleDshotCommands(void);
extern void ThrottleToDshot(uint8_t *serialOutBuffer, float throttle, float idle, int reverse);
extern void CommandToDshot(uint8_t *serialOutBuffer, uint16_t command);
extern void DshotTransferComplete(uint32_t callbackNumber);
1 change: 0 additions & 1 deletion src/flight_controller/src/config.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "includes.h"


// use variable record but instead of storing address of variable, store offset based on address of field, that way it works with the record loaded from file

extern volatile int logMe;
Expand Down
5 changes: 5 additions & 0 deletions src/flight_controller/src/imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ quaternion_record MultiplyQuatAndQuat(volatile quaternion_record quatIn1, volati
void EulerToVector(volatile vector_record *outVector, float x, float y, float z);
void VectorAddVector(volatile vector_record *vectorOut, vector_record vectorIn, float trust);

vector_record RotateVectorByQuaternionQV(volatile quaternion_record quatIn, volatile vector_record vectorIn);
void VectorCrossProduct(volatile vector_record *vectorOut, volatile vector_record vectorIn1, volatile vector_record vectorIn2);
vector_record RotateVectorByQuaternionVQ(volatile vector_record vectorIn, volatile quaternion_record quatIn);
vector_record QuaternionToVector(volatile quaternion_record quatIn);

//quats are defined like this: X is roll, Y is pitch, Z is yaw.
//Positive X is a roll to the right which matches our gyro
//Positive Y is a pitch down which is opposite of our gyro
Expand Down
6 changes: 4 additions & 2 deletions src/flight_controller/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ int main(void)

retValChk = BoardInit();

//DshotInit(1);

retValChk = HandleRfbl();

DshotInit(1);
//TESTING ONLY!!
while(1);

retValChk = LoadConfig(ADDRESS_CONFIG_START);

SpektrumBind(mainConfig.rcControlsConfig.bind);
Expand Down
2 changes: 1 addition & 1 deletion src/flight_controller/src/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void TaskAdc(void)
void TaskProcessSoftSerial(void)
{
//feed the dog if oneWire is active to prevent WD restart
if (oneWireActive)
if (oneWireActive || dShotFeedTheDog)
FeedTheDog();

//feed the dog if dshot commanding is active to prevent WD restart
Expand Down
Loading