Exemplo n.º 1
0
/**
 * Initializes all requisite sub-modules to properly operate digital outputs. This includes any multiplexing and
 * default inputs.
 *
 * @param none
 * @retval none
 */
void DigitalOutputsInit(void) {
    for (uint_fast8_t i = 0; i < NUM_DIGITAL_OUTPUTS; ++i) {
        InitializeOutput(&Ext_DOutputs[i]);
    }

    uint8_t data[NUMBER_TLE7232_CHIPS] = {0xFF, 0xFF};
    TLE7232_WriteRegisterAll(TLE7232_REG_CTL, data);
}
Exemplo n.º 2
0
void
ProducerNode::NodeRegistered()
{
	out("ProducerNode::NodeRegistered\n");
	InitializeOutput();
	SetPriority(108); 
	Run(); 
}
void
avtTimeIteratorExpression::Execute(void)
{
    FinalizeTimeLoop();
    avtContract_p contract = ConstructContractWithVarnames();
    contract->DisableExtentsCalculations();

    // Store off the original expression list.
    ParsingExprList *pel = ParsingExprList::Instance();
    ExpressionList orig_list = *(pel->GetList());

    InitializeOutput();

    std::string db = GetInput()->GetInfo().GetAttributes().GetFullDBName();
    ref_ptr<avtDatabase> dbp = avtCallback::GetDatabase(db, 0, NULL);
    if (*dbp == NULL)
        EXCEPTION1(InvalidFilesException, db.c_str());

    // The first EEF already set up its expressions ... we need a new one
    // to set up filters for the CMFE expressions.
    avtExpressionEvaluatorFilter myeef;
    myeef.SetInput(GetInput());
    for (int i = 0 ; i < numTimeSlicesToProcess ; i++)
    {
        int timeSlice = firstTimeSlice + i*timeStride;
        if (timeSlice > actualLastTimeSlice)
            timeSlice = actualLastTimeSlice;
        debug1 << "Time iterating expression working on time slice " 
               << timeSlice << endl;
        UpdateExpressions(timeSlice);
        // won't re-execute without setting modified to true, because
        // it doesn't check to see if expression definitions change.
        myeef.ReleaseData();
        myeef.GetOutput()->Update(contract);
        avtCallback::ResetTimeout(5*60);
        Barrier();
        avtCallback::ResetTimeout(5*60);

        avtDatabaseMetaData *md = dbp->GetMetaData(timeSlice, false,
                                                   false, false);
        currentCycle = md->GetCycles()[timeSlice];
        currentTime  = md->GetTimes()[timeSlice];

        ProcessDataTree(myeef.GetTypedOutput()->GetDataTree(), i);
        debug1 << "Time iterating expression done working on time slice " 
               << timeSlice << endl;
    }

    // Get the upstream filters back the way they are supposed to be.
    GetInput()->Update(executionContract);

    FinalizeOutput();

    // Restore the original expression list ... i.e. undo the temporary
    // expressions we put in.
    *(pel->GetList()) = orig_list;
}
Exemplo n.º 4
0
/**
 * Removes a digital output by specifying its absolute index. If the index is out of range,
 * and error message will be logged depending on the debug level compiled with.
 *
 * @param id uint8_t The absolute index of the output.
 * @retval none
 */
static void RemoveDigitalOutputByID(uint8_t id) {
    if (isExternalOutput(id)) {
        InitializeOutput(&Ext_DOutputs[id]);
    } else {
        /* This is out of range */
#ifdef DIGITALOUTPUT_DEBUG
        printf("[Digital Output] Cannot find the requested digital output. Input does not exist on the board.\n\r");
#endif
    }
}
Exemplo n.º 5
0
void
ProducerNode::Disconnect(
				const media_source & what,
				const media_destination & where)
{
	out("ProducerNode::Disconnect\n");
	mOutputEnabled = false;

	// unreserve connection
	InitializeOutput();
}
Exemplo n.º 6
0
void
ProducerNode::Connect(
				status_t error, 
				const media_source & source,
				const media_destination & destination,
				const media_format & format,
				char * io_name)
{
	out("ProducerNode::Connect\n");

	if (error != B_OK) {
		InitializeOutput();
		return;
	}
/*
	if (mOutput.destination != destination) { //if connected in PrepareToConnect fixme?
		trace("error mOutput.destination != destination\n");
		return;
	}
*/	
	mOutput.destination = destination;

	if (mOutput.source != source) {
		out("error mOutput.source != source\n");
		return;
	}	
		
	strcpy(io_name,mOutput.name);

#if 0
	trace("format (final and approved):\n");
	dump_format(&format);
#endif

	mOutputEnabled = true;

	return;
}