Skip to content

Commit

Permalink
#ifdef hell
Browse files Browse the repository at this point in the history
These goddamned #ifdefs will be the death of me...
  • Loading branch information
SpenceKonde committed Mar 20, 2020
1 parent ae5fb7c commit 94dd0e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions megaavr/cores/arduino/Tone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#else
#error "This part only has one type B timer, but it is selected as millis source; tone cannot be used."
#endif
#else
#define USE_TIMERB0
#endif

Expand Down
4 changes: 4 additions & 0 deletions megaavr/cores/arduino/wiring.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ static volatile TCB_t* _timer =
#error "Selected millis timer, TCB1 does not exist on this part."
#endif
&TCB1;
#endif
#else //it's not TCB0, TCB1, TCD0, TCA0, or RTC
#error "No millis timer selected, but not disabled - can't happen!".
#endif
Expand Down Expand Up @@ -288,7 +289,10 @@ unsigned long micros() {
#endif //end of timer-specific part of micros calculations
return microseconds;
}

#endif //end of non-RTC micros code


#endif //end of non-DISABLE_MILLIS code

#if !(defined(DISABLE_MILLIS) || defined(MILLIS_USE_TIMERRTC)) //delay implementation when we do have micros()
Expand Down

1 comment on commit 94dd0e8

@Floessie
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SpenceKonde Maybe it could help to indent them...

Please sign in to comment.