0
mirror of https://github.com/torvalds/GuitarPedal.git synced 2026-08-19 05:33:46 +00:00
Files
Linus Torvalds 0c1b9c3db3 Split Software/ into the four things it actually was
'Software' was the directory everything that was not KiCad ended up in,
which stopped describing anything a while ago - Validation and the web
app are software too.  Worse, it put the shared parts inside the
firmware, where they read as the firmware's own.

They are not.  Effects/ has three consumers built from it: the firmware,
Validation's bench, and the web app's controls, all generated from the
same POT: comments by gen_effects.py.  Audio/ has two - the bench
compiles the same biquads, the same envelope followers and the same
single_sample(), which is the whole reason a measurement on a
workstation says anything about the pedal.  Neither belongs under
Firmware/, so neither is under it any more:

  Effects/    one file per effect
  Audio/      the DSP they are built from, and the audio loop
  Firmware/   the rest of what runs on the pedal, and the submodules
  WebMIDI/    the web app
  scripts/    what the build runs
  Validation/ unchanged
  Hardware/, Documentation/, Images/

CMakeLists.txt and the wrapper Makefile move to the top with them,
because the build now consumes four of those directories and generates
into a fifth.  board.local and build/ come along; MIDI_CC_MAP.md is
generated into Documentation/ rather than into the old Software/ root.

scripts/ goes with the build rather than staying under the firmware,
because six of the ten had nothing to do with the firmware: gen_effects.py
reads Effects/ and writes to three different places, pow2/log2/quarter_sine
generate Audio/'s tables, check-readme.py compares Effects/ against the
README, and server.py serves the web app.  Four of them are invoked from
Validation, which was reaching into Firmware/ for tooling - the same
burying this commit is undoing.  The four that really are about the
firmware are ELF checks the top-level build drives anyway, and a second
scripts directory would only be a second place to look.

C includes say "Audio/foo.h" and the generated map says
"Effects/bar.h", with the repository root on the include path for both
the firmware and the bench.  Spelling the directory out rather than
relying on a bare name is what keeps Audio/cycles.h shimmable: a quoted
include searches the including file's own directory first.

The submodules are renamed as well as moved.  git mv updates their paths
but leaves the section names, and 'Software/pico-sdk' surviving in
.gitmodules would be the word this commit removes, still load-bearing.
That meant the nested modules under pico-sdk too - six .git files
pointing into .git/modules/Software - which is why 'git submodule update
--init --recursive' is worth running once after pulling this.

Verified rather than assumed: a clean configure and build, make check
(failing only on the missing-eeprom case it already failed on),
check-effects, all four analysis pages reproducing every series and
drawing every chart, and a flash to the board that still measures a
routed reverb where it did before.

One latent bug fell out of it.  bench/coeff declared only quarter_sine.h
of the three generated math tables, and Audio/util.h includes pow2.h and
log2.h as well - so building that target with an empty gen/ could never
have worked.  'make bench' builds bench/bench first, which generates all
three, so it stayed hidden until this rebuilt everything from nothing.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-08-11 13:48:26 -07:00

66 lines
2.4 KiB
C

//
// The split boards. Hardware/audio-jacks plus an MCU board.
//
// "Split" is the architecture: an MCU board and an audio-jacks board
// joined by a 12P 0.5mm FFC carrying power, i2c and i2s. It was done
// that way to lay the two out independently, to fit a 125B enclosure
// with the jacks, rotaries and the original screen all in one top area,
// and out of a worry about noise isolation that never had to be tested.
//
// Both halves are finished hardware now and neither will change again.
// They stay buildable because the basics have not moved and they are
// still useful for testing.
//
// **One board file covers all of them, and that is the point.** There
// are two MCU boards - one with a rotary encoder, one with hardware MIDI
// jacks - and their pins do not clash, so a single build drives either.
// Polling a rotary that is not fitted reads a pin that never moves, and
// bringing up a UART whose jacks are absent talks to nobody.
//
// The audio boards vary too - a TAC5112 that was never wired for stereo,
// and a TAC5242 that was - and that difference is real and user-visible.
// It is not a build option either: the TAC5112 needs i2c setup anyway,
// so the firmware has to find out which one is there, and having found
// out it can simply say so. See probe_hardware().
//
// Any audio board pairs with any MCU board; it is a cable. So nothing
// here may assert what is on the other end of it.
//
// The one LED. Plain PWM brightness; see set_led().
#define LED_GPIO 0
//
// The one rotary encoder: A and B are the quadrature pair, SW is the
// shaft pressing down. Not fitted on the MIDI MCU board.
//
#define ROTARY_A_GPIO 6
#define ROTARY_B_GPIO 7
#define ROTARY_SW_GPIO 12
// The one stomp switch. Internal pull-up, closing to GND.
#define STOMP_GPIO 13
//
// Hardware MIDI, on the pins the second rotary encoder used to have.
// Not fitted on the rotary MCU board.
//
// Funcsel 11 rather than 2: UART1 TX/RX is one of the RP2350 extended
// functions on 26/27, because CTS/RTS already occupy function 2 there.
// See board.h, which explains why that number lives with the pins.
//
#define MIDI_HW 1
#define MIDI_OUT 26
#define MIDI_IN 27
#define MIDI_FUNCSEL 11
//
// Pins that used to be something on these boards and no longer are,
// recorded so nobody has to go through the git history to find out why
// there are gaps:
//
// GPIO 1 second LED
// GPIO 28 second rotary's shaft switch
// GPIO 29 second stomp switch
//