mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-18 16:15:36 +00:00
Apply formatting to S&F
This commit is contained in:
parent
228be41ba6
commit
efdd2ad490
@ -80,8 +80,7 @@ void StoreForwardPlugin::populatePSRAM()
|
|||||||
/* Use a maximum of 2/3 the available PSRAM unless otherwise specified.
|
/* Use a maximum of 2/3 the available PSRAM unless otherwise specified.
|
||||||
Note: This needs to be done after every thing that would use PSRAM
|
Note: This needs to be done after every thing that would use PSRAM
|
||||||
*/
|
*/
|
||||||
uint32_t numberOfPackets =
|
uint32_t numberOfPackets = (this->records ? this->records : (((ESP.getFreePsram() / 3) * 2) / sizeof(PacketHistoryStruct)));
|
||||||
(this->records ? this->records : (((ESP.getFreePsram() / 3) * 2) / sizeof(PacketHistoryStruct)));
|
|
||||||
|
|
||||||
this->packetHistory = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)));
|
this->packetHistory = static_cast<PacketHistoryStruct *>(ps_calloc(numberOfPackets, sizeof(PacketHistoryStruct)));
|
||||||
|
|
||||||
@ -107,7 +106,7 @@ void StoreForwardPlugin::historyReport()
|
|||||||
void StoreForwardPlugin::historySend(uint32_t msAgo, uint32_t to)
|
void StoreForwardPlugin::historySend(uint32_t msAgo, uint32_t to)
|
||||||
{
|
{
|
||||||
|
|
||||||
//uint32_t packetsSent = 0;
|
// uint32_t packetsSent = 0;
|
||||||
|
|
||||||
uint32_t queueSize = storeForwardPlugin->historyQueueCreate(msAgo, to);
|
uint32_t queueSize = storeForwardPlugin->historyQueueCreate(msAgo, to);
|
||||||
|
|
||||||
@ -147,7 +146,8 @@ uint32_t StoreForwardPlugin::historyQueueCreate(uint32_t msAgo, uint32_t to)
|
|||||||
TODO: The condition (this->packetHistory[i].to & NODENUM_BROADCAST) == to) is not tested since
|
TODO: The condition (this->packetHistory[i].to & NODENUM_BROADCAST) == to) is not tested since
|
||||||
I don't have an easy way to target a specific user. Will need to do this soon.
|
I don't have an easy way to target a specific user. Will need to do this soon.
|
||||||
*/
|
*/
|
||||||
if ((this->packetHistory[i].to & NODENUM_BROADCAST) == NODENUM_BROADCAST || ((this->packetHistory[i].to & NODENUM_BROADCAST) == to)) {
|
if ((this->packetHistory[i].to & NODENUM_BROADCAST) == NODENUM_BROADCAST ||
|
||||||
|
((this->packetHistory[i].to & NODENUM_BROADCAST) == to)) {
|
||||||
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].time = this->packetHistory[i].time;
|
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].time = this->packetHistory[i].time;
|
||||||
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].time = this->packetHistory[i].time;
|
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].time = this->packetHistory[i].time;
|
||||||
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].to = this->packetHistory[i].to;
|
this->packetHistoryTXQueue[this->packetHistoryTXQueue_size].to = this->packetHistory[i].to;
|
||||||
@ -355,7 +355,6 @@ ProcessMessage StoreForwardPlugin::handleReceivedProtobuf(const MeshPacket &mp,
|
|||||||
DEBUG_MSG("StoreAndForward_RequestResponse_ROUTER_PONG\n");
|
DEBUG_MSG("StoreAndForward_RequestResponse_ROUTER_PONG\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(0); // unexpected state - FIXME, make an error code and reboot
|
assert(0); // unexpected state - FIXME, make an error code and reboot
|
||||||
}
|
}
|
||||||
@ -411,9 +410,8 @@ StoreForwardPlugin::StoreForwardPlugin()
|
|||||||
// Popupate PSRAM with our data structures.
|
// Popupate PSRAM with our data structures.
|
||||||
this->populatePSRAM();
|
this->populatePSRAM();
|
||||||
|
|
||||||
|
// this->packetTimeMax = 2000;
|
||||||
//this->packetTimeMax = 2000;
|
// DEBUG_MSG("SF Time to Transmit maxPacketSize (%d bytes) %d ms\n", maxPacketSize, this->packetTimeMax);
|
||||||
//DEBUG_MSG("SF Time to Transmit maxPacketSize (%d bytes) %d ms\n", maxPacketSize, this->packetTimeMax);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("Device has less than 1M of PSRAM free. Aborting startup.\n");
|
DEBUG_MSG("Device has less than 1M of PSRAM free. Aborting startup.\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user