Applied code formatters.

This commit is contained in:
Jm Casler 2021-11-20 21:57:21 -08:00
parent 97aec5f125
commit 4367f05b24

View File

@ -83,8 +83,9 @@ void StoreForwardPlugin::populatePSRAM()
DEBUG_MSG(" Free PSRAM: %d\n", ESP.getFreePsram()); DEBUG_MSG(" Free PSRAM: %d\n", ESP.getFreePsram());
// Use a maximum of 2/3 the available PSRAM unless otherwise specified. // Use a maximum of 2/3 the available PSRAM unless otherwise specified.
uint32_t numberOfPackets =( radioConfig.preferences.store_forward_plugin_records ? radioConfig.preferences.store_forward_plugin_records : uint32_t numberOfPackets =
( ( (ESP.getFreePsram() / 3) * 2 )/ sizeof(PacketHistoryStruct)) ); (radioConfig.preferences.store_forward_plugin_records ? radioConfig.preferences.store_forward_plugin_records
: (((ESP.getFreePsram() / 3) * 2) / sizeof(PacketHistoryStruct)));
// this->packetHistory = (PacketHistoryStruct *)ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)); // this->packetHistory = (PacketHistoryStruct *)ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct));
this->packetHistory = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct))); this->packetHistory = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)));
@ -171,8 +172,10 @@ void StoreForwardPlugin::sendPayload(NodeNum dest, uint32_t packetHistory_index)
// TODO: Make this configurable. // TODO: Make this configurable.
p->want_ack = false; p->want_ack = false;
p->decoded.payload.size = this->packetHistory[packetHistory_index].payload_size; // You must specify how many bytes are in the reply p->decoded.payload.size =
memcpy(p->decoded.payload.bytes, this->packetHistory[packetHistory_index].payload, this->packetHistory[packetHistory_index].payload_size); this->packetHistory[packetHistory_index].payload_size; // You must specify how many bytes are in the reply
memcpy(p->decoded.payload.bytes, this->packetHistory[packetHistory_index].payload,
this->packetHistory[packetHistory_index].payload_size);
service.sendToMesh(p); service.sendToMesh(p);
} }
@ -236,7 +239,6 @@ StoreForwardPlugin::StoreForwardPlugin()
radioConfig.preferences.store_forward_plugin_enabled = 1; radioConfig.preferences.store_forward_plugin_enabled = 1;
radioConfig.preferences.is_router = 1; radioConfig.preferences.is_router = 1;
radioConfig.preferences.is_always_powered = 1; radioConfig.preferences.is_always_powered = 1;
} }
if (radioConfig.preferences.store_forward_plugin_enabled) { if (radioConfig.preferences.store_forward_plugin_enabled) {