aboutsummaryrefslogtreecommitdiff
path: root/tk-delay.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2015-10-05 18:10:18 -0600
committerSelene ToyKeeper2015-10-05 18:10:18 -0600
commit95d877541c2f136243bc676fa555e2e31c3d307a (patch)
tree12cae65293ea0e47ebe69b9ffcb69f928a35cbbb /tk-delay.h
parentAdded nanjg board/pin layout definition to tk-attiny.h. (diff)
downloadanduril-95d877541c2f136243bc676fa555e2e31c3d307a.tar.gz
anduril-95d877541c2f136243bc676fa555e2e31c3d307a.tar.bz2
anduril-95d877541c2f136243bc676fa555e2e31c3d307a.zip
Replaced how USE_FILE_DELAY works.
As a separate function, it seems to produce smaller builds.
Diffstat (limited to '')
-rw-r--r--tk-delay.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/tk-delay.h b/tk-delay.h
index 57bdded..324077a 100644
--- a/tk-delay.h
+++ b/tk-delay.h
@@ -28,15 +28,20 @@ void _delay_ms(uint16_t n)
{
// TODO: make this take tenths of a ms instead of ms,
// for more precise timing?
- #ifdef USE_FINE_DELAY
- if (n==0) { _delay_loop_2(BOGOMIPS/3); }
- else {
- while(n-- > 0) _delay_loop_2(BOGOMIPS);
- }
- #else
+ //#ifdef USE_FINE_DELAY
+ //if (n==0) { _delay_loop_2(BOGOMIPS/3); }
+ //else {
+ // while(n-- > 0) _delay_loop_2(BOGOMIPS);
+ //}
+ //#else
while(n-- > 0) _delay_loop_2(BOGOMIPS);
- #endif
+ //#endif
}
+#ifdef USE_FINE_DELAY
+void _delay_zero() {
+ _delay_loop_2(BOGOMIPS/3);
+}
+#endif
#ifdef USE_DELAY_S
void _delay_s() // because it saves a bit of ROM space to do it this way
{