K22 processor

Revision:
3:71278c5b7c67
Parent:
2:b188a511819f
Child:
4:fce988d27938
diff -r b188a511819f -r 71278c5b7c67 main.cpp
--- a/main.cpp	Sat Aug 15 19:55:02 2020 +0000
+++ b/main.cpp	Sun Aug 23 16:20:21 2020 +0200
@@ -6,7 +6,8 @@
 #include "mbed.h"
 #include "platform/mbed_thread.h"
 
-#include "IOspi.h"
+#include "IOtest.h"
+#include "IOboard.h"
 
 // Blinking rate in milliseconds
 #define BLINKING_RATE_MS                                                    200
@@ -18,7 +19,7 @@
 
 
 
-char tx_niz[] = { 7,0,1,2,3, 4, 5 , 6, 7, 8};
+
 
 void consolafun( void );
 Thread th_consola( consolafun );
@@ -29,7 +30,8 @@
 printf("\n\n\r ____________ POCETAK IOspi_______________\n\r");
 
     inic_IOspi( );
-    
+   // inicIOboard_spi( );
+    inicIOboard_spi( );
     DigitalOut ledB(LED3,1);
 
 int b = b2;
@@ -43,9 +45,11 @@
         if( b!= b2)
         {
             b = b2;
-        if( b ) { ledB = 1;}
-        else    { ledB = 0; static char c = 0; /*writeIOspiData( 0xa0, c++ );*/  transIOspiData( 1, 0xa, c++ );  }
+        if( b ) { /*ledB = 1;*/}
+        else    { /*ledB = 0;*/ static char c = 0; /*writeIOspiData( 0xa0, c++ );*/  
+                    transIOspiData( 1, 0xa, c++ );  }
         }
+        ThisThread::yield();
    
     }
 
@@ -88,6 +92,7 @@
         }
             break;
      }
-        
+     ThisThread::yield();   
+      thread_sleep_for(100);
     }
 }