Missing API function xTimerGetReloadMode()

Hi there,

there is no getter for the setter vTimerSetReloadMode().

Looking at the source code, it should be easily possible the read the reload mode out of the ucStatus.

UBaseType_t xTimerGetReloadMode( TimerHandle_t xTimer)
{
    Timer_t * pxTimer =  xTimer;

	configASSERT( xTimer );
	taskENTER_CRITICAL();
	{
    	return pxTimer->ucStatus &= tmrSTATUS_IS_AUTORELOAD;
    }
	taskEXIT_CRITICAL();
}

Could we add this?

I have added but won’t check in until I have tested.

Thank you very much!

Since I cannot update my first post: The code there is wrong, it should be more:

UBaseType_t xTimerGetReloadMode( TimerHandle_t xTimer)
{
    
    Timer_t * pxTimer =  xTimer;
    UBaseType_t xReturn;

    configASSERT( xTimer );
    taskENTER_CRITICAL();
    {
        xReturn = pxTimer->ucStatus &= tmrSTATUS_IS_AUTORELOAD;
    }
    taskEXIT_CRITICAL();

    return xReturn;
}

See here: https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Source/timers.c#l462

1 Like