mirror of https://github.com/ARMmbed/mbed-os.git
Timer/Ticker - fix constness of the data argument/member
parent
1f6ad3fbb3
commit
f0038f84e8
|
@ -60,7 +60,7 @@ public:
|
|||
Ticker() : TimerEvent() {
|
||||
}
|
||||
|
||||
Ticker(const ticker_data_t *const data) : TimerEvent(data) {
|
||||
Ticker(const ticker_data_t *data) : TimerEvent(data) {
|
||||
}
|
||||
|
||||
/** Attach a function to be called by the Ticker, specifiying the interval in seconds
|
||||
|
|
|
@ -46,7 +46,7 @@ class Timer {
|
|||
|
||||
public:
|
||||
Timer();
|
||||
Timer(const ticker_data_t *const data);
|
||||
Timer(const ticker_data_t *data);
|
||||
|
||||
/** Start the timer
|
||||
*/
|
||||
|
@ -83,7 +83,7 @@ protected:
|
|||
int _running; // whether the timer is running
|
||||
unsigned int _start; // the start time of the latest slice
|
||||
int _time; // any accumulated time from previous slices
|
||||
const ticker_data_t *const _ticker_data;
|
||||
const ticker_data_t *_ticker_data;
|
||||
};
|
||||
|
||||
} // namespace mbed
|
||||
|
|
|
@ -47,7 +47,7 @@ protected:
|
|||
|
||||
ticker_event_t event;
|
||||
|
||||
const ticker_data_t *const _ticker_data;
|
||||
const ticker_data_t *_ticker_data;
|
||||
};
|
||||
|
||||
} // namespace mbed
|
||||
|
|
|
@ -23,7 +23,7 @@ Timer::Timer() : _running(), _start(), _time(), _ticker_data(get_us_ticker_data(
|
|||
reset();
|
||||
}
|
||||
|
||||
Timer::Timer(const ticker_data_t *const data) : _running(), _start(), _time(), _ticker_data(data) {
|
||||
Timer::Timer(const ticker_data_t *data) : _running(), _start(), _time(), _ticker_data(data) {
|
||||
reset();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue