mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-24 15:28:10 +00:00
feat(core): show red error header when USB data not connected
This commit is contained in:
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…
Reference in New Issue
Block a user