summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2020-10-16 00:15:16 +1100
committerDamien George <damien@micropython.org>2020-11-24 01:07:17 +1100
commit0e8af2b3708ab3e499491836d481b10e030408f8 (patch)
treeea916e958ac0099f197ce080d65c8e2f453266e9 /py
parent64180f0742a1926162b784c68bafa49b9b58596c (diff)
extmod/modbluetooth: Add API for L2CAP channels.
Also known as L2CAP "connection oriented channels". This provides a socket-like data transfer mechanism for BLE. Currently only implemented for NimBLE on STM32 / Unix. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'py')
-rw-r--r--py/misc.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/py/misc.h b/py/misc.h
index aac907244..fe2b3b8af 100644
--- a/py/misc.h
+++ b/py/misc.h
@@ -53,6 +53,9 @@ typedef unsigned int uint;
// Static assertion macro
#define MP_STATIC_ASSERT(cond) ((void)sizeof(char[1 - 2 * !(cond)]))
+// Round-up integer division
+#define MP_CEIL_DIVIDE(a, b) (((a) + (b) - 1) / (b))
+
/** memory allocation ******************************************/
// TODO make a lazy m_renew that can increase by a smaller amount than requested (but by at least 1 more element)