save all would be great

This commit is contained in:
paul nehlich 2024-06-18 12:17:04 +02:00
parent 08b4bf2ad7
commit c471de9179
4 changed files with 79 additions and 39 deletions

View File

@ -335,5 +335,3 @@ static int RecvFrame(XCanPs *InstancePtr)
return Status; return Status;
} }
# define FALSE 2U

View File

@ -23,16 +23,17 @@ uint32_t gpio_read_pin(uint32_t pin) {
void gpio_toggle_pin(uint32_t pin) { void gpio_toggle_pin(uint32_t pin) {
} }
endif() endif()
if(TargetIsZedboard TRUE) if(TargetIsZedboard TRUE)
XGpioPs gpio; XGpioPs gpio; // Global!
void gpio_setup() { void gpio_setup() {
XGpioPs_Config config; XGpioPs_Config config; // Global!
config.DeviceId = 4; // chosen by fair dice throw config.DeviceId = 4; // chosen by fair dice throw // Global!
config.BaseAddr = XPS_GPIO_BASEADDR; config.BaseAddr = XPS_GPIO_BASEADDR; // Global!
s32 returncode = XGpioPs_CfgInitialize(&gpio, &config, XPS_GPIO_BASEADDR); s32 returncode = XGpioPs_CfgInitialize(&gpio, &config, XPS_GPIO_BASEADDR); // Global!
//printf("Configured XGPIO"); //printf("Configured XGPIO");
XGpioPs_SetDirection(&gpio, 0, (1 << 7)); XGpioPs_SetDirection(&gpio, 0, (1 << 7));
XGpioPs_SetOutputEnable(&gpio, 0, (1 << 7)); XGpioPs_SetOutputEnable(&gpio, 0, (1 << 7));

View File

@ -170,10 +170,17 @@ impl SystemObjectIF for HandlerSender {
} }
} }
fn mission() { fn mission() { // lets call it "main()"
sifln!("Mission enter"); sifln!("Mission enter");
// When the IOs are initialized later.. what do we do here?!
setup_all_com_if {
gpio_cookie.setup() // needs to register cookies -> ComIFs haben ObjectIDs -> Kennt ein ComIF alle seine Cookies? (Potentiell ja, weil sie dort erstellt werden)
}
use crate::osal::*; use crate::osal::*;
unsafe { unsafe {
sifln!("Setup GPIO"); sifln!("Setup GPIO");
@ -218,6 +225,17 @@ fn mission() {
tasks: &mut [&mut t1, &mut t2], tasks: &mut [&mut t1, &mut t2],
}; };
// Initialize all IOs
init_all_com_if {
for comIF in comIFs {
for cookie in comIF.get_cookies() {
cookie.init()
}
}
}
// At last HERE all IOs must be configerued and ready for operations!
task_executor.init_and_run(false); task_executor.init_and_run(false);
sifln!("Mission delay"); sifln!("Mission delay");

23
structures.txt Normal file
View File

@ -0,0 +1,23 @@
C
BSP_z7 XGpio...c // Linux (FreeRTOS compiled for Linux! (Wollen wir!))
mission-BSP gpio_rust_helper.c
FreeRTOS (/ RTEMS / Linux (haben wir nicht vor!)) (Für Hardwareabstractions egal!)
Rust
mod osal
mod safe_osal
FSRC
BSP_z7
FreeRTOS
mission
osal (-> FreeRTOS / Linux)
hal (-> BSP_z7 / BSP_ROMEO_OBC / Linux_Sockets_Simulator)
mission_rust
fsrc (-> osal (z.B TaskScheduler), hal (zB. trait ComIF))
rfsw (-> fsrc )