Skip to content

Commit 958f73e

Browse files
committed
Eliminating 'F(expr)' macro since it's of no use due to the Neumann architecture in samd, mbed and megaavr (all currently supported arduino boards.
1 parent 956cd77 commit 958f73e

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/ArduinoIoTCloudLPWAN.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ void ArduinoIoTCloudLPWAN::update()
8787

8888
void ArduinoIoTCloudLPWAN::printDebugInfo()
8989
{
90-
DEBUG_INFO(F("***** Arduino IoT Cloud LPWAN - configuration info *****"));
91-
DEBUG_INFO(F("Thing ID: %s"), getThingId().c_str());
90+
DEBUG_INFO("***** Arduino IoT Cloud LPWAN - configuration info *****");
91+
DEBUG_INFO("Thing ID: %s", getThingId().c_str());
9292
}
9393

9494
/******************************************************************************
@@ -106,16 +106,16 @@ ArduinoIoTCloudLPWAN::State ArduinoIoTCloudLPWAN::handle_ConnectPhy()
106106
ArduinoIoTCloudLPWAN::State ArduinoIoTCloudLPWAN::handle_SyncTime()
107107
{
108108
unsigned long const internal_posix_time = _time_service.getTime();
109-
DEBUG_VERBOSE(F("ArduinoIoTCloudLPWAN::%s internal clock configured to posix timestamp %d"), __FUNCTION__, internal_posix_time);
110-
DEBUG_INFO(F("Connected to Arduino IoT Cloud"));
109+
DEBUG_VERBOSE("ArduinoIoTCloudLPWAN::%s internal clock configured to posix timestamp %d", __FUNCTION__, internal_posix_time);
110+
DEBUG_INFO("Connected to Arduino IoT Cloud");
111111
return State::Connected;
112112
}
113113

114114
ArduinoIoTCloudLPWAN::State ArduinoIoTCloudLPWAN::handle_Connected()
115115
{
116116
if (!connected())
117117
{
118-
DEBUG_ERROR(F("ArduinoIoTCloudLPWAN::%s connection to gateway lost"), __FUNCTION__);
118+
DEBUG_ERROR("ArduinoIoTCloudLPWAN::%s connection to gateway lost", __FUNCTION__);
119119
return State::ConnectPhy;
120120
}
121121

@@ -175,4 +175,4 @@ int ArduinoIoTCloudLPWAN::writeProperties(const byte data[], int length)
175175

176176
ArduinoIoTCloudLPWAN ArduinoCloud;
177177

178-
#endif
178+
#endif

src/ArduinoIoTCloudTCP.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,17 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
134134
#ifdef BOARD_HAS_ECCX08
135135
if (!ECCX08.begin())
136136
{
137-
DEBUG_ERROR(F("Cryptography processor failure. Make sure you have a compatible board."));
137+
DEBUG_ERROR("Cryptography processor failure. Make sure you have a compatible board.");
138138
return 0;
139139
}
140140
if (!CryptoUtil::readDeviceId(ECCX08, getDeviceId(), ECCX08Slot::DeviceId))
141141
{
142-
DEBUG_ERROR(F("Cryptography processor read failure."));
142+
DEBUG_ERROR("Cryptography processor read failure.");
143143
return 0;
144144
}
145145
if (!CryptoUtil::reconstructCertificate(_eccx08_cert, getDeviceId(), ECCX08Slot::Key, ECCX08Slot::CompressedCertificate, ECCX08Slot::SerialNumberAndAuthorityKeyIdentifier))
146146
{
147-
DEBUG_ERROR(F("Cryptography certificate reconstruction failure."));
147+
DEBUG_ERROR("Cryptography certificate reconstruction failure.");
148148
return 0;
149149
}
150150
_sslClient.setClient(_connection->getClient());
@@ -181,7 +181,7 @@ int ArduinoIoTCloudTCP::begin(String brokerAddress, uint16_t brokerPort)
181181
String const nina_fw_version = WiFi.firmwareVersion();
182182
if (nina_fw_version < "1.4.1") {
183183
_ota_cap = false;
184-
DEBUG_WARNING(F("ArduinoIoTCloudTCP::%s In order to be ready for cloud OTA, NINA firmware needs to be >= 1.4.1, current %s"), __FUNCTION__, nina_fw_version.c_str());
184+
DEBUG_WARNING("ArduinoIoTCloudTCP::%s In order to be ready for cloud OTA, NINA firmware needs to be >= 1.4.1, current %s", __FUNCTION__, nina_fw_version.c_str());
185185
}
186186
else {
187187
_ota_cap = true;
@@ -218,10 +218,10 @@ int ArduinoIoTCloudTCP::connected()
218218

219219
void ArduinoIoTCloudTCP::printDebugInfo()
220220
{
221-
DEBUG_INFO(F("***** Arduino IoT Cloud - configuration info *****"));
222-
DEBUG_INFO(F("Device ID: %s"), getDeviceId().c_str());
223-
DEBUG_INFO(F("Thing ID: %s"), getThingId().c_str());
224-
DEBUG_INFO(F("MQTT Broker: %s:%d"), _brokerAddress.c_str(), _brokerPort);
221+
DEBUG_INFO("***** Arduino IoT Cloud - configuration info *****");
222+
DEBUG_INFO("Device ID: %s", getDeviceId().c_str());
223+
DEBUG_INFO("Thing ID: %s", getThingId().c_str());
224+
DEBUG_INFO("MQTT Broker: %s:%d", _brokerAddress.c_str(), _brokerPort);
225225
}
226226

227227
/******************************************************************************
@@ -239,7 +239,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectPhy()
239239
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime()
240240
{
241241
unsigned long const internal_posix_time = _time_service.getTime();
242-
DEBUG_VERBOSE(F("ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d"), __FUNCTION__, internal_posix_time);
242+
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s internal clock configured to posix timestamp %d", __FUNCTION__, internal_posix_time);
243243
return State::ConnectMqttBroker;
244244
}
245245

@@ -248,30 +248,30 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_ConnectMqttBroker()
248248
if (_mqttClient.connect(_brokerAddress.c_str(), _brokerPort))
249249
return State::SubscribeMqttTopics;
250250

251-
DEBUG_ERROR(F("ArduinoIoTCloudTCP::%s could not connect to %s:%d"), __FUNCTION__, _brokerAddress.c_str(), _brokerPort);
251+
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not connect to %s:%d", __FUNCTION__, _brokerAddress.c_str(), _brokerPort);
252252
return State::ConnectPhy;
253253
}
254254

255255
ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SubscribeMqttTopics()
256256
{
257257
if (!_mqttClient.subscribe(_dataTopicIn))
258258
{
259-
DEBUG_ERROR(F("ArduinoIoTCloudTCP::%s could not subscribe to %s"), __FUNCTION__, _dataTopicIn.c_str());
260-
DEBUG_ERROR(F("Check your thing configuration, and press the reset button on your board."));
259+
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _dataTopicIn.c_str());
260+
DEBUG_ERROR("Check your thing configuration, and press the reset button on your board.");
261261
return State::SubscribeMqttTopics;
262262
}
263263

264264
if (_shadowTopicIn != "")
265265
{
266266
if (!_mqttClient.subscribe(_shadowTopicIn))
267267
{
268-
DEBUG_ERROR(F("ArduinoIoTCloudTCP::%s could not subscribe to %s"), __FUNCTION__, _shadowTopicIn.c_str());
269-
DEBUG_ERROR(F("Check your thing configuration, and press the reset button on your board."));
268+
DEBUG_ERROR("ArduinoIoTCloudTCP::%s could not subscribe to %s", __FUNCTION__, _shadowTopicIn.c_str());
269+
DEBUG_ERROR("Check your thing configuration, and press the reset button on your board.");
270270
return State::SubscribeMqttTopics;
271271
}
272272
}
273273

274-
DEBUG_INFO(F("Connected to Arduino IoT Cloud"));
274+
DEBUG_INFO("Connected to Arduino IoT Cloud");
275275
execCloudEventCallback(ArduinoIoTCloudEvent::CONNECT);
276276

277277
if (_shadowTopicIn != "")
@@ -286,7 +286,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_RequestLastValues()
286286
unsigned long const now = millis();
287287
if ((now - _lastSyncRequestTickTime) > TIMEOUT_FOR_LASTVALUES_SYNC)
288288
{
289-
DEBUG_VERBOSE(F("ArduinoIoTCloudTCP::%s [%d] last values requested"), __FUNCTION__, now);
289+
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] last values requested", __FUNCTION__, now);
290290
requestLastValue();
291291
_lastSyncRequestTickTime = now;
292292
}
@@ -298,7 +298,7 @@ ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_Connected()
298298
{
299299
if (!_mqttClient.connected())
300300
{
301-
DEBUG_ERROR(F("ArduinoIoTCloudTCP::%s MQTT client connection lost"), __FUNCTION__);
301+
DEBUG_ERROR("ArduinoIoTCloudTCP::%s MQTT client connection lost", __FUNCTION__);
302302

303303
/* Forcefully disconnect MQTT client and trigger a reconnection. */
304304
_mqttClient.stop();
@@ -378,7 +378,7 @@ void ArduinoIoTCloudTCP::handleMessage(int length)
378378

