Skip to content

Commit

Permalink
Completed read only params to indicate if deck drivers are initialize…
Browse files Browse the repository at this point in the history
…d or not. Closes #237
  • Loading branch information
krichardsson committed Aug 7, 2018
1 parent 8a9b535 commit efbd2d0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/deck/drivers/src/cppmdeck.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "debug.h"
#include "deck.h"
#include "extrx.h"
#include "param.h"

//Hardware configuration
static bool isInit;
Expand Down Expand Up @@ -69,3 +70,7 @@ static const DeckDriver cppm_deck = {
};

DECK_DRIVER(cppm_deck);

PARAM_GROUP_START(deck)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcCPPM, &isInit)
PARAM_GROUP_STOP(deck)
5 changes: 5 additions & 0 deletions src/deck/drivers/src/gtgps.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <stdlib.h>
#include <math.h>
#include "log.h"
#include "param.h"

static bool isInit;

Expand Down Expand Up @@ -311,6 +312,10 @@ static const DeckDriver gtgps_deck = {

DECK_DRIVER(gtgps_deck);

PARAM_GROUP_START(deck)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcGTGPS, &isInit)
PARAM_GROUP_STOP(deck)

LOG_GROUP_START(gps)
LOG_ADD(LOG_INT32, lat, &m.latitude)
LOG_ADD(LOG_INT32, lon, &m.longitude)
Expand Down
8 changes: 4 additions & 4 deletions src/deck/drivers/src/locodeck.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,10 @@ static const DeckDriver dwm1000_deck = {

DECK_DRIVER(dwm1000_deck);

PARAM_GROUP_START(deck)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcDWM1000, &isInit)
PARAM_GROUP_STOP(deck)

LOG_GROUP_START(ranging)
#if (LOCODECK_NR_OF_ANCHORS > 0)
LOG_ADD(LOG_FLOAT, distance0, &algoOptions.distance[0])
Expand Down Expand Up @@ -606,10 +610,6 @@ PARAM_ADD(PARAM_FLOAT, anchor7z, &algoOptions.anchorPosition[7].z)
PARAM_ADD(PARAM_UINT8, enable, &algoOptions.combinedAnchorPositionOk)
PARAM_GROUP_STOP(anchorpos)

PARAM_GROUP_START(deck)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcDWM1000, &isInit)
PARAM_GROUP_STOP(deck)

// Loco Posisioning Protocol (LPP) handling

void lpsHandleLppShortPacket(const uint8_t srcId, const uint8_t *data, const int length)
Expand Down
8 changes: 4 additions & 4 deletions src/deck/drivers/src/oa.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ static const DeckDriver oa_deck = {

DECK_DRIVER(oa_deck);

PARAM_GROUP_START(deck)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcOA, &isInit)
PARAM_GROUP_STOP(deck)

LOG_GROUP_START(oa)
LOG_ADD(LOG_UINT16, front, &rangeFront)
LOG_ADD(LOG_UINT16, back, &rangeBack)
LOG_ADD(LOG_UINT16, up, &rangeUp)
LOG_ADD(LOG_UINT16, left, &rangeLeft)
LOG_ADD(LOG_UINT16, right, &rangeRight)
LOG_GROUP_STOP(oa)

PARAM_GROUP_START(deck)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcOA, &isInit)
PARAM_GROUP_STOP(deck)
5 changes: 5 additions & 0 deletions src/deck/drivers/src/rzr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "deck.h"
#include "extrx.h"
#include "pm.h"
#include "param.h"

#define RZR_GPIO_RCC_M1_OVERRIDE RCC_AHB1Periph_GPIOA
#define RZR_GPIO_PORT_M1_OVERRIDE GPIOA
Expand Down Expand Up @@ -120,3 +121,7 @@ static const DeckDriver rzr_deck = {
};

DECK_DRIVER(rzr_deck);

PARAM_GROUP_START(deck)
PARAM_ADD(PARAM_UINT8 | PARAM_RONLY, bcRZR, &isInit)
PARAM_GROUP_STOP(deck)

0 comments on commit efbd2d0

Please sign in to comment.