mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
Add mcu support to the carousel example (#1744)
The carousel example can be now also run on the supported mcu devices
This commit is contained in:
parent
328cee7289
commit
b87705aa56
24 changed files with 126 additions and 62 deletions
|
|
@ -1,11 +1,18 @@
|
|||
// Copyright © SixtyFPS GmbH <info@slint-ui.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||
|
||||
#![cfg_attr(feature = "mcu", no_std)]
|
||||
#![cfg_attr(all(feature = "mcu", not(simulator)), no_main)]
|
||||
|
||||
#[cfg(feature = "mcu")]
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
slint::include_modules!();
|
||||
|
||||
#[cfg(not(feature = "mcu"))]
|
||||
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
|
||||
pub fn main() {
|
||||
// This provides better error messages in debug mode.
|
||||
|
|
@ -15,3 +22,12 @@ pub fn main() {
|
|||
|
||||
MainWindow::new().run()
|
||||
}
|
||||
|
||||
#[cfg(feature = "mcu")]
|
||||
#[mcu_board_support::entry]
|
||||
fn main() -> ! {
|
||||
mcu_board_support::init();
|
||||
MainWindow::new().run();
|
||||
|
||||
panic!("The MCU demo should not quit")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue