Line data Source code
1 : /**
2 : * The MIT License (MIT)
3 : *
4 : * Copyright (c) 2021 RSK Labs Ltd
5 : *
6 : * Permission is hereby granted, free of charge, to any person obtaining a copy
7 : * of this software and associated documentation files (the "Software"), to
8 : * deal in the Software without restriction, including without limitation the
9 : * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 : * sell copies of the Software, and to permit persons to whom the Software is
11 : * furnished to do so, subject to the following conditions:
12 : *
13 : * The above copyright notice and this permission notice shall be included in
14 : * all copies or substantial portions of the Software.
15 : *
16 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 : * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 : * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 : * IN THE SOFTWARE.
23 : */
24 :
25 : #include <stddef.h>
26 : #include "os_io_seproxyhal.h"
27 : #include "defs.h"
28 : #include "signer_ux.h"
29 :
30 : // This 2-step expansion is necessary to force the preprocessor to expand the
31 : // numeric macros before stringifying them
32 : #define STRINGIFY(x) #x
33 : #define INT2STR(x) STRINGIFY(x)
34 :
35 : #define SIGNER_VERSION_STRING \
36 : INT2STR(VERSION_MAJOR) \
37 : "." INT2STR(VERSION_MINOR) "." INT2STR(VERSION_PATCH)
38 :
39 : // clang-format off
40 : static const bagl_element_t bagl_ui_info_nanos[] = {
41 : {
42 : {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000,
43 : 0xFFFFFF, 0, 0},
44 : NULL,
45 : 0,
46 : 0,
47 : 0,
48 : NULL,
49 : NULL,
50 : NULL,
51 : },
52 : {
53 : {BAGL_LABELINE, 0x02, 0, 12, 128, 11, 0, 0, 0, 0xFFFFFF, 0x000000,
54 : BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0},
55 : "Signer running...",
56 : 0,
57 : 0,
58 : 0,
59 : NULL,
60 : NULL,
61 : NULL,
62 : },
63 : {
64 : {BAGL_LABELINE, 0x03, 0, 26, 128, 11, 0, 0, 0, 0xFFFFFF, 0x000000,
65 : BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0},
66 : "Version: " SIGNER_VERSION_STRING,
67 : 0,
68 : 0,
69 : 0,
70 : NULL,
71 : NULL,
72 : NULL,
73 : }
74 : };
75 : // clang-format on
76 :
77 0 : static unsigned int bagl_ui_info_nanos_button(
78 : unsigned int button_mask, unsigned int button_mask_counter) {
79 : // no-op - button presses are handled directly in the event loop
80 0 : return 0;
81 : }
82 :
83 7 : void signer_ux_info(void) {
84 7 : UX_DISPLAY(bagl_ui_info_nanos, NULL);
85 7 : }
|