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

adrv9002 ensm improv #504

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

adrv9002 ensm improv #504

wants to merge 5 commits into from

Conversation

nunojsa
Copy link
Contributor

@nunojsa nunojsa commented Sep 6, 2024

PR Description

This PT has a fix for updating the ensm when the port mode is set to pin. But the main feature being added is to allow to control the ensm even when in pin mode (given that the drivers allows us to do that)

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have followed the coding standards and guidelines
  • I have conducted a self-review of my own code changes
  • I have commented new code, particulary complex or unclear areas
  • I have checked in CI output that no new warnings/errors got introduced
  • I have updated documentation accordingly (GitHub Pages, READMEs, etc)

With commit 54efaad ("plugins: adrv9002: constrain RSSI reads") a bug
was introduced for TX ports since we stop checking, in the periodic
update function, the ensm value in case the port is in pin mode.
Therefore the widget was never being updated even if the RF state
changed.

Signed-off-by: Nuno Sa <[email protected]>
@nunojsa
Copy link
Contributor Author

nunojsa commented Sep 6, 2024

I opened the PULL just for speeding review but please don't merge this before I do one last sanity test on real HW...

If some port is in any other state than rf_enabled when the plugin
initialized or a new profile is loaded, we still try to read the RSSI
level which will fail. Hence, just skip that read if not in the proper
state.

Signed-off-by: Nuno Sa <[email protected]>
Change the argument 'ensm' to 'attr_name' as 'ensm' is specific to
plugins like adrv9002. Hence use a generic name.

Signed-off-by: Nuno Sa <[email protected]>
Check, at the plugin initialization, if the port enable mode is set to
pin. If it is, change the ensm widget sensitivity in the same way we do
it in save_port_en().

Signed-off-by: Nuno Sa <[email protected]>
There's now the possibility of still controlling the port RF enable
state mode even if the port mode is set to pin. That's possible in case
the driver is in control of the pin controlling the port. Hence, let's
check if the driver supports that at the plugin initialization and act
accordingly. To check it we do the following:

 1) Move the port to pin mode if in spi mod;.
 2) Change the RF state mode to rf_enabled;
 3) If success, then we allow changing the RF state even in pin mode;

Signed-off-by: Nuno Sa <[email protected]>
@nunojsa
Copy link
Contributor Author

nunojsa commented Sep 11, 2024

v2:

  • Fix wrong condition for checking pin state;
  • Make sure to set the pin in the default state;
  • Move to prime instead of rf_enabled;
  • Also update the widget in case of failure in save_ensm() ;
  • Use gchar instead of plain char
  • New patch for RSSI at init.

(now tested)

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.

1 participant