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.

TMS320F280049: ERAD_getOwnership()

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE

Hi, 

I am using empty_driverlib_project and I have changed "Language options in compiler's settings to support C++ and to thread C files as C++ as well.
However I got following error in the  driverlib function ERAD_getOwnership().

Description Resource Path Location Type
#121 return value type does not match the function type .ccsproject /empty_driverlib_project line 380, external location: C:\ti\c2000\C2000Ware_4_00_00_00\driverlib\f28004x\driverlib\erad.h C/C++ Problem

return((ERAD_Owner)(HWREGH(ERAD_GLOBAL_BASE + ERAD_O_GLBL_OWNER) &
ERAD_GLBL_OWNER_OWNER_M) >> ERAD_GLBL_OWNER_OWNER_S);

Seems that C++ compiler is more strict regarding type casting.

It could be easily  fixed by putting brackets in correct place. - please confirm

I am also facing of one more error which I don't understand.  See attached picture. According to error description it requires additional curly bracket. Why? 





Jozef

  • Hi Jozef,

    Thank you reporting the issue. You are correct the ERAD error can be resolved by updating the lines to - 

    return((ERAD_Owner)((HWREGH(ERAD_GLOBAL_BASE + ERAD_O_GLBL_OWNER) &
    ERAD_GLBL_OWNER_OWNER_M) >> ERAD_GLBL_OWNER_OWNER_S));

    And the other issue is because of a missing } in the pmbus_common..h header file, which gets included as part of driverlib.h.

    Please add the following line at the end of the file, just before the last #endif.

    #ifdef __cplusplus
    }
    #endif

    This should resolve the issue. I will raise a ticket to get this fixed in the upcoming release.

    Regards,

    Veena