K22 processor

Revision:
18:6196688e2a94
Parent:
17:f99cdfd01d4e
diff -r f99cdfd01d4e -r 6196688e2a94 main.cpp
--- a/main.cpp	Sat May 15 13:59:57 2021 +0200
+++ b/main.cpp	Sun May 16 22:01:47 2021 +0200
@@ -44,22 +44,22 @@
 
 class C_data c_data;
 
-C_ledControl c_ledControl(&c_data);//( &c_ledLight);
+ C_ledControl c_ledControl(&c_data);//( &c_ledLight);
 
-C_spiProtokol c_spiProtokol( &c_data, &c_ledControl );
+ C_spiProtokol c_spiProtokol( &c_data, &c_ledControl );
 
 
 
 
-C_zeroCrossing c_zeroCrossing( &c_data);
+ C_zeroCrossing c_zeroCrossing( &c_data);
 
 
 
-C_zeroCrossing& rc_zc = c_zeroCrossing;
+// C_zeroCrossing& rc_zc = c_zeroCrossing;
 
-C_zcControl c_zcControl( &c_zeroCrossing, &c_spiProtokol);
+// C_zcControl c_zcControl( &c_zeroCrossing, &c_spiProtokol);
 
-C_ZC_CommandIndication c_zc_ci( &c_data, &c_zeroCrossing);
+ C_ZC_CommandIndication c_zc_ci( &c_data, &c_zeroCrossing);
 
 
 //Ticker test_RasaLed;
@@ -75,61 +75,63 @@
 
 printf("\n\n\r ____________ POCETAK IOboard_______________\n\r");
 
-s_log.resize(1000);
-s_log.clear();
+// s_log.resize(1000);
+// s_log.clear();
 
-printf( " capacity %d max_size %d size %d\n\r", s_log.capacity(), s_log.max_size(), s_log.size());
+// printf( " capacity %d max_size %d size %d\n\r", s_log.capacity(), s_log.max_size(), s_log.size());
 
 
-//test_RasaLed.attach_us([=]{ RasaLed = !RasaLed;}, 500000   );
+// //test_RasaLed.attach_us([=]{ RasaLed = !RasaLed;}, 500000   );
 
 
 
-int b = b2;
+// int b = b2;
  
-    /* konzolu napraciti kao klasu koja nasledjuje C_thread klasu */
-    extern void consolafun( void );
+//     /* konzolu napraciti kao klasu koja nasledjuje C_thread klasu */
+//     extern void consolafun( void );
 
-    Thread th_consola;
-    th_consola.start( consolafun);
+//     Thread th_consola;
+//     th_consola.start( consolafun);
 
 
 
-    /* cekanje da se procita prva ispravna adresa  sa dip switch-a  */
+//     /* cekanje da se procita prva ispravna adresa  sa dip switch-a  */
  
 
-    do       { ThisThread::sleep_for(10ms);;c_spiProtokol.inic_address( ); }
-    while   ( c_data.get_address() == 0 );
-                    printf(" adresa je = %d\n\r", c_data.get_address());
+//     do       { ThisThread::sleep_for(10ms);;c_spiProtokol.inic_address( ); }
+//     while   ( c_data.get_address() == 0 );
+//                     printf(" adresa je = %d\n\r", c_data.get_address());
 
-    //   postavljanje sopstvene adrese i prikaz na ledovima
-    c_spiProtokol.set_myAddress(c_data.get_address());
-    c_ledControl.set_colorTemplate_Green(); 
-    c_ledControl.set_ledView(adresa);
+//     //   postavljanje sopstvene adrese i prikaz na ledovima
+//     c_spiProtokol.set_myAddress(c_data.get_address());
+//     c_ledControl.set_colorTemplate_Green(); 
+//     c_ledControl.set_ledView(adresa);
 
 
-    while (true) 
-    {
+//     while (true) 
+//     {
 
 
-        if( b!= b2)
-        {
-            b = b2;
-        if( b ) { ledB = 1;}
-        else    { ledB = 0; //printf( " bitCount = %d, byteCount = %d\n\r", c_spiProtokol.get_bitCount(), c_spiProtokol.get_byteCount());  
+//         if( b!= b2)
+//         {
+//             b = b2;
+//         if( b ) { ledB = 1;}
+//         else    { ledB = 0; //printf( " bitCount = %d, byteCount = %d\n\r", c_spiProtokol.get_bitCount(), c_spiProtokol.get_byteCount());  
                 
-                printf( " zerocrossing timer on = %d   off = %d \n\r", c_zeroCrossing.get_zcTimeON(), c_zeroCrossing.get_zcTimeOFF());
-               // printf(" port in %x\n\r", rc_zc.s_portinMin.get_port() );
-                printf(" adresa je = %d\n\r", c_data.get_address());
-                }
-        }
+//                 printf( " zerocrossing timer on = %d   off = %d \n\r", c_zeroCrossing.get_zcTimeON(), c_zeroCrossing.get_zcTimeOFF());
+//                // printf(" port in %x\n\r", rc_zc.s_portinMin.get_port() );
+//                 printf(" adresa je = %d\n\r", c_data.get_address());
+//                 }
+//         }
     
-        c_spiProtokol.spi_monitor();
+//         c_spiProtokol.spi_monitor();
 
 
-        thread_sleep_for(BLINKING_RATE_MS);
-    }
-}
+//         thread_sleep_for(BLINKING_RATE_MS);
+//     }
+
+while(1);
+ }
 
 
 
@@ -182,4 +184,5 @@
      ThisThread::yield();   
       thread_sleep_for(100);
     }
+
 }