fix compiler warnings and HAL API version.