re add const for keil compiler
re enable states