Guten Abend, ich habe folgendes Problem:
Ich benutze mehrere structs zum Speichern von Menueinträgen für ein LCD.
Die sehen so aus.
1 | struct menu_list{
|
2 | const char *Title;
|
3 | const uint8_t mode;
|
4 | zeiger_func text;
|
5 | };
|
6 |
|
7 | const struct menu_list WasserSim_Menu[] PROGMEM = {
|
8 | {_string_WASSER_MODE,WATER_MODE,_water_mode},
|
9 | {_string_modul_status,WATER_START,_water_startstop},
|
10 | {_string_WASSER_IMPULSE,WATER_IMPULSE,_water_impulse},
|
11 | {_string_WASSER_PRESSURE,WATER_PRESSURE,_water_pressure},
|
12 | {_string_WASSER_COUNT,WATER_COUNT,_water_count},
|
13 | };
|
(*Title zeigt auch auf eine Adresse im Flash)
und werden so aufgerufen:(Auszüge aus dem Code)
1 | zeiger_func TextFunc = (zeiger_func)pgm_read_word(&array[i+line_offset].text);
|
2 |
|
3 |
|
4 | und
|
5 |
|
6 | const char *title = (const char*)pgm_read_word(&array[i+line_offset].Title);
|
Wie zähle ich die Anzahl der Einträge in der menu_list WasserSim_Menu
structur?