BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
c2b0401
Branches
Tags
master
mips_sys
fw
cyc_cnt.c
added file headers
Stefan Schuermans
commited
c2b0401
at 2012-04-08 11:54:40
cyc_cnt.c
Blame
History
Raw
/* MIPS I system * Copyright 2011-2012 Stefan Schuermans <stefan@schuermans.info> * Copyleft GNU public license V2 or later * http://www.gnu.org/copyleft/gpl.html */ #include "cyc_cnt.h" static volatile unsigned int *const cyc_cnt_ptr = (volatile unsigned int *)0x80001000; /** * @brief read cycle counter * @return cycle counter value */ unsigned int cyc_cnt_read(void) { return *cyc_cnt_ptr; } /** * @brief delay for a number of cycles * @param[in] cyc number of cycles */ void cyc_cnt_delay(unsigned int cyc) { unsigned int start = cyc_cnt_read(); while (cyc_cnt_read() - start < cyc) /* wait */; }