#pragma once #include #include "FreeRTOS.h" #include "stdio.h" #include "io_cli.h" #include "io_gsm.h" /* File identifier declarations. The XMacros use these. */ #define FILE_CLI __create_file(3) #define FILE_GSM __create_file(4) #define FILE_FATFS __create_file(100) // Anything higher is a FatFS file /* Default timeout for fread and fwrite. */ #define IO_DEFAULT_TIMEOUT 120 * configTICK_RATE_HZ /* The IO X-macros come from each header file, the syntax is * X(fileno, initfunc, readfunc, writefunc) */ #define IO_XMACROS \ IO_CLI_XMACRO \ IO_GSM_XMACRO /* High-level IO functions * In most cases everything should go through these or the functions * in stdio.h. */ void io_init(); // fread and fwrite with timeout option size_t fread2(void *ptr, size_t size, FILE *stream, portTickType timeout); size_t fwrite2(const void *ptr, size_t size, FILE *stream, portTickType timeout); /* IO clone support for debugging and logging. * Copies all read and written data on one file as writes to another file. */ // Returns false if list is full bool insert_io_clone(FILE *monitored, FILE *log); // Returns false if clone not found bool remove_io_clone(FILE *monitored, FILE *log);