projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/stm32f1: For some reason the DBG registers aren't always available
[fw/altos]
/
src
/
samd21
/
ao_arch_funcs.h
diff --git
a/src/samd21/ao_arch_funcs.h
b/src/samd21/ao_arch_funcs.h
index beb8d1262c796b47346a58999d03c85a788eca56..754ca3b51c3c84ecc4c8a6e2079ea64c8c8f54ba 100644
(file)
--- a/
src/samd21/ao_arch_funcs.h
+++ b/
src/samd21/ao_arch_funcs.h
@@
-282,12
+282,13
@@
ao_spi_put_bit(struct samd21_port *port, uint8_t bit, uint16_t spi_index)
}
static inline uint8_t
}
static inline uint8_t
-ao_spi_speed(uint32_t hz)
+ao_spi_speed(
int index,
uint32_t hz)
{
int32_t baud = (int32_t) (AO_SYSCLK / (2 * hz)) - 1;
{
int32_t baud = (int32_t) (AO_SYSCLK / (2 * hz)) - 1;
- if (baud < 0)
- baud = 0;
+ (void) index;
+ if (baud < 1)
+ baud = 1;
if (baud > 255)
baud = 255;
return (uint8_t) baud;
if (baud > 255)
baud = 255;
return (uint8_t) baud;