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

Function size limit #7

Closed
ticpu opened this issue Sep 1, 2013 · 3 comments
Closed

Function size limit #7

ticpu opened this issue Sep 1, 2013 · 3 comments

Comments

@ticpu
Copy link

ticpu commented Sep 1, 2013

1 issue, 1 improvement, 1 question and 1 happy user!

I'm very happy with bitlash, this provides me a shell for Arduino and expands the possibilities by making the Arduino almost a dynamic device which can be re-programmed on the field. The snooze based semi-multitasking is awesome!

1 issue:
I just subscribed to the project and noticed it is alive, which is quite good :) I noticed that the functions are size limited but it seems like a bug because it is neither documented nor an error message is issued when the limit is encountered. I currently own an Arduino compatible SainSmart ATMEGA2560 with W5100 Ethernet Shield. I uploaded the bitlash Web Server example and started using it. If I try to input a function longuer or equal to 60 characters, the function appears as function name {} after issuing ls. Nothing else I could notice, it always does that, whatever the function name is. Shorter functions work perfectly, longuer won't work (do nothing) and appear in "peep" as empty too.

1 improvement:
Maybe it would be nice to indicate in the documentation that to use analog pins in functions they should use higher numbered pin numbers, that took me a while to figure out by myself. For example in for loops and specially in pinmode!!

1 question:
Is it possible to store function in RAM actually? Maybe with a prefix? Or maybe in the main flash in the future?

@billroy
Copy link
Owner

billroy commented Sep 1, 2013

Hello, Jérôme:

Thanks for your note, and your kind words. I will try to answer your questions.

  1. I believe the function size limit you are seeing may be caused by the limit on the maximum length of an input line. But I am puzzled why you are running into problems at 60 characters, since the limit is 120. I will test this later in the morning here. Anyway, you can adjust the size of this buffer, at the cost of available RAM of course, at around line 480 in src/bitlash.h:

    // String value buffer size
    #define STRVALSIZE 120 <-- you can increase this to increase the max function size

  2. Doc improvement is noted and I will include in next revision. If there is a particular place you would suggest the enhancement should live I'd appreciate your thoughts.

  3. Storing functions in RAM would be possible with some coding work, in fact for the Arduino Due which has no EEPROM I have a little simulated EEPROM that lives in RAM. Interested in a project? I take pull requests ;)

Storing functions in flash memory on the AVR devices is difficult since apparently it is quite challenging to write the AVR flash at runtime (as opposed to from the boot loader), so I don't expect that to happen unless someone coughs up a flash-writing library (which I would be happy to discover, if it exists.)

I hope that is helpful and I would be happy to take followup questions.

Kind regards,

-br

On Aug 31, 2013, at 8:04 PM, Jérôme Poulin wrote:

1 issue, 1 improvement, 1 question and 1 happy user!

I'm very happy with bitlash, this provides me a shell for Arduino and expands the possibilities by making the Arduino almost a dynamic device which can be re-programmed on the field. The snooze based semi-multitasking is awesome!

1 issue:
I just subscribed to the project and noticed it is alive, which is quite good :) I noticed that the functions are size limited but it seems like a bug because it is neither documented nor an error message is issued when the limit is encountered. I currently own an Arduino compatible SainSmart ATMEGA2560 with W5100 Ethernet Shield. I uploaded the bitlash Web Server example and started using it. If I try to input a function longuer or equal to 60 characters, the function appears as function name {} after issuing ls. Nothing else I could notice, it always does that, whatever the function name is. Shorter functions work perfectly, longuer won't work (do nothing) and appear in "peep" as empty too.

1 improvement:
Maybe it would be nice to indicate in the documentation that to use analog pins in functions they should use higher numbered pin numbers, that took me a while to figure out by myself. For example in for loops and specially in pinmode!!

1 question:
Is it possible to store function in RAM actually? Maybe with a prefix? Or maybe in the main flash in the future?


Reply to this email directly or view it on GitHub.

@ticpu
Copy link
Author

ticpu commented Sep 2, 2013

Thanks for your fast answer, here is what I found:

  1. The web server sketch effectively has an input limit which is set to 80 by default, which corresponds to the added "function capmvolt " bytes and truncate the rest of the function. I should write something so I get for example "unexpected end of input" when full buffer size is exceeded.
  2. The "Pin Variables" section sounds like a good candidate. Is there any way to submit pull request for the wiki documentation?
  3. Yeah, I could look at the code for the other Arduino and make it possible to use RAM functions be prefixing with an underscore like private functions.

@billroy
Copy link
Owner

billroy commented Sep 9, 2013

Thanks for your comments. Re: pull requests for the wiki, it looks like this is not supported (http://stackoverflow.com/questions/10642928/how-to-pull-request-a-wiki-page-on-github) so I guess you can paste amended text here and I will move it to the wiki. Cheers, -br

@ticpu ticpu closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
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