Skip to content

Commit 0bf60dd

Browse files
authored
fix(legacy): fix OK-19317 (#392)
1 parent 6d616dc commit 0bf60dd

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

legacy/firmware/layout2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ void onboarding(uint8_t key) {
591591
"have fun\nwith your OneKey Classic."),
592592
NULL, NULL, NULL, NULL);
593593
key = protectWaitKey(0, 1);
594-
if (protectAbortedByInitialize) return;
594+
if (protectAbortedByInitializeOnboarding) return;
595595
if (key != KEY_CONFIRM) {
596596
goto done1;
597597
}
@@ -610,7 +610,7 @@ void onboarding(uint8_t key) {
610610
oledRefresh();
611611
}
612612
key = protectWaitKey(0, 1);
613-
if (protectAbortedByInitialize) return;
613+
if (protectAbortedByInitializeOnboarding) return;
614614
if (key != KEY_CONFIRM) {
615615
goto done1;
616616
}
@@ -629,7 +629,7 @@ void onboarding(uint8_t key) {
629629
oledRefresh();
630630
}
631631
key = protectWaitKey(0, 1);
632-
if (protectAbortedByInitialize) return;
632+
if (protectAbortedByInitializeOnboarding) return;
633633
if (key != KEY_CONFIRM) {
634634
goto done2;
635635
}

legacy/firmware/protect.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#define MAX_WRONG_PINS 15
4343

4444
bool protectAbortedByCancel = false;
45+
// allow the app to connect to the device when in the tutorial page
46+
bool protectAbortedByInitializeOnboarding = false;
4547
bool protectAbortedByInitialize = false;
4648
bool protectAbortedByTimeout = false;
4749
extern bool exitBlindSignByInitialize;
@@ -751,6 +753,7 @@ uint8_t protectWaitKey(uint32_t time_out, uint8_t mode) {
751753
uint8_t key = KEY_NULL;
752754

753755
protectAbortedByInitialize = false;
756+
protectAbortedByInitializeOnboarding = false;
754757
usbTiny(1);
755758
timer_out_set(timer_out_oper, time_out);
756759
while (1) {
@@ -784,6 +787,7 @@ uint8_t protectWaitKey(uint32_t time_out, uint8_t mode) {
784787
}
785788
}
786789
usbTiny(0);
790+
protectAbortedByInitializeOnboarding = protectAbortedByInitialize;
787791
if (protectAbortedByInitialize) {
788792
if (device_sleep_state) device_sleep_state = SLEEP_CANCEL_BY_USB;
789793
fsm_sendFailure(FailureType_Failure_ActionCancelled, NULL);

legacy/firmware/protect.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ void enter_sleep(void);
6565

6666
extern bool protectAbortedByCancel;
6767
extern bool protectAbortedByInitialize;
68+
extern bool protectAbortedByInitializeOnboarding;
6869
extern bool protectAbortedByTimeout;
6970
#endif

0 commit comments

Comments
 (0)