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

Change detection method for DE versus V2 #54

Open
microenh opened this issue Aug 17, 2023 · 1 comment
Open

Change detection method for DE versus V2 #54

microenh opened this issue Aug 17, 2023 · 1 comment

Comments

@microenh
Copy link

The current method (sbitx.c around line 1231) to detect V2 is to call i2cbb_read_i2c_block_data on the address of the power/swr bridge, which fails if it isn't installed as in the DE.

This call prints an error message to the terminal when it fails. If you instead use i2cbb_read_byte_data, it will also fail if the bridge is missing, but won't print the error message.

@elhandjr
Copy link

Using the i2c read to identify the sbitx version is not a good idea. There are DE mods to add the SWR/Power sensor that would fail this test and assign V2 to a DE relay machine. I suggest removing the test in the settings function and only using the assignment of sbitx_version.

Remove:
//detect the version of sbitx
uint8_t response[4];
if(i2cbb_read_i2c_block_data(0x8, 0, 4, response) == -1)
sbitx_version = SBITX_DE;
else
sbitx_version = SBITX_V2;

Since there are fewer DE sbitx, include a note to change the assignment DE:
int sbitx_version = SBITX_V2;
to
int sbitx_version = SBITX_DE;

And then ./build.

Evan
AC9TU

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

No branches or pull requests

2 participants