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

fix: TCXO_OPTIONAL featuring SenseCAP Indicator (V1/V2) #5948

Merged
merged 4 commits into from
Jan 27, 2025

Conversation

mverch67
Copy link
Collaborator

@mverch67 mverch67 commented Jan 27, 2025

The macro TCXO_OPTIONAL that is supposed to support run-time evaluation for SX1262 XTAL/TCXO seems broken, it leads to compiler errors when using it. Also the variable tcxoVoltage in main.cpp is set but not used anywhere.

Then there's the issue that SX1262Interface reports SX126x init result -707 but continues without returning an error.

This PR fixes the TCXO_OPTIONAL usage and simplifies the code by:

  • code-cleanup when using SX126X_DIO3_TCXO_VOLTAGE
  • adding a new interface method to SX126xInterface to set tcxoVoltage
  • remove superfluous usage of tcxoVoltage variable in main.cpp and remove externals
  • adding res == RADIOLIB_ERR_SPI_CMD_FAILED to return init() with an error.
    Note: I'd rather like to see using res != RADIOLIB_ERR_NONE here to leave init() whenever any error occurs, but don't know the impact and can't test with all possible devices...

Tested OK with SenseCAP Indicator V1/V2 and promicro XTAL.

@thebentern thebentern merged commit 2d42e1b into master Jan 27, 2025
57 checks passed
@thebentern thebentern deleted the tcxo-optional branch January 27, 2025 20:00
} else {
LOG_INFO("SX1262 init success, XTAL, Vref %f V", tcxoVoltage);
LOG_INFO("SX1262 init success, XTAL, Vref 0.0V");
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically "SX1262 init success using XTAL" on its own would be clearer as there is no reference voltage set when using the XTAL (DIO3 could theoretically be used as an interrupt). 0 is only used to tell RadioLib that the SX126x's DIO3 pin shouldn't be set to output a reference voltage, not explicitly sending 0 V from DIO3.

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