mirror of https://github.com/ARMmbed/mbed-os.git
Move time macro conversions to `Ticker.h`
parent
4b1cee3cf3
commit
ce5dbda1ba
|
@ -23,6 +23,21 @@
|
|||
#include "platform/NonCopyable.h"
|
||||
#include "hal/lp_ticker_api.h"
|
||||
|
||||
/**
|
||||
* Number of microseconds in a second
|
||||
*/
|
||||
#define MICROSECONDS_IN_SECOND (us_timestamp_t)1000000
|
||||
|
||||
/**
|
||||
* Converts seconds to microseconds
|
||||
*/
|
||||
#define SECONDS_TO_MICROSECONDS(SECONDS) (us_timestamp_t)(MICROSECONDS_IN_SECOND * SECONDS)
|
||||
|
||||
/**
|
||||
* Converts microseconds to seconds
|
||||
*/
|
||||
#define MICROSECONDS_TO_SECONDS(MICROSECONDS) (s_timestamp_t)(MICROSECONDS / MICROSECONDS_IN_SECOND)
|
||||
|
||||
namespace mbed {
|
||||
/**
|
||||
* \addtogroup drivers_Ticker Ticker class
|
||||
|
|
|
@ -24,21 +24,6 @@
|
|||
#include <stdbool.h>
|
||||
#include "device.h"
|
||||
|
||||
/**
|
||||
* Number of microseconds in a second
|
||||
*/
|
||||
#define MICROSECONDS_IN_SECOND (us_timestamp_t)1000000
|
||||
|
||||
/**
|
||||
* Converts seconds to microseconds
|
||||
*/
|
||||
#define SECONDS_TO_MICROSECONDS(SECONDS) (us_timestamp_t)(MICROSECONDS_IN_SECOND * SECONDS)
|
||||
|
||||
/**
|
||||
* Converts microseconds to seconds
|
||||
*/
|
||||
#define MICROSECONDS_TO_SECONDS(MICROSECONDS) (s_timestamp_t)(MICROSECONDS / MICROSECONDS_IN_SECOND)
|
||||
|
||||
/**
|
||||
* Legacy format representing a timestamp in us.
|
||||
* Given it is modeled as a 32 bit integer, this type can represent timestamp
|
||||
|
|
Loading…
Reference in New Issue