1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-03-22 19:15:43 +00:00

powerctl emulator

This commit is contained in:
tychovrahe 2025-03-11 03:40:11 +01:00
parent 4de53a3e3f
commit 0ef7d0634c
5 changed files with 40 additions and 0 deletions

View File

@ -43,6 +43,7 @@ backlight = []
usb = []
optiga = []
ble = []
powerctl = []
translations = ["crypto"]
test = [
"backlight",

View File

@ -0,0 +1,30 @@
/*
* This file is part of the Trezor project, https://trezor.io/
*
* Copyright (c) SatoshiLabs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <trezor_rtl.h>
#include <SDL.h>
bool powerctl_hibernate(void) {
exit(1);
return true;
}

View File

@ -58,6 +58,13 @@ def configure(
features_available.append("touch")
defines += [("USE_TOUCH", "1")]
sources += [
"embed/sys/powerctl/unix/powerctl.c",
]
defines += [("USE_POWERCTL", "1")]
paths += ["embed/sys/powerctl/inc"]
features_available.append("powerctl")
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]

View File

@ -235,6 +235,7 @@ def configure(
]
paths += ["embed/sys/powerctl/inc"]
defines += [("USE_POWERCTL", "1")]
features_available.append("powerctl")
env.get("ENV")["LINKER_SCRIPT"] = linker_script

View File

@ -240,6 +240,7 @@ def configure(
]
paths += ["embed/sys/powerctl/inc"]
defines += [("USE_POWERCTL", "1")]
features_available.append("powerctl")
env.get("ENV")["LINKER_SCRIPT"] = linker_script