161006_BDK_SPIslave

Dependencies:   mbed

Fork of Nucleo_SPIslave_F303K8_KSS by CUBEBITE

Files at this revision

API Documentation at this revision

Comitter:
bcup
Date:
Thu Oct 06 00:11:39 2016 +0000
Parent:
3:4bb95aa46ebc
Commit message:
161006_BDK_SPIslave

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
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");
         }
         
-        */
-        
+