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

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

Re: [avr-gcc-list] Help with flash lookup table


From: Paulo Marques
Subject: Re: [avr-gcc-list] Help with flash lookup table
Date: Wed, 10 May 2006 20:48:57 +0100
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050716)

Micah Carrick wrote:
[...]
uint8_t gp2d120_adc8_to_cm (uint8_t adc_value)
{
       uint8_t *ptr = gp2d120_data;
       *ptr += adc_value;
        ^^^^

this should be:

        ptr += adc_value;


Or even easier (totally untested):

uint8_t gp2d120_adc8_to_cm (uint8_t adc_value)
{
        return pgm_read_byte(&gp2d120_data[value]);
}

I hope this helps,

--
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com

Pointy-Haired Boss: I don't see anything that could stand in our way.
           Dilbert: Sanity? Reality? The laws of physics?




reply via email to

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