Buffered Test
Dependencies: ExioBufferdController MCP23S17 mbed-rtos mbed
Diff: main.cpp
- Revision:
- 4:20ee7612edb9
- Parent:
- 3:ee7fd89f2539
- Child:
- 5:526691f54026
--- a/main.cpp Fri Nov 04 20:44:47 2016 +0000 +++ b/main.cpp Fri Nov 04 20:51:47 2016 +0000 @@ -42,7 +42,7 @@ //Thread::wait(10); } } -/* + void testExioBufferedIn() { printf("*** Test ExioBuffedIn ***\r\n"); @@ -50,7 +50,19 @@ // Reset MCP23S17 (初期化時にreset()が必要) Exio.reset(); - ExioInBuffer inBufferB(&Exio, ExioPortB, 1); + ExioInBuffer inBufferA(&Exio, ExioPortA); + ExioBufferedIn inA[] = { + ExioBufferedIn(&inBufferA, 0), + ExioBufferedIn(&inBufferA, 1), + ExioBufferedIn(&inBufferA, 2), + ExioBufferedIn(&inBufferA, 3), + ExioBufferedIn(&inBufferA, 4), + ExioBufferedIn(&inBufferA, 5), + ExioBufferedIn(&inBufferA, 6), + ExioBufferedIn(&inBufferA, 7) + }; + + ExioInBuffer inBufferB(&Exio, ExioPortB); ExioBufferedIn inB[] = { ExioBufferedIn(&inBufferB, 0), ExioBufferedIn(&inBufferB, 1), @@ -62,20 +74,26 @@ ExioBufferedIn(&inBufferB, 7) }; - inBufferB.run(); + inBufferA.run(10); + inBufferB.run(10); while (true) { for (int i = 0; i < 8; i++) { - int v = inB[i].read(); - printf("%d ", v); + int va = inA[i].read(); + printf("%d ", va); + } + putchar(' '); + for (int i = 0; i < 8; i++) { + int vb = inB[i].read(); + printf("%d ", vb); } printf("\r\n"); //Thread::wait(10); } } -*/ + int main() { - testExioInBuffer(); - //testExioBufferedIn(); + //testExioInBuffer(); + testExioBufferedIn(); } \ No newline at end of file