-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for input device support #183
Comments
Since the generic task limitation(embassy-rs/embassy#2454), the only way for defining a generic input device task is to use macro. There are two options:
#[input_device]
struct RotaryEncoder {}
impl InputDevice for RotaryEncoder {...} which could be expanded as: struct RotaryEncoder {}
impl InputDevice for RotaryEncoder {...}
#[embassy_executor::task]
async fn rotaryencoder_task(device: RotaryEncoder) -> ! {
device.run().await
}
struct RotaryEncoder {}
impl InputDevice for RotaryEncoder {...}
impl_input_device!(RotaryEncoder, task_name); expanded code: struct RotaryEncoder {}
impl InputDevice for RotaryEncoder {...}
#[embassy_executor::task]
async fn task_name(device: RotaryEncoder) -> ! {
device.run().await
}
Now I'm going to option 2 first, Any ideas are welcome:) |
Okay, after some testing I found neither work with generic tasks. So I have to give up embassy task. The only option seems to be join all input device's // Implement the input device for RotaryEncoder
struct RotaryEncoder {}
impl InputDevice for RotaryEncoder {...} in user space: let e1 = RotaryEncoder {};
let e2 = RotaryEncoder {};
join(run_rmk(), run_devices!(e1, e2)).await |
RMK should support other input devices, like touchpad, encoder, joystick, etc.
The text was updated successfully, but these errors were encountered: