+ if (last_key == KEY_RESET) {
+ cur_motor[0] = 0xff;
+ } else {
+ if (cur_motor[0]) {
+ u8 motor_num;
+ cur_motor[1] = last_key%10;
+ display_buf[1] = cur_motor[1]+'0';
+ set_msg(display_buf);
+
+ motor_num = cur_motor[0]%10;
+ motor_num *= 10;
+ motor_num += cur_motor[1];
+ switch (dispense_motor(motor_num)) {
+ case MOTOR_HOME_FAIL:
+ set_msg(" HOME FAIL ");
+ break;
+ case MOTOR_CURRENT_FAIL:
+ set_msg(" OVER CRNT ");
+ break;
+ case MOTOR_SUCCESS:
+ set_msg("THANK YOU");
+ break;
+ case MOTOR_NOSLOT:
+ set_msg(" NO MOTOR ");
+ break;
+ default:
+ set_msg("ERRRRRRRR?");
+ break;
+ }
+
+ display_buf[0] = ' ';
+ display_buf[1] = ' ';
+ cur_motor[0] = 0xff;
+ delay(500);
+ } else {
+ cur_motor[0] = last_key;
+ display_buf[0] = (last_key%10)+'0';
+ set_msg(display_buf);
+ }
+ }