ArmDeveloperEcosystem / lorawan-library-for-pico

Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡
BSD 3-Clause "New" or "Revised" License
125 stars 47 forks source link

Compiler error #32

Closed machasm1 closed 1 year ago

machasm1 commented 1 year ago

Getting a complier error here on line 295 of lorawan.c file int lorawan_process_timeout_ms(uint32_t timeout_ms)

Error message is this a value of type "int" cannot be used to initialize an entity of type "absolute_time_t" Any ideas?

jerryneedell commented 1 year ago

In lorawan.c try adding "#include pico/time.h"

diff --git a/src/lorawan.c b/src/lorawan.c
index 9e4cec3..dc24e60 100644
--- a/src/lorawan.c
+++ b/src/lorawan.c
@@ -28,6 +28,7 @@
 #include <string.h>

 #include "pico/lorawan.h"
+#include "pico/time.h"

 #include "board.h"
 #include "rtc-board.h"
machasm1 commented 1 year ago

Thank you. Simple when you know what you are doing :-)

jerryneedell commented 1 year ago

Glad it worked -- I created PR #33 to make this fix available to others.