mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-12 17:57:53 +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;
|
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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user