energest: removed energest type ENERGEST_TYPE_IRQ

This commit is contained in:
Niclas Finne 2017-10-12 23:57:38 +02:00
parent 8b930bfa06
commit 7317316942
37 changed files with 2 additions and 209 deletions

View File

@ -68,8 +68,6 @@ __attribute__ ((__naked__))
void
svcall_handler(void)
{
/* This is a controlled system handler, so do not use ENERGEST_TYPE_IRQ. */
/*
* Decide whether to switch to the main thread or to a process thread,
* depending on the type of the thread preempted by SVCall.
@ -124,8 +122,6 @@ __attribute__ ((__naked__))
void
pendsv_handler(void)
{
/* This is a controlled system handler, so do not use ENERGEST_TYPE_IRQ. */
/*
* Return without doing anything if PendSV has not preempted a process thread.
* This can occur either because PendSV has preempted the main thread, in

View File

@ -241,11 +241,7 @@ clock_adjust(void)
void
clock_isr(void)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
update_ticks();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/

View File

@ -1060,16 +1060,12 @@ PROCESS_THREAD(cc2538_rf_process, ev, data)
void
cc2538_rf_rx_tx_isr(void)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(!poll_mode) {
process_poll(&cc2538_rf_process);
}
/* We only acknowledge FIFOP so we can safely wipe out the entire SFR */
REG(RFCORE_SFR_RFIRQF0) = 0;
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
/**
@ -1091,8 +1087,6 @@ cc2538_rf_rx_tx_isr(void)
void
cc2538_rf_err_isr(void)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
PRINTF("RF Error: 0x%08lx\n", REG(RFCORE_SFR_RFERRF));
/* If the error is not an RX FIFO overflow, set a flag */
@ -1103,8 +1097,6 @@ cc2538_rf_err_isr(void)
REG(RFCORE_SFR_RFERRF) = 0;
process_poll(&cc2538_rf_process);
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -36,7 +36,6 @@
* Implementation of the cc2538 AES/SHA cryptoprocessor driver
*/
#include "contiki.h"
#include "sys/energest.h"
#include "dev/sys-ctrl.h"
#include "dev/nvic.h"
#include "dev/crypto.h"
@ -59,8 +58,6 @@ static volatile struct process *notification_process = NULL;
void
crypto_isr(void)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
NVIC_ClearPendingIRQ(AES_IRQn);
NVIC_DisableIRQ(AES_IRQn);
@ -68,8 +65,6 @@ crypto_isr(void)
process_poll((struct process *)notification_process);
notification_process = NULL;
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
static bool

View File

@ -36,7 +36,6 @@
* Implementation of the cc2538 GPIO controller
*/
#include "contiki.h"
#include "sys/energest.h"
#include "dev/leds.h"
#include "dev/gpio.h"
#include "dev/nvic.h"
@ -90,8 +89,6 @@ gpio_port_isr(uint8_t port)
lpm_exit();
ENERGEST_ON(ENERGEST_TYPE_IRQ);
base = GPIO_PORT_TO_BASE(port);
int_status = GPIO_GET_MASKED_INT_STATUS(base);
power_up_int_status = GPIO_GET_POWER_UP_INT_STATUS(port);
@ -100,8 +97,6 @@ gpio_port_isr(uint8_t port)
GPIO_CLEAR_INTERRUPT(base, int_status);
GPIO_CLEAR_POWER_UP_INTERRUPT(port, power_up_int_status);
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
#define GPIO_PORT_ISR(lowercase_port, uppercase_port) \

View File

@ -40,7 +40,6 @@
* Implementation of the cc2538 PKA engine driver
*/
#include "contiki.h"
#include "sys/energest.h"
#include "dev/pka.h"
#include "dev/sys-ctrl.h"
#include "dev/nvic.h"
@ -62,8 +61,6 @@ static volatile struct process *notification_process = NULL;
void
pka_isr(void)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
NVIC_ClearPendingIRQ(PKA_IRQn);
NVIC_DisableIRQ(PKA_IRQn);
@ -71,8 +68,6 @@ pka_isr(void)
process_poll((struct process *)notification_process);
notification_process = NULL;
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
static bool

View File

@ -36,7 +36,6 @@
* Implementation of the cc2538 UART driver
*/
#include "contiki.h"
#include "sys/energest.h"
#include "dev/sys-ctrl.h"
#include "dev/ioc.h"
#include "dev/gpio.h"
@ -363,8 +362,6 @@ uart_isr(uint8_t uart)
uint32_t uart_base;
uint16_t mis;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
uart_base = uart_regs[uart].base;
/* Store the current MIS and clear all flags early, except the RTM flag.
@ -387,8 +384,6 @@ uart_isr(uint8_t uart)
/* ISR triggered due to some error condition */
reset(uart_base);
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
#define UART_ISR(u) void uart##u##_isr(void) { uart_isr(u); }

View File

@ -51,18 +51,6 @@
#if LPM_CONF_ENABLE != 0
/*---------------------------------------------------------------------------*/
#if ENERGEST_CONF_ON
static unsigned long irq_energest = 0;
#define ENERGEST_IRQ_SAVE(a) do { \
a = energest_type_time(ENERGEST_TYPE_IRQ); } while(0)
#define ENERGEST_IRQ_RESTORE(a) do { \
energest_type_set(ENERGEST_TYPE_IRQ, a); } while(0)
#else
#define ENERGEST_IRQ_SAVE(a) do {} while(0)
#define ENERGEST_IRQ_RESTORE(a) do {} while(0)
#endif
/*---------------------------------------------------------------------------*/
/*
* Deep Sleep thresholds in rtimer ticks (~30.5 usec)
*
@ -130,9 +118,6 @@ enter_pm0(void)
{
ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
/* We are only interested in IRQ energest while idle or in LPM */
ENERGEST_IRQ_RESTORE(irq_energest);
/* Remember the current time so we can keep stats when we wake up */
if(LPM_CONF_STATS) {
sleep_enter_time = RTIMER_NOW();
@ -143,9 +128,6 @@ enter_pm0(void)
/* We reach here when the interrupt context that woke us up has returned */
LPM_STATS_ADD(0, RTIMER_NOW() - sleep_enter_time);
/* Remember IRQ energest for next pass */
ENERGEST_IRQ_SAVE(irq_energest);
ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
}
/*---------------------------------------------------------------------------*/
@ -233,9 +215,6 @@ lpm_exit()
/* Restore PMCTL to PM0 for next pass */
REG(SYS_CTRL_PMCTL) = SYS_CTRL_PMCTL_PM0;
/* Remember IRQ energest for next pass */
ENERGEST_IRQ_SAVE(irq_energest);
ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
}
/*---------------------------------------------------------------------------*/
@ -307,8 +286,6 @@ lpm_enter()
REG(SYS_CTRL_PMCTL) = SYS_CTRL_PMCTL_PM1;
}
/* We are only interested in IRQ energest while idle or in LPM */
ENERGEST_IRQ_RESTORE(irq_energest);
ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
/* Remember the current time so we can keep stats when we wake up */
@ -333,8 +310,6 @@ lpm_enter()
REG(SYS_CTRL_PMCTL) = SYS_CTRL_PMCTL_PM0;
/* Remember IRQ energest for next pass */
ENERGEST_IRQ_SAVE(irq_energest);
ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
} else {
/* All clear. Assert WFI and drop to PM1/2. This is now un-interruptible */

View File

@ -37,7 +37,6 @@
*
*/
#include "contiki.h"
#include "sys/energest.h"
#include "sys/rtimer.h"
#include "dev/nvic.h"
#include "dev/smwdthrosc.h"
@ -143,16 +142,12 @@ rtimer_isr()
*/
lpm_exit();
ENERGEST_ON(ENERGEST_TYPE_IRQ);
next_trigger = 0;
NVIC_ClearPendingIRQ(SMT_IRQn);
NVIC_DisableIRQ(SMT_IRQn);
rtimer_run_next();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
/** @} */

View File

@ -37,7 +37,6 @@
* the cc2530 driver written by Philippe Retornaz
*/
#include "contiki.h"
#include "energest.h"
#include "usb-arch.h"
#include "usb-api.h"
#include "dev/usb-regs.h"
@ -1257,8 +1256,6 @@ usb_isr(void)
uint8_t common_if = REG(USB_CIF) & REG(USB_CIE);
uint8_t i;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(ep_in_if) {
/* EP0 flag is in the IN Interrupt Flags register */
if(ep_in_if & USB_IIF_EP0IF) {
@ -1287,8 +1284,6 @@ usb_isr(void)
if(common_if & USB_CIF_SUSPENDIF) {
notify_process(USB_EVENT_SUSPEND);
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/

View File

@ -46,7 +46,6 @@
#include "uart.h"
#include "lpm.h"
#include "ti-lib.h"
#include "sys/energest.h"
#include <stdint.h>
#include <stdbool.h>
@ -366,8 +365,6 @@ cc26xx_uart_isr(void)
char the_char;
uint32_t flags;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
power_and_clock();
/* Read out the masked interrupt status */
@ -389,8 +386,6 @@ cc26xx_uart_isr(void)
}
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
/** @} */

View File

@ -38,7 +38,6 @@
/*---------------------------------------------------------------------------*/
#include "ioc.h"
#include "gpio-interrupt.h"
#include "sys/energest.h"
#include "lpm.h"
#include "ti-lib.h"
@ -83,8 +82,6 @@ gpio_interrupt_isr(void)
uint32_t pin_mask;
uint8_t i;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* Read interrupt flags */
pin_mask = (HWREG(GPIO_BASE + GPIO_O_EVFLAGS31_0) & GPIO_DIO_ALL_MASK);
@ -98,8 +95,6 @@ gpio_interrupt_isr(void)
handlers[i](i);
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
/** @} */

View File

@ -37,7 +37,6 @@
*/
/*---------------------------------------------------------------------------*/
#include "contiki.h"
#include "sys/energest.h"
#include "rtimer.h"
#include "lpm.h"
@ -146,8 +145,6 @@ soc_rtc_isr(void)
{
uint32_t next;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
last_isr_time = RTIMER_NOW();
/* Adjust the s/w tick counter irrespective of which event trigger this */
@ -177,8 +174,6 @@ soc_rtc_isr(void)
ti_lib_aon_rtc_channel_disable(AON_RTC_CH2);
HWREG(AON_RTC_BASE + AON_RTC_O_EVFLAGS) = AON_RTC_EVFLAGS_CH2;
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
/** @} */

View File

@ -284,8 +284,6 @@ PROCESS_THREAD(soc_trng_process, ev, data)
void
soc_trng_isr(void)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
ti_lib_trng_disable();
disable_number_ready_interrupt();
@ -294,8 +292,6 @@ soc_trng_isr(void)
ti_lib_trng_enable();
process_post(&soc_trng_process, rng_ready_event, NULL);
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -56,18 +56,6 @@
#include <string.h>
#include <stdbool.h>
/*---------------------------------------------------------------------------*/
#if ENERGEST_CONF_ON
static unsigned long irq_energest = 0;
#define ENERGEST_IRQ_SAVE(a) do { \
a = energest_type_time(ENERGEST_TYPE_IRQ); } while(0)
#define ENERGEST_IRQ_RESTORE(a) do { \
energest_type_set(ENERGEST_TYPE_IRQ, a); } while(0)
#else
#define ENERGEST_IRQ_SAVE(a) do {} while(0)
#define ENERGEST_IRQ_RESTORE(a) do {} while(0)
#endif
/*---------------------------------------------------------------------------*/
LIST(modules_list);
/*---------------------------------------------------------------------------*/
/* PDs that may stay on in deep sleep */
@ -197,8 +185,6 @@ wake_up(void)
{
lpm_registered_module_t *module;
/* Remember IRQ energest for next pass */
ENERGEST_IRQ_SAVE(irq_energest);
ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
/* Sync so that we get the latest values before adjusting recharge settings */
@ -389,17 +375,11 @@ lpm_sleep(void)
{
ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
/* We are only interested in IRQ energest while idle or in LPM */
ENERGEST_IRQ_RESTORE(irq_energest);
/* Just to be on the safe side, explicitly disable Deep Sleep */
HWREG(NVIC_SYS_CTRL) &= ~(NVIC_SYS_CTRL_SLEEPDEEP);
ti_lib_prcm_sleep();
/* Remember IRQ energest for next pass */
ENERGEST_IRQ_SAVE(irq_energest);
ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
}
/*---------------------------------------------------------------------------*/
@ -505,8 +485,6 @@ deep_sleep(void)
ti_lib_pwr_ctrl_source_set(PWRCTRL_PWRSRC_ULDO);
}
/* We are only interested in IRQ energest while idle or in LPM */
ENERGEST_IRQ_RESTORE(irq_energest);
ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
/* Sync the AON interface to ensure all writes have gone through. */

View File

@ -567,8 +567,6 @@ rx_nok_isr(void)
void
cc26xx_rf_cpe1_isr(void)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
PRINTF("RF Error\n");
if(!rf_core_is_accessible()) {
@ -579,15 +577,11 @@ cc26xx_rf_cpe1_isr(void)
/* Clear INTERNAL_ERROR interrupt flag */
HWREG(RFC_DBELL_NONBUF_BASE + RFC_DBELL_O_RFCPEIFG) = 0x7FFFFFFF;
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void
cc26xx_rf_cpe0_isr(void)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(!rf_core_is_accessible()) {
printf("RF ISR called but RF not ready... PANIC!!\n");
if(rf_core_power_up() != RF_CORE_CMD_OK) {
@ -619,8 +613,6 @@ cc26xx_rf_cpe0_isr(void)
}
ti_lib_int_master_enable();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
/** @} */

View File

@ -42,7 +42,7 @@ extern volatile uint16_t cc2420_sfd_end_time;
ISR(TIMERB1, cc2420_timerb1_interrupt)
{
int tbiv;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* always read TBIV to clear IFG */
tbiv = TBIV;
/* read and discard tbiv to avoid "variable set but not used" warning */
@ -54,7 +54,6 @@ ISR(TIMERB1, cc2420_timerb1_interrupt)
cc2420_sfd_counter = 0;
cc2420_sfd_end_time = TBCCR1;
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -50,13 +50,9 @@
/*---------------------------------------------------------------------------*/
ISR(CC2420_IRQ, cc2420_port1_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(cc2420_interrupt()) {
LPM4_EXIT;
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -41,7 +41,7 @@ extern volatile uint16_t cc2520_sfd_end_time;
ISR(TIMERB1, cc2520_timerb1_interrupt)
{
int tbiv;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* always read TBIV to clear IFG */
tbiv = TBIV;
/* read and discard tbiv to avoid "variable set but not used" warning */
@ -53,7 +53,6 @@ ISR(TIMERB1, cc2520_timerb1_interrupt)
cc2520_sfd_counter = 0;
cc2520_sfd_end_time = TBCCR1;
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -49,13 +49,9 @@
/*---------------------------------------------------------------------------*/
ISR(CC2520_IRQ, cc2520_port1_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(cc2520_interrupt()) {
LPM4_EXIT;
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -63,8 +63,6 @@ read_tar(void)
/*---------------------------------------------------------------------------*/
ISR(TIMERA1, timera1)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
watchdog_start();
if(TAIV == 2) {
@ -106,8 +104,6 @@ ISR(TIMERA1, timera1)
}*/
watchdog_stop();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
clock_time_t

View File

@ -39,7 +39,6 @@
#include "contiki.h"
#include "sys/energest.h"
#include "sys/rtimer.h"
#include "sys/process.h"
#include "dev/watchdog.h"
@ -56,8 +55,6 @@
/*---------------------------------------------------------------------------*/
ISR(TIMERA0, timera0)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
watchdog_start();
rtimer_run_next();
@ -67,8 +64,6 @@ ISR(TIMERA0, timera0)
}
watchdog_stop();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -33,7 +33,6 @@
*/
#include "contiki.h"
#include "sys/energest.h"
#include "dev/uart1.h"
#include "dev/watchdog.h"
#include "sys/ctimer.h"
@ -239,7 +238,6 @@ uart1_init(unsigned long ubr)
ISR(UART1RX, uart1_rx_interrupt)
{
uint8_t c;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(!(URXIFG1 & IFG2)) {
/* Edge detect if IFG not set? */
@ -261,23 +259,17 @@ ISR(UART1RX, uart1_rx_interrupt)
}
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
#endif /* !RX_WITH_DMA */
/*---------------------------------------------------------------------------*/
#if TX_WITH_INTERRUPT
ISR(UART1TX, uart1_tx_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(ringbuf_elements(&txbuf) == 0) {
transmitting = 0;
} else {
TXBUF1 = ringbuf_get(&txbuf);
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
#endif /* TX_WITH_INTERRUPT */
/*---------------------------------------------------------------------------*/

View File

@ -35,7 +35,6 @@
#include <stdlib.h>
#include "contiki.h"
#include "sys/energest.h"
#include "dev/uart0.h"
#include "dev/watchdog.h"
#include "lib/ringbuf.h"
@ -186,7 +185,6 @@ ISR(USCIAB0RX, uart0_rx_interrupt)
{
uint8_t c;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(UCA0STAT & UCRXERR) {
c = UCA0RXBUF; /* Clear error flags by forcing a dummy read. */
} else {
@ -197,14 +195,12 @@ ISR(USCIAB0RX, uart0_rx_interrupt)
}
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
#endif /* !RX_WITH_DMA */
/*---------------------------------------------------------------------------*/
#if TX_WITH_INTERRUPT
ISR(USCIAB0TX, uart0_tx_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if((IFG2 & UCA0TXIFG)) {
if(ringbuf_elements(&txbuf) == 0) {
@ -216,8 +212,6 @@ ISR(USCIAB0TX, uart0_tx_interrupt)
/* In a stand-alone app won't work without this. Is the UG misleading? */
IFG2 &= ~UCA0TXIFG;
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
#endif /* TX_WITH_INTERRUPT */
/*---------------------------------------------------------------------------*/

View File

@ -33,7 +33,6 @@
*/
#include "contiki.h"
#include <stdlib.h>
#include "sys/energest.h"
#include "dev/uart1.h"
#include "dev/watchdog.h"
#include "lib/ringbuf.h"
@ -119,7 +118,6 @@ uart1_init(unsigned long ubr)
ISR(USCIAB1RX, uart1_rx_interrupt)
{
uint8_t c;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* Check status register for receive errors. */
if(UCA0STAT & UCRXERR) {
@ -132,13 +130,11 @@ ISR(USCIAB1RX, uart1_rx_interrupt)
}
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
#if TX_WITH_INTERRUPT
ISR(USCIAB1TX, uart1_tx_interrupt)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(IFG2 & UCA0TXIFG) {
if(ringbuf_elements(&txbuf) == 0) {
transmitting = 0;
@ -146,8 +142,6 @@ ISR(USCIAB1TX, uart1_tx_interrupt)
UCA0TXBUF = ringbuf_get(&txbuf);
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
#endif /* TX_WITH_INTERRUPT */
/*---------------------------------------------------------------------------*/

View File

@ -63,8 +63,6 @@ read_tar(void)
/*---------------------------------------------------------------------------*/
ISR(TIMER1_A1, timera1)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
/* watchdog_start(); */
if(TA1IV == 2) {
@ -106,8 +104,6 @@ ISR(TIMER1_A1, timera1)
}*/
/* watchdog_stop(); */
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
clock_time_t

View File

@ -37,7 +37,6 @@
*/
#include "contiki.h"
#include "sys/energest.h"
#include "sys/rtimer.h"
#include "sys/process.h"
#include "dev/watchdog.h"
@ -54,8 +53,6 @@
/*---------------------------------------------------------------------------*/
ISR(TIMER1_A0, timera0)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
watchdog_start();
rtimer_run_next();
@ -65,8 +62,6 @@ ISR(TIMER1_A0, timera0)
}
watchdog_stop();
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -35,7 +35,6 @@
#include "contiki.h"
#include <stdlib.h>
#include "sys/energest.h"
#include "dev/uart0.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
@ -103,7 +102,6 @@ ISR(USCI_A0, uart0_rx_interrupt)
{
uint8_t c;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(UCA0IV == 2) {
if(UCA0STAT & UCRXERR) {
c = UCA0RXBUF; /* Clear error flags by forcing a dummy read. */
@ -116,6 +114,5 @@ ISR(USCI_A0, uart0_rx_interrupt)
}
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/

View File

@ -35,7 +35,6 @@
#include "contiki.h"
#include <stdlib.h>
#include "sys/energest.h"
#include "dev/uart1.h"
#include "dev/watchdog.h"
#include "isr_compat.h"
@ -157,7 +156,6 @@ ISR(USCI_A1, uart1_rx_interrupt)
{
uint8_t c;
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(UCA1IV == 2) {
if(UCA1STAT & UCRXERR) {
c = UCA1RXBUF; /* Clear error flags by forcing a dummy read. */
@ -170,7 +168,6 @@ ISR(USCI_A1, uart1_rx_interrupt)
}
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
#endif /* !RX_WITH_DMA */
/*---------------------------------------------------------------------------*/

View File

@ -63,8 +63,6 @@ static uint8_t txbuf_data[TXBUFSIZE];
static void
uart_event_handler(nrf_drv_uart_event_t * p_event, void * p_context)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if (p_event->type == NRF_DRV_UART_EVT_RX_DONE) {
if (uart0_input_handler != NULL) {
uart0_input_handler(p_event->data.rxtx.p_data[0]);
@ -76,8 +74,6 @@ uart_event_handler(nrf_drv_uart_event_t * p_event, void * p_context)
nrf_drv_uart_tx(&c, 1);
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -42,7 +42,6 @@
#include <AppHardwareApi.h>
#include <PeripheralRegs.h>
#include "contiki.h"
#include "sys/energest.h"
#include "sys/clock.h"
#include "sys/etimer.h"
#include "rtimer-arch.h"
@ -130,8 +129,6 @@ clockTimerISR(uint32 u32Device, uint32 u32ItemBitmap)
return;
}
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(u32Device == CLOCK_TIMER_ISR_DEV) {
check_etimers();
}
@ -139,8 +136,6 @@ clockTimerISR(uint32 u32Device, uint32 u32ItemBitmap)
if(u32Device == OVERFLOW_TIMER_ISR_DEV) {
check_rtimer_overflow(clock());
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -43,7 +43,6 @@
#include <PeripheralRegs.h>
#include <MicroSpecific.h>
#include "dev/watchdog.h"
#include "sys/energest.h"
#include "sys/process.h"
#if RTIMER_USE_32KHZ
@ -75,8 +74,6 @@ timerISR(uint32 u32Device, uint32 u32ItemBitmap)
return;
}
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(u32ItemBitmap & TICK_TIMER_MASK) {
/* 32-bit overflow happened; restart the timer */
uint32_t ticks_late = WRAPAROUND_VALUE - u64AHI_WakeTimerReadLarge(TICK_TIMER);
@ -104,8 +101,6 @@ timerISR(uint32 u32Device, uint32 u32ItemBitmap)
process_nevents();
}
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -44,7 +44,6 @@
#include <PeripheralRegs.h>
#include <MicroSpecific.h>
#include "dev/watchdog.h"
#include "sys/energest.h"
#include "sys/process.h"
#if !RTIMER_USE_32KHZ
@ -71,7 +70,6 @@ rtimer_arch_run_next(uint32 u32DeviceId, uint32 u32ItemBitmap)
return;
}
ENERGEST_ON(ENERGEST_TYPE_IRQ);
vAHI_TickTimerIntPendClr();
vAHI_TickTimerIntEnable(0);
/*
@ -90,7 +88,6 @@ rtimer_arch_run_next(uint32 u32DeviceId, uint32 u32ItemBitmap)
vAHI_TickTimerIntEnable(1);
vAHI_TickTimerInterval(scheduled_time);
}
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
void

View File

@ -335,8 +335,6 @@ main(int argc, char **argv)
if(process_nevents() != 0 || uart1_active()) {
splx(s); /* Re-enable interrupts. */
} else {
static unsigned long irq_energest = 0;
#if DCOSYNCH_CONF_ENABLED
/* before going down to sleep possibly do some management */
if(timer_expired(&mgt_timer)) {
@ -351,10 +349,6 @@ main(int argc, char **argv)
/* Re-enable interrupts and go to sleep atomically. */
ENERGEST_SWITCH(ENERGEST_TYPE_CPU, ENERGEST_TYPE_LPM);
/* We only want to measure the processing done in IRQs when we
are asleep, so we discard the processing time done when we
were awake. */
energest_type_set(ENERGEST_TYPE_IRQ, irq_energest);
watchdog_stop();
/* check if the DCO needs to be on - if so - only LPM 1 */
if (msp430_dco_required) {
@ -367,11 +361,6 @@ main(int argc, char **argv)
interrupt that sets
the wake up flag. */
}
/* We get the current processing time for interrupts that was
done during the LPM and store it for next time around. */
dint();
irq_energest = energest_type_time(ENERGEST_TYPE_IRQ);
eint();
watchdog_start();
ENERGEST_SWITCH(ENERGEST_TYPE_LPM, ENERGEST_TYPE_CPU);
}

View File

@ -46,8 +46,6 @@ HWCONF_IRQ(BUTTON, 2, 7);
/*---------------------------------------------------------------------------*/
ISR(PORT2, irq_p2)
{
ENERGEST_ON(ENERGEST_TYPE_IRQ);
if(BUTTON_CHECK_IRQ()) {
if(timer_expired(&debouncetimer)) {
timer_set(&debouncetimer, CLOCK_SECOND / 4);
@ -56,7 +54,6 @@ ISR(PORT2, irq_p2)
}
}
P2IFG = 0x00;
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
}
/*---------------------------------------------------------------------------*/
static int

View File

@ -63,7 +63,6 @@ static void
reed_interrupt_handler(uint8_t ioid)
{
if(!timer_expired(&debouncetimer)) {
ENERGEST_OFF(ENERGEST_TYPE_IRQ);
return;
}

View File

@ -50,7 +50,6 @@ typedef struct {
enum energest_type {
ENERGEST_TYPE_CPU,
ENERGEST_TYPE_LPM,
ENERGEST_TYPE_IRQ,
ENERGEST_TYPE_TRANSMIT,
ENERGEST_TYPE_LISTEN,