add callback support

This commit is contained in:
hathach committed 2017-09-14 01:09:03 +07:00
1 parent 337b683e9f
commit 23dca4bc75
6 files changed
+155 -10

No files matched your search

+4 -1
View File
@@ -41,7 +41,7 @@
class HwRotaryEncoder
{
public:
typedef void (*callback_t) (int32_t step);
typedef void (*callback_t) (int step);
HwRotaryEncoder(void)
{
@@ -68,6 +68,9 @@ class HwRotaryEncoder
void setCallback(callback_t fp);
// Internal API
void _irq_handler(void);
private:
int8_t _pina, _pinb;
int8_t _pinled;