From e015dbbcda11f268b27509067e28dae5e0b3084f Mon Sep 17 00:00:00 2001 From: Anne Hitchcock Date: Sun, 29 May 2016 08:39:09 -0700 Subject: [PATCH 1/2] dtostrf for other SAMD boards Changed preprocessor directive to create the dtostrf function whenever it is not defined in order to support more SAMD boards (including MKR1000) without adding more board defines to the ifdef. --- Adafruit_MQTT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_MQTT.cpp b/Adafruit_MQTT.cpp index 910960c..5b05e01 100644 --- a/Adafruit_MQTT.cpp +++ b/Adafruit_MQTT.cpp @@ -21,7 +21,7 @@ // SOFTWARE. #include "Adafruit_MQTT.h" -#ifdef ARDUINO_SAMD_ZERO +#ifndef dtostrf static char *dtostrf (double val, signed char width, unsigned char prec, char *sout) { char fmt[20]; sprintf(fmt, "%%%d.%df", width, prec); From de48c73e747adaf8e4b17a2b1cf599200d283f5b Mon Sep 17 00:00:00 2001 From: Anne Hitchcock Date: Sun, 29 May 2016 09:03:04 -0700 Subject: [PATCH 2/2] Added MKR1000 board to list to define the dtostrf function Adding the MKR1000 board to the list of boards for which the dtostrf function should be defined here (for lack of a better way to determine if the function is available elsewhere). --- Adafruit_MQTT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adafruit_MQTT.cpp b/Adafruit_MQTT.cpp index 5b05e01..ac86c2e 100644 --- a/Adafruit_MQTT.cpp +++ b/Adafruit_MQTT.cpp @@ -21,7 +21,7 @@ // SOFTWARE. #include "Adafruit_MQTT.h" -#ifndef dtostrf +#if defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) static char *dtostrf (double val, signed char width, unsigned char prec, char *sout) { char fmt[20]; sprintf(fmt, "%%%d.%df", width, prec);