We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried this code:
main.rs
#![no_std] #![no_main] #![feature(llvm_asm)] pub fn black_box<T>(dummy: T) -> T { unsafe { llvm_asm!("" : : "r"(&dummy)) } dummy } #[panic_handler] fn panic(_info: &core::panic::PanicInfo) -> ! { use arduino_uno::prelude::*; let dp = arduino_uno::Peripherals::take().unwrap(); let mut pins = arduino_uno::Pins::new(dp.PORTB, dp.PORTC, dp.PORTD); let mut led = pins.d13.into_output(&mut pins.ddr); loop { led.toggle().void_unwrap(); arduino_uno::delay_ms(50); } } #[arduino_uno::entry] fn main() -> ! { let x = 123.456; assert_eq!(x == 0f32, black_box(x) == 0f32); loop {} }
Cargo.toml
[package] name = "rust-arduino-blink" version = "0.1.0" edition = "2018" [profile.release] panic = "abort" opt-level = "z" lto = true codegen-units = 1 [dependencies.arduino-uno] git = "https://github.com/Rahix/avr-hal" features = ["arduino-nano"]
RUSTFLAGS="-Clink-args=-lc" cargo build --release --target avr-unknown-gnu-atmega328 -Z build-std=core
I expected to see this happen: no blinking
Instead, this happened: blinking :)
rustc --version --verbose:
rustc --version --verbose
rustc 1.48.0-nightly (0da580074 2020-09-22) binary: rustc commit-hash: 0da58007451a154da2480160429e1604a1f5f0ec commit-date: 2020-09-22 host: x86_64-unknown-linux-gnu release: 1.48.0-nightly LLVM version: 11.0
``` N/A ```
The text was updated successfully, but these errors were encountered:
Thanks for the report! This looks like a duplicate of #77131, however, so closing in favor of that.
Please leave a comment on that issue if you have more information to contribute.
Sorry, something went wrong.
No branches or pull requests
I tried this code:
main.rs
Cargo.toml
RUSTFLAGS="-Clink-args=-lc" cargo build --release --target avr-unknown-gnu-atmega328 -Z build-std=core
I expected to see this happen: no blinking
Instead, this happened: blinking :)
Meta
rustc --version --verbose
:Backtrace
``` N/A ```
The text was updated successfully, but these errors were encountered: