[PATCH 05/45] score: Add header to _Watchdog_Remove()

Sebastian Huber sebastian.huber at embedded-brains.de
Sat May 16 09:19:01 UTC 2015



----- Am 15. Mai 2015 um 20:07 schrieb Gedare Bloom gedare at rtems.org:

> On Fri, May 15, 2015 at 7:41 AM, Sebastian Huber
> <sebastian.huber at embedded-brains.de> wrote:
[...]
>> diff --git a/cpukit/rtems/src/timercreate.c b/cpukit/rtems/src/timercreate.c
>> index 0b1c44b..390c965 100644
>> --- a/cpukit/rtems/src/timercreate.c
>> +++ b/cpukit/rtems/src/timercreate.c
>> @@ -25,6 +25,27 @@
>>  #include <rtems/rtems/timerimpl.h>
>>  #include <rtems/score/watchdogimpl.h>
>>
>> +void _Timer_Cancel( Timer_Control *the_timer )
>> +{
>> +  Timer_server_Control *timer_server;
>> +
>> +  switch ( the_timer->the_class ) {
>> +    case TIMER_INTERVAL:
>> +      _Watchdog_Remove_ticks( &the_timer->Ticker );
>> +      break;
>> +    case TIMER_TIME_OF_DAY:
>> +      _Watchdog_Remove_seconds( &the_timer->Ticker );
>> +      break;
>> +    case TIMER_INTERVAL_ON_TASK:
>> +    case TIMER_TIME_OF_DAY_ON_TASK:
>> +      timer_server = _Timer_server;
>> +      (*timer_server->cancel)( timer_server, the_timer );
>> +      break;
>> +    default:
> Should this be an error case?

No, but I add an _Assert( the_timer->the_class == TIMER_DORMANT ).

> 
>> +      break;
>> +  }
>> +}
>> +
>>  rtems_status_code rtems_timer_create(
>>    rtems_name  name,
>>    rtems_id   *id
[...]



More information about the devel mailing list