Other Parts Discussed in Thread: C2000WARE
Hello,
I think there's two bugs in the following file:
C:\ti\c2000\C2000Ware_DigitalPower_SDK_4_01_00_00\solutions\tidm_02002\f28004x\drivers\source\clllc_hal.c
Bug 1) Lines 1687,1688:
HWREGH(CLLLC_SEC_LEG2_PWM_BASE + EPWM_O_DBCTL) = (HWREGH(CLLLC_SEC_LEG1_PWM_BASE + EPWM_O_DBCTL) | 0x3000);
The EPWM base is different between the two lines, i.e. LEG2 vs LEG1. Shouldn't they be the same?
Bug 2) Line 1879:
ECAP_clearInterrupt(base1, 0xFF);
The line does not pass the ASSERT check when DEBUG is defined because an attempt is made to clear the global interrupt flag, Bit 0, which is not in the scope of the function. I think it should be 0xFE at the very least:
ECAP_clearInterrupt(base1, 0xFE);
For optimal readability it should be:
ECAP_clearInterrupt(base1, ECAP_ISR_SOURCE_CAPTURE_EVENT_1 | ECAP_ISR_SOURCE_CAPTURE_EVENT_2 | ECAP_ISR_SOURCE_CAPTURE_EVENT_3 | ECAP_ISR_SOURCE_CAPTURE_EVENT_4 | ECAP_ISR_SOURCE_COUNTER_OVERFLOW | ECAP_ISR_SOURCE_COUNTER_PERIOD | ECAP_ISR_SOURCE_COUNTER_COMPARE);
Thank you.