avr-libc-dev
[Top][All Lists]
Advanced

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

[avr-libc-dev] [bugs #9669] Incorrect example for strings in flash


From: Joerg Wunsch
Subject: [avr-libc-dev] [bugs #9669] Incorrect example for strings in flash
Date: Tue, 20 Jul 2004 17:48:36 -0400
User-agent: Mozilla/5.0 Galeon/1.2.6 (X11; FreeBSD i386; U;) Gecko/0

This mail is an automated notification from the bugs tracker
 of the project: AVR C Runtime Library.

/**************************************************************************/
[bugs #9669] Latest Modifications:

Changes by: 
                Joerg Wunsch <address@hidden>
'Date: 
                Tue 07/20/2004 at 21:45 (Europe/Berlin)

            What     | Removed                   | Added
---------------------------------------------------------------------------
         Assigned to | None                      | joerg_wunsch







/**************************************************************************/
[bugs #9669] Full Item Snapshot:

URL: <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=9669>
Project: AVR C Runtime Library
Submitted by: 0
On: Fri 07/16/2004 at 14:42

Category:  Documentation
Severity:  5 - Average
Item Group:  None
Resolution:  None
Assigned to:  joerg_wunsch
Originator Email:  address@hidden
Status:  Open


Summary:  Incorrect example for strings in flash

Original Submission:  The code in the FAQ entry "How do I put an array of 
strings completely in ROM?" is incorrect. Array elements are not read the right 
way (note that the array of pointers resides in flash).

Here is a working solution. Instead of:
//------------------------------------
        strcpy_P (buf, array[1]);
//------------------------------------

Should be:
//------------------------------------
        PGM_P p;
        memcpy_P( &p, &array[1], sizeof(PGM_P));
        strcpy_P (buf, p);
//------------------------------------













For detailed info, follow this link:
<http://savannah.nongnu.org/bugs/?func=detailitem&item_id=9669>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/







reply via email to

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