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

Simple Text Terminal Compatibility #46

Open
AndyLindsay opened this issue Sep 23, 2016 · 1 comment
Open

Simple Text Terminal Compatibility #46

AndyLindsay opened this issue Sep 23, 2016 · 1 comment

Comments

@AndyLindsay
Copy link
Contributor

Please make corrections in the SimpleTextTerminalCompatibility branch.

https://github.com/parallaxinc/Simple-Libraries/tree/SimpleTextTerminalCompatibility

Since this behavior and any change to it may affect many libraries (that use serial drivers), and several terminals, it's going to be important to release one comprehensive repair instead of repeatedly treating the individual symptoms. This in mind, I proposed the approach below. It's not a small project, but it should at least prevent anything from appearing to be completely broken on the next Simple Libraries release.

  • Create a separate branch for developing and testing this (done!).
  • Constants: TERM_NONE = 0, TERM_SIMPLEIDE = 1, TERM_BLOCKLY = 2, TERM_ PST = 3, TERM_BS2 = 4, and others TBD.
  • Add a variable to serial driver structures. For TERM_SIMPLEIDE, if Rx/Tx = 31/30, then simpletext and simpleserial functions will do all the \r -> \n\r character substitutions. Also, simpletext and simpleserial will not make the variable substitutions on any other port. For now, with the other values, it will not make any substitutions.
  • Add a function that can be called to set the value of the variable. Probably void terminalMode(int *simpletext_st serptr, int mode).
  • Find and update all simpletext and simpleserial functions that currently make substitutions to respond correctly to this variable.
  • Test each driver that rely on these functions and modify its code if it is affected. In some cases, the driver structures will have to be updated too. Examples of ones that might need it include ColorPal, GPS, RFID reader, (maybe vgatext here instead), SimpleIDE Terminal (and a wide sampling of existing examples), BlocklyProp terminal, XBee examples, and probably more.
  • Merge the branch
@PropGit
Copy link
Contributor

PropGit commented Sep 26, 2016

I like this approach, all things considered. I think most of the modes defined by the constants will result in the same operation as TERM_NONE, but you're defining it that way to make it very clear to the user how to set it for the intention, right?

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