AnsweredAssumed Answered

CHIP_SCT_EVENT wrong definition

Question asked by Javier Vallori on Feb 3, 2017
Latest reply on Feb 3, 2017 by jeremyzhou

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.

Outcomes