void loop(void *arg){ char buf[CHAR_BUFFER_SIZE]; int count = 0; sprintf(buf,"%s%s",getenv("HOME"),"/.xenomailab/workspace/debug.log"); if((log=fopen(buf, "w")) == NULL) ERROR("Failed open %s to write!\n",buf); while (running) { read_inputs(); if(count < MAX_TICKS){ LOG("\n********* TICK #%d\n",(int)io.input_result[0].matrix[0][0]); periodic_function(io.input_result,io.input_num); settings_unlock(&gs_mtx); count++; } else { settings_unlock(&gs_mtx); break; } } fclose(log); }
void loop(void *arg){ Matrix outputMatrix; blackbox_init(); while (running) { read_inputs(); outputMatrix=periodic_function(io.input_result,io.input_num); write_outputs(outputMatrix); } blackbox_close(); }
void loop(void *arg) { RT_HEAP sampling_heap; current_period=bind_shm(&sampling_heap,"tickPeriod",sizeof(long)); Matrix outputMatrix=empty_matrix(1,1); DEBUG("Outputing a %s wave of amplitude %4.2f, freq %4.2f, duty %4.2f, dc %4.2f\n",gs->wave,gs->wave_amp,gs->wave_freq,gs->wave_duty,gs->wave_dc); while (running) { read_inputs(); outputMatrix=periodic_function(io.input_result,io.input_num); write_outputs(outputMatrix); } unbind_shm(&sampling_heap); }
void loop(void *arg){ Matrix outputMatrix; /* * Insert initialization code here. * e.g. open a file. */ while (running) { read_inputs(); outputMatrix=periodic_function(io.input_result,io.input_num); write_outputs(outputMatrix); } /* * Insert finalization code here * e.g. close a file. */ }
void st_scheduler::task() { periodic_function(); }