Button Event not being picked up by dev array
fogled@mizzou
Posts: 549
DEFINE_DEVICE dvtp1_core = 10001:1:0 dvtp2_core = 10002:1:0 debug_port = 33001:1:0 DEFINE_CONSTANT btnset_tab = {1,2,3} DEFINE_VARIABLE dvtp_core[] = { dvtp1_core,dvtp2_core } DEFINE_EVENT button_event[dvtp_core,btnset_tab] { //Tabs push: { send_string debug_port,"'Panel Tab # ',itoa(button.input.device.number),' Pushed!" } }
I have nearly identical code running successfully on several controllers in several installations, and suddenly, with this latest project, the button event is not getting picked up. I get no message to the debug port.
If I change the DEV array in the button event to a single device, it will pick up the button push on that device. But the moment I use a device array, the button event goes dead.
I'm missing something, but I can't figure it out. Any ideas out there?
Thanks!
0
Comments
This will appear to work fine as long as you are pushing a button that made it into the event table, but if you try pushing button 20 on dvTp100, nothing will happen. I don't recall if it cuts off the Tps, or the higher button numbers, but it definitely cuts off.
There is an easy way to solve this tho:
This will work just fine as each table has 100 elements (Not sure of the nomenclature, but hopefully you get the idea).
Jeff
If you use button_event[dvTps,0] you effecively have only 1 event trigger as far has system resources are concerned but you can push buttons up to 65535. You also no longer have hold issues when using the catch all "0".
http://amxforums.com/showthread.php?t=5943&highlight=event+table
The DEV typing is there in my code, that was just a copy/paste into the browser form mistake.
I've always got 3 buttons, and every other project has just 2 panels; this one has 3 panels. Hardly anything that should run up against any limits.
This project is the only one I've got so far that uses the same DEV in more than one DEV array. I ran into this once before now that I think about it, and I did solve it by just stacking button events with a single dev per button event. I'm going to poke around just a bit to see if I can figure this out before I drop back to the stacked button events.
Any more ideas out there?
I've had things like this happen a couple times before and it turned out to be the starngest thing. I accidentally typed in some keyword in an unintended place. It would compile without errors but the program was totally jacked.
In one case I was finding that any variables made non-volatile or persistent were not working. So, any code for things that had persistent variables (like volume or station presets) would compile but not work. You'd never see the button event fire.
I don't even remember what the heck keyword I typed but it was something up in the top of the file. Sometimies, I'll pop open NS to quickly type in a keyword and hit F1 to check out what it does. I think I did this, got distracted, and forgot to clear it out afterward.
How I found it was also mind-bogglingly annoying. I basically commented out all the code and complied, uploaded, checked for happiness, then uncommented another section, repieat, repeat, repeat...
It literally took a whole day of this. But, I eventually did find it.
If it is this kind of thing, it'll be hard to find since it is obviously compiling. So, it won't be as simple as double-clicking the error notice in the window.
I had made some changes to one of my structures, adding storage for more info, and I think I must have overloaded the memory. In one place in the structure, I had given a character size of 20,000 instead of 2,000. Reducing the size of the CHAR definitions in the structure fixed the problem.
Thanks everyone!
Happy Day!
Can you change the flash memory in cases like that?
You could also (probably) run a clean disc to clear the running program so that there would be enough space for the new program. Since you have to have enough free space for the current running program and the new program to be installed at the same time until the final checksums on the new program are validated and then the new program loaded. Clearing the disc to minimize the current program should free up enough space to allow the new program to load. Unless of course you made some seriously large modification.