aboutsummaryrefslogtreecommitdiffstats
path: root/wirish/time.h
diff options
context:
space:
mode:
authorMichael Hope <michael.hope@linaro.org>2010-09-29 20:45:57 +1300
committerMichael Hope <michael.hope@linaro.org>2010-09-29 20:45:57 +1300
commit6fcd4cd306dbecf56f5b0b506a3c23762d1219fa (patch)
tree467125eca5a2e6706001cad8e09bc475e58a12d9 /wirish/time.h
parent368e4fc1662c2594b2a0908900713a2555a3ed8e (diff)
parentadde11b099ff5dad176e410279d21feac39d2c7e (diff)
downloadlibrambutan-6fcd4cd306dbecf56f5b0b506a3c23762d1219fa.tar.gz
librambutan-6fcd4cd306dbecf56f5b0b506a3c23762d1219fa.zip
Merge remote branch 'upstream/master'
Diffstat (limited to 'wirish/time.h')
-rw-r--r--wirish/time.h32
1 files changed, 16 insertions, 16 deletions
diff --git a/wirish/time.h b/wirish/time.h
index f4612fa..742f28d 100644
--- a/wirish/time.h
+++ b/wirish/time.h
@@ -1,4 +1,4 @@
-/* *****************************************************************************
+/******************************************************************************
* The MIT License
*
* Copyright (c) 2010 Perry Hung.
@@ -20,10 +20,10 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
- * ****************************************************************************/
+ *****************************************************************************/
/**
- * @brief
+ * @brief Timing and delay functions.
*/
#ifndef _TIME_H
@@ -44,28 +44,28 @@ extern volatile uint32 systick_timer_millis;
/* time in milliseconds since boot */
static inline uint32 millis(void) {
- return systick_timer_millis;
+ return systick_timer_millis;
}
/* Time in microseconds since boot */
static inline uint32 micros(void) {
- uint32 ms;
- uint32 cycle_cnt;
- uint32 res;
+ uint32 ms;
+ uint32 cycle_cnt;
+ uint32 res;
- nvic_globalirq_disable();
+ nvic_globalirq_disable();
- cycle_cnt = systick_get_count();
- ms = millis();
+ cycle_cnt = systick_get_count();
+ ms = millis();
- nvic_globalirq_enable();
+ nvic_globalirq_enable();
- /* MAPLE_RELOAD_VAL is 1 less than the number of cycles it actually
- takes to complete a systick reload */
- res = (ms * US_PER_MS) +
- (MAPLE_RELOAD_VAL + 1 - cycle_cnt)/CYCLES_PER_MICROSECOND;
+ /* MAPLE_RELOAD_VAL is 1 less than the number of cycles it actually
+ takes to complete a systick reload */
+ res = (ms * US_PER_MS) +
+ (MAPLE_RELOAD_VAL + 1 - cycle_cnt)/CYCLES_PER_MICROSECOND;
- return res;
+ return res;
}
void delay(unsigned long ms);