Skip to content

Commit

Permalink
Merge pull request #78 from trilitech/ajinkyaraj-23@53-change-screens…
Browse files Browse the repository at this point in the history
…aver-setting-to-ledger-screensaver

Fix ledger comments + Remove custom code for screensaver
  • Loading branch information
spalmer25 authored Mar 21, 2024
2 parents 773eea3 + 299fc43 commit f38b83c
Show file tree
Hide file tree
Showing 33 changed files with 46 additions and 273 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ env
#ide
*.code-workspace
compile_commands.json
# Documentation files
doc/html
doc/latex
19 changes: 0 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,6 @@ all: show-app default
show-app:
@echo ">>>>> Building at commit $(COMMIT)"

##############
# Compiler #
##############

ifneq ($(BOLOS_ENV),)
$(info BOLOS_ENV=$(BOLOS_ENV))
CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/
GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/
CFLAGS += -idirafter $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/arm-none-eabi/include
else
$(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH)
endif
ifeq ($(CLANGPATH),)
$(info CLANGPATH is not set: clang will be used from PATH)
endif
ifeq ($(GCCPATH),)
$(info GCCPATH is not set: arm-none-eabi-* will be used from PATH)
endif

CFLAGS += -Wno-incompatible-pointer-types-discards-qualifiers

include $(BOLOS_SDK)/Makefile.standard_app
3 changes: 1 addition & 2 deletions src/apdu_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "to_string.h"
#include "ui.h"
#include "ui_delegation.h"
#include "ui_empty.h"

#include "cx.h"

Expand Down Expand Up @@ -183,7 +182,7 @@ static size_t baking_sign_complete(bool const send_hash, volatile uint32_t *flag
guard_baking_authorized(&G.parsed_baking_data, &global.path_with_curve);
result = perform_signature(true, send_hash);
#ifdef HAVE_BAGL
ux_empty_screen();
update_baking_idle_screens();
#endif
break;

Expand Down
3 changes: 1 addition & 2 deletions src/ui_bagl.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "memory.h"
#include "os_cx.h" // ui-menu
#include "to_string.h"
#include "ui_empty.h"

#include <stdbool.h>
#include <string.h>
Expand Down Expand Up @@ -63,7 +62,7 @@ static HomeContext_t home_context;
* - Exit screen
*
*/
UX_STEP_CB(ux_app_is_ready_step, nn, ux_empty_screen(), {"Application", "is ready"});
UX_STEP_NOCB(ux_app_is_ready_step, nn, {"Application", "is ready"});
UX_STEP_NOCB(ux_version_step, bnnn_paging, {"Tezos Baking", VERSION});
UX_STEP_NOCB(ux_chain_id_step, bnnn_paging, {"Chain", home_context.chain_id});
UX_STEP_NOCB(ux_authorized_key_step, bnnn_paging, {"Public Key Hash", home_context.authorized_key});
Expand Down
73 changes: 1 addition & 72 deletions src/ui_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,78 +20,7 @@
*/

#include "ui.h"
#include "ux.h"

#include "globals.h"
#include "os.h"

uint8_t io_event(unsigned char channel);

/**
* @brief Redefinition of lib_standard_app/io.io_event
*
* In order to disable ticker event handling to prevent
* screen-saver from starting
*
* @param channel: requested channel
* @return 1
*/
uint8_t io_event(__attribute__((unused)) unsigned char channel) {
// nothing done with the event, throw an error on the transport layer if
// needed

// can't have more than one tag in the reply, not supported yet.
switch (G_io_seproxyhal_spi_buffer[0]) {
#ifdef HAVE_NBGL
case SEPROXYHAL_TAG_FINGER_EVENT:
UX_FINGER_EVENT(G_io_seproxyhal_spi_buffer);
break;
#endif // HAVE_NBGL

case SEPROXYHAL_TAG_BUTTON_PUSH_EVENT:
#ifdef HAVE_BAGL
UX_BUTTON_PUSH_EVENT(G_io_seproxyhal_spi_buffer);
#endif // HAVE_BAGL
break;

case SEPROXYHAL_TAG_STATUS_EVENT:
if ((G_io_apdu_media == IO_APDU_MEDIA_USB_HID) &&
!(U4BE(G_io_seproxyhal_spi_buffer, 3) &
SEPROXYHAL_TAG_STATUS_EVENT_FLAG_USB_POWERED)) {
THROW(EXCEPTION_IO_RESET);
}
UX_DEFAULT_EVENT();
break;

case SEPROXYHAL_TAG_DISPLAY_PROCESSED_EVENT:
#ifdef HAVE_BAGL
UX_DISPLAYED_EVENT({});
#endif // HAVE_BAGL
#ifdef HAVE_NBGL
UX_DEFAULT_EVENT();
#endif // HAVE_NBGL
break;

case SEPROXYHAL_TAG_TICKER_EVENT:
#if defined(HAVE_BAGL)
// Disable ticker event handling to prevent screen saver from starting.
#else
UX_TICKER_EVENT(G_io_seproxyhal_spi_buffer, {});
#endif // HAVE_BAGL
break;
default:
UX_DEFAULT_EVENT();
break;
}

// close the event if not done previously (by a display or whatever)
if (!io_seproxyhal_spi_is_status_sent()) {
io_seproxyhal_general_status();
}

// command has been processed, DO NOT reset the current APDU transport
return 1;
}
#include "os_pin.h"

/**
* @brief Invalidates the pin to enforce its requirement.
Expand Down
96 changes: 0 additions & 96 deletions src/ui_empty.c

This file was deleted.

34 changes: 0 additions & 34 deletions src/ui_empty.h

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f38b83c

Please sign in to comment.