Skip to content

Commit 50a11ae

Browse files
committed
minor update
1 parent 2ea1757 commit 50a11ae

File tree

6 files changed

+1440
-17970
lines changed

6 files changed

+1440
-17970
lines changed

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
#define VISUAL_AREA_MASK c_tileRoundedSquareMask
8181

8282
#define LAND_SKY_MASK c_tileSolidSquareMask
83-
#define LAND_SKY_MASK_SCARE_RATIO 1.5f
84-
#define LAND_SKY_MASK_BOARDER_WIDTH 5
83+
#define LAND_SKY_MASK_SCARE_RATIO 3.6f
84+
#define LAND_SKY_MASK_BOARDER_WIDTH 0.5f
8585

8686
#define HORIZON_MASK c_tileSolidLineMask
8787

@@ -261,32 +261,32 @@ static void __on_scene_flight_attitude_instrument_frame_start(arm_2d_scene_t *pt
261261
this.bTransformSky = this.iPitchScale > 0;
262262

263263
if (this.bTransformSky) {
264-
spin_zoom_widget_set_source(&this.Roll.tLand,
264+
spin_zoom_widget_set_source_f32(&this.Roll.tLand,
265265
NULL,
266266
&LAND_SKY_MASK,
267-
(arm_2d_location_t) {
268-
LAND_SKY_MASK.tRegion.tSize.iWidth >> 1,
269-
(LAND_SKY_MASK.tRegion.tSize.iHeight - 1)
270-
- LAND_SKY_MASK_BOARDER_WIDTH
271-
+ reinterpret_s16_q16(
272-
mul_n_q16( this.Roll.q16PitchRatio,
273-
this.iPitchScale))
267+
(arm_2d_point_float_t) {
268+
.fX = LAND_SKY_MASK.tRegion.tSize.iWidth / 2.0f,
269+
.fY = (LAND_SKY_MASK.tRegion.tSize.iHeight - 1)
270+
- LAND_SKY_MASK_BOARDER_WIDTH
271+
+ this.Roll.fPitchRatio
272+
* (float)this.iPitchScale,
274273
});
275274
spin_zoom_widget_set_colour(&this.Roll.tLand, SKY_COLOUR);
276275

277276
this.Roll.tLand.tHelper.SourceReference.ptPoints = s_tHorizonReferencePoints[HORIZON_SKY];
278277
this.Roll.tLand.tHelper.SourceReference.chCount = dimof(s_tHorizonReferencePoints[HORIZON_SKY]);
279278
} else {
280-
spin_zoom_widget_set_source(&this.Roll.tLand,
281-
NULL,
282-
&LAND_SKY_MASK,
283-
(arm_2d_location_t) {
284-
LAND_SKY_MASK.tRegion.tSize.iWidth >> 1,
285-
LAND_SKY_MASK_BOARDER_WIDTH +
286-
reinterpret_s16_q16(
287-
mul_n_q16( this.Roll.q16PitchRatio,
288-
this.iPitchScale))
289-
});
279+
280+
spin_zoom_widget_set_source_f32(&this.Roll.tLand,
281+
NULL,
282+
&LAND_SKY_MASK,
283+
(arm_2d_point_float_t) {
284+
.fX = LAND_SKY_MASK.tRegion.tSize.iWidth / 2.0f,
285+
.fY = LAND_SKY_MASK_BOARDER_WIDTH
286+
+ this.Roll.fPitchRatio
287+
* (float)this.iPitchScale,
288+
});
289+
290290
spin_zoom_widget_set_colour(&this.Roll.tLand, LAND_COLOUR);
291291
this.Roll.tLand.tHelper.SourceReference.ptPoints = s_tHorizonReferencePoints[HORIZON_LAND];
292292
this.Roll.tLand.tHelper.SourceReference.chCount = dimof(s_tHorizonReferencePoints[HORIZON_LAND]);
@@ -586,7 +586,7 @@ user_scene_flight_attitude_instrument_t *__arm_2d_scene_flight_attitude_instrume
586586

587587
float fPitchHeight = ((float)VISUAL_AREA_MASK.tRegion.tSize.iHeight / LAND_SKY_MASK_SCARE_RATIO) / 2.0f;
588588

589-
this.Roll.q16PitchRatio = reinterpret_q16_f32(fPitchHeight / 900.0f);
589+
this.Roll.fPitchRatio = fPitchHeight / 900.0f;
590590

591591
/* update reference points*/
592592
do {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ ARM_PRIVATE(
101101
#endif
102102

103103
spin_zoom_widget_t tMarker;
104-
q16_t q16PitchRatio;
104+
float fPitchRatio;
105105
} Roll;
106106

107107
struct {

0 commit comments

Comments
 (0)