From 262edffd35ad6aa7976aee38632f6b75695bc0a8 Mon Sep 17 00:00:00 2001 From: Jonas Wanke Date: Sun, 17 Nov 2024 09:07:46 +0100 Subject: [PATCH] doc: version command cleanup (#119) Co-authored-by: Daniel Schaefer --- README.md | 12 ++++++------ commands.md | 11 +++++++++-- inputmodule-control/src/inputmodule.rs | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cf5fa10..ad2a53b 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ For device specific commands, see their individual documentation pages. ###### Permissions on Linux To ensure that the input module's port is accessible, install the `udev` rule and trigger a reload: -``` +```sh sudo cp release/50-framework-inputmodule.rules /etc/udev/rules.d/ sudo udevadm control --reload && sudo udevadm trigger ``` @@ -72,7 +72,7 @@ to a single device, specify the COM port. In this example the command is targeted at `b1-display`, so it will only apply to this module type. -``` +```sh # Example on Linux > inputmodule-control --serial-dev /dev/ttyACM0 b1-display --pattern black @@ -88,7 +88,7 @@ connected and then send the command. ``` > inputmodule-control b1-display --pattern black -Failed to find serial devivce. Please manually specify with --serial-dev +Failed to find serial device. Please manually specify with --serial-dev # No failure, waits until the device is connected, sends command and exits > inputmodule-control --wait-for-device b1-display --pattern black @@ -105,7 +105,7 @@ Device already present. No need to wait. Not executing command. First, put the module into bootloader mode. This can be done either by pressing the bootsel button while plugging it in or -by using one of the following commands: +by using one of the following commands: ```sh inputmodule-control led-matrix --bootloader @@ -144,7 +144,7 @@ cargo make --cwd b1display cargo make --cwd c1minimal ``` -Generate the UF2 update file: +Generate the UF2 update file into `target/thumbv6m-none-eabi/release/`: ```sh cargo make --cwd ledmatrix uf2 @@ -159,7 +159,7 @@ Dependencies: [Rust/rustup](https://rustup.rs/), pkg-config, libudev Currently have to specify the build target because it's not possible to specify a per package build target. Tracking issue: https://github.com/rust-lang/cargo/issues/9406 -``` +```sh # Install cargo-make to help build it cargo install cargo-make diff --git a/commands.md b/commands.md index c118660..46322ed 100644 --- a/commands.md +++ b/commands.md @@ -56,7 +56,7 @@ When no parameters are given, the current value is queried and returned. | InvertScreen | 0x15 | ` D ` | | bool | Invert scren on/off | | SetPxCol | 0x16 | ` D ` | | 50 Bytes | Send a column of pixels | | FlushFB | 0x17 | ` D ` | | | Flush all columns | -| Version | 0x20 | ` D ` | 3 Bytes | | Get firmware version | +| Version | 0x20 | `LDM` | 3 Bytes | | Get firmware version | #### Pattern (0x01) @@ -93,8 +93,15 @@ TODO Response: -``` +```plain Byte 0: USB bcdDevice MSB Byte 1: USB bcdDevice LSB Byte 2: 1 if pre-release version, 0 otherwise + ++-- Major version +| +-- Minor version +| | +-- Patch version +| | | +-- 1 if is pre-release, +| | | | 0 otherwise +MMMMMMMM mmmmPPPP 0000000p ``` diff --git a/inputmodule-control/src/inputmodule.rs b/inputmodule-control/src/inputmodule.rs index 4908839..d2d4e83 100644 --- a/inputmodule-control/src/inputmodule.rs +++ b/inputmodule-control/src/inputmodule.rs @@ -160,7 +160,7 @@ pub fn find_serialdevs(args: &crate::ClapCli, wait_for_device: bool) -> (Vec, bool) = find_serialdevs(args, args.wait_for_device); if serialdevs.is_empty() { - println!("Failed to find serial devivce. Please manually specify with --serial-dev"); + println!("Failed to find serial device. Please manually specify with --serial-dev"); return; } else if args.wait_for_device && !waited { println!("Device already present. No need to wait. Not executing command. Sleep 1s");