Skip to content

Commit 9d2dbfd

Browse files
committed
Merge branch 'bl-touch'
2 parents a55659e + c1b4e9b commit 9d2dbfd

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ customers cannot upgrade their bootloader, its changes are recorded separately.
152152

153153
### v1.0.7
154154
- Update manufacturer HID descriptor to bitbox.swiss
155+
- Remove qtouch code from production bootloader
155156

156157
### v1.0.6
157158
- Replace root pubkeys

src/CMakeLists.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,16 @@ set(DBB-BOOTLOADER-SOURCES ${DBB-BOOTLOADER-SOURCES} PARENT_SCOPE)
125125
set(DRIVER-SOURCES
126126
${CMAKE_SOURCE_DIR}/src/platform/platform_init.c
127127
${CMAKE_SOURCE_DIR}/src/platform/driver_init.c
128-
${CMAKE_SOURCE_DIR}/src/qtouch/qtouch.c
129128
${CMAKE_SOURCE_DIR}/src/ui/oled/oled.c
130129
${CMAKE_SOURCE_DIR}/src/ui/oled/oled_writer.c
131130
)
132131
set(DRIVER-SOURCES ${DRIVER-SOURCES} PARENT_SCOPE)
133132

133+
set(QTOUCH-SOURCES
134+
${CMAKE_SOURCE_DIR}/src/qtouch/qtouch.c
135+
)
136+
set(QTOUCH-SOURCES ${DRIVER-SOURCES} PARENT_SCOPE)
137+
134138
set(PLATFORM-BITBOX02-SOURCES
135139
${CMAKE_SOURCE_DIR}/src/sd_mmc/sd_mmc_start.c
136140
${CMAKE_SOURCE_DIR}/src/usb/class/hid/hid.c
@@ -180,6 +184,7 @@ set(FIRMWARE-SOURCES
180184
${DBB-FIRMWARE-UI-SOURCES}
181185
${FIRMWARE-DRIVER-SOURCES}
182186
${DRIVER-SOURCES}
187+
${QTOUCH-SOURCES}
183188
${SECURECHIP-SOURCES}
184189
${CMAKE_SOURCE_DIR}/src/common_main.c
185190
)
@@ -337,6 +342,12 @@ set(BOOTLOADERS
337342
)
338343
set(BOOTLOADERS ${BOOTLOADERS} PARENT_SCOPE)
339344

345+
set(DEVDEVICE-BOOTLOADERS
346+
bootloader-development
347+
bootloader-development-locked
348+
bootloader-btc-development
349+
)
350+
340351
set(FIRMWARES
341352
firmware # Firmware MULTI
342353
firmware-btc # Firmware BTC-ONLY
@@ -416,7 +427,6 @@ if(CMAKE_CROSSCOMPILING)
416427
target_include_directories(${elf} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/bootloader)
417428
target_link_libraries(${elf} PRIVATE "-Wl,-Map=\"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${bootloader}.map\" -T\"${CMAKE_SOURCE_DIR}/bootloader.ld\"")
418429
target_link_libraries(${elf} PRIVATE -Wl,--defsym=STACK_SIZE=${STACK_SIZE} -Wl,-defsym=HEAP_SIZE=${HEAP_SIZE})
419-
target_link_libraries(${elf} PRIVATE ${QTOUCHLIB_A} ${QTOUCHLIB_B} ${QTOUCHLIB_T})
420430

421431
target_link_libraries(${elf} PRIVATE ${bootloader}_rust_c)
422432

@@ -427,6 +437,12 @@ if(CMAKE_CROSSCOMPILING)
427437
target_link_libraries(${elf} PRIVATE --specs=nosys.specs)
428438
endforeach(bootloader)
429439

440+
foreach(bootloader ${DEVDEVICE-BOOTLOADERS})
441+
set(elf ${bootloader}.elf)
442+
target_link_libraries(${elf} PRIVATE ${QTOUCHLIB_A} ${QTOUCHLIB_B} ${QTOUCHLIB_T})
443+
target_sources(${elf} PRIVATE ${QTOUCH-SOURCES})
444+
endforeach(bootloader)
445+
430446
foreach(bootloader ${BOOTLOADERS-BITBOX02})
431447
target_sources(${bootloader}.elf PRIVATE ${PLATFORM-BITBOX02-SOURCES})
432448
endforeach(bootloader)

src/bootloader/startup.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919

2020
#include <driver_init.h>
2121
#include <hardfault.h>
22+
#ifdef BOOTLOADER_DEVDEVICE
2223
#include <qtouch.h>
24+
#endif
2325
#include <screen.h>
2426
#include <string.h>
2527
#include <usb/usb_processing.h>
@@ -49,7 +51,9 @@ int main(void)
4951
platform_init();
5052
__stack_chk_guard = rand_sync_read32(&RAND_0);
5153
screen_init();
54+
#ifdef BOOTLOADER_DEVDEVICE
5255
qtouch_init();
56+
#endif
5357
bootloader_jump();
5458

5559
// If did not jump to firmware code, begin USB processing

src/platform/driver_init.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ void bootloader_init(void)
307307
_oled_set_pins();
308308
_ptc_clock_init();
309309

310+
#ifdef BOOTLOADER_DEVDEVICE
311+
// Only needed for qtouch, which is only needed in the devdevice bootloader.
310312
_timer_peripheral_init();
313+
#endif
311314
_delay_driver_init();
312315

313316
// OLED

0 commit comments

Comments
 (0)