changed gpio_export to access the memory only once per call