Skip to content

Commit dbbeea3

Browse files
frame update display on DFU
1 parent 8a98692 commit dbbeea3

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

source/application/bluetooth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void SD_EVT_IRQHandler(void)
333333
(uint32_t *)&bond.keyset.keys_own.p_enc_key->enc_info,
334334
sizeof(bond.keyset.keys_own.p_enc_key->enc_info));
335335

336-
status = show_pairing_screen(true);
336+
status = show_pairing_screen(true, false);
337337
}
338338

339339
break;

source/application/lua_libraries/system.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636

3737
static int lua_update(lua_State *L)
3838
{
39+
int status = show_pairing_screen(false, true);
40+
if (status != LUA_OK)
41+
{
42+
const char *lua_error = lua_tostring(L, -1);
43+
luaL_error(L, "%s", lua_error);
44+
}
3945
check_error(sd_power_gpregret_set(0, 0xB1));
4046
NVIC_SystemReset();
4147
return 0;

source/application/luaport.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,19 @@ void lua_break_signal_interrupt(void)
6363
1);
6464
}
6565

66-
int show_pairing_screen(bool is_paired)
66+
int show_pairing_screen(bool is_paired, bool is_update)
6767
{
6868
int status;
6969
if(L_global == NULL)
7070
{
7171
return LUA_ERRRUN;
7272
}
73-
if (!is_paired)
73+
if (is_update)
74+
{
75+
status = luaL_dostring(L_global, "frame.display.text('Frame Update', 200, 140);"
76+
"frame.display.show();");
77+
}
78+
else if (!is_paired)
7479
{
7580
status = luaL_dostring(L_global, "frame.display.text('Ready to Pair', 200, 140);"
7681
"frame.display.text('Frame '..frame.bluetooth.address():sub(-2, -1), 245, 210, { color = 'GREEN' });"
@@ -155,7 +160,7 @@ void run_lua(bool is_paired)
155160
}
156161

157162
// Show splash screen
158-
status = show_pairing_screen(is_paired);
163+
status = show_pairing_screen(is_paired, false);
159164

160165

161166
// Run REPL

source/application/luaport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ void lua_break_signal_interrupt(void);
4040

4141
void run_lua(bool is_paired);
4242

43-
int show_pairing_screen(bool is_paired);
43+
int show_pairing_screen(bool is_paired, bool is_update);

0 commit comments

Comments
 (0)