1#![allow(static_mut_refs)]
10#![no_main]
11#![no_std]
12use core::cell::OnceCell;
13use firefly_rust as ff;
14
15static mut IMAGE: OnceCell<ff::ImageBuf> = OnceCell::new();
16
17#[unsafe(no_mangle)]
18extern "C" fn boot() {
19 let file = ff::load_file_buf("img").unwrap();
20 unsafe {
21 IMAGE.set(file.into()).ok().unwrap();
22 }
23}
24
25#[unsafe(no_mangle)]
26extern "C" fn update() {
27 ff::clear_screen(ff::Color::White);
28 let image = unsafe { IMAGE.get().unwrap() };
29 ff::draw_image(image, ff::Point { x: 60, y: 60 });
30}