Description
This code:
#[atmega_hal::entry]
fn main() -> ! {
let dp = Peripherals::take().unwrap();
let pins = pins!(dp);
let mut uart = Usart0::<MHz16>::new(
dp.USART0,
pins.pd0,
pins.pd1.into_output(),
115200u32.into_baudrate(),
);
let value: f32 = core::hint::black_box(1.0);
let a = value as i64;
ufmt::uwriteln!(&mut uart, "A: {:?}", a.to_le_bytes());
loop {
//
}
}
... prints (under simavr):
A: [1, 0, 0, 0, 0, 0, 0, 0]
... but moving the code into a loop:
loop {
let value: f32 = core::hint::black_box(1.0);
let a = value as i64;
ufmt::uwriteln!(&mut uart, "A: {:?}", a.to_le_bytes());
}
... breaks something:
A: [0, 0, 0, 128, 0, 0, 0, 128]
I'll try to investigate what's going on, I just thought I'll create an issue in case someone else stumbles upon this one as well.