Skip to content

Commit 0aa6447

Browse files
committed
update the discovery example project
1 parent 99177de commit 0aa6447

File tree

9 files changed

+94
-102
lines changed

9 files changed

+94
-102
lines changed

examples/[template][bare-metal][STM32F746G-Discovery]/project/mdk/RTE/Acceleration/arm_2d_cfg.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extern "C" {
7575
// <i> Note that enabling this feature will half the performance of IIR Blur and only works correctly in Full framebuffer mode
7676
// <i> This feature is disabled by default to improve performance
7777
#ifndef __ARM_2D_CFG_USE_IIR_BLUR_REVERSE_PATH__
78-
# define __ARM_2D_CFG_USE_IIR_BLUR_REVERSE_PATH__ 1
78+
# define __ARM_2D_CFG_USE_IIR_BLUR_REVERSE_PATH__ 0
7979
#endif
8080

8181
// <q>Support Scaling for A1, A2 and A4 fonts
@@ -211,14 +211,14 @@ extern "C" {
211211
// <i> The width of your screen for running benchmark
212212
// <i> Default: 320
213213
#ifndef __GLCD_CFG_SCEEN_WIDTH__
214-
# define __GLCD_CFG_SCEEN_WIDTH__ 320
214+
# define __GLCD_CFG_SCEEN_WIDTH__ 480
215215
#endif
216216

217217
// <o>Height of the screen <8-32767>
218218
// <i> The height of your screen for running benchmark
219219
// <i> Default: 240
220220
#ifndef __GLCD_CFG_SCEEN_HEIGHT__
221-
# define __GLCD_CFG_SCEEN_HEIGHT__ 240
221+
# define __GLCD_CFG_SCEEN_HEIGHT__ 272
222222
#endif
223223

224224
// <o>Number of iterations <1-2000>

examples/[template][bare-metal][STM32F746G-Discovery]/project/mdk/RTE/Acceleration/arm_2d_disp_adapter_0.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ extern "C" {
6565
// <i> The width of your screen
6666
// <i> Default: 320
6767
#ifndef __DISP0_CFG_SCEEN_WIDTH__
68-
# define __DISP0_CFG_SCEEN_WIDTH__ 320
68+
# define __DISP0_CFG_SCEEN_WIDTH__ 480
6969
#endif
7070

7171
// <o>Height of the screen <8-32767>
7272
// <i> The height of your screen
7373
// <i> Default: 240
7474
#ifndef __DISP0_CFG_SCEEN_HEIGHT__
75-
# define __DISP0_CFG_SCEEN_HEIGHT__ 240
75+
# define __DISP0_CFG_SCEEN_HEIGHT__ 272
7676
#endif
7777

7878
/*
@@ -96,13 +96,13 @@ extern "C" {
9696
// <o>Width of the PFB block
9797
// <i> The width of your PFB block size used in disp0
9898
#ifndef __DISP0_CFG_PFB_BLOCK_WIDTH__
99-
# define __DISP0_CFG_PFB_BLOCK_WIDTH__ 320
99+
# define __DISP0_CFG_PFB_BLOCK_WIDTH__ 480
100100
#endif
101101

102102
// <o>Height of the PFB block
103103
// <i> The height of your PFB block size used in disp0
104104
#ifndef __DISP0_CFG_PFB_BLOCK_HEIGHT__
105-
# define __DISP0_CFG_PFB_BLOCK_HEIGHT__ 24
105+
# define __DISP0_CFG_PFB_BLOCK_HEIGHT__ 28
106106
#endif
107107

108108
// <o>Width Alignment of generated PFBs
@@ -165,7 +165,7 @@ extern "C" {
165165
// <1=> Real FPS
166166
// <i> Decide the meaning of the real time FPS display
167167
#ifndef __DISP0_CFG_FPS_CACULATION_MODE__
168-
# define __DISP0_CFG_FPS_CACULATION_MODE__ 0
168+
# define __DISP0_CFG_FPS_CACULATION_MODE__ 1
169169
#endif
170170

171171
// <q> Enable Console

examples/[template][bare-metal][STM32F746G-Discovery]/project/mdk/RTE/Acceleration/arm_2d_scene_gas_gauge.c

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -204,57 +204,42 @@ IMPL_PFB_ON_DRAW(__pfb_draw_scene_gas_gauge_handler)
204204

205205
arm_2d_layout(__centre_region, DEFAULT, true) {
206206

207-
__item_line_horizontal(64, 130) {
207+
arm_lcd_text_set_target_framebuffer((arm_2d_tile_t *)ptTile);
208+
arm_lcd_text_set_font((arm_2d_font_t *)&ARM_2D_FONT_A4_DIGITS_ONLY);
209+
210+
__item_line_dock_horizontal(64) {
208211
battery_gasgauge_nixie_tube_show( &this.tBatteryNixieTube,
209212
ptTile,
210213
&__item_region,
211214
this.hwGasgauge,
212215
this.tStatus,
213216
bIsNewFrame);
214217

215-
arm_2d_op_wait_async(NULL);
218+
ARM_2D_OP_WAIT_ASYNC();
216219

217-
218-
arm_2d_size_t tTextSize = arm_lcd_get_string_line_box("00", &ARM_2D_FONT_A4_DIGITS_ONLY);
219-
220-
arm_2d_align_bottom_centre(__item_region, tTextSize) {
221-
222-
arm_lcd_text_set_target_framebuffer((arm_2d_tile_t *)ptTile);
223-
arm_lcd_text_set_font((arm_2d_font_t *)&ARM_2D_FONT_A4_DIGITS_ONLY);
224-
arm_lcd_text_set_draw_region(&__bottom_centre_region);
225-
arm_lcd_text_set_colour(GLCD_COLOR_NIXIE_TUBE, GLCD_COLOR_BLACK);
226-
arm_lcd_text_location(0,0);
227-
arm_lcd_printf("%02d", this.hwGasgauge / 10);
220+
arm_lcd_text_set_draw_region(&__item_region);
221+
arm_lcd_text_set_colour(GLCD_COLOR_NIXIE_TUBE, GLCD_COLOR_BLACK);
222+
223+
arm_lcd_printf_label(ARM_2D_ALIGN_BOTTOM_CENTRE, "%02d", this.hwGasgauge / 10);
228224

229-
arm_2d_op_wait_async(NULL);
230-
}
231225
}
232226

233-
__item_line_horizontal(64, 130) {
227+
__item_line_dock_horizontal(64) {
234228
battery_gasgauge_liquid_show( &this.tBatteryLiquid,
235229
ptTile,
236230
&__item_region,
237231
this.hwGasgauge,
238232
this.tStatus,
239233
bIsNewFrame);
240234

241-
arm_2d_op_wait_async(NULL);
242-
243-
arm_2d_size_t tTextSize = arm_lcd_get_string_line_box("00", &ARM_2D_FONT_A4_DIGITS_ONLY);
244-
245-
arm_2d_align_bottom_centre(__item_region, tTextSize) {
246-
247-
arm_lcd_text_set_target_framebuffer((arm_2d_tile_t *)ptTile);
248-
arm_lcd_text_set_font((arm_2d_font_t *)&ARM_2D_FONT_A4_DIGITS_ONLY);
249-
arm_lcd_text_set_draw_region(&__bottom_centre_region);
250-
arm_lcd_text_set_colour(GLCD_COLOR_WHITE, GLCD_COLOR_BLACK);
251-
arm_lcd_text_location(0,0);
252-
arm_lcd_text_set_opacity(128);
253-
arm_lcd_printf("%02d", this.hwGasgauge / 10);
254-
arm_lcd_text_set_opacity(255);
255-
256-
arm_2d_op_wait_async(NULL);
257-
}
235+
ARM_2D_OP_WAIT_ASYNC();
236+
237+
arm_lcd_text_set_draw_region(&__item_region);
238+
arm_lcd_text_set_colour(GLCD_COLOR_WHITE, GLCD_COLOR_BLACK);
239+
240+
arm_lcd_text_set_opacity(128);
241+
arm_lcd_printf_label(ARM_2D_ALIGN_BOTTOM_CENTRE, "%02d", this.hwGasgauge / 10);
242+
arm_lcd_text_set_opacity(255);
258243
}
259244
}
260245
}
@@ -270,7 +255,7 @@ IMPL_PFB_ON_DRAW(__pfb_draw_scene_gas_gauge_handler)
270255
arm_lcd_puts("Scene Battery Gas Gauge");
271256

272257
/*-----------------------draw the foreground end -----------------------*/
273-
arm_2d_op_wait_async(NULL);
258+
ARM_2D_OP_WAIT_ASYNC();
274259

275260
return arm_fsm_rt_cpl;
276261
}

examples/[template][bare-metal][STM32F746G-Discovery]/project/mdk/RTE/Acceleration/arm_2d_scene_progress_status.c

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,16 @@ static void __on_scene_progress_status_frame_start(arm_2d_scene_t *ptScene)
187187

188188
int32_t iResult;
189189
if (arm_2d_helper_time_half_cos_slider(0, 1000, 6000, &iResult, &this.lTimestamp[0])) {
190-
this.iProgress = -1;
190+
this.iProgress[0] = -1;
191191
} else {
192-
this.iProgress = (uint16_t)iResult;
192+
this.iProgress[0] = (uint16_t)iResult;
193+
}
194+
195+
if (arm_2d_helper_time_half_cos_slider(0, 1000, 6000, &iResult, &this.lTimestamp[2])) {
196+
this.iProgress[1] = 0;
197+
this.lTimestamp[2] = 0;
198+
} else {
199+
this.iProgress[1] = (uint16_t)iResult;
193200
}
194201

195202
progress_bar_round_on_frame_start(&this.tProgressBarRound);
@@ -239,9 +246,9 @@ IMPL_PFB_ON_DRAW(__pfb_draw_scene_progress_status_handler)
239246

240247

241248
arm_2d_dock_vertical(__canvas,
242-
200 + tWiFiLogoSize.iHeight) {
249+
150 + tWiFiLogoSize.iHeight) {
243250
#else
244-
arm_2d_dock_vertical(__canvas, 200) {
251+
arm_2d_dock_vertical(__canvas, 150) {
245252
#endif
246253
arm_2d_layout(__vertical_region) {
247254
#if PROGRESS_STATUS_DEMO_SHOW_WIFI_ANIMATION
@@ -263,9 +270,9 @@ IMPL_PFB_ON_DRAW(__pfb_draw_scene_progress_status_handler)
263270
}
264271
}
265272
#endif
266-
__item_line_dock_vertical(40) {
273+
__item_line_dock_vertical(30) {
267274
arm_2d_container(ptTile, __progress_bar, &__item_region) {
268-
progress_bar_simple_show(&__progress_bar, NULL, this.iProgress, bIsNewFrame);
275+
progress_bar_simple_show(&__progress_bar, NULL, this.iProgress[1], bIsNewFrame);
269276

270277
arm_2d_helper_dirty_region_update_item(
271278
&this.tDirtyRegionItems[DIRTY_REGION_PROGRESS_BAR_SIMPLE],
@@ -274,19 +281,19 @@ IMPL_PFB_ON_DRAW(__pfb_draw_scene_progress_status_handler)
274281
&__progress_bar_canvas);
275282
}
276283
}
277-
__item_line_dock_vertical(40) {
284+
__item_line_dock_vertical(30) {
278285
arm_2d_container(ptTile, __progress_bar, &__item_region) {
279-
progress_bar_drill_show(&__progress_bar, NULL, this.iProgress, bIsNewFrame);
286+
progress_bar_drill_show(&__progress_bar, NULL, this.iProgress[0], bIsNewFrame);
280287
arm_2d_helper_dirty_region_update_item(
281288
&this.tDirtyRegionItems[DIRTY_REGION_PROGRESS_BAR_DRILL],
282289
&__progress_bar,
283290
NULL,
284291
&__progress_bar_canvas);
285292
}
286293
}
287-
__item_line_dock_vertical(40) {
294+
__item_line_dock_vertical(30) {
288295
arm_2d_container(ptTile, __progress_bar, &__item_region) {
289-
progress_bar_flowing_show(&__progress_bar, NULL, this.iProgress, bIsNewFrame);
296+
progress_bar_flowing_show(&__progress_bar, NULL, this.iProgress[0], bIsNewFrame);
290297
arm_2d_helper_dirty_region_update_item(
291298
&this.tDirtyRegionItems[DIRTY_REGION_PROGRESS_BAR_FLOWING],
292299
&__progress_bar,
@@ -295,26 +302,26 @@ IMPL_PFB_ON_DRAW(__pfb_draw_scene_progress_status_handler)
295302
}
296303
}
297304

298-
__item_line_dock_vertical(40) {
305+
__item_line_dock_vertical(30) {
299306
arm_2d_container(ptTile, __progress_bar, &__item_region) {
300307
progress_bar_round_show(&this.tProgressBarRound,
301308
&__progress_bar,
302309
NULL,
303310
GLCD_COLOR_GRAY(32),
304311
GLCD_COLOR_NIXIE_TUBE,
305-
this.iProgress,
312+
this.iProgress[1],
306313
255);
307314
}
308315
}
309316

310-
__item_line_dock_vertical(40) {
317+
__item_line_dock_vertical(30) {
311318
arm_2d_container(ptTile, __progress_bar, &__item_region) {
312319
progress_bar_round_show2(&this.tProgressBarRound2,
313320
&__progress_bar,
314321
NULL,
315322
GLCD_COLOR_GRAY(32),
316323
__RGB(0x94, 0xd2, 0x52),
317-
this.iProgress,
324+
this.iProgress[1],
318325
255);
319326
}
320327
}

examples/[template][bare-metal][STM32F746G-Discovery]/project/mdk/RTE/Acceleration/arm_2d_scene_progress_status.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ struct user_scene_progress_status_t {
8787

8888
ARM_PRIVATE(
8989
/* place your private member here, following two are examples */
90-
int64_t lTimestamp[2];
90+
int64_t lTimestamp[3];
9191

9292
arm_2d_helper_dirty_region_item_t tDirtyRegionItems[4];
9393

9494
progress_bar_round_t tProgressBarRound;
9595
progress_bar_round_t tProgressBarRound2;
9696

9797
bool bUserAllocated;
98-
int16_t iProgress;
98+
int16_t iProgress[2];
9999
)
100100
/* place your public member here */
101101

0 commit comments

Comments
 (0)