The Pico has 32k RAM and 2MB flash.
I created a program by copying existing an Arduino code, which barely fitted into an UNO, into a main.cpp for the Pico. The project folder was created withe the Pico board selected.
For a while now, libraries need to be added to each project. So I added the PubSubClient to the project.
But where do I find the avr/wdt.h file?
And more so, how do I add it to the Pico project.
This step was not necessary under the Arduino framework/project.
The main question is though: can I program the Pico by using the Arduino libraries?
Thanks. I did some further digging and found the watchdog.h, which could simply be called in the program.
I think the bigger question is: cane the Pico run unaltered Arduino code, including the use of libraries written for the Arduino?
This is how I understood the Pico; program it in MicroPython or program it in the Arduino IDE; or PlatformIO for that matter.
So far, the watchdog seems to require the Pico watchdog.
Source-code compatibility can only be expected if the libraries only use the common Arduino API – if a library decides to include AVR specific header and call functions in it, or even worse, do direct register manipulations, that fails to compile. Arduino cores try to partially remedy this because they know libraries just love to e.g. #include <pgmspace.h> for PROGMEM etc, which is an AVR compiler specific thing, by providing headers that hack the macros and functions in such a way that it compiles to sensible code (see e.g. pgmspace.h from Arduino-Pico, same header in STM32Duino). If it goes beyond that (like avr/interrupt.h, avr/watchdog.h), the cores usually don’t handle that and source-code compatibility is not given.