Changed frequency to test,
authorMartin Prudek <prudemar@fel.cvut.cz>
Thu, 7 May 2015 14:44:39 +0000 (16:44 +0200)
committerMartin Prudek <prudemar@fel.cvut.cz>
Thu, 7 May 2015 14:44:39 +0000 (16:44 +0200)
pmsm-control/test_sw/main_pmsm.c

index 4e64f95..c9b9fe9 100644 (file)
@@ -439,8 +439,8 @@ void * read_data(void* param){
        set_priority(param);                            /*set priority*/
        pocatek = spi_read(tx);
                while(1){
-                       prepare_tx(tx);                 /*save the data to send*/
                        sem_wait(&thd_par_sem);         /*---take semaphore---*/
+                       prepare_tx(tx);                 /*save the data to send*/
                        data = spi_read(tx);            /*exchange data*/
                        /*subtract initiate postion */
                        rps.tf_count++;
@@ -462,7 +462,7 @@ void * read_data(void* param){
                                simple_hall_commutator(rps.duty);
                        }
                        sem_post(&thd_par_sem);         /*--post semaphore---*/
-                       usleep(1000);                           /*1kHz*/
+                       usleep(500);                            /*1kHz*/
                }
 }