mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Very small optimization.
This commit is contained in:
parent
8a9f16ed38
commit
3ee654bb12
1 changed files with 2 additions and 1 deletions
|
@ -153,9 +153,10 @@ uint8_t* MAX3421e< SPI_SS, INTR >::bytesWr(uint8_t reg, uint8_t nbytes, uint8_t*
|
||||||
data_p += nbytes;
|
data_p += nbytes;
|
||||||
#else
|
#else
|
||||||
SPDR = (reg | 0x02); //set WR bit and send register number
|
SPDR = (reg | 0x02); //set WR bit and send register number
|
||||||
while(nbytes--) {
|
while(nbytes) {
|
||||||
while(!(SPSR & (1 << SPIF))); //check if previous byte was sent
|
while(!(SPSR & (1 << SPIF))); //check if previous byte was sent
|
||||||
SPDR = (*data_p); // send next data byte
|
SPDR = (*data_p); // send next data byte
|
||||||
|
nbytes--;
|
||||||
data_p++; // advance data pointer
|
data_p++; // advance data pointer
|
||||||
}
|
}
|
||||||
while(!(SPSR & (1 << SPIF)));
|
while(!(SPSR & (1 << SPIF)));
|
||||||
|
|
Loading…
Reference in a new issue