From aba4a949a9421fafaef8195be4892084a15e8fb4 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Sat, 6 Aug 2011 02:41:40 +0200 Subject: [PATCH] Make openbeacon behave on funk config --- firmware/funk/openbeacon.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firmware/funk/openbeacon.c b/firmware/funk/openbeacon.c index f1831e4..65d8ae9 100644 --- a/firmware/funk/openbeacon.c +++ b/firmware/funk/openbeacon.c @@ -16,6 +16,8 @@ volatile uint32_t seq = 0; volatile uint8_t strength = 0; static void openbeaconSave(uint32_t s); +static struct NRF_CFG oldconfig; + static void openbeaconShutdown(void) { openbeaconSave(seq); @@ -91,6 +93,9 @@ static uint8_t openbeaconSendPacket(uint32_t id, uint32_t seq, uint8_t openbeaconSend(void) { uint8_t status; + + nrf_config_get(&oldconfig); + nrf_set_channel(OPENBEACON_CHANNEL); nrf_set_strength(strength); nrf_set_tx_mac(sizeof(mac), mac); @@ -100,6 +105,7 @@ uint8_t openbeaconSend(void) strength = 0; if( (seq++ & OPENBEACON_SAVE) == OPENBEACON_SAVE ) openbeaconSaveBlock(); + nrf_config_set(&oldconfig); return status; }