Skip to content

Commit

Permalink
avr-hal-generic: prefer compilation error for unsupported targets
Browse files Browse the repository at this point in the history
The use of "unimplemented!" delays error detection until runtime, but
the target architecture is known at compile time. By removing the
unimplemented function we prevent unsupported architectures at
compile-time.
  • Loading branch information
tones111 committed Jan 2, 2025
1 parent 6fa0d2d commit 9543d18
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions avr-hal-generic/src/delay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ fn busy_loop(mut c: u16) {
}
}

#[cfg(not(target_arch = "avr"))]
fn busy_loop(_c: u16) {
unimplemented!("Implementation is only available for avr targets!")
}

// Clock-Specific Delay Implementations ----------------------------------- {{{
impl delay_v0::DelayUs<u16> for Delay<crate::clock::MHz24> {
fn delay_us(&mut self, mut us: u16) {
Expand Down

0 comments on commit 9543d18

Please sign in to comment.