Skip to content

Commit

Permalink
Added the result from exptest deck driver to log variables
Browse files Browse the repository at this point in the history
Included the limit as well so that you can see how the drone performed compared to it.
THis will make it possible to fetch individual motor results using the lib in production
  • Loading branch information
ToveRumar committed Oct 24, 2024
1 parent 5817411 commit 884c5ed
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/deck/drivers/src/test/exptestCfBl.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ typedef struct {
logVarId_t m4;
} motorRpmParams_t;

typedef struct {
uint16_t motors[4];
uint16_t lowerRpmLimit;
} rpmTestResults_t;

static EtGpio etGpioIn[ET_NBR_PINS] = {
{ET_GPIO_PORT_TX1, ET_GPIO_PIN_TX1, "TX1"},
{ET_GPIO_PORT_RX1, ET_GPIO_PIN_RX1, "RX1"},
Expand All @@ -103,6 +108,7 @@ static EtGpio etGpioIn[ET_NBR_PINS] = {
static bool isInit;
const DeckDriver *bcRpm = NULL;
static motorRpmParams_t motorRpm = {0};
static rpmTestResults_t rpmResults = {.motors = {0,0,0,0}, .lowerRpmLimit = RPM_TEST_LOWER_LIMIT};

static void expCfBlTestInit(DeckInfo *info)
{
Expand Down Expand Up @@ -275,4 +281,12 @@ static const DeckDriver expCfBltest_deck = {
.test = expCfBlTestRun
};

LOG_GROUP_START(expCfBl)
LOG_ADD(LOG_UINT16, rpmLimit, &rpmResults.lowerRpmLimit)
LOG_ADD(LOG_UINT16, m1, &rpmResults.motors[0])
LOG_ADD(LOG_UINT16, m2, &rpmResults.motors[1])
LOG_ADD(LOG_UINT16, m3, &rpmResults.motors[2])
LOG_ADD(LOG_UINT16, m4, &rpmResults.motors[3])
LOG_GROUP_STOP(expCfBl)

DECK_DRIVER(expCfBltest_deck);

0 comments on commit 884c5ed

Please sign in to comment.