379379
if ((_shadowTopicIn == topic) && (_state == State::RequestLastValues))
380380
{
381-
DEBUG_VERBOSE(F("ArduinoIoTCloudTCP::%s [%d] last values received"), __FUNCTION__, millis());
381+
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s [%d] last values received", __FUNCTION__, millis());
382382
CBORDecoder::decode(_property_container, (uint8_t*)bytes, length, true);
383383
sendPropertiesToCloud();
384384
execCloudEventCallback(ArduinoIoTCloudEvent::SYNC);
@@ -428,7 +428,7 @@ int ArduinoIoTCloudTCP::write(String const topic, byte const data[], int const l
428428
#if OTA_ENABLED
429429
void ArduinoIoTCloudTCP::onOTARequest()
430430
{
431-
DEBUG_VERBOSE(F("ArduinoIoTCloudTCP::%s _ota_url = %s"), __FUNCTION__, _ota_url.c_str());
431+
DEBUG_VERBOSE("ArduinoIoTCloudTCP::%s _ota_url = %s"), __FUNCTION__, _ota_url.c_str());
432432

433433
/* Status flag to prevent the reset from being executed
434434
* when HTTPS download is not supported.
@@ -444,7 +444,7 @@ void ArduinoIoTCloudTCP::onOTARequest()
444444
uint8_t nina_ota_err_code = 0;
445445
if (!WiFiStorage.downloadOTA(_ota_url.c_str(), &nina_ota_err_code))
446446
{
447-
DEBUG_ERROR(F("ArduinoIoTCloudTCP::%s error download to nina: %d"), __FUNCTION__, nina_ota_err_code);
447+
DEBUG_ERROR("ArduinoIoTCloudTCP::%s error download to nina: %d"), __FUNCTION__, nina_ota_err_code);
448448
_ota_error = static_cast<int>(OTAError::DownloadFailed);
449449
return;
450450
}

0 commit comments

Comments
 (0)