mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-07-12 18:19:42 -07:00
remove the dead analog-stick LED feature end to end
The "ANALOG STICKS LED COLOR" feature controlled RGB LEDs that no ArchR-supported device has (only the unsupported R36S Ultra does), gated by DEVICE_ANALOG_STICKS_LED_CONTROL which no device sets, backed by a dispatcher that execs a per-device binary nothing ships -> a guaranteed no-op everywhere. - ES (patches/0003): remove the menu entry, openAnalogSticksLedControls() + its declaration + include, the two CMakeLists refs, and the GuiAnalogSticksLedControls class. - system-utils: drop the analog_sticks_ledcontrol dispatcher script + install. - quirks 999-export: drop DEVICE_ANALOG_STICKS_LED_CONTROL. If R36S Ultra support is ever added, this comes back with a real, hardware- backed backend developed against the device. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -34,7 +34,6 @@ export OS_VERSION \
|
||||
DEVICE_LED_BRIGHTNESS \
|
||||
DEVICE_LED_CHARGING \
|
||||
DEVICE_LED_CONTROL \
|
||||
DEVICE_ANALOG_STICKS_LED_CONTROL \
|
||||
DEVICE_MANGOHUD_SUPPORT \
|
||||
DEVICE_MMC_EJECT \
|
||||
DEVICE_PIPEWIRE_PROFILE \
|
||||
|
||||
@@ -20,7 +20,6 @@ makeinstall_target() {
|
||||
cp ${PKG_DIR}/sources/scripts/hdmi_sense ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/input_sense ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/ledcontrol ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/analog_sticks_ledcontrol ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/battery_led_status ${INSTALL}/usr/bin
|
||||
cp ${PKG_DIR}/sources/scripts/turbomode ${INSTALL}/usr/bin
|
||||
if [ -d "${PKG_DIR}/sources/devices/${DEVICE}" ]
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2024-present ArchR (https://github.com/archr-linux/Arch-R)
|
||||
|
||||
###
|
||||
### LED Control now redirects to the quirk device or platform /bin/analog_sticks_ledcontrol
|
||||
### so we don't need to have multiple variants in /usr/bin.
|
||||
###
|
||||
|
||||
if [ -z "${QUIRK_DEVICE}" ] || [ -z "${HW_DEVICE}" ]; then
|
||||
. /etc/profile
|
||||
fi
|
||||
|
||||
if [ -f "/usr/lib/autostart/quirks/devices/${QUIRK_DEVICE}/bin/analog_sticks_ledcontrol" ]; then
|
||||
exec "/usr/lib/autostart/quirks/devices/${QUIRK_DEVICE}/bin/analog_sticks_ledcontrol" $*
|
||||
elif [ -f "/usr/lib/autostart/quirks/platforms/${HW_DEVICE}/bin/analog_sticks_ledcontrol" ]; then
|
||||
exec "/usr/lib/autostart/quirks/platforms/${HW_DEVICE}/bin/analog_sticks_ledcontrol" $*
|
||||
fi
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
es-menu: remove the dead ANALOG STICKS LED COLOR feature
|
||||
|
||||
No ArchR-supported device has analog-stick RGB LEDs (only the R36S Ultra
|
||||
has them, and ArchR does not support it; its stock DTB is a generic EVB that
|
||||
does not even describe the LED control path). No device sets
|
||||
DEVICE_ANALOG_STICKS_LED_CONTROL, so the menu entry never rendered, and the
|
||||
backend /usr/bin/analog_sticks_ledcontrol was a dispatcher to a per-device
|
||||
binary that nothing ships, i.e. a guaranteed no-op.
|
||||
|
||||
Remove the whole chain on the ES side: the menu entry, GuiMenu's
|
||||
openAnalogSticksLedControls(), its declaration, the include, the two
|
||||
CMakeLists source refs, and the GuiAnalogSticksLedControls class itself.
|
||||
The OS-side script + its install + the DEVICE_ANALOG_STICKS_LED_CONTROL
|
||||
export are removed in the same commit.
|
||||
|
||||
--- a/es-app/src/guis/GuiMenu.cpp
|
||||
+++ b/es-app/src/guis/GuiMenu.cpp
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "guis/GuiRetroAchievementsSettings.h"
|
||||
#include "guis/GuiSystemInformation.h"
|
||||
#include "guis/GuiControllersSettings.h"
|
||||
-#include "guis/GuiAnalogSticksLedControls.h"
|
||||
#include "views/UIModeController.h"
|
||||
#include "views/ViewController.h"
|
||||
#include "CollectionSystemManager.h"
|
||||
@@ -1857,10 +1856,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
- if (Utils::Platform::GetEnv("DEVICE_ANALOG_STICKS_LED_CONTROL") == "true"){
|
||||
- s->addEntry(_("ANALOG STICKS LED COLOR"), true, [this] { openAnalogSticksLedControls(); });
|
||||
- }
|
||||
-
|
||||
if (Utils::Platform::GetEnv("DEVICE_DTB_SWITCH") == "true"){
|
||||
s->addGroup(_("DEVICE"));
|
||||
// Switch device dtb between e.g. the R33S & R36S
|
||||
@@ -3017,11 +3012,6 @@
|
||||
mWindow->pushGui(new GuiNetPlaySettings(mWindow));
|
||||
}
|
||||
|
||||
-void GuiMenu::openAnalogSticksLedControls()
|
||||
-{
|
||||
- mWindow->pushGui(new GuiAnalogSticksLedControls(mWindow));
|
||||
-}
|
||||
-
|
||||
void GuiMenu::addDecorationSetOptionListComponent(Window* window, GuiSettings* parentWindow, const std::vector<DecorationSetInfo>& sets, const std::string& configName)
|
||||
{
|
||||
auto decorations = std::make_shared<OptionListComponent<std::string> >(window, _("DECORATION SET"), false);
|
||||
--- a/es-app/src/guis/GuiMenu.h
|
||||
+++ b/es-app/src/guis/GuiMenu.h
|
||||
@@ -63,7 +63,6 @@
|
||||
void openResetOptions();
|
||||
void openNetplaySettings();
|
||||
void openRetroachievementsSettings();
|
||||
- void openAnalogSticksLedControls();
|
||||
void openMissingBiosSettings();
|
||||
void openFormatDriveSettings();
|
||||
void exitKidMode();
|
||||
--- a/es-app/CMakeLists.txt
|
||||
+++ b/es-app/CMakeLists.txt
|
||||
@@ -105,7 +105,6 @@
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiFileBrowser.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiFavoriteMusicSelector.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMoonlight.h
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiAnalogSticksLedControls.h
|
||||
|
||||
# Scrapers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.h
|
||||
@@ -212,7 +211,6 @@
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiFileBrowser.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiFavoriteMusicSelector.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMoonlight.cpp
|
||||
- ${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiAnalogSticksLedControls.cpp
|
||||
|
||||
# Scrapers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.cpp
|
||||
--- a/es-app/src/guis/GuiAnalogSticksLedControls.cpp
|
||||
+++ /dev/null 2026-06-25 17:24:11.918953990 -0300
|
||||
@@ -1,78 +0,0 @@
|
||||
-#include "GuiAnalogSticksLedControls.h"
|
||||
-
|
||||
-#include <cstdlib>
|
||||
-#include "components/SliderComponent.h"
|
||||
-#include "SystemConf.h"
|
||||
-#include "utils/Platform.h"
|
||||
-#include "utils/StringUtil.h"
|
||||
-
|
||||
-GuiAnalogSticksLedControls::GuiAnalogSticksLedControls(Window* window) : GuiSettings(window, _("ANALOG STICKS LEDS").c_str())
|
||||
-{
|
||||
- float brightness_value = 0.f;
|
||||
- float left_red_value = 0.f, left_green_value = 0.f, left_blue_value = 0.f;
|
||||
- float right_red_value = 0.f, right_green_value = 0.f, right_blue_value = 0.f;
|
||||
-
|
||||
- std::string line = SystemConf::getInstance()->get("analogsticks.led");
|
||||
- if (!line.empty()) {
|
||||
- std::vector<std::string> tokens = Utils::String::split(line, ' ');
|
||||
- if (tokens.size() == 7) {
|
||||
- brightness_value = (float) std::atoi(tokens[0].c_str()) / 255;
|
||||
- right_red_value = (float) std::atoi(tokens[1].c_str()) / 255;
|
||||
- right_green_value = (float) std::atoi(tokens[2].c_str()) / 255;
|
||||
- right_blue_value = (float) std::atoi(tokens[3].c_str()) / 255;
|
||||
- left_red_value = (float) std::atoi(tokens[4].c_str()) / 255;
|
||||
- left_green_value = (float) std::atoi(tokens[5].c_str()) / 255;
|
||||
- left_blue_value = (float) std::atoi(tokens[6].c_str()) / 255;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- auto brightness = std::make_shared<SliderComponent>(mWindow, 0.f, 1.f, 0.1f);
|
||||
- brightness->setValue(brightness_value);
|
||||
- addWithLabel(_("BRIGHTNESS"), brightness);
|
||||
-
|
||||
- addGroup(_("LEFT"));
|
||||
- auto left_red = std::make_shared<SliderComponent>(mWindow, 0.f, 1.f, 0.1f);
|
||||
- left_red->setValue(left_red_value);
|
||||
- addWithLabel(_("RED"), left_red);
|
||||
-
|
||||
- auto left_green = std::make_shared<SliderComponent>(mWindow, 0.f, 1.f, 0.1f);
|
||||
- left_green->setValue(left_green_value);
|
||||
- addWithLabel(_("GREEN"), left_green);
|
||||
-
|
||||
- auto left_blue = std::make_shared<SliderComponent>(mWindow, 0.f, 1.f, 0.1f);
|
||||
- left_blue->setValue(left_blue_value);
|
||||
- addWithLabel(_("BLUE"), left_blue);
|
||||
-
|
||||
- addGroup(_("RIGHT"));
|
||||
- auto right_red = std::make_shared<SliderComponent>(mWindow, 0.f, 1.f, 0.1f);
|
||||
- right_red->setValue(right_red_value);
|
||||
- addWithLabel(_("RED"), right_red);
|
||||
-
|
||||
- auto right_green = std::make_shared<SliderComponent>(mWindow, 0.f, 1.f, 0.1f);
|
||||
- right_green->setValue(right_green_value);
|
||||
- addWithLabel(_("GREEN"), right_green);
|
||||
-
|
||||
- auto right_blue = std::make_shared<SliderComponent>(mWindow, 0.f, 1.f, 0.1f);
|
||||
- right_blue->setValue(right_blue_value);
|
||||
- addWithLabel(_("BLUE"), right_blue);
|
||||
-
|
||||
- const std::string analogSticksLedScript = "/usr/bin/analog_sticks_ledcontrol";
|
||||
- mMenu.addButton(_("APPLY"), "apply", [this, analogSticksLedScript, brightness,
|
||||
- left_red, left_green, left_blue, right_red, right_green, right_blue]
|
||||
- {
|
||||
- char buffer[128];
|
||||
-
|
||||
- sprintf(buffer, "%u %u %u %u %u %u %u",
|
||||
- static_cast<uint8_t>(brightness->getValue() * 255),
|
||||
- static_cast<uint8_t>(right_red->getValue() * 255),
|
||||
- static_cast<uint8_t>(right_green->getValue() * 255),
|
||||
- static_cast<uint8_t>(right_blue->getValue() * 255),
|
||||
- static_cast<uint8_t>(left_red->getValue() * 255),
|
||||
- static_cast<uint8_t>(left_green->getValue() * 255),
|
||||
- static_cast<uint8_t>(left_blue->getValue() * 255)
|
||||
- );
|
||||
-
|
||||
- Utils::Platform::runSystemCommand(analogSticksLedScript + " " + buffer, "", nullptr);
|
||||
- SystemConf::getInstance()->set("analogsticks.led", buffer);
|
||||
- });
|
||||
-}
|
||||
--- a/es-app/src/guis/GuiAnalogSticksLedControls.h
|
||||
+++ /dev/null 2026-06-25 17:24:11.918953990 -0300
|
||||
@@ -1,11 +0,0 @@
|
||||
-#pragma once
|
||||
-
|
||||
-#include "GuiSettings.h"
|
||||
-
|
||||
-class Window;
|
||||
-
|
||||
-class GuiAnalogSticksLedControls : public GuiSettings
|
||||
-{
|
||||
-public:
|
||||
- GuiAnalogSticksLedControls(Window* window);
|
||||
-};
|
||||
Reference in New Issue
Block a user