diff options
| author | Liam Murphy <[email protected]> | 2021-06-29 12:07:10 +1000 |
|---|---|---|
| committer | Liam Murphy <[email protected]> | 2021-06-29 12:07:10 +1000 |
| commit | 0c0597f775e3197b87e9370f390ccc3814b637a1 (patch) | |
| tree | 29e272bc41a83a7a97f7c820192293224bcf0949 /embassy-nrf/src/timer.rs | |
| parent | 94e13ef053d788238899bffb8f4fc450101b78ee (diff) | |
Don't include extended timer support on chips without it
Diffstat (limited to 'embassy-nrf/src/timer.rs')
| -rw-r--r-- | embassy-nrf/src/timer.rs | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs index a96c6a823..0f37a6d65 100644 --- a/embassy-nrf/src/timer.rs +++ b/embassy-nrf/src/timer.rs | |||
| @@ -206,7 +206,19 @@ impl<'d, T: Instance> Timer<'d, T> { | |||
| 206 | 1 => w.compare1().clear(), | 206 | 1 => w.compare1().clear(), |
| 207 | 2 => w.compare2().clear(), | 207 | 2 => w.compare2().clear(), |
| 208 | 3 => w.compare3().clear(), | 208 | 3 => w.compare3().clear(), |
| 209 | #[cfg(any( | ||
| 210 | feature = "nrf52805", | ||
| 211 | feature = "nrf52811", | ||
| 212 | feature = "nrf52820", | ||
| 213 | feature = "nrf52833", | ||
| 214 | ))] | ||
| 209 | 4 => w.compare4().clear(), | 215 | 4 => w.compare4().clear(), |
| 216 | #[cfg(any( | ||
| 217 | feature = "nrf52805", | ||
| 218 | feature = "nrf52811", | ||
| 219 | feature = "nrf52820", | ||
| 220 | feature = "nrf52833", | ||
| 221 | ))] | ||
| 210 | 5 => w.compare5().clear(), | 222 | 5 => w.compare5().clear(), |
| 211 | _ => unreachable!("No timers have more than 6 CC registers"), | 223 | _ => unreachable!("No timers have more than 6 CC registers"), |
| 212 | }); | 224 | }); |
| @@ -291,7 +303,19 @@ impl<'a, T: Instance> Cc<'a, T> { | |||
| 291 | 1 => w.compare1_clear().enabled(), | 303 | 1 => w.compare1_clear().enabled(), |
| 292 | 2 => w.compare2_clear().enabled(), | 304 | 2 => w.compare2_clear().enabled(), |
| 293 | 3 => w.compare3_clear().enabled(), | 305 | 3 => w.compare3_clear().enabled(), |
| 306 | #[cfg(any( | ||
| 307 | feature = "nrf52805", | ||
| 308 | feature = "nrf52811", | ||
| 309 | feature = "nrf52820", | ||
| 310 | feature = "nrf52833", | ||
| 311 | ))] | ||
| 294 | 4 => w.compare4_clear().enabled(), | 312 | 4 => w.compare4_clear().enabled(), |
| 313 | #[cfg(any( | ||
| 314 | feature = "nrf52805", | ||
| 315 | feature = "nrf52811", | ||
| 316 | feature = "nrf52820", | ||
| 317 | feature = "nrf52833", | ||
| 318 | ))] | ||
| 295 | 5 => w.compare5_clear().enabled(), | 319 | 5 => w.compare5_clear().enabled(), |
| 296 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), | 320 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), |
| 297 | }) | 321 | }) |
| @@ -304,7 +328,19 @@ impl<'a, T: Instance> Cc<'a, T> { | |||
| 304 | 1 => w.compare1_clear().disabled(), | 328 | 1 => w.compare1_clear().disabled(), |
| 305 | 2 => w.compare2_clear().disabled(), | 329 | 2 => w.compare2_clear().disabled(), |
| 306 | 3 => w.compare3_clear().disabled(), | 330 | 3 => w.compare3_clear().disabled(), |
| 331 | #[cfg(any( | ||
| 332 | feature = "nrf52805", | ||
| 333 | feature = "nrf52811", | ||
| 334 | feature = "nrf52820", | ||
| 335 | feature = "nrf52833", | ||
| 336 | ))] | ||
| 307 | 4 => w.compare4_clear().disabled(), | 337 | 4 => w.compare4_clear().disabled(), |
| 338 | #[cfg(any( | ||
| 339 | feature = "nrf52805", | ||
| 340 | feature = "nrf52811", | ||
| 341 | feature = "nrf52820", | ||
| 342 | feature = "nrf52833", | ||
| 343 | ))] | ||
| 308 | 5 => w.compare5_clear().disabled(), | 344 | 5 => w.compare5_clear().disabled(), |
| 309 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), | 345 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), |
| 310 | }) | 346 | }) |
| @@ -321,7 +357,19 @@ impl<'a, T: Instance> Cc<'a, T> { | |||
| 321 | 1 => w.compare1_stop().enabled(), | 357 | 1 => w.compare1_stop().enabled(), |
| 322 | 2 => w.compare2_stop().enabled(), | 358 | 2 => w.compare2_stop().enabled(), |
| 323 | 3 => w.compare3_stop().enabled(), | 359 | 3 => w.compare3_stop().enabled(), |
| 360 | #[cfg(any( | ||
| 361 | feature = "nrf52805", | ||
| 362 | feature = "nrf52811", | ||
| 363 | feature = "nrf52820", | ||
| 364 | feature = "nrf52833", | ||
| 365 | ))] | ||
| 324 | 4 => w.compare4_stop().enabled(), | 366 | 4 => w.compare4_stop().enabled(), |
| 367 | #[cfg(any( | ||
| 368 | feature = "nrf52805", | ||
| 369 | feature = "nrf52811", | ||
| 370 | feature = "nrf52820", | ||
| 371 | feature = "nrf52833", | ||
| 372 | ))] | ||
| 325 | 5 => w.compare5_stop().enabled(), | 373 | 5 => w.compare5_stop().enabled(), |
| 326 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), | 374 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), |
| 327 | }) | 375 | }) |
| @@ -334,7 +382,19 @@ impl<'a, T: Instance> Cc<'a, T> { | |||
| 334 | 1 => w.compare1_stop().disabled(), | 382 | 1 => w.compare1_stop().disabled(), |
| 335 | 2 => w.compare2_stop().disabled(), | 383 | 2 => w.compare2_stop().disabled(), |
| 336 | 3 => w.compare3_stop().disabled(), | 384 | 3 => w.compare3_stop().disabled(), |
| 385 | #[cfg(any( | ||
| 386 | feature = "nrf52805", | ||
| 387 | feature = "nrf52811", | ||
| 388 | feature = "nrf52820", | ||
| 389 | feature = "nrf52833", | ||
| 390 | ))] | ||
| 337 | 4 => w.compare4_stop().disabled(), | 391 | 4 => w.compare4_stop().disabled(), |
| 392 | #[cfg(any( | ||
| 393 | feature = "nrf52805", | ||
| 394 | feature = "nrf52811", | ||
| 395 | feature = "nrf52820", | ||
| 396 | feature = "nrf52833", | ||
| 397 | ))] | ||
| 338 | 5 => w.compare5_stop().disabled(), | 398 | 5 => w.compare5_stop().disabled(), |
| 339 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), | 399 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), |
| 340 | }) | 400 | }) |
| @@ -352,7 +412,19 @@ impl<'a, T: Instance> Cc<'a, T> { | |||
| 352 | 1 => w.compare1().set(), | 412 | 1 => w.compare1().set(), |
| 353 | 2 => w.compare2().set(), | 413 | 2 => w.compare2().set(), |
| 354 | 3 => w.compare3().set(), | 414 | 3 => w.compare3().set(), |
| 415 | #[cfg(any( | ||
| 416 | feature = "nrf52805", | ||
| 417 | feature = "nrf52811", | ||
| 418 | feature = "nrf52820", | ||
| 419 | feature = "nrf52833", | ||
| 420 | ))] | ||
| 355 | 4 => w.compare4().set(), | 421 | 4 => w.compare4().set(), |
| 422 | #[cfg(any( | ||
| 423 | feature = "nrf52805", | ||
| 424 | feature = "nrf52811", | ||
| 425 | feature = "nrf52820", | ||
| 426 | feature = "nrf52833", | ||
| 427 | ))] | ||
| 356 | 5 => w.compare5().set(), | 428 | 5 => w.compare5().set(), |
| 357 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), | 429 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), |
| 358 | }); | 430 | }); |
| @@ -364,7 +436,19 @@ impl<'a, T: Instance> Cc<'a, T> { | |||
| 364 | 1 => w.compare1().clear(), | 436 | 1 => w.compare1().clear(), |
| 365 | 2 => w.compare2().clear(), | 437 | 2 => w.compare2().clear(), |
| 366 | 3 => w.compare3().clear(), | 438 | 3 => w.compare3().clear(), |
| 439 | #[cfg(any( | ||
| 440 | feature = "nrf52805", | ||
| 441 | feature = "nrf52811", | ||
| 442 | feature = "nrf52820", | ||
| 443 | feature = "nrf52833", | ||
| 444 | ))] | ||
| 367 | 4 => w.compare4().clear(), | 445 | 4 => w.compare4().clear(), |
| 446 | #[cfg(any( | ||
| 447 | feature = "nrf52805", | ||
| 448 | feature = "nrf52811", | ||
| 449 | feature = "nrf52820", | ||
| 450 | feature = "nrf52833", | ||
| 451 | ))] | ||
| 368 | 5 => w.compare5().clear(), | 452 | 5 => w.compare5().clear(), |
| 369 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), | 453 | _ => unreachable!("a `Cc` cannot be created with `n > 5`"), |
| 370 | }); | 454 | }); |
