Wie kann ich im Flash ein Array (Lock up Table) erstellen ?
Gruß wfly
Array im Flash erstellen ? - Flowcode 5 AVR
Moderator: Benj
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: Array im Flash erstellen ? - Flowcode 5 AVR
Hallo,
Sie können den folgenden ausgezeichneten Beitrag von Martin ...
http://www.matrixmultimedia.com/mmforum ... hp?p=31507 # p31507
Sie können den folgenden ausgezeichneten Beitrag von Martin ...
http://www.matrixmultimedia.com/mmforum ... hp?p=31507 # p31507
Re: Array im Flash erstellen ? - Flowcode 5 AVR
Der Beitrag von Martin bezieht sich auf den Code für PIC.
Hier das Beispiel für AVR
Beim AVR muss unter "Projekt Options" im Feld "Definitions and function declarations:" der Code
"#include <avr/pgmspace.h>" eingetragen werden
Und unter "Function implementations:"
const uint16_t Variablenname[] PROGMEM =
{65281,65028,64777,64528,64281,64035,63792,63550,
63310,63072,62836,62602,62369,62138,61909,61681,
61455,61231,61008,60787,60568,60350,60133,59919};
Das Auslesen der Tabelle erfolgt in einem C-Element:
VAR=Variablenname[INDEX];
Hier das Beispiel für AVR
Beim AVR muss unter "Projekt Options" im Feld "Definitions and function declarations:" der Code
"#include <avr/pgmspace.h>" eingetragen werden
Und unter "Function implementations:"
const uint16_t Variablenname[] PROGMEM =
{65281,65028,64777,64528,64281,64035,63792,63550,
63310,63072,62836,62602,62369,62138,61909,61681,
61455,61231,61008,60787,60568,60350,60133,59919};
Das Auslesen der Tabelle erfolgt in einem C-Element:
VAR=Variablenname[INDEX];