GPIO handler + flag handler