Skip to content

Commit 75e4e34

Browse files
committed
pwr: do not update power mode in non-QC mode
1 parent 954a923 commit 75e4e34

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main/src/user/pwr.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#define TAG "pwr"
2020

21+
static bool qc_mode = false;
2122
static pwr_idx_t pwr_mode = PWR_IDX_DC;
2223

2324
static char pwr_mode_str[][8] = {
@@ -31,6 +32,10 @@ static char pwr_mode_str[][8] = {
3132

3233
void pwr_set_mode(pwr_idx_t idx)
3334
{
35+
if (!qc_mode) {
36+
return;
37+
}
38+
3439
switch (idx) {
3540
default:
3641
case PWR_IDX_QC_5V:
@@ -114,6 +119,8 @@ void pwr_init(void)
114119
return;
115120
}
116121

122+
qc_mode = true;
123+
117124
size_t length = sizeof(pwr_mode);
118125
app_getenv("PWR_INIT_CFG", &pwr_mode, &length);
119126

0 commit comments

Comments
 (0)