Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07 Nov 2003 11:29 AM by  francisco.gutierrez@nav-international.com
How do you display a picture?
 4 Replies
Sort:
You are not authorized to post a reply.
Author Messages
francisco.gutierrez@nav-international.com
New Member
New Member
Posts:


--
07 Nov 2003 07:41 AM
    Hello Everybody, How do you display a picture (In code, no LOLO)??

    This is what I had tried:

    I partially took this from one of the demos in the kit. The demo was clearing the video buffer, so instead of *pbf=0 I replaced it with a color 0x01E0 (green), but it looks weird, it does not paint all the vertical lines why?
    also
    would this display my picture if I do this:

    pfb = (UNS_32*)SRAM_PHYS_BASE
    while ((UNS_32)pfb < (image+ DISPLAY_WIDTH*DISPLAY_HEIGHT)*2))
    {
    *pfb=*(pointer of my picture array)
    pfb=pfb+1;
    (pointer of my picture)=(pointer of my picture)+1;
    }



    here is the code:

    pfb = (UNS_32*)SRAM_PHYS_BASE
    while ((UNS_32)pfb < (image+ DISPLAY_WIDTH*DISPLAY_HEIGHT)*2))
    {
    *pfb =0x01E0; //(GREEN)
    pfb=pfb+1;
    }
    miket@logicpd.com
    New Member
    New Member
    Posts:


    --
    07 Nov 2003 09:47 AM
    what are pfb and pbf declared as?
    francisco.gutierrez@nav-international.com
    New Member
    New Member
    Posts:


    --
    07 Nov 2003 10:11 AM
    pfb (no pbf sorry typo):

    UNS_32* pfb=NULL;
    UNS_32 image = SRAM_PHYS_BASE;
    miket@logicpd.com
    New Member
    New Member
    Posts:


    --
    07 Nov 2003 10:17 AM
    That's the problem, you're doing pointer math on a 32-bit
    pointer, so when you do pfb = pfb + 1; you're incrementing
    the pointer by 4 byte positions. And the write to the pointer
    location is 32 bits as well (so you're really writing 0x000001e0.)
    Try changing the declaration of pfb to UNS_16 *pfb;
    francisco.gutierrez@nav-international.com
    New Member
    New Member
    Posts:


    --
    07 Nov 2003 11:29 AM
    THANK YOU! it worked!!
    You are not authorized to post a reply.