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
model01: Use a modified CDC.cpp #7
Conversation
Can you recast this commit as checking in the original file and then checking in your change as a separate commit? |
Sure, will do that in a bit. |
We're going to change this file, so add the original (from arduino-1.8.7, hardware/arduino/avr/cores/arduino/CDC.cpp) before applying our changes. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
At least for OSX, we need to slow down Serial writes. The easiest way to do that is to add a delay after each write, and to accomplish that, the easiest is to modify `CDC.cpp`. Without this, on OSX, we end up writing too fast (and changing the baud rate does not help, no matter in which direction I change), and end up losing data. This is not a great solution. It's not even a solution, but a workaround. But it works for now. Signed-off-by: Gergely Nagy <algernon@keyboard.io>
7085e47
to
7f977da
Compare
Updated |
Having made all communication go through I could redo keyboardio/Kaleidoscope#477 in a way that I'm afraid that unless we figure out the root cause, and can fix that, this delay in |
what about forcing noinline?
… On Nov 23, 2018, at 3:15 AM, Gergely Nagy ***@***.***> wrote:
Having made all communication go through Focus (keyboardio/Kaleidoscope#477), I made an attempt at adding the delay to Focus.send(). That... doesn't scale well, because .send() is inlined. Thus we end up with not calls to Focus.send(), but calls to Serial.print and delay. With my own sketch, this is over 200 bytes extra, and each call to Focus.send() will adds yet another delay call.
I could redo keyboardio/Kaleidoscope#477 in a way that .send does not get inlined, but that will also add significant PROGMEM costs (though less than 200 bytes, but still too much), would use more memory, and would be a little bit slower too.
I'm afraid that unless we figure out the root cause, and can fix that, this delay in CDC is our most efficient bet. :(
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Didn't try yet, will do so later tonight. |
Forced noinline for all This PR is a constant +28 bytes. Seems like we exhausted most other options... :/ |
This makes me really unhappy, especially since it only works for the Model 01 and isn't a general solution. But I'm ok with it being merged for now. I still don't like it. |
We'll figure out something better before 2.0. I... have a couple of ideas, but it will take a while to explore them, and I'd rather not hold up Chrysalis usability on OSX until then. |
At least for OSX, we need to slow down Serial writes. The easiest way to do that is to add a delay after each write, and to accomplish that, the easiest is to modify
CDC.cpp
. Without this, on OSX, we end up writing too fast (and changing the baud rate does not help, no matter in which direction I change), and end up losing data.This is not a great solution. It's not even a solution, but a workaround. But it works for now.