♻️ Refactor HAL as singleton (#23357)

This commit is contained in:
Scott Lahteine
2022-02-17 18:50:31 -06:00
parent fee85b318e
commit 44eff9a233
79 changed files with 1975 additions and 1417 deletions

View File

@@ -102,9 +102,9 @@ static SPISettings spiConfig;
// Soft SPI receive byte
uint8_t spiRec() {
DISABLE_ISRS(); // No interrupts during byte receive
hal.isr_off(); // No interrupts during byte receive
const uint8_t data = HAL_SPI_STM32_SpiTransfer_Mode_3(0xFF);
ENABLE_ISRS(); // Enable interrupts
hal.isr_on(); // Enable interrupts
return data;
}
@@ -116,9 +116,9 @@ static SPISettings spiConfig;
// Soft SPI send byte
void spiSend(uint8_t data) {
DISABLE_ISRS(); // No interrupts during byte send
hal.isr_off(); // No interrupts during byte send
HAL_SPI_STM32_SpiTransfer_Mode_3(data); // Don't care what is received
ENABLE_ISRS(); // Enable interrupts
hal.isr_on(); // Enable interrupts
}
// Soft SPI send block