IO plocana FRDM K64

Revision:
11:f46528c56b8f
Parent:
7:4aa3dac73b66
diff -r 5de7b6e77c4a -r f46528c56b8f ZeroCrossing/ZeroCrossing.cpp
--- a/ZeroCrossing/ZeroCrossing.cpp	Mon Mar 29 21:53:19 2021 +0200
+++ b/ZeroCrossing/ZeroCrossing.cpp	Tue Mar 30 17:05:48 2021 +0200
@@ -11,26 +11,27 @@
 
 InterruptIn zc( ZC_PIN );
 
-DigitalOut dout6(PTB2, 1 );
-DigitalOut dout5(PTB3, 1 );
-DigitalOut dout4(PTB10, 1 );
-DigitalOut dout3(PTB11, 1 );
-DigitalOut dout2(PTC11, 1 );
-DigitalOut dout1(PTC10, 1 );
+
+
+#define Dout(n)   dout##n(PIN_OUT_##n, 1)
+
+DigitalOut Dout(6);
+DigitalOut Dout(5);
+DigitalOut Dout(4);
+DigitalOut Dout(3);
+DigitalOut Dout(2);
+DigitalOut Dout(1);
 
-// DigitalIn din1( PTC1, PullUp);
-// DigitalIn din2( PTC2, PullUp);
-// DigitalIn din3( PTC3, PullDown);
-// DigitalIn din4( PTC4, PullUp);   // PROBLEM!!!!!
-// DigitalIn din5( PTC8, PullDown);
-// DigitalIn din6( PTC9, PullDown);
+
+#define Din(n)   din##n(PIN_IN_##n, PullUp)
 
-DigitalIn din6( PTC5, PullUp);
-DigitalIn din5( PTC7, PullUp);
-DigitalIn din4( PTC0, PullUp);
-DigitalIn din3( PTC9, PullUp);   
-DigitalIn din2( PTC8, PullUp);
-DigitalIn din1( PTC1, PullUp);
+DigitalIn Din(6);
+DigitalIn Din(5);
+DigitalIn Din(4);
+DigitalIn Din(3);
+DigitalIn Din(2);
+DigitalIn Din(1);
+
 
 
 /************************************************************************************************************************/