uartlite_test_fix1

This commit is contained in:
paul nehlich
2024-07-26 12:53:31 +02:00
parent bb29c907e2
commit a48388bebb
6 changed files with 299 additions and 11 deletions

View File

@ -24,7 +24,7 @@ fn panic(panic: &PanicInfo<'_>) -> ! {
sifln!("");
sif!("in task \"");
unsafe {
//osal::get_task_name is implemented safely in C, so we trust it
//TODO is from_ptr safe enough?
let task_name = core::ffi::CStr::from_ptr(osal::get_task_name());
let task_name_utf8 = core::str::from_utf8(task_name.to_bytes());
match task_name_utf8 {
@ -62,11 +62,6 @@ extern "C" fn rust_assert_called(ptr: *const core::ffi::c_char, line: core::ffi:
panic!("assertion failed at {file_name}:{}", line);
}
#[no_mangle]
extern "C" fn rust_alloc_failed(){
panic!("allocation failed!");
}
#[no_mangle]
extern "C" fn rust_main() {
sifln!("Rust startup 🚀");
@ -206,7 +201,7 @@ fn mission() {
gpio_setup();
sifln!(";");
sifln!("");
gpio_toggle_pin(0x00000070);
// gpio_toggle_pin(0x00000070);
sifln!("");
@ -214,7 +209,7 @@ fn mission() {
// canps_poll_example();
}
sifln!("Called canps poll example()");