Sensinode/cc2430 stack depth optimisation

This replicates the method used by the cc2530 port
This commit is contained in:
George Oikonomou 2012-09-07 14:48:15 +01:00
parent 067fabe0f9
commit 95b9d4ee29
11 changed files with 72 additions and 6 deletions

View file

@ -105,7 +105,7 @@ uint8_t rf_error = 0;
PROCESS(cc2430_rf_process, "CC2430 RF driver");
#endif
/*---------------------------------------------------------------------------*/
static uint8_t __data rf_flags;
static uint8_t CC_AT_DATA rf_flags;
static uint8_t rf_channel;
static int on(void); /* prepare() needs our prototype */

View file

@ -56,6 +56,10 @@ PROCESS_NAME(cc2430_rf_process);
* RF interrupt service routine.
*
*/
#pragma save
#if CC_CONF_OPTIMIZE_STACK_SIZE
#pragma exclude bits
#endif
void
cc2430_rf_ISR( void ) __interrupt (RF_VECTOR)
{
@ -75,6 +79,7 @@ cc2430_rf_ISR( void ) __interrupt (RF_VECTOR)
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
EA = 1;
}
#pragma restore
#endif
/*---------------------------------------------------------------------------*/
#if CC2430_RFERR_INTERRUPT
@ -82,6 +87,10 @@ cc2430_rf_ISR( void ) __interrupt (RF_VECTOR)
* RF error interrupt service routine.
* Turned off by default, can be turned on in contiki-conf.h
*/
#pragma save
#if CC_CONF_OPTIMIZE_STACK_SIZE
#pragma exclude bits
#endif
void
cc2430_rf_error_ISR( void ) __interrupt (RFERR_VECTOR)
{
@ -98,5 +107,6 @@ cc2430_rf_error_ISR( void ) __interrupt (RFERR_VECTOR)
RF_TX_LED_OFF();
EA = 1;
}
#pragma restore
#endif
/*---------------------------------------------------------------------------*/

View file

@ -51,8 +51,8 @@ volatile uint8_t sleep_flag;
/*---------------------------------------------------------------------------*/
/* Used in sleep timer interrupt for calculating the next interrupt time */
static unsigned long timer_value;
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
@ -109,6 +109,10 @@ clock_init(void)
IEN0_STIE = 1; /* IEN0.STIE acknowledge Sleep Timer Interrupt */
}
/*---------------------------------------------------------------------------*/
#pragma save
#if CC_CONF_OPTIMIZE_STACK_SIZE
#pragma exclude bits
#endif
void
clock_ISR(void) __interrupt(ST_VECTOR)
{
@ -161,4 +165,5 @@ clock_ISR(void) __interrupt(ST_VECTOR)
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
ENABLE_INTERRUPTS();
}
#pragma restore
/*---------------------------------------------------------------------------*/

View file

@ -32,6 +32,10 @@ extern void spi_rx_dma_callback(void);
*
* if callback defined a poll is made to that process
*/
#pragma save
#if CC_CONF_OPTIMIZE_STACK_SIZE
#pragma exclude bits
#endif
void
dma_ISR(void) __interrupt (DMA_VECTOR)
{
@ -65,4 +69,5 @@ dma_ISR(void) __interrupt (DMA_VECTOR)
#endif
EA = 1;
}
#pragma restore
/*---------------------------------------------------------------------------*/

View file

@ -36,6 +36,10 @@ uart0_set_input(int (*input)(unsigned char c))
}
/*---------------------------------------------------------------------------*/
#pragma save
#if CC_CONF_OPTIMIZE_STACK_SIZE
#pragma exclude bits
#endif
void
uart0_rx_ISR(void) __interrupt (URX0_VECTOR)
{
@ -51,6 +55,7 @@ void
uart0_tx_ISR( void ) __interrupt (UTX0_VECTOR)
{
}
#pragma restore
#endif /* UART_ZERO_ENABLE */
#if UART_ONE_ENABLE
/*---------------------------------------------------------------------------*/
@ -61,6 +66,10 @@ uart1_set_input(int (*input)(unsigned char c))
}
/*---------------------------------------------------------------------------*/
#if UART_ONE_CONF_WITH_INPUT
#pragma save
#if CC_CONF_OPTIMIZE_STACK_SIZE
#pragma exclude bits
#endif
void
uart1_rx_ISR(void) __interrupt (URX1_VECTOR)
{
@ -76,6 +85,7 @@ void
uart1_tx_ISR( void ) __interrupt (UTX1_VECTOR)
{
}
#pragma restore
/*---------------------------------------------------------------------------*/
#endif /* UART_ONE_CONF_WITH_INPUT */
#endif /* UART_ONE_ENABLE */

View file

@ -47,6 +47,10 @@
/*---------------------------------------------------------------------------*/
/* The watchdog only throws interrupts in timer mode */
#if WDT_TIMER_MODE
#pragma save
#if CC_CONF_OPTIMIZE_STACK_SIZE
#pragma exclude bits
#endif
void
cc4230_watchdog_ISR(void) __interrupt (WDT_VECTOR)
{
@ -57,6 +61,7 @@ cc4230_watchdog_ISR(void) __interrupt (WDT_VECTOR)
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
EA = 1;
}
#pragma restore
#endif
/*---------------------------------------------------------------------------*/
void