Skip to content

Commit

Permalink
[clean] Flex migration first draft
Browse files Browse the repository at this point in the history
  • Loading branch information
lpascal-ledger committed Apr 26, 2024
1 parent ef798e7 commit 9ef1a28
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 24 deletions.
8 changes: 0 additions & 8 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ APP_LOAD_PARAMS = --appFlags 0x10 $(COMMON_LOAD_PARAMS) --curve secp256k1 --path

ifeq ($(TARGET_NAME), TARGET_NANOS)
ICONNAME=icons/nanos_app_recovery_check.gif
else ifeq ($(TARGET_NAME), TARGET_STAX)
else ifeq ($(TARGET_NAME), $(filter $(TARGET_NAME), TARGET_STAX TARGET_EUROPA))
ICONNAME=icons/stax_recovery_check_32px.gif
else
ICONNAME=icons/nanox_app_recovery_check.gif
Expand All @@ -55,7 +55,7 @@ DEFINES += BOLOS_APP_ICON_SIZE_B=\(9+32\)
DEFINES += IO_USB_MAX_ENDPOINTS=4 IO_HID_EP_LENGTH=64
DEFINES += HAVE_SPRINTF

ifneq ($(TARGET_NAME), TARGET_STAX)
ifneq ($(TARGET_NAME), $(filter $(TARGET_NAME), TARGET_STAX TARGET_EUROPA))
$(info Using BAGL)
DEFINES += HAVE_BAGL HAVE_UX_FLOW
else
Expand All @@ -67,7 +67,7 @@ ifeq ($(TARGET_NAME), TARGET_NANOS)
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128
else
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300
ifneq ($(TARGET_NAME), TARGET_STAX)
ifneq ($(TARGET_NAME), $(filter $(TARGET_NAME), TARGET_STAX TARGET_EUROPA))
DEFINES += HAVE_GLO096
DEFINES += BAGL_WIDTH=128 BAGL_HEIGHT=64
DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature
Expand Down Expand Up @@ -122,7 +122,7 @@ include $(BOLOS_SDK)/Makefile.glyphs
APP_SOURCE_PATH += src

ifneq ($(TARGET_NAME), TARGET_NANOS)
ifneq ($(TARGET_NAME), TARGET_STAX)
ifneq ($(TARGET_NAME), $(filter $(TARGET_NAME), TARGET_STAX TARGET_EUROPA))
SDK_SOURCE_PATH += lib_ux
endif
endif
Expand Down
2 changes: 1 addition & 1 deletion src/stax/mnemonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "../ux_common/common_bip39.h"
#include "./mnemonic.h"

#if defined(TARGET_STAX)
#if defined(SCREEN_SIZE_WALLET)

typedef struct buffer {
// the mnemonic passphrase, built over time
Expand Down
2 changes: 1 addition & 1 deletion src/stax/mnemonic.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <stdbool.h>
#include "constants.h"

#if defined(TARGET_STAX)
#if defined(SCREEN_SIZE_WALLET)

#define MAX_MNEMONIC_LENGTH (MNEMONIC_SIZE_24 * (MAX_WORD_LENGTH + 1))

Expand Down
9 changes: 4 additions & 5 deletions src/stax/passphrase_length_screen.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#include <os.h>
#include "glyphs.h"

#if defined(TARGET_STAX)
#if defined(SCREEN_SIZE_WALLET)

#include <nbgl_obj.h>

#define UPPER_MARGIN 4
#define BUTTON_DIAMETER 80
#define ICON_X 0
#define ICON_Y 148

Expand All @@ -27,7 +26,7 @@ nbgl_text_area_t *passphrase_length_set_title(nbgl_obj_t *align_to) {
textArea->textColor = BLACK;
textArea->text = "How long is your\nRecovery Phrase?";
textArea->textAlignment = CENTER;
textArea->fontId = BAGL_FONT_INTER_MEDIUM_32px;
textArea->fontId = LARGE_MEDIUM_FONT;
textArea->obj.area.width = SCREEN_WIDTH - 2 * BORDER_MARGIN;
textArea->obj.area.height = nbgl_getTextHeight(textArea->fontId, textArea->text);
textArea->style = NO_STYLE;
Expand All @@ -48,7 +47,7 @@ void passphrase_length_configure_buttons(nbgl_button_t **buttons, const size_t s
button->obj.area.width = SCREEN_WIDTH - 2 * BORDER_MARGIN;
button->obj.area.height = BUTTON_DIAMETER;
button->radius = BUTTON_RADIUS;
button->fontId = BAGL_FONT_INTER_SEMIBOLD_24px;
button->fontId = SMALL_BOLD_1BPP_FONT;
button->icon = NULL;
button->localized = true;
button->obj.alignmentMarginX = 0;
Expand All @@ -68,7 +67,7 @@ nbgl_button_t *passphrase_length_set_back_button() {
button->obj.area.height = BUTTON_DIAMETER;
button->radius = BUTTON_RADIUS;
button->text = NULL;
button->icon = &C_leftArrow32px;
button->icon = &LEFT_ARROW_ICON;
button->obj.alignmentMarginX = 0;
button->obj.alignmentMarginY = UPPER_MARGIN;
button->obj.alignment = TOP_LEFT;
Expand Down
2 changes: 1 addition & 1 deletion src/stax/passphrase_length_screen.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#if defined(TARGET_STAX)
#if defined(SCREEN_SIZE_WALLET)

nbgl_image_t *passphrase_length_set_icon(void);
nbgl_text_area_t *passphrase_length_set_title(nbgl_obj_t *align_to);
Expand Down
1 change: 1 addition & 0 deletions src/stax/ui_stax.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#if defined(HAVE_NBGL)

#include <nbgl_use_case.h>
#include <nbgl_layout.h>
#include <nbgl_fonts.h>
#include <nbgl_front.h>
#include <nbgl_debug.h>
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/app.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from ragger.firmware.stax.layouts import CenteredFooter, _Layout, LetterOnlyKeyboard, \
from ragger.firmware.nbgl.layouts import CenteredFooter, Element, LetterOnlyKeyboard, \
NavigationHeader, Suggestions
from ragger.firmware.stax.use_cases import UseCaseHomeExt, UseCaseSettings
from ragger.firmware.stax.screen import MetaScreen
from ragger.firmware.nbgl.use_cases import UseCaseHomeExt, UseCaseSettings
from ragger.firmware.nbgl.screen import MetaScreen


class CustomChoiceList(_Layout):
class CustomChoiceList(Element):

def choose(self, index: int):
assert 1 <= index <= 6, "Choice index must be in [1, 6]"
Expand Down

0 comments on commit 9ef1a28

Please sign in to comment.