src_legacy/2018/src/program/programTask.cpp
// the task that actually runs the program thru the handler
// arg: program line to start program from
the task that actually runs the program thru the handler
arg: program line to start program from
the task that actually runs the program thru the handler arg : program line to start program from
void programExecTask(void* arg){
  programActive = true;
  if (arg == NULL){
    handler.init();
  }
  else {
    uint8_t *progLine = (uint8_t*) arg;
    handler.init(*progLine);
  }
  while(programActive && handler.next()){
		PoiCommand cmd = handler.getCurrentCommand();
    sendToQueue(PLAYER_QUEUE, cmd, PROG_T);
  }
  if (programActive) {
    LOGI(PROG_T, "End of program.");
  } 
  else {
    LOGI(PROG_T, "Program stopped.");
  }
  vTaskDelete(NULL);
  programActive = false;
}
void programExecTask ( void * arg ) { programActive = true ; if ( arg == NULL ) { handler . init ( ) ; } else { uint8_t * progLine = ( uint8_t * ) arg ; handler . init ( * progLine ) ; } while ( programActive && handler . next ( ) ) { PoiCommand cmd = handler . getCurrentCommand ( ) ; sendToQueue ( PLAYER_QUEUE , cmd , PROG_T ) ; } if ( programActive ) { LOGI ( PROG_T , " " ) ; } else { LOGI ( PROG_T , " " ) ; } vTaskDelete ( NULL ) ; programActive = false ; }
the task that actually runs the program thru the handler
arg: program line to start program from
the task that actually runs the program thru the handler arg : program line to start program from
// first next() does not advance prg // stop program when programActive is set to false