Added new functions to the watch face API such as watch_face_set_step_count_indicator or watch_face_is_in_use

This commit is contained in:
anschrammh 2023-03-30 13:24:48 +02:00
parent 61f7e21cb3
commit 6a9639700b
2 changed files with 28 additions and 2 deletions

View File

@ -469,7 +469,7 @@ void watch_face_set_bluetooth_indicator(WatchFace_t * const watchFace, Bluetooth
_set_bluetooth_indicator(watchFace);
}
void watch_face_set_step_count(WatchFace_t * const watchFace, uint32_t step_count)
void watch_face_set_step_count_indicator(WatchFace_t * const watchFace, uint32_t step_count)
{
if(!watchFace)
{
@ -524,3 +524,14 @@ void watch_face_force_sync(WatchFace_t *const watchFace)
update_watch_hands_angles(watchFace, 0);
}
bool watch_face_is_in_use(WatchFace_t * const watchFace)
{
if(!watchFace)
{
LV_LOG_ERROR("NULL pointer given !");
return false;
}
return watchFace->display != NULL;
}

View File

@ -125,7 +125,13 @@ void watch_face_set_battery_indicator(WatchFace_t * const watchFace, uint8_t lev
*/
void watch_face_set_bluetooth_indicator(WatchFace_t * const watchFace, BluetoothState_e bluetoothState);
void watch_face_set_step_count(WatchFace_t * const watchFace, uint32_t step_count);
/**
* @brief Shows the current step count passed as parameter on the watch face.
*
* @param watchFace a pointer to the watch face context structure.
* @param step_count the step count to show on the watch face.
*/
void watch_face_set_step_count_indicator(WatchFace_t * const watchFace, uint32_t step_count);
/**
* @brief Forces the watch face to sync up with the RTC by calling the provided date_time_cb
@ -134,6 +140,15 @@ void watch_face_set_step_count(WatchFace_t * const watchFace, uint32_t step_coun
*/
void watch_face_force_sync(WatchFace_t * const watchFace);
/**
* @brief Returns true if the watch face screen is currently being used and displayed.
*
* @param watchFace a pointer to the watch face context structure.
* @return true if the watch face screen is being used
* @return false if the watch face screen is not being used/displayed currently
*/
bool watch_face_is_in_use(WatchFace_t * const watchFace);
/**
* @brief Frees all resources used by the WatchFace object
*