cc2530: Added a method to maximise stack depth

This was oringinally contributed/reported/discussed/patched by
Philippe Retornaz (EPFL) but it's implemented
in a more configurable fashion here.
This commit is contained in:
George Oikonomou 2012-09-05 16:00:23 +01:00
parent a0d2988846
commit c6ec22c4c8
8 changed files with 61 additions and 5 deletions

View file

@ -55,8 +55,8 @@ volatile uint8_t sleep_flag;
/* Do NOT remove the absolute address and do NOT remove the initialiser here */
__xdata __at(0x0000) static unsigned long timer_value = 0;
static volatile __data clock_time_t count = 0; /* Uptime in ticks */
static volatile __data clock_time_t seconds = 0; /* Uptime in secs */
static volatile CC_AT_DATA clock_time_t count = 0; /* Uptime in ticks */
static volatile CC_AT_DATA clock_time_t seconds = 0; /* Uptime in secs */
/*---------------------------------------------------------------------------*/
/**
* Each iteration is ~1.0xy usec, so this function delays for roughly len usec
@ -132,6 +132,11 @@ clock_init(void)
STIE = 1; /* IEN0.STIE interrupt enable */
}
/*---------------------------------------------------------------------------*/
/* avoid referencing bits, we don't call code which use them */
#pragma save
#if CC_CONF_OPTIMIZE_STACK_SIZE
#pragma exclude bits
#endif
void
clock_isr(void) __interrupt(ST_VECTOR)
{
@ -177,4 +182,5 @@ clock_isr(void) __interrupt(ST_VECTOR)
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
ENABLE_INTERRUPTS();
}
#pragma restore
/*---------------------------------------------------------------------------*/