Exemple #1
0
/*******************************************************************************
* Procedure:    RFU_SetBootloadActive
* Purpose:      xxxx
* Passed:       xxxx
*   
* Returned:     nothing
* Globals:      none
*
* Date:         Author:             Comments:
*   2014-03-13  Neal Shurmantine    initial revision
*******************************************************************************/
void RFU_SetBootloadActive(bool isBootloadActive)
{
    int numbytes;
    char ser_rx_buff[1];

//    OS_SchedLock();<<
    OS_EventClear(ActiveEventHandle,ActiveEventBit);
    QFlush(&RxQueue);
    if (isBootloadActive == true) {
        URX_WaitTime = BOOTLOAD_RECEIVE_WAIT_TIME;
        ActiveEventHandle = BootloadEventHandle;
        ActiveEventBit = BootloadEventBit;
    }
    else {
        URX_WaitTime = NORMAL_RECEIVE_WAIT_TIME;
        ActiveEventHandle = InboundEventHandle;
        ActiveEventBit = InboundEventBit;
    }

    do {
        numbytes = read(nordic_fp, ser_rx_buff, 1);
    } while (numbytes != 0);
//    OS_SchedUnlock();<<

}
Exemple #2
0
/*! This virtual function is called before the destructor.
    We do this because here we can still call virtual methods.
*/
void flext_base::Exit()
{
#if FLEXT_SYS == FLEXT_SYS_MAX
    // according to David Z. one should do that first...
	if(NeedDSP()) dsp_free(thisHdr());
#endif

#if FLEXT_SYS == FLEXT_SYS_PD && !defined(FLEXT_NOATTREDIT)
    // attribute editor window may still be open -> close it
    gfxstub_deleteforkey(thisHdr());
#endif

#ifdef FLEXT_THREADS
    StopThreads();
#endif

    // send remaining pending messages for this object
    QFlush(this);

    // delete message lists
    if(bindhead) delete bindhead;  // ATTENTION: the object must free all memory associated to bindings itself
    if(methhead) delete methhead;
    if(attrhead) delete attrhead;
    if(attrdata) delete attrdata;
    
#if FLEXT_SYS == FLEXT_SYS_PD || FLEXT_SYS == FLEXT_SYS_MAX
    if(outlets) delete[] outlets;

    if(inlets) {
        FLEXT_ASSERT(incnt > 1);
        for(int ix = 1; ix < incnt; ++ix)
            if(inlets[ix-1]) {
                // release proxy object
#if FLEXT_SYS == FLEXT_SYS_PD
                pd_free(&inlets[ix-1]->obj.ob_pd);
#elif FLEXT_SYS == FLEXT_SYS_MAX
                freeobject((object *)inlets[ix-1]);
#endif
            }
        delete[] inlets;
    }
#endif

#if FLEXT_SYS == FLEXT_SYS_MAX
    if(indesc) {
        for(int i = 0; i < incnt; ++i) if(indesc[i]) delete[] indesc[i];
        delete[] indesc;
    }
    if(outdesc) {
        for(int i = 0; i < outcnt; ++i) if(outdesc[i]) delete[] outdesc[i];
        delete[] outdesc;
    }
#endif

    flext_obj::Exit();
}