@@ -840,7 +840,7 @@ static int emcTaskPlan(void)
840840 case EMC_MOTION_SET_AOUT_TYPE:
841841 case EMC_TRAJ_RIGID_TAP_TYPE:
842842 case EMC_TRAJ_SET_TELEOP_ENABLE_TYPE:
843- case EMC_SET_DEBUG_TYPE:
843+ case EMC_SET_DEBUG_TYPE:
844844 retval = emcTaskIssueCommand (emcCommand);
845845 break ;
846846
@@ -962,7 +962,7 @@ static int emcTaskPlan(void)
962962 case EMC_MOTION_ADAPTIVE_TYPE:
963963 case EMC_TRAJ_RIGID_TAP_TYPE:
964964 case EMC_TRAJ_SET_TELEOP_ENABLE_TYPE:
965- case EMC_SET_DEBUG_TYPE:
965+ case EMC_SET_DEBUG_TYPE:
966966 retval = emcTaskIssueCommand (emcCommand);
967967 break ;
968968
@@ -1318,7 +1318,7 @@ static int emcTaskPlan(void)
13181318 case EMC_TRAJ_PROBE_TYPE:
13191319 case EMC_AUX_INPUT_WAIT_TYPE:
13201320 case EMC_TRAJ_RIGID_TAP_TYPE:
1321- case EMC_SET_DEBUG_TYPE:
1321+ case EMC_SET_DEBUG_TYPE:
13221322 case EMC_COOLANT_MIST_ON_TYPE:
13231323 case EMC_COOLANT_MIST_OFF_TYPE:
13241324 case EMC_COOLANT_FLOOD_ON_TYPE:
@@ -1416,7 +1416,7 @@ static int emcTaskPlan(void)
14161416 case EMC_MOTION_SET_AOUT_TYPE:
14171417 case EMC_MOTION_ADAPTIVE_TYPE:
14181418 case EMC_TRAJ_RIGID_TAP_TYPE:
1419- case EMC_SET_DEBUG_TYPE:
1419+ case EMC_SET_DEBUG_TYPE:
14201420 retval = emcTaskIssueCommand (emcCommand);
14211421 break ;
14221422
@@ -1548,7 +1548,7 @@ static int emcTaskCheckPreconditions(NMLmsg * cmd)
15481548 return EMC_TASK_EXEC_WAITING_FOR_MOTION_AND_IO;
15491549 break ;
15501550
1551- case EMC_TOOL_PREPARE_TYPE:
1551+ case EMC_TOOL_PREPARE_TYPE:
15521552 case EMC_LUBE_ON_TYPE:
15531553 case EMC_LUBE_OFF_TYPE:
15541554 return EMC_TASK_EXEC_WAITING_FOR_IO;
@@ -2470,7 +2470,7 @@ static int emcTaskCheckPostconditions(NMLmsg * cmd)
24702470 case EMC_SPINDLE_ON_TYPE:
24712471 case EMC_SPINDLE_OFF_TYPE:
24722472 case EMC_SPINDLE_ORIENT_TYPE:
2473- case EMC_COOLANT_MIST_ON_TYPE:
2473+ case EMC_COOLANT_MIST_ON_TYPE:
24742474 case EMC_COOLANT_MIST_OFF_TYPE:
24752475 case EMC_COOLANT_FLOOD_ON_TYPE:
24762476 case EMC_COOLANT_FLOOD_OFF_TYPE:
@@ -3015,26 +3015,6 @@ static int emctask_startup()
30153015 return -1 ;
30163016 }
30173017
3018- end = RETRY_TIME;
3019- good = 0 ;
3020- do {
3021- if (0 == emcIoUpdate (&emcStatus->io )) {
3022- good = 1 ;
3023- break ;
3024- }
3025- esleep (RETRY_INTERVAL);
3026- end -= RETRY_INTERVAL;
3027- if (done) {
3028- emctask_shutdown ();
3029- exit (1 );
3030- }
3031- } while (end > 0.0 );
3032- if (!good) {
3033- rcs_print_error (" can't read IO status\n " );
3034- return -1 ;
3035- }
3036-
3037-
30383018 // now motion
30393019
30403020 end = RETRY_TIME;
@@ -3337,16 +3317,14 @@ int main(int argc, char *argv[])
33373317 // moved up from emc_startup so we can expose it in Python right away
33383318 emcStatus = new EMC_STAT;
33393319
3340- #ifdef TOOL_NML // {
3341- tool_nml_register ( (CANON_TOOL_TABLE*)&emcStatus->io .tool .toolTable );
3342- #else // }{
3343- tool_mmap_user ();
3344- // initialize database tool finder:
3345- #endif // }
33463320 // get the Python plugin going
33473321
33483322 // inistantiate task methods object, too
3349- emcTaskOnce (emc_inifile);
3323+ if (emcTaskOnce (emc_inifile, emcStatus->io )) {
3324+ rcs_print_error (" can't initialize task object / HAL\n " );
3325+ emctask_shutdown ();
3326+ exit (1 );
3327+ }
33503328 rtapi_strxcpy (emcStatus->task .ini_filename , emc_inifile);
33513329 if (task_methods == NULL ) {
33523330 set_rcs_print_destination (RCS_PRINT_TO_STDOUT); // restore diag
@@ -3408,7 +3386,6 @@ int main(int argc, char *argv[])
34083386 }
34093387 // update subordinate status
34103388
3411- emcIoUpdate (&emcStatus->io );
34123389 emcMotionUpdate (&emcStatus->motion );
34133390 // synchronize subordinate states
34143391 if (emcStatus->io .aux .estop ) {
@@ -3596,6 +3573,7 @@ int main(int argc, char *argv[])
35963573 } else {
35973574 timer->wait ();
35983575 }
3576+ task_methods->run ();
35993577 }
36003578 // end of while (! done)
36013579
0 commit comments