khang_91
Diff: MTS-Lora/vendor/multitech/MTS-Utils/MTSCircularBuffer.h
- Revision:
- 133:05a58ba6d281
- Parent:
- 16:b630e18103e5
--- a/MTS-Lora/vendor/multitech/MTS-Utils/MTSCircularBuffer.h Fri Feb 02 14:06:12 2018 -0600 +++ b/MTS-Lora/vendor/multitech/MTS-Utils/MTSCircularBuffer.h Tue Feb 06 14:20:31 2018 -0600 @@ -1,6 +1,8 @@ #ifndef MTSCIRCULARBUFFER_H #define MTSCIRCULARBUFFER_H +#include <Callback.h> + #include "Utils.h" namespace mts @@ -99,7 +101,7 @@ void attach(void(*fptr)(void), int threshold, RelationalOperator op) { _threshold = threshold; _op = op; - notify.attach(fptr); + notify = fptr; } /** This method returns the size of the storage space currently allocated for @@ -147,7 +149,7 @@ int readIndex; // read index for circular buffer int writeIndex; // write index for circular buffer int bytes; // available data - FunctionPointer notify; // function pointer used for the internal callback notification + Callback<void()> notify; // Internal callback notification int _threshold; // threshold for the notification RelationalOperator _op; // operator that determines the direction of the threshold void checkThreshold(); // private function that checks thresholds and processes notifications