/************************************************************************************* * slavePrimFuncts.c * * synopsis: Contains the primitive functions which are used only by the slave DSPs. * * in this file: startEventTrapping, stopEventTrapping. * * related files: * eventHandler.c: Routines which handle event transfer from the router into the * burst buffer, and the subsequent managing of those events. * listManager.c: Routines which manage the execution of a primitive list and writing * the reply data. * primFuncts.h: Declares the structure tag which communicates necessary information * to primitive functions. * primParams.h: Defines primitive ids which are used to index the array of pointers * to primitive functions, structure tags for primitive data and reply * data, and prototypes of primtive functions. * primFuncts.c: Contains primitive execution functions and the function which ini- * tializes the array of pointers to the primitive execution functions. * * Damon Fasching, The University of Wisconsin, Madison fasching@wisconsin.cern.ch * Douglas Ferguson, UW Madison (510) 486-5230 dpferguson@lbl.gov * Roy McKay, Iowa State University mckay@iastate.edu * Tom Meyer, Iowa State University meyer@iastate.edu * * modifications/bugs * - Made setLed & flashLed into common primitives, since both types of DSP * have an available LED & there are only minor code differences. 14.05.02 dpsf * - Histogram setup has moved to the detector-specific files. 01.03.04 dpsf ************************************************************************************/ #include #include #include #include #include "resources.h" #include "primParams.h" #include "histogram.h" extern char genStr[]; #pragma CODE_SECTION(startEventTrapping, "xcode"); #pragma CODE_SECTION(stopEventTrapping, "xcode"); /************************************************************************************ * startEventTrapping * * synopsis: Calls initiateTrapping which performs some setup for data taking and * triggers the router to start sending data. * * author: Damon Fasching ************************************************************************************/ INT32 startEventTrapping(PrimData *primData) { INT32 returnCode = SUCCESS, error; error = initiateTrapping(); if (error != SUCCESS) { addError(&returnCode, error, "startEventTrapping", "initiateTrapping", __FILE__, __LINE__); } return returnCode; } /************************************************************************************ * stopEventTrapping * * synopsis: Halts data taking. Normally, data taking will stop automatically after * the number of events requested by the setEventTrapParams() primitive * have been collected. This primitive allows data taking to be aborted, * e.g. if something has gone wrong or if continuous data taking was * requested. * * author: Damon Fasching ************************************************************************************/ INT32 stopEventTrapping(PrimData *primData) { stopTrapping(); return SUCCESS; }