BlinkenArea - GitList
Repositories
Blog
Wiki
mips_sys
Code
Commits
Branches
Tags
Search
Tree:
3bee72b
Branches
Tags
master
mips_sys
fw
main.c
added cycle counter peripheral
Stefan Schuermans
commited
3bee72b
at 2012-02-12 00:02:27
main.c
Blame
History
Raw
#include "cyc_cnt.h" #include "leds.h" volatile int data[100]; void delay() { unsigned int start = cyc_cnt_read(); while (cyc_cnt_read() - start < 10000000) /* wait */; } int main() { unsigned int i; for (i = 0; i < sizeof(data) / sizeof(data[0]); ++i) data[i] = i; while (1) { for (i = 0x1; i < 0x80; i <<= 1) { leds_set_state(i); delay(); } for (i = 0x80; i > 0x1; i >>= 1) { leds_set_state(i); delay(); } } return 0; }