瀏覽代碼

handle odd byte with option to PUSHR_CONT

main
Kurt Eckhardt 8 年之前
父節點
當前提交
157095efe9
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. +4
    -1
      SPI.cpp

+ 4
- 1
SPI.cpp 查看文件

@@ -338,7 +338,10 @@ void SPIClass::transfer(void *buf, size_t count) {

// Now lets loop while we still have data to output
if (count & 1) {
KINETISK_SPI0.PUSHR = *p_write++ | SPI_PUSHR_CTAS(0);
if (count > 1)
KINETISK_SPI0.PUSHR = *p_write++ | SPI_PUSHR_CONT | SPI_PUSHR_CTAS(0);
else
KINETISK_SPI0.PUSHR = *p_write++ | SPI_PUSHR_CTAS(0);
count--;
}


Loading…
取消
儲存