データの保存、更新、取得ができるWebサービス「milkcocoa」に接続し、データのプッシュ、送信、取得ができるライブラリです。 https://mlkcca.com/

Dependencies:   MQTT

Dependents:   MilkcocoaSample MilkcocoaSampleESP8266_LED MilkcocoaSampleESP8266 MilkcocoaSample_3G ... more

Committer:
jksoft
Date:
Tue Dec 15 09:56:32 2015 +0000
Revision:
0:23e533c4b1ec
??; Subscribe?1?????; ?Milkcocoa::on???????????????????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:23e533c4b1ec 1 //A modified version of the regular ticker/timeout libraries to allow us to do timeout without losing accuracy
jksoft 0:23e533c4b1ec 2
jksoft 0:23e533c4b1ec 3 #ifndef FLEXTICKER_H
jksoft 0:23e533c4b1ec 4 #define FLEXTICKER_H
jksoft 0:23e533c4b1ec 5
jksoft 0:23e533c4b1ec 6 #include "mbed.h"
jksoft 0:23e533c4b1ec 7
jksoft 0:23e533c4b1ec 8 class FlexTicker: public TimerEvent {
jksoft 0:23e533c4b1ec 9 public:
jksoft 0:23e533c4b1ec 10 template<typename T>
jksoft 0:23e533c4b1ec 11 void attach(T* tptr, void (T::*mptr)(void)) {
jksoft 0:23e533c4b1ec 12 _function.attach(tptr, mptr);
jksoft 0:23e533c4b1ec 13 }
jksoft 0:23e533c4b1ec 14
jksoft 0:23e533c4b1ec 15 /** Detach the function
jksoft 0:23e533c4b1ec 16 */
jksoft 0:23e533c4b1ec 17 void detach() {
jksoft 0:23e533c4b1ec 18 remove();
jksoft 0:23e533c4b1ec 19 }
jksoft 0:23e533c4b1ec 20
jksoft 0:23e533c4b1ec 21 void setNext(int delay) {
jksoft 0:23e533c4b1ec 22 insert(event.timestamp + delay);
jksoft 0:23e533c4b1ec 23 }
jksoft 0:23e533c4b1ec 24
jksoft 0:23e533c4b1ec 25 void prime(void) {
jksoft 0:23e533c4b1ec 26 event.timestamp = us_ticker_read();
jksoft 0:23e533c4b1ec 27 }
jksoft 0:23e533c4b1ec 28
jksoft 0:23e533c4b1ec 29 protected:
jksoft 0:23e533c4b1ec 30 virtual void handler() {
jksoft 0:23e533c4b1ec 31 _function.call();
jksoft 0:23e533c4b1ec 32 }
jksoft 0:23e533c4b1ec 33
jksoft 0:23e533c4b1ec 34 unsigned int _delay;
jksoft 0:23e533c4b1ec 35 FunctionPointer _function;
jksoft 0:23e533c4b1ec 36 };
jksoft 0:23e533c4b1ec 37
jksoft 0:23e533c4b1ec 38 #endif