| 56 | /// means the manager should wake and poll. Drivers that do not have such a |
| 57 | /// signal leave this unused; the manager's timed wait slice is the fallback. |
| 58 | struct PollNeededCallback { |
| 59 | using Callback = void (*)(void*) FL_NOEXCEPT; |
| 60 | |
| 61 | Callback callback = nullptr; |
| 62 | void* context = nullptr; |
| 63 | |
| 64 | constexpr PollNeededCallback() FL_NOEXCEPT = default; |
| 65 | constexpr PollNeededCallback(Callback cb, void* ctx) FL_NOEXCEPT |
| 66 | : callback(cb), context(ctx) {} |
| 67 | |
| 68 | bool isValid() const FL_NOEXCEPT { return callback != nullptr; } |
| 69 | explicit operator bool() const FL_NOEXCEPT { return isValid(); } |
| 70 | |
| 71 | void invoke() const FL_NOEXCEPT { |
| 72 | if (callback != nullptr) { |
| 73 | callback(context); |
| 74 | } |
| 75 | } |
| 76 | }; |
| 77 | |
| 78 | /// @brief ISR-safe storage for a poll-needed callback handle. |
| 79 | /// |
no outgoing calls
no test coverage detected