#define PRUM_SOUC 6183
static char doPrint = 1;
+static char error = 0;
/*
* \brief
state->log_col_count=LOG_DEF_COL;
for (r=0;r<LOG_ROWS;r++){
state->logs[r]=malloc(state->log_col_count*sizeof(int));
+ if (state->logs[r]==NULL){
+ error=1;
+ state->log_col_count=-1;
+ return;
+ }
}
+ state->doLogs=1;
}
/*
/* spustim zachytavani logu */
}else{
logInit(state);
- state->doLogs=1;
sem_post(&state->thd_par_sem);
}
}
printf("duty=%d\n",s.duty);
if (s.index_ok) printf("index ok\n");
if (s.commutate) printf("commutation in progress\n");
+ if (s.doLogs) printf("logujeme\n");
+ if (error) printf("error pri maloc logs!! \n");
+
}
}
rps.logs[0][rps.log_col]=(int)rps.tf_count;
rps.logs[1][rps.log_col]=(int)rps.spi_dat->pozice;
+ rps.logs[2][rps.log_col]=(int)rps.pwm1;
+ rps.logs[3][rps.log_col]=(int)rps.pwm2;
+ rps.logs[4][rps.log_col]=(int)rps.pwm3;
rps.log_col++;
-
+ /*
if (rps.log_col==rps.log_col_count-1){
rps.log_col_count*=2;
rps.log_col_count%=MAX_LOGS;
for (r=0;r<LOG_ROWS;r++){
rps.logs[r]=realloc(rps.logs[r],rps.log_col_count*sizeof(int));
+ if (rps.logs[r]==NULL){
+ rps.doLogs=0;
+ rps.error=1;
+ }
}
}
+ */
}
/*