diff --git a/third_party/mfrc522_integration/mfrc522_rp2040_integration.c b/third_party/mfrc522_integration/mfrc522_rp2040_integration.c index 0ec3fb6..c3b4bee 100644 --- a/third_party/mfrc522_integration/mfrc522_rp2040_integration.c +++ b/third_party/mfrc522_integration/mfrc522_rp2040_integration.c @@ -166,8 +166,12 @@ uint8_t mfrc522_interface_spi_init(void) gpio_set_function(MFRC522_CFG_SPI_CLK_GPIO, GPIO_FUNC_SPI); gpio_set_function(MFRC522_CFG_SPI_SS_GPIO, GPIO_FUNC_SPI); - uint baudrate = MFRC522_CFG_SPI_SPEED_MHZ; - return (baudrate == spi_init(spi0, baudrate)) ? 0 : 1; + /* + * From the manual: + * "There is no guarantee that the baudrate requested can be achieved exactly; + * the nearest will be chosen and returned" + */ + return !spi_init(spi0, MFRC522_CFG_SPI_SPEED_MHZ); } /**