OK, so first of all many thanks to Teo for testing this out (as it turned out, the first test code had a benign bug
).
This is a basic procedure, LC rpm hard cut and time limited NLS cut, as in the patch to be found in the Wiki for ME7.1 (or was it ME7.5). Only I fixed it around a bit, and this one disables dmd and kr, oh, and it also has configurable hysteresis margins for the RPM thresholds. I attach the factory bin of what Teo tested, a S19 patch, xdf definition with LC/NLS parameters, patched bin for the lazy ones, and my ASM source (don't bother trying to find the tool that compiles it, only I have it, the code is only for reviewing, please tell me if you see bugs) if you want to match to another bin.
Two next extensions on the list, RPM shift light through MIL (this I already sorted out), and dynamic setting up of LC/NLS RPM thresholds through the cruise control stalk. Here I need feedback, I got a bit stuck conceptually:
My initial plan was: cc into on mode (also makes LC/NLS disabled), and then when holding cc+ register the rpm (highest seen) for LC, and when holding cc- register rpm for NLS. But for this to make sense there has to be a way to reset it and I run out of cc buttons. There is the resume button, but, here is the thing, there are two types of ME7.9.10 (as far as I can tell), one that has cc stalk connected directly to the ECU (and then all buttons / states are always readable), the other one gets this from the cluster through CAN and the cluster already filters out some things, in particular the ECU does not receive resume presses when stationary (or +/- presses without cc being on).
So I need another logic for this. Possibly: cc on for setup / LC/NLS disable, then (no other buttons) register RPMs for LC (as long as they are above some sensible limit, like 2500 rpm), with cc+ register RPMs for NLS, cc- reset both. What do you think? To me it seems overly complicated, but I cannot come up with something simpler. There is also the option to read the sport / power steering state, but this would make it even a bigger clusterfuck. Help me out here to come up with something sensible.