Embedded SDK
Embedded SDK
ux_layout_nn.c
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * Ledger Nano S - Secure firmware
4  * (c) 2022 Ledger
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  ********************************************************************************/
18 
19 #include "ux.h"
20 #include "ux_layout_common.h"
21 
22 #ifdef HAVE_UX_FLOW
23 
24 /*********************************************************************************
25  * 2 text lines
26  * Uses bb layout
27  */
28 
29 const bagl_element_t *ux_layout_nn_prepro(const bagl_element_t *element)
30 {
31  const bagl_element_t *e = ux_layout_strings_prepro(element);
32  if (e && G_ux.tmp_element.component.userid >= 0x10) {
33  G_ux.tmp_element.component.font_id
34  = BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER;
35  }
36  return e;
37 }
38 
39 void ux_layout_nn_init(unsigned int stack_slot)
40 {
41  ux_layout_bb_init_common(stack_slot);
42  G_ux.stack[stack_slot].screen_before_element_display_callback = ux_layout_nn_prepro;
43  ux_stack_display(stack_slot);
44 }
45 
46 #endif // HAVE_UX_FLOW
const bagl_element_t * ux_layout_strings_prepro(const bagl_element_t *element)
#define G_ux
Definition: ux_bagl.h:345
void ux_stack_display(unsigned int stack_slot)
Definition: ux_stack.c:331