Skip to content

Commit 0eca751

Browse files
authored
Merge pull request #654 from LeeLeahy2/wip-rename
Rename some routines and variables
2 parents 73098ed + 50598ee commit 0eca751

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,18 @@ NETCONSUMER_MASK_t networkConsumerBits(NetIndex_t index)
501501
return networkConsumersAny | netIfConsumers[index];
502502
}
503503

504+
//----------------------------------------
505+
// Count the number of network consumers
506+
//----------------------------------------
507+
int networkConsumerCount(NetIndex_t index)
508+
{
509+
return networkConsumerCountBits(networkConsumerBits(index));
510+
}
511+
504512
//----------------------------------------
505513
// Count the network consumer bits
506514
//----------------------------------------
507-
int networkConsumerCount(NETCONSUMER_MASK_t bits)
515+
int networkConsumerCountBits(NETCONSUMER_MASK_t bits)
508516
{
509517
int bitCount;
510518
NETCONSUMER_MASK_t bitMask;
@@ -543,7 +551,7 @@ void networkConsumerDisplay()
543551
bits |= netIfConsumers[index];
544552
users = netIfUsers[index];
545553
}
546-
systemPrintf("Network Consumers: %d", networkConsumerCount(bits));
554+
systemPrintf("Network Consumers: %d", networkConsumerCountBits(bits));
547555
networkConsumerPrint(bits, users, ", ");
548556
systemPrintln();
549557

@@ -1355,7 +1363,7 @@ void networkInterfaceInternetConnectionLost(NetIndex_t index)
13551363
bool networkIsHighestPriority(NetIndex_t index)
13561364
{
13571365
NetPriority_t priority;
1358-
bool higherPriority;
1366+
bool highestPriority;
13591367

13601368
// Validate the index
13611369
networkValidateIndex(index);
@@ -1364,10 +1372,10 @@ bool networkIsHighestPriority(NetIndex_t index)
13641372
priority = networkPriority;
13651373

13661374
// Determine if the specified interface has higher priority
1367-
higherPriority = (priority == NETWORK_OFFLINE);
1368-
if (!higherPriority)
1369-
higherPriority = (priority >= networkPriorityTable[index]);
1370-
return higherPriority;
1375+
highestPriority = (priority == NETWORK_OFFLINE);
1376+
if (highestPriority == false)
1377+
highestPriority = (priority >= networkPriorityTable[index]);
1378+
return highestPriority;
13711379
}
13721380

13731381
//----------------------------------------
@@ -2025,7 +2033,7 @@ NETCONSUMER_MASK_t networkSoftApConsumerBits()
20252033
//----------------------------------------
20262034
void networkSoftApConsumerDisplay()
20272035
{
2028-
systemPrintf("WiFi Soft AP Consumers: %d", networkConsumerCount(networkSoftApConsumer));
2036+
systemPrintf("WiFi Soft AP Consumers: %d", networkConsumerCountBits(networkSoftApConsumer));
20292037
networkConsumerPrint(networkSoftApConsumer, 0, ", ");
20302038
systemPrintln();
20312039
}
@@ -2465,7 +2473,7 @@ void networkUserDisplay(NetIndex_t index)
24652473

24662474
// Determine if there are any users
24672475
bits = netIfUsers[index];
2468-
systemPrintf("%s Users: %d", networkInterfaceTable[index].name, networkConsumerCount(bits));
2476+
systemPrintf("%s Users: %d", networkInterfaceTable[index].name, networkConsumerCountBits(bits));
24692477
networkConsumerPrint(bits, 0, ", ");
24702478
systemPrintln();
24712479
}

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ bool wifiStationReconnectionRequest()
863863

864864
//*********************************************************************
865865
// Start WiFi with throttling, used by wifiStopSequence
866-
void wifiStationRestart(NetIndex_t index, uintptr_t parameter, bool debug)
866+
void wifiStationRestartOld(NetIndex_t index, uintptr_t parameter, bool debug)
867867
{
868868
// Check for network shutdown
869869
if (networkConsumerCount == 0)
@@ -3075,7 +3075,7 @@ NETWORK_POLL_SEQUENCE wifiStartSequence[] = {
30753075
// WiFi stop sequence
30763076
NETWORK_POLL_SEQUENCE wifiStopSequence[] = {
30773077
// State Parameter Description
3078-
{wifiStationRestart, 0, "Restart WiFi"},
3078+
{wifiStationRestartOld, 0, "Restart WiFi"},
30793079
{wifiWaitNoUsers, 0, "Wait for no WiFi users"},
30803080
{wifiStop, 0, "Shutdown WiFi"},
30813081
{nullptr, 0, "Termination"},

0 commit comments

Comments
 (0)