BRT Community

General Category => Discussion - EVE => Topic started by: korstiaan on June 16, 2021, 06:42:10 AM

Title: BT817Q CMD_SPINNER fails
Post by: korstiaan on June 16, 2021, 06:42:10 AM
Hi,

As soon as I want to use a spinner my screen flashes once and then goes blank.
Same program works fine on EVE2 and EVE3 but not on EVE4?
Text and lines works fine, it is only the spinner that causes the problem.

What can be the reason?

Korstiaan
Title: Re: BT817Q CMD_SPINNER fails
Post by: BRT Community on June 16, 2021, 03:52:31 PM
Hello,

Can you provide the display list you are using when you see this behaviour?
Could you also provide the CMD_SPINNER implementation you are using in your library?

Best Regards,
BRT Community
Title: Re: BT817Q CMD_SPINNER fails
Post by: korstiaan on June 17, 2021, 06:36:47 AM
Hi,

This is the simple list:

Code: [Select]
void testscreen() {
    EVE_LIB_BeginCoProList();
    EVE_CMD_DLSTART();
    EVE_CLEAR_COLOR_RGB(0, 0, 0);
    EVE_CLEAR(1, 1, 1);
    EVE_LINE_WIDTH(1 * 12);
    EVE_BEGIN(EVE_BEGIN_LINES);
    EVE_VERTEX2F(0 * 16, 0 * 16);
    EVE_VERTEX2F(799 * 16, 479 * 16);
    EVE_END();
    EVE_CMD_SPINNER(200, 200, 0, 0);
    EVE_DISPLAY();
    EVE_CMD_SWAP();
    EVE_LIB_EndCoProList();
    EVE_LIB_AwaitCoProEmpty();
}

and the EVE_CMD_SPINNER:

Code: [Select]
void EVE_CMD_SPINNER(int16_t x, int16_t y, uint16_t style, uint16_t scale) {
    HAL_Write32(EVE_ENC_CMD_SPINNER);
    HAL_Write32(((uint32_t)y << 16) | (x & 0xffff));
    HAL_Write32(((uint32_t)scale << 16) | (style & 0xffff));
    HAL_IncCmdPointer(12);
}

1. Code works fine on EVE2 and EVE3
2. If I delete the EVE_CMD_SPINNER line I see the diagonal line.
3. As soon as EVE_CMD_SPINNER is in the list, the screen gives a very short image (a flash) of the result and then goes blank.

Korstiaan
Title: Re: BT817Q CMD_SPINNER fails
Post by: korstiaan on June 17, 2021, 03:29:53 PM
Hi,

Seems like the SPINNER command implicitly on EVE4 calls a SWAP!

This works (tested on 2 different libraries):

Code: [Select]
void testscreen() {
    EVE_LIB_BeginCoProList();
    EVE_CMD_DLSTART();
    EVE_CLEAR_COLOR_RGB(0, 0, 0);
    EVE_CLEAR(1, 1, 1);
    EVE_LINE_WIDTH(1 * 12);
    EVE_BEGIN(EVE_BEGIN_LINES);
    EVE_VERTEX2F(0 * 16, 0 * 16);
    EVE_VERTEX2F(799 * 16, 479 * 16);
    EVE_END();
    EVE_CMD_SPINNER(200, 200, 0, 0);
    EVE_DISPLAY();
    // EVE_CMD_SWAP();
    EVE_LIB_EndCoProList();
    EVE_LIB_AwaitCoProEmpty();
}

SWAP needs to be removed or screen does not work.
Bridgetek, PLEASE confirm this!

Title: Re: BT817Q CMD_SPINNER fails
Post by: BRT Community on June 17, 2021, 04:03:13 PM
Hello,

Thank you for the update, I haven't had a chance to explicitly verify this behaviour yet with a BT817 development board.

However the following code is from our main sample application, and this does not include a swap command:
Code: [Select]
void SAMAPP_CoPro_Widget_Spinner()
{
/*************************************************************************/
/* Below code demonstrates the usage of spinner function. Spinner func   */
/* will wait untill stop command is sent from the mcu. Spinner has option*/
/* for displaying points in circle fashion or in a line fashion.         */
/*************************************************************************/
EVE_CoCmd_dlStart(phost);
EVE_Cmd_wr32(phost, CLEAR_COLOR_RGB(64, 64, 64));
EVE_Cmd_wr32(phost, CLEAR(1, 1, 1));
EVE_Cmd_wr32(phost, COLOR_RGB(0xff, 0xff, 0xff));
EVE_CoCmd_text(phost, (int16_t)(DispWidth / 2), 20, 27, OPT_CENTER, "Spinner circle");
EVE_CoCmd_text(phost, (int16_t)(DispWidth / 2), 80, 27, OPT_CENTER, "Please Wait ...");
EVE_CoCmd_spinner(phost, (int16_t)(DispWidth / 2), (int16_t)(DispHeight / 2), 0, 1);//style 0 and scale 0

/* Wait till coprocessor completes the operation */
EVE_Cmd_waitFlush(phost);

EVE_sleep(1000);

/**************************** spinner with style 1 and scale 1 *****************************************************/

EVE_CoCmd_dlStart(phost);
EVE_Cmd_wr32(phost, CLEAR_COLOR_RGB(64, 64, 64));
EVE_Cmd_wr32(phost, CLEAR(1, 1, 1));
EVE_Cmd_wr32(phost, COLOR_RGB(0xff, 0xff, 0xff));
EVE_CoCmd_text(phost, (int16_t)(DispWidth / 2), 20, 27, OPT_CENTER, "Spinner line");
EVE_CoCmd_text(phost, (int16_t)(DispWidth / 2), 80, 27, OPT_CENTER, "Please Wait ...");
EVE_Cmd_wr32(phost, COLOR_RGB(0x00, 0x00, 0x80));
EVE_CoCmd_spinner(phost, (int16_t)(DispWidth / 2), (int16_t)(DispHeight / 2), 1, 1);//style 1 and scale 1

/* Wait till coprocessor completes the operation */
EVE_Cmd_waitFlush(phost);

EVE_sleep(1000);

EVE_CoCmd_dlStart(phost);
EVE_Cmd_wr32(phost, CLEAR_COLOR_RGB(64, 64, 64));
EVE_Cmd_wr32(phost, CLEAR(1, 1, 1));
EVE_Cmd_wr32(phost, COLOR_RGB(0xff, 0xff, 0xff));
EVE_CoCmd_text(phost, (int16_t)(DispWidth / 2), 20, 27, OPT_CENTER, "Spinner clockhand");
EVE_CoCmd_text(phost, (int16_t)(DispWidth / 2), 80, 27, OPT_CENTER, "Please Wait ...");
EVE_Cmd_wr32(phost, COLOR_RGB(0x80, 0x00, 0x00));
EVE_CoCmd_spinner(phost, (int16_t)(DispWidth / 2), (int16_t)((DispHeight / 2) + 20), 2, 1);//style 2 scale 1

/* Wait till coprocessor completes the operation */
EVE_Cmd_waitFlush(phost);

EVE_sleep(1000);

EVE_CoCmd_dlStart(phost);
EVE_Cmd_wr32(phost, CLEAR_COLOR_RGB(64, 64, 64));
EVE_Cmd_wr32(phost, CLEAR(1, 1, 1));
EVE_Cmd_wr32(phost, COLOR_RGB(0xff, 0xff, 0xff));
EVE_CoCmd_text(phost, (int16_t)(DispWidth / 2), 20, 27, OPT_CENTER, "Spinner two dots");
EVE_CoCmd_text(phost, (int16_t)(DispWidth / 2), 80, 27, OPT_CENTER, "Please Wait ...");
EVE_Cmd_wr32(phost, COLOR_RGB(0x80, 0x00, 0x00));
EVE_CoCmd_spinner(phost, (int16_t)(DispWidth / 2), (int16_t)((DispHeight / 2) + 20), 3, 1);//style 3 scale 0

/* Wait till coprocessor completes the operation */
EVE_Cmd_waitFlush(phost);

EVE_sleep(1000);

/* Send the stop command */
EVE_Cmd_wr32(phost, CMD_STOP);
/* Update the command buffer pointers - both read and write pointers */
EVE_Cmd_waitFlush(phost);

EVE_sleep(1000);
}

As such I believe you are correct and the swap is issued implicitly when calling CMD_SPINNER on EVE 4, I will verify this with the development team.

Best Regards,
BRT Community.
Title: Re: BT817Q CMD_SPINNER fails
Post by: BRT Community on June 18, 2021, 11:49:34 AM
Hello,

The development team confirmed that the CMD_SPINNER command will implicitly call a SWAP command in the EVE 4 series.
I will get this information updated in the programmers guide.

Best Regards,
BRT COmmunity
Title: Re: BT817Q CMD_SPINNER fails
Post by: korstiaan on June 18, 2021, 12:11:35 PM
Hi,

In fact, on EVE3 it was also not necessary but it didn't harm.
I tested it again on EVE3 it works fine with or without the SWAP.
On EVE4 you may not use an extra SWAP.

Korstiaan
Title: Re: BT817Q CMD_SPINNER fails
Post by: Cyrilou on August 18, 2021, 03:57:12 PM
On ESD this would explain why widgets rendered after spinner are not displayed....
Title: Re: BT817Q CMD_SPINNER fails
Post by: Baxsie on January 14, 2022, 09:13:09 PM
@korstiaan I'm so glad you found the solution. The spinner in my code has been commented out for a long time. Nice to have a solution!
Title: Re: BT817Q CMD_SPINNER fails
Post by: vdc on February 08, 2022, 03:17:33 PM
Is there any way we can make display() macro run first before swap? Because I have a code that run the display every 100Hz. With other EVE, that work fine. But with EVE4. When I run the Spinner before Display() cmd. I do see a delay refresh rate. Like button color change when pressed.