CHIP_SCT_EVENT wrong definition

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CHIP_SCT_EVENT wrong definition

429 Views
javiervallori
Contributor III

Hi,

I think there is a small bug in the lpcOpen library for the LPC 43xx chips. The following definition:

typedef enum CHIP_SCT_EVENT {
    SCT_EVT_0  = (1 << 0),    /*!< Event 0 */
    SCT_EVT_1  = (1 << 1),    /*!< Event 1 */
    SCT_EVT_2  = (1 << 2),    /*!< Event 2 */
    SCT_EVT_3  = (1 << 3),    /*!< Event 3 */
    SCT_EVT_4  = (1 << 4)    /*!< Event 4 */
} CHIP_SCT_EVENT_T;

does not match with the specification of the models LPC 43xx, as long as these models have 16 Events (Ev0.. Ev15).

As consequence, if I use a method like:

void Chip_SCT_DisableEventInt(LPC_SCT_T *pSCT, CHIP_SCT_EVENT_T evt) 

I get the following warning and a not correct behavior if the event is greater than 4:

warning: large integer implicitly truncated to unsigned type [-Woverflow]

Regards.

0 Kudos
1 Reply

300 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Javier Vallori

Thanks for your reporting, I'll contact with AE team about the enum value.

Thanks again.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos