Revert "fix compiler warnings and HAL API version."

This reverts commit 5eb670992ac7935d9489e9c79d986d447d3ba771.
Doesn't work as expected.