void demoTask(void *pdata)
{
INT16S size;
INT8U cnt;
const INT8U **messagesPtr;
//Initialize LCD Services (uses priorities 3, 4, 5)
vGlcdInit(&lcdTaskStk[0], sizeof(lcdTaskStk), 3);
for(;;)
{
/*Init fillscreen object*/
fillScr.offset.x = fillScr.offset.y = 0; //Offset for the source in X and Y
fillScr.param.color = PX_COMB_PASTE; //Coloring method
fillScr.size.x = fillScr.size.y = 1; //One byte long in X and Y
fillScr.data = pclean; //Source of the data
/*Call to the method "Clear all screen"*/
cGlcdFillScr( &fillScr );
/*Draw 2 rectangles*/
rectangle.posIni.x = 0; rectangle.posFin.x = 127;
rectangle.posIni.y = 0; rectangle.posFin.y = 63;
rectangle.param.color = PX_COMB_ON;
rectangle.param.getSet = SET;
rectangle.param.limited = 1; rectangle.param.optimized = 1;
for (cnt = 0; cnt < 2; cnt++)
{
rectangle.posIni.x = cnt * 2; rectangle.posFin.x = 127 - cnt * 2;
rectangle.posIni.y = cnt * 2; rectangle.posFin.y = 63 - cnt * 2;
cGlcdRectangle(&rectangle);
OSTimeDly(2);
}
//Draw a splitting line
line.param.color = PX_COMB_ON;
line.param.getSet = SET;
line.param.limited = 1;
line.param.optimized = 1;
line.posIni.x = 63;
line.posIni.y = 2;
line.posFin.x = 63;
line.posFin.y = 60;
cGlcdLine(&line);
/*Init text object*/
text1.window.pos.x = 3;
text1.window.pos.y = 3; //Position of the text window
text1.window.size.x = 58;
text1.window.size.y = 58; //Size of the text window
text1.string.pos.x = text1.string.pos.y = 0; // Initial position of text in the window
text1.string.param.color = PX_COMB_PASTE;
text1.string.param.optimized = 1;
text1.string.param.limited = 1;
text1.string.tabspace = xGlcdGetDefTAB(4); // Size of tab space
text1.font.size.x = 5; text1.font.size.y = 6; //Size of font
text1.font.data = font5_6;
messagesPtr = messages;
//Print a message 20 times
for (cnt = 0; cnt < 20; cnt++)
{
//Set Message
text1.string.data = (const INT8U *) *messagesPtr++;
//Print Messages
cGlcdPrintf( &text1 );
//Delay 500 ms
OSTimeDlyHMSM(0, 0, 2, 0);
if (*messagesPtr == 0) { messagesPtr = messages; }
}
bitmap.param.limited = 0; //Limit to screen size
bitmap.param.optimized = 1; //Optimized routine
bitmap.source.size.x = 16; bitmap.source.size.y = 16; //Size of the bitmap source
bitmap.size = bitmap.source.size; //Size of the desired bitmap
bitmap.source.offset.x = bitmap.source.offset.y = 0;
bitmap.param.color = PX_COMB_XOR; //Negate
bitmap.source.data = pball; //Data of the bitmap
for (cnt = 0; cnt < 200; cnt++ )
{
bitmap.
pos.
x = ((INT16U
)sin(cnt
) * 48)/64; bitmap.
pos.
y = ((INT16U
)sin(cnt
+ 32) * 48)/64;
/*Call to the method "place bitmap"*/
cGlcdBitmapSet( &bitmap );
OSTimeDly(5);
/*Restore by negating*/
cGlcdBitmapSet( &bitmap );
}
}
}