Hi,
I have code (snippet below) which uses SPI on the Teeny 4.1. The code works consistently when using the 1.57.2 Teensyduino in the Boards Manager in Arduino IDE 2.1.0.
When switching to 1.58 in the Boards Manager, the code causes the Teensy to restart (can be seen through the current consumption reducing). I see this in 1.58.1 as well.
It seems that any call to SPI1 makes the Teensy restart. I'm putting this in the `Bugs` forum as I couldn't find any mention of a new required initialization function for SPI in the changelogs, please let me know if this is incorrect. Thanks!
I have code (snippet below) which uses SPI on the Teeny 4.1. The code works consistently when using the 1.57.2 Teensyduino in the Boards Manager in Arduino IDE 2.1.0.
When switching to 1.58 in the Boards Manager, the code causes the Teensy to restart (can be seen through the current consumption reducing). I see this in 1.58.1 as well.
It seems that any call to SPI1 makes the Teensy restart. I'm putting this in the `Bugs` forum as I couldn't find any mention of a new required initialization function for SPI in the changelogs, please let me know if this is incorrect. Thanks!
Code:
SPI1.beginTransaction(_spi_settings);
digitalWriteFast(_cs_pin, LOW);
// Send command
SPI1.transfer(tx_buf, rx_buf, sizeof(tx_buf));
response = buf_to_val(rx_buf);
place_response(response);
_write_reg_flag = true;
// Update tx_buf with reg_val
val_to_buf(reg_val, tx_buf);
SPI1.transfer(tx_buf, rx_buf, sizeof(tx_buf));
// Read in the incoming data and throw it out
for(size_t i = 0; i < NUM + 1; i++) {
SPI1.transfer(NULL, rx_buf, sizeof(rx_buf));
}
// End the SPI communication
digitalWriteFast(_cs_pin, HIGH);
SPI1.endTransaction();