-/*
- * \brief
- * Initialize logs
- */
-static void logInit(struct rpi_state* state){
- int r;
- state->log_col=0;
- 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;
-}
-
-/*
- * \brief
- * Save logs
- */
-static void saveLogs(struct rpi_state* state){
- FILE *f;
- int r,s;
-
- f = fopen("logs.log", "w");
- if (f == NULL){
- printf("Error opening file!\n");
- return;
- }
-
- for (r=0;r<LOG_ROWS;r++){
- for(s=0;s<state->log_col-1;s++){ /*posledni sloupec je vevyplneny*/
- if (s==state->log_col-2){
- fprintf(f,"%d ",state->logs[r][s]);
- }else{
- fprintf(f,"%d, ",state->logs[r][s]);
- }
- }
- fprintf(f,"\r");
- }
- fclose(f);
- freeLogs();
-}
-