RPi-WiringPi

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

          we reset the hardware, then either re-raise to terminate (default) or,
          with fatal_exit => 0, continue running. POD updated to match
        - Stopped pin cleanup's pinctrl shell-out from clobbering the program's
          exit status (local $?/$! in _restore_pin_alt)
        - Completed the Pi 5/RP1 pin-restore fix: on the RP1, get_alt() returns a
          mode enum, not a classic alt number, so pinModeAlt() could not restore
          INPUT (0) or OUTPUT (1) — only alt 31 was handled before. cleanup() and
          RPiTest's rpi_reset() now restore INPUT/OUTPUT via pinMode() (and "no
          function" via pinctrl), so a pin left in OUTPUT (eg. by a worker) is
          properly returned to its default. t/213-worker.t now asserts BCM18 is
          restored; clears the cascade that failed t/400-407 in a full sweep
        - Made t/107-alt_modes.t board-aware: its "default mode is INPUT" check
          now reads the per-board default (INPUT on Pi 3/4, "no function"/alt 31
          on Pi 5), and the classic ALT0-5 round-trip block is skipped on the
          Pi 5 / RP1, whose funcsel scheme doesn't match it (alt 1/2 don't take).
          Pi 3/4 behaviour is unchanged
        - Made io_led() and pwr_led() board-aware: Pi 5 / RP1 names its LEDs
          ACT/PWR rather than led0/led1, which produced "tee: .../led0: No such
          file or directory" noise and left the LEDs undriven. Resolved via
          pi_rp1_model(); restore triggers are now board-correct (PWR default
          is "none" on Pi 5, "input" on earlier boards)

t/RPiTest.pm  view on Meta::CPAN

    $min = 0 if $min < 0;

    my $max = $duty + RPI_PWM_TOLERANCE;
    $max = 100 if $max > 100;

    return ($min, $max);
}
sub rpi_i2c_check {
    # Gate tests that require a live I2C bus (e.g. the ADS1115 ADC). Without
    # this, a test that unconditionally touches I2C dies mid-run when the bus
    # is disabled, leaving stale metadata in shared memory that cascades into
    # subsequent tests.
    if (! $ENV{RPI_I2C}) {
        plan skip_all => "RPI_I2C environment variable not set (these tests " .
                         "verify PWM via the I2C ADS1115; set RPI_I2C=1 when " .
                         "the I2C bus and ADS1115 are wired and powered)\n";
    }
}

# fetch the current running test file number



( run in 0.922 second using v1.01-cache-2.11-cpan-9581c071862 )