Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
button_classifier.h
Go to the documentation of this file.
1
9#pragma once
10
11#include <cstdint>
12
13namespace aiming
14{
15enum class ButtonEvent : uint8_t { None, Short, Long };
16
18 uint32_t debounce_ms = 50;
19 uint32_t long_ms = 1500;
20};
21
23{
24public:
25 explicit ButtonClassifier(const ButtonConfig& config = ButtonConfig{}) : config_(config) {}
26 ButtonEvent update(bool pressed_raw, uint32_t now_ms);
27
28private:
29 ButtonConfig config_;
30 bool raw_ = false;
31 uint32_t raw_since_ms_ = 0;
32 bool stable_ = false;
33 uint32_t pressed_at_ms_ = 0;
34 bool long_fired_ = false;
35};
36} // namespace aiming
Definition button_classifier.h:23
Definition button_classifier.h:17