Make openbeacon behave on funk config

This commit is contained in:
Stefan `Sec` Zehl 2011-08-06 02:41:40 +02:00
parent feb5db7328
commit aba4a949a9
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}