瀏覽代碼

Merge pull request #59 from KurtE/T4-SPI_end

T4.x Implement SPI.end()
main
Paul Stoffregen 4 年之前
父節點
當前提交
d834af6a20
No account linked to committer's email address
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. +9
    -1
      SPI.cpp

+ 9
- 1
SPI.cpp 查看文件

@@ -1716,7 +1716,15 @@ void SPIClass::transfer(const void * buf, void * retbuf, size_t count)
}


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

Loading…
取消
儲存