Skip to content

Releases: RMSSimRacing/FreeJoy

Encoder Fix - FSM Quadrature State Machine

Choose a tag to compare

@RMSSimRacing RMSSimRacing released this 21 May 11:40
5d2a931

Encoder Fix - FSM Quadrature State Machine

Fixes multiple encoder issues in FreeJoy firmware.

Problems fixed

  • Ghost HID output when partially rotating and releasing the encoder
  • Lost pulses on EC11 encoders due to time and direction blocking
  • First step lost when quickly changing rotation direction

Solution

Replaced the original lookup table logic with a full quadrature FSM (Finite State Machine) for ENCODER_CONF_1x and ENCODER_CONF_2x modes.

  • Bounce rejection is handled automatically by the FSM
  • Direction changes are detected immediately without losing the first step
  • ENCODER_CONF_4x keeps the original enc_array_4 logic, required for encoders like the ALPS RKJXT1F42001

Modified files

  • application/Src/encoders.c
  • application/Inc/common_types.h (added fsm_state field to encoder_state_t struct)

Tested on

  • EC16 (ENCODER_CONF_1x)
  • EC11 (ENCODER_CONF_1x)
  • ALPS RKJXT1F42001 (ENCODER_CONF_4x)

Installation

Flash FreeJoy.bin using FreeJoy Configurator, or FreeJoy.hex using ST-Link or similar programmer.

v1.0-encoder-fix

v1.0-encoder-fix Pre-release
Pre-release

Choose a tag to compare

@RMSSimRacing RMSSimRacing released this 08 May 02:57
1b1646a

Fix for ghost HID output on rotary encoders (partial rotation false press).

Changes

  • encoders.c: added cycle_started logic to EncoderProcess()
  • common_types.h: added cycle_started field to encoder_state_t

How to flash

⚠️ DO NOT flash this .bin using ST-Link or STM32CubeProgrammer.

This firmware must be flashed through the FreeJoy Configurator:

  1. Open FreeJoy Configurator
  2. Go to the "Advanced Settings" tab
  3. Click "Enter Flasher Mode" and wait
  4. Click "Flash Firmware"
  5. Select this .bin file
  6. Wait for the process to complete and reconnect the device

Hardware

Compiled for STM32F103C8 (Blue Pill) — standard FreeJoy pinout.
If your pinout is different, recompile from the patched source.

Status

Pre-release / community testing. Please report results in issue FreeJoy-Team#160.