Skip to content

Commit

Permalink
Fix NameError of CYW43 on Pico W
Browse files Browse the repository at this point in the history
  • Loading branch information
hasumikin committed Feb 9, 2024
1 parent 2bd5675 commit 5145384
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mrblib/r2p2_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
require "shell"
require "spi"

# Not to break symbol table
# FIXME: Fix Sandbox class to remove this workaround
require "vim"

# Setup flash disk
begin
$shell = Shell.new(clean: true)
Expand All @@ -21,6 +17,13 @@
puts "#{e.message} (#{e.class})"
end

# Putting this before the shell setup causes the shell to hang
begin
require "cyw43"
rescue LoadError
# Ignore. Maybe not Pico W
end

begin
puts "Press 's' to skip running app.mrb or app.rb"
skip = false
Expand All @@ -44,8 +47,10 @@
# Start shell if terminal is available
IO.wait_terminal
puts "Starting shell...\n\n"

$shell.show_logo
$shell.start

rescue => e
puts "#{e.message} (#{e.class})"
puts "Rebooting"
Expand Down

0 comments on commit 5145384

Please sign in to comment.