adafruit/adafruit-beaglebone-io-python — pull request #15 by cdesjardins (2013-07-26 16:29:15+00:00)
Title: Pass the name of the GPIO to callbacks rather than the GPIO number.

When a callback is invoked as a result of add_event_detect or add_event_callback the parameter is the GPIO number rather than the actual name which is used everywhere else in the python api. I have changed the code so that it now passes in the name, then it is easy to read the GPIO for example.

def switchHit(channel):
print("Hit a switch", channel)

GPIO.add_event_detect("P8_46", GPIO.FALLING, switchHit, 50)

When the GPIO falls, the output in this case will be:

('Hit a switch', 'P8_46')

Prior to this patch the output would have been:

('Hit a switch', 71)

Which is totally useless.