From 51453845a7f2306d1d08b8ad005c9b714d486277 Mon Sep 17 00:00:00 2001 From: HASUMI Hitoshi Date: Fri, 9 Feb 2024 13:53:11 +0900 Subject: [PATCH] Fix NameError of CYW43 on Pico W --- mrblib/r2p2_task.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mrblib/r2p2_task.rb b/mrblib/r2p2_task.rb index 777552c..4ab835a 100644 --- a/mrblib/r2p2_task.rb +++ b/mrblib/r2p2_task.rb @@ -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) @@ -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 @@ -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"