mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-18 04:18:10 +00:00
refactor(core): make emulated dma2d usable outside of emulator
[no changelog]
This commit is contained in:
parent
ef2d2a3e75
commit
8154e5103f
@ -7,7 +7,6 @@ TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
|||||||
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||||
BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
|
BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
|
||||||
PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
|
PRODUCTION = 0 if BOOTLOADER_QA else ARGUMENTS.get('PRODUCTION', '0') == '1'
|
||||||
DMA2D = False
|
|
||||||
|
|
||||||
if TREZOR_MODEL in ('1', ):
|
if TREZOR_MODEL in ('1', ):
|
||||||
# skip bootloader build
|
# skip bootloader build
|
||||||
@ -144,13 +143,6 @@ SOURCE_TREZORHAL = [
|
|||||||
'embed/trezorhal/vectortable.s',
|
'embed/trezorhal/vectortable.s',
|
||||||
]
|
]
|
||||||
|
|
||||||
if DMA2D:
|
|
||||||
SOURCE_STMHAL.append('vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c')
|
|
||||||
SOURCE_TREZORHAL.append('embed/trezorhal/dma2d.c')
|
|
||||||
CPPDEFINES_MOD += [
|
|
||||||
'USE_DMA2D',
|
|
||||||
]
|
|
||||||
|
|
||||||
# fonts
|
# fonts
|
||||||
tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
tools.add_font('NORMAL', FONT_NORMAL, CPPDEFINES_MOD, SOURCE_MOD)
|
||||||
tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD)
|
tools.add_font('BOLD', FONT_BOLD, CPPDEFINES_MOD, SOURCE_MOD)
|
||||||
|
@ -9,7 +9,6 @@ PRODUCTION = ARGUMENTS.get('PRODUCTION', '0') == '1'
|
|||||||
BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
|
BOOTLOADER_QA = ARGUMENTS.get('BOOTLOADER_QA', '0') == '1'
|
||||||
EVERYTHING = BITCOIN_ONLY != '1'
|
EVERYTHING = BITCOIN_ONLY != '1'
|
||||||
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
TREZOR_MODEL = ARGUMENTS.get('TREZOR_MODEL', 'T')
|
||||||
DMA2D = TREZOR_MODEL in ('T', )
|
|
||||||
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
CMAKELISTS = int(ARGUMENTS.get('CMAKELISTS', 0))
|
||||||
|
|
||||||
|
|
||||||
@ -19,7 +18,7 @@ FEATURE_FLAGS = {
|
|||||||
"SYSTEM_VIEW": False,
|
"SYSTEM_VIEW": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
FEATURES_WANTED = ["input", "sbu", "sd_card", "rgb_led"]
|
FEATURES_WANTED = ["input", "sbu", "sd_card", "rgb_led", "dma2d"]
|
||||||
|
|
||||||
CCFLAGS_MOD = ''
|
CCFLAGS_MOD = ''
|
||||||
CPPPATH_MOD = []
|
CPPPATH_MOD = []
|
||||||
@ -383,17 +382,6 @@ SOURCE_TREZORHAL = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
if DMA2D:
|
|
||||||
CPPDEFINES_MOD += [
|
|
||||||
'USE_DMA2D',
|
|
||||||
]
|
|
||||||
SOURCE_TREZORHAL += [
|
|
||||||
'embed/trezorhal/dma2d.c',
|
|
||||||
]
|
|
||||||
SOURCE_STMHAL += [
|
|
||||||
'vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c',
|
|
||||||
]
|
|
||||||
|
|
||||||
CPPDEFINES_MOD += ['USE_SVC_SHUTDOWN']
|
CPPDEFINES_MOD += ['USE_SVC_SHUTDOWN']
|
||||||
|
|
||||||
if FEATURE_FLAGS["RDI"]:
|
if FEATURE_FLAGS["RDI"]:
|
||||||
@ -741,8 +729,6 @@ def cargo_build():
|
|||||||
features.append('ui')
|
features.append('ui')
|
||||||
if PYOPT == '0':
|
if PYOPT == '0':
|
||||||
features.append('ui_debug')
|
features.append('ui_debug')
|
||||||
if DMA2D:
|
|
||||||
features.append('dma2d')
|
|
||||||
|
|
||||||
features.extend(FEATURES_AVAILABLE)
|
features.extend(FEATURES_AVAILABLE)
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ if DMA2D:
|
|||||||
'USE_DMA2D',
|
'USE_DMA2D',
|
||||||
]
|
]
|
||||||
SOURCE_UNIX += [
|
SOURCE_UNIX += [
|
||||||
'embed/unix/dma2d.c',
|
'embed/lib/dma2d_emul.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dma2d.h"
|
|
||||||
#include "colors.h"
|
#include "colors.h"
|
||||||
#include "display_interface.h"
|
#include "display_interface.h"
|
||||||
|
|
@ -35,6 +35,12 @@ def configure(
|
|||||||
sources += ["embed/trezorhal/sbu.c"]
|
sources += ["embed/trezorhal/sbu.c"]
|
||||||
features_available.append("sbu")
|
features_available.append("sbu")
|
||||||
|
|
||||||
env.get("ENV")["TREZOR_BOARD"] = board
|
if "dma2d" in features_wanted:
|
||||||
|
defines += ["USE_DMA2D"]
|
||||||
|
sources += ["embed/trezorhal/dma2d.c"]
|
||||||
|
sources += ["vendor/micropython/lib/stm32lib/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c"]
|
||||||
|
features_available.append("dma2d")
|
||||||
|
|
||||||
|
env.get('ENV')['TREZOR_BOARD'] = board
|
||||||
|
|
||||||
return features_available
|
return features_available
|
||||||
|
Loading…
Reference in New Issue
Block a user