summaryrefslogtreecommitdiff
path: root/include/lib/mpack/mpack.h
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-11-30 09:25:45 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-11-30 09:25:45 +0100
commitd5636b932e111056e852316cdbe6a711a9643183 (patch)
treed5df86d48565be70e78541710ca206a822b6d6dd /include/lib/mpack/mpack.h
parentbed25c675e3558254d335e0a3069849d4dfc4942 (diff)
Patch mpack to work on AVR
Diffstat (limited to 'include/lib/mpack/mpack.h')
-rw-r--r--include/lib/mpack/mpack.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/lib/mpack/mpack.h b/include/lib/mpack/mpack.h
index 96014d4..cfadf78 100644
--- a/include/lib/mpack/mpack.h
+++ b/include/lib/mpack/mpack.h
@@ -2133,12 +2133,21 @@ MPACK_INLINE float mpack_load_float(const char* p) {
MPACK_INLINE double mpack_load_double(const char* p) {
MPACK_CHECK_FLOAT_ORDER();
+#ifdef MULTIPASS_ARCH_arduino_nano
+ MPACK_STATIC_ASSERT(sizeof(double) == sizeof(uint32_t), "double is wrong size??");
+ union {
+ double d;
+ uint32_t u;
+ } v;
+ v.u = mpack_load_u32(p);
+#else
MPACK_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t), "double is wrong size??");
union {
double d;
uint64_t u;
} v;
v.u = mpack_load_u64(p);
+#endif
return v.d;
}