X-Git-Url: http://git.droids-corp.org/?p=protos%2Fimu.git;a=blobdiff_plain;f=sd_log.h;h=d386126461d009f932ff0733c2c11ae5b65b08cc;hp=d2333e26286a2e381b2ceb3f41b25fbbe4a378cb;hb=849b29b998a8cbc10cd1900d3e5dd1a8488b77f6;hpb=a4e442441be45647f1115a59b7bff452910cf509 diff --git a/sd_log.h b/sd_log.h index d2333e2..d386126 100644 --- a/sd_log.h +++ b/sd_log.h @@ -1,7 +1,30 @@ #ifndef SD_LOG_H_ #define SD_LOG_H_ -struct fat_file_struct *open_log_file(void); -struct fat_file_struct *get_log_file(void); +/** + * open a log file on sd card. + * + * The format of the filename is "log%.4d". The choosen integer is the + * first file that doesn't exist on the sd card, starting from 0. + * + * @return + * 0 on success, negative value on error + */ +int8_t sd_log_open(void); + +/** + * Write a buffer in the log file + * + * This function fails (return -1)if the log file was not opened. + * + * @return + * number of written bytes on success, negative value en error + */ +intptr_t sd_log_write(const void *buffer, uintptr_t buffer_len); + +/** + * return true if log file was properly opened + */ +uint8_t sd_log_enabled(void); #endif