Skip to content

Commit 0c9328f

Browse files
committed
update bubble charging
1 parent 0aa6447 commit 0c9328f

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

ARM.Arm-2D.pdsc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,8 @@
375375
<file category="sourceC" name="examples/common/scenes/fan/arm_2d_scene_fan.c" attr="template" select="Scene Template: Fan" version="2.1.4" />
376376
<file category="header" name="examples/common/scenes/fan/arm_2d_scene_fan.h" attr="template" select="Scene Template: Fan" version="2.1.4" />
377377

378-
<file category="sourceC" name="examples/common/scenes/bubble_charging/arm_2d_scene_bubble_charging.c" attr="template" select="Scene Template: Bubble Charging" version="1.1.2" />
379-
<file category="header" name="examples/common/scenes/bubble_charging/arm_2d_scene_bubble_charging.h" attr="template" select="Scene Template: Bubble Charging" version="1.1.2" />
378+
<file category="sourceC" name="examples/common/scenes/bubble_charging/arm_2d_scene_bubble_charging.c" attr="template" select="Scene Template: Bubble Charging" version="1.2.0" />
379+
<file category="header" name="examples/common/scenes/bubble_charging/arm_2d_scene_bubble_charging.h" attr="template" select="Scene Template: Bubble Charging" version="1.2.0" />
380380

381381
<file category="sourceC" name="examples/common/scenes/animate_background/arm_2d_scene_animate_background.c" attr="template" select="Scene Template: Animate Background" version="1.1.2" />
382382
<file category="sourceC" name="examples/common/scenes/animate_background/arm_2d_scene_animate_background_vres.c" attr="template" select="Scene Template: Animate Background" version="1.1.2" />

examples/common/scenes/bubble_charging/arm_2d_scene_bubble_charging.c

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,6 @@ static void __on_scene_bubble_charging_frame_complete(arm_2d_scene_t *ptScene)
189189

190190
arm_2dp_filter_iir_blur_depose(&this.tBlurOP);
191191

192-
#if 0
193-
/* switch to next scene after 30s */
194-
if (arm_2d_helper_is_time_out(30000, &this.lTimestamp[0])) {
195-
arm_2d_scene_player_switch_to_next_scene(ptScene->ptPlayer);
196-
}
197-
#endif
198-
199192
}
200193

201194
static void __before_scene_bubble_charging_switching_out(arm_2d_scene_t *ptScene)
@@ -266,26 +259,34 @@ IMPL_PFB_ON_DRAW(__pfb_draw_scene_bubble_charging_handler)
266259
(__arm_2d_color_t) {GLCD_COLOR_WHITE},
267260
255);
268261

269-
}
262+
263+
ARM_2D_OP_WAIT_ASYNC();
270264

271-
arm_2d_size_t tStringSize = arm_lcd_get_string_line_box("000", &ARM_2D_FONT_ALARM_CLOCK_32_A4);
265+
arm_2d_size_t tStringSize =
266+
arm_lcd_printf_to_buffer( (const arm_2d_font_t *)&ARM_2D_FONT_ALARM_CLOCK_32_A4,
267+
"%02d",
268+
(this.iSoC / 10));
272269

273-
arm_2d_align_centre_open(__charging_canvas, tStringSize) {
270+
arm_2d_align_centre_open(__centre_region, tStringSize) {
274271

275-
arm_lcd_text_set_target_framebuffer((arm_2d_tile_t *)ptTile);
276-
arm_lcd_text_set_draw_region(&__centre_region);
277-
arm_lcd_text_set_font((const arm_2d_font_t *)&ARM_2D_FONT_ALARM_CLOCK_32_A4);
278-
arm_lcd_text_set_colour(GLCD_COLOR_WHITE, GLCD_COLOR_BLACK);
272+
__arm_2d_hint_optimize_for_pfb__(__centre_region) {
273+
arm_lcd_text_set_target_framebuffer((arm_2d_tile_t *)ptTile);
274+
arm_lcd_text_set_draw_region(&__centre_region);
275+
arm_lcd_text_set_colour(GLCD_COLOR_WHITE, GLCD_COLOR_BLACK);
279276

280-
arm_lcd_printf("%02d", (this.iSoC / 10));
277+
arm_lcd_printf_buffer(0);
278+
}
281279

282-
arm_lcd_text_set_font(NULL);
283-
284-
__centre_region.tLocation.iX += tStringSize.iWidth + 6;
285-
__centre_region.tLocation.iY += tStringSize.iHeight - 8;
286-
arm_lcd_text_set_draw_region(&__centre_region);
287-
arm_lcd_text_set_colour(__RGB(0, 128, 0), GLCD_COLOR_BLACK);
288-
arm_lcd_printf("%%");
280+
__centre_region.tLocation.iX += tStringSize.iWidth + 6;
281+
__centre_region.tLocation.iY += tStringSize.iHeight - 8;
282+
283+
__arm_2d_hint_optimize_for_pfb__(__centre_region) {
284+
arm_lcd_text_set_font(NULL);
285+
arm_lcd_text_set_draw_region(&__centre_region);
286+
arm_lcd_text_set_colour(__RGB(0, 128, 0), GLCD_COLOR_BLACK);
287+
arm_lcd_printf("%%");
288+
}
289+
}
289290
}
290291
#endif
291292

0 commit comments

Comments
 (0)