1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-04-15 23:05:45 +00:00

build(core): allow ble feature in emulator

[no changelog]
This commit is contained in:
Martin Milata 2025-04-08 16:01:34 +02:00
parent 69ce947d71
commit 62ea246ce1
3 changed files with 37 additions and 1 deletions

View File

@ -21,7 +21,7 @@ if BENCHMARK and PYOPT != '0':
print("BENCHMARK=1 works only with PYOPT=0.")
exit(1)
FEATURES_WANTED = ["input", "sd_card", "dma2d", "optiga"]
FEATURES_WANTED = ["input", "sd_card", "dma2d", "optiga", "ble"]
if not DISABLE_TROPIC:
FEATURES_WANTED.append('tropic')

View File

@ -0,0 +1,30 @@
#include <io/ble.h>
#include <trezor_rtl.h>
#include <stdlib.h>
bool ble_init(void) { return true; }
void ble_deinit(void) {}
void ble_start(void) {}
void ble_stop(void) {}
bool ble_issue_command(ble_command_t *command) { return true; }
bool ble_get_event(ble_event_t *event) { return false; }
void ble_get_state(ble_state_t *state) {
memset(state, 0, sizeof(ble_state_t));
}
bool ble_can_write(void) { return true; }
bool ble_write(const uint8_t *data, uint16_t len) { return len; }
bool ble_can_read(void) { return false; }
uint32_t ble_read(uint8_t *data, uint16_t max_len) { return 0; }
bool ble_get_mac(uint8_t *mac, size_t max_len) { return false; }

View File

@ -87,6 +87,12 @@ def configure(
features_available.append("touch")
defines += [("USE_TOUCH", "1")]
if "ble" in features_wanted:
sources += ["embed/io/ble/unix/ble.c"]
paths += ["embed/io/ble/inc"]
features_available.append("ble")
defines += [("USE_BLE", "1")]
features_available.append("backlight")
defines += [("USE_BACKLIGHT", "1")]