Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion firmware/libsi/include/si/device/gc_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,13 @@ static inline bool si_device_gc_wireless_id_fixed(struct si_device_gc_controller
/**
* Mark the input state as valid.
*
* When the input state is marked valid, we'll use the contents of device->input
* when replying to poll commands, otherwise we'll use the origin state.
*
* @param device the device to set the input state for
* @param valid true if the input state is valid
*/
static inline void si_device_set_input_valid(struct si_device_gc_controller *device, bool valid)
static inline void si_device_gc_input_valid(struct si_device_gc_controller *device, bool valid)
{
device->input_valid = valid;
}
Expand Down
4 changes: 2 additions & 2 deletions firmware/receiver/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ static void handle_wavebird_packet(const uint8_t *packet)

// Set the input state as valid
input_valid_until = millis + INPUT_VALID_MS;
si_device_set_input_valid(&si_device, true);
si_device_gc_input_valid(&si_device, true);
} else {
//
// Handle origin packets
Expand Down Expand Up @@ -439,6 +439,6 @@ int main(void)

// Invalidate stale inputs
if (si_device.input_valid && (int32_t)(millis - input_valid_until) >= 0)
si_device_set_input_valid(&si_device, false);
si_device_gc_input_valid(&si_device, false);
}
}