X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fsamd21%2Fao_arch_funcs.h;h=32670b45ca1897bc1f6a3016a4fd9c1cf4902930;hb=e959061fa17e15dfdd75d35c6c67e68a0e5e98e2;hp=141a9a205b7b32a144902d3912e76b6af9a85ed0;hpb=a06c84a27bd760039c522460f79bfe242d2d22c8;p=fw%2Faltos diff --git a/src/samd21/ao_arch_funcs.h b/src/samd21/ao_arch_funcs.h index 141a9a20..32670b45 100644 --- a/src/samd21/ao_arch_funcs.h +++ b/src/samd21/ao_arch_funcs.h @@ -190,11 +190,11 @@ ao_enable_cs(struct samd21_port *port, uint8_t pin) /* * PA22 SERCOM3.0 -> MOSI (DOPO 0) * PA23 SERCOM3.1 -> SCLK (DOPO 0) - * PA20 SERCOM3.3 -> MISO (DIPO 3) + * PA20 SERCOM3.2 -> MISO (DIPO 2) */ #define AO_SPI_3_PA22_PA23_PA20 (3 | AO_SPI_CONFIG_0 | \ AO_SPI_DOPO_MOSI_0_SCLK_1 | \ - AO_SPI_DIPO_MISO_3) + AO_SPI_DIPO_MISO_2) #endif /* HAS_SPI_3 */ #if HAS_SPI_4 @@ -286,8 +286,8 @@ ao_spi_speed(uint32_t hz) { int32_t baud = (int32_t) (AO_SYSCLK / (2 * hz)) - 1; - if (baud < 0) - baud = 0; + if (baud < 1) + baud = 1; if (baud > 255) baud = 255; return (uint8_t) baud;