X-Git-Url: http://cloudbase.mooo.com/gitweb/irmp-demo.git/blobdiff_plain/b1a276a15faaf6b4b74769021857850e818156b7..113f999d8cf296bb78f8652b1cc08fc323c7c4aa:/timer.c diff --git a/timer.c b/timer.c index 58a4d2f..5665098 100644 --- a/timer.c +++ b/timer.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2017 Leo C. + * (C) Copyright 20014 - 2017 Leo C. * * SPDX-License-Identifier: GPL-2.0 */ @@ -11,10 +11,11 @@ #include -/* 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;