test

Dependencies:   BLE_API nRF51822 mbed

Fork of KS7 by masaaki makabe

Branch:
KS3
Revision:
31:b5e19d153db4
Parent:
30:f67850cc3cfe
--- a/io.cpp	Mon May 23 05:15:58 2016 +0000
+++ b/io.cpp	Thu Jul 28 07:46:56 2016 +0000
@@ -1,5 +1,6 @@
 #include "io.h"
 #include "mbed.h"
+#include "common.h"
 
 // COL[2:0]: P0_27 P0_26 P0_21
 // ROW[7:0]: P0_19 P0_16 P0_15 P0_13 P0_12 P0_11 P0_09 P0_08
@@ -80,6 +81,7 @@
     _sg0 = new DigitalOut(P0_8, 0);
  #endif
 #else
+    // UART cannot use
     _sg0 = new DigitalOut(P0_8, 0);
     _sg1 = new DigitalOut(P0_9, 0);
     _sg2 = new DigitalOut(P0_11, 0);
@@ -186,6 +188,7 @@
     else _sg6->write(1);
     if ((d & 0x80) == 0) _sg7->write(0);
     else _sg7->write(1);
+    
 }
 
 uint8_t io::_set_segment(uint8_t d)
@@ -337,13 +340,27 @@
 //        _row_out[6] |= 0xf0; _row_out[7] |= 0x1f; // 6e-6f-6g-6h 7a-7b-7c-7d-7e
 
     // display unit ('G')
-#ifdef PCB_VER1
-        _row_out[6] |= 0xf0;
-        _row_out[7] |= 0x1f; // 6e-6f-6g-6h 7a-7b-7c-7d-7e
-#else
-        _row_out[6] |= 0xf0;
-        _row_out[7] |= 0xf4; // 6e-6f-6g-6h 7c-7e-7f-7g-7h
+/*S-------------------------------------------------------------------*/
+    display_unit();
+//#ifdef PCB_VER1
+//        _row_out[6] |= 0xf0;
+//        _row_out[7] |= 0x1f; // 6e-6f-6g-6h 7a-7b-7c-7d-7e
+//#else
+//        _row_out[6] |= 0xf0;
+//        _row_out[7] |= 0xf4; // 6e-6f-6g-6h 7c-7e-7f-7g-7h
+//#endif
+#if 0 /*debug*/
+        /*全灯*/
+        _row_out[0] = 0xff;
+        _row_out[1] = 0xff;
+        _row_out[2] = 0xff;
+        _row_out[3] = 0xff;
+        _row_out[4] = 0xff;
+        _row_out[5] = 0xff;
+        _row_out[6] = 0xff;
+        _row_out[7] = 0xff;
 #endif
+/*E-------------------------------------------------------------------*/
     }
 }