Added reading of irc_index position.
[fpga/rpi-motor-control.git] / pmsm-control / test_sw / main_pmsm.c
index 6219d69..7d707da 100644 (file)
@@ -67,6 +67,7 @@ void sighnd_fnc(){
 }
 
 void substractOffset(struct rpi_in* data, struct rpi_in* offset){
+       data->pozice_raw=data->pozice;
        data->pozice-=offset->pozice;
        return;
 }
@@ -100,6 +101,9 @@ void printData(struct rpi_in data){
        }
        puts("");
        printf("\npozice=%d\n",(int32_t)data.pozice);
+       printf("raw_pozice=%d\n",(int32_t)data.pozice_raw);
+       printf("raw_pozice last11=%u\n",(data.pozice_raw&0x7FF));
+       printf("index position=%d\n",(int16_t)data.index_position);
        printf("hal1=%d, hal2=%d, hal3=%d\n",data.hal1,data.hal2,data.hal3);
        printf("en1=%d, en2=%d, en3=%d (Last sent)\n",!!(0x40&test),!!(0x20&test),!!(0x10&test));
        printf("shdn1=%d, shdn2=%d, shdn3=%d (L.s.)\n",!!(0x08&test),!!(0x04&test),!!(0x02&test));