diff options
Diffstat (limited to 'nuttx/arch/8051/src/up_reprioritizertr.c')
-rw-r--r-- | nuttx/arch/8051/src/up_reprioritizertr.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/nuttx/arch/8051/src/up_reprioritizertr.c b/nuttx/arch/8051/src/up_reprioritizertr.c index 6d4a72487..0d1941f66 100644 --- a/nuttx/arch/8051/src/up_reprioritizertr.c +++ b/nuttx/arch/8051/src/up_reprioritizertr.c @@ -1,7 +1,7 @@ /**************************************************************************** * up_reprioritizertr.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -90,9 +90,14 @@ void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority) /* Verify that the caller is sane */ if (tcb->task_state < FIRST_READY_TO_RUN_STATE || - tcb->task_state > LAST_READY_TO_RUN_STATE || - priority < SCHED_PRIORITY_MIN || - priority > SCHED_PRIORITY_MAX) + tcb->task_state > LAST_READY_TO_RUN_STATE +#if SCHED_PRIORITY_MIN > 0 + || priority < SCHED_PRIORITY_MIN +#endif +#if SCHED_PRIORITY_MAX < UINT8_MAX + || priority > SCHED_PRIORITY_MAX +#endif + ) { PANIC(OSERR_BADREPRIORITIZESTATE); } |