Hallo Leute, Sorry wenn ich mit dem Flash nerve, falls jemand eine gute Doku dazu kennt - außer Butterfly - das kenne ich schon und ich hab zwar so halbwegs kapiert, wies dort funktioniert. Aber irgendwie fehlen mir ein paar wichtige Infos. Deshalb nochmal die Frage hier: Wie bekomme ich die Struktur aus dem Flash kopiert, auf die der Pointer my_strukt.down zeigt. Danke für Eure Antworten. Ein paar Ding noch: Ich verwende den avr-gcc und die Daten sind IMHo auch alle im Flash. typedef struct def_menustruktur { const char* position; PGM_P* up; PGM_P* down; PGM_P* prev; PGM_P* next; void ( *funktion )( void ); } menustruktur; const char Hauptmenuname[] PROGMEM = "Hauptmenu"; const char Helligkeitsname[] PROGMEM = "Helligkeit"; PGM_P NAME[] PROGMEM = { (void*)&Hauptmenuname, (void*)&Helligkeitsname }; const menustruktur Hauptmenu PROGMEM = {(char*) &Hauptmenuname, (PGM_P *) &Interfacemenu, (PGM_P *) &Kameramenu, (PGM_P *) &Helligkeit, (PGM_P *) &Helligkeit, do_Hauptmenu}; const menustruktur Helligkeit PROGMEM = {(char*) &Helligkeitname, (PGM_P *)&Hauptmenu, (PGM_P *)&Hauptmenu, (PGM_P *)&Hauptmenu, (PGM_P *)&Hauptmenu, do_Helligkeit}; PGM_P MENU[] { (void*)&Hautpmenu, (void*)&Helligkeit }; void menu (void) { menustruktur my_struct; memcpy_P((void*)&my_struct, (PGM_P*)&Hauptmenu, sizeof(my_struct)); char temp[16]; PGM_P* tempi; for (int i = 0; i < 4; i++) { tempi = pgm_read_word(&my_struct.down); memcpy_P((void*)&my_struct, (PGM_P*)tempi, sizeof(my_struct)); strcpy_P(temp,my_struct.position); LCD_writeln(i, temp); } }
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.