26
26
#include <screen.h>
27
27
#include <stdint.h>
28
28
#include <string.h>
29
+ #include <ui/canvas.h>
29
30
#include <ui/components/ui_images.h>
30
31
#include <ui/fonts/arial_fonts.h>
31
32
#include <ui/graphics/graphics.h>
@@ -328,15 +329,14 @@ static void _render_message(const char* message, int duration)
328
329
{
329
330
char print [100 ];
330
331
snprintf (print , sizeof (print ), "%s" , message );
331
- UG_ClearBuffer ();
332
332
UG_PutString (0 , 0 , print , false);
333
- UG_SendBuffer ();
333
+ canvas_commit ();
334
+ oled_blit ();
334
335
delay_ms (duration );
335
336
}
336
337
337
338
void bootloader_render_default_screen (void )
338
339
{
339
- UG_ClearBuffer ();
340
340
_load_logo ();
341
341
#if PLATFORM_BITBOX02PLUS == 1
342
342
UG_PutString (0 , SCREEN_HEIGHT - 9 * 2 - 5 , "See the BitBoxApp" , false);
@@ -354,7 +354,8 @@ void bootloader_render_default_screen(void)
354
354
}
355
355
UG_PutString (0 , SCREEN_HEIGHT - 9 , "See the BitBoxApp" , false);
356
356
#endif
357
- UG_SendBuffer ();
357
+ canvas_commit ();
358
+ oled_blit ();
358
359
}
359
360
360
361
#if PLATFORM_BITBOX02PLUS
@@ -368,7 +369,6 @@ void bootloader_render_ble_confirm_screen(bool confirmed)
368
369
uint32_t pairing_code_int = (* (uint32_t * )& bootloader_pairing_code_bytes [0 ]) % 1000000 ;
369
370
char code_str [10 ] = {0 };
370
371
snprintf (code_str , sizeof (code_str ), "%06u" , (unsigned )pairing_code_int );
371
- UG_ClearBuffer ();
372
372
uint16_t check_width = IMAGE_DEFAULT_CHECKMARK_HEIGHT + IMAGE_DEFAULT_CHECKMARK_HEIGHT / 2 - 1 ;
373
373
if (confirmed ) {
374
374
UG_PutString (15 , 0 , "Confirm on app" , false);
@@ -380,13 +380,13 @@ void bootloader_render_ble_confirm_screen(bool confirmed)
380
380
UG_FontSelect (& font_monogram_5X9 );
381
381
UG_PutString (45 , SCREEN_HEIGHT / 2 - 9 , code_str , false);
382
382
UG_FontSelect (& font_font_a_9X9 );
383
- UG_SendBuffer ();
383
+ canvas_commit ();
384
+ oled_blit ();
384
385
}
385
386
#endif
386
387
387
388
static void _render_progress (float progress )
388
389
{
389
- UG_ClearBuffer ();
390
390
_load_logo ();
391
391
if (progress > 0 ) {
392
392
char label [5 ] = {0 };
@@ -401,7 +401,8 @@ static void _render_progress(float progress)
401
401
msg = "INSTALLING" ;
402
402
}
403
403
UG_PutString (SCREEN_WIDTH / 2 - 3 , SCREEN_HEIGHT - 9 * 2 , msg , false);
404
- UG_SendBuffer ();
404
+ canvas_commit ();
405
+ oled_blit ();
405
406
}
406
407
407
408
static void _render_hash (const char * title , const uint8_t * hash )
@@ -433,7 +434,6 @@ static void _render_hash(const char* title, const uint8_t* hash)
433
434
& hash_hex [48 ]);
434
435
435
436
for (uint8_t i = 1 ; i <= seconds ; i ++ ) {
436
- UG_ClearBuffer ();
437
437
UG_PutString (0 , 0 , title , false);
438
438
439
439
snprintf (timer_buf , sizeof (timer_buf ), "%ds" , seconds - i );
@@ -449,7 +449,8 @@ static void _render_hash(const char* title, const uint8_t* hash)
449
449
450
450
UG_FontSelect (f_regular );
451
451
452
- UG_SendBuffer ();
452
+ canvas_commit ();
453
+ oled_blit ();
453
454
delay_ms (1000 );
454
455
}
455
456
bootloader_render_default_screen ();
@@ -1013,7 +1014,6 @@ static void _check_init(boot_data_t* data)
1013
1014
#ifdef BOOTLOADER_DEVDEVICE
1014
1015
static bool _devdevice_enter (secbool_u32 firmware_verified )
1015
1016
{
1016
- UG_ClearBuffer ();
1017
1017
UG_PutString (0 , 0 , " <Enter bootloader>" , false);
1018
1018
UG_PutString (0 , SCREEN_HEIGHT / 2 - 11 , "DEV DEVICE" , false);
1019
1019
UG_PutString (0 , SCREEN_HEIGHT / 2 + 2 , "NOT FOR VALUE" , false);
@@ -1043,7 +1043,8 @@ static bool _devdevice_enter(secbool_u32 firmware_verified)
1043
1043
UG_DrawLine (xpos + 5 , ypos , xpos , ypos + 5 , C_WHITE );
1044
1044
UG_DrawLine (xpos - 2 , ypos + 3 , xpos , ypos + 5 , C_WHITE );
1045
1045
}
1046
- UG_SendBuffer ();
1046
+ canvas_commit ();
1047
+ oled_blit ();
1047
1048
while (true) {
1048
1049
do {
1049
1050
qtouch_process ();
0 commit comments