Skip to content

Commit

Permalink
#269: Allow setting the low interference mode in config.mk
Browse files Browse the repository at this point in the history
  • Loading branch information
ataffanel committed Jul 3, 2018
1 parent 42536bd commit ad62b75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/platform/cf2/platform_cf2.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
#include "radiolink.h"

// Define to decrease the nRF51 Tx power to reduce interference
#define PLATFORM_NRF51_TX_POWER_DBM (-12)
#ifndef PLATFORM_NRF51_LOW_INTERFERENCE_TX_POWER_DBM
#define PLATFORM_NRF51_LOW_INTERFERENCE_TX_POWER_DBM (-12)
#endif

// TODO: Implement!
int platformInit(void)
Expand All @@ -51,6 +53,6 @@ int platformInit(void)
void platformSetLowInterferenceRadioMode(void)
{
// Decrease the nRF51 Tx power to reduce interference
radiolinkSetPowerDbm(PLATFORM_NRF51_TX_POWER_DBM);
DEBUG_PRINT("Low interference mode. NRF51 TX power reduced by %ddb.\r\n", PLATFORM_NRF51_TX_POWER_DBM);
radiolinkSetPowerDbm(PLATFORM_NRF51_LOW_INTERFERENCE_TX_POWER_DBM);
DEBUG_PRINT("Low interference mode. NRF51 TX power offset by %ddb.\r\n", PLATFORM_NRF51_LOW_INTERFERENCE_TX_POWER_DBM);
}
5 changes: 5 additions & 0 deletions tools/make/config.mk.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@
# Only use in TDoA 3
# Note: Anchors must also be built with this flag
# CFLAGS += -DLPS_LONGER_RANGE

## Low interference communication
# Set the 'low interference' 2.4GHz TX power. This power is set when the loco deck is initialized
# Possible power are: +4, 0, -4, -8, -12, -16, -20, -30
# CFLAGS += -DPLATFORM_NRF51_LOW_INTERFERENCE_TX_POWER_DBM="(-12)"

0 comments on commit ad62b75

Please sign in to comment.