From: Keith Packard Date: Sun, 13 Nov 2022 03:36:52 +0000 (-0800) Subject: samd21: Limit SPI baud value to 1 X-Git-Tag: 1.9.13~1^2~26^2~15 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=1cdcaea940864bbe531b32f228bc169b50f4d3a9 samd21: Limit SPI baud value to 1 Keep speeds slow enough Signed-off-by: Keith Packard --- diff --git a/src/samd21/ao_arch_funcs.h b/src/samd21/ao_arch_funcs.h index beb8d126..32670b45 100644 --- a/src/samd21/ao_arch_funcs.h +++ b/src/samd21/ao_arch_funcs.h @@ -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;