浏览代码

Teensy LC working :)

main_ledos
PaulStoffregen 7 年前
父节点
当前提交
730050ec46
共有 2 个文件被更改,包括 9 次插入1 次删除
  1. +8
    -1
      WS2812Serial.cpp
  2. +1
    -0
      examples/BasicTest/BasicTest.ino

+ 8
- 1
WS2812Serial.cpp 查看文件

@@ -135,7 +135,6 @@ void WS2812Serial::show()
while ((dma->CFG->DCR & DMA_DCR_ERQ)) {
yield();
}
#elif defined(KINETISL)
#endif
// wait 300us WS2812 reset time
uint32_t min_elapsed = ((numled * 34134) >> 10) + 300;
@@ -173,10 +172,18 @@ void WS2812Serial::show()
*fb++ = x;
} while (fb < stop);
}
#if defined(KINETISK)
dma->sourceBuffer(frameBuffer, numled * 8);
dma->transferSize(1);
dma->transferCount(numled * 8);
dma->disableOnCompletion();
dma->enable();
#elif defined(KINETISL)
dma->CFG->SAR = frameBuffer;
dma->CFG->DSR_BCR = 0x01000000;
dma->CFG->DSR_BCR = numled * 8;
dma->CFG->DCR = DMA_DCR_ERQ | DMA_DCR_CS | DMA_DCR_SSIZE(1) |
DMA_DCR_SINC | DMA_DCR_DSIZE(1) | DMA_DCR_D_REQ;
#endif
}


+ 1
- 0
examples/BasicTest/BasicTest.ino 查看文件

@@ -4,6 +4,7 @@ const int numled = 64;
const int pin = 1;

// Usable pins:
// Teensy LC: 1, 4, 5, 24
// Teensy 3.2: 1, 5, 8, 10, 20, 31
// Teensy 3.5: 1, 5, 8, 10, 20, 26, 32, 33, 48
// Teensy 3.6: 1, 5, 8, 10, 20, 26, 32, 33

正在加载...
取消
保存