Christopher Haster / mbed-hal

Dependencies:   target-freescale

Fork of mbed-hal by Morpheus

Revision:
13:d6551a5dcbbf
Parent:
7:4fdb3a44f646
Child:
16:086d28575041
--- a/api/Ticker.h	Thu Mar 31 20:05:27 2016 -0500
+++ b/api/Ticker.h	Thu Mar 31 20:10:32 2016 -0500
@@ -17,7 +17,7 @@
 #define MBED_TICKER_H
 
 #include "TimerEvent.h"
-#include "Function.h"
+#include "FunctionPointer.h"
 
 namespace mbed {
 
@@ -68,7 +68,7 @@
      *  @param fptr pointer to the function to be called
      *  @param t the time between calls in seconds
      */
-    void attach(void (*fptr)(void), float t) {
+    void attach(FunctionPointer fptr, float t) {
         attach_us(fptr, t * 1000000.0f);
     }
 
@@ -78,8 +78,8 @@
      *  @param mptr pointer to the member function to be called
      *  @param t the time between calls in seconds
      */
-    template<typename T>
-    void attach(T* tptr, void (T::*mptr)(void), float t) {
+    template <typename T, typename M>
+    void attach(T *tptr, M mptr, float t) {
         attach_us(tptr, mptr, t * 1000000.0f);
     }
 
@@ -88,7 +88,7 @@
      *  @param fptr pointer to the function to be called
      *  @param t the time between calls in micro-seconds
      */
-    void attach_us(void (*fptr)(void), timestamp_t t) {
+    void attach_us(FunctionPointer fptr, timestamp_t t) {
         _function.attach(fptr);
         setup(t);
     }
@@ -99,8 +99,8 @@
      *  @param mptr pointer to the member function to be called
      *  @param t the time between calls in micro-seconds
      */
-    template<typename T>
-    void attach_us(T* tptr, void (T::*mptr)(void), timestamp_t t) {
+    template <typename T, typename M>
+    void attach_us(T *tptr, M mptr, timestamp_t t) {
         _function.attach(tptr, mptr);
         setup(t);
     }
@@ -119,7 +119,7 @@
 
 protected:
     timestamp_t     _delay;     /**< Time delay (in microseconds) for re-setting the multi-shot callback. */
-    Function<void()> _function;  /**< Callback. */
+    FunctionPointer _function;  /**< Callback. */
 };
 
 } // namespace mbed