You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -782,13 +782,15 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
782
782
}
783
783
// check next Round-Robin client, and sync next new post
784
784
auto client = &known_clients[next_client_idx];
785
+
bool did_push = false;
785
786
if (client->pending_ack == 0 && client->last_activity != 0 && client->push_failures < 3) { // not already waiting for ACK, AND not evicted, AND retries not max
786
787
MESH_DEBUG_PRINTLN("loop - checking for client %02X", (uint32_t) client->id.pub_key[0]);
787
788
for (int k = 0, idx = next_post_idx; k < MAX_UNSYNCED_POSTS; k++) {
788
789
if (posts[idx].post_timestamp > client->sync_since// is new post for this Client?
789
790
&& !posts[idx].author.matches(client->id)) { // don't push posts to the author
790
791
// push this post to Client, then wait for ACK
791
792
pushPostToClient(client, posts[idx]);
793
+
did_push = true;
792
794
MESH_DEBUG_PRINTLN("loop - pushed to client %02X: %s", (uint32_t) client->id.pub_key[0], posts[idx].text);
793
795
break;
794
796
}
@@ -799,7 +801,12 @@ class MyMesh : public mesh::Mesh, public CommonCLICallbacks {
799
801
}
800
802
next_client_idx = (next_client_idx + 1) % num_clients; // round robin polling for each client
801
803
802
-
next_push = futureMillis(SYNC_PUSH_INTERVAL);
804
+
if (did_push) {
805
+
next_push = futureMillis(SYNC_PUSH_INTERVAL);
806
+
} else {
807
+
// were no unsynced posts for curr client, so proccess next client much quicker! (in next loop())
808
+
next_push = futureMillis(SYNC_PUSH_INTERVAL / 8);
809
+
}
803
810
}
804
811
805
812
if (next_flood_advert && millisHasNowPassed(next_flood_advert)) {
@@ -839,6 +846,14 @@ void setup() {
839
846
840
847
board.begin();
841
848
849
+
#ifdef DISPLAY_CLASS
850
+
if(display.begin()){
851
+
display.startFrame();
852
+
display.print("Please wait...");
853
+
display.endFrame();
854
+
}
855
+
#endif
856
+
842
857
if (!radio_init()) { halt(); }
843
858
844
859
fast_rng.begin(radio_get_rng_seed());
@@ -857,6 +872,10 @@ void setup() {
857
872
#endif
858
873
if (!store.load("_main", the_mesh.self_id)) {
859
874
the_mesh.self_id = radio_new_identity(); // create new random identity
875
+
int count = 0;
876
+
while (count < 10 && (the_mesh.self_id.pub_key[0] == 0x00 || the_mesh.self_id.pub_key[0] == 0xFF)) { // reserved id hashes
0 commit comments