Skip to content

Commit 9263778

Browse files
committed
Fix some issues
1 parent 43c6397 commit 9263778

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ defmt = "0.3"
3333
document-features = "0.2.7"
3434
embassy-executor = { git = "https://github.com/embassy-rs/embassy" }
3535
embassy-futures = { git = "https://github.com/embassy-rs/embassy" }
36-
embassy-imxrt = { git = "https://github.com/OpenDevicePartnership/embassy-imxrt" }
36+
#embassy-imxrt = { git = "https://github.com/OpenDevicePartnership/embassy-imxrt" }
37+
embassy-imxrt = { git = "https://github.com/philgweber/embassy-imxrt" }
3738
embassy-sync = { git = "https://github.com/embassy-rs/embassy" }
3839
embassy-time = { git = "https://github.com/embassy-rs/embassy" }
3940
embassy-time-driver = { git = "https://github.com/embassy-rs/embassy" }

espi-service/src/espi_service.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ pub async fn espi_service(mut espi: espi::Espi<'static>, memory_map_buffer: &'st
176176
.await
177177
.unwrap();
178178

179+
unsafe {
180+
let test_mem = 0x2000_0010 as *mut u32;
181+
*test_mem = 0xff;
182+
};
183+
179184
loop {
180185
let event = espi.wait_for_event().await;
181186
match event {
@@ -187,6 +192,7 @@ pub async fn espi_service(mut espi: espi::Espi<'static>, memory_map_buffer: &'st
187192
);
188193

189194
// If it is a peripheral channel write, then we need to notify the service
195+
/*
190196
if port_event.direction {
191197
let res = espi_service
192198
.route_to_service(port_event.offset, port_event.length)
@@ -199,8 +205,9 @@ pub async fn espi_service(mut espi: espi::Espi<'static>, memory_map_buffer: &'st
199205
);
200206
}
201207
}
208+
*/
202209

203-
espi.complete_port(0).await;
210+
espi.complete_port(port_event.port).await;
204211
}
205212

206213
Ok(espi::Event::OOBEvent(port_event)) => {
@@ -220,7 +227,7 @@ pub async fn espi_service(mut espi: espi::Espi<'static>, memory_map_buffer: &'st
220227
let result = espi.oob_get_write_buffer(port_event.port);
221228
match result {
222229
Ok(dest_slice) => {
223-
dest_slice.copy_from_slice(src_slice);
230+
dest_slice[..src_slice.len()].copy_from_slice(src_slice);
224231
}
225232
Err(e) => {
226233
error!("Failed to retrieve OOB write buffer: {}",e)
@@ -230,9 +237,9 @@ pub async fn espi_service(mut espi: espi::Espi<'static>, memory_map_buffer: &'st
230237

231238
// Don't complete event until we read out OOB data
232239
espi.complete_port(port_event.port).await;
233-
240+
234241
// Test code send same data on loopback
235-
espi.oob_write_data(port_event.port, port_event.length as u8);
242+
let _ = espi.oob_write_data(port_event.port, port_event.length as u8);
236243
} else {
237244
espi.complete_port(port_event.port).await;
238245
}

0 commit comments

Comments
 (0)