#include "components/ui_label.h"
#include "battery.h"
+#include "hal_tick.h"
+
+#ifdef __cplusplus
+#if __cplusplus
+extern "C" {
+#endif
+#endif
+
extern uint8_t battery_get_voltage(float *voltage);
+#ifdef XTS_SUPPORT
+extern uint8_t is_xts_test_done(void);
+#endif
+#ifdef __cplusplus
+#if __cplusplus
+}
+#endif
+#endif
+
namespace OHOS {
static constexpr int16_t SEC_TO_MILLI = 1000;
static constexpr int16_t USEC_TO_MILLI = 1000;
private:
UISweepClock *sweepClock{nullptr};
};
+
class ProgressCallback : public AnimatorCallback {
public:
explicit ProgressCallback(UIBoxProgress *progress, UILabel *label) : progress(progress), label(label) {}
//int value = std::rand() % 101; // 生成一个介于 0 和 100 之间的随机数
float voltage = 0.0F ;
// battery_get_voltage_by_channel(&voltage,channel);
- uint8_t value = battery_get_voltage(&voltage);
+ uint8_t value = 0 ;
+ uint8_t xts_testing = 0 ;
+
+ uint32_t RunTime_ = HALTick::GetInstance().GetTime();
+
+ #ifdef XTS_SUPPORT
+ xts_testing = is_xts_test_done();
+ #endif
+ if(xts_testing){
+ value = 0;
+ printf("bat check stamp %u xts_testing %u\r\n",RunTime_,xts_testing);
+ return ;
+ }else{
+ value = battery_get_voltage(&voltage);
+ printf("bat check stamp %u xts_testing %u\r\n",RunTime_,xts_testing);
+ }
char* progress1ForeImageSrc = nullptr;
char* progress1BackImageSrc = nullptr;
if (value <= 10) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "callBack new fail");
return false;
}
- clockAnimator = new Animator(callBack, mainSweepClock, 0, true);
+ clockAnimator = new Animator(callBack, mainSweepClock, 50, true);
if (clockAnimator == nullptr) {
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "clockAnimator new fail");
return false;
}
progress1callback_ = new ProgressCallback(progress,batteryLabel);
- progress1animator_ = new Animator(progress1callback_,progress,5000,true);
+ progress1animator_ = new Animator(progress1callback_,progress,10000,true);
progress1animator_->Start();
clockAnimator->Start();
SetCoverable(true);