summaryrefslogtreecommitdiff
path: root/digital/beacon/src/Bitcloud_stack/Components/HAL/avr/common/src/sleep.c
diff options
context:
space:
mode:
Diffstat (limited to 'digital/beacon/src/Bitcloud_stack/Components/HAL/avr/common/src/sleep.c')
-rw-r--r--digital/beacon/src/Bitcloud_stack/Components/HAL/avr/common/src/sleep.c79
1 files changed, 0 insertions, 79 deletions
diff --git a/digital/beacon/src/Bitcloud_stack/Components/HAL/avr/common/src/sleep.c b/digital/beacon/src/Bitcloud_stack/Components/HAL/avr/common/src/sleep.c
deleted file mode 100644
index 1ad72df2..00000000
--- a/digital/beacon/src/Bitcloud_stack/Components/HAL/avr/common/src/sleep.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/**************************************************************************//**
- \file sleep.c
-
- \brief The implementation of common sleep and wake up.
-
- \author
- Atmel Corporation: http://www.atmel.com \n
- Support email: avr@atmel.com
-
- Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
- Licensed under Atmel's Limited License Agreement (BitCloudTM).
-
- \internal
- History:
- 1/12/09 A. Khromykh - Created
- ******************************************************************************/
-/******************************************************************************
- * WARNING: CHANGING THIS FILE MAY AFFECT CORE FUNCTIONALITY OF THE STACK. *
- * EXPERT USERS SHOULD PROCEED WITH CAUTION. *
- ******************************************************************************/
-/******************************************************************************
- Includes section
-******************************************************************************/
-#include <halSleep.h>
-
-/******************************************************************************
- Define(s) section
-******************************************************************************/
-#define HAL_NULL_POINTER -1
-#define HAL_SLEEP_TIMER_HAS_ALREADY_STARTED -3
-#define HAL_SLEEP_TIMER_IS_BUSY -2
-#define HAL_SLEEP_SYSTEM_HAS_ALREADY_STARTED -3
-
-/******************************************************************************
- Global variables section
-******************************************************************************/
-HalSleepControl_t halSleepControl =
-{
- .wakeupStation = HAL_ACTIVE_MODE,
- .sleepTimerState = HAL_SLEEP_TIMER_IS_STOPPED
-};
-
-/******************************************************************************
- Implementations section
-******************************************************************************/
-/**************************************************************************//**
-\brief Starts sleep timer and HAL sleep. When system is wake up send callback
-\param[in]
- sleepParam - pointer to sleep structure.
-\return
- -1 - bad pointer, \n
- -2 - sleep timer is busy, \n
- -3 - sleep system has been started.
- 0 - success.
-******************************************************************************/
-int HAL_StartSystemSleep(HAL_Sleep_t *sleepParam)
-{
- HAL_SleepTimer_t sleepTimer;
- int sleepTimerStatus;
-
- if (!sleepParam)
- return HAL_NULL_POINTER;
-
- halSleepControl.callback = sleepParam->callback;
- sleepTimer.interval = sleepParam->sleepTime;
- sleepTimer.mode = TIMER_ONE_SHOT_MODE;
- sleepTimer.callback = NULL;
-
- sleepTimerStatus = HAL_StartSleepTimer(&sleepTimer);
- if ((HAL_NULL_POINTER == sleepTimerStatus) || (HAL_SLEEP_TIMER_HAS_ALREADY_STARTED == sleepTimerStatus))
- return HAL_SLEEP_TIMER_IS_BUSY;
-
- if (-1 == HAL_Sleep())
- return HAL_SLEEP_SYSTEM_HAS_ALREADY_STARTED;
-
- return 0;
-}
-
-//eof sleep.c