Revision 1543
Added a bunch of debug prints to the library
spi.c | ||
---|---|---|
27 | 27 |
int spi_init (spi_fun_recv_t recv_func, spi_fun_recv_complete_t recv_complete_func) |
28 | 28 |
{ |
29 | 29 |
if(spi_initd) { |
30 |
DRAGONFLY_DEBUG_PRINT("ERROR: SPI already init'd\r\n"); |
|
30 | 31 |
return ERROR_INIT_ALREADY_INITD; |
31 | 32 |
} |
32 | 33 |
|
... | ... | |
58 | 59 |
**/ |
59 | 60 |
int spi_transfer(char bytes) |
60 | 61 |
{ |
61 |
if(!spi_initd) |
|
62 |
return ERROR_LIBRARY_NOT_INITD; |
|
62 |
if(!spi_initd) { |
|
63 |
DRAGONFLY_DEBUG_PRINT("ERROR: SPI not init'd\r\n"); |
|
64 |
return ERROR_LIBRARY_NOT_INITD; |
|
65 |
} |
|
63 | 66 |
|
64 | 67 |
spi_bytes = bytes; |
65 | 68 |
PORTB &= ~SS; /* Set SS low to initiate transmission */ |
Also available in: Unified diff