diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-07-26 11:23:36 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-07-26 11:23:36 +1000 |
| commit | f94be3db2f2bb6c1b359744cb915683095e4ee80 (patch) | |
| tree | 79d335db661720947c518a535bdde733fe669032 /src/drivers/include/gpios.hpp | |
| parent | d8194135bbaad97d1f3428a74c7fc54ba3f604ec (diff) | |
| download | tangara-fw-f94be3db2f2bb6c1b359744cb915683095e4ee80.tar.gz | |
make event queue go faster
Diffstat (limited to 'src/drivers/include/gpios.hpp')
| -rw-r--r-- | src/drivers/include/gpios.hpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/drivers/include/gpios.hpp b/src/drivers/include/gpios.hpp index da997843..5ac475bf 100644 --- a/src/drivers/include/gpios.hpp +++ b/src/drivers/include/gpios.hpp @@ -107,9 +107,8 @@ class Gpios : public IGpios { */ auto Read(void) -> bool; - auto listener() -> std::function<void(void)>* { return listener_; } - - auto set_listener(std::function<void(void)>* l) -> void { listener_ = l; } + auto InstallReadPendingISR() -> void; + auto IsReadPending() -> SemaphoreHandle_t { return read_pending_; } // Not copyable or movable. There should usually only ever be once instance // of this class, and that instance will likely have a static lifetime. @@ -122,7 +121,7 @@ class Gpios : public IGpios { std::atomic<uint16_t> ports_; std::atomic<uint16_t> inputs_; - std::function<void(void)>* listener_; + SemaphoreHandle_t read_pending_; }; } // namespace drivers |
