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


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to