Skip to content

Commit

Permalink
drv/lpc55-spi-server: convert to task_slot!
Browse files Browse the repository at this point in the history
  • Loading branch information
mx-shift committed Oct 19, 2021
1 parent 8701387 commit b5595c2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drv/lpc55-spi-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use drv_lpc55_syscon_api::{Peripheral, Syscon};
use lpc55_pac as device;
use userlib::*;

declare_task!(SYSCON, syscon_driver);
declare_task!(GPIO, gpio_driver);
task_slot!(SYSCON, syscon_driver);
task_slot!(GPIO, gpio_driver);

#[repr(u32)]
enum ResponseCode {
Expand Down Expand Up @@ -68,7 +68,7 @@ impl From<ResponseCode> for u32 {

#[export_name = "main"]
fn main() -> ! {
let syscon = Syscon::from(get_task_id(SYSCON));
let syscon = Syscon::from(SYSCON.get_task_id());

// Turn the actual peripheral on so that we can interact with it.
turn_on_flexcomm(&syscon);
Expand Down Expand Up @@ -267,7 +267,7 @@ fn muck_with_gpios(syscon: &Syscon) {
syscon.enable_clock(Peripheral::Iocon);
syscon.leave_reset(Peripheral::Iocon);

let gpio_driver = get_task_id(GPIO);
let gpio_driver = GPIO.get_task_id();
let iocon = Gpio::from(gpio_driver);

// This is quite the array!
Expand Down
4 changes: 4 additions & 0 deletions gemini-bu-rot/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ start = true
interrupts = {59 = 1}
stacksize = 1000

[tasks.spi0_driver.task-slots]
gpio_driver = "gpio_driver"
syscon_driver = "syscon_driver"

[tasks.ping]
path = "../task-ping"
name = "task-ping"
Expand Down
4 changes: 4 additions & 0 deletions gimlet-rot/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ start = true
interrupts = {59 = 1}
stacksize = 1000

[tasks.spi_driver.task-slots]
gpio_driver = "gpio_driver"
syscon_driver = "syscon_driver"

[peripherals.syscon]
address = 0x40000000
size = 4096
Expand Down
4 changes: 4 additions & 0 deletions lpc55/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ start = true
interrupts = {59 = 1}
stacksize = 1000

[tasks.spi_driver.task-slots]
gpio_driver = "gpio_driver"
syscon_driver = "syscon_driver"

[tasks.ping]
path = "../task-ping"
name = "task-ping"
Expand Down

0 comments on commit b5595c2

Please sign in to comment.