import stdlib.h from qmsk-dmx
authorTero Marttila <terom@paivola.fi>
Wed, 24 Sep 2014 22:30:15 +0300
changeset 0 893a25a6c372
child 1 04b8d469ae4c
import stdlib.h from qmsk-dmx
include/stdlib.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/stdlib.h	Wed Sep 24 22:30:15 2014 +0300
@@ -0,0 +1,31 @@
+#ifndef QMSK_ARDUINO_STDLIB_H
+#define QMSK_ARDUINO_STDLIB_H
+
+#define false       0
+#define true        1
+
+typedef uint8_t byte;
+
+typedef volatile uint8_t ioport_t;
+
+static inline ioport_t tbi(ioport_t *port, int bit)
+{
+    return *port & (1 << bit);
+}
+
+static inline void sbi(ioport_t *port, int bit)
+{
+    *port |= (1 << bit);
+}
+
+static inline void cbi(ioport_t *port, int bit)
+{
+    *port &= ~(1 << bit);
+}
+
+static inline void xbi(ioport_t *port, int bit)
+{
+    *port ^= (1 << bit);
+}
+
+#endif