Repository navigation
Runtime 0.4.1
·
15 commits
to main
since this release
Added
- Board libraries (
lib/prremote/boards/,Prremote::Boards): Ruby files for a board's built-in hardware that the CLI compiles in automatically when a script references one of their constants —run/deploy/watch/evalprintAdding board library: ...; scripts that don't reference them pay nothing on the device. Kept in the gem rather than the runtime because one runtime image serves several boards (measured on the esp32 image: a board class costs ~1.3 KB heap and ~25 of the 500 symbol-table slots, of which 256 are already used — every board sharing the image would pay for every other board's classes). First libraries:M5StickCPlus(m5stickc_plus.rb): AXP192 power-on innew;lcd(rotation:)presets pins / size / RGB MADCTL / RAM offset for all four rotations (fixes the one-line noise at the panel edge in rotations that mirror the 135-px axis, whose offset is 53 rather than 52);button_a/button_b(pressed?),led(on/off),tone(hz, duration),ir,rtc,i2c.BM8563(bm8563.rb): RTC driver converting to / from the runtime'sTime(time(offset:),time=,valid?).
- Board identity:
prremote install -b m5stickc_plusflashes the esp32 image and records the board name on the device through a newBORDprotocol command (stored in NVS on ESP-IDF builds, so it survives reflashing and deploy/undeploy;-b esp32clears it). The runtime reports it in the READY banner —READY prremote-runtime/X.Y.Z board=NAME— and asPRREMOTE_BOARD; Pico builds report their fixed build name. Older gems still parse the banner (the version is the first token).prremote versionshows the board. Libraries are chosen from the script alone and compiled before connecting (keeping the READY-to-send gap as short as before — an open ESP32 port can reset the chip); after READY the reported board is checked: a board library for another board is refused with a clear error, while the plainesp32board and runtimes older than board names accept it. Installing a runtime that predatesBORDjust prints a warning. - Example (M5StickC PLUS):
lcd_rotations.rb— cycles all fourstick.lcd(rotation:)presets with a 1-px border, to check that each rotation's RAM offset fills the panel exactly (no undrawn noise line on any edge). Verified on a physical M5StickC PLUS: all four border lines visible in every rotation, no edge noise. - Runtime (all boards):
PRREMOTE_VERSIONconstant holding the runtime version string (the same value as theREADY prremote-runtime/X.Y.Zbanner), so scripts can display it. Defined in the platform-neutralruntime.cright after the per-board bindings on every exec.
Changed
- Examples (M5StickC PLUS):
lcd_hello.rb,ntp_clock.rb,fablab.rb,ruby.rb,rtc.rb,rtc_sync.rbandadc.rbnow useM5StickCPlusinstead of hand-written AXP192 writes,LCD.newpin/offset/MADCTL arguments and BCD register access (rtc_sync.rbisrtc.time = t). The GPIO / PWM / SPI / IR / IMU examples keep the raw pin-level API as the low-level reference. Mrbc.compilereplaces the identicalcompilehelpers inRunandDeploy; test fixtures inls_test.rbnow send a real newline after READY (they sent a literal\n, which only worked because the READY line wasn't read to its end).- Example (M5StickC PLUS,
examples/m5stickc_plus/ruby.rb): flipped 180° (stick.lcd(rotation: 1); the comment says to userotation: 3to flip back), adds a smallHH:MMclock at the top center read from the RTC (--:--untilrtc_sync.rbhas set it; polled once a second, redrawn only when the minute changes), and showsvX.Y.ZfromPRREMOTE_VERSIONat the bottom right — silently omitted on runtimes older than 0.4.1.