Skip to content

Commit

Permalink
refactor(progmem)
Browse files Browse the repository at this point in the history
  • Loading branch information
tspopp committed Jun 15, 2024
1 parent b43fd4d commit d0c99c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions tools/AquaDebug/include/mqtt/MQTTDefinitions.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#ifndef AQUAMQTT_MQTTDEFINITIONS_H
#define AQUAMQTT_MQTTDEFINITIONS_H

#include "pgmspace.h"

namespace aquamqtt
{
namespace mqtt
{

const char BASE_TOPIC[] PROGMEM = { "aquadbg/" };
const char DEBUG[] PROGMEM = { "debug" };
constexpr char BASE_TOPIC[] = { "aquadbg/" };
constexpr char DEBUG[] = { "debug" };

} // namespace mqtt
} // namespace aquamqtt
Expand Down
2 changes: 1 addition & 1 deletion tools/AquaDebug/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void loop()
mBuffer.pop(retVal);
mTempBuffer[i] = retVal;
}
sprintf(reinterpret_cast<char*>(mTopicBuffer), "%s%S%S", config::mqttPrefix, BASE_TOPIC, DEBUG);
sprintf(reinterpret_cast<char*>(mTopicBuffer), "%s%s%s", config::mqttPrefix, BASE_TOPIC, DEBUG);
toHexStr(mTempBuffer, BUFFER_SIZE, reinterpret_cast<char*>(mPayloadBuffer));
mMQTTClient.publish(reinterpret_cast<char*>(mTopicBuffer), reinterpret_cast<char*>(mPayloadBuffer));
}
Expand Down

0 comments on commit d0c99c4

Please sign in to comment.