From db33611a6fb21140b6f6526d983284293f32b782 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Tue, 18 Sep 2018 16:26:22 +0300 Subject: [PATCH 01/26] Update main.c --- blue-app-helloworld/src/main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index c5ea2f0..79ded6a 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -25,7 +25,7 @@ unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; static const bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e); ux_state_t ux; - +char*name="Person"; // ******************************************************************************** // Ledger Blue specific UI // ******************************************************************************** @@ -125,7 +125,7 @@ static const bagl_element_t bagl_ui_sample_nanos[] = { { {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello World", + "Hello "+name, 0, 0, 0, @@ -161,8 +161,15 @@ static unsigned int bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { - case BUTTON_EVT_RELEASED | BUTTON_LEFT | BUTTON_RIGHT: // EXIT - io_seproxyhal_touch_exit(NULL); + case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT + name="ANTON"; + UX_REDISPLAY(); + break; + } + + case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT + name="URA"; + UX_REDISPLAY(); break; } return 0; From 9c933639bde431f287f42142c01f7f8f1a133832 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Thu, 20 Sep 2018 16:59:34 +0100 Subject: [PATCH 02/26] Update Makefile --- blue-app-helloworld/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blue-app-helloworld/Makefile b/blue-app-helloworld/Makefile index f791f59..6bceffb 100755 --- a/blue-app-helloworld/Makefile +++ b/blue-app-helloworld/Makefile @@ -15,6 +15,9 @@ # limitations under the License. #******************************************************************************* + +TARGET_ID = 0x31100002 #Nano S + ifeq ($(BOLOS_SDK),) $(error BOLOS_SDK is not set) endif From e2cf21116af5cbd6ec9d76c86104ae0cd883905a Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 11:22:29 +0100 Subject: [PATCH 03/26] Update Makefile --- blue-app-helloworld/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blue-app-helloworld/Makefile b/blue-app-helloworld/Makefile index 6bceffb..060bafe 100755 --- a/blue-app-helloworld/Makefile +++ b/blue-app-helloworld/Makefile @@ -48,7 +48,7 @@ DEFINES += CX_COMPLIANCE_141 ifneq ($(BOLOS_ENV),) $(info BOLOS_ENV=$(BOLOS_ENV)) -CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/ +CLANGPATH := /usr/bin/ GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/ else $(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH) @@ -60,7 +60,7 @@ ifeq ($(GCCPATH),) $(info GCCPATH is not set: arm-none-eabi-* will be used from PATH) endif -CC := $(CLANGPATH)clang +CC := $(CLANGPATH)clang-4.0 CFLAGS += -O3 -Os AS := $(GCCPATH)arm-none-eabi-gcc From 9f55b3b0ad3cd03604338e69e7b7fd2f69f8616d Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 12:19:43 +0100 Subject: [PATCH 04/26] Update main.c --- blue-app-helloworld/src/main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 79ded6a..97d6a7b 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -25,7 +25,7 @@ unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; static const bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e); ux_state_t ux; -char*name="Person"; +char*name="Hello, Person"; // ******************************************************************************** // Ledger Blue specific UI // ******************************************************************************** @@ -125,7 +125,7 @@ static const bagl_element_t bagl_ui_sample_nanos[] = { { {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello "+name, + name, 0, 0, 0, @@ -162,13 +162,12 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - name="ANTON"; + name="Hello, ANTON"; UX_REDISPLAY(); break; - } case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - name="URA"; + name="Hello, URA"; UX_REDISPLAY(); break; } From 5c68b47a5411216544fe01382cc3dde1cbdfee50 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 12:28:07 +0100 Subject: [PATCH 05/26] Update main.c --- blue-app-helloworld/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 97d6a7b..1636d7d 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -22,7 +22,7 @@ unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; -static const bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e); +static bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e); ux_state_t ux; char*name="Hello, Person"; @@ -30,7 +30,7 @@ char*name="Hello, Person"; // Ledger Blue specific UI // ******************************************************************************** -static const bagl_element_t bagl_ui_sample_blue[] = { +static bagl_element_t bagl_ui_sample_blue[] = { // { // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, // bgcolor, font_id, icon_id}, From b4a18d1199e60ca8aa493cabf199163af524c388 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 12:36:45 +0100 Subject: [PATCH 06/26] Update main.c --- blue-app-helloworld/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 1636d7d..fe2cd72 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -99,7 +99,7 @@ bagl_ui_sample_blue_button(unsigned int button_mask, // Ledger Nano S specific UI // ******************************************************************************** -static const bagl_element_t bagl_ui_sample_nanos[] = { +static bagl_element_t bagl_ui_sample_nanos[] = { // { // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, // bgcolor, font_id, icon_id}, @@ -174,7 +174,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, return 0; } -static const bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e) { +static bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e) { // Go back to the dashboard os_sched_exit(0); return NULL; From 1d15551c196c71f22a4b96fb484f7e9fcc46ff4e Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 12:44:27 +0100 Subject: [PATCH 07/26] Update main.c --- blue-app-helloworld/src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index fe2cd72..c52e4be 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -170,6 +170,10 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, name="Hello, URA"; UX_REDISPLAY(); break; + + case BUTTON_EVT_RELEASED | BUTTON_LEFT | BUTTON_RIGHT: // EXIT + io_seproxyhal_touch_exit(NULL); + break; } return 0; } From 88bed9cedfe8320f9a5b7c4686a4533cdfc0c986 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 12:48:04 +0100 Subject: [PATCH 08/26] Update main.c --- blue-app-helloworld/src/main.c | 120 +++++++++++++++++++++++++++++++-- 1 file changed, 116 insertions(+), 4 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index c52e4be..e8474e5 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -25,7 +25,7 @@ unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; static bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e); ux_state_t ux; -char*name="Hello, Person"; + // ******************************************************************************** // Ledger Blue specific UI // ******************************************************************************** @@ -125,7 +125,7 @@ static bagl_element_t bagl_ui_sample_nanos[] = { { {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - name, + "Hello,world", 0, 0, 0, @@ -162,12 +162,124 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - name="Hello, ANTON"; + bagl_element_t bagl_ui_sample_nanos[] = { + // { + // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, + // bgcolor, font_id, icon_id}, + // text, + // touch_area_brim, + // overfgcolor, + // overbgcolor, + // tap, + // out, + // over, + // }, + { + {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, + 0xFFFFFF, 0, 0}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, + BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, + "Hello,Anton", + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, + BAGL_GLYPH_ICON_CROSS}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, + BAGL_GLYPH_ICON_CHECK}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, +}; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - name="Hello, URA"; + bagl_element_t bagl_ui_sample_nanos[] = { + // { + // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, + // bgcolor, font_id, icon_id}, + // text, + // touch_area_brim, + // overfgcolor, + // overbgcolor, + // tap, + // out, + // over, + // }, + { + {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, + 0xFFFFFF, 0, 0}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, + BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, + "Hello,Ura", + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, + BAGL_GLYPH_ICON_CROSS}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, + BAGL_GLYPH_ICON_CHECK}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, +}; UX_REDISPLAY(); break; From 3e01f8acbde5fef2bac8db5f70bc51ace90d20ba Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 12:51:54 +0100 Subject: [PATCH 09/26] Update main.c --- blue-app-helloworld/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index e8474e5..58226b7 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -162,7 +162,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_element_t bagl_ui_sample_nanos[] = { + bagl_ui_sample_nanos[] = { // { // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, // bgcolor, font_id, icon_id}, @@ -223,7 +223,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_element_t bagl_ui_sample_nanos[] = { + bagl_ui_sample_nanos[] = { // { // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, // bgcolor, font_id, icon_id}, From ffa85f8b65670a89cdca4a1103a11beb8eb9b81e Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 12:54:23 +0100 Subject: [PATCH 10/26] Update main.c --- blue-app-helloworld/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 58226b7..100fda4 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -162,7 +162,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos[] = { + bagl_ui_sample_nanos = { // { // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, // bgcolor, font_id, icon_id}, @@ -223,7 +223,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos[] = { + bagl_ui_sample_nanos = { // { // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, // bgcolor, font_id, icon_id}, From 7025cc49c554941410995b44d0ba0f4f99b6f75f Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 13:05:56 +0100 Subject: [PATCH 11/26] Update main.c --- blue-app-helloworld/src/main.c | 120 +++------------------------------ 1 file changed, 9 insertions(+), 111 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 100fda4..d3214ae 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -100,17 +100,7 @@ bagl_ui_sample_blue_button(unsigned int button_mask, // ******************************************************************************** static bagl_element_t bagl_ui_sample_nanos[] = { - // { - // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, - // bgcolor, font_id, icon_id}, - // text, - // touch_area_brim, - // overfgcolor, - // overbgcolor, - // tap, - // out, - // over, - // }, + { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, 0xFFFFFF, 0, 0}, @@ -162,124 +152,32 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos = { - // { - // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, - // bgcolor, font_id, icon_id}, - // text, - // touch_area_brim, - // overfgcolor, - // overbgcolor, - // tap, - // out, - // over, - // }, - { - {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, - 0xFFFFFF, 0, 0}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, + bagl_ui_sample_nanos [0] = { + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello,Anton", - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, - BAGL_GLYPH_ICON_CROSS}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, - BAGL_GLYPH_ICON_CHECK}, - NULL, + "Hello,Ura", 0, 0, 0, NULL, NULL, NULL, - }, -}; + }; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos = { - // { - // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, - // bgcolor, font_id, icon_id}, - // text, - // touch_area_brim, - // overfgcolor, - // overbgcolor, - // tap, - // out, - // over, - // }, - { - {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, - 0xFFFFFF, 0, 0}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, + bagl_ui_sample_nanos [0] = { + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello,Ura", - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, - BAGL_GLYPH_ICON_CROSS}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, - BAGL_GLYPH_ICON_CHECK}, - NULL, + "Hello,Anton", 0, 0, 0, NULL, NULL, NULL, - }, -}; + }; UX_REDISPLAY(); break; From b1053fc4903c28576c3dadacf2930a690bc41006 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 13:18:21 +0100 Subject: [PATCH 12/26] Update main.c --- blue-app-helloworld/src/main.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index d3214ae..0388b0f 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -152,32 +152,14 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos [0] = { - {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, - BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello,Ura", - 0, - 0, - 0, - NULL, - NULL, - NULL, + bagl_ui_sample_nanos [0,2] ="Hello,Ura"; }; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos [0] = { - {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, - BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello,Anton", - 0, - 0, - 0, - NULL, - NULL, - NULL, - }; + bagl_ui_sample_nanos [0,2] ="Hello,Anton"; + UX_REDISPLAY(); break; From c13992a70e562414f4cc76a94bcf1f7d24c74dcb Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 13:26:14 +0100 Subject: [PATCH 13/26] Update main.c --- blue-app-helloworld/src/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 0388b0f..367dfef 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -152,14 +152,12 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos [0,2] ="Hello,Ura"; - }; + bagl_ui_sample_nanos [0,1] ="Hello,Ura"; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos [0,2] ="Hello,Anton"; - + bagl_ui_sample_nanos [0,1] ="Hello,Anton"; UX_REDISPLAY(); break; From 290e27294f70a5f73a2a2853c3340586ddb29f81 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 13:29:25 +0100 Subject: [PATCH 14/26] Update main.c --- blue-app-helloworld/src/main.c | 96 +++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 2 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 367dfef..433f724 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -152,12 +152,104 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos [0,1] ="Hello,Ura"; + bagl_ui_sample_nanos = { + + { + {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, + 0xFFFFFF, 0, 0}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, + BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, + "Hello,1", + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, + BAGL_GLYPH_ICON_CROSS}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, + BAGL_GLYPH_ICON_CHECK}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, +}; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos [0,1] ="Hello,Anton"; + bagl_ui_sample_nanos[] = { + + { + {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, + 0xFFFFFF, 0, 0}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, + BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, + "Hello,2", + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, + BAGL_GLYPH_ICON_CROSS}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, + { + {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, + BAGL_GLYPH_ICON_CHECK}, + NULL, + 0, + 0, + 0, + NULL, + NULL, + NULL, + }, +}; UX_REDISPLAY(); break; From 1604a94a1400a7638d614c72dc8f01b34a293a0d Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 13:36:01 +0100 Subject: [PATCH 15/26] Update main.c --- blue-app-helloworld/src/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 433f724..7797c75 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -22,7 +22,7 @@ unsigned char G_io_seproxyhal_spi_buffer[IO_SEPROXYHAL_BUFFER_SIZE_B]; -static bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e); +static bagl_element_t *io_seproxyhal_touch_exit(bagl_element_t *e); ux_state_t ux; @@ -152,7 +152,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos = { + bagl_ui_sample_nanos = { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, @@ -198,12 +198,12 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, NULL, NULL, }, -}; + UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos[] = { + bagl_ui_sample_nanos = { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, @@ -249,7 +249,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, NULL, NULL, }, -}; + UX_REDISPLAY(); break; From 3e40351347f4cf69702239108488ad77c913a3c9 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 13:53:41 +0100 Subject: [PATCH 16/26] Update main.c --- blue-app-helloworld/src/main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 7797c75..3e879a3 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -152,7 +152,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos = + bagl_ui_sample_nanos = { { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, @@ -197,13 +197,12 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, NULL, NULL, NULL, - }, - + },}; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos = + bagl_ui_sample_nanos = { { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, @@ -248,7 +247,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, NULL, NULL, NULL, - }, + },}; UX_REDISPLAY(); break; @@ -260,7 +259,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, return 0; } -static bagl_element_t *io_seproxyhal_touch_exit(const bagl_element_t *e) { +static bagl_element_t *io_seproxyhal_touch_exit(bagl_element_t *e) { // Go back to the dashboard os_sched_exit(0); return NULL; From 303f138e351db3ac7ee7be65451d10383203e370 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 13:57:37 +0100 Subject: [PATCH 17/26] Update main.c --- blue-app-helloworld/src/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 3e879a3..d0412c7 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -29,8 +29,7 @@ ux_state_t ux; // ******************************************************************************** // Ledger Blue specific UI // ******************************************************************************** - -static bagl_element_t bagl_ui_sample_blue[] = { +bagl_element_t bagl_ui_sample_blue[] = { // { // {type, userid, x, y, width, height, stroke, radius, fill, fgcolor, // bgcolor, font_id, icon_id}, @@ -99,7 +98,7 @@ bagl_ui_sample_blue_button(unsigned int button_mask, // Ledger Nano S specific UI // ******************************************************************************** -static bagl_element_t bagl_ui_sample_nanos[] = { +bagl_element_t bagl_ui_sample_nanos[] = { { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, From 12e06f8b306f03401330247b51520c3a427df9a7 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 14:02:04 +0100 Subject: [PATCH 18/26] Update main.c --- blue-app-helloworld/src/main.c | 64 ++++++---------------------------- 1 file changed, 11 insertions(+), 53 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index d0412c7..95035fc 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -146,12 +146,7 @@ bagl_element_t bagl_ui_sample_nanos[] = { }, }; -static unsigned int -bagl_ui_sample_nanos_button(unsigned int button_mask, - unsigned int button_mask_counter) { - switch (button_mask) { - case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos = { +bagl_element_t hellow[] = { { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, @@ -196,57 +191,20 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, NULL, NULL, NULL, - },}; + }, +}; + +static unsigned int +bagl_ui_sample_nanos_button(unsigned int button_mask, + unsigned int button_mask_counter) { + switch (button_mask) { + case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT + bagl_ui_sample_nanos=hellow; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos = { - - { - {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, - 0xFFFFFF, 0, 0}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, - BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello,2", - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, - BAGL_GLYPH_ICON_CROSS}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, - BAGL_GLYPH_ICON_CHECK}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - },}; + bagl_ui_sample_nanos=hellow; UX_REDISPLAY(); break; From 564bea0d545de96cf344edc584efbed22881c14d Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 14:06:48 +0100 Subject: [PATCH 19/26] Update main.c --- blue-app-helloworld/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 95035fc..5e24677 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -98,7 +98,7 @@ bagl_ui_sample_blue_button(unsigned int button_mask, // Ledger Nano S specific UI // ******************************************************************************** -bagl_element_t bagl_ui_sample_nanos[] = { +bagl_element_t bagl_ui_sample_nanos[4] = { { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, @@ -146,7 +146,7 @@ bagl_element_t bagl_ui_sample_nanos[] = { }, }; -bagl_element_t hellow[] = { +bagl_element_t hellow[4] = { { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, From d6f2332b3292816c5327f4e0e013330e4fc5cb47 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 14:12:37 +0100 Subject: [PATCH 20/26] Update main.c --- blue-app-helloworld/src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 5e24677..e5a58f8 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -97,7 +97,7 @@ bagl_ui_sample_blue_button(unsigned int button_mask, // ******************************************************************************** // Ledger Nano S specific UI // ******************************************************************************** - +char* name="Hello"; bagl_element_t bagl_ui_sample_nanos[4] = { { @@ -114,7 +114,7 @@ bagl_element_t bagl_ui_sample_nanos[4] = { { {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello,world", + name, 0, 0, 0, @@ -199,12 +199,12 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos=hellow; + name="12"; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos=hellow; + name="12"; UX_REDISPLAY(); break; From 281e6ed14f65b267fa6e4bdf2b2f38a65059c403 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 14:16:08 +0100 Subject: [PATCH 21/26] Update main.c --- blue-app-helloworld/src/main.c | 46 ---------------------------------- 1 file changed, 46 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index e5a58f8..1f440a0 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -146,53 +146,7 @@ bagl_element_t bagl_ui_sample_nanos[4] = { }, }; -bagl_element_t hellow[4] = { - { - {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, - 0xFFFFFF, 0, 0}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, - BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Hello,1", - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_ICON, 0x00, 3, 12, 7, 7, 0, 0, 0, 0xFFFFFF, 0x000000, 0, - BAGL_GLYPH_ICON_CROSS}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, - { - {BAGL_ICON, 0x00, 117, 13, 8, 6, 0, 0, 0, 0xFFFFFF, 0x000000, 0, - BAGL_GLYPH_ICON_CHECK}, - NULL, - 0, - 0, - 0, - NULL, - NULL, - NULL, - }, -}; static unsigned int bagl_ui_sample_nanos_button(unsigned int button_mask, From 35287e28863856bea63a379319ca7358904bb9bf Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 14:21:10 +0100 Subject: [PATCH 22/26] Update main.c --- blue-app-helloworld/src/main.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 1f440a0..6cc79e4 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -97,7 +97,7 @@ bagl_ui_sample_blue_button(unsigned int button_mask, // ******************************************************************************** // Ledger Nano S specific UI // ******************************************************************************** -char* name="Hello"; + bagl_element_t bagl_ui_sample_nanos[4] = { { @@ -114,7 +114,7 @@ bagl_element_t bagl_ui_sample_nanos[4] = { { {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - name, + "ho", 0, 0, 0, @@ -153,12 +153,34 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - name="12"; + bagl_ui_sample_nanos[1] = + { + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, + BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, + "Helloodcs", + 0, + 0, + 0, + NULL, + NULL, + NULL, + }; UX_REDISPLAY(); break; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - name="12"; + bagl_ui_sample_nanos[1] = + { + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, + BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, + "Helloo", + 0, + 0, + 0, + NULL, + NULL, + NULL, + }; UX_REDISPLAY(); break; From 6db99b46504117b7d691c578cbbeac2518d1db59 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 14:23:03 +0100 Subject: [PATCH 23/26] Update main.c --- blue-app-helloworld/src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 6cc79e4..d6ced94 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -153,7 +153,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos[1] = + bagl_ui_sample_nanos[1] = { { {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, @@ -164,7 +164,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, NULL, NULL, NULL, - }; + }}; UX_REDISPLAY(); break; From de145a3ae2af94a64bc93a93ab1cc945133cff55 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 14:24:29 +0100 Subject: [PATCH 24/26] Update main.c --- blue-app-helloworld/src/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index d6ced94..48940a5 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -153,8 +153,8 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos[1] = { - { + bagl_ui_sample_nanos[1] = + {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, "Helloodcs", @@ -163,8 +163,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, 0, NULL, NULL, - NULL, - }}; + NULL; UX_REDISPLAY(); break; From eda3660236f9286d5fa9c5be0319f6c76ab115c6 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Mon, 1 Oct 2018 14:29:49 +0100 Subject: [PATCH 25/26] Update main.c --- blue-app-helloworld/src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 48940a5..55fd3b4 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -153,7 +153,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos[1] = + bagl_ui_sample_nanos[1] = { {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, @@ -166,6 +166,7 @@ bagl_ui_sample_nanos_button(unsigned int button_mask, NULL; UX_REDISPLAY(); break; + }; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT bagl_ui_sample_nanos[1] = From 589dd8c9695407710a38a96a169a4ec0bcfa1c72 Mon Sep 17 00:00:00 2001 From: diesel167 <42602312+diesel167@users.noreply.github.com> Date: Tue, 2 Oct 2018 07:17:03 +0100 Subject: [PATCH 26/26] Update main.c --- blue-app-helloworld/src/main.c | 48 +++++++++++++--------------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/blue-app-helloworld/src/main.c b/blue-app-helloworld/src/main.c index 55fd3b4..0f24204 100644 --- a/blue-app-helloworld/src/main.c +++ b/blue-app-helloworld/src/main.c @@ -97,8 +97,21 @@ bagl_ui_sample_blue_button(unsigned int button_mask, // ******************************************************************************** // Ledger Nano S specific UI // ******************************************************************************** +struct temporary { + bagl_component_t component; + + char *text; + unsigned char touch_area_brim; + int overfgcolor; + int overbgcolor; + bagl_element_callback_t tap; + bagl_element_callback_t out; + bagl_element_callback_t over; +}; + +char*name="Hello1"; -bagl_element_t bagl_ui_sample_nanos[4] = { +temporary tmp[] = { {BAGL_RECTANGLE, 0x00, 0, 0, 128, 32, 0, 0, BAGL_FILL, 0x000000, @@ -114,7 +127,7 @@ bagl_element_t bagl_ui_sample_nanos[4] = { { {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "ho", + name, 0, 0, 0, @@ -147,40 +160,15 @@ bagl_element_t bagl_ui_sample_nanos[4] = { }; - static unsigned int bagl_ui_sample_nanos_button(unsigned int button_mask, unsigned int button_mask_counter) { switch (button_mask) { case BUTTON_EVT_RELEASED | BUTTON_LEFT : // EXIT - bagl_ui_sample_nanos[1] = { - - {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, - BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Helloodcs", - 0, - 0, - 0, - NULL, - NULL, - NULL; - UX_REDISPLAY(); - break; - }; + name="Hello2"; case BUTTON_EVT_RELEASED | BUTTON_RIGHT: // EXIT - bagl_ui_sample_nanos[1] = - { - {BAGL_LABELINE, 0x01, 0, 12, 128, 32, 0, 0, 0, 0xFFFFFF, 0x000000, - BAGL_FONT_OPEN_SANS_REGULAR_11px | BAGL_FONT_ALIGNMENT_CENTER, 0}, - "Helloo", - 0, - 0, - 0, - NULL, - NULL, - NULL, - }; + name="Hello3"; UX_REDISPLAY(); break; @@ -229,7 +217,7 @@ static void ui_idle(void) { SEPROXYHAL_TAG_SESSION_START_EVENT_FEATURE_SCREEN_BIG) { UX_DISPLAY(bagl_ui_sample_blue, NULL); } else { - UX_DISPLAY(bagl_ui_sample_nanos, NULL); + UX_DISPLAY(tmp, NULL); } }