Skip to content

Commit

Permalink
Fixes per review
Browse files Browse the repository at this point in the history
  • Loading branch information
haslinghuis committed Mar 10, 2023
1 parent 8b49bab commit 8241b81
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
14 changes: 14 additions & 0 deletions src/main/pg/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@
#include "rx/rx.h"
#include "rx/rx_spi.h"

#ifndef SERIALRX_PROVIDER

#if defined(USE_SERIALRX_SBUS)
#define SERIALRX_PROVIDER SERIALRX_SBUS
#elif defined(USE_SERIALRX_GHST)
#define SERIALRX_PROVIDER SERIALRX_GHST
#elif defined(USE_SERIALRX_CRSF)
#define SERIALRX_PROVIDER SERIALRX_CRSF
#else
#define SERIALRX_PROVIDER 0
#endif

#endif

PG_REGISTER_WITH_RESET_FN(rxConfig_t, rxConfig, PG_RX_CONFIG, 4);
void pgResetFn_rxConfig(rxConfig_t *rxConfig)
{
Expand Down
4 changes: 0 additions & 4 deletions src/main/target/common_defaults_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@
#define RX_SPI_DEFAULT_PROTOCOL 0
#endif

#ifndef SERIALRX_PROVIDER
#define SERIALRX_PROVIDER 0
#endif

#define RX_MIN_USEC 885
#define RX_MAX_USEC 2115
#define RX_MID_USEC 1500
Expand Down
12 changes: 0 additions & 12 deletions src/main/target/common_pre.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,3 @@
#endif

#endif // defined(USE_SERIALRX_CRSF)

#if defined(USE_SERIALRX) && !defined(SERIALRX_PROVIDER)

#if defined(USE_SERIALRX_SBUS)
#define SERIALRX_PROVIDER SERIALRX_SBUS
#elif defined(USE_SERIALRX_GHST)
#define SERIALRX_PROVIDER SERIALRX_GHST
#else
#define SERIALRX_PROVIDER SERIALRX_CRSF
#endif

#endif

0 comments on commit 8241b81

Please sign in to comment.