Skip to content

Commit

Permalink
Add default warning bitmap
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Oct 25, 2024
1 parent 1b29c34 commit e314fbe
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion ledger_device_sdk/src/nbgl/nbgl_choice.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
use super::*;

const WARNING_64PX_BITMAP: [u8; 359] = [
0x40, 0x00, 0x40, 0x00, 0x21, 0x5f, 0x01, 0x00, 0x5d, 0x01, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0xff, 0x85, 0xd5, 0x31, 0x4e, 0xc3, 0x40, 0x10, 0x05, 0xd0, 0x8d, 0x85, 0x08,
0x4a, 0x45, 0x49, 0x91, 0xc2, 0x25, 0xb2, 0x52, 0xe4, 0x08, 0x39, 0x40, 0xc4, 0x19, 0x72, 0x82,
0x5c, 0x81, 0x84, 0x03, 0x80, 0xb8, 0x41, 0xc4, 0x05, 0x72, 0x04, 0x0a, 0xd2, 0xe7, 0x08, 0x69,
0x02, 0xa2, 0x0b, 0xa5, 0x13, 0xa1, 0x1d, 0xec, 0x99, 0x5d, 0xb3, 0xf6, 0xee, 0x1f, 0x6f, 0xfb,
0xc6, 0x96, 0xbc, 0xfe, 0x33, 0x43, 0x84, 0x4f, 0xb9, 0x27, 0xed, 0x5c, 0xf2, 0xeb, 0x93, 0xc2,
0xbf, 0x53, 0x63, 0x26, 0x0a, 0xcf, 0x8c, 0x31, 0x23, 0x9d, 0xb1, 0x5b, 0x66, 0xe8, 0x76, 0x51,
0xe1, 0x60, 0x06, 0x7d, 0x5d, 0x3f, 0xfc, 0xb8, 0x41, 0xce, 0xbc, 0x24, 0xe4, 0xcc, 0x73, 0x42,
0xfe, 0xea, 0x18, 0xf8, 0x9b, 0xe7, 0xb4, 0xef, 0x6a, 0x96, 0x7b, 0x4b, 0x39, 0x73, 0x41, 0xc8,
0x99, 0xef, 0x08, 0xf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, 0xf7, 0x93, 0x5f, 0x60, 0x23, 0x65,
0x3f, 0xe6, 0xba, 0x73, 0xa0, 0xc6, 0x3d, 0xfb, 0x99, 0xf4, 0x05, 0x5e, 0xcd, 0xcb, 0x3f, 0xe4,
0x2a, 0x7b, 0x24, 0x00, 0x08, 0x00, 0x00,
];

/// A wrapper around the asynchronous NBGL nbgl_useCaseChoice C API binding.
/// Draws a generic choice page, described in a centered info (with configurable icon),
/// thanks to a button and a footer at the bottom of the page.
Expand Down Expand Up @@ -31,7 +57,13 @@ impl<'a> NbglChoice<'a> {
unsafe {
let icon: nbgl_icon_details_t = match self.glyph {
Some(g) => g.into(),
None => nbgl_icon_details_t::default(),
None => nbgl_icon_details_t {
width: 64,
height: 64,
bpp: NBGL_BPP_4,
isFile: true,
bitmap: &WARNING_64PX_BITMAP as *const u8,
},
};
let message = CString::new(message).unwrap();
let sub_message = CString::new(sub_message).unwrap();
Expand Down

0 comments on commit e314fbe

Please sign in to comment.