universal7885: parts-aidl: Run clang-format on smartcharge impl

This commit is contained in:
roynatech2544 2022-11-09 18:55:35 +09:00
commit f2228a093e
2 changed files with 13 additions and 9 deletions

View file

@ -14,9 +14,9 @@
#include "SmartCharge.h"
#include <chrono>
#include <FileIO.h>
#include "BatteryConstants.h"
#include <FileIO.h>
#include <chrono>
namespace aidl::vendor::eureka::hardware::parts {
@ -24,17 +24,20 @@ void SmartCharge::battery_monitor(void) {
while (kShouldRun) {
auto batt = FileIO::readline(BATTERY_CAPACITY_CURRENT);
if (batt >= limit) {
if (kTookAction) goto sleep;
if (kTookAction)
goto sleep;
FileIO::writeline(BATTERY_CHARGE, 1);
kTookAction = true;
limit_stat += 1;
} else if (batt <= restart) {
if (kTookAction) goto sleep;
if (kTookAction)
goto sleep;
FileIO::writeline(BATTERY_CHARGE, 0);
kTookAction = true;
restart_stat += 1;
} else {
if (!kTookAction) goto sleep;
if (!kTookAction)
goto sleep;
kTookAction = false;
}
sleep:

View file

@ -28,6 +28,7 @@ struct SmartCharge : public BnSmartCharge {
::ndk::ScopedAStatus setConfig(int32_t limit, int32_t restart);
::ndk::ScopedAStatus getLimitCnt(int32_t *_aidl_return);
::ndk::ScopedAStatus getRestartCnt(int32_t *_aidl_return);
private:
int limit;
int restart;