fix sampling.
fix gpio init based on config.