since the isr TB1 is an accurate timebase you can
make a new var
Code:
kio_inhibit var byte
modify the I/o key routine
Code:
IF KP = 0 THEN '1/0 BUTTON PRESSED
;use p_level to see what state machine is in 0=off ,non zero = on
if kio_inhibit==0 then
kio_inhibit=152 ;152*32mS = about 5 seconds
if p_level then
ccp1con=0 ;must be on kill it
led=0
p_level= 0
else ;must be off power to max
p_level= 5
endif
endif
and add this to the isr
Code:
if kio_inhibit then
kio_inhibit = kio_inhibit -1
endif
now the I/O key is inhibited for 5 sec after being acted on
I like ART's quote and its so true
PBP is very well documented, however you’ll notice all examples of command use are also examples of exactly how not to write a cyclic program.
you need to adjust your way of thinking to loops , states and flags . it opens up a whole new vista
Bookmarks