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.

MCU-PLUS-SDK-AM243X: SDK Feature Request: Make some functions weak to enable overwrites of IRQ Handlers etc

Part Number: MCU-PLUS-SDK-AM243X

For example: TimerP_isr0 could be made weak to enable us to overwrite this function and thus avoid setup callback for each Timer module.

This would enable more or better abstraction. We would not need to setup a extra callback in syscfg, just overwrite the generated.

As discussed in meeting...

  • Hi Andreas,

    When I created two timers (timer0 and timer1) the following code has been generated for ti_dpl_config.c:

    /* ----------- TimerP ----------- */
    #define CONFIG_TIMER0_CLOCK_SRC_MUX_ADDR (0x430081B4u)
    #define CONFIG_TIMER0_CLOCK_SRC_MCU_HFOSC0 (0x0u)

    #define CONFIG_TIMER1_CLOCK_SRC_MUX_ADDR (0x430081B0u)
    #define CONFIG_TIMER1_CLOCK_SRC_MCU_HFOSC0 (0x0u)


    HwiP_Object gTimerHwiObj[TIMER_NUM_INSTANCES];
    uint32_t gTimerBaseAddr[TIMER_NUM_INSTANCES];

    void TimerP_isr0(void *args)
    {
    void timer0Isr(void *args);

    timer0Isr(args);
    TimerP_clearOverflowInt(gTimerBaseAddr[CONFIG_TIMER0]);
    HwiP_clearInt(CONFIG_TIMER0_INT_NUM);
    }

    void TimerP_isr1(void *args)
    {
    void timer1Isr(void *args);

    timer1Isr(args);
    TimerP_clearOverflowInt(gTimerBaseAddr[CONFIG_TIMER1]);
    HwiP_clearInt(CONFIG_TIMER1_INT_NUM);
    }

    As you may see, we can make the TimerP_isrN (N=0, 1) weak, so that you can overwrite it in your code, but your customized  TimerP_isrN has to handle the following too: 

    TimerP_clearOverflowInt(gTimerBaseAddr[CONFIG_TIMERN]);
    HwiP_clearInt(CONFIG_TIMERN_INT_NUM);

    Where N=0, 1

    Those are the details we wanted to hide from the customers.

    Anyway, this is my two cents.

    Best regards,

    Ming