fix microbit hang after 180 sec

This commit is contained in:
Gordon Williams 2015-11-30 16:03:13 +00:00
parent ef19051b80
commit 0f37ba6426

View File

@ -47,11 +47,13 @@ of beta. */
#define IS_SRVC_CHANGED_CHARACT_PRESENT 0 /**< Include the service_changed characteristic. If not enabled, the server's database cannot be changed for the lifetime of the device. */
#define DEVICE_NAME "Nordic_Espruino" /**< Name of device. Will be included in the advertising data. */
#define DEVICE_NAME "Espruino "PC_BOARD_ID /**< Name of device. Will be included in the advertising data. */
#define NUS_SERVICE_UUID_TYPE BLE_UUID_TYPE_VENDOR_BEGIN /**< UUID type for the Nordic UART Service (vendor specific). */
#define APP_ADV_INTERVAL 64 /**< The advertising interval (in units of 0.625 ms. This value corresponds to 40 ms). */
#define APP_ADV_INTERVAL 1600 /**< The advertising interval (in units of 0.625 ms. This value corresponds to 1 sec). */
#define APP_ADV_TIMEOUT_IN_SECONDS 180 /**< The advertising timeout (in units of seconds). */
#define APP_ADV_SLOW_INTERVAL 1600 /**< The advertising interval (in units of 0.625 ms. This value corresponds to 1 sec). */
#define APP_ADV_SLOW_TIMEOUT_IN_SECONDS 0 /* always */
#define APP_TIMER_PRESCALER 0 /**< Value of the RTC1 PRESCALER register. */
#define APP_TIMER_MAX_TIMERS (2) /**< Maximum number of simultaneously created timers. */
@ -310,7 +312,6 @@ static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
on_ble_evt(p_ble_evt);
ble_advertising_on_ble_evt(p_ble_evt);
// bsp_btn_ble_on_ble_evt(p_ble_evt); // GW
}
@ -394,10 +395,14 @@ static void advertising_init(void)
scanrsp.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
scanrsp.uuids_complete.p_uuids = m_adv_uuids;
ble_adv_modes_config_t options = {0};
ble_adv_modes_config_t options;
memset(&options, 0, sizeof(options));
options.ble_adv_fast_enabled = BLE_ADV_FAST_ENABLED;
options.ble_adv_fast_interval = APP_ADV_INTERVAL;
options.ble_adv_fast_timeout = APP_ADV_TIMEOUT_IN_SECONDS;
options.ble_adv_slow_enabled = BLE_ADV_SLOW_ENABLED;
options.ble_adv_slow_interval = APP_ADV_SLOW_INTERVAL;
options.ble_adv_slow_timeout = APP_ADV_SLOW_TIMEOUT_IN_SECONDS;
err_code = ble_advertising_init(&advdata, &scanrsp, &options, on_adv_evt, NULL);
APP_ERROR_CHECK(err_code);