Skip to content
Snippets Groups Projects
Commit f670a59d authored by Davide Mor's avatar Davide Mor
Browse files

[CI/CD] Fixed sx1278 lints

parent aa5ac6c6
Branches
Tags
No related merge requests found
...@@ -103,14 +103,15 @@ struct Stats ...@@ -103,14 +103,15 @@ struct Stats
{ {
// Prints are REALLY slow, so take a COPY of stats, so we can print an // Prints are REALLY slow, so take a COPY of stats, so we can print an
// instant in time. // instant in time.
Stats stats = *this; Stats stats_now = *this;
printf("stats.last_recv_packet = %d\n", stats.last_recv_packet); printf("stats.last_recv_packet = %d\n", stats_now.last_recv_packet);
printf("stats.corrupted_packets = %d\n", stats.corrupted_packets); printf("stats.corrupted_packets = %d\n", stats_now.corrupted_packets);
printf("stats.send_count = %d\n", stats.send_count); printf("stats.send_count = %d\n", stats_now.send_count);
printf("stats.recv_count = %d\n", stats.recv_count); printf("stats.recv_count = %d\n", stats_now.recv_count);
printf("stats.recv_errors = %d\n", stats.recv_errors); printf("stats.recv_errors = %d\n", stats_now.recv_errors);
printf("stats.packet_loss = %.2f %%\n", stats.packet_loss() * 100.0f); printf("stats.packet_loss = %.2f %%\n",
stats_now.packet_loss() * 100.0f);
} }
} stats; } stats;
......
...@@ -108,7 +108,8 @@ void recvLoop() ...@@ -108,7 +108,8 @@ void recvLoop()
char buf[64]; char buf[64];
while (1) while (1)
{ {
ssize_t res = sx1278->receive((uint8_t *)buf, sizeof(buf)); ssize_t res =
sx1278->receive(reinterpret_cast<uint8_t *>(buf), sizeof(buf));
if (res != -1) if (res != -1)
{ {
// Make sure there is a terminator somewhere // Make sure there is a terminator somewhere
...@@ -127,7 +128,7 @@ void sendLoop(int interval, const char *data) ...@@ -127,7 +128,7 @@ void sendLoop(int interval, const char *data)
{ {
miosix::Thread::sleep(interval); miosix::Thread::sleep(interval);
sx1278->send((uint8_t *)buf, strlen(buf) + 1); sx1278->send(reinterpret_cast<uint8_t *>(buf), strlen(buf) + 1);
printf("[sx1278] Sent '%s'\n", buf); printf("[sx1278] Sent '%s'\n", buf);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment