Skip to content

Commit

Permalink
apps/examples/pwfb : fix compiling error
Browse files Browse the repository at this point in the history
fix compiling warning and error when CONFIG_NX=y, EXAMPLES_PWFB=y and EXAMPLES_PWFB_DEFAULT_FONT=y
fix CI-Precheck for pwfb_motion.c

Signed-off-by: YanXiaowei <[email protected]>
  • Loading branch information
sylvia-soft authored and xiaoxiang781216 committed Aug 9, 2023
1 parent 79a111f commit b2d5d3f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 0 additions & 2 deletions examples/pwfb/pwfb_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ static void pwfb_tb_position(NXTKWINDOW hwnd,
FAR void *arg)
{
#ifdef CONFIG_EXAMPLES_PWFB_VERBOSE
FAR struct nxeg_state_s *st = (FAR struct nxeg_state_s *)arg;

/* Report the position */

printf("pwfb_tb_position: hwnd=%p size=(%d,%d) pos=(%d,%d) "
Expand Down
12 changes: 8 additions & 4 deletions examples/pwfb/pwfb_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@

#ifndef CONFIG_EXAMPLES_PWFB_COLOR3
# if CONFIG_EXAMPLES_PWFB_BPP == 24 || CONFIG_EXAMPLES_PWFB_BPP == 32
# define CONFIG_EXAMPLES_PWFB_COLOR2 0x00ffecb3
# define CONFIG_EXAMPLES_PWFB_COLOR3 0x00ffecb3
# elif CONFIG_EXAMPLES_PWFB_BPP == 16
# define CONFIG_EXAMPLES_PWFB_COLOR2 0xff76
# define CONFIG_EXAMPLES_PWFB_COLOR3 0xff76
# else
# define CONFIG_EXAMPLES_PWFB_COLOR2 '3'
# endif
# define CONFIG_EXAMPLES_PWFB_COLOR3 '3'
# endif
#endif

#ifndef CONFIG_EXAMPLES_PWFB_TBCOLOR
Expand All @@ -142,6 +142,10 @@
# endif
#endif

#ifdef CONFIG_EXAMPLES_PWFB_DEFAULT_FONT
# define CONFIG_EXAMPLES_PWFB_FONTID FONTID_DEFAULT
#endif

/* Cursor timing */

#if CONFIG_EXAMPLES_PWFB_RATECONTROL > 0
Expand Down
9 changes: 5 additions & 4 deletions examples/pwfb/pwfb_motion.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static inline bool pwfb_move_cursor(FAR struct pwfb_state_s *st)
#ifdef CONFIG_EXAMPLES_PWFB_VERBOSE
printf("pwfb_move_cursor: State: %u countdown: %u blinktime: %u\n",
(unsigned int)st->cursor.state, (unsigned int)st->cursor.countdown,
(unsigned int)st->cursor.blinktime;
(unsigned int)st->cursor.blinktime);
printf("pwfb_move_cursor: Velocity: (%lx.%04lx,%lx.%04lx)\n",
(unsigned long)st->cursor.deltax >> 16,
(unsigned long)st->cursor.deltax & 0xffff,
Expand All @@ -186,12 +186,13 @@ static inline bool pwfb_move_cursor(FAR struct pwfb_state_s *st)
#endif

/* Handle the update based on cursor state */

/* If the state is not PFWB_CURSOR_STATIONARY, then update the cursor
* position.
*/

if (st->cursor.state != PFWB_CURSOR_STATIONARY)
{
if (st->cursor.state != PFWB_CURSOR_STATIONARY)
{
/* Update X position */

newx = st->cursor.xpos + st->cursor.deltax;
Expand Down Expand Up @@ -258,7 +259,7 @@ static inline bool pwfb_move_cursor(FAR struct pwfb_state_s *st)

return false;
}
}
}

/* Check for state changes */

Expand Down

0 comments on commit b2d5d3f

Please sign in to comment.