3bee72bd74ac9da4521e5618715bafda31c0ff05
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

1) #include "cyc_cnt.h"
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

2) #include "leds.h"
3) 
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

4) volatile int data[100];
5) 
6) void delay()
7) {
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

8)   unsigned int start = cyc_cnt_read();
9)   while (cyc_cnt_read() - start < 10000000)
10)     /* wait */;
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

11) }
Stefan Schuermans initial firmware and testbed

Stefan Schuermans authored 12 years ago

12) 
13) int main()
14) {
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

15)   unsigned int i;
16) 
Stefan Schuermans added cycle counter peripheral

Stefan Schuermans authored 12 years ago

17)   for (i = 0; i < sizeof(data) / sizeof(data[0]); ++i)
18)     data[i] = i;
19) 
Stefan Schuermans slower LED animation for ex...

Stefan Schuermans authored 12 years ago

20)   while (1) {
21)     for (i = 0x1; i < 0x80; i <<= 1) {
22)       leds_set_state(i);
23)       delay();
24)     }
25)     for (i = 0x80; i > 0x1; i >>= 1) {
26)       leds_set_state(i);
27)       delay();
28)     }
29)   }
Stefan Schuermans added "LEDs" I/O peripheral...

Stefan Schuermans authored 12 years ago

30)