diff options
author | fishsoupisgood <github@madingley.org> | 2020-06-15 14:02:42 +0100 |
---|---|---|
committer | fishsoupisgood <github@madingley.org> | 2020-06-15 14:02:42 +0100 |
commit | 4ced1453cee7a3131459040efd57f73bfc77aece (patch) | |
tree | 78cbcbdcef4847b5b194cf65470ffb45a3e7a8e3 /app/tacho.c | |
parent | d23934fedc0b76863fcb2ba653560e108309bce6 (diff) | |
download | robs_speedo-4ced1453cee7a3131459040efd57f73bfc77aece.tar.gz robs_speedo-4ced1453cee7a3131459040efd57f73bfc77aece.tar.bz2 robs_speedo-4ced1453cee7a3131459040efd57f73bfc77aece.zip |
guage code
Diffstat (limited to 'app/tacho.c')
-rw-r--r-- | app/tacho.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/tacho.c b/app/tacho.c index 87f398f..bf0222c 100644 --- a/app/tacho.c +++ b/app/tacho.c @@ -1,6 +1,6 @@ #include "project.h" -#define SPURIOUS MS(10) /*Anything faster than 6000rpm is a false trigger */ +#define SPURIOUS MS(10) /*Anything faster than 6000rpm is a false trigger */ @@ -20,12 +20,12 @@ TACHO_ISR (void) uint32_t now, diff; static uint32_t last_edge; - if (!(EXTI_PR & TACHO)) + if (! (EXTI_PR & TACHO)) return; EXTI_PR = TACHO; - now = dwt_read_cycle_counter (); + now = dwt_read_cycle_counter(); diff = cycle_diff (last_edge, now); @@ -35,12 +35,12 @@ TACHO_ISR (void) last_edge = now; -/* Want RPM, diff is in units of 1/72 us */ + /* Want RPM, diff is in units of 1/72 us */ if (!diff) return; -/* uint32_t is un-able to express 60s in clock ticks, so divide everything by 2 */ + /* uint32_t is un-able to express 60s in clock ticks, so divide everything by 2 */ diff >>= 1; |