[advertising] fast mode will blink Blue LED 2x slow mode

This commit is contained in:
hathach committed 2017-07-21 23:22:03 +07:00
1 parent cd2da96afb
commit 161e4d4de8
3 files changed
+9 -2

No files matched your search

@@ -258,6 +258,8 @@ bool BLEAdvertising::start(uint16_t timeout)
VERIFY_STATUS( sd_ble_gap_adv_data_set(_data, _count, Bluefruit.ScanResponse.getData(), Bluefruit.ScanResponse.count()), false );
// Initially advertising in fast mode
// Fast mode blink 2x than slow mode
Bluefruit.setConnLedInterval(CFG_ADV_BLINKY_INTERVAL/2);
VERIFY( _start(_fast_interval, _fast_timeout) );
return true;
@@ -308,6 +310,9 @@ void BLEAdvertising::_eventHandler(ble_evt_t* evt)
{
_runnning = false;
// If still advertising, it is only in slow mode --> blink normal
Bluefruit.setConnLedInterval(CFG_ADV_BLINKY_INTERVAL);
if ( _stop_timeout == 0 )
{
// if stop_timeout is 0 --> no timeout
+2 -2
View File
@@ -42,7 +42,7 @@
#define CFG_BLE_TX_POWER_LEVEL 0
#define CFG_DEFAULT_NAME "Bluefruit52"
#define CFG_ADV_BLINKY_INTERVAL 500
#define CFG_BLE_TASK_STACKSIZE (512*3)
#define CFG_SOC_TASK_STACKSIZE (200)
@@ -220,7 +220,7 @@ err_t AdafruitBluefruit::begin(bool prph_enable, bool central_enable)
NVIC_EnableIRQ(SD_EVT_IRQn);
// Create Timer for led advertising blinky
_led_blink_th = xTimerCreate(NULL, ms2tick(CFG_ADV_BLINKY_INTERVAL), true, NULL, bluefruit_blinky_cb);
_led_blink_th = xTimerCreate(NULL, ms2tick(CFG_ADV_BLINKY_INTERVAL/2), true, NULL, bluefruit_blinky_cb);
// Initialize nffs for bonding (it is safe to call nffs_pkg_init() multiple time)
Nffs.begin();
+2
View File
@@ -39,6 +39,8 @@
#include <Arduino.h>
#include "bluefruit_common.h"
#define CFG_ADV_BLINKY_INTERVAL 500
// Note chaning these parameters will affect APP_RAM_BASE
// --> need to update RAM in feather52_s132.ld linker
#define BLE_GATTS_ATTR_TABLE_SIZE 0x0B00