Skip to content

Commit

Permalink
drv/stm32h7-gpio: 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 a520c8c commit c161c66
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions demo-stm32h7/app-h743.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ requires = {flash = 8192, ram = 1024}
uses = ["gpios1", "gpios2", "gpios3"]
start = true

[tasks.gpio_driver.task-slots]
rcc_driver = "rcc_driver"

[tasks.usart_driver]
path = "../drv/stm32h7-usart"
name = "drv-stm32h7-usart"
Expand Down
3 changes: 3 additions & 0 deletions demo-stm32h7/app-h7b3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ requires = {flash = 8192, ram = 1024}
uses = ["gpios1", "gpios2", "gpios3"]
start = true

[tasks.gpio_driver.task-slots]
rcc_driver = "rcc_driver"

[tasks.usart_driver]
path = "../drv/stm32h7-usart"
name = "drv-stm32h7-usart"
Expand Down
4 changes: 2 additions & 2 deletions drv/stm32h7-gpio/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl From<ResponseCode> for u32 {
}
}

declare_task!(RCC, rcc_driver);
task_slot!(RCC, rcc_driver);

#[export_name = "main"]
fn main() -> ! {
Expand Down Expand Up @@ -285,7 +285,7 @@ fn main() -> ! {
}

fn turn_on_all_gpios() {
let rcc_driver = Rcc::from(get_task_id(RCC));
let rcc_driver = Rcc::from(RCC.get_task_id());

for port in 0..11 {
let pnum = Peripheral::GpioA as u32 + port; // see bits in AHB4ENR
Expand Down
3 changes: 3 additions & 0 deletions gemini-bu/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ requires = {flash = 8192, ram = 1024}
uses = ["gpios1", "gpios2", "gpios3"]
start = true

[tasks.gpio_driver.task-slots]
rcc_driver = "rcc_driver"

[tasks.usart_driver]
path = "../drv/stm32h7-usart"
name = "drv-stm32h7-usart"
Expand Down
3 changes: 3 additions & 0 deletions gimlet/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ requires = {flash = 8192, ram = 1024}
uses = ["gpios1", "gpios2", "gpios3"]
start = true

[tasks.gpio_driver.task-slots]
rcc_driver = "rcc_driver"

[tasks.spi4_driver]
path = "../drv/stm32h7-spi-server"
name = "drv-stm32h7-spi-server"
Expand Down
3 changes: 3 additions & 0 deletions gimletlet/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ requires = {flash = 8192, ram = 1024}
uses = ["gpios1", "gpios2", "gpios3"]
start = true

[tasks.gpio_driver.task-slots]
rcc_driver = "rcc_driver"

[tasks.usart_driver]
path = "../drv/stm32h7-usart"
name = "drv-stm32h7-usart"
Expand Down

0 comments on commit c161c66

Please sign in to comment.