Moved helper function used to vibrate the watch when an item was clicked to an other source file to clean things up
This commit is contained in:
parent
a5527b583c
commit
8ee9f96de2
@ -1,6 +1,5 @@
|
|||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
#include "watch_peripherals.h"
|
#include "watch_peripherals.h"
|
||||||
#include "watch_settings.h"
|
|
||||||
|
|
||||||
#include "app_log.h"
|
#include "app_log.h"
|
||||||
|
|
||||||
@ -60,13 +59,3 @@ void common_screen_header_update_title(const char * title)
|
|||||||
if(!*header_title_p)return;
|
if(!*header_title_p)return;
|
||||||
lv_label_set_text_static(*header_title_p, title);
|
lv_label_set_text_static(*header_title_p, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void common_screen_onclick_vibration(void)
|
|
||||||
{
|
|
||||||
uint16_t vibration_strength = (persistency_get_settings()->display.display_vibrate_on_touch_strength + 1)*32;
|
|
||||||
uint32_t vibration_duration_ms = 0;
|
|
||||||
if(persistency_get_settings()->display.display_vibrate_on_touch_duration)
|
|
||||||
vibration_duration_ms = persistency_get_settings()->display.display_vibrate_on_touch_duration*50 + 50;
|
|
||||||
|
|
||||||
watch_peripherals_vibrate(vibration_strength > 255 ? 255 : vibration_strength, vibration_duration_ms);
|
|
||||||
}
|
|
||||||
|
@ -19,10 +19,4 @@ void common_screen_header_component(lv_obj_t *parent, const char * title, lv_coo
|
|||||||
*/
|
*/
|
||||||
void common_screen_header_update_title(const char * title);
|
void common_screen_header_update_title(const char * title);
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Vibrate to give a feedback to the user when an item was clicked
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void common_screen_onclick_vibration(void);
|
|
||||||
|
|
||||||
#endif //COMMON_SCREEN_COMPONENTS_H
|
#endif //COMMON_SCREEN_COMPONENTS_H
|
||||||
|
Loading…
Reference in New Issue
Block a user