Skip to content

Commit

Permalink
xtensa port: use portSUPPRESS_TICKS_AND_SLEEP_ABS
Browse files Browse the repository at this point in the history
Define new portSUPPRESS_TICKS_AND_SLEEP_ABS macro for xtensa port and
update vPortSuppressTicksAndSleep implementation.

Signed-off-by: Max Filippov <[email protected]>
  • Loading branch information
jcmvbkbc committed Feb 24, 2020
1 parent 7b53cec commit 5742688
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion portable/XCC/Xtensa/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack,
// Tickless idle support. Suppress N ticks and sleep when directed by kernel.
//-----------------------------------------------------------------------------
#if ( configUSE_TICKLESS_IDLE != 0 )
void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
void vPortSuppressTicksAndSleep( TickType_t target, TickType_t xExpectedIdleTime )
{
eSleepModeStatus eSleepStatus;
uint32_t ps;
Expand All @@ -329,6 +329,7 @@ void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime )
uint32_t skip_tick;
uint32_t now;

xExpectedIdleTime = target - xTaskGetTickCountFromISR ();
// Compute number of cycles to sleep for, capped by max limit.
// we use one less than the number of ticks because we are already
// partway through the current tick. This is adjusted later below.
Expand Down
8 changes: 5 additions & 3 deletions portable/XCC/Xtensa/portmacro.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,11 @@ void _frxt_setup_switch( void );

/* Tickless idle */
#if ( configUSE_TICKLESS_IDLE != 0 )
#ifndef portSUPPRESS_TICKS_AND_SLEEP
extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
#ifndef portSUPPRESS_TICKS_AND_SLEEP_ABS
extern void vPortSuppressTicksAndSleep( TickType_t target,
TickType_t xExpectedIdleTime );
#define portSUPPRESS_TICKS_AND_SLEEP_ABS( target, xExpectedIdleTime ) \
vPortSuppressTicksAndSleep( target, xExpectedIdleTime )
#endif
#endif

Expand Down

0 comments on commit 5742688

Please sign in to comment.