There's currently no way to be notified in a "stdio" agnostic way
whether there's an incoming character available. You can poll with
getchar_timeout_us, but that's far from ideal.
Add a method that takes a callback to notify that a character might be
available.
1. Make sure Pico SDK libraries have the correct dependencies on other SDK libraries
2. Pico SDK libraries all have _headers variants to include the headers. This may facilitate building user STATIC libraries without
pulling in SDK code, though care will still need to be taken w.r.t. values of #defines
3. Make sure the _headers versions also have the correct dependencies
Note: There are a few exceptions to 1. for some non code libraries like pico_standard_link and pico_cxx_options
* Add BSSID connection options to PicoW
When working with a mesh or multiple APs with the same SSID, it is often
necessary to specify which of the APs to connect to in order to maximize
the WiFi strength.
Add BSSID options to the SDK's PicoW cyw43_arch_wifi_connect_XXX APIs.
Fixes#1090
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
Basically the integration code (cyw43_config.h and related implementations) are now in the driver.
cyw43_arch now just has
* async_context creation per CYW43_ARCH_TYPE
* pre-existing cyw43_arch methods for connect etc.
Add a general purpose random number generator via pico_rand library. which tries to use as much real entropy as possible mixed into a PRNG
Co-authored-by: graham sanderson <graham.sanderson@raspberrypi.com>
This sets the compile-time flag for tinyusb's dcd_rp2040 driver by
default. Applications that won't ever be plugged into a Pi 4 or Pi 400
can optionally disable this.
* Remove (legacy) direct inclusion of 'pico/platform.h' which potentially skip config/board setup
* also fix direct use of pico/config.h which predated pico.h being assembly includable
* Extract all poll/threadsafe_background/freertos from cyw43_arch into new abstraction async_context:
* provides support for asynchronous events (timers/IRQ notifications) to be handled in a safe context.
* now guarantees all callbacks happen on a single core.
* is reusable by multiple different libraries (stdio_usb can now be ported to this but hasn't been yet).
* supports multiple independent instances (independent instances will not block each other).
* cyw43_arch libraries cleaned up to use the new abstraction. Note each distinct cyw43_arch type is now a very thin layer that creates the right type of context and adds cyw43_driver and lwip support as appropriate.
Additionally,
* Add new pico_time and hardware_alarm APIs
* Add from_us_since_boot()
* Add alarm_pool_create_with_unused_hardware_alarm()
* Add alarm_pool_add_alarm_at_force_in_context()
* Add hardware_alarm_claim_unused()
* Add hardware_alarm_force_irq()
* Added panic_compact() and some minor comment cleanup; moved FIRST_USER_IRQ define to platform_defs.h
* SYS functions and GCC 12 fixes
* Add implementation of _gettimeofday and settimeofday, _times
* Remove some GCC warnings about unimplemented SYS functions (e.g. _open) by making weak implementations that return errors.
* Removed _exit from crt0.S since we have a weak version in runtime.c and we don't want two weak impls since the linker can't pick. If the user omits runtime.c then they'll need to provide _exit or get the error
* Add sys/time.h to arch/cc.h for lwIP as it seems under GCC12 this is not getting included
In arm-gnu-toolchain-12.2 we see this warning, that's not relevant to
pico. Disable it.
warning: blink.elf has a LOAD segment with RWX permissions
Fixes#1029
fix bug #1068 where the raw irq handler that was added masked on IO_IRQ_BANK0 (defined as 13) and not the gpio connected to the CYW43 i.e. CYW43_PIN_WL_HOST_WAKE
Co-authored-by: andrew arm <armdev@openlx.org.uk>
* Remove incorrect override for LWIP_PLATFORM_ASSERT
LWIP_PLATFORM_ASSERT macro is used by lwip driver implementations to specify the behavior of the assertions in lwip code.
The previous override of this macro incorrectly assumed that the parameter to the function macro was the condition to check. However this is incorrect. The parameter is actually a message string defining what failed.
This mistake caused all assertions to be ignored. ( and myself to loose many hours of debugging time )
By removing this, we restore the default behavior specified by lwip which is to use `printf` to log the message.
* I think i prefer to use panic (which doesn't pull in fflush etc)
Co-authored-by: Graham Sanderson <graham.sanderson@gmail.com>
* Remove unnecessary wait in pico_divider.
There is no need to wait if there is more than 8 cycles between setup and result readout.
Dividend/divisor readout should be correct without delay. Update comment to reflect that.
* Optimize hw_divider_save_state/hw_divider_restore_state.
Doing multiple pushes to avoid stack usage is faster.
The wait loop in hw_divider_save_state had an incorrect branch in the wait loop.
This didn't matter since the wait wasn't necessary to begin with.
* Remove pointless aligns in hardware_divider.
The regular_func_with_section inserts a new section so if aligning
is desired it should be placed in the macro after section start.
* Save a few bytes in hardware_divider.
Signed and unsigned code can use the same exit code.
Branching to the common code is free since we need the 8 cycle
delay anyway.
* Add mbedtls as a submodule
Checked out on branch mbedtls-2.28
* Add mbedtls to pico-sdk
Link your code to pico_lwip_mbedtls and pico_mbedtls.
See tls_client example in pico-examples
Fixes https://github.com/raspberrypi/pico-sdk/issues/893
* Implement whole-buffer write semihosting
Each semihosting call is very slow, so doing it for each character
does not provide an ideal developer experience.
This change allows the entire buffer to be printed out in a single call.