Browse Source

T4.x Implement SPI.end()

The end method was a nop until now.

Now have it stop the SPI operations, plus sets the
MISO, MOSI. SCK pins into INPUT_DISABLE mode.
main
Kurt Eckhardt 4 years ago
parent
commit
495ae756f5
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      SPI.cpp

+ 9
- 1
SPI.cpp View File

} }




void SPIClass::end(){}
void SPIClass::end() {
// only do something if we have begun
if (hardware().clock_gate_register & hardware().clock_gate_mask) {
port().CR = 0; // turn off the enable
pinMode(hardware().miso_pin[miso_pin_index], INPUT_DISABLE);
pinMode(hardware().mosi_pin[mosi_pin_index], INPUT_DISABLE);
pinMode(hardware().sck_pin[sck_pin_index], INPUT_DISABLE);
}
}


//============================================================================= //=============================================================================
// ASYNCH Support // ASYNCH Support

Loading…
Cancel
Save