Added can test code

This commit is contained in:
paul nehlich
2024-06-17 12:32:07 +02:00
parent 6af34d9559
commit ecf85cf610
5 changed files with 959 additions and 6 deletions

View File

@ -52,16 +52,15 @@ extern "C" {
// TODO: Is u32 compatible to uint32_t?
/// Reads the value of a gpio pin
///
pub fn gpio_read_pin(pin: u32) -> u32;
pub fn gpio_toggle_pin(pin: u32) -> ();
// CAN Samples
fn canps_poll_example() -> u32;
pub fn canps_poll_example() -> i32;
}

View File

@ -173,6 +173,23 @@ impl SystemObjectIF for HandlerSender {
fn mission() {
sifln!("Mission enter");
use crate::osal::*;
unsafe {
sifln!("Setup GPIO");
gpio_setup();
sifln!(";");
sifln!("");
gpio_toggle_pin(0x00000070);
sifln!("");
sifln!("Call canps poll example()");
canps_poll_example();
}
sifln!("Called canps poll example()");
let mut h1 = Handler {
id: 1,
command_queue: queues::MessageQueue::new(),