Hi Manfred,
Tried to lock the bitmap and take the first pixel of the locked bitmap area. But a reset happening in the harware . Kindly find the code snippet for the same
static void EwUpdate( XViewport* aViewport, CoreRoot aApplication )
{
XBitmap* bitmap;
GraphicsCanvas canvas = EwNewObject( GraphicsCanvas, 0 );
XRect updateRect = {{ 0, 0 }, { 0, 0 }};
XRect lockArea;
XBitmapLock* lock;
if ( !canvas )
return;
if ( DisplayInfo.UpdateMode == EW_BSP_DISPLAY_UPDATE_NORMAL )
{
bitmap = EwBeginUpdate( aViewport );
/* redraw the dirty area of the screen */
if ( bitmap )
{
GraphicsCanvas__AttachBitmap( canvas, (XHandle)bitmap );
updateRect = CoreRoot__UpdateGE20( aApplication, canvas );
GraphicsCanvas__DetachBitmap( canvas );
EwEndUpdate( aViewport, updateRect );
}
}
else
{
int regions = CoreRoot__BeginUpdate( aApplication );
while ( regions-- )
{
/* get rectangular area of the update region for scratch-pad buffer */
if ( DisplayInfo.UpdateMode == EW_BSP_DISPLAY_UPDATE_SCRATCHPAD )
updateRect = CoreRoot__GetUpdateRegion( aApplication, regions );
/* iterate through all update areas */
while ( EwBspDisplayGetUpdateArea( &updateRect ))
{
/* update the current subarea */
bitmap = EwBeginUpdateArea( aViewport, updateRect );
GraphicsCanvas__AttachBitmap( canvas, (XHandle)bitmap );
CoreRoot__UpdateCanvas( aApplication, canvas, updateRect.Point1 );
GraphicsCanvas__DetachBitmap( canvas );
EwEndUpdate( aViewport, updateRect );
}
if ( DisplayInfo.UpdateMode != EW_BSP_DISPLAY_UPDATE_SCRATCHPAD )
break;
}
CoreRoot__EndUpdate( aApplication );
}
/* Lock the entire bitmap for write operation */
lockArea.Point1.X = 0;
lockArea.Point1.Y = 0;
lockArea.Point2.X = 800;
lockArea.Point2.Y = 480;
EwPrint("\n ******Lock Bitmap*****");
lock = EwLockBitmap( bitmap, 0, lockArea, 1, 0 );
EwPrint("\n ******Bitmap locked*****%u",lock); //Returns 0
dest = (unsigned int*)lock->Pixel1; //At this point there is a reset
EwPrint("\n ******Bitmap locked dest:%d*****",dest);
EwUnlockBitmap( bitmap );
}
Here if we try to print the lock object its returning 0 , then if we try to access lock->Pixel1 then there is a reset happening in hardware.
Kindly check and let me know if we miss something.
Best Regards,
Preethi S