* Enable proper reuse of PIO programs
Rewrite the PIOProgram helper class to properly re-use loaded programs
and to try to re-use loaded instructions before allocating a new PIO
program.
Supersedes #1524
* Less copy-pasta
The ABM had an off-by-one error in the DMA buffer swapover. Instead of
setting the DMA address to the newly added buffer in active[], it set it
to the buffer that was currently running.
This would effectively disable the ping-pong and cause clicks/lost data.
Fixes#1491
The serial port reset logic was calling `sleep_ms()` which ended up doing
a task switch...while the other core was frozen and everything was supposed
to be locked.
Use `busy_wait_ms()` which is a tight loop to delay in the reset portion.
Fixes#1486
Since FreeRTOS has real tasks and mutexes with support for priority bumping, actually always try and take a `CoreMutex` instead of seeing if someone else already has it and aborting immediately.
This fix helps ensure things like Serial output in a multi-task system won't get lost.
* Implement the BD_ADDR(char * address_string) constructor.
* Updating implementation to use sscanf.
There is an extra step after the sscanf that checks that we got
six bytes back and if we did not, it will set all bytes in the
address to zero.
* Example using BD_ADDR(const char * address_string)
This example shows how BD_ADDR(const char * address_string) can
be used to create BD_ADDR objects to use for comparisons etc.
* Update LEDeviceScanner.ino formatting
Warn the user that the Pico SDK STDIO calls (stdio_init_all, stdio_usb_init,
stdio_uart_init) are not supported or needed at compile time. See multiple
issues #1433#1347#1273#1251 and others.
* Fix FreeRTOS CoreMutex shim to handle ISRs
Automatically check, when in FreeRTOS, if we're in an ISR and
if so call the correct mutex grab.
Thanks to @caveman99 for finding and proposing a solution!
Fixes#1441
* Fix the CoreMutex destructor, too
Fixes#1465
The Adafruit Feather came onboard before the Wire swapping was supported
in the core, so it's backwards from the real definition. Now that swapping is
supported, fix it to match the rest of the boards.
Call `SerialPIO::setInverted(txinv, rxinv)` before `SerialPIO::begin()` to enable.
---------
Co-authored-by: Mykle Hansen <mykle@mykle.com>
Co-authored-by: Earle F. Philhower, III <earlephilhower@yahoo.com>
Update to head of upstream FreeRTOS/SMP branch. Very minor changes.
Remove the custom getreent implementation, use the one that was defined
in the upstream FreeRTOS/smp branch (callback related vs. static vars).
Fixes#1439
Use a real FreeRTOS task, at the highest priority, to idle the other core
while doing flash accesses.
The USB stack seems to have some timing dependent bits which get broken
if FreeRTOS switches out the current task when it's running. Avoid any
issue by disabling preemption on the core for all tud_task calls.
The PendSV handler disable flag can live completely inside the FreeRTOS
variant port, so remove any reference to it in the main core.
Tested using Multicode-FreeRTOS, #1402 and #1441
The USB FIFO interrupts were still being serviced even when the core was
frozen, leading to crashes. Explicitly shut off IRQs on both the victim
and the initiator core when freezing.
Removed the need for hack __holdUpPendSV flag