feat(core): show red error header when USB data not connected

pull/2470/head
Ondrej Mikle 2 years ago committed by matejcik
parent a0287698d5
commit 72228e35cf

@ -1 +1 @@
Show blue dot when USB data pins are not connected
Show red error header when USB data pins are not connected

@ -66,3 +66,9 @@ const char *profile_sdcard_path(void) {
FILE_PATH(_sdcard_path, "/trezor.sdcard");
return _sdcard_path;
}
const char *profile_usb_disconnect_path(void) {
SVAR(_disconnect_path);
FILE_PATH(_disconnect_path, "/trezor.usb_data_disconnected");
return _disconnect_path;
}

@ -33,5 +33,6 @@ const char *profile_name(void);
const char *profile_dir(void);
const char *profile_flash_path(void);
const char *profile_sdcard_path(void);
const char *profile_usb_disconnect_path(void);
#endif // __TREZOR_PROFILE_H__

@ -27,6 +27,7 @@
#include <time.h>
#include <unistd.h>
#include "profile.h"
#include "touch.h"
#include "usb.h"
@ -252,7 +253,7 @@ void pendsv_kbd_intr(void) {}
void mp_hal_set_vcp_iface(int iface_num) {}
secbool usb_configured(void) {
if (access("/var/tmp/trezor.usb_data_disconnected", F_OK) == 0) {
if (access(profile_usb_disconnect_path(), F_OK) == 0) {
return secfalse;
}

@ -68,7 +68,7 @@ class Homescreen(HomescreenBase):
# Differs for each model
if not utils.usb_data_connected():
ui.display.bar(0, 0, 8, 8, ui.BLUE)
ui.header_error("NO USB CONNECTION")
# TODO: support homescreen avatar change for R and 1
if utils.MODEL in ("T",):

Loading…
Cancel
Save