Root/tornado/fw/boot.c

1#include <stdint.h>
2
3#define F_CPU 8000000UL
4#include <util/delay.h>
5
6#include "io.h"
7
8
9#define HIGH(port) \
10    (MASK(port, CARD_nPWR) | \
11    MASK(port, SW_N) | MASK(port, SW_E) | MASK(port, SW_S) | \
12    MASK(port, SW_W) | MASK(port, SW_SW))
13
14#define OUTPUTS(port) \
15    (MASK(port, CARD_nPWR) | MASK(port, CARD_CLK) | \
16    MASK(port, LED_DS) | MASK(port, LED_LCLK) | MASK(port, LED_SCLK))
17
18
19int main(void)
20{
21    PORTB = HIGH(B);
22    PORTC = HIGH(C);
23    PORTD = HIGH(D);
24    DDRB = OUTPUTS(B);
25    DDRC = OUTPUTS(C);
26    DDRD = OUTPUTS(D);
27
28    while (1);
29}
30

Archive Download this file

Branches:
master
tornado-v1



interactive