refactor stk600.c