usedbytes / picowota

A bootloader for OTA WiFi code upload to a Raspberry Pi Pico W
BSD 3-Clause "New" or "Revised" License
116 stars 21 forks source link

reboot.h not usable in C++ #19

Open bobstaff147 opened 8 months ago

bobstaff147 commented 8 months ago

The current reboot.h is not compatible with C++ due to the function name being mangled.

Can I suggest the file is changed as shown in this patch

--- /home/dev/picowota_blink/picowota/picowota_reboot/include/picowota/reboot.h +++ reboot.h @@ -11,6 +11,15 @@

define PICOWOTA_BOOTLOADER_ENTRY_MAGIC 0xb105f00d

+#ifdef cplusplus +extern "C" { +#endif + void picowota_reboot(bool to_bootloader); + +#ifdef cplusplus +} +#endif +

endif / PICOWOTA_REBOOT_H /

Thanks Bob S.

OKE924 commented 3 weeks ago

Thanks for your PR. Your solution approach solved my "undefined reference "issue. Is this related to the fact that the cmake lib is also named "picowota_reboot"?

Best wishes Oke