def test_irq(gpio, pin_num=None):
    value = gpio.value()
    state = ('released' if value else 'pressed')
    print('key', gpio, state)
    global app, key1, key2
    if (gpio is key2):
        app.on_top_button_changed(state)
def test_irq(gpio, pin_num=None):
    value = gpio.value()
    state = ('released' if value else 'pressed')
    print('key', gpio, state)
    global app, key1, key2
    if (gpio is key2):
        app.on_top_button_changed(state)