Skip to content

Commit

Permalink
Update for 64-bit OS
Browse files Browse the repository at this point in the history
- Modify examples files for 64-bit OS #218
  • Loading branch information
TMRh20 committed Feb 16, 2024
1 parent 31ea51c commit 5cee39c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 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 All @@ -56,7 +56,7 @@ int main(int argc, char** argv)
payload_t payload;
network.read(header, &payload, sizeof(payload));

printf("Received payload: counter=%lu, origin timestamp=%lu\n", payload.counter, payload.ms);
printf("Received payload: counter=%u, origin timestamp=%u\n", payload.counter, payload.ms);
}
//sleep(2);
delay(2000);
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 5cee39c

Please sign in to comment.