diff --git a/src/core/jogcon.cpp b/src/core/jogcon.cpp index ca5663018..391833218 100644 --- a/src/core/jogcon.cpp +++ b/src/core/jogcon.cpp @@ -376,6 +376,14 @@ bool JogCon::Transfer(const u8 data_in, u8* data_out) m_tx_buffer = {GetIDByte(), m_status_byte, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; Poll(); } + else if (m_configuration_mode && data_in == 0x44) + { + Assert(m_command_step == 0); + m_response_length = (GetResponseNumHalfwords() + 1) * 2; + m_command = Command::SetAnalogMode; + m_tx_buffer = {GetIDByte(), m_status_byte, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + ResetMotorConfig(); + } else if (m_configuration_mode && data_in == 0x45) { m_response_length = (GetResponseNumHalfwords() + 1) * 2; @@ -429,6 +437,25 @@ bool JogCon::Transfer(const u8 data_in, u8* data_out) } break; + case Command::SetAnalogMode: + { + if (m_command_step == 2) + { + DEV_LOG("analog mode val 0x{:02x}", data_in); + + if (data_in == 0x00 || data_in == 0x01) + SetJogConMode(data_in == 0x01, true); + } + else if (m_command_step == 3) + { + DEV_LOG("analog mode lock 0x{:02x}", data_in); + + if (data_in == 0x02 || data_in == 0x03) + WARNING_LOG("Unimplemented analog mode lock {}", (data_in == 0x03)); + } + } + break; + case Command::SetMode: { m_configuration_mode = (m_rx_buffer[2] == 1 && m_jogcon_mode); diff --git a/src/core/jogcon.h b/src/core/jogcon.h index ebbc1d43a..b8c0e3549 100644 --- a/src/core/jogcon.h +++ b/src/core/jogcon.h @@ -71,6 +71,7 @@ private: ReadPad, SetMode, GetAnalogMode, + SetAnalogMode, GetSetRumble, Command46, Command47,