diff --git a/src/W800_SDK_v1.00.10/app/persistency/watch_settings.c b/src/W800_SDK_v1.00.10/app/persistency/watch_settings.c index 69ac077..179fab3 100644 --- a/src/W800_SDK_v1.00.10/app/persistency/watch_settings.c +++ b/src/W800_SDK_v1.00.10/app/persistency/watch_settings.c @@ -31,8 +31,8 @@ static const WatchSettings_t defaultWatchSettings = .notification = { .notification_vibration_duration = 3, .notification_vibration_strength = 6, - .vibrate_on_email = true, - .vibrate_on_sms = true, + .notification_vibrate_on_email = true, + .notification_vibrate_on_sms = true, }, .connectivity = { .connectivity_ble_enabled = false, @@ -93,7 +93,7 @@ void watch_settings_display_set_orientation(LCDOrientation_e orientation) _params_changed = true; } -void watch_settings_display_set_wrist_wakeup(bool wakeup) +void watch_settings_display_wrist_wakeup_enabled(bool wakeup) { watchSettings.display.display_wrist_wakeup = wakeup; _params_changed = true; @@ -141,8 +141,11 @@ void watch_settings_language_and_UI_set_language(TranslationLanguage_e language) _params_changed = true; } - - +void watch_settings_activity_step_counter_enabled(bool enabled) +{ + watchSettings.activity.activity_step_counter_en = enabled; + _params_changed = true; +} void persistency_init(void) { diff --git a/src/W800_SDK_v1.00.10/app/persistency/watch_settings.h b/src/W800_SDK_v1.00.10/app/persistency/watch_settings.h index 4307954..9833ab6 100644 --- a/src/W800_SDK_v1.00.10/app/persistency/watch_settings.h +++ b/src/W800_SDK_v1.00.10/app/persistency/watch_settings.h @@ -6,13 +6,13 @@ #include "translation.h" /** - * @brief The address in flash storage where the settings are saved + * @brief The address in flash storage where the settings are saved. * */ #define WATCH_SETTINGS_FLASH_STORAGE_ADDRESS (0x1E0000) /** - * @brief Time and Date Settings + * @brief Time and Date Settings. * */ typedef struct TimeAndDate @@ -23,7 +23,7 @@ typedef struct TimeAndDate } TimeAndDate_t; /** - * @brief Display Settings + * @brief Display Settings. * */ typedef struct Display @@ -37,28 +37,28 @@ typedef struct Display } Display_t; /** - * @brief Activity settings + * @brief Activity settings. * */ typedef struct Activity { - uint32_t activity_step_counter_en:1; + uint32_t activity_step_counter_en:1; // Not yet used } Activity_t; /** - * @brief Notification Settings + * @brief Notification Settings. * */ typedef struct Notification { - uint32_t vibrate_on_sms:1, - vibrate_on_email:1, + uint32_t notification_vibrate_on_sms:1, + notification_vibrate_on_email:1, notification_vibration_strength:3, notification_vibration_duration:3; } Notification_t; /** - * @brief Connectivity Settings + * @brief Connectivity Settings. * */ typedef struct Connectivity @@ -68,9 +68,9 @@ typedef struct Connectivity } Connectivity_t; /** - * @brief Language and UI Settings + * @brief Language and UI Settings. * - * @note Languages : English, French and German will be available + * @note Languages : English, French and German will be available. * */ typedef struct LanguageAndUI @@ -79,7 +79,24 @@ typedef struct LanguageAndUI } LanguageAndUI_t; /** - * @brief Main setting structure + * @brief Watch sensor calibration data if there are any. + * + * @note For the moment, only the magnetometer have some. + * + */ +typedef struct SensorCalibrationData +{ + int16_t sensor_calibration_data_magnetometer_x_min; + int16_t sensor_calibration_data_magnetometer_x_max; + int16_t sensor_calibration_data_magnetometer_y_min; + int16_t sensor_calibration_data_magnetometer_y_max; + int16_t sensor_calibration_data_magnetometer_z_min; + int16_t sensor_calibration_data_magnetometer_z_max; + float sensor_calibration_data_magnetometer_temperature_offset; +} SensorCalibrationData_t; + +/** + * @brief Main setting structure. * */ typedef struct WatchSettings @@ -91,6 +108,7 @@ typedef struct WatchSettings Connectivity_t connectivity; LanguageAndUI_t languageAndUI; Activity_t activity; + SensorCalibrationData_t sensorCalibrationData; } WatchSettings_t; /** @@ -140,7 +158,7 @@ void watch_settings_display_set_orientation(LCDOrientation_e orientation); * * @param wakeup */ -void watch_settings_display_set_wrist_wakeup(bool wakeup); +void watch_settings_display_wrist_wakeup_enabled(bool wakeup); /** * @brief @@ -191,6 +209,13 @@ void watch_settings_connectivity_set_wifi_enabled(bool enabled); */ void watch_settings_language_and_UI_set_language(TranslationLanguage_e language); +/** + * @brief + * + * @param enabled + */ +void watch_settings_activity_step_counter_enabled(bool enabled); + /**