Skip to content

Commit b03edc8

Browse files
committed
fix: ifdef function to avoid unused function build warning
This function is only used if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED is set, let's ifdef it to avoid a build warning in Zephyr. Note this commit is in a branch that forks from the upstream master branch. It is a provisional patch to fix Zephyr's CI. This branch should be discarded once the real fix is merged in lvgl's master branch. Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent cb85b35 commit b03edc8

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ static inline void /* LV_ATTRIBUTE_FAST_MEM */ blend_non_normal_pixel(lv_color32
9191

9292
static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride);
9393

94-
static inline lv_color16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color16_from_u16(uint16_t raw);
94+
#if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED
95+
static inline lv_color16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color16_from_u16(uint16_t raw);
96+
#endif
9597

9698
/**********************
9799
* STATIC VARIABLES
@@ -1350,6 +1352,7 @@ static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, ui
13501352
return (void *)((uint8_t *)buf + stride);
13511353
}
13521354

1355+
#if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED
13531356
static inline lv_color16_t LV_ATTRIBUTE_FAST_MEM lv_color16_from_u16(uint16_t raw)
13541357
{
13551358
lv_color16_t c;
@@ -1358,6 +1361,7 @@ static inline lv_color16_t LV_ATTRIBUTE_FAST_MEM lv_color16_from_u16(uint16_t ra
13581361
c.blue = raw & 0x1F;
13591362
return c;
13601363
}
1364+
#endif
13611365

13621366
#endif /* LV_DRAW_SW_SUPPORT_ARGB8888 */
13631367

src/draw/sw/blend/lv_draw_sw_blend_to_i1.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ static inline uint8_t /* LV_ATTRIBUTE_FAST_MEM */ get_bit(const uint8_t * buf, i
7878

7979
static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride);
8080

81-
static inline lv_color16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color16_from_u16(uint16_t raw);
81+
#if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED
82+
static inline lv_color16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color16_from_u16(uint16_t raw);
83+
#endif
8284

8385
/**********************
8486
* STATIC VARIABLES
@@ -1271,6 +1273,7 @@ static inline uint8_t LV_ATTRIBUTE_FAST_MEM get_bit(const uint8_t * buf, int32_t
12711273
return (buf[bit_idx / 8] >> (7 - (bit_idx % 8))) & 1;
12721274
}
12731275

1276+
#if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED
12741277
static inline lv_color16_t LV_ATTRIBUTE_FAST_MEM lv_color16_from_u16(uint16_t raw)
12751278
{
12761279
lv_color16_t c;
@@ -1279,5 +1282,6 @@ static inline lv_color16_t LV_ATTRIBUTE_FAST_MEM lv_color16_from_u16(uint16_t ra
12791282
c.blue = raw & 0x1F;
12801283
return c;
12811284
}
1285+
#endif
12821286

12831287
#endif

src/draw/sw/blend/lv_draw_sw_blend_to_l8.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ static inline void /* LV_ATTRIBUTE_FAST_MEM */ blend_non_normal_pixel(uint8_t *
7474

7575
static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride);
7676

77-
static inline lv_color16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color16_from_u16(uint16_t raw);
77+
#if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED
78+
static inline lv_color16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color16_from_u16(uint16_t raw);
79+
#endif
7880

7981
/**********************
8082
* STATIC VARIABLES
@@ -1005,6 +1007,7 @@ static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, ui
10051007
return (void *)((uint8_t *)buf + stride);
10061008
}
10071009

1010+
#if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED
10081011
static inline lv_color16_t LV_ATTRIBUTE_FAST_MEM lv_color16_from_u16(uint16_t raw)
10091012
{
10101013
lv_color16_t c;
@@ -1013,6 +1016,7 @@ static inline lv_color16_t LV_ATTRIBUTE_FAST_MEM lv_color16_from_u16(uint16_t ra
10131016
c.blue = raw & 0x1F;
10141017
return c;
10151018
}
1019+
#endif
10161020

10171021
#endif
10181022

src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ static inline uint16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color_24_16_mix(const uint
7979

8080
static inline void * /* LV_ATTRIBUTE_FAST_MEM */ drawbuf_next_row(const void * buf, uint32_t stride);
8181

82-
static inline lv_color16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color16_from_u16(uint16_t raw);
82+
#if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED
83+
static inline lv_color16_t /* LV_ATTRIBUTE_FAST_MEM */ lv_color16_from_u16(uint16_t raw);
84+
#endif
8385

8486
/**********************
8587
* STATIC VARIABLES
@@ -1497,6 +1499,7 @@ static inline void * LV_ATTRIBUTE_FAST_MEM drawbuf_next_row(const void * buf, ui
14971499
return (void *)((uint8_t *)buf + stride);
14981500
}
14991501

1502+
#if LV_DRAW_SW_SUPPORT_RGB565_SWAPPED
15001503
static inline lv_color16_t LV_ATTRIBUTE_FAST_MEM lv_color16_from_u16(uint16_t raw)
15011504
{
15021505
lv_color16_t c;
@@ -1505,6 +1508,7 @@ static inline lv_color16_t LV_ATTRIBUTE_FAST_MEM lv_color16_from_u16(uint16_t ra
15051508
c.blue = raw & 0x1F;
15061509
return c;
15071510
}
1511+
#endif
15081512

15091513
#endif /*LV_DRAW_SW_SUPPORT_RGB565*/
15101514

0 commit comments

Comments
 (0)