From 4b8cea3c7b3831cb5932fe4b1fe8c4d16c341ea3 Mon Sep 17 00:00:00 2001 From: cepetr Date: Mon, 25 Nov 2024 11:21:54 +0100 Subject: [PATCH] feat(core/prodtest): add suspend command [no changelog] --- core/embed/projects/prodtest/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/embed/projects/prodtest/main.c b/core/embed/projects/prodtest/main.c index 3906c625d1..6ad2f6e197 100644 --- a/core/embed/projects/prodtest/main.c +++ b/core/embed/projects/prodtest/main.c @@ -78,6 +78,7 @@ #include "memzero.h" #ifdef USE_POWERCTL +#include #include "../../sys/powerctl/npm1300/npm1300.h" #include "../../sys/powerctl/stwlc38/stwlc38.h" #endif @@ -1009,6 +1010,16 @@ void test_wpc(const char *args) { } } +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"); +} + #define BACKLIGHT_NORMAL 150 int main(void) { @@ -1180,6 +1191,8 @@ int main(void) { test_wpc(line + 4); } else if (startswith(line, "WPC")) { test_wpc(line + 3); + } else if (startswith(line, "SUSPEND")) { + test_suspend(); } else { vcp_println("UNKNOWN"); }