Introduce protocol-neutral controller state
This commit is contained in:
parent
df515934ab
commit
b11ae076a8
28 changed files with 833 additions and 501 deletions
|
|
@ -4,10 +4,13 @@
|
|||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
struct SwitchRumbleOutput {
|
||||
struct ControllerRumbleOutput {
|
||||
uint8_t low_frequency_magnitude;
|
||||
uint8_t high_frequency_magnitude;
|
||||
};
|
||||
typedef void (*ControllerRumbleCallback)(
|
||||
uint8_t instance, const ControllerRumbleOutput& rumble);
|
||||
|
||||
|
||||
size_t normalize_switch_output_report(uint8_t report_id,
|
||||
const uint8_t* payload,
|
||||
|
|
@ -19,7 +22,7 @@ public:
|
|||
SwitchHapticsDecoder();
|
||||
|
||||
void reset();
|
||||
SwitchRumbleOutput decode(const uint8_t payload[8]);
|
||||
ControllerRumbleOutput decode(const uint8_t payload[8]);
|
||||
|
||||
private:
|
||||
struct ActuatorState {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue