ducalex / retro-go

Retro emulation for the ODROID-GO and other ESP32 devices
GNU General Public License v2.0
489 stars 114 forks source link

Simplify menu by hiding inoperable options #122

Closed tomvanbraeckel closed 3 days ago

tomvanbraeckel commented 1 week ago

Simplify menu by hiding inoperable options, to avoid confusing the users.

On the Fri3D Camp 2022 badge, the backlight is always on, and there is no GPIO LED to show activity, AFAIK. In any case, if a board doesn't have these configured in config.h, then showing a changeable option in the menu for it doesn't make sense.

ducalex commented 1 week ago

The disk LED change is reasonable and I've pushed a commit to make your RG_GPIO_LED check actually work (it was default defined so your check would always fail).

But the backlight one isn't as straightforward because it isn't necessarily controlled by RG_GPIO_LCD_BCKL, so it's not a 100% good indication of the capability...

tomvanbraeckel commented 1 week ago

Ah yes, thanks for catching that. I can confirm the disk LED option is gone now, as well as the backlight option. I've added an additional "defined(AW_TFT_BACKLIGHT)" to cover the qtpy-gamer's backlight configuration.

ducalex commented 6 days ago

I'm not happy with this solution, because future targets might use totally different things to control brightness. In fact, I have unmerged device support that uses /sys/class/backlight/... for example.

I've added a constant. For simplicity we'll assume that if it's undefined or zero it means no backlight, so a short #if RG_SCREEN_BACKLIGHT should correctly fail on both scenarios.

tomvanbraeckel commented 6 days ago

Alright, pushed it!