X-Git-Url: https://rtime.felk.cvut.cz/gitweb/fpga/rpi-motor-control.git/blobdiff_plain/526f31a42665da0c8d341f6532e579bd8bea2730..f11e0e40b525a7dfd9d452e02e676ee6cd0478a2:/pmsm-control/test_sw/logs.c diff --git a/pmsm-control/test_sw/logs.c b/pmsm-control/test_sw/logs.c index f6c2a5f..3a3e9cc 100644 --- a/pmsm-control/test_sw/logs.c +++ b/pmsm-control/test_sw/logs.c @@ -21,6 +21,25 @@ void freeLogs(struct rpi_state* this){ this->doLogs=0; } +/* + * \brief + * Initialize logs + */ +void logInit(struct rpi_state* state){ + int r; + state->log_col=0; + state->log_col_count=LOG_DEF_COL; + for (r=0;rlogs[r]=malloc(state->log_col_count*sizeof(int)); + if (state->logs[r]==NULL){ + state->error=1; + state->log_col_count=-1; + return; + } + } + state->doLogs=1; +} + /* * \brief * Makes log.