Logging function moved to separate file.
[fpga/rpi-motor-control.git] / pmsm-control / test_sw / cmd_proc.c
index cc92a0b..8f49e91 100644 (file)
@@ -3,6 +3,7 @@
 #include <string.h>
 
 #include "cmd_proc.h"
+#include "logs.h"
 
 #define PRUM_PROUD     2061
 #define PRUM_SOUC      6183
@@ -161,33 +162,7 @@ static void logInit(struct rpi_state* state){
        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();
-}
 
 /**
  * \brief