mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-10-23 04:47:56 +00:00
Merge pull request #653 from andrzej-kaczmarek/various-fixes
Add new semaphore API + some nimble/os fixes X-Original-Commit: 3a0857ecc2fe3d12ad7e5eb48596e1b3e61cd083
This commit is contained in:
@@ -44,10 +44,10 @@ static const struct ble_gatt_svc_def ble_svc_ias_defs[] = {
|
||||
{
|
||||
/*** Service: Immediate Alert Service (IAS). */
|
||||
.type = BLE_GATT_SVC_TYPE_PRIMARY,
|
||||
.uuid = BLE_UUID16(BLE_SVC_IAS_UUID16),
|
||||
.uuid = BLE_UUID16_DECLARE(BLE_SVC_IAS_UUID16),
|
||||
.characteristics = (struct ble_gatt_chr_def[]) { {
|
||||
/*** Characteristic: Alert Level. */
|
||||
.uuid = BLE_UUID16(BLE_SVC_IAS_CHR_UUID16_ALERT_LEVEL),
|
||||
.uuid = BLE_UUID16_DECLARE(BLE_SVC_IAS_CHR_UUID16_ALERT_LEVEL),
|
||||
.access_cb = ble_svc_ias_access,
|
||||
.flags = BLE_GATT_CHR_F_WRITE_NO_RSP,
|
||||
}, {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <errno.h>
|
||||
#include "bsp/bsp.h"
|
||||
#include "ble_hs_priv.h"
|
||||
|
||||
static uint16_t ble_att_preferred_mtu_val;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include "bsp/bsp.h"
|
||||
#include "os/os.h"
|
||||
#include "nimble/ble.h"
|
||||
#include "host/ble_uuid.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <string.h>
|
||||
#include "sysinit/sysinit.h"
|
||||
#include "syscfg/syscfg.h"
|
||||
#include "bsp/bsp.h"
|
||||
#include "stats/stats.h"
|
||||
#include "os/os.h"
|
||||
#include "console/console.h"
|
||||
@@ -125,20 +124,20 @@ ble_hs_evq_set(struct os_eventq *evq)
|
||||
ble_hs_evq = evq;
|
||||
}
|
||||
|
||||
#if MYNEWT_VAL(BLE_HS_DEBUG)
|
||||
int
|
||||
ble_hs_locked_by_cur_task(void)
|
||||
{
|
||||
struct os_task *owner;
|
||||
|
||||
#if MYNEWT_VAL(BLE_HS_DEBUG)
|
||||
if (!os_started()) {
|
||||
return ble_hs_dbg_mutex_locked;
|
||||
}
|
||||
#endif
|
||||
|
||||
owner = ble_hs_mutex.mu_owner;
|
||||
return owner != NULL && owner == os_sched_get_current_task();
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Indicates whether the host's parent task is currently running.
|
||||
|
||||
@@ -338,7 +338,7 @@ ble_hs_hci_cmd_tx_empty_ack(uint16_t opcode, void *cmd, uint8_t cmd_len)
|
||||
void
|
||||
ble_hs_hci_rx_ack(uint8_t *ack_ev)
|
||||
{
|
||||
if (ble_hs_hci_sem.sem_tokens != 0) {
|
||||
if (os_sem_get_count(&ble_hs_hci_sem) > 0) {
|
||||
/* This ack is unexpected; ignore it. */
|
||||
ble_hci_trans_buf_free(ack_ev);
|
||||
return;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#error "Cannot enable monitor over UART and RTT at the same time!"
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include "os/os.h"
|
||||
|
||||
Reference in New Issue
Block a user