mirror of
https://github.com/google/mozc-devices.git
synced 2025-11-09 09:13:27 +03:00
Add mozc dial version.
Co-authored-by: Takashi Toyoshima <toyoshim@google.com> Co-authored-by: Shun Ikejima <ikejima@google.com>
This commit is contained in:
28
mozc-dial/firmware/common/dial_controller.h
Normal file
28
mozc-dial/firmware/common/dial_controller.h
Normal file
@@ -0,0 +1,28 @@
|
||||
// Copyright 2025 Google Inc.
|
||||
// Use of this source code is governed by an Apache License that can be found
|
||||
// in the LICENSE file.
|
||||
|
||||
#ifndef COMMON_DIAL_CONTROLLER_H
|
||||
#define COMMON_DIAL_CONTROLLER_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
|
||||
class DialController {
|
||||
public:
|
||||
DialController();
|
||||
DialController(const DialController&) = delete;
|
||||
DialController& operator=(const DialController&) = delete;
|
||||
~DialController() = default;
|
||||
|
||||
void Update(uint8_t sensor_gray_code);
|
||||
bool IsBasePosition() const;
|
||||
std::optional<uint8_t> PopDecidedPosition();
|
||||
|
||||
private:
|
||||
uint8_t position_ = 0u;
|
||||
uint8_t max_position_ = 0u;
|
||||
std::optional<uint8_t> decided_position_;
|
||||
};
|
||||
|
||||
#endif // COMMON_DIAL_CONTROLLER_H
|
||||
Reference in New Issue
Block a user