Function startup

Source
pub unsafe fn startup<const BANNER: bool>(theme: BannerTheme)
Expand description

Startup Routine

  • Sets up the heap allocator if necessary.
  • Zeroes the .bss section if necessary.
  • Prints the startup banner with a specified theme, if enabled.

ยงSafety

Must be called once at the start of program execution after the stack has been setup.

Examples found in repository?
examples/booting.rs (line 19)
17
18
19
20
21
22
23
24
25
26
27
28
29
30
unsafe extern "C" fn _start() -> ! {
    unsafe {
        vexide_startup::startup::<true>(THEME_DEFAULT);

        // Write something to the screen to test if the program is running
        let test_box = Box::new(100);
        vex_sdk::vexDisplayRectFill(0, 0, *test_box, 200);
        println!("Hello, world!");
        vexTasksRun(); // Flush serial
    }

    // Exit once we're done.
    vexide_core::program::exit();
}