Backport bsmiles32 interrupt refactoring