mediCAL's first BLE project
Fork of nRF51822 by
Diff: nordic/nrf-sdk/app_common/app_timer.h
- Revision:
- 56:a1071b629aa3
- Parent:
- 45:3c4df37ed83e
- Child:
- 65:98215c4f3a25
--- a/nordic/nrf-sdk/app_common/app_timer.h Fri Jul 25 10:33:52 2014 +0100 +++ b/nordic/nrf-sdk/app_common/app_timer.h Tue Sep 02 15:50:05 2014 +0100 @@ -62,6 +62,8 @@ #define APP_TIMER_USER_SIZE 8 /**< Size of app_timer.timer_user_t (only for use inside APP_TIMER_BUF_SIZE()). */ #define APP_TIMER_INT_LEVELS 3 /**< Number of interrupt levels from where timer operations may be initiated (only for use inside APP_TIMER_BUF_SIZE()). */ +#define MAX_RTC_COUNTER_VAL 0x00FFFFFF /**< Maximum value of the RTC counter. */ + /**@brief Compute number of bytes required to hold the application timer data structures. * * @param[in] MAX_TIMERS Maximum number of timers that can be created at any given time. @@ -106,6 +108,8 @@ /**@brief Timer id type. */ typedef uint32_t app_timer_id_t; +#define TIMER_NULL ((app_timer_id_t)(0 - 1)) /**< Invalid timer id. */ + /**@brief Application timeout handler type. */ typedef void (*app_timer_timeout_handler_t)(void * p_context); @@ -249,13 +253,14 @@ */ uint32_t app_timer_stop_all(void); -/**@brief Function for returning the current value of the RTC1 counter. +/**@brief Function for returning the current value of the RTC1 counter. The + * value includes overflow bits to extend the range to 64-bits. * * @param[out] p_ticks Current value of the RTC1 counter. * * @retval NRF_SUCCESS Counter was successfully read. */ -uint32_t app_timer_cnt_get(uint32_t * p_ticks); +uint32_t app_timer_cnt_get(uint64_t * p_ticks); /**@brief Function for computing the difference between two RTC1 counter values. *