diff libutil/bitfunc.c @ 0:35c0d9f03c0a

beginning with sipout-test-voice, a copy of sip-manual-out from themwi-system-sw
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 03 Mar 2024 23:20:19 -0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/libutil/bitfunc.c	Sun Mar 03 23:20:19 2024 -0800
@@ -0,0 +1,14 @@
+/*
+ * Some bit manipulation functions.
+ */
+
+#include <stdint.h>
+#include "osmo_bits.h"
+
+void uint16_to_bits(uint16_t word, ubit_t *out, unsigned nbits)
+{
+	unsigned n;
+
+	for (n = 0; n < nbits; n++)
+		out[n] = (word >> (nbits-n-1)) & 1;
+}