Crates.io | owl_patch |
lib.rs | owl_patch |
version | |
source | src |
created_at | 2024-11-19 17:36:13.000859 |
updated_at | 2024-11-19 22:00:34.469123 |
description | Rust SDK for Rebel Technology Owl2/3 devices |
homepage | |
repository | https://github.com/orukusaki/owl_patch |
max_upload_size | |
id | 1453605 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Write Patches in Rust for many Rebel Technology devices based on the Owl2/3 modules.
#![no_main]
#![no_std]
extern crate alloc;
use alloc::boxed::Box;
use owl_patch::{
patch,
program_vector::{heap_bytes_used, ProgramVector},
sample_buffer::{Buffer, Channels, ConvertFrom, ConvertTo},
};
#[patch("Example Patch")]
fn main(mut pv: ProgramVector) -> ! {
let audio_settings = pv.audio().settings;
let mut buffer: Buffer<Channels, Box<[f32]>> =
Buffer::new(audio_settings.channels, audio_settings.blocksize);
pv.meta().set_heap_bytes_used(heap_bytes_used());
pv.audio().run(|input, output| {
buffer.convert_from(input);
// Do something clever with the samples in the buffer
buffer.convert_to(output);
});
}
thumbv7em-none-eabihf
Rust target installed:rustup target add thumbv7em-none-eabihf
Install gcc-arm-none-eabi
and FirmwareSender. See the instructions on https://github.com/RebelTechnology/OwlProgram for details.
Create a new binary package using Cargo, and add this repo as a dependency:
[dependencies]
owl_patch = "0.1.2"
It is also a good idea to add this to your Cargo.toml:
[profile.release]
codegen-units = 1
debug = 2
debug-assertions = false
incremental = false
lto = "fat"
opt-level = 3
overflow-checks = false
[profile.release.package."*"]
opt-level = 3
.cargo/config.toml
file:[build]
target = "thumbv7em-none-eabihf"
# For Owl 2
[target.thumbv7em-none-eabihf]
rustflags = [
"-C", "link-arg=--nmagic",
"-C", "target-cpu=cortex-m4",
"-C", "link-arg=-Towl2.ld",
]
# For Owl 3
#[target.thumbv7em-none-eabihf]
#rustflags = [
# "-C", "link-arg=--nmagic",
# "-C", "target-cpu=cortex-m7",
# "-C", "link-arg=-Towl3.ld",
#]
Copy one of the examples into src/main.rs
Build your patch
cargo build --release
arm-none-eabi-objcopy
to get the final binary:arm-none-eabi-objcopy -O binary target/thumbv7em-none-eabihf/release/main target/thumbv7em-none-eabihf/release/main.bin
FirmwareSender
to upload the patch to your device.For further help, check the docs.
The examples in this repo have been tested on a Befaco Lich using Owl2 and Owl3 modules. They should work on others too, but I am unable to verify this. To give you the best chance of success, make sure your device is running the latest Firmware.
talc
(default): Uses the talc crate as the global allocator. If you want to use a different allocator, turn this feature off with default-features = false
fastmaths
(default): Enables the fast approximate maths functions in the fastmaths module.vpo_fastmaths
(default): Use fastmaths functions in the volts_per_octave module to convert between Volts and Frequencies quicker (but less accurately). Requires fastmaths
.Experimental. Will probabably always be that way.
i32
and f32
formatsOWL_SERVICE_LOAD_RESOURCE
service callOWL_SERVICE_ARM_RFFT_FAST_INIT_F32
and OWL_SERVICE_ARM_CFFT_INIT_F32
hardware_version == OWL_MODULAR_HARDWARE
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this repository by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
The authors of this repository are not affiliated with Rebel Technology. The Owl Platform and associated published code is their copyright.