Skip to content

Commit 23a7d69

Browse files
committed
hww.c: extend REQ_INFO with the BitBox02 Plus platform
Based on the newly added memory flag.
1 parent 4d3fa3b commit 23a7d69

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/hww.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <memory/memory.h>
2020
#include <version.h>
2121

22+
#include <memory/memory_shared.h>
2223
#include <platform_config.h>
2324
#include <rust/rust.h>
2425
#include <usb/usb_packet.h>
@@ -60,8 +61,9 @@ typedef struct {
6061
* 1 byte: platform code:
6162
* - 0x00 - BitBox02
6263
* - 0x01 - BitBoxBase (deprecated)
64+
* - 0x02 - BitBox02Plus
6365
* 1 byte: edition code:
64-
* - For the BitBox02 edition:
66+
* - For the BitBox02 and BitBox02Plus edition:
6567
* - - 0x00 - Multi
6668
* - - 0x01 - Bitcoin-only
6769
* - For the BitBoxBase platform (deprecated):
@@ -84,14 +86,21 @@ static size_t _api_info(uint8_t* buf)
8486
memcpy((char*)current, DIGITAL_BITBOX_VERSION_SHORT, version_string_len);
8587
current += version_string_len;
8688

87-
// 1 byte platform code and 1 byte edition code
88-
#if PRODUCT_BITBOX_MULTI == 1 || PRODUCT_BITBOX02_FACTORYSETUP == 1
89-
*current = 0x00;
89+
// 1 byte platform code
90+
switch (memory_get_platform()) {
91+
case MEMORY_PLATFORM_BITBOX02_PLUS:
92+
*current = 0x02;
93+
break;
94+
default:
95+
*current = 0x00;
96+
break;
97+
}
9098
current++;
99+
100+
// 1 byte edition code
101+
#if PRODUCT_BITBOX_MULTI == 1 || PRODUCT_BITBOX02_FACTORYSETUP == 1
91102
*current = 0x00;
92103
#elif PRODUCT_BITBOX_BTCONLY == 1
93-
*current = 0x00;
94-
current++;
95104
*current = 0x01;
96105
#endif
97106
current++;

0 commit comments

Comments
 (0)