From 58533d2286d3070d6da34af443dadc26aa331a6b Mon Sep 17 00:00:00 2001 From: cepetr Date: Wed, 20 Nov 2024 16:24:20 +0100 Subject: [PATCH] TEMP - enable disc2 powerctl --- core/embed/io/button/stm32/button.c | 2 +- core/site_scons/models/D002/discovery2.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/embed/io/button/stm32/button.c b/core/embed/io/button/stm32/button.c index c80bcea958..4e73cd19bf 100644 --- a/core/embed/io/button/stm32/button.c +++ b/core/embed/io/button/stm32/button.c @@ -54,7 +54,7 @@ static void button_setup_pin(GPIO_TypeDef *port, uint16_t pin) { GPIO_InitTypeDef GPIO_InitStructure = {0}; GPIO_InitStructure.Mode = GPIO_MODE_INPUT; - GPIO_InitStructure.Pull = GPIO_PULLUP; + GPIO_InitStructure.Pull = GPIO_PULLDOWN; GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW; GPIO_InitStructure.Pin = pin; HAL_GPIO_Init(port, &GPIO_InitStructure); diff --git a/core/site_scons/models/D002/discovery2.py b/core/site_scons/models/D002/discovery2.py index e23511c914..bfb5710863 100644 --- a/core/site_scons/models/D002/discovery2.py +++ b/core/site_scons/models/D002/discovery2.py @@ -97,6 +97,16 @@ def configure( "USE_RESET_TO_BOOT=1", ] + sources += [ + "embed/sys/powerctl/npm1300/npm1300.c", + "embed/sys/powerctl/stwlc38/stwlc38.c", + "embed/sys/powerctl/stm32u5/powerctl.c", + "embed/sys/powerctl/stm32u5/powerctl_suspend.c", + "embed/sys/powerctl/wakeup_flags.c", + ] + paths += ["embed/sys/powerctl/inc"] + defines += ["USE_POWERCTL=1"] + env.get("ENV")["LINKER_SCRIPT"] = linker_script defs = env.get("CPPDEFINES_IMPLICIT")