From ad7f76f3a88dad141a820e6a30d823767f26c95e Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 10 Apr 2019 15:00:36 -0600 Subject: [PATCH] apps/examples/pwfb: Fix more cursor-related problems. Currently cursor is presented but the system dies due to memory corruption. --- examples/pwfb/pwfb_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/examples/pwfb/pwfb_main.c b/examples/pwfb/pwfb_main.c index d95a8e1f1..f5f2fcfc4 100644 --- a/examples/pwfb/pwfb_main.c +++ b/examples/pwfb/pwfb_main.c @@ -523,10 +523,12 @@ static bool pwfb_configure_cursor(FAR struct pwfb_state_s *st, st->cursor.state = PFWB_CURSOR_MOVING; st->cursor.countdown = CURSOR_MOVING_DELAY; st->cursor.blinktime = 0; - st->cursor.xpos = pos->x; - st->cursor.ypos = pos->y; - st->cursor.deltax = deltax; - st->cursor.deltay = deltay; + st->cursor.xmax = itob16(st->xres - g_arrow1Cursor.size.w - 1); + st->cursor.ymax = itob16(st->yres - g_arrow1Cursor.size.h - 1); + st->cursor.xpos = itob16(pos->x); + st->cursor.ypos = itob16(pos->y); + st->cursor.deltax = dtob16(deltax); + st->cursor.deltay = dtob16(deltay); /* Set the cursor image */ @@ -552,7 +554,7 @@ static bool pwfb_configure_cursor(FAR struct pwfb_state_s *st, /* Enable the cursor */ - ret = nxcursor_enable(st->hnx, false); + ret = nxcursor_enable(st->hnx, true); if (ret < 0) { printf("pwfb_configure_cursor: ERROR: " @@ -738,7 +740,7 @@ int pwfb_main(int argc, char *argv[]) /* Configure the software cursor */ pos.x = wstate.xres / 2; - pos.x = wstate.yres / 2; + pos.y = wstate.yres / 2; if (!pwfb_configure_cursor(&wstate, &pos, 2.900, -5.253)) {