Fix #1: Implement save function for calibration

This commit is contained in:
2020-08-16 12:52:16 +02:00
parent fa3c980207
commit 15d255778c
5 changed files with 29 additions and 9 deletions

View File

@@ -21,8 +21,10 @@
#ifndef __SETTINGS_SETTINGS_SD_CARD_H__
#define __SETTINGS_SETTINGS_SD_CARD_H__
#include <stdbool.h>
#define CALIBRATION_FILE_NAME "cal.toml"
int sd_card_settings_save_calibration(float sens_deviation, float offset);
int sd_card_settings_save_calibration(float sens_deviation, float offset, bool active);
#endif /* __SETTINGS_SETTINGS_SD_CARD_H__ */

View File

@@ -22,12 +22,14 @@
#ifndef __SETTINGS_SETTINGS_H__
#define __SETTINGS_SETTINGS_H__
#include <stdbool.h>
/**
* @brief Save the calibration
* @param sens_deviation
* @param offset
* @return 0 if successful, -1 if generic error, -2 if medium unavailable
*/
int settings_save_calibration(float sens_deviation, float offset);
int settings_save_calibration(float sens_deviation, float offset, bool active);
#endif /* __SETTINGS_SETTINGS_H__ */