avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Address of code segment


From: Robert von Knobloch
Subject: [avr-gcc-list] Address of code segment
Date: Thu, 28 Jan 2010 10:53:10 +0100
User-agent: Thunderbird 1.5.0.14 (X11/20060911)

Hi,

I am trying to beat the compiler into submission (doing what I want) and
would appreciate it if anyone could help me with a small point.
I have a system where a program running on a Mega644P is used to program
and test small embedded apps running on Tiny13s & 25/45s.
In order to test these, I want to first put a small program using the
in-line assembler in the Target Tiny to test it's I/O devices, then I
blow the target program.

I have everything working with just one small niggle:

In the following code:

CODESECTION uint16_t test7(void)
{
    uint8_t size7prog;

    // Write assembler program to tester RAM. BEWARE of page size !!
    for (size7prog = 0; size7prog < (4 * 32); ++size7prog)
    parms.flashbuf[size7prog] =
test_pgm_read_byte((PGM_VOID_P)(&test7prog + size7prog)); *****
//.........
// Having got the assembler in the ram buffer parms.flashbuf[ ], I have
existing routines to transfer the code to the target using ISP.
//........
}

CODESECTION void test7prog(void)
{
    asm (   "some assembler code \n\t"
        : : );
}

Although working, the starred line gives the warning "passing argument 1
of 'test_pgm_read_byte' discards qualifiers from pointer target type"
I had hoped the cast of (PGM_VOID_P) would help, but it doesn't.
What is the 'right' way (from the compiler's view) to extract the
address of the assembler code ?
(I like a clean compile with no warnings).

Thanks,

Robert von Knobloch




reply via email to

[Prev in Thread] Current Thread [Next in Thread]