RP2040 CONNECT sleep working

I have put together an ARduino IDE2 library using mostly code taken from several posts on the Web. A sketch requires a single call to put either a Pi Pico or an RP2040 Connect into deep sleep for a specified number of seconds, and then recovers the clocks etc so that the sketch continues running without the processor needing restarting. I have tested this using both an unconnected processor and a processor working in a simple datalogger, the latter confirms that the processors are indeed functioning reasonably normally after sleep :-). My findings on the bare processors are:
Pico running normally consumes about 25 mA
Pico in deepsleep consumes just less than 3 mA
Connect running normally consumes about 26 mA
Connect in deepsleep consumes just over 7 mA

Of course, the Connect board has more than just the RP2040 on it, which is probably why it has higher current consumption. The Pico is basically just an RP2040.

I'm new to these forums, what's the best way to publish my code? It's 204 lines of C++ and a small .h file.
DISCLAIMER although I believe this code works, I did not write most of it, and I'm not an expert on RP2040 architecture.

Hi @mistertransistor.

Thanks for thinking to share your work with the Arduino community!

I think the best way to publish the source code is in a GitHub repository:

This is where almost all Arduino libraries (including every one of the libraries created by the Arduino organization) are hosted.

GitHub makes it very easy to collaborate on open source software projects.

If you don't have a GitHub account already, they are free and creating one is quite easy. Once you have a GitHub account, you can create an unlimited number of public or private repositories for all your projects for free. Since so much Arduino open source software (and open source software in general) development occurs in GitHub, you will likely find that having an account is also useful for submitting bug reports or contributing fixes or enhancements to other people's projects in addition to hosting your own projects.

Once you have published the library source code on GitHub (or an alternative common Git hosting service if you prefer), the next thing you can consider is to submit your library for inclusion in the Arduino Library Manager. This makes it easy for users to discover, install, and update the library. The procedure for submitting a library is documented here:

https://github.com/arduino/library-registry#adding-a-library-to-library-manager

You should make sure to publish the code in compliance with the license provided by the authors of the code you didn't write.

@mistertransistor can you share the github repository with your sleep code for RP2040 connect? Thanks

That could take a while. I don't have a GitHub account and I know nothing about it. I'm also busy with a load of other stuff.