2
« on: September 26, 2022, 04:02:29 PM »
Hi there,
i'm testing a MicroChip PIC32 EV-board connected to a new Riverdi 7" 1024x600 EVE4 BT817 display.
I'm using the EVE library from Rudolph.
So far everything is OK and all works fine.
To test out the limits i wrote a small test routine which writes zigzag lines in blocks of 250 single lines.
The BT817Q spec says display list size is 8k, but i crash after the 4k border:
void test_8k(void) {
uint16_t i;
EVE_cmd_dl( CMD_DLSTART );
EVE_cmd_dl( CLEAR( 1, 1, 1 ) );
num_dl_static = EVE_memRead16(REG_CMD_DL); // read current position
EVE_color_rgb( WHITE ); // sets the foreground color
EVE_cmd_dl( LINE_WIDTH( 1 * 16 ) );
// *** draw zigzag 1
EVE_cmd_dl( BEGIN(EVE_LINE_STRIP) );
for( i = 0 ; i < 250 ; i++ ) {
if( i % 2 )
EVE_cmd_dl( VERTEX2F( 1600 + i*40, 66*16 -50 *16 ) );
else
EVE_cmd_dl( VERTEX2F( 1600 + i*40, 66*16 +50 *16 ) );
// to go sure
if( i % 50 )
EVE_execute_cmd();
}
num_dl_static = EVE_memRead16(REG_CMD_DL); // read current position
// *** draw zigzag 2
EVE_cmd_dl( BEGIN(EVE_LINE_STRIP) );
for( i = 0 ; i < 250 ; i++ ) {
if( i % 2 )
EVE_cmd_dl( VERTEX2F( 1600 + i*40, 196*16 -50 *16 ) );
else
EVE_cmd_dl( VERTEX2F( 1600 + i*40, 196*16 +50 *16 ) );
// to go sure
if( i % 50 )
EVE_execute_cmd();
}
num_dl_static = EVE_memRead16(REG_CMD_DL); // read current position
// *** draw zigzag 3
EVE_cmd_dl( BEGIN(EVE_LINE_STRIP) );
for( i = 0 ; i < 250 ; i++ ) {
if( i % 2 )
EVE_cmd_dl( VERTEX2F( 1600 + i*40, 326*16 -50 *16 ) );
else
EVE_cmd_dl( VERTEX2F( 1600 + i*40, 326*16 +50 *16 ) );
// to go sure
if( i % 50 )
EVE_execute_cmd();
}
num_dl_static = EVE_memRead16(REG_CMD_DL); // read current position
// *** draw zigzag 4
EVE_cmd_dl( BEGIN(EVE_LINE_STRIP) );
// for( i = 0 ; i < 250 ; i++ ) { // CRASHES !
for( i = 0 ; i < 230 ; i++ ) { // OK
if( i % 2 )
EVE_cmd_dl( VERTEX2F( 1600 + i*40, 456*16 -50 *16 ) );
else
EVE_cmd_dl( VERTEX2F( 1600 + i*40, 456*16 +50 *16 ) );
// to go sure
if( i % 50 )
EVE_execute_cmd();
}
// *** draw zigzag 5
// EVE_cmd_dl( BEGIN(EVE_LINE_STRIP) );
//
//// for( i = 0 ; i < 250 ; i++ ) { // CRASHES !
// for( i = 0 ; i < 230 ; i++ ) {
//
// if( i % 2 )
// EVE_cmd_dl( VERTEX2F( 1600 + i*40, 586*16 -50 *16 ) );//
// else
// EVE_cmd_dl( VERTEX2F( 1600 + i*40, 586*16 +50 *16 ) );
//
// if( i % 50 )
// EVE_execute_cmd();
// }
num_dl_static = EVE_memRead16(REG_CMD_DL);
EVE_cmd_dl( END() );
EVE_cmd_dl( DL_DISPLAY );
EVE_cmd_dl( CMD_SWAP );
EVE_execute_cmd();
}
One picture shows the forth block with 230 lines, the second one with 250 line, which crashes.
"num_dl_static" shows the size of the display list to me in the debugger.
What am i doing i wrong ?