cosmetics

This commit is contained in:
midelic 2016-09-19 21:21:24 +01:00 committed by GitHub
parent 62f96c3105
commit a5c1b2e5d2

View File

@ -82,7 +82,9 @@ void spi_write(uint8_t command)
{ {
uint8_t n=8; uint8_t n=8;
SCK_off;//SCK start low SCK_off;//SCK start low
XNOP();
SDI_off; SDI_off;
XNOP();
do do
{ {
if(command&0x80) if(command&0x80)
@ -94,8 +96,9 @@ void spi_write(uint8_t command)
NOP(); NOP();
XNOP() ; XNOP() ;
XNOP() ; XNOP() ;
SCK_off;
command = command << 1; command = command << 1;
SCK_off;
XNOP() ;
} }
while(n--); while(n--);
SDI_on; SDI_on;
@ -129,8 +132,12 @@ uint8_t spi_read()
if(SDO_1) /// if(SDO_1) ///
result|=0x01; result|=0x01;
SCK_on; SCK_on;
XNOP();
XNOP();
NOP(); NOP();
SCK_off; SCK_off;
XNOP();
XNOP();
} }
return result; return result;
} }