Ryo Od / Mbed 2 deprecated ExioBufferdController_Test

Dependencies:   ExioBufferdController MCP23S17 mbed-rtos mbed

Revision:
9:76d17c5cac87
Parent:
8:d511db400a09
Child:
10:5d1a09afe152
--- a/main.cpp	Fri Nov 04 23:16:46 2016 +0000
+++ b/main.cpp	Fri Nov 04 23:20:32 2016 +0000
@@ -149,11 +149,17 @@
     }
 }
 
+bool state = false;
 uint8_t count = 0;
+
 void pa7Falled() {
     count++;
 }
 
+void pa6Falled() {
+    state = !state;
+}
+
 void testExioBufferedPinDetect()
 {
     printf("*** Test ExioBufferedPinDetect ***\r\n");
@@ -162,18 +168,22 @@
     Exio.reset();
     
     ExioInBuffer inBufferA(&Exio, ExioPortA);
+    ExioBufferedPinDetect pinA6(&inBufferA, 6);
     ExioBufferedPinDetect pinA7(&inBufferA, 7);
     
     // assign callback functions
+    pinA6.attach_asserted(&pa6Falled);
+    pinA6.setAssertValue(0);
     pinA7.attach_asserted(&pa7Falled);
     pinA7.setAssertValue(0);
     
     // Start Timers
     inBufferA.run(5);
+    pinA6.setSampleFrequency(10000);
     pinA7.setSampleFrequency(10000);
             
     while (true) {
-        printf("%d\r\n", count);
+        printf("%d %d\r\n", state, count);
     }
 }