From 6a6c00e26d59a053ba62bcaf622619d032dcfa6d Mon Sep 17 00:00:00 2001 From: Tobias Antonsson Date: Thu, 11 Oct 2018 14:37:52 +0200 Subject: [PATCH] Added USE_EXT_ANTENNA define. Disabled RSSI_ACK_PACKET. --- Makefile | 2 +- src/pm_cf2.c | 15 ++++++++++++--- src/pm_cf21.c | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3225f2ee..c2a82ba0 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ NRF_S110 ?= s110 INCLUDES= -I Include -I Include/gcc -Iinterface -CONFIG = -DRSSI_ACK_PACKET +#CONFIG = -DRSSI_ACK_PACKET BUILD_OPTION = -g3 -O0 -Wall -fsingle-precision-constant -ffast-math -std=gnu11 PERSONAL_DEFINES ?= diff --git a/src/pm_cf2.c b/src/pm_cf2.c index e7d24357..3543fba5 100644 --- a/src/pm_cf2.c +++ b/src/pm_cf2.c @@ -44,6 +44,7 @@ #define HAS_TI_CHARGER #define HAS_BAT_SINK +//#define ENABLE_FAST_CHARGE_1A static PmState state; static PmState targetState; @@ -191,12 +192,15 @@ static void pmRunSystem(bool enable) #ifdef HAS_TI_CHARGER nrf_gpio_cfg_output(PM_EN1); nrf_gpio_cfg_output(PM_EN2); +#ifdef ENABLE_FAST_CHARGE_1A + // 980mA current + nrf_gpio_pin_clear(PM_EN1); + nrf_gpio_pin_set(PM_EN2); +#else // Set 500mA current nrf_gpio_pin_set(PM_EN1); nrf_gpio_pin_clear(PM_EN2); - // 980mA current -// nrf_gpio_pin_clear(PM_EN1); -// nrf_gpio_pin_set(PM_EN2); +#endif // Enable charging nrf_gpio_cfg_output(PM_CHG_EN); @@ -208,8 +212,13 @@ static void pmRunSystem(bool enable) nrf_gpio_cfg_output(RADIO_PA_RX_EN); nrf_gpio_cfg_output(RADIO_PA_MODE); nrf_gpio_cfg_output(RADIO_PA_ANT_SW); + #ifdef USE_EXT_ANTENNA + // Select u.FL antenna + nrf_gpio_pin_clear(RADIO_PA_ANT_SW); + #else // Select chip antenna nrf_gpio_pin_set(RADIO_PA_ANT_SW); + #endif #ifdef RFX2411N_BYPASS_MODE nrf_gpio_pin_set(RADIO_PA_MODE); diff --git a/src/pm_cf21.c b/src/pm_cf21.c index 347807a8..f974d47e 100644 --- a/src/pm_cf21.c +++ b/src/pm_cf21.c @@ -22,5 +22,6 @@ * License along with this library. */ #define HAS_RFX2411N +//#define USE_EXT_ANTENNA #include "pm_cf2.c"