-
Notifications
You must be signed in to change notification settings - Fork 55
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
Add support for multiple models of Apple remote + long press #97
Conversation
ff7486a
to
6793fe4
Compare
6793fe4
to
ec38998
Compare
d02c219
to
b33db1a
Compare
@dspverden I noticed something in freeDSP-aurora/SOURCES/WEBAPP/ESP32/aurora/hwconfig.h Lines 41 to 44 in 7bbd8f7
My remote has codes looking like The code here should work with all. |
@dspverden I improved the thing a bit so it speeds up when maintaining a long press on volume remote buttons, and tried to debounce very short presses, so it's possible to fine tune volume level. On short presses, it goes with 0.5db as it was before, but when maintaining buttons it speeds up to 1db then 2db. |
I'm not yet happy with this code. I'll update the PR once I have something good enough. |
d143c58
to
4b46978
Compare
I reworked the code, it is much simpler now, and should work as expected. |
Great job. Just tested it. Works like charm. Even the logic regarding short long presses and longer long presses. Love it. |
4b46978
to
c623e27
Compare
- code should work with all Apple remotes with codes starting with 0x77E1 - volume increases/decreases faster if volume buttons are pressed for a long time
c623e27
to
27cb29c
Compare
To make things a bit more complicated, I had a bunch of Apple remotes here, they all showed different patterns. But it can be narrowed down to a scheme. In hex code the second byte identifies the key while byte 4 & 3 are always 0x77E1xxxx. That means masking byte 2 by 0x0000FF00 will give the key code. Here I found two variants for each key, e.g. Play button is either 0x00007A00 or 0x0000FA00. |
@dspverden did you test my code with those remotes ? The 0x00007A00 or 0x0000FA00 should be handled by 0x00007F00 mask EDIT: I'm pretty sure this code was working with the variant you added in 00f0012 I wonder if you actually tested this code, and if it wasn't working, why.
The first bit on the left varies ("battery flat?"), hence the mask |
@dspverden you didn't answer to my comment above, I need to know what wasn't working with the models you own, before reworking this PR. |
Please have a look at the one of the latest commits from develop. There you can see, it seems to be bit 7 (most left) of the the second byte. As you described it above. |
No description provided.