1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-05-06 17:09:11 +00:00

feat(core/prodtest): add suspend command

[no changelog]
This commit is contained in:
cepetr 2024-12-10 09:53:59 +01:00 committed by cepetr
parent dda9d2ba36
commit 27b27df17d

View File

@ -78,6 +78,7 @@
#include "memzero.h" #include "memzero.h"
#ifdef USE_POWERCTL #ifdef USE_POWERCTL
#include <sys/powerctl.h>
#include "../../sys/powerctl/npm1300/npm1300.h" #include "../../sys/powerctl/npm1300/npm1300.h"
#include "../../sys/powerctl/stwlc38/stwlc38.h" #include "../../sys/powerctl/stwlc38/stwlc38.h"
#endif #endif
@ -1014,6 +1015,18 @@ void test_wpc(const char *args) {
} }
#endif // USE_POWERCTL #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 #define BACKLIGHT_NORMAL 150
int main(void) { int main(void) {
@ -1185,6 +1198,8 @@ int main(void) {
test_pmic(line + 5); test_pmic(line + 5);
} else if (startswith(line, "WPC ")) { } else if (startswith(line, "WPC ")) {
test_wpc(line + 4); test_wpc(line + 4);
} else if (startswith(line, "SUSPEND")) {
test_suspend();
#endif #endif
} else { } else {
vcp_println("UNKNOWN"); vcp_println("UNKNOWN");