test

Dependencies:   mbed

Fork of 161006_BDK_SPIslave2 by CUBEBITE

Revision:
4:cc97d7a33efc
Parent:
3:4bb95aa46ebc
Child:
5:1ccdbfe5e4bb
diff -r 4bb95aa46ebc -r cc97d7a33efc main.cpp
--- a/main.cpp	Wed Oct 05 08:59:53 2016 +0000
+++ b/main.cpp	Thu Oct 06 00:11:39 2016 +0000
@@ -115,7 +115,7 @@
         
         
         
-        /* TODO "serial -> slave ----(SPI)-----> "
+        /* TODO "serial -> slave ----(SPI)-----> " */
         
         if(0 != pc_serial.readable())       // wait serial input..
         {   
@@ -126,21 +126,30 @@
         }        
         if(1 == spiTxReadyFlag)
         {
+            PRINTD("spiTxReadyFlag=%d\n",spiTxReadyFlag);
             // SPI Send Start
             
-            
+#if 0
             for(spiTxCnt = 0 ; spiTxCnt < serialRxLen + 1 ; ++spiTxCnt)
             {
                 //printf("send Cnt[%d] [0x%02X]\n", spiTxCnt, serialRxBuf[spiTxCnt]);                         
                 spi_slave.reply(serialRxBuf[spiTxCnt]);    
-            }   
+            } 
+#endif        
+            for(spiTxCnt = 0 ; spiTxCnt < 1 ; ++spiTxCnt)
+            {
+                //printf("send Cnt[%d] [0x%02X]\n", spiTxCnt, serialRxBuf[spiTxCnt]);
+                
+                spi_slave.reply(serialRxBuf[spiTxCnt]);    
+                PRINTD("reply=%c\n",serialRxBuf[spiTxCnt]);
+            }  
             
             
             spiTxReadyFlag = 0;
+            PRINTD("spiTxReadyFlag =0\n");
         }
         
-        */
-        
+