]> cloudbase.mooo.com Git - irmp-demo.git/blobdiff - timer.c
Add .gitignore
[irmp-demo.git] / timer.c
diff --git a/timer.c b/timer.c
index 58a4d2fba81daf85a652d54ea0029b8bf9052ce3..5665098bdfc8cee30373042c67acda95b1bbe0d6 100644 (file)
--- a/timer.c
+++ b/timer.c
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2017 Leo C. <erbl259-lmu@yahoo.de>
+ * (C) Copyright 20014 - 2017 Leo C. <erbl259-lmu@yahoo.de>
  *
  * SPDX-License-Identifier:    GPL-2.0
  */
 #include <libopencm3/stm32/gpio.h>
 
 
-/* timer interrupt/overflow counter */
-/* counts up every ms. */
-static volatile
-uint32_t timestamp;
+/*
+ * timer interrupt/overflow counter, counts up every ms.
+ */
+static
+volatile uint32_t timestamp;
 
 void systick_setup(void)
 {
@@ -28,7 +29,6 @@ void systick_setup(void)
 /*--------------------------------------------------------------------------*/
 
 /*
- *
  * 1000Hz timer interrupt generated by System Timer
  */
 void sys_tick_handler(void)
@@ -38,6 +38,9 @@ void sys_tick_handler(void)
 
 /*--------------------------------------------------------------------------*/
 
+/*
+ * Return elapsed time in ms since base.
+ */
 uint32_t get_timer(uint32_t base)
 {
        return timestamp - base;