Something went wrong on our end
-
dawehr authored
char arrays are still statically allocated, but will be truncated if trying to print more to them than space available, rather than just writing to random memory.
dawehr authoredchar arrays are still statically allocated, but will be truncated if trying to print more to them than space available, rather than just writing to random memory.
log_data.h 1.23 KiB
/*
* log_data.h
*
* Created on: Feb 20, 2016
* Author: ucart
*/
#ifndef LOG_DATA_H_
#define LOG_DATA_H_
#include "type_def.h"
#define LOG_STARTING_SIZE 8192 //262144 // 2^18 32768 2^15
// Maximum number of block outputs you can record, and maximum number of block parameters to record
#define MAX_LOG_NUM 50
void initialize_logging(log_t* log_struct, parameter_t* ps);
/**
* Adds the given block output to the data to be logged
*/
void addOutputToLog(log_t* log_struct, int controller_id, int output_id, char* units);
/**
* Adds the given block parameter to the data to be logged
*/
void addParamToLog(log_t* log_struct, int controller_id, int param_id, char* units);
/**
* @brief
* Logs the data obtained throughout the controller loop.
*
* @param log_struct
* structure of the data to be logged
*
* @return
* error message
*
*/
int log_data(log_t* log_struct, parameter_t* ps);
/**
* Fills up an xbox hueg amount of memory with log data
*/
void updateLog(log_t log_struct);
/**
* Prints all the log information.
*/
void printLogging(hardware_t *hardware_struct, log_t* log_struct, parameter_t* ps);
/**
* Resets and clears logged data
*/
void resetLogging();
#endif /* LOG_DATA_H_ */