Skip to content

Commit

Permalink
Modifications for 64-bit OS
Browse files Browse the repository at this point in the history
- Change unsigned long to uint32_t in examples
  • Loading branch information
TMRh20 committed Feb 16, 2024
1 parent 4e804ee commit 463dbb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples_RPi/helloworld_rx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions examples_RPi/helloworld_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions examples_RPi/rx-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 463dbb9

Please sign in to comment.