Skip to content

Commit

Permalink
feat(core/prodtest): add suspend command
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
cepetr committed Nov 25, 2024
1 parent 56faef0 commit 690fce2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/embed/projects/prodtest/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
#include "memzero.h"

#ifdef USE_POWERCTL
#include <sys/powerctl.h>
#include "../../sys/powerctl/npm1300/npm1300.h"
#include "../../sys/powerctl/stwlc38/stwlc38.h"
#endif
Expand Down Expand Up @@ -1013,6 +1014,18 @@ void test_wpc(const char *args) {
}
#endif // USE_POWERCTL

#ifdef USE_POWERCTL
void test_suspend(void) {
vcp_println("# Going to suspend mode (press power button to resume)");
systick_delay_ms(500);

powerctl_suspend();

systick_delay_ms(1500);
vcp_println("OK # Resumed");
}
#endif // USE_POWERCTL

#define BACKLIGHT_NORMAL 150

int main(void) {
Expand Down Expand Up @@ -1184,6 +1197,8 @@ int main(void) {
test_pmic(line + 5);
} else if (startswith(line, "WPC ")) {
test_wpc(line + 4);
} else if (startswith(line, "SUSPEND")) {
test_suspend();
#endif
} else {
vcp_println("UNKNOWN");
Expand Down

0 comments on commit 690fce2

Please sign in to comment.