Commit graph

17 commits

Author SHA1 Message Date
Markus Gyger
b3d0ccc7e3
Change duty cycle of PIO Tone to 50% (#2770) 2025-01-21 10:03:31 -08:00
Earle F. Philhower, III
67bf5a734a
Remove 2 instructions from tone PIO program (#2515)
Manually load the 2 needed registers using pio_execute to save a couple
PIO instruction slots.
2024-10-03 13:27:14 -07:00
Earle F. Philhower, III
76811d3c66
Add RP2350B generic/Pimoroni PGA2350 support (#2433)
* Add support for the extra 16 GPIO pins in the menus and core.
* Clean up Generic RP2350 PSRAM ("none" is valid) and flash (other than 16MB) options.
* Add extra GPIO<->peripheral connections
* Add Pimoroni PGA2350 RP2350B-based board
* Pins 32-47 can be used for PIOPrograms
* Avoid hang when PSRAM fails to initialize
* Move libpico to an RP2350B board for SDK (otherwise the SDK drops all GPIOHI support)
2024-09-11 18:55:28 -07:00
Earle F. Philhower, III
444bb24464
Remove debug printout warnings (#1091)
Exposed by #1090, remove ugly printf format warnings while in debug mode
2023-01-02 10:51:04 -08:00
Earle F. Philhower, III
029471ecca
Drive pin LOW after Tone(period) timeout (#887)
Fixes #886
2022-09-29 13:03:49 -07:00
Earle F. Philhower, III
b0d0e292c9
Minor - Add number separators (#845) 2022-09-07 15:19:12 -07:00
Earle F. Philhower, III
bedfbda372
Clear PIO FIFOs when updating Tone and Servos (#206)
The PIO programs that generate tone() and Servo() use the TX FIFO to
receive updates to the period/duty cycle.

The original code would push into the FIFO (potentially blocking the
app if the FIFO was full) and generate at least one cycle of every
value written into the control.  Basically, the output would
lag the changes by 1 cycle or more (which could be 20ms+ on Servo).

Fix this by clearing any old, ungrabbed values from the FIFO before
sending a new one to the program.  Instead of a FIFO, there is
effectively now just a control register and updates will be immediate.

Update the Siren.ino example with delays because now the tone() calls
will not block and run 10x+ faster.
2021-06-11 12:27:48 -07:00
Earle F. Philhower, III
c65c4bfb4e
Allow continuous tone frequency changes (#186)
Fixes #121
Supersedes #185

Redo the PIO program to allow the tone generator on a pin to be updated
without interruption, at waveform boundaries.  This allows for things like
sirens or slurs to be implemented simply.

Use an alarm, not the PIO hardware, to manage time-limited tones().

Add a simple siren example.
2021-06-04 02:45:13 -07:00
Earle F. Philhower, III
8016a932f3
Add astyle format, boards.txt, and package check (#166)
Miscellaneous CI checks for code style, boards.txt update, and that all
referenced packages are available.
2021-05-24 15:01:03 -07:00
Earle F. Philhower, III
83a32f1ba3
Add compilation to CI (#155)
Stolen from ESP8266, modified to run basic sanity compiles on the core.

Fix warnings identified by the new checks.
2021-05-22 02:58:57 -07:00
Earle F. Philhower, III
d776ec2f56
Fix memory leak in tone/noTone calls (#125)
Was never deleting the tone object on noTone, so eventually the leaked
objects would fill up heap and cause a crash.

Fixes #121
2021-05-08 11:19:32 -07:00
Earle F. Philhower, III
011ecdb5a6
More multicore safety plumbing, IRQs, analogXXX (#107)
Keep a per-core IRQ stack for noInterrupts since each core has its own
enable/disable.

Make analogRead/analogWrite multicore safe
2021-04-15 17:16:13 -07:00
Earle F. Philhower, III
b793ad5533
Make Tone multicore safe (#106)
Add a mutex around the Tone mapping for multicore safety.
2021-04-15 16:21:47 -07:00
Earle F. Philhower, III
c988c1c8a4 Add debug prints on error conditions to the core 2021-03-30 18:17:52 -07:00
Earle F. Philhower, III
6adb1a641c Initial debugging framework 2021-03-17 10:54:13 -07:00
Earle F. Philhower, III
0647955a93 Use PIO to generate Tones, too 2021-03-16 17:55:57 -07:00
Earle F. Philhower, III
912e010d3e Add tone and noTone support 2021-03-15 13:20:34 -07:00