From d910e34d0deecc4af18cf98377479cdfb78eac31 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 8 Jul 2019 19:23:09 +0200 Subject: [PATCH] Library: Comments --- lib/util-debug.c | 6 ++++++ lib/util.h | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/util-debug.c b/lib/util-debug.c index e47ff46..ed1076d 100644 --- a/lib/util-debug.c +++ b/lib/util-debug.c @@ -1,3 +1,9 @@ +/* + * Debugging Utilities for STM32 + * + * (c) 2018--2019 Martin Mareš + */ + #include "util.h" #include diff --git a/lib/util.h b/lib/util.h index a84d099..b06b6ad 100644 --- a/lib/util.h +++ b/lib/util.h @@ -1,9 +1,17 @@ +/* + * General Utility Library for STM32 + * + * (c) 2018--2019 Martin Mareš + */ + #include #include #include #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]; -- 2.39.5