I finally got round to streamlining my BladeID setups, but save files don’t seem to be entirely playing ball…
I’ve set it to run ScanID with a button push when I put a different blade in to distinguish between blades. The blades all have different resistor values, I have the SAVE_STATE define and my blade array has four stages.
I want the first three stages to work in sync, and only the fourth (which links to a charging preset) to be separate.
What I mean by that is if I have no blade fitted and I’m on preset number 6, and I then fit my test blade, run scanid to switch to the appropriate blade array, I still want it to stay on preset 6 and not switch to the last saved preset on that array. The first three preset arrays all use the same font folders in the same order.
So to do this, I’ve specified a save file for the charge blade array, but not for the other three arrays, on the basis that those three will all use the same save files which default to the top layer of the SD card.
All good so far, and seems to work great.
So going a step further, I’ve added three different PreFont folders specified in each preset array. This is so I can have a spoken ident as the bladein effect telling which array I’ve switched to. So when I insert, say, the test blade and then run scanid on the buttons, it announces, “Test blade detected,” as it switches to that blade/preset array.
But it’s here that it gets weird because I’m finding that if I start with a clean slate of no save files and just boot up and use the saber, everything works great. It switches between arrays, plays the right idents etc. But if I have done the colour change feature on any font, and I then run scanid, it still correctly switches to the correct blade and preset arrays, but bizarrely it doesn’t play the correct bladein file from the correct PreFont folder - it just plays the same one from the array I was on when I did the colour change. But I know it’s switching to both the correct blade array AND the correct preset array because my blade lengths are different in each array and they switch correctly. Also the blade styles in the no-blade array are also different to the others in order to get a kind of spinning effect inside the neopixel connector. And that all works.
So my question is, how is it managing to switch to the correct blade and preset arrays but not the correct folder paths?
The only possible clue is that on all my presets I have 12 colours all set in the same order. But the first time I use colour change, it seems to get a little confused on the order. But once I’ve cycled through the colours and saved a new colour, it seems to sort itself out and is correct after that.
So my guess is that it is indeed something to do with the save files and how they save preset and colour change data. But I’m at a loss as to how that’s creating the observed anomolies.
I’m using 7.14 so I guess the next step is to try GitHub Master and see how that compares. Will give it a go later today and report back.
Config is below.