25#include "os_io_seph_ux.h"
34 for (i = 0; i < ARRAYLEN(
G_ux.stack) && i <
G_ux.stack_count; i++) {
36 if (
G_ux.stack[i].element_arrays[j].element_array == element_array) {
48 if (
G_ux.stack_count < ARRAYLEN(
G_ux.stack)) {
49 memset(&
G_ux.stack[
G_ux.stack_count], 0,
sizeof(
G_ux.stack[0]));
51 memset(&
G_ux.flow_stack[
G_ux.stack_count], 0,
sizeof(
G_ux.flow_stack[0]));
56 return G_ux.stack_count - 1;
61 unsigned int exit_code = BOLOS_UX_OK;
63 if (
G_ux.stack_count > 0) {
66 exit_code =
G_ux.stack[
G_ux.stack_count].exit_code_after_elements_displayed;
68 memset(&
G_ux.stack[
G_ux.stack_count], 0,
sizeof(
G_ux.stack[0]));
70 memset(&
G_ux.flow_stack[
G_ux.stack_count], 0,
sizeof(
G_ux.flow_stack[0]));
76 if (
G_ux.stack_count == 0) {
77 G_ux.exit_code = exit_code;
83 G_ux.stack[
G_ux.stack_count - 1].element_index = 0;
86 return G_ux.stack_count - 1;
99 if (
G_ux.stack_count > 0 &&
G_ux.stack_count <= ARRAYLEN(
G_ux.stack)) {
100 G_ux.stack[
G_ux.stack_count - 1].element_index = 0;
104 else if (
G_ux.stack_count == 0) {
105 if (
G_ux.exit_code == BOLOS_UX_OK) {
106 G_ux.exit_code = BOLOS_UX_REDRAW;
113 if (stack_slot >= ARRAYLEN(
G_ux.stack)) {
117 if (
G_ux.stack_count < ARRAYLEN(
G_ux.stack)) {
119 if (stack_slot != ARRAYLEN(
G_ux.stack) - 1) {
120 memmove(&
G_ux.stack[stack_slot + 1],
121 &
G_ux.stack[stack_slot],
122 (ARRAYLEN(
G_ux.stack) - (stack_slot + 1)) *
sizeof(
G_ux.stack[0]));
124 memmove(&
G_ux.flow_stack[stack_slot + 1],
125 &
G_ux.flow_stack[stack_slot],
126 (ARRAYLEN(
G_ux.flow_stack) - (stack_slot + 1)) *
sizeof(
G_ux.flow_stack[0]));
142 if (stack_slot > ARRAYLEN(
G_ux.stack) - 1) {
143 stack_slot = ARRAYLEN(
G_ux.stack) - 1;
147 if (stack_slot >=
G_ux.stack_count) {
154 if (stack_slot != ARRAYLEN(
G_ux.stack) - 1) {
155 memmove(&
G_ux.stack[stack_slot],
156 &
G_ux.stack[stack_slot + 1],
157 (ARRAYLEN(
G_ux.stack) - (stack_slot + 1)) *
sizeof(
G_ux.stack[0]));
160 memmove(&
G_ux.flow_stack[stack_slot],
161 &
G_ux.flow_stack[stack_slot + 1],
162 (ARRAYLEN(
G_ux.flow_stack) - (stack_slot + 1)) *
sizeof(
G_ux.flow_stack[0]));
181#ifdef HAVE_UX_STACK_INIT_KEEP_TICKER
183 unsigned int ticker_value =
G_ux.stack[stack_slot].ticker_value;
184 unsigned int ticker_interval =
G_ux.stack[stack_slot].ticker_interval;
188 memset(&
G_ux.stack[stack_slot], 0,
sizeof(
G_ux.stack[0]));
190#ifdef HAVE_UX_STACK_INIT_KEEP_TICKER
191 G_ux.stack[stack_slot].ticker_callback = ticker_callback;
192 G_ux.stack[stack_slot].ticker_value = ticker_value;
193 G_ux.stack[stack_slot].ticker_interval = ticker_interval;
197 G_ux.stack[stack_slot].exit_code_after_elements_displayed = BOLOS_UX_CONTINUE;
205 if (
G_ux.stack_count) {
206 if (
G_ux.stack[
G_ux.stack_count - 1].screen_before_element_display_callback) {
207 el =
G_ux.stack[
G_ux.stack_count - 1].screen_before_element_display_callback(element);
212 if ((
unsigned int) el != 1) {
223 unsigned int elem_idx;
224 unsigned int total_element_count;
228 total_element_count = 0;
231 if ((os_perso_isonboarded() != BOLOS_UX_OK || os_global_pin_is_validated() == BOLOS_UX_OK))
240 while (elem_idx < slot->element_arrays[i].element_array_count) {
249 if (
G_ux.exit_code != BOLOS_UX_CONTINUE) {
255 if ((
unsigned int) el != 1) {
258 io_seph_ux_display_bagl_element(element);
273 if (slot->displayed_callback) {
276 if (!slot->displayed_callback(0)) {
278 G_ux.exit_code = BOLOS_UX_CONTINUE;
291 if (
G_ux.stack_count > 0 && stack_slot + 1 ==
G_ux.stack_count) {
294 G_ux.stack[stack_slot].element_index = 0;
299 else if (stack_slot == -1UL ||
G_ux.stack_count == 0) {
300 if (
G_ux.exit_code == BOLOS_UX_OK) {
301 G_ux.exit_code = BOLOS_UX_REDRAW;
struct ux_stack_slot_s::@48 element_arrays[UX_STACK_SLOT_ARRAY_COUNT]
unsigned char element_arrays_count
bolos_task_status_t exit_code_after_elements_displayed
unsigned short element_index
const bagl_element_t * element_array
unsigned char element_array_count
#define UX_STACK_SLOT_COUNT
#define UX_STACK_SLOT_ARRAY_COUNT
unsigned int(* callback_int_t)(unsigned int)
unsigned int ux_flow_relayout(void)
unsigned int ux_stack_push(void)
unsigned int ux_stack_is_element_array_present(const bagl_element_t *element_array)
const bagl_element_t * ux_stack_display_element_callback(const bagl_element_t *element)
void ux_stack_display(unsigned int stack_slot)
void ux_stack_remove(unsigned int stack_slot)
void ux_stack_insert(unsigned int stack_slot)
void ux_stack_init(unsigned int stack_slot)
void ux_stack_display_elements(ux_stack_slot_t *slot)
void ux_stack_redisplay(void)
unsigned int ux_stack_pop(void)