Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmake/nuttx_add_rust.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ function(nuttx_add_rust)
add_custom_command(
OUTPUT ${RUST_LIB_PATH}
COMMAND
${CMAKE_COMMAND} -E env
NUTTX_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/include:${CMAKE_BINARY_DIR}/include:${CMAKE_BINARY_DIR}/include/arch
cargo build --${RUST_PROFILE} -Zbuild-std=std,panic_abort
${RUST_DEBUG_FLAGS} --manifest-path ${CRATE_PATH}/Cargo.toml --target
${RUST_TARGET} --target-dir ${RUST_BUILD_DIR}
Expand Down
2 changes: 1 addition & 1 deletion examples/rust/slint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ opt-level = 'z'
[dependencies]
libc = "0.2"
slint = { version = "1.9", default-features = false, features = ["compat-1-2", "renderer-software", "libm", "unsafe-single-threaded"] }
nuttx = { git = "https://github.com/no1wudi/nuttx-rs.git", branch = "master" }
nuttx = { git = "https://github.com/no1wudi/nuttx-rs.git", branch = "main" }

[build-dependencies]
slint-build = { version = "1.9" }
2 changes: 1 addition & 1 deletion examples/rust/slint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub extern "C" fn slint_main() {
println!("{:?}", planeinfo);
println!("{:?}", videoinfo);

if videoinfo.fmt != Format::RGB565 as u8 {
if videoinfo.fmt != FB_FMT_RGB16_565 as u8 {
println!("Unsupported pixel format, only RGB565 is supported for now");
return;
}
Expand Down
6 changes: 4 additions & 2 deletions tools/Rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ endef

ifeq ($(CONFIG_DEBUG_FULLOPT),y)
define RUST_CARGO_BUILD
cargo build --release -Zbuild-std=std,panic_abort \
NUTTX_INCLUDE_DIR=$(TOPDIR)/include:$(TOPDIR)/include/arch \
cargo build --release -Zbuild-std=std,panic_abort \
-Zbuild-std-features=panic_immediate_abort \
--manifest-path $(2)/$(1)/Cargo.toml \
--target $(call RUST_TARGET_TRIPLE)
endef
else
define RUST_CARGO_BUILD
@echo "Building Rust code with cargo..."
cargo build -Zbuild-std=std,panic_abort \
NUTTX_INCLUDE_DIR=$(TOPDIR)/include:$(TOPDIR)/include/arch \
cargo build -Zbuild-std=std,panic_abort \
--manifest-path $(2)/$(1)/Cargo.toml \
--target $(call RUST_TARGET_TRIPLE)
endef
Expand Down
Loading