Skip to content

Commit 027f8af

Browse files
committed
Remove __AVR__ compile options to improve code clarity
1 parent 45d5672 commit 027f8af

13 files changed

+2
-304
lines changed

src/ArduinoIoTCloudTCP.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,7 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress,
141141
_brokerAddress = brokerAddress;
142142
_brokerPort = brokerPort;
143143

144-
#if defined(__AVR__)
145-
String const nina_fw_version = WiFi.firmwareVersion();
146-
if (nina_fw_version < "1.4.2")
147-
{
148-
DEBUG_ERROR("ArduinoIoTCloudTCP::%s NINA firmware needs to be >= 1.4.2 to support cloud on Uno WiFi Rev. 2, current %s", __FUNCTION__, nina_fw_version.c_str());
149-
return 0;
150-
}
151-
#endif /* AVR */
152-
153-
#if OTA_ENABLED && !defined(__AVR__)
144+
#if OTA_ENABLED
154145
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_NICLA_VISION)
155146
/* The length of the application can be retrieved the same way it was
156147
* communicated to the bootloader, that is by writing to the non-volatile
@@ -547,18 +538,14 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeThingTopics()
547538
if (!_mqttClient.subscribe(_dataTopicIn))
548539
{
549540
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _dataTopicIn.c_str());
550-
#if !defined(__AVR__)
551541
DEBUG_ERROR("Check your thing configuration, and press the reset button on your board.");
552-
#endif
553542
return State::SubscribeThingTopics;
554543
}
555544

556545
if (!_mqttClient.subscribe(_shadowTopicIn))
557546
{
558547
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _shadowTopicIn.c_str());
559-
#if !defined(__AVR__)
560548
DEBUG_ERROR("Check your thing configuration, and press the reset button on your board.");
561-
#endif
562549
return State::SubscribeThingTopics;
563550
}
564551

src/cbor/CBORDecoder.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424

2525
#include <Arduino.h>
2626

27-
#ifdef __AVR__
28-
# include <Arduino_AVRSTL.h>
29-
#endif
30-
3127
#undef max
3228
#undef min
3329
#include <list>

src/cbor/CBOREncoder.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424

2525
#include <Arduino.h>
2626

27-
#ifdef __AVR__
28-
# include <Arduino_AVRSTL.h>
29-
#endif
30-
3127
#undef max
3228
#undef min
3329
#include <list>

src/cbor/lib/tinycbor/src/cbor.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
#ifndef CBOR_H
2626
#define CBOR_H
2727

28-
#ifdef __AVR__
29-
#define FP_NAN NAN
30-
#define FP_INFINITE INFINITY
31-
#endif
32-
3328
#ifndef assert
3429
#include <assert.h>
3530
#endif

src/cbor/lib/tinycbor/src/cborpretty.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
# define __STDC_LIMIT_MACROS 1
2929
#endif
3030

31-
#ifndef __AVR__
32-
3331
#include "cbor.h"
3432
#include "cborinternal_p.h"
3533
#include "compilersupport_p.h"
@@ -582,6 +580,4 @@ CborError cbor_value_to_pretty_stream(CborStreamFunction streamFunction, void *t
582580

583581
#pragma GCC diagnostic pop
584582

585-
#endif // __AVR__
586-
587583
/** @} */

src/cbor/lib/tinycbor/src/cbortojson.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
# define __STDC_LIMIT_MACROS 1
3131
#endif
3232

33-
#ifndef __AVR__
34-
3533
#include "cbor.h"
3634
#include "cborjson.h"
3735
#include "cborinternal_p.h"
@@ -703,6 +701,4 @@ CborError cbor_value_to_json_advance(FILE *out, CborValue *value, int flags)
703701

704702
#pragma GCC diagnostic pop
705703

706-
#endif // __AVR__
707-
708704
/** @} */

src/cbor/lib/tinycbor/src/open_memstream.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434

3535
#include <unistd.h>
3636

37-
#ifdef __AVR__
38-
typedef size_t ssize_t;
39-
#endif
40-
4137
typedef ssize_t RetType;
4238
typedef size_t LenType;
4339

src/nonstd/nonstd.h

Lines changed: 0 additions & 235 deletions
This file was deleted.

src/property/Property.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,7 @@ CborError Property::appendAttributeReal(String value, String attributeName, Cbor
222222
}, encoder);
223223
}
224224

225-
#ifdef __AVR__
226-
CborError Property::appendAttributeName(String attributeName, nonstd::function<CborError (CborEncoder& mapEncoder)>appendValue, CborEncoder *encoder)
227-
#else
228225
CborError Property::appendAttributeName(String attributeName, std::function<CborError (CborEncoder& mapEncoder)>appendValue, CborEncoder *encoder)
229-
#endif
230226
{
231227
if (attributeName != "") {
232228
// when the attribute name string is not empty, the attribute identifier is incremented in order to be encoded in the message if the _lightPayload flag is set
@@ -315,11 +311,7 @@ void Property::setAttributeReal(String& value, String attributeName) {
315311
});
316312
}
317313

318-
#ifdef __AVR__
319-
void Property::setAttributeReal(String attributeName, nonstd::function<void (CborMapData & md)>setValue)
320-
#else
321314
void Property::setAttributeReal(String attributeName, std::function<void (CborMapData & md)>setValue)
322-
#endif
323315
{
324316
if (attributeName != "") {
325317
_attributeIdentifier++;

0 commit comments

Comments
 (0)