Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ jobs:
cargo -V
rustc -V

- name: Build
shell: bash
- run: sudo apt install -qq -y libudev-dev
- shell: bash
run: $BUILD_CMD build --release --target=${{ matrix.job.target }}

- name: Set binary name & path
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- uses: arduino/setup-task@v1
with:
repo-token: ${{ github.token }}
- run: sudo apt install -qq -y libudev-dev
- run: task test

lint:
Expand All @@ -34,6 +35,7 @@ jobs:
- uses: arduino/setup-task@v1
with:
repo-token: ${{ github.token }}
- run: sudo apt install -qq -y libudev-dev
- run: task lint

markdownlint-cli:
Expand Down
133 changes: 126 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ anyhow = "1.0.95"
chrono = { version = "0.4.39", default-features = false, features = ["clock"] }
# Framework for parsing CLI args
clap = { version = "4.5.29", features = ["derive"] }
# Detect message boundaries in serial port output from device
cobs = "0.3.0"
# TUI for the "monitor" command, colored terminal output
crossterm = "0.28.1"
# Convert binary hash into hex
data-encoding = "2.8.0"
# Find the best place to sotre the VFS
directories = "6.0.0"
# Serialize app config into meta file in the ROM
firefly-types = { version = "0.5.0" }
firefly-types = { version = "0.5.1" }
# Decode wav files
hound = "3.5.1"
# Parse PNG images
Expand All @@ -52,6 +54,7 @@ rustyline = "15.0.0"
serde = { version = "1.0.217", features = ["serde_derive", "derive"] }
# Deserialize JSON API responses from the firefly catalog.
serde_json = "1.0.138"
serialport = "4.7.0"
# Calculate file checksum
sha2 = "0.10.8"
# Deserialize firefly.toml
Expand Down
20 changes: 19 additions & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ pub enum Commands {
/// Show runtime stats for a running device (or emulator).
Monitor(MonitorArgs),

/// Show live runtime logs from a running device.
Logs(LogsArgs),

/// Inspect contents of the ROM: files, metadata, wasm binary.
Inspect(InspectArgs),

Expand Down Expand Up @@ -244,7 +247,22 @@ pub struct EmulatorArgs {
}

#[derive(Debug, Parser)]
pub struct MonitorArgs {}
pub struct MonitorArgs {
#[arg(long, default_value = None)]
pub port: Option<String>,

#[arg(long, default_value_t = 115_200)]
pub baud_rate: u32,
}

#[derive(Debug, Parser)]
pub struct LogsArgs {
#[arg(long)]
pub port: String,

#[arg(long, default_value_t = 115_200)]
pub baud_rate: u32,
}

#[derive(Debug, Parser)]
pub struct InspectArgs {
Expand Down
1 change: 1 addition & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub fn run_command(vfs: PathBuf, command: &Commands) -> anyhow::Result<()> {
Commands::Boards(args) => cmd_boards(&vfs, args),
Commands::Cheat(args) => cmd_cheat(args),
Commands::Monitor(args) => cmd_monitor(&vfs, args),
Commands::Logs(args) => cmd_logs(args),
Commands::Inspect(args) => cmd_inspect(&vfs, args),
Commands::Repl(args) => cmd_repl(&vfs, args),
Commands::Key(KeyCommands::New(args)) => cmd_key_new(&vfs, args),
Expand Down
3 changes: 2 additions & 1 deletion src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::path::{Path, PathBuf};
static TIPS: &[&str] = &[
"keep an eye on the binary size: bigger binary often means slower code",
"if the app hits `unreachable`, use `log_debug` to find out where",
"you can use build_args option in firefly.toml to customize the build command",
"you can use `build_args` option in `firefly.toml` to customize the build command",
"if your game has multiple levels/scenes, use a separate sprite file for each",
"prefer using 32 bit float over 64 bit float",
"using shapes instead of sprites might save memory and improve performance",
Expand All @@ -46,6 +46,7 @@ static TIPS: &[&str] = &[
"you can customize TinyGo build with a custom target.json in the project root",
"make sure to test your game with multiplayer",
"images using 4 or less colors are twice smaller",
"when debugging an app, call `set_seed` in `boot` to make the randomness predictable",
// covering CLI subcommands
"you can use `wasm2wat` and `firefly_cli inspect` to inspect the app binary",
"use `firefly_cli export` to share the app with your friends",
Expand Down
Loading
Loading