Hi!!
Your code seems to be ok, however you must be aware the way the KBI works. The KBI module will NOT assert a new interrupt request until there are no pins on active state!! That was a nightmare first time I faced it.
For example, suppose you have two pins for requesting an interrupt, A0 and A1, on falling edges only. On normal state A0 and A1 are at high level. When A0 goes to low level then an interrupt request asserts, and you service it, and then, while A0 is still at low level, A1 asserts (e.g. going to low level). This last request won't be serviced!! :smileysad: In order for a new request to be serviced ALL kbi pins MUST be on inactive state, e.g. all must be at high level before a new request interrupt must be asserted. Awesome!! :smileyhappy:
Please verify that your applications is not doing what I said. If so, you may look for alternatives, e.g. using the IRQ interrupt, and the input capture timer pins as well. I remember I tried to disable a pin like KBI interrupt in order to assert other request for other pin, but that didn't work for me ( I intended to do a quadrature decoder), but you can try it.
By the way, for the original user that posted this thread: if you only want to count pulses you may use the IRQ pin or the input capture timer pin, it will be easier and cleaner.