Merge pull request #49 from ECNU3D/master

[TARGET] Fix #48 for unexpected program running (reset and halt)
Fix the #48 and clean up the code