Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #154 from ojousima/master
Browse files Browse the repository at this point in the history
Fix fast advertising at startup
  • Loading branch information
ojousima authored Feb 28, 2019
2 parents b531523 + a3625d7 commit 351b1eb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions ruuvi_examples/ruuvi_firmware/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,14 @@ void change_mode(void* data, uint16_t length)
tag_mode = RAWv1;
app_timer_start(main_timer_id, APP_TIMER_TICKS(MAIN_LOOP_INTERVAL_RAW, RUUVITAG_APP_TIMER_PRESCALER), NULL);
}
bluetooth_configure_advertising_interval(advertising_rates[tag_mode] + advertisement_delay);
if(fast_advertising)
{
bluetooth_configure_advertising_interval(ADVERTISING_INTERVAL_STARTUP + advertisement_delay);
}
else
{
bluetooth_configure_advertising_interval(advertising_rates[tag_mode] + advertisement_delay);
}
bluetooth_apply_configuration();
NRF_LOG_INFO("Updating to %d mode\r\n", (uint32_t) tag_mode);
main_timer_handler(NULL);
Expand Down Expand Up @@ -221,7 +228,7 @@ static void store_mode(void* data, uint16_t length)
*/
static void reboot(void* p_context)
{
NRF_LOG_INFO("Rebooting\r\n")
NRF_LOG_WARNING("Rebooting\r\n")
NVIC_SystemReset();
}

Expand Down Expand Up @@ -387,7 +394,7 @@ static void main_sensor_task(void* p_data, uint16_t length)
// Embed data into structure for parsing.
parseSensorData(&data, raw_t, raw_p, raw_h, vbat, acc);
NRF_LOG_DEBUG("temperature: %d, pressure: %d, humidity: %d x: %d y: %d z: %d\r\n", raw_t, raw_p, raw_h, acc[0], acc[1], acc[2]);
NRF_LOG_INFO("VBAT: %d send %d \r\n", vbat, data.vbat);
NRF_LOG_DEBUG("VBAT: %d send %d \r\n", vbat, data.vbat);
// Prepare bytearray to broadcast.
bme280_data_t environmental;
environmental.temperature = raw_t;
Expand Down

0 comments on commit 351b1eb

Please sign in to comment.