We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 954a923 commit 75e4e34Copy full SHA for 75e4e34
main/src/user/pwr.c
@@ -18,6 +18,7 @@
18
19
#define TAG "pwr"
20
21
+static bool qc_mode = false;
22
static pwr_idx_t pwr_mode = PWR_IDX_DC;
23
24
static char pwr_mode_str[][8] = {
@@ -31,6 +32,10 @@ static char pwr_mode_str[][8] = {
31
32
33
void pwr_set_mode(pwr_idx_t idx)
34
{
35
+ if (!qc_mode) {
36
+ return;
37
+ }
38
+
39
switch (idx) {
40
default:
41
case PWR_IDX_QC_5V:
@@ -114,6 +119,8 @@ void pwr_init(void)
114
119
return;
115
120
}
116
121
122
+ qc_mode = true;
123
117
124
size_t length = sizeof(pwr_mode);
118
125
app_getenv("PWR_INIT_CFG", &pwr_mode, &length);
126
0 commit comments