From 463dbb9023492733b7894134deec43aa19661e79 Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Fri, 16 Feb 2024 04:07:13 -0600 Subject: [PATCH] Modifications for 64-bit OS - Change unsigned long to uint32_t in examples --- examples_RPi/helloworld_rx.cpp | 4 ++-- examples_RPi/helloworld_tx.cpp | 10 +++++----- examples_RPi/rx-test.cpp | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples_RPi/helloworld_rx.cpp b/examples_RPi/helloworld_rx.cpp index 520338af..b0300841 100644 --- a/examples_RPi/helloworld_rx.cpp +++ b/examples_RPi/helloworld_rx.cpp @@ -29,8 +29,8 @@ const uint16_t other_node = 01; struct payload_t { // Structure of our payload - unsigned long ms; - unsigned long counter; + uint32_t ms; + uint32_t counter; }; int main(int argc, char** argv) diff --git a/examples_RPi/helloworld_tx.cpp b/examples_RPi/helloworld_tx.cpp index 1e5fe779..6352133a 100644 --- a/examples_RPi/helloworld_tx.cpp +++ b/examples_RPi/helloworld_tx.cpp @@ -32,13 +32,13 @@ const uint16_t other_node = 00; // How often (in milliseconds) to send a message to the `other_node` const unsigned long interval = 2000; -unsigned long last_sent; // When did we last send? -unsigned long packets_sent; // How many have we sent already +uint32_t last_sent; // When did we last send? +uint32_t packets_sent; // How many have we sent already struct payload_t { // Structure of our payload - unsigned long ms; - unsigned long counter; + uint32_t ms; + uint32_t counter; }; int main(int argc, char** argv) @@ -58,7 +58,7 @@ int main(int argc, char** argv) while (1) { network.update(); - unsigned long now = millis(); // If it's time to send a message, send it! + uint32_t now = millis(); // If it's time to send a message, send it! if (now - last_sent >= interval) { last_sent = now; diff --git a/examples_RPi/rx-test.cpp b/examples_RPi/rx-test.cpp index df4372bb..6e188a85 100644 --- a/examples_RPi/rx-test.cpp +++ b/examples_RPi/rx-test.cpp @@ -27,17 +27,17 @@ const uint16_t other_node = 01; struct payload_power_t { // Structure of our payload - unsigned long nodeId; + uint32_t nodeId; float power; float current; }; struct payload_weather_t { - unsigned long nodeId; + uint32_t nodeId; float temperature; float humidity; - unsigned long lux; + uint32_t lux; }; int main(int argc, char** argv)