Class: Prremote::Commands::Install
- Inherits:
-
Object
- Object
- Prremote::Commands::Install
- Defined in:
- lib/prremote/commands/install.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(version: RUNTIME_VERSION, board: 'picow') ⇒ Install
constructor
A new instance of Install.
Constructor Details
#initialize(version: RUNTIME_VERSION, board: 'picow') ⇒ Install
Returns a new instance of Install.
6 7 8 9 |
# File 'lib/prremote/commands/install.rb', line 6 def initialize(version: RUNTIME_VERSION, board: 'picow') @version = version @board = board end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/prremote/commands/install.rb', line 11 def call uf2_path = RuntimeManager.fetch(@version, @board) device_label = @board == 'picow' ? 'Pico W' : 'Pico' puts "Put the #{device_label} into BOOTSEL mode:" puts ' 1. Hold the BOOTSEL button' puts ' 2. Connect USB (or press RUN while holding BOOTSEL)' puts ' 3. Release BOOTSEL — RPI-RP2 should appear as a USB drive' puts puts 'Waiting for RPI-RP2...' volume = wait_for_volume puts "Copying firmware to #{volume}..." FileUtils.cp(uf2_path, File.join(volume, File.basename(uf2_path))) puts 'Waiting for device to reboot...' wait_for_unmount(volume) puts "Done. Runtime #{@version} installed." end |