mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Rename new occurrences of LOWPOWERTIMER to LPTICKER
							parent
							
								
									3850c80b43
								
							
						
					
					
						commit
						efd307fa79
					
				| 
						 | 
				
			
			@ -21,7 +21,7 @@
 | 
			
		|||
 | 
			
		||||
#include "mbed.h"
 | 
			
		||||
 | 
			
		||||
#if !defined(MBED_CPU_STATS_ENABLED) || !defined(DEVICE_LOWPOWERTIMER) || !defined(DEVICE_SLEEP)
 | 
			
		||||
#if !defined(MBED_CPU_STATS_ENABLED) || !defined(DEVICE_LPTICKER) || !defined(DEVICE_SLEEP)
 | 
			
		||||
#error [NOT_SUPPORTED] test not supported
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -34,13 +34,13 @@ static uint16_t deep_sleep_lock = 0U;
 | 
			
		|||
static us_timestamp_t sleep_time = 0;
 | 
			
		||||
static us_timestamp_t deep_sleep_time = 0;
 | 
			
		||||
 | 
			
		||||
#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LOWPOWERTIMER)
 | 
			
		||||
#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LPTICKER)
 | 
			
		||||
static ticker_data_t *sleep_ticker = NULL;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static inline us_timestamp_t read_us(void)
 | 
			
		||||
{
 | 
			
		||||
#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LOWPOWERTIMER)
 | 
			
		||||
#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LPTICKER)
 | 
			
		||||
    if (NULL == sleep_ticker) {
 | 
			
		||||
        sleep_ticker = (ticker_data_t *)get_lp_ticker_data();
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -29,7 +29,7 @@ static int (*_rtc_isenabled)(void) = rtc_isenabled;
 | 
			
		|||
static time_t (*_rtc_read)(void) = rtc_read;
 | 
			
		||||
static void (*_rtc_write)(time_t t) = rtc_write;
 | 
			
		||||
 | 
			
		||||
#elif DEVICE_LOWPOWERTIMER
 | 
			
		||||
#elif DEVICE_LPTICKER
 | 
			
		||||
 | 
			
		||||
#include "drivers/LowPowerTimer.h"
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -63,13 +63,13 @@ static int (*_rtc_isenabled)(void) = _rtc_lpticker_isenabled;
 | 
			
		|||
static time_t (*_rtc_read)(void) = _rtc_lpticker_read;
 | 
			
		||||
static void (*_rtc_write)(time_t t) = _rtc_lpticker_write;
 | 
			
		||||
 | 
			
		||||
#else /* DEVICE_LOWPOWERTIMER */
 | 
			
		||||
#else /* DEVICE_LPTICKER */
 | 
			
		||||
 | 
			
		||||
static void (*_rtc_init)(void) = NULL;
 | 
			
		||||
static int (*_rtc_isenabled)(void) = NULL;
 | 
			
		||||
static time_t (*_rtc_read)(void) = NULL;
 | 
			
		||||
static void (*_rtc_write)(time_t t) = NULL;
 | 
			
		||||
#endif /* DEVICE_LOWPOWERTIMER */
 | 
			
		||||
#endif /* DEVICE_LPTICKER */
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
extern "C" {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,7 +12,7 @@
 | 
			
		|||
#warning Statistics are currently not supported without the rtos.
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(MBED_CPU_STATS_ENABLED) && (!defined(DEVICE_LOWPOWERTIMER) || !defined(DEVICE_SLEEP))
 | 
			
		||||
#if defined(MBED_CPU_STATS_ENABLED) && (!defined(DEVICE_LPTICKER) || !defined(DEVICE_SLEEP))
 | 
			
		||||
#warning CPU statistics are not supported without low power timer support.
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -20,7 +20,7 @@ void mbed_stats_cpu_get(mbed_stats_cpu_t *stats)
 | 
			
		|||
{
 | 
			
		||||
    MBED_ASSERT(stats != NULL);
 | 
			
		||||
    memset(stats, 0, sizeof(mbed_stats_cpu_t));
 | 
			
		||||
#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LOWPOWERTIMER) && defined(DEVICE_SLEEP)
 | 
			
		||||
#if defined(MBED_CPU_STATS_ENABLED) && defined(DEVICE_LPTICKER) && defined(DEVICE_SLEEP)
 | 
			
		||||
    stats->uptime = mbed_uptime();
 | 
			
		||||
    stats->idle_time = mbed_time_idle();
 | 
			
		||||
    stats->sleep_time = mbed_time_sleep();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue