MidiPal: Issue with adding pages (AddPage limitation?)

I have a problem in modifying some MidiPal code which really drives me crazy.
I’m modifying the sequencer code at the moment. I changed the class name, did some modifications, and i also added two new pages using the ui.AddPage method. I defined the variables in the header and in the cc-code and i also took care that the two new paramaters/variables have been defined in the right order (as a pointer will be used later in the MidiPal code).
I also took care of extending the sequencer_factory_data (index size as well as entering the data into the array). Last but not least i modified all sections in the code which were referencing the number of pages (now 15 instead of 13).

So far, so good. Everything went fine, the variables were used by the code, i was able to change them in the MidiPal etc.

Then i tried the same again with another variable/page and the desaster began! Afterwards i was not able to scroll to the single step pages (which are added by AddRepatedPage() ). Sometimes the first pages did show up but most of the time they didn’t. The number of steps was shown in the according page and i could change it. I have the impression that in the code a different value will be retrieved.
Ah, of course i always did a reset after uploading the new FW.

I know that this is a very specific question and i think most of the people reading this don’t even know what i’m talking about :frowning: but i’m messing around the whole day (!) now and could not get any further.

So, is there anything special i have to take into account when adding new pages or is there a limitation?

The sequencer app is pushing the tiny midipal UI framework to its limits - repeated pages, some of them optional.

I bet you have done something that makes CheckPageStatus unhappy. Make it return 1 and see if it fixes your problem.

Another thing: whenever you change a data structure in the MIDIpal, it will filled with garbage the first time you run your app because it’ll be filled with settings in eeproms from the previous saved structure. So maybe you have garbage in the variables note_track_, duration_track_ and so on which decides which kinds of info is editable per step.

Good luck, and welcome to the land of troubleshooting embedded application code :slight_smile:

Yes, i already tried the return 1 trick and it worked but i want to do it the “correct” way :slight_smile:
Regarding the other point you mentioned: yes, i also realized this and therefore i always called the “reset application” before using the app.
I also checked the values in the app.cc file so that i don’t mess up the tiny 1024 bytes in the eeprom.
O.k., will continue to try to fix the problem.

So the first month of coding must have been a nightmare for you, right?

Anyhow, thanks for the help.