Skip to content

Commit c101c05

Browse files
committed
rust-app: clean up main.c
1 parent e1904f3 commit c101c05

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

samples/rust-app/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn thread_join_std_mem_domain(_context: zephyr::context::Kernel) {
4242
}
4343

4444
#[no_mangle]
45-
pub extern "C" fn hello_rust_second_thread(
45+
pub extern "C" fn rust_second_thread(
4646
_a: *const c_void,
4747
_b: *const c_void,
4848
_c: *const c_void,
@@ -64,7 +64,7 @@ pub extern "C" fn hello_rust_second_thread(
6464
}
6565

6666
#[no_mangle]
67-
pub extern "C" fn hello_rust() {
67+
pub extern "C" fn rust_main() {
6868
use zephyr::context::Kernel as Context;
6969

7070
println!("Hello Rust println");

samples/rust-app/src/main.c

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
/*
2-
* Copyright (c) 2012-2014 Wind River Systems, Inc.
3-
*
4-
* SPDX-License-Identifier: Apache-2.0
5-
*/
6-
71
#include <zephyr.h>
8-
#include <misc/printk.h>
9-
10-
extern uint8_t hello_rust(void);
11-
extern void hello_rust_user(void);
12-
13-
extern uint8_t hello_rust_second_thread(void *, void *, void *);
142

153
#define MY_STACK_SIZE 1024
164
#define MY_PRIORITY 5
175

6+
extern void rust_main(void);
7+
extern void rust_second_thread(void *, void *, void *);
8+
189
K_THREAD_DEFINE(my_tid, MY_STACK_SIZE,
19-
hello_rust_second_thread, NULL, NULL, NULL,
20-
MY_PRIORITY, 0, K_NO_WAIT);
10+
rust_second_thread, NULL, NULL, NULL,
11+
MY_PRIORITY, 0, K_NO_WAIT);
2112

2213
void main(void)
2314
{
24-
hello_rust();
15+
rust_main();
2516
}

0 commit comments

Comments
 (0)