Skip to content

Runtime 0.4.1

Choose a tag to compare

@github-actions github-actions released this 29 Sep 01:51
· 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 / eval print Adding 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 in new; 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's Time (time(offset:), time=, valid?).
  • Board identity: prremote install -b m5stickc_plus flashes the esp32 image and records the board name on the device through a new BORD protocol command (stored in NVS on ESP-IDF builds, so it survives reflashing and deploy/undeploy; -b esp32 clears it). The runtime reports it in the READY banner — READY prremote-runtime/X.Y.Z board=NAME — and as PRREMOTE_BOARD; Pico builds report their fixed build name. Older gems still parse the banner (the version is the first token). prremote version shows 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 plain esp32 board and runtimes older than board names accept it. Installing a runtime that predates BORD just prints a warning.
  • Example (M5StickC PLUS): lcd_rotations.rb — cycles all four stick.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_VERSION constant holding the runtime version string (the same value as the READY prremote-runtime/X.Y.Z banner), so scripts can display it. Defined in the platform-neutral runtime.c right 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.rb and adc.rb now use M5StickCPlus instead of hand-written AXP192 writes, LCD.new pin/offset/MADCTL arguments and BCD register access (rtc_sync.rb is rtc.time = t). The GPIO / PWM / SPI / IR / IMU examples keep the raw pin-level API as the low-level reference.
  • Mrbc.compile replaces the identical compile helpers in Run and Deploy; test fixtures in ls_test.rb now 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 use rotation: 3 to flip back), adds a small HH:MM clock at the top center read from the RTC (--:-- until rtc_sync.rb has set it; polled once a second, redrawn only when the minute changes), and shows vX.Y.Z from PRREMOTE_VERSION at the bottom right — silently omitted on runtimes older than 0.4.1.