mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2025-04-21 12:27:27 +03:00
atusb/fw2: further abstract board functions
- atusb.c (main), board.h (board_init), board.c (board_init): moved clock and I/O initialization to board file - board.h (led), board.c (led), atusb.c (main): abstracted LED setting in function "led" instead of open-coding it - spi.c (spi_init): set nSS to 1 before enabling the output, so that we don't generate what looks like an empty SPI transaction
This commit is contained in:
@@ -14,26 +14,15 @@
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* We start with a 1 MHz/8 clock. Disable the prescaler. */
|
||||
|
||||
CLKPR = 1 << CLKPCE;
|
||||
CLKPR = 0;
|
||||
|
||||
/* set up all the outputs; default port value is 0 */
|
||||
|
||||
OUT(LED);
|
||||
OUT(nRST_RF); /* resets the transceiver */
|
||||
OUT(SLP_TR);
|
||||
|
||||
board_init();
|
||||
spi_init();
|
||||
|
||||
reset_rf();
|
||||
|
||||
/* now we should be at 8 MHz */
|
||||
|
||||
SET(LED);
|
||||
led(1);
|
||||
_delay_ms(100);
|
||||
CLR(LED);
|
||||
led(0);
|
||||
|
||||
usb_init();
|
||||
ep0_init();
|
||||
|
||||
Reference in New Issue
Block a user