projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/avr: SPI mutex is now held by the caller, not the SPI driver
[fw/altos]
/
src
/
avr
/
ao_spi_usart.c
diff --git
a/src/avr/ao_spi_usart.c
b/src/avr/ao_spi_usart.c
index 6ed708ff38faf9d09e3eb44ff13ee33aea3bc5ee..1996fcd9e98a9cee798aaaf3ace662c2b623924a 100644
(file)
--- a/
src/avr/ao_spi_usart.c
+++ b/
src/avr/ao_spi_usart.c
@@
-33,14
+33,12
@@
ao_spi_send(void __xdata *block, uint16_t len) __reentrant
{
uint8_t *d = block;
{
uint8_t *d = block;
- ao_mutex_get(&ao_spi_mutex);
while (len--) {
while (!(UCSR1A & (1 << UDRE1)));
UDR1 = *d++;
while (!(UCSR1A & (1 << RXC1)));
(void) UDR1;
}
while (len--) {
while (!(UCSR1A & (1 << UDRE1)));
UDR1 = *d++;
while (!(UCSR1A & (1 << RXC1)));
(void) UDR1;
}
- ao_mutex_put(&ao_spi_mutex);
}
/* Receive bytes over SPI.
}
/* Receive bytes over SPI.
@@
-54,14
+52,12
@@
ao_spi_recv(void __xdata *block, uint16_t len) __reentrant
{
uint8_t *d = block;
{
uint8_t *d = block;
- ao_mutex_get(&ao_spi_mutex);
while (len--) {
while (!(UCSR1A & (1 << UDRE1)));
UDR1 = 0;
while (!(UCSR1A & (1 << RXC1)));
*d++ = UDR1;
}
while (len--) {
while (!(UCSR1A & (1 << UDRE1)));
UDR1 = 0;
while (!(UCSR1A & (1 << RXC1)));
*d++ = UDR1;
}
- ao_mutex_put(&ao_spi_mutex);
}
/*
}
/*