Merge branch 'master' into develop
This commit is contained in:
commit
d478e200e1
7 files changed
+57
-10
No files matched your search
@@ -8,6 +8,13 @@
|
||||
- Added nrfx to core
|
||||
- Added tinyusb stack to libraries
|
||||
|
||||
## 0.8.6
|
||||
|
||||
- Fixed dbgDumpMemory for buffer > 255 byte, thanks to @airbornemint
|
||||
- Added setConnSupervisionTimeout and setConnSupervisionTimeoutMS, thanks to @airbornemint
|
||||
- Decrease gpio's interrupt level to 2 to avoid conlfict with SD timing critical task, thanks to @Nenik
|
||||
- Fixed #174 window build error with Arduino 1.8.6 with verbose = off
|
||||
|
||||
## 0.8.5
|
||||
|
||||
- Migrate nrfutil to adafruit-nrfutil, executable binaries for windows and macOS are included.
|
||||
|
||||
@@ -42,7 +42,7 @@ static void __initialize()
|
||||
|
||||
NVIC_DisableIRQ(GPIOTE_IRQn);
|
||||
NVIC_ClearPendingIRQ(GPIOTE_IRQn);
|
||||
NVIC_SetPriority(GPIOTE_IRQn, 1);
|
||||
NVIC_SetPriority(GPIOTE_IRQn, 2);
|
||||
NVIC_EnableIRQ(GPIOTE_IRQn);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ AdafruitBluefruit::AdafruitBluefruit(void)
|
||||
|
||||
_sd_cfg.attr_table_size = 0x800;
|
||||
_sd_cfg.uuid128_max = BLE_UUID_VS_COUNT_DEFAULT;
|
||||
|
||||
_sd_cfg.service_changed = 1;
|
||||
|
||||
_prph_count = 0;
|
||||
_central_count = 0;
|
||||
@@ -116,6 +116,7 @@ AdafruitBluefruit::AdafruitBluefruit(void)
|
||||
|
||||
_ppcp_min_conn = BLE_GAP_CONN_MIN_INTERVAL_DFLT;
|
||||
_ppcp_max_conn = BLE_GAP_CONN_MAX_INTERVAL_DFLT;
|
||||
_ppcp_conn_sup_timeout = BLE_GAP_CONN_SUPERVISION_TIMEOUT_MS / 10; // in 10ms unit
|
||||
_conn_interval = 0;
|
||||
|
||||
_connect_cb = NULL;
|
||||
@@ -127,6 +128,11 @@ COMMENT_OUT(
|
||||
)
|
||||
}
|
||||
|
||||
void AdafruitBluefruit::configServiceChanged(bool changed)
|
||||
{
|
||||
_sd_cfg.service_changed = (changed ? 1 : 0);
|
||||
}
|
||||
|
||||
void AdafruitBluefruit::configUuid128Count(uint8_t uuid128_max)
|
||||
{
|
||||
_sd_cfg.uuid128_max = uuid128_max;
|
||||
@@ -291,7 +297,7 @@ err_t AdafruitBluefruit::begin(uint8_t prph_count, uint8_t central_count)
|
||||
// VERIFY_STATUS( sd_ble_cfg_set(BLE_GAP_CFG_DEVICE_NAME, &blecfg, ram_start) );
|
||||
|
||||
varclr(&blecfg);
|
||||
blecfg.gatts_cfg.service_changed.service_changed = 1; // must be enabled to be consistent with DFU in OTA mode
|
||||
blecfg.gatts_cfg.service_changed.service_changed = _sd_cfg.service_changed;
|
||||
VERIFY_STATUS ( sd_ble_cfg_set(BLE_GATTS_CFG_SERVICE_CHANGED, &blecfg, ram_start) );
|
||||
|
||||
// ATTR Table Size
|
||||
@@ -385,7 +391,7 @@ err_t AdafruitBluefruit::begin(uint8_t prph_count, uint8_t central_count)
|
||||
.min_conn_interval = _ppcp_min_conn, // in 1.25ms unit
|
||||
.max_conn_interval = _ppcp_max_conn, // in 1.25ms unit
|
||||
.slave_latency = BLE_GAP_CONN_SLAVE_LATENCY,
|
||||
.conn_sup_timeout = BLE_GAP_CONN_SUPERVISION_TIMEOUT_MS / 10 // in 10ms unit
|
||||
.conn_sup_timeout = _ppcp_conn_sup_timeout, // in 10ms unit
|
||||
};
|
||||
|
||||
VERIFY_STATUS( sd_ble_gap_ppcp_set(&gap_conn_params) );
|
||||
@@ -536,7 +542,7 @@ bool AdafruitBluefruit::setConnInterval(uint16_t min, uint16_t max)
|
||||
.min_conn_interval = _ppcp_min_conn, // in 1.25ms unit
|
||||
.max_conn_interval = _ppcp_max_conn, // in 1.25ms unit
|
||||
.slave_latency = BLE_GAP_CONN_SLAVE_LATENCY,
|
||||
.conn_sup_timeout = BLE_GAP_CONN_SUPERVISION_TIMEOUT_MS / 10 // in 10ms unit
|
||||
.conn_sup_timeout = _ppcp_conn_sup_timeout // in 10ms unit
|
||||
};
|
||||
|
||||
VERIFY_STATUS( sd_ble_gap_ppcp_set(&gap_conn_params), false);
|
||||
@@ -549,6 +555,27 @@ bool AdafruitBluefruit::setConnIntervalMS(uint16_t min_ms, uint16_t max_ms)
|
||||
return setConnInterval( MS100TO125(min_ms), MS100TO125(max_ms) );
|
||||
}
|
||||
|
||||
bool AdafruitBluefruit::setConnSupervisionTimeout(uint16_t timeout)
|
||||
{
|
||||
_ppcp_conn_sup_timeout = timeout;
|
||||
|
||||
ble_gap_conn_params_t gap_conn_params =
|
||||
{
|
||||
.min_conn_interval = _ppcp_min_conn, // in 1.25ms unit
|
||||
.max_conn_interval = _ppcp_max_conn, // in 1.25ms unit
|
||||
.slave_latency = BLE_GAP_CONN_SLAVE_LATENCY,
|
||||
.conn_sup_timeout = _ppcp_conn_sup_timeout // in 10ms unit
|
||||
};
|
||||
|
||||
VERIFY_STATUS( sd_ble_gap_ppcp_set(&gap_conn_params), false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AdafruitBluefruit::setConnSupervisionTimeoutMS(uint16_t timeout_ms)
|
||||
{
|
||||
return setConnSupervisionTimeout(timeout_ms / 10); // 10ms unit
|
||||
}
|
||||
|
||||
void AdafruitBluefruit::setConnectCallback( BLEGap::connect_callback_t fp )
|
||||
{
|
||||
@@ -629,6 +656,10 @@ void AdafruitBluefruit::printInfo(void)
|
||||
Serial.printf(title_fmt, "ATTR Table Size");
|
||||
Serial.println(_sd_cfg.attr_table_size);
|
||||
|
||||
// Service Changed
|
||||
Serial.printf(title_fmt, "Service Changed");
|
||||
Serial.println(_sd_cfg.service_changed);
|
||||
|
||||
if ( _prph_count )
|
||||
{
|
||||
Serial.println("Peripheral Connect Setting");
|
||||
@@ -713,6 +744,10 @@ void AdafruitBluefruit::printInfo(void)
|
||||
Serial.printf("max = %.2f ms", _ppcp_max_conn*1.25f);
|
||||
Serial.println();
|
||||
|
||||
Serial.printf(title_fmt, "Conn Timeout");
|
||||
Serial.printf("%.2f ms", _ppcp_conn_sup_timeout*10.0f);
|
||||
Serial.println();
|
||||
|
||||
/*------------- List the paried device -------------*/
|
||||
if ( _prph_count )
|
||||
{
|
||||
@@ -800,7 +835,7 @@ void adafruit_ble_task(void* arg)
|
||||
{
|
||||
(void) arg;
|
||||
|
||||
uint8_t * ev_buf = (uint8_t*) rtos_malloc(BLE_EVT_LEN_MAX(BLEGATT_ATT_MTU_MAX));
|
||||
uint8_t * ev_buf = (uint8_t*) rtos_malloc(BLE_EVT_LEN_MAX(BLE_GATT_ATT_MTU_MAX));
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -811,7 +846,7 @@ void adafruit_ble_task(void* arg)
|
||||
// Until no pending events
|
||||
while( NRF_ERROR_NOT_FOUND != err )
|
||||
{
|
||||
uint16_t ev_len = BLE_EVT_LEN_MAX(BLEGATT_ATT_MTU_MAX);
|
||||
uint16_t ev_len = BLE_EVT_LEN_MAX(BLE_GATT_ATT_MTU_MAX);
|
||||
|
||||
// Get BLE Event
|
||||
err = sd_ble_evt_get(ev_buf, &ev_len);
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
|
||||
/* Note changing these parameters will affect APP_RAM_BASE
|
||||
* --> need to update RAM region in linker file
|
||||
* - BLEGATT_ATT_MTU_MAX from 23 (default) to 247
|
||||
* - BLE_GATT_ATT_MTU_MAX from 23 (default) to 247
|
||||
*/
|
||||
#define BLEGATT_ATT_MTU_MAX 247
|
||||
#define BLE_GATT_ATT_MTU_MAX 247
|
||||
#define BLE_PRPH_MAX_CONN 1
|
||||
#define BLE_CENTRAL_MAX_CONN 4
|
||||
#define BLE_CENTRAL_MAX_SECURE_CONN 1 // should be enough
|
||||
@@ -120,6 +120,7 @@ class AdafruitBluefruit
|
||||
/* SoftDevice Configure Functions, must call before begin().
|
||||
* These function affect the SRAM consumed by SoftDevice.
|
||||
*------------------------------------------------------------------*/
|
||||
void configServiceChanged (bool changed);
|
||||
void configUuid128Count (uint8_t uuid128_max);
|
||||
void configAttrTableSize (uint32_t attr_table_size);
|
||||
|
||||
@@ -156,6 +157,8 @@ class AdafruitBluefruit
|
||||
|
||||
bool setConnInterval (uint16_t min, uint16_t max);
|
||||
bool setConnIntervalMS (uint16_t min_ms, uint16_t max_ms);
|
||||
bool setConnSupervisionTimeout(uint16_t timeout);
|
||||
bool setConnSupervisionTimeoutMS(uint16_t timeout_ms);
|
||||
|
||||
uint16_t connHandle (void);
|
||||
bool connPaired (void);
|
||||
@@ -190,6 +193,7 @@ class AdafruitBluefruit
|
||||
/*------------- SoftDevice Configuration -------------*/
|
||||
struct {
|
||||
uint32_t attr_table_size;
|
||||
uint8_t service_changed;
|
||||
uint8_t uuid128_max;
|
||||
}_sd_cfg;
|
||||
|
||||
@@ -199,6 +203,7 @@ class AdafruitBluefruit
|
||||
// Peripheral Preferred Connection Parameters (PPCP)
|
||||
uint16_t _ppcp_min_conn;
|
||||
uint16_t _ppcp_max_conn;
|
||||
uint16_t _ppcp_conn_sup_timeout;
|
||||
|
||||
// Actual connection interval in use
|
||||
uint16_t _conn_interval;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
name=Adafruit nRF52 Boards
|
||||
version=0.9.0
|
||||
version=0.8.5
|
||||
|
||||
# Compile variables
|
||||
# -----------------
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user