diff --git a/libraries/AP_HAL_Linux/Util.h b/libraries/AP_HAL_Linux/Util.h index 08fd9a5a1d..36ee1507d5 100644 --- a/libraries/AP_HAL_Linux/Util.h +++ b/libraries/AP_HAL_Linux/Util.h @@ -2,7 +2,9 @@ #ifndef __AP_HAL_LINUX_UTIL_H__ #define __AP_HAL_LINUX_UTIL_H__ +#include #include + #include "AP_HAL_Linux_Namespace.h" #include "ToneAlarmDriver.h" @@ -40,8 +42,19 @@ public: uint32_t available_memory(void) override; - int write_file(const char *path, const char *fmt, ...); - int read_file(const char *path, const char *fmt, ...); + /* + * Write a string as specified by @fmt to the file in @path. Note this + * should not be used on hot path since it will open, write and close the + * file for each call. + */ + int write_file(const char *path, const char *fmt, ...) FORMAT(3, 4); + + /* + * Read a string as specified by @fmt from the file in @path. Note this + * should not be used on hot path since it will open, read and close the + * file for each call. + */ + int read_file(const char *path, const char *fmt, ...) FMT_SCANF(3, 4); private: static Linux::ToneAlarm _toneAlarm;