merge some freeimu code