Hi Filipe,
I never tried this but here is a thought.
The pin on a specific port can be found in the LATx register, example below for portc this is
LATC.
You find this in your device file for e.g. pin_C2
var volatile bit LATC_LATC2 at LATC : 2
var volatile bit pin_C2 at PORTC : 2
So if you have for example your buttons on port C you could pass a 'mask'
as parameter to the procedure. Example below (not compiled):
function pin_active(byte in pin_mask) return bit
return (LATC & pin_mask)
end function
So if you want to if test pin C1 is active (HIGH) or pin C7 is active (HIGH) you do:
if pin_active(0b0000_0010) then
-- Do something for bin C1
end if
if pin_active(0b1000_0000) then
-- Do something for pin C7
end if
Kind regards,
Rob