Skiff 1.3.1: a 320 MHz CPU CLOCK, and fixes from your comments
- CPU CLOCK (MENU > SYSTEM): 360 MHz, the default, or 320 MHz, the clock JieLi rates the chip for, from the next power-on; curist's fm1-clk320-probe switch (MIT) (#14) - The web editor's step tables no longer draw over each other past 16 steps - The low-pass and high-pass icons the right way round (the icon font's names are mirrored) - README: the standard MIDI CCs; the editor's pictures from 1.3's editor
No files matched your search
@@ -358,7 +358,7 @@ The colours differ in lightness as well as hue, and always appear with the track
|
||||
- EDIT > LANES (DRUM) is one page: KNOB 1 the lane (the grid's too), KNOB 2 its LEVEL, (phase 9) KNOB 3 its TUNE (±12 semitones, 0.0 as the kit has it), KNOB 4 its DECAY (a signed offset, 0 as the kit has it), the eight as faders; a held step's KNOB 2 3 4 lock that lane's. DRUM-X has its sheet's LEVEL instead (and tunes its sounds there).
|
||||
- A page that changes nothing on the track's engine is not there: ENV, ENV DEST, ENV 2, VOICE, VOICE 2 and SCALE on DRUM and DRUM-X (`engine_t.oneshot`), ENV, ENV DEST and ENV 2 on FM6 (`ownenv`); VOICE 2 is ALLOC, DTUNE and (1.3) SPREAD (PAN, MUTE: MIXER's). A card that does nothing there is dimmed: LFO DEST's PIT FLT SHP on the hits, DRUM's KICK on a model kit, (1.3) LFO's RATE while LFO 2 SYNC is on, SPREAD on MONO and LEGATO. A button with no page says so (NO ENV ON DRUM); a page a track no longer has goes to its family's first (or HOME) and says so too.
|
||||
- Every family reopens the page it was left on (SAVE and GLO too), and the MENU closes back onto the page it was opened over.
|
||||
- SAVE › TOOLS is gone (CLEAR is the REC and SEQ TOOLS layers', INIT the EDIT layer's), and so is GLO › SYSTEM: CLOCK and MIDI IN are MENU › CONTROL's ((1.3) MENU › MIDI's), TUNE MENU › AUDIO's, CPU (read only) MENU › SYSTEM's. (Skiff 1.3) CPU picks 1 CORE or 2 CORES (BETA, from the next power-on; RESTART until then), then the load: the second core renders tracks (fx.c mix_block: the split by the last block's cost, the sums per core, bit for bit as one core; tests/dualcore_test.c), and the voice budget is 12 instead of 8 while it runs (core.h VOICE_BUDGET). A core that misreads or stops answering is held: one core, CORE 2 FAILED, the row back to 1 CORE.
|
||||
- SAVE › TOOLS is gone (CLEAR is the REC and SEQ TOOLS layers', INIT the EDIT layer's), and so is GLO › SYSTEM: CLOCK and MIDI IN are MENU › CONTROL's ((1.3) MENU › MIDI's), TUNE MENU › AUDIO's, CPU (read only) MENU › SYSTEM's. (Skiff 1.3) CPU picks 1 CORE or 2 CORES (BETA, from the next power-on; RESTART until then), then the load: the second core renders tracks (fx.c mix_block: the split by the last block's cost, the sums per core, bit for bit as one core; tests/dualcore_test.c), and the voice budget is 12 instead of 8 while it runs (core.h VOICE_BUDGET). A core that misreads or stops answering is held: one core, CORE 2 FAILED, the row back to 1 CORE. (Skiff) CPU CLOCK, after CPU (SYSTEM's seven rows scroll): 360 MHZ (the boot stage's, the default) or 320 MHZ, JieLi's rated clock, switched at boot from RAM with the IRQs off, the cache and the flash controller retimed around the PLL change (curist's hal/fm1_clk320.h, hal/fm1_clk.h, main.c), the screen up, before the second core, the audio and USB; from the next power-on (RESTART, STOP while playing, as CPU). Clock registers not as the boot stage leaves them: not switched, the header says NO 320 MHZ and why, the row REFUSED; a reset during the switch is no failed boot, and no switch is tried again until power-off; a soft reset keeps the PLL, and a kept 320 is not switched again. ABOUT shows the clock (CPU 320 MHZ), the console's `status` cpu_mhz, clk320 and the loop-measured clk320_loop_mhz.
|
||||
- CLOCK, MIDI IN and TUNE are the unit's (`ui.c` `unit_g_*`, settings bytes [15][18..20]): a project still stores them (for older firmware) but a load leaves them; the first boot with U3 takes the restored session's.
|
||||
- **Sentence case** for the lines that explain, as the mockup's dialog and TAKE box: recording starts after 1, list ALL to add sounds, teach each button and knob. Titles, labels, values and key hints stay in capitals.
|
||||
- **Track numbers** (`icons.c` `cv_trk`): no cushions. The number stands alone in its track's colour, as on the HOME lanes: V where Felucca's 16 px cushion went (footer, MIXER, the GLO layer's SOLO keys), M where its 12 px one went (the GLO cards, the layers' mute keys). It's INK on a light tile or a held key, and DIM for a silent track. The TAKE box's chip, the number on its colour, is the one square, as in the mockup.
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
Two files of the firmware's HAL are curist's fm1-clk320-probe
|
||||
<https://github.com/curist/fm1-clk320-probe> (MIT), unchanged:
|
||||
|
||||
- firmware/hal/fm1_clk320.h, the switch from the FM-1's 360 MHz to JieLi's rated 320 MHz: the check
|
||||
of the clock registers and the switch itself, after the JieLi AC79 SDK's sys_clock_update
|
||||
(Apache-2.0)
|
||||
- firmware/hal/fm1_clk320_probe.h, its reason codes and a loop timed against the crystal
|
||||
|
||||
Skiff runs them at boot when MENU > SYSTEM > CPU CLOCK is 320 MHZ (firmware/hal/fm1_clk.h,
|
||||
firmware/src/main.c). The two files stay under the MIT licence below; the rest of Skiff is
|
||||
GPL-3.0-only (LICENSE). The files carry no copyright line of their own: their author is curist,
|
||||
2026, and their header asks that the JieLi credit be kept.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
fm1-clk320-probe: fm1_clk320.h and fm1_clk320_probe.h, by curist (2026)
|
||||
|
||||
Published under the MIT license (SPDX-License-Identifier: MIT):
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
@@ -23,8 +23,9 @@ Every file in this tree that carries an `SPDX-License-Identifier: GPL-3.0-only`
|
||||
|
||||
Three source files are ports and keep the licence of their originals:
|
||||
`firmware/src/phys_dsp.c` (DaisySP, MIT), `firmware/src/phys_symp.c` (Rings, MIT) and
|
||||
`firmware/src/fm6_core.c` (msfa, Apache-2.0). The firmware built with them is GPL-3.0-only as
|
||||
a whole.
|
||||
`firmware/src/fm6_core.c` (msfa, Apache-2.0); two are another project's, unchanged, under its
|
||||
licence: `firmware/hal/fm1_clk320.h` and `firmware/hal/fm1_clk320_probe.h` (fm1-clk320-probe,
|
||||
MIT). The firmware built with them is GPL-3.0-only as a whole.
|
||||
|
||||
You may use, study, change and share Skiff under the GPL. If you distribute Skiff, or
|
||||
firmware derived from it, you must also give your recipients its complete corresponding
|
||||
@@ -64,6 +65,7 @@ made: `assets/breaks/ATTRIBUTION.txt`).
|
||||
| X0X by charlesvestal (<https://github.com/charlesvestal/fm1-x0x>), a Felucca fork: the design of the browser emulator (the worklet, the device clock driven by its audio, the exports); its files credit it in their headers | GPL-3.0 | `web/emu/` |
|
||||
| The second core (Skiff 1.3), as Felucca 1.6.1 has it (<https://github.com/hugelton/Felucca>, commit a53ecf4, by Leo Kuroshita and gospodindilly-ops): its start, mailbox and hold from X0X by charlesvestal (`hal/fm1_cpu1.h`, `hal/fm1_cpu1.S`, unchanged), after Melodee by Kerem Kilic (<https://github.com/keremimo/melodee>) and with Jangada's measurements and hardening by zednaked (<https://github.com/zednaked/jangada>); the render split and its host tests adapted to Skiff's six tracks | GPL-3.0-only (X0X, Melodee, Jangada: GPL-3.0) | `firmware/hal/fm1_cpu1.h`, `firmware/hal/fm1_cpu1.S`, `firmware/src/fx.c`, `tests/c1_host.h`, `tests/dualcore_test.c` |
|
||||
| DotGothic16 font by The DotGothic16 Project Authors (<https://github.com/fontworks-fonts/DotGothic16>): the browser emulator's knob labels, served with its page (cut to printable ASCII; the font declares no Reserved Font Name) | SIL OFL 1.1 | `web/emu/fonts/DotGothic16-subset.woff`, `LICENSES/OFL-DotGothic16.txt` (also `web/emu/fonts/OFL.txt`) |
|
||||
| fm1-clk320-probe by curist (<https://github.com/curist/fm1-clk320-probe>): the switch from the FM-1's 360 MHz to JieLi's rated 320 MHz behind MENU > SYSTEM > CPU CLOCK (the check of the clock registers, the switch, its reason codes and a crystal-timed clock loop), unchanged; its sequence after the JieLi AC79 SDK's `sys_clock_update` (Apache-2.0) | MIT | `firmware/hal/fm1_clk320.h`, `firmware/hal/fm1_clk320_probe.h`, `LICENSES/MIT-fm1-clk320.txt` |
|
||||
| JieLi AC79 SDK by JieLi Technology: three of its files go into every `.fwsc` package (below); none are in this tree | Apache-2.0 | `LICENSES/Apache-2.0.txt` |
|
||||
|
||||
On the device, HOME held > ABOUT opens the information screen; turning PRESETS scrolls on into
|
||||
|
||||
@@ -14,7 +14,9 @@ synths and drums, patterns and songs, live performance, and a screen that shows
|
||||
<img src="https://img.shields.io/badge/hardware-M--VAVE%20FM--1-555" alt="Hardware: M-VAVE FM-1">
|
||||
</p>
|
||||
|
||||
<p align="center"><b>New in 1.3:</b> the FM-1's second core (BETA: 12 voices), MIDI LEARN and a channel per track,
|
||||
<p align="center"><b>New in 1.3.1:</b> a 320 MHz CPU CLOCK to choose (the chip's rated clock), and fixes from your
|
||||
comments · <a href="https://github.com/illuminus5/skiff/releases/tag/v1.3.1">the release notes</a><br>
|
||||
<b>New in 1.3:</b> the FM-1's second core (BETA: 12 voices), MIDI LEARN and a channel per track,
|
||||
an INSERT effect, LFO sync, SPREAD and more from Felucca 1.6.1 ·
|
||||
<a href="https://github.com/illuminus5/skiff/releases/tag/v1.3">the release notes</a></p>
|
||||
|
||||
@@ -43,12 +45,12 @@ Custom firmware, at your own risk; the way back to the official firmware is belo
|
||||
connect the FM-1 by USB and follow it. The same page takes the FM-1 back to the official V15 firmware, saving a
|
||||
complete backup of your music first.
|
||||
|
||||
**With Python 3:** download `skiff-1.3.fwsc` from the [latest release](https://github.com/illuminus5/skiff/releases/latest)
|
||||
**With Python 3:** download `skiff-1.3.1.fwsc` from the [latest release](https://github.com/illuminus5/skiff/releases/latest)
|
||||
and, with this repository's `tools/` folder,
|
||||
|
||||
```
|
||||
pip install mido python-rtmidi
|
||||
python tools/fm1_install.py skiff-1.3.fwsc
|
||||
python tools/fm1_install.py skiff-1.3.1.fwsc
|
||||
```
|
||||
|
||||
It takes about two minutes and the FM-1 restarts on Skiff.
|
||||
@@ -308,7 +310,10 @@ FM6 patches from `.syx` files and saves complete backups.
|
||||
master on a computer; channels 1–6 play tracks 1–6 (MENU › MIDI IN CH1-6), and (1.3) each track can listen on a
|
||||
channel of its own (MENU › MIDI › T1–T6 CHANNEL); clock from internal, USB or TRS. **MIDI LEARN** (1.3): MENU › MIDI
|
||||
› MIDI LEARN, turn a knob, send a CC: the controller sets that parameter, up to 10 of them; **Program Change** (1.3)
|
||||
loads the track's nth preset
|
||||
loads the track's nth preset. **Standard CCs**, each on the track its channel plays (recorded as automation while it's
|
||||
armed): CC7 LEVEL, CC10 PAN, CC5 GLIDE, CC73 ATTACK, CC75 DECAY, CC72 RELEASE, CC74 the engine's brightness (ANALOG's
|
||||
CUTOFF ..), CC71 its resonance, CC91 REVERB, CC93 CHORUS, CC94 DELAY; CC1 mod wheel and CC11 expression (MOD sources),
|
||||
CC64 sustain
|
||||
|
||||
### Patterns, lists and the song
|
||||
|
||||
@@ -498,6 +503,10 @@ every setting back as a new unit has it. The web editor's Settings tab reads and
|
||||
every block, the sound bit for bit the same, and up to 12 voices sound at once instead of 8. If the second core
|
||||
misreads or stops answering (some units do), the FM-1 goes on with one core, says CORE 2 FAILED and sets the row
|
||||
back to 1 CORE
|
||||
- **CPU CLOCK** (SYSTEM, 1.3.1): **360 MHZ** (default: what the FM-1's boot sets) or **320 MHZ**, the clock JieLi rates
|
||||
the chip for (curist's switch, no voltage changed). It takes effect at the next power-on, as CPU does (STOP, then
|
||||
RESTART). 320 is about 11 % slower: the same music shows a higher CPU. A unit whose clock is set up differently
|
||||
refuses it and says why (NO 320 MHZ: ...). ABOUT shows the clock the FM-1 runs at
|
||||
- **HINTS** (DISPLAY): ON or OFF; OFF drops the one line of hint (HOLD HOME: SHIFT, KEYS: STEPS, a layer's
|
||||
first HOLD [X]: SHORTCUTS) and SHIFT's map; what OCT+ and OCT- do on an action page stays
|
||||
- **RESET SETTINGS** (SYSTEM): OCT+ asks, then puts every MENU setting back as a new unit has it (the channels too, and
|
||||
@@ -595,6 +604,8 @@ Skiff stands on Felucca. If it is useful to you, support Felucca's author:
|
||||
after [Melodee](https://github.com/keremimo/melodee) by [keremimo](https://github.com/keremimo) and with
|
||||
[Jangada](https://github.com/zednaked/jangada)'s measurements and hardening by [zednaked](https://github.com/zednaked) (all GPL-3.0);
|
||||
its host tests by gospodindilly-ops
|
||||
- 320 MHz (MENU › SYSTEM › CPU CLOCK): the switch from [fm1-clk320-probe](https://github.com/curist/fm1-clk320-probe)
|
||||
by [curist](https://github.com/curist) ([MIT](LICENSES/MIT-fm1-clk320.txt)), after the JieLi AC79 SDK's clock code (Apache-2.0)
|
||||
- Package format and boot files: [JieLi AC79 SDK](https://gitee.com/Jieli-Tech/fw-AC79_AIoT_SDK) ([Apache-2.0](LICENSES/Apache-2.0.txt); three of its files are in every package, none in this tree)
|
||||
- Contributions to Felucca: [keremimo](https://github.com/keremimo) (white-key scales, #2), [ChanceTheMaker](https://github.com/ChanceTheMaker)
|
||||
(TRS MIDI, bend, sustain and clock, palettes, favourites, editor display settings: #8, #10, #11, #12),
|
||||
|
||||
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -0,0 +1,48 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only */
|
||||
/* (Skiff) The core clock: what runs now, and MENU > SYSTEM > CPU CLOCK 320 MHZ's switch at boot (main.c).
|
||||
* The boot stage M-VAVE's V15 update installed runs SYS at 360 MHz (PLL2's VCO 540 MHz x 2/3; HSB 180, LSB 60); JieLi
|
||||
* rates the chip for 320. fm1_clk320.h and fm1_clk320_probe.h are curist's (github.com/curist/fm1-clk320-probe, MIT; the
|
||||
* sequence after the JieLi AC79 SDK's sys_clock_update, Apache-2.0), unchanged: the check of the clock registers, the
|
||||
* switch to the SDK's 320 MHz row (HSB 160, SFC 80, LSB 53: RAM code, the cache and the flash controller stopped around
|
||||
* the PLL change and retimed after it; no voltage touched), its reasons, a loop timed against the crystal. A soft reset
|
||||
* keeps the PLL where it is; a power-on brings back the boot stage's 360. USB and the TRS UART run on PLL48M and the
|
||||
* timers on the crystal (unchanged); the LCD's SPI is LSB / 5: 10.7 MHz at 320 (12 at 360).
|
||||
* fm1_clk_mhz() the core clock now, from the PLL registers (0: SYS is not on PLL2's VCO x 2/3)
|
||||
* fm1_sfc_baud() the flash controller's divider (XIP runs at HSB / (n + 1))
|
||||
* fm1_clk320_go(t) 360 -> 320 now: checked, switched with IRQs off, verified; t[0], t[1] the loop's crystal ticks
|
||||
* before and after (360 x t[0] / t[1]: the clock it runs at). 0 = done; else FM1_CLK320_E*, not
|
||||
* switched (EALREADY: a soft reset kept 320; EVERIFY: switched, and PLL2 is not at 240). Call it on
|
||||
* one core, before the audio, the timers and USB, with nothing reading the flash meanwhile (the
|
||||
* LCD's DMA idle) */
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include "fm1_clk320_probe.h"
|
||||
|
||||
static uint32_t fm1_clk_mhz(void)
|
||||
{
|
||||
uint32_t ref = ((FCLK_PLL_CON & 0x0C000000u) == 0x08000000u ? 40000u : 24000u) /
|
||||
(((FCLK_PLL2_CON0 >> 2) & 31u) + 2u); /* kHz */
|
||||
if ((FCLK_CLK_CON2 & 15u) != 6u || !(FCLK_CLK_CON0 & 0x100u))
|
||||
return 0;
|
||||
return (ref * fm1_clk320_mult() * 2u / 3u + 500u) / 1000u;
|
||||
}
|
||||
|
||||
/* the flash controller's clock divider: SFC = HSB / (n + 1) (the switch: 1, 80 MHz at 320; at 360 the boot stage's) */
|
||||
static uint32_t fm1_sfc_baud(void) { return FCLK_SFC_BAUD; }
|
||||
|
||||
static int fm1_clk320_go(uint32_t *t)
|
||||
{
|
||||
fm1_clk320_t p;
|
||||
uint32_t f = irq_save();
|
||||
int rc = fm1_clk320_check(&p);
|
||||
t[0] = t[1] = 0;
|
||||
if (rc == FM1_CLK320_OK) {
|
||||
t[0] = fm1_clk320_loop_ticks();
|
||||
FL_FAR(fm1_clk320_switch)(&p);
|
||||
t[1] = fm1_clk320_loop_ticks();
|
||||
if (fm1_clk320_mult() != FM1_CLK320_MULT_320)
|
||||
rc = FM1_CLK320_EVERIFY;
|
||||
}
|
||||
irq_restore(f);
|
||||
return rc;
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
/* SPDX-License-Identifier: MIT
|
||||
* SYS 360 -> 320 MHz at boot, after the JieLi AC79 SDK's sys_clock_update (Apache-2.0),
|
||||
* PLL2-VCO path with the SDK's 320 MHz row (HSB 160, SFC 80, LSB 53). */
|
||||
#define FCLK_SYS_DIV REG32(0x10008u) /* [17:16] HSB = SYS/(n+1); [10:8] LSB = HSB/(n+1) */
|
||||
#define FCLK_CLK_CON0 REG32(0x1000Cu) /* b8 SYS from the PLL (0: RC); b1 RC16M on */
|
||||
#define FCLK_CLK_CON2 REG32(0x10014u) /* [3:0] SYS source: 6 = PLL2 VCO * 2/3 */
|
||||
#define FCLK_PLL_CON REG32(0x119A0u) /* [27:26] = 2: 40 MHz reference, else 24 MHz */
|
||||
#define FCLK_PLL2_CON0 REG32(0x119A8u) /* [6:2] reference divider - 2 */
|
||||
#define FCLK_PLL2_CON1 REG32(0x119ACu) /* [11:0] VCO multiplier - 2 */
|
||||
#define FCLK_USB_CON0 REG32(0x16A00u)
|
||||
#define FCLK_USB_CLK REG32(0x16A08u) /* [4:3] = 3: USB clocked from PLL2 */
|
||||
#define FCLK_SDR_CON0 REG32(0x40400u) /* b11: SDRAM in use */
|
||||
#define FCLK_SDR_CON1 REG32(0x40404u)
|
||||
#define FCLK_PSR_CON REG32(0x40500u) /* b0: the SDK sets cache b9 back if set */
|
||||
#define FCLK_SFC_BAUD REG32(0x40204u) /* SFC clock = HSB / (n + 1) */
|
||||
|
||||
typedef struct { uint32_t pll2_con1, sys_div, sfc_baud, sfc_con, cache_b9; } fm1_clk320_t;
|
||||
|
||||
static inline uint32_t fm1_clk320_mult(void) { return (FCLK_PLL2_CON1 & 0xFFFu) + 2u; }
|
||||
|
||||
/* 0 = the expected state; fills p. Any other value: do not switch. */
|
||||
static int fm1_clk320_check(fm1_clk320_t *p)
|
||||
{
|
||||
uint32_t osc = (FCLK_PLL_CON & 0x0C000000u) == 0x08000000u ? 40000000u : 24000000u;
|
||||
uint32_t ref = osc / (((FCLK_PLL2_CON0 >> 2) & 31u) + 2u);
|
||||
uint32_t div = FCLK_SYS_DIV, cache = CACHE_CON, n;
|
||||
if (fm1_clk320_mult() == 240u) return 1; /* already 320 (a soft reset keeps the PLL) */
|
||||
if ((FCLK_CLK_CON2 & 15u) != 6u) return 2; /* SYS not on PLL2 VCO * 2/3 */
|
||||
if (fm1_clk320_mult() != 270u) return 3; /* not the boot loader's 360 */
|
||||
if (ref != 2000000u) return 4;
|
||||
if (((div >> 16) & 3u) != 1u || ((div >> 8) & 7u) != 2u) return 5; /* HSB /2, LSB /3 */
|
||||
if (!(FCLK_CLK_CON0 & 0x100u)) return 6; /* SYS not on the PLL */
|
||||
if ((FCLK_USB_CLK & 0x18u) == 0x18u) return 7; /* USB on PLL2 */
|
||||
if (FCLK_SDR_CON0 & 0x800u) return 8; /* SDRAM */
|
||||
p->cache_b9 = ((FCLK_PSR_CON & 1u) ? 0x200u : 0u) | (cache & 0x200u); /* keep the boot loader's b9 */
|
||||
p->sys_div = (div & ~0x30000u & ~0x700u) | 0x10000u | 0x200u; /* HSB 320/2, LSB 160/3 */
|
||||
p->sfc_baud = 1u; /* SFC 160/2 = 80 */
|
||||
p->pll2_con1 = (FCLK_PLL2_CON1 & ~0xFFFu) | ((480000000u / ref + 4094u) & 0xFFFu); /* VCO 480 */
|
||||
n = 160u * 45u; /* CS high 45 ns in 160 MHz cycles, rounded up */
|
||||
n = n / 1000u + (n % 1000u != 0u);
|
||||
p->sfc_con = (SFC_CON & ~0xF00000u) | (((n + 1u) << 20) & 0xF00000u);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define FCLK_SYNC() __asm__ volatile("csync" ::: "memory")
|
||||
#define FCLK_WAIT_CACHE() do {} while (!(CACHE_CON & (1u << 14)))
|
||||
#define FCLK_WAIT_SFC() do {} while (SFC_CON & 0x80000000u)
|
||||
static inline __attribute__((always_inline)) void fclk_spin(uint32_t n)
|
||||
{
|
||||
volatile uint32_t k = n + 1u;
|
||||
while (--k)
|
||||
__asm__ volatile("nop");
|
||||
}
|
||||
|
||||
/* RAM only, IRQs off, second core not running: no flash fetch from here to the end */
|
||||
static RAMFN void fm1_clk320_switch(const fm1_clk320_t *p)
|
||||
{
|
||||
uint32_t pll2 = p->pll2_con1, sdiv = p->sys_div, baud = p->sfc_baud, scon = p->sfc_con, b9 = p->cache_b9;
|
||||
uint32_t usb = FCLK_USB_CON0, sdr = FCLK_SDR_CON1, con2 = FCLK_CLK_CON2, r = FCLK_CLK_CON0;
|
||||
if (r & 0x100u) { /* SYS onto RC16M */
|
||||
r = (r | 2u) & ~0x100u;
|
||||
FCLK_SYNC(); FCLK_WAIT_CACHE(); FCLK_SYNC(); FCLK_WAIT_SFC();
|
||||
FCLK_CLK_CON0 = r;
|
||||
FCLK_SYNC(); fclk_spin(300);
|
||||
}
|
||||
FCLK_SYNC(); FCLK_WAIT_CACHE(); CACHE_CON &= ~0x300u; /* cache off */
|
||||
FCLK_SYNC(); FCLK_WAIT_SFC(); SFC_CON &= ~1u; /* flash controller off */
|
||||
FCLK_SYNC(); fclk_spin(60u * 4u); /* 60 us at RC16M, x2 margin */
|
||||
FCLK_USB_CON0 = usb; /* the SDK's write order */
|
||||
FCLK_SDR_CON1 = sdr;
|
||||
FCLK_PLL2_CON1 = pll2;
|
||||
FCLK_CLK_CON2 = con2;
|
||||
FCLK_SYS_DIV = sdiv;
|
||||
FCLK_SYNC(); fclk_spin(1000u * 4u); /* 1 ms: the PLL settles */
|
||||
FCLK_SYNC(); FCLK_WAIT_CACHE(); FCLK_SYNC(); FCLK_WAIT_SFC();
|
||||
FCLK_SFC_BAUD = baud; /* flash controller back, retimed */
|
||||
SFC_CON = scon;
|
||||
FCLK_SYNC(); fclk_spin(60u * 4u);
|
||||
CACHE_CON |= 0x100u | b9; /* cache back */
|
||||
FCLK_SYNC();
|
||||
r = FCLK_CLK_CON0;
|
||||
if (!(r & 0x100u)) { /* SYS back onto the PLL */
|
||||
r |= 0x100u;
|
||||
FCLK_SYNC(); FCLK_WAIT_CACHE(); FCLK_SYNC(); FCLK_WAIT_SFC();
|
||||
FCLK_CLK_CON0 = r;
|
||||
FCLK_SYNC(); fclk_spin(300);
|
||||
}
|
||||
}
|
||||
|
||||
/* at boot, before the second core and any peripheral start:
|
||||
* fm1_clk320_t p;
|
||||
* if (fm1_clk320_check(&p) == 0) { irqs off; FL_FAR(fm1_clk320_switch)(&p); irqs back; }
|
||||
* then fm1_clk320_mult() == 240 means 320 MHz */
|
||||
@@ -0,0 +1,54 @@
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
/* PROBE BUILD (fm1-clk320-probe): what the probe adds around fm1_clk320.h, which is the study's published listing
|
||||
* (MIT) byte for byte, so the soak tests exactly the code others copy. fm1_clk320.h needs RAMFN, REG32,
|
||||
* SFC_CON and CACHE_CON (fm1_flash.h) and uint32_t before it.
|
||||
*
|
||||
* FM1_CLK320_E* fm1_clk320_check's return values, named for the report
|
||||
* fm1_clk320_loop_ticks() the core clock without the cycle counter: TIMER4 ticks (the crystal) for
|
||||
* 4000 passes of 64 dependent adds, the best of three. Timed before and after
|
||||
* the switch in one boot, the ratio is the clock ratio. IRQs off. */
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include "fm1_flash.h" /* RAMFN, RAMINL, FL_FAR, REG32, SFC_CON, CACHE_CON */
|
||||
#include "fm1_time.h" /* fm1_ticks: TIMER4, 24 MHz from the crystal */
|
||||
#include "fm1_clk320.h"
|
||||
|
||||
#define FM1_CLK320_MULT_360 270u
|
||||
#define FM1_CLK320_MULT_320 240u
|
||||
|
||||
enum {
|
||||
FM1_CLK320_OK = 0,
|
||||
FM1_CLK320_EALREADY, /* PLL2 already at 240 (a soft reset kept a switch) */
|
||||
FM1_CLK320_EMODE, /* SYS not on PLL2 VCO * 2/3 */
|
||||
FM1_CLK320_EMULT, /* PLL2 not at 270 */
|
||||
FM1_CLK320_EREF, /* PLL2 reference not 2 MHz */
|
||||
FM1_CLK320_EDIV, /* HSB / LSB dividers not /2 /3 */
|
||||
FM1_CLK320_ESRC, /* SYS not on the PLL (CLK_CON0 b8) */
|
||||
FM1_CLK320_EUSB, /* USB clocked from PLL2 */
|
||||
FM1_CLK320_ESDRAM, /* SDRAM in use */
|
||||
FM1_CLK320_ECACHE, /* (unused since the listing keeps cache b9) */
|
||||
FM1_CLK320_EVERIFY, /* (plat_fm1.c) PLL2 not at 240 after the switch */
|
||||
FM1_CLK320_ECONTROL, /* (plat_fm1.c) the control build: checked, not switched */
|
||||
};
|
||||
|
||||
static __attribute__((noinline)) uint32_t fclk_adds(uint32_t passes)
|
||||
{
|
||||
uint32_t x = 0;
|
||||
while (passes--)
|
||||
__asm__ volatile(".rept 64\n\t%0 = %0 + 1\n\t.endr" : "+r"(x));
|
||||
return x;
|
||||
}
|
||||
|
||||
static uint32_t fm1_clk320_loop_ticks(void)
|
||||
{
|
||||
uint32_t best = ~0u, t, k;
|
||||
fclk_adds(4); /* the loop into the cache */
|
||||
for (k = 0; k < 3u; k++) {
|
||||
t = fm1_ticks();
|
||||
fclk_adds(4000);
|
||||
t = fm1_ticks() - t;
|
||||
if (t < best)
|
||||
best = t;
|
||||
}
|
||||
return best;
|
||||
}
|
||||
@@ -209,6 +209,18 @@ static void con_status(void)
|
||||
con_kv("cpu2_wait_max_us", (int32_t)(fm1_c1_wait_max / 24u));
|
||||
con_kv("cpu2_stack", (int32_t)fm1_cpu1_stack_used());
|
||||
#endif
|
||||
{ /* (Skiff) the core clock now, from the PLL (hal/fm1_clk.h); MENU > CPU CLOCK; what this boot's switch did (main.c),
|
||||
* and the clock after it by the crystal-timed loop (0: none this boot) */
|
||||
static const char *const N[6] = {"-", "ARMED", "SWITCHED", "KEPT", "REFUSED ", "TRIPPED"};
|
||||
con_kv("cpu_mhz", (int32_t)CLK_MHZ());
|
||||
con_kv("clk320_set", CLK320_SET);
|
||||
con_puts("clk320 ");
|
||||
con_puts(N[clk320.state % 6u]);
|
||||
con_puts(clk320.state == CLK_REFUSED ? CLK_WHY[clk320.why % NELEM(CLK_WHY)] : "");
|
||||
con_puts("\r\n");
|
||||
con_kv("clk320_loop_mhz", clk320.loop_mhz);
|
||||
con_kv("sfc_mhz", (int32_t)(CLK_MHZ() / 2u / (fm1_sfc_baud() + 1u))); /* the flash (XIP): HSB (SYS / 2) / (n + 1) */
|
||||
}
|
||||
con_kv("voices_given_up", (int32_t)voice_kills);
|
||||
con_kv("track", (int32_t)song.sel + 1);
|
||||
con_kv("batt_raw", song.batt_raw);
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#define FELUCCA_ID "FM-1_700" /* package identity (build.py: the .fwsc marker string) */
|
||||
#endif
|
||||
#ifndef FELUCCA_VERSION
|
||||
#define FELUCCA_VERSION "v1.3" /* Skiff's; shown in the menu, the console and the editor; build.py --release X.Y */
|
||||
#define FELUCCA_VERSION "v1.3.1" /* Skiff's; shown in the menu, the console and the editor; build.py --release X.Y */
|
||||
#endif
|
||||
#if FELUCCA_OTA && !FELUCCA_FLASH
|
||||
#error "FELUCCA_OTA needs FELUCCA_FLASH"
|
||||
@@ -74,6 +74,8 @@ static inline __attribute__((always_inline)) void *audio_far(void *p) { void *vo
|
||||
#include "fm1_audio.h"
|
||||
#include "fm1_adc.h"
|
||||
#include "fm1_lcd_hw.h"
|
||||
#include "fm1_clk.h" /* (Skiff) the core clock; MENU > CPU CLOCK 320 MHZ's switch (main.c) */
|
||||
#define CLK_MHZ() fm1_clk_mhz() /* the core clock now (ui.c: 360 elsewhere) */
|
||||
#include "felucca_tables.h" /* generated by build.py (tools/gen_tables.py) */
|
||||
|
||||
/* ----------------------------------------------------- base, display --- */
|
||||
|
||||
@@ -173,6 +173,21 @@ static void fm1_main(void)
|
||||
felucca_dbg.prev_home = felucca_dbg.home;
|
||||
felucca_dbg.prev_frames = felucca_dbg.ui_frames;
|
||||
felucca_dbg.prev_rst = fm1_boot.p3_rst;
|
||||
if (CLK320_SET && !bootguard.failed && clk320.state != CLK_TRIPPED) {
|
||||
/* (Skiff) MENU > CPU CLOCK 320 MHZ: from the boot stage's 360 to JieLi's rated 320 (hal/fm1_clk.h, curist's
|
||||
* switch), the screen up, on one core, before the scan, the second core, the audio and USB. Not after a failed
|
||||
* boot, nor again before a power-off after a reset during it (fm1_cstart: TRIPPED); a soft reset that kept 320
|
||||
* is not switched again (the check: EALREADY). Any other register not as expected: refused, said (below) */
|
||||
uint32_t t[2];
|
||||
lcd_sync(); /* (no LCD DMA through it) */
|
||||
clk320.state = CLK_ARMED;
|
||||
fm1_wdt_feed();
|
||||
clk320.why = (uint8_t)fm1_clk320_go(t);
|
||||
fm1_wdt_feed();
|
||||
clk320.state = !clk320.why ? CLK_ON : clk320.why == FM1_CLK320_EALREADY ? CLK_KEPT : CLK_REFUSED;
|
||||
if (t[1]) /* (the loop timed before and after: the clock it runs at) */
|
||||
clk320.loop_mhz = (uint16_t)((360u * t[0] + t[1] / 2u) / t[1]);
|
||||
}
|
||||
fm1_input_init();
|
||||
fm1_adc_init();
|
||||
panel_init();
|
||||
@@ -220,6 +235,10 @@ static void fm1_main(void)
|
||||
kb_boot_hold = 0;
|
||||
lcd_fill(0, 0, 240, 240, T_BG);
|
||||
scrn.idle = fm1_ms; /* (MENU > SCREEN OFF: from here) */
|
||||
if (clk320.state == CLK_REFUSED) /* (Skiff) MENU > CPU CLOCK 320 MHZ not switched, then why */
|
||||
ui_way("NO 320 MHZ", CLK_WHY[clk320.why % NELEM(CLK_WHY)]);
|
||||
else if (clk320.state == CLK_TRIPPED && CLK320_SET)
|
||||
ui_way("NO 320 MHZ", "RESET IN SWITCH");
|
||||
|
||||
for (;;) {
|
||||
uint32_t m = fm1_ms;
|
||||
@@ -343,6 +362,16 @@ void fm1_cstart(void)
|
||||
bootguard.failed = 0;
|
||||
bootguard.pending = 0;
|
||||
}
|
||||
if (((p3 & 1u) && !(p3 & 0x44u)) || clk320.magic != CLK320_MAGIC) /* ((Skiff) a power-on, no watchdog or soft
|
||||
* reset: the boot stage's 360 MHz again) */
|
||||
clk320.state = CLK_NONE;
|
||||
clk320.magic = CLK320_MAGIC;
|
||||
if (clk320.state == CLK_ARMED) /* a reset during the 320 MHz switch (fm1_main): not a failed boot, and
|
||||
* no switch till power-off (curist's probe does the same) */
|
||||
bootguard.pending = 0;
|
||||
clk320.state = clk320.state == CLK_ARMED || clk320.state == CLK_TRIPPED ? CLK_TRIPPED : CLK_NONE;
|
||||
clk320.why = 0;
|
||||
clk320.loop_mhz = 0;
|
||||
if (bootguard.pending)
|
||||
bootguard.failed++;
|
||||
bootguard.pending = 1;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* value (MI_VALUES: the rows before them hold one). 1.0.5: in four tabs (MI_TAB). */
|
||||
enum { MI_COLOR, MI_LARGE, MI_ANIM, MI_LEDS, MI_SCROFF, MI_HINTS, MI_HOLD, MI_ACCEL, MI_BPMLOCK, MI_SCLLED, MI_PREVIEW,
|
||||
MI_LOWCUT, MI_USB, MI_CLICK, MI_CLKLVL, MI_COUNTIN, MI_TUNE, MI_CLOCK, MI_ROUTE,
|
||||
MI_LEARN, MI_LCLEAR, MI_TCH1, MI_TCH2, MI_TCH3, MI_TCH4, MI_TCH5, MI_TCH6, MI_SERIAL, MI_RESTORE, MI_CPU, MI_PANEL,
|
||||
MI_LEARN, MI_LCLEAR, MI_TCH1, MI_TCH2, MI_TCH3, MI_TCH4, MI_TCH5, MI_TCH6, MI_SERIAL, MI_RESTORE, MI_CPU, MI_CLK, MI_PANEL,
|
||||
MI_RESET, MI_ABOUT, MI_COUNT }; /* ((Skiff U4, A3) HINTS; RESET SETTINGS, a row with no value: its dialog) */ /* ((Skiff U3, R8, R2) CLOCK, MIDI IN, TUNE: the unit's, GLOBAL's and SYSTEM's before; CPU: read) */ /* (1.1: the metronome's rows in
|
||||
* AUDIO; 1.2: RESTORE LAST in SYSTEM, SCALE LEDS
|
||||
* in CONTROL) */
|
||||
@@ -18,7 +18,7 @@ static const char *const MI_NAME[MI_COUNT] = {"THEME", "LARGE", "ANIM", "LEDS",
|
||||
"SPEAKER EQ", "USB LEVEL", "CLICK", "CLICK LEVEL", "COUNT-IN", "TUNE",
|
||||
"CLOCK", "MIDI IN", "MIDI LEARN", "LEARN CLEAR",
|
||||
"T1 CHANNEL", "T2 CHANNEL", "T3 CHANNEL", "T4 CHANNEL", "T5 CHANNEL", "T6 CHANNEL",
|
||||
"USB SERIAL", "RESTORE LAST", "CPU", "CALIBRATION", "RESET SETTINGS",
|
||||
"USB SERIAL", "RESTORE LAST", "CPU", "CPU CLOCK", "CALIBRATION", "RESET SETTINGS",
|
||||
"ABOUT"};
|
||||
/* 1.0.5: the MENU's tabs (ui_menu.c: ALGORITHM steps between them, PRESETS among one tab's rows; the editor gets a
|
||||
* row's tab after its MENU_DESC reply). A tab's rows follow each other in MI order (tests/ui_test.c checks it); the
|
||||
@@ -44,8 +44,9 @@ static const uint8_t MI_TAB[MI_COUNT] = {
|
||||
* CONTROL) */
|
||||
MTAB_MIDI, MTAB_MIDI, /* (1.3) MIDI LEARN, LEARN CLEAR */
|
||||
MTAB_MIDI, MTAB_MIDI, MTAB_MIDI, MTAB_MIDI, MTAB_MIDI, MTAB_MIDI, /* (1.3) T1..T6 CHANNEL */
|
||||
MTAB_SYSTEM, MTAB_SYSTEM, MTAB_SYSTEM, MTAB_SYSTEM, MTAB_SYSTEM, MTAB_SYSTEM, /* USB SERIAL, RESTORE LAST, (Skiff U3)
|
||||
* CPU, CALIBRATION, (U4) RESET SETTINGS, ABOUT */
|
||||
MTAB_SYSTEM, MTAB_SYSTEM, MTAB_SYSTEM, MTAB_SYSTEM, /* USB SERIAL, RESTORE LAST, (Skiff U3) CPU,
|
||||
* (Skiff) CPU CLOCK (SYSTEM's seven scroll) */
|
||||
MTAB_SYSTEM, MTAB_SYSTEM, MTAB_SYSTEM, /* CALIBRATION, (U4) RESET SETTINGS, ABOUT */
|
||||
};
|
||||
typedef char mtab_fits_ui[sizeof ui.menu_row >= MTAB_COUNT ? 1 : -1]; /* (ui.c: the row last picked per tab) */
|
||||
static uint32_t mtab_first(uint32_t t) /* a tab's first row */
|
||||
@@ -150,6 +151,7 @@ static uint32_t menu_get(uint32_t row)
|
||||
#if FELUCCA_CPU2
|
||||
case MI_CPU: return CPU2_SET ? 1u : 0u; /* ((Skiff 1.3) 1 CORE, 2 CORES (BETA): from the next power-on) */
|
||||
#endif
|
||||
case MI_CLK: return CLK320_SET ? 1u : 0u; /* ((Skiff) 360 MHZ, 320 MHZ: from the next power-on) */
|
||||
case MI_LEDS:
|
||||
while (i + 1u < LEDS_COUNT && LEDS_MENU[i] != settings_leds)
|
||||
i++;
|
||||
@@ -210,6 +212,16 @@ static const char *menu_vname(uint32_t row, uint32_t v)
|
||||
str_cpy(b + str_len(b), row == MI_TUNE ? " CT" : " %", sizeof b - str_len(b));
|
||||
return b;
|
||||
}
|
||||
case MI_CLK: { /* ((Skiff) "320 MHZ"; set another way than this power-on runs, as
|
||||
* CPU's: ": RESTART" (playing ": STOP"), and 320 refused at boot
|
||||
* (main.c; its header message said why): ": REFUSED" */
|
||||
static char m[20] __attribute__((section(".pool")));
|
||||
str_cpy(m, v ? "320 MHZ" : "360 MHZ", sizeof m);
|
||||
if (CLK_MHZ() != (v ? 320u : 360u))
|
||||
str_cpy(m + str_len(m), transport_busy() ? ": STOP" : v && clk320.state >= CLK_REFUSED ? ": REFUSED" :
|
||||
": RESTART", sizeof m - str_len(m));
|
||||
return m;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@@ -258,6 +270,11 @@ static void menu_put(uint32_t row, uint32_t v)
|
||||
* at STOP, and the row says STOP till then) */
|
||||
break;
|
||||
#endif
|
||||
case MI_CLK: /* ((Skiff) the clock: switched at boot only, main.c; saved as CPU) */
|
||||
if (favorites.factory[15][24] == 0xA5u)
|
||||
CPU2_BYTE = (uint8_t)(v ? CPU2_BYTE | 4u : CPU2_BYTE & ~4u);
|
||||
settings_save();
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* (Skiff U4, the review's A3) MENU > SYSTEM > RESET SETTINGS, after its dialog (ui_input.c): every MENU setting as a new
|
||||
@@ -289,6 +306,7 @@ static void settings_reset(void)
|
||||
#if FELUCCA_CPU2
|
||||
menu_put(MI_CPU, 0); /* ((Skiff 1.3) 1 CORE) */
|
||||
#endif
|
||||
menu_put(MI_CLK, 0); /* ((Skiff) 360 MHZ) */
|
||||
settings_save();
|
||||
}
|
||||
/* the menu's step, any of KNOB 1..4 or OCT+ (s > 0) / OCT- (s < 0): the next / previous value, stopping at the ends;
|
||||
|
||||
@@ -97,6 +97,19 @@ static uint32_t up_gen; /* bumped on every user bank change
|
||||
#define CPU2_BYTE (favorites.factory[15][5])
|
||||
#define CPU2_SET (favorites.factory[15][24] == 0xA5u && (CPU2_BYTE & 1u))
|
||||
#define PREVIEW_SET (favorites.factory[15][24] == 0xA5u && (CPU2_BYTE & 2u)) /* ((1.3) MENU > STEP PREVIEW ON) */
|
||||
/* (Skiff) MENU > SYSTEM > CPU CLOCK 320 MHZ: JieLi's rated clock instead of the boot stage's 360 (hal/fm1_clk.h), switched
|
||||
* at boot (main.c), bit 2 of CPU2_BYTE; clear: 360, as 1.3. clk320: what this boot did about it, kept across a soft reset
|
||||
* (which keeps the PLL), forgotten at power-on; CLK_WHY: FM1_CLK320_E*'s words (hal/fm1_clk320_probe.h) */
|
||||
#define CLK320_SET (favorites.factory[15][24] == 0xA5u && (CPU2_BYTE & 4u))
|
||||
enum { CLK_NONE, CLK_ARMED, CLK_ON, CLK_KEPT, CLK_REFUSED, CLK_TRIPPED }; /* (ARMED: switching; TRIPPED: a reset then, so
|
||||
* no switch till power-off) */
|
||||
#define CLK320_MAGIC 0x434C4B32u /* "CLK2" */
|
||||
struct { uint32_t magic; uint8_t state, why; uint16_t loop_mhz; } clk320 __attribute__((section(".noinit")));
|
||||
static const char *const CLK_WHY[11] = {"", "ALREADY 320", "SYS MODE", "PLL2 NOT 270", "PLL2 REF", "DIVIDERS",
|
||||
"SYS NOT ON PLL", "USB ON PLL2", "SDRAM", "CACHE B9", "VERIFY"};
|
||||
#ifndef CLK_MHZ
|
||||
#define CLK_MHZ() 360u /* the core clock now (felucca.c: the PLL's); the host, the browser */
|
||||
#endif
|
||||
/* (Skiff U3, R8) the unit's CLOCK, MIDI IN and TUNE (MENU > CONTROL, AUDIO; GLOBAL's and SYSTEM's before, saved in every
|
||||
* project, so a project load could switch the clock or the routing without a word): settings bytes no engine uses
|
||||
* ([15][18..20], free since phase 5; 0 = INT, CH1-6, 0 ct, the defaults, in every older setting). song.g[] holds them
|
||||
|
||||
@@ -66,6 +66,10 @@ static const menu_credit_t MENU_CREDITS[] = {
|
||||
{"Emilie Gillet / MIT", MC_TEXT},
|
||||
{"https://github.com/pichenettes/eurorack", MC_URL},
|
||||
{"", MC_TEXT},
|
||||
{"FM1-CLK320-PROBE", MC_TITLE}, /* (Skiff) MENU > CPU CLOCK 320 MHZ (hal/fm1_clk320.h) */
|
||||
{"curist: the 320 MHz switch / MIT, after the JieLi AC79 SDK (Apache-2.0)", MC_TEXT},
|
||||
{"https://github.com/curist/fm1-clk320-probe", MC_URL},
|
||||
{"", MC_TEXT},
|
||||
{"BARLOW CONDENSED", MC_TITLE}, /* (Skiff U1) the face on the screen (Inter Tight: not in the build) */
|
||||
{"The Barlow Project Authors", MC_TEXT},
|
||||
{"SIL Open Font License 1.1", MC_TEXT},
|
||||
@@ -125,6 +129,13 @@ static int32_t menu_document(int32_t y, int draw)
|
||||
cv_text(6, y + 38, &AF_S, "Groovebox on Felucca", T_TEXT);
|
||||
cv_text(6, y + 58, &AF_M, FELUCCA_VERSION, T_THEME);
|
||||
cv_text_r(232, y + 61, &AF_S, __DATE__, T_MID, T_BG);
|
||||
{ /* (Skiff) the core clock now, from the PLL (hal/fm1_clk.h; MENU > SYSTEM > CPU CLOCK) */
|
||||
char c[16] = "CPU ?";
|
||||
if (CLK_MHZ())
|
||||
fmt_int(c + 4, (int32_t)CLK_MHZ());
|
||||
str_cpy(c + str_len(c), " MHZ", sizeof c - str_len(c));
|
||||
cv_text_r(232, y + 82, &AF_S, c, T_MID, T_BG);
|
||||
}
|
||||
cv_text(6, y + 82, &AF_S, "Skiff: illuminus5", T_TEXT); /* (Skiff 1.0) its source (the QR), Felucca's */
|
||||
cv_text(6, y + 100, &AF_S, "Felucca (C) 2026", T_TEXT); /* credit; GPL-3.0-only */
|
||||
cv_text(6, y + 118, &AF_S, "Leo Kuroshita, H\xFCgelton", T_TEXT);
|
||||
@@ -413,7 +424,8 @@ static void draw_menu(void)
|
||||
ui_hints_off * 3079u + menu_get(MI_CPU) * 18451u + song.cpu_q8 * 100u / 256u * 12289u +
|
||||
ml_count() * 2741u + ui.ml.on * 3463u + (uint32_t)(ui_mch(0) + ui_mch(1) * 3u + ui_mch(2) * 7u + ui_mch(3) * 11u +
|
||||
ui_mch(4) * 13u + ui_mch(5) * 17u) * 5101u + /* ((1.3) LEARN's count, the tracks' channels) */
|
||||
(uint32_t)transport_busy() * 40503u; /* ((Skiff 1.3) CPU's STOP / RESTART) */
|
||||
(uint32_t)transport_busy() * 40503u + /* ((Skiff 1.3) CPU's STOP / RESTART) */
|
||||
menu_get(MI_CLK) * 30011u; /* ((Skiff) CPU CLOCK) */
|
||||
if (!ui.force && sig == ui.menu_sig) {
|
||||
if (ui.menu == 1 && mt.pos != pos0) { /* only the tabs slid: their strip */
|
||||
cv_begin(240, MP_Y - H_HEAD, T_BG);
|
||||
|
||||
@@ -1465,7 +1465,7 @@ static int test_menu_tabs(void)
|
||||
"tab gaps constant (S, LARGE)",
|
||||
ok && MTAB_COUNT == 5u && str_eq(MTAB_NAME[0], "DISPLAY") && str_eq(MTAB_NAME[MTAB_MIDI], "MIDI") &&
|
||||
mtab_rows(MTAB_DISPLAY) == 6u && mtab_rows(MTAB_CONTROL) == 5u && mtab_rows(MTAB_AUDIO) == 6u &&
|
||||
mtab_rows(MTAB_SYSTEM) == 6u && mtab_rows(MTAB_MIDI) == 10u);
|
||||
mtab_rows(MTAB_SYSTEM) == 7u && mtab_rows(MTAB_MIDI) == 10u); /* ((Skiff) SYSTEM: CPU CLOCK) */
|
||||
|
||||
ui_power_on();
|
||||
hold(B_HOME);
|
||||
@@ -1580,6 +1580,28 @@ static int test_menu_tabs(void)
|
||||
song.g[G_TUNE] = 0;
|
||||
bad += check("(U3) MENU > AUDIO > TUNE steps in cents (+2 CT); SYSTEM > CPU is read only", ok);
|
||||
#endif
|
||||
{ /* (Skiff) SYSTEM > CPU CLOCK: 360 MHZ (bit clear) / 320 MHZ, bit 2 of the CPU byte, from the next power-on (the host
|
||||
* runs at 360: RESTART; playing STOP), REFUSED after a boot that refused it; RESET SETTINGS: 360 */
|
||||
uint32_t s0, cpu = CPU2_BYTE & 3u;
|
||||
favorites.factory[15][24] = 0xA5u;
|
||||
ui.menu_sel = MI_CLK;
|
||||
frame();
|
||||
s0 = ui.menu_sig;
|
||||
ok = !CLK320_SET && str_eq(menu_vname(MI_CLK, 0), "360 MHZ") && MI_TAB[MI_CLK] == MTAB_SYSTEM;
|
||||
press(B_OCTUP);
|
||||
ok &= CLK320_SET && (CPU2_BYTE & 3u) == cpu && str_eq(menu_vname(MI_CLK, 1), "320 MHZ: RESTART") &&
|
||||
ui.menu_sig != s0;
|
||||
song.playing = 1;
|
||||
ok &= str_eq(menu_vname(MI_CLK, 1), "320 MHZ: STOP");
|
||||
song.playing = 0;
|
||||
clk320.state = CLK_REFUSED;
|
||||
ok &= str_eq(menu_vname(MI_CLK, 1), "320 MHZ: REFUSED");
|
||||
clk320.state = CLK_NONE;
|
||||
press(B_OCTDN);
|
||||
ok &= !CLK320_SET && (CPU2_BYTE & 3u) == cpu && str_eq(menu_vname(MI_CLK, 0), "360 MHZ");
|
||||
bad += check("(Skiff) MENU > SYSTEM > CPU CLOCK: 360 / 320 MHZ, a bit of its own (RESTART, STOP while playing, "
|
||||
"REFUSED)", ok);
|
||||
}
|
||||
{ /* (1.2.1) a step of TUNE, CLOCK, MIDI IN draws the row again at once, and the CPU row follows the load (their
|
||||
* values were not in the menu's signature: they stayed as drawn until the cursor moved) */
|
||||
static const uint8_t RW[] = {MI_TUNE, MI_CLOCK, MI_ROUTE};
|
||||
@@ -7016,6 +7038,9 @@ static int test_u4(void)
|
||||
ok = ui_hints_off && !msg_is("HOLD [EDIT]: SHORTCUTS");
|
||||
menu_put(MI_TUNE, 60);
|
||||
menu_put(MI_LEDS, 0);
|
||||
favorites.factory[15][24] = 0xA5u; /* ((Skiff) CPU CLOCK 320 MHZ: a bit of a byte bank.c freed) */
|
||||
menu_put(MI_CLK, 1);
|
||||
ok &= CLK320_SET;
|
||||
hold(B_HOME);
|
||||
for (i = 0; i < 12u && ui.menu_sel != MI_RESET; i++) {
|
||||
turn(EN_ALGO, 1);
|
||||
@@ -7025,8 +7050,9 @@ static int test_u4(void)
|
||||
press(B_OCTUP);
|
||||
ok &= !ui.menu && ui.confirm == CF_RESET_SET;
|
||||
press(B_OCTUP);
|
||||
bad += check("U4 A3: HINTS OFF hides the layer's first-tap hint; RESET SETTINGS asks, then the MENU's defaults (TUNE 0, LEDS DIM HI, HINTS ON)",
|
||||
ok && !ui_hints_off && song.g[G_TUNE] == 0 && settings_leds == LEDS_DIM && msg_is("SETTINGS RESET"));
|
||||
bad += check("U4 A3: HINTS OFF hides the layer's first-tap hint; RESET SETTINGS asks, then the MENU's defaults (TUNE 0, LEDS DIM HI, HINTS ON, "
|
||||
"(Skiff) CPU CLOCK 360 MHZ)",
|
||||
ok && !ui_hints_off && song.g[G_TUNE] == 0 && settings_leds == LEDS_DIM && !CLK320_SET && msg_is("SETTINGS RESET"));
|
||||
ui_power_on();
|
||||
return bad;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,9 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
LEGACY = {
|
||||
"generic": "ui_knob", "attack": "function_env_adsr_attack", "decay": "function_env_adsr_decay",
|
||||
"sustain": "function_env_adsr_sustain", "release": "function_env_adsr_release", "env": "function_env_adsr_lin",
|
||||
"cutoff": "function_filter_lpf", "reso": "function_filter_lpf_peak", "rate": "symbol_speed",
|
||||
"cutoff": "function_filter_hpf", "reso": "function_filter_hpf_peak", "rate": "symbol_speed", # ((1.3.1) Fukiai's
|
||||
# filter names are mirrored: its "hpf" glyphs draw the low-pass curve (flat, then falling), its "lpf" ones the
|
||||
# high-pass (rising, then flat); a low-pass CUTOFF and its resonance take the low-pass drawing, FX's HPF the other)
|
||||
"lfo_wave": "waveform_sine", "wave": "waveform_variant", "pulse": "waveform_pulse_quarter",
|
||||
"shape": "waveform_variant_four", "pitch": "waveform_pitch", "tune": "symbol_tuning",
|
||||
"detune": "function_phaseout", "transpose": "control_arrow_up_down", "octave": "control_arrow_up",
|
||||
@@ -82,7 +84,7 @@ EXTRA = {
|
||||
"x_doctor": "symbol_doctor", "x_bat0": "system_battery_0", "x_bat1": "system_battery_1",
|
||||
"x_bat3": "system_battery_3", "x_bat4": "system_battery_4", "x_bat_chg": "system_battery_charging",
|
||||
# the FX hold layer (ui_draw.c draw_layer, Fukiai 0.8.3) and the HOLD menu row
|
||||
"x_knob": "ui_knob", "x_hpf": "function_filter_hpf",
|
||||
"x_knob": "ui_knob", "x_hpf": "function_filter_lpf", # ((1.3.1) the high-pass drawing: see "cutoff")
|
||||
"x_repeat": "control_arrow_loop", "x_reverse": "control_reverse_f", "x_tstop": "symbol_stop",
|
||||
"x_freeze": "symbol_freeze",
|
||||
# OCT UP / OCT DN (the harmonizer): stand-ins until Fukiai has a pitch-shift glyph;
|
||||
|
||||
@@ -103,10 +103,12 @@
|
||||
.fm6ops td, .fm6ops th { padding: 0 2px; }
|
||||
input.fm6n { width: 3.2em; }
|
||||
#steps tr.off td { color: var(--dim); }
|
||||
.stepcols { columns: 470px; column-gap: 24px; }
|
||||
.stepcols table { break-inside: avoid; }
|
||||
.stepcols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; } /* ((1.3.1) the 16-step tables
|
||||
side by side where they fit, else one under another: CSS columns of
|
||||
470 px overlapped tables grown to ~790 px with FLAM, COND, NUDGE) */
|
||||
.stepcols table { flex: none; }
|
||||
@media (max-width: 600px) {
|
||||
.stepcols { columns: auto; overflow-x: auto; }
|
||||
.stepcols { overflow-x: auto; }
|
||||
#steps input[type=text] { width: 84px; }
|
||||
#steps input[type=number] { width: 42px; }
|
||||
#steps th, #steps td { padding-right: 3px; }
|
||||
@@ -3076,7 +3078,7 @@ const GLYPH = {
|
||||
control_arrow_loop: 0xEAD6, note_eight: 0xEAEF, symbol_waves: 0xEAE6, function_env_adsr_exp: 0xEA12,
|
||||
ui_knob: 0xEA70, symbol_keyboard: 0xEABC, symbol_effector: 0xEAB7, symbol_echo: 0xEAB5, symbol_spring: 0xEAD1,
|
||||
symbol_tuning: 0xEAA7, control_arrow_up_down: 0xEACF, symbol_grid: 0xEABA, symbol_cog: 0xEA46,
|
||||
function_filter_lpf_peak: 0xEAA0, ui_slider_vertical: 0xEA73, symbol_books: 0xEADC, control_rec_f: 0xEA09, control_stop_f: 0xEA0F, control_play_f: 0xEA07,
|
||||
function_filter_hpf_peak: 0xEA9E, ui_slider_vertical: 0xEA73, symbol_books: 0xEADC, control_rec_f: 0xEA09, control_stop_f: 0xEA0F, control_play_f: 0xEA07,
|
||||
symbol_pan: 0xEA53, control_speaker_mute: 0xEAEB,
|
||||
waveform_sine: 0xEA85, waveform_triangle_ac: 0xEA89, waveform_sawtooth_ac: 0xEA81, waveform_square: 0xEA87,
|
||||
waveform_pulse_quarter: 0xEA7F, waveform_pulse_eighth: 0xEA7B, waveform_noise_step: 0xEA79,
|
||||
@@ -3086,7 +3088,8 @@ const GLYPH = {
|
||||
const HEAD_IC = { ENV: "function_env_adsr_exp", LFO: "waveform_sine", MOD: "symbol_waves", EDIT: "ui_knob", VOICE: "symbol_keyboard",
|
||||
FX: "symbol_effector", SCALE: "symbol_tuning", ARP: "control_arrow_up_down", "SEQ PATTERN": "symbol_grid",
|
||||
GLOBAL: "symbol_cog", INSTRUMENT: "symbol_keyboard" };
|
||||
const PAGE_IC = { FLT: "function_filter_lpf_peak", FILT: "function_filter_lpf_peak", DLY: "symbol_echo", REVERB: "symbol_spring", CHORUS: "symbol_waves",
|
||||
/* ((1.3.1) Fukiai's filter names are mirrored: its "hpf_peak" glyph draws a low-pass with its resonance peak) */
|
||||
const PAGE_IC = { FLT: "function_filter_hpf_peak", FILT: "function_filter_hpf_peak", DLY: "symbol_echo", REVERB: "symbol_spring", CHORUS: "symbol_waves",
|
||||
SLICER: "symbol_grid", CHORD: "symbol_keyboard" };
|
||||
/* WAVE / WAVE2 choices; phase-distortion shapes without a close glyph (SPLS, RSAW, RTRI, RTRP) get none */
|
||||
const WAVE_IC = { SIN: "waveform_sine", TRI: "waveform_triangle_ac", SAW: "waveform_sawtooth_ac", SQR: "waveform_square",
|
||||
|
||||
@@ -233,6 +233,9 @@ static void fm1_cpu1_halt(void) {}
|
||||
static int fm1_cpu1_start(void) { return -1; }
|
||||
static void fm1_guard_pc_open(void) {}
|
||||
#endif
|
||||
/* (Skiff) MENU > CPU CLOCK 320 MHZ (hal/fm1_clk.h): no PLL here; refused, as on a unit whose clock is not as expected */
|
||||
enum { FM1_CLK320_EALREADY = 1, FM1_CLK320_EMODE };
|
||||
static int fm1_clk320_go(uint32_t *t) { t[0] = t[1] = 0; return FM1_CLK320_EMODE; }
|
||||
#if FELUCCA_CDC
|
||||
static void cdc_task(void) {}
|
||||
#endif
|
||||
|
||||