]> mj.ucw.cz Git - home-hw.git/commitdiff
Library: Comments
authorMartin Mares <mj@ucw.cz>
Mon, 8 Jul 2019 17:23:09 +0000 (19:23 +0200)
committerMartin Mares <mj@ucw.cz>
Mon, 8 Jul 2019 17:23:09 +0000 (19:23 +0200)
lib/util-debug.c
lib/util.h

index e47ff46c9bd04c6f119216381e0a903ebcce9a1d..ed1076d922f25b7463436dec7a05f49eaa647f7c 100644 (file)
@@ -1,3 +1,9 @@
+/*
+ *     Debugging Utilities for STM32
+ *
+ *     (c) 2018--2019 Martin Mareš <mj@ucw.cz>
+ */
+
 #include "util.h"
 
 #include <libopencm3/stm32/usart.h>
index a84d09975475d03fe05a7bca1715aeb57b3c25b6..b06b6add070627072e181fbfb9d04bc793a06185 100644 (file)
@@ -1,9 +1,17 @@
+/*
+ *     General Utility Library for STM32
+ *
+ *     (c) 2018--2019 Martin Mareš <mj@ucw.cz>
+ */
+
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdint.h>
 
 #include "config.h"
 
+// Types
+
 typedef unsigned int uint;
 typedef uint8_t byte;
 typedef uint16_t u16;
@@ -11,11 +19,15 @@ typedef int16_t s16;
 typedef uint32_t u32;
 typedef int32_t s32;
 
+// Macros
+
 #define MIN(x,y) ((x) < (y) ? (x) : (y))
 #define MAX(x,y) ((x) > (y) ? (x) : (y))
 
 #define UNUSED __attribute__((unused))
 
+// Unaligned access to data
+
 static inline uint get_u16_le(byte *p)
 {
        return (p[1] << 8) | p[0];