From 0b65a33979a6369301c5394c2c7779fecaf79849 Mon Sep 17 00:00:00 2001
From: Koen Zandberg <koen@bergzand.net>
Date: Mon, 17 Sep 2018 10:07:36 +0200
Subject: [PATCH] tinycbor: Version bump to 0.5.2

This release fixed some bugs related to disabling float support in the
parser.
The float support is now optional and can be enabled by including the
tinycbor_float module. This allows for compiling on AVR as that platform
doesn't support the float specific defines used by tinycbor.
---
 pkg/tinycbor/Makefile         | 3 ++-
 pkg/tinycbor/Makefile.include | 7 +++++++
 tests/pkg_tinycbor/Makefile   | 2 ++
 tests/pkg_tinycbor/main.c     | 2 ++
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/pkg/tinycbor/Makefile b/pkg/tinycbor/Makefile
index 03c0cd4cfe..c8b0e04207 100644
--- a/pkg/tinycbor/Makefile
+++ b/pkg/tinycbor/Makefile
@@ -1,6 +1,7 @@
 PKG_NAME=tinycbor
 PKG_URL=https://github.com/intel/tinycbor
-PKG_VERSION=v0.5.1
+# Tinycbor v0.5.2
+PKG_VERSION=d94ca09aa91f5b3c581527aa8bca179a82b79874
 PKG_LICENSE=MIT
 
 .PHONY: all
diff --git a/pkg/tinycbor/Makefile.include b/pkg/tinycbor/Makefile.include
index ce4074d8c1..88b8300ad9 100644
--- a/pkg/tinycbor/Makefile.include
+++ b/pkg/tinycbor/Makefile.include
@@ -1 +1,8 @@
 INCLUDES += -I$(PKGDIRBASE)/tinycbor/src
+
+ifeq (,$(filter tinycbor_float,$(USEMODULE)))
+  CFLAGS += -DCBOR_NO_FLOATING_POINT
+endif
+
+# Declare pseudomodules here to be selfcontained
+PSEUDOMODULES += tinycbor_%
diff --git a/tests/pkg_tinycbor/Makefile b/tests/pkg_tinycbor/Makefile
index 7e0102edd1..300fff2f0d 100644
--- a/tests/pkg_tinycbor/Makefile
+++ b/tests/pkg_tinycbor/Makefile
@@ -9,6 +9,8 @@ USEMODULE += embunit
 USEMODULE += fmt
 USEPKG += tinycbor
 
+USEMODULE += tinycbor_float
+
 TEST_ON_CI_WHITELIST += all
 include $(RIOTBASE)/Makefile.include
 
diff --git a/tests/pkg_tinycbor/main.c b/tests/pkg_tinycbor/main.c
index 59d3b95c53..425d9ffc61 100644
--- a/tests/pkg_tinycbor/main.c
+++ b/tests/pkg_tinycbor/main.c
@@ -52,6 +52,7 @@ const char *tests[] = {
     "f7",                  /* undefined               */
     "f8ff",                /* simple(255)             */
 
+#ifdef MODULE_TINYCBOR_FLOAT
     "f93c00",              /* 1.0                     */
     "f9bc00",              /* -1.0                    */
     "f903ff",              /* 6.097555160522461e-05   */
@@ -61,6 +62,7 @@ const char *tests[] = {
     "fa47800000",          /* 65536.0                 */
     "fb3ff199999999999a",  /* 1.1                     */
     "f97e00",              /* NaN                     */
+#endif
 
     "8300810000",          /* [ 0, [ 0], 0]           */
     "a26161016162820203",  /* { "a": 1, "b": [ 2, 3]} */
-- 
GitLab