[riot-notifications] [RIOT-OS/RIOT] sys: add units.h for helper macros (#13530)

Kaspar Schleiser notifications at github.com
Tue May 12 11:07:00 CEST 2020


@kaspar030 commented on this pull request.



> + * @brief       Unit helper macros
+ *
+ * @author      Benjamin Valentin <benjamin.valentin at ml-pa.com>
+ */
+
+#ifndef UNITS_H
+#define UNITS_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* KiB, MiB, GiB */
+#define KiB(x) ((unsigned long)(x) << 10)
+#define MiB(x) (KiB(x) << 10)
+#define GiB(x) (MiB(x) << 10)

Would 4194 be enough for MiB?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13530#discussion_r423580288
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200512/af208197/attachment-0001.htm>


More information about the notifications mailing list