Permalink
Browse files

Eliminate _delay_ms().

Lots of duplicate stuff in delay.c/.h ...
  • Loading branch information...
Traumflug committed Mar 19, 2013
1 parent 2ebfd44 commit 1114761bed366a6b256fb95a84250940a216a903
Showing with 3 additions and 13 deletions.
  1. +1 −1 delay.c
  2. +1 −11 delay.h
  3. +1 −1 pinio.c
View
@@ -36,7 +36,7 @@ void _delay(uint32_t delay) {
/// delay milliseconds
/// \param delay time to wait in milliseconds
-void _delay_ms(uint32_t delay) {
+void delay_ms(uint32_t delay) {
wd_reset();
while (delay > 65) {
delay_us(64999);
View
12 delay.h
@@ -16,7 +16,7 @@ void delay_us(uint16_t delay);
void _delay(uint32_t delay);
// millisecond delay, does reset WDT if feature enabled
-void _delay_ms(uint32_t delay);
+void delay_ms(uint32_t delay);
// microsecond timer, does reset WDT if feature enabled
@@ -36,14 +36,4 @@ inline void delay(uint32_t d) {
}
}
-// millisecond timer, does reset WDT if feature enabled
-// 0 results in no real delay, but the watchdog
-// reset is called if the feature is enabled
-static void delay_ms(uint32_t) __attribute__ ((always_inline));
-inline void delay_ms(uint32_t d) {
- if (d > 65)
- _delay_ms(d);
- else
- delay(d * 1000);
- }
#endif /* _DELAY_H */
View
@@ -12,7 +12,7 @@ void power_on() {
#ifdef PS_ON_PIN
WRITE(PS_ON_PIN, 0);
SET_OUTPUT(PS_ON_PIN);
- _delay_ms(500);
+ delay_ms(500);
#endif
ps_is_on = 1;
}

0 comments on commit 1114761

Please sign in to comment.