This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

some problem of the code in the "c6474_CSL_Rel_03_03_01"



folder c6474_CSL_Rel_03_03_01->csl_c64xplus_intc_src->src->intc->csl_intcHwControl.c

#pragma CODE_SECTION (CSL_intcHwControl, ".text:csl_section:intc");
CSL_Status  CSL_intcHwControl(
    CSL_IntcHandle            hIntc,
    CSL_IntcHwControlCmd      controlCommand,
    void*                     commandArg
)

{
    CSL_Status status = CSL_SOK;
   
    if (hIntc == NULL)
        status = CSL_ESYS_BADHANDLE;
       
    switch(controlCommand) {
        case CSL_INTC_CMD_EVTENABLE:
            if (hIntc->vectId < CSL_INTC_VECTID_EXCEP) {
                if (hIntc->vectId < CSL_INTC_VECTID_COMBINE) {
                    if (hIntc->eventId < 4) {
                        if (commandArg)
                            CSL_intcCombinedEventEnable(hIntc->eventId,\
                                                  *(CSL_BitMask32*)commandArg);
                    }
                    CSL_intcInterruptEnable(hIntc->vectId);             
                    CSL_intcEventDisable(hIntc->eventId);            //why it is dsiable but not EventEnable? is it wrong  in the src code?     
                }      
                else
                    CSL_intcEventEnable(hIntc->eventId);                   
            }
            else         
                CSL_intcExcepEnable(hIntc->eventId);
            break;
       
        case CSL_INTC_CMD_EVTDISABLE:
            if (hIntc->vectId < CSL_INTC_VECTID_EXCEP) {
                if (hIntc->vectId < CSL_INTC_VECTID_COMBINE) {
                    if (hIntc->eventId < 4) {
                        if (commandArg)
                            CSL_intcCombinedEventDisable(hIntc->eventId, \
                                                  *(CSL_BitMask32*)commandArg);
                    }
                    CSL_intcInterruptDisable(hIntc->vectId);               
                }      
                else
                    CSL_intcEventDisable(hIntc->eventId);
            }
            else         
                CSL_intcExcepDisable(hIntc->eventId);
            break;
           
        case CSL_INTC_CMD_EVTSET:
            CSL_intcEventSet(hIntc->eventId);              
            break;
               
        case CSL_INTC_CMD_EVTCLEAR: 
            if (hIntc->vectId < CSL_INTC_VECTID_EXCEP) {
                if (hIntc->eventId < 4) {
                    if (commandArg)
                        CSL_intcCombinedEventClear(hIntc->eventId, \
                                                  *(CSL_BitMask32*)commandArg);
                }
                else                   
                    CSL_intcEventClear(hIntc->eventId);
            }
            else         
                CSL_intcExcepClear(hIntc->eventId);

            break;
       
        case CSL_INTC_CMD_EVTDROPENABLE: 
            if (hIntc->vectId < CSL_INTC_VECTID_COMBINE)
                CSL_intcInterruptDropEnable(1 << hIntc->vectId);
            else
                status = CSL_ESYS_INVCMD;
            break;
       
        case CSL_INTC_CMD_EVTDROPDISABLE:  
            if (hIntc->vectId < CSL_INTC_VECTID_COMBINE)
                CSL_intcInterruptDropDisable(1 << hIntc->vectId);
            else
                status = CSL_ESYS_INVCMD;  
            break;
        case CSL_INTC_CMD_EVTINVOKEFUNCTION:   
            CSL_intcInvokeEventHandle (hIntc->eventId);
            break;
        default:
            status = CSL_ESYS_INVCMD;
            break;

    }
    return status;
}