naru naruken
/
mbed_blinky
measure MAC
main.cpp@0:62bb4b0c6b47, 2015-02-19 (annotated)
- Committer:
- naru
- Date:
- Thu Feb 19 16:14:17 2015 +0000
- Revision:
- 0:62bb4b0c6b47
measureMAC
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
naru | 0:62bb4b0c6b47 | 1 | #include "mbed.h" |
naru | 0:62bb4b0c6b47 | 2 | |
naru | 0:62bb4b0c6b47 | 3 | DigitalOut myled1(LED1); |
naru | 0:62bb4b0c6b47 | 4 | DigitalOut myled2(LED2); |
naru | 0:62bb4b0c6b47 | 5 | DigitalOut myled3(LED3); |
naru | 0:62bb4b0c6b47 | 6 | DigitalOut myled4(LED4); |
naru | 0:62bb4b0c6b47 | 7 | int main() { |
naru | 0:62bb4b0c6b47 | 8 | volatile int k; |
naru | 0:62bb4b0c6b47 | 9 | while(1) { |
naru | 0:62bb4b0c6b47 | 10 | for(int j=0;j<15;j++){ |
naru | 0:62bb4b0c6b47 | 11 | for(volatile int i=0;i<1000*1000;i++){ |
naru | 0:62bb4b0c6b47 | 12 | k+=i*j; |
naru | 0:62bb4b0c6b47 | 13 | k+=i*j; |
naru | 0:62bb4b0c6b47 | 14 | k+=i*j; |
naru | 0:62bb4b0c6b47 | 15 | k+=i*j; |
naru | 0:62bb4b0c6b47 | 16 | k+=i*j; |
naru | 0:62bb4b0c6b47 | 17 | k+=i*j; |
naru | 0:62bb4b0c6b47 | 18 | k+=i*j; |
naru | 0:62bb4b0c6b47 | 19 | k+=i*j; |
naru | 0:62bb4b0c6b47 | 20 | } |
naru | 0:62bb4b0c6b47 | 21 | myled1 = j & 0x0001; |
naru | 0:62bb4b0c6b47 | 22 | myled2 = j & 0x0002; |
naru | 0:62bb4b0c6b47 | 23 | myled3 = j & 0x0004; |
naru | 0:62bb4b0c6b47 | 24 | myled4 = j & 0x0008; |
naru | 0:62bb4b0c6b47 | 25 | } |
naru | 0:62bb4b0c6b47 | 26 | // wait(0.1); |
naru | 0:62bb4b0c6b47 | 27 | } |
naru | 0:62bb4b0c6b47 | 28 | } |