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

compatibility for arduino ide 1.6.3 #28

Open
Clamari opened this issue Apr 21, 2015 · 3 comments
Open

compatibility for arduino ide 1.6.3 #28

Clamari opened this issue Apr 21, 2015 · 3 comments

Comments

@Clamari
Copy link

Clamari commented Apr 21, 2015

I know that this library can work fine with arduino ide 1.0.6. I need to use the ide 1.6.3 new features but I can't because the lib is not working on this ide version. Can I do something to make the rm04 library or arduino code compatible? in ide1.6.3 I can easily set up a specific serial buffer size greater than 512 bytes but in 1.0.6 you can't or it's not easy to do. Hope somebody can help me. Thanks in advance.

@chunlinhan
Copy link
Owner

Hi Clamari,

I don't have mega2560 on hand now.
Would you mind try my modification to see if it works on IDE 1.6.3?

Here is my modification:
https://drive.google.com/folderview?id=0BwHknyUrLaIUfjNRMGtVVVRqbE03THY5V3Z2alpUWHhVSEYwQUFKYmZ4YmpYWEpnQTRSRms&usp=sharing

@Clamari
Copy link
Author

Clamari commented May 12, 2015

it works!!! thank you very much, i'm testing some examples and all is working normally. I will notify you if I find any problem. Could you tell us what was the code problem?

@chunlinhan
Copy link
Owner

In IDE 1.6.3, the UARTx's ISR will call Serialx's handler method (e.g. Serial1._tx_udr_empty_irq()) and this handler method will use tx/rx buffers (and the head/tail indexes) inside the Serialx object. (the tx/rx buffers (and the head/tail indexes) were declared globally in IDE 1.0.6)
In the original implementation of the AtDrv::serialPort[], it's an array of HardwareSerial objects contains the copy of Serialx objects.
Then, when we call serialPort[0].print(), the data we want to send will be saved in serialPort[0]'s tx buffer and update serialPort[0]'s head index, but the UART1's ISR will only use Serial1's tx buffer.

chunlinhan pushed a commit that referenced this issue May 13, 2015
root cause:
#28 (comment)

Modify code to use pointers to Serial objects to solve this issue.
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