Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Clean up unused variables from HardwareSerial.cpp #1769
This commit is unfortunately wrong - the result of these variables isn't used, but the side effect of reading the UDR register is that the byte is removed from the FIFO, which is needed. If this line is removed, and a buffer flow occurs, I think that the RX complete interrupt will then continue to occur indefinately...
Assuming that your goal is to silence the compilers warning, you might need to find some other way to keep the read, but get rid of the warning...
Regarding the other variable you are removing, I already have a commit for that in #1711, which will hopefully be merged soon.
Commit updated as promised.
@matthijskooijman - Ah yes, I see what you mean now I've looked more closely at your changes. However (being fairly new to this) I'm not sure what is the correct way to achieve this - should I merge the commits from your PR into this branch?
It's probably best if you put your change(s) on top of my change, instead of merging. To do so, you should fetch my changes and create a local branch containing them:
This puts you on a local branch called "new_branch", containing my changes. Now, add any changes you want (you could cherry-pick them, but IIRC I moved code so much that you'll probably want to redo your change from scratch).
When making a pull-request, it seems you can even tell github to use "refs/pull/1711/head" (i.e. my pullreq) as a base (you'll have to manually enter that string, it's not offered in the list). Not sure what this means for the way the pullrequest is merged (I don't think github can know where the pullrequest should be merged to), but that's something to sort out later (the devs can always just manually pull the commit).