| 276 | #if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) |
| 277 | |
| 278 | TimerHandle_t xTimerCreate( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ |
| 279 | const TickType_t xTimerPeriodInTicks, |
| 280 | const UBaseType_t uxAutoReload, |
| 281 | void * const pvTimerID, |
| 282 | TimerCallbackFunction_t pxCallbackFunction ) |
| 283 | { |
| 284 | Timer_t * pxNewTimer; |
| 285 | |
| 286 | pxNewTimer = ( Timer_t * ) pvPortMalloc( sizeof( Timer_t ) ); /*lint !e9087 !e9079 All values returned by pvPortMalloc() have at least the alignment required by the MCU's stack, and the first member of Timer_t is always a pointer to the timer's mame. */ |
| 287 | |
| 288 | if( pxNewTimer != NULL ) |
| 289 | { |
| 290 | /* Status is thus far zero as the timer is not created statically |
| 291 | * and has not been started. The auto-reload bit may get set in |
| 292 | * prvInitialiseNewTimer. */ |
| 293 | pxNewTimer->ucStatus = 0x00; |
| 294 | prvInitialiseNewTimer( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxNewTimer ); |
| 295 | } |
| 296 | |
| 297 | return pxNewTimer; |
| 298 | } |
| 299 | |
| 300 | #endif /* configSUPPORT_DYNAMIC_ALLOCATION */ |
| 301 | /*-----------------------------------------------------------*/ |
no test coverage detected