diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-05-12 01:57:01 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-05-17 00:57:37 +0200 |
| commit | 0310e4d458b86df31f1765104eb3aa9a6ee09bfc (patch) | |
| tree | aca167ae6e37442cafc932b3c729e37082d23b04 /embassy-macros/src/lib.rs | |
| parent | bfc7f52e6dd7b5ad12fa1f09483fa60f2732ae0c (diff) | |
Add `init` fn. Initializes hw and returns Peripherals.
Diffstat (limited to 'embassy-macros/src/lib.rs')
| -rw-r--r-- | embassy-macros/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-macros/src/lib.rs b/embassy-macros/src/lib.rs index d91549ca7..dc234cd6d 100644 --- a/embassy-macros/src/lib.rs +++ b/embassy-macros/src/lib.rs | |||
| @@ -315,12 +315,12 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { | |||
| 315 | 315 | ||
| 316 | let args = task_fn.sig.inputs.clone(); | 316 | let args = task_fn.sig.inputs.clone(); |
| 317 | 317 | ||
| 318 | if args.len() != 1 { | 318 | if args.len() != 2 { |
| 319 | task_fn | 319 | task_fn |
| 320 | .sig | 320 | .sig |
| 321 | .span() | 321 | .span() |
| 322 | .unwrap() | 322 | .unwrap() |
| 323 | .error("main function must have one argument") | 323 | .error("main function must have 2 arguments") |
| 324 | .emit(); | 324 | .emit(); |
| 325 | fail = true; | 325 | fail = true; |
| 326 | } | 326 | } |
| @@ -364,7 +364,7 @@ pub fn main(args: TokenStream, item: TokenStream) -> TokenStream { | |||
| 364 | #chip_setup | 364 | #chip_setup |
| 365 | 365 | ||
| 366 | executor.run(|spawner| { | 366 | executor.run(|spawner| { |
| 367 | spawner.spawn(__embassy_main(spawner)).unwrap(); | 367 | spawner.spawn(__embassy_main(spawner, p)).unwrap(); |
| 368 | }) | 368 | }) |
| 369 | 369 | ||
| 370 | } | 370 | } |
