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

Receive may not change data #56

Open
cosmicfrogpt opened this issue Oct 4, 2020 · 2 comments
Open

Receive may not change data #56

cosmicfrogpt opened this issue Oct 4, 2020 · 2 comments

Comments

@cosmicfrogpt
Copy link

Hello, thank you for your code. It was very useful for some experiments with Conrad TX-01 temperature sensor although i had to make some changes)

I found that the receive code can sometimes not change the output data.

The bug is that the variable rx_curByte is incrementend correctly in the AddManBit function but only initialized on the program start.

It must be reseted when a complete receive is completed.

the following code resolves the problem (in the ISR):

...
if ((rx_sample == 1) &&
(rx_curByte >= rx_maxBytes))
{
rx_mode = RX_MODE_MSG;

		//get ready for next receive !
		rx_curByte = 0;
		rx_manBits=0;
        
      }
      else

...

@darkmetalman
Copy link

Hello! Which lines did you changed?

@cosmicfrogpt
Copy link
Author

Hello! Which lines did you changed?

Hello, in my last experiments I changed this function(initialize lines):

MANRX_BeginReceiveBytes(uint8_t maxBytes, uint8_t *data)
{
rx_curByte = 0;//initialize
rx_numMB=0;//initialize

rx_manBits=0;

rx_maxBytes = maxBytes;
rx_data = data;
rx_mode = RX_MODE_PRE;
}

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