From 2c025824d7a19c96c3e624665437173d65c5a056 Mon Sep 17 00:00:00 2001 From: lly Date: Mon, 2 Sep 2019 11:20:15 +0800 Subject: [PATCH] ble_mesh: sync zephyr v1.14.0 bt_hex() --- components/bt/esp_ble_mesh/mesh_core/mesh_util.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/components/bt/esp_ble_mesh/mesh_core/mesh_util.c b/components/bt/esp_ble_mesh/mesh_core/mesh_util.c index 4650bb260..232662baa 100644 --- a/components/bt/esp_ble_mesh/mesh_core/mesh_util.c +++ b/components/bt/esp_ble_mesh/mesh_core/mesh_util.c @@ -17,19 +17,11 @@ const char *bt_hex(const void *buf, size_t len) { static const char hex[] = "0123456789abcdef"; - static char hexbufs[4][129]; - static u8_t curbuf; + static char str[129]; const u8_t *b = buf; - unsigned int mask; - char *str; int i; - mask = bt_mesh_irq_lock(); - str = hexbufs[curbuf++]; - curbuf %= ARRAY_SIZE(hexbufs); - bt_mesh_irq_unlock(mask); - - len = MIN(len, (sizeof(hexbufs[0]) - 1) / 2); + len = MIN(len, (sizeof(str) - 1) / 2); for (i = 0; i < len; i++) { str[i * 2] = hex[b[i] >> 4];