/****************************************************************************** * Function Name: R_OSTM_Close * Description : * Arguments : uint32_t channel * Return Value : DEVDRV_SUCCESS * : DEVDRV_ERROR ******************************************************************************/ int32_t R_OSTM_Close(uint32_t channel, uint32_t * count) { if (channel >= OSTM_CH_TOTAL) { return DEVDRV_ERROR; } switch (channel) { case DEVDRV_CH_0: OSTM_Close(&OSTM0, count); break; case DEVDRV_CH_1: OSTM_Close(&OSTM1, count); break; default: break; } return DEVDRV_SUCCESS; }
/****************************************************************************** * Function Name: R_OSTM_Close * Description : Stops the OSTM timer counter specified by the argument channel. * : Returns the count value at the time the timer counter stopped * : to the argument count. * Arguments : uint32_t channel : OSTM channel (0 or 1) * : uint32_t * count : Count value * Return Value : DEVDRV_SUCCESS : Success to stop counting OSTM * : DEVDRV_ERROR : Failure to stop counting OSTM ******************************************************************************/ int32_t R_OSTM_Close(uint32_t channel, uint32_t * count) { /* ==== Argument check ==== */ if (channel >= OSTM_CH_TOTAL) { return DEVDRV_ERROR; /* Argument error */ } /* ==== Stop counting OSTM ==== */ switch (channel) { case DEVDRV_CH_0: OSTM_Close(&OSTM0, count); break; case DEVDRV_CH_1: OSTM_Close(&OSTM1, count); break; default: /* Do not reach here based on the assumption */ break; } return DEVDRV_SUCCESS; }