2626#include  <screen.h> 
2727#include  <stdint.h> 
2828#include  <string.h> 
29+ #include  <ui/canvas.h> 
2930#include  <ui/components/ui_images.h> 
3031#include  <ui/fonts/arial_fonts.h> 
3132#include  <ui/graphics/graphics.h> 
@@ -328,15 +329,14 @@ static void _render_message(const char* message, int duration)
328329{
329330    char  print [100 ];
330331    snprintf (print , sizeof (print ), "%s" , message );
331-     UG_ClearBuffer ();
332332    UG_PutString (0 , 0 , print , false);
333-     UG_SendBuffer ();
333+     canvas_commit ();
334+     oled_blit ();
334335    delay_ms (duration );
335336}
336337
337338void  bootloader_render_default_screen (void )
338339{
339-     UG_ClearBuffer ();
340340    _load_logo ();
341341#if  PLATFORM_BITBOX02PLUS  ==  1 
342342    UG_PutString (0 , SCREEN_HEIGHT  -  9  *  2  -  5 , "See the BitBoxApp" , false);
@@ -354,7 +354,8 @@ void bootloader_render_default_screen(void)
354354    }
355355    UG_PutString (0 , SCREEN_HEIGHT  -  9 , "See the BitBoxApp" , false);
356356#endif 
357-     UG_SendBuffer ();
357+     canvas_commit ();
358+     oled_blit ();
358359}
359360
360361#if  PLATFORM_BITBOX02PLUS 
@@ -368,7 +369,6 @@ void bootloader_render_ble_confirm_screen(bool confirmed)
368369    uint32_t  pairing_code_int  =  (* (uint32_t * )& bootloader_pairing_code_bytes [0 ]) % 1000000 ;
369370    char  code_str [10 ] =  {0 };
370371    snprintf (code_str , sizeof (code_str ), "%06u" , (unsigned )pairing_code_int );
371-     UG_ClearBuffer ();
372372    uint16_t  check_width  =  IMAGE_DEFAULT_CHECKMARK_HEIGHT  +  IMAGE_DEFAULT_CHECKMARK_HEIGHT  / 2  -  1 ;
373373    if  (confirmed ) {
374374        UG_PutString (15 , 0 , "Confirm on app" , false);
@@ -380,13 +380,13 @@ void bootloader_render_ble_confirm_screen(bool confirmed)
380380    UG_FontSelect (& font_monogram_5X9 );
381381    UG_PutString (45 , SCREEN_HEIGHT  / 2  -  9 , code_str , false);
382382    UG_FontSelect (& font_font_a_9X9 );
383-     UG_SendBuffer ();
383+     canvas_commit ();
384+     oled_blit ();
384385}
385386#endif 
386387
387388static  void  _render_progress (float  progress )
388389{
389-     UG_ClearBuffer ();
390390    _load_logo ();
391391    if  (progress  >  0 ) {
392392        char  label [5 ] =  {0 };
@@ -401,7 +401,8 @@ static void _render_progress(float progress)
401401        msg  =  "INSTALLING" ;
402402    }
403403    UG_PutString (SCREEN_WIDTH  / 2  -  3 , SCREEN_HEIGHT  -  9  *  2 , msg , false);
404-     UG_SendBuffer ();
404+     canvas_commit ();
405+     oled_blit ();
405406}
406407
407408static  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)
433434        & hash_hex [48 ]);
434435
435436    for  (uint8_t  i  =  1 ; i  <= seconds ; i ++ ) {
436-         UG_ClearBuffer ();
437437        UG_PutString (0 , 0 , title , false);
438438
439439        snprintf (timer_buf , sizeof (timer_buf ), "%ds" , seconds  -  i );
@@ -449,7 +449,8 @@ static void _render_hash(const char* title, const uint8_t* hash)
449449
450450        UG_FontSelect (f_regular );
451451
452-         UG_SendBuffer ();
452+         canvas_commit ();
453+         oled_blit ();
453454        delay_ms (1000 );
454455    }
455456    bootloader_render_default_screen ();
@@ -1013,7 +1014,6 @@ static void _check_init(boot_data_t* data)
10131014#ifdef  BOOTLOADER_DEVDEVICE 
10141015static  bool  _devdevice_enter (secbool_u32  firmware_verified )
10151016{
1016-     UG_ClearBuffer ();
10171017    UG_PutString (0 , 0 , "    <Enter bootloader>" , false);
10181018    UG_PutString (0 , SCREEN_HEIGHT  / 2  -  11 , "DEV DEVICE" , false);
10191019    UG_PutString (0 , SCREEN_HEIGHT  / 2  +  2 , "NOT FOR VALUE" , false);
@@ -1043,7 +1043,8 @@ static bool _devdevice_enter(secbool_u32 firmware_verified)
10431043        UG_DrawLine (xpos  +  5 , ypos , xpos , ypos  +  5 , C_WHITE );
10441044        UG_DrawLine (xpos  -  2 , ypos  +  3 , xpos , ypos  +  5 , C_WHITE );
10451045    }
1046-     UG_SendBuffer ();
1046+     canvas_commit ();
1047+     oled_blit ();
10471048    while  (true) {
10481049        do  {
10491050            qtouch_process ();
0 commit comments