mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-12 09:47:54 +00:00
cosmetics
This commit is contained in:
parent
62f96c3105
commit
a5c1b2e5d2
@ -82,7 +82,9 @@ void spi_write(uint8_t command)
|
||||
{
|
||||
uint8_t n=8;
|
||||
SCK_off;//SCK start low
|
||||
XNOP();
|
||||
SDI_off;
|
||||
XNOP();
|
||||
do
|
||||
{
|
||||
if(command&0x80)
|
||||
@ -94,8 +96,9 @@ void spi_write(uint8_t command)
|
||||
NOP();
|
||||
XNOP() ;
|
||||
XNOP() ;
|
||||
SCK_off;
|
||||
command = command << 1;
|
||||
SCK_off;
|
||||
XNOP() ;
|
||||
}
|
||||
while(n--);
|
||||
SDI_on;
|
||||
@ -129,8 +132,12 @@ uint8_t spi_read()
|
||||
if(SDO_1) ///
|
||||
result|=0x01;
|
||||
SCK_on;
|
||||
XNOP();
|
||||
XNOP();
|
||||
NOP();
|
||||
SCK_off;
|
||||
XNOP();
|
||||
XNOP();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user