Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/prelight additions #7

Closed

Conversation

mwls-sean
Copy link

@mwls-sean mwls-sean commented Nov 20, 2023

Added percent brightness support to the SHOW.PRE_LIGHTS param. Existing integer values retain their level of brightness.

@mwls-sean mwls-sean changed the base branch from master to CMCopter-4.4 November 20, 2023 14:50
@CLAassistant
Copy link

CLAassistant commented Nov 20, 2023

CLA assistant check
All committers have signed the CLA.

@@ -353,6 +353,7 @@ const AP_Param::GroupInfo AC_DroneShowManager::var_info[] = {
static DroneShowLEDFactory _rgb_led_factory_singleton;

static bool is_safe_to_change_start_time_in_stage(DroneShowModeStage stage);
static bool are_almost_equal(float a, float b);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler didn't like comparisons of variables to float values. Maybe there is a utility that already provides this?

@ntamas
Copy link
Member

ntamas commented Dec 26, 2023

Judging from the code in AP_Param.cpp, the raw storage format of a parameter in the EEPROM depends on its type. This PR changes the type of the SHOW_PRE_LIGHTS parameter from AP_Int8 to AP_Float so I think that previous values of this parameter saved into EEPROM would not be preserved if we merge this PR and a user upgrades the firmware on a flight controller from an earlier version of the Skybrush firmware to this one.

I'm putting this PR on hold for the time being. If there's considerable interest from the community to merge this feature, drop a message here. In that case, some kind of an upgrade mechanism will have to be provided that re-writes the type of the parameter in the EEPROM from AP_Int8 to AP_Float.

@ntamas
Copy link
Member

ntamas commented Feb 15, 2025

Proposal:

  • Let's keep the type of the parameter as AP_Int8.
  • Values less than 5 remain interpreted as it is now (i.e. bit shifts on the RGB components).
  • Values greater than or equal to 5 but less than or equal to 100 are interpreted as percentages so you can still achieve almost arbitrary scaling of the RGB values.
  • Values greater than 100 are interpreted as 100.

@seankovacs
Copy link

Yea, sorry. I already did this for my own builds. Guess I forgot to push up.

@ntamas
Copy link
Member

ntamas commented Feb 15, 2025

Superseded by 36a3a2c in the CMCopter-4.5 branch. (But thanks for your contribution anyway!).

@ntamas ntamas closed this Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants