-
Notifications
You must be signed in to change notification settings - Fork 111
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
v1.2.1: Major rewrite and new features (data download) #54
base: master
Are you sure you want to change the base?
Conversation
- Fixed baudrate method. (SEE NEXT). - Fixed variable type used for parameter (used 2-byte type, it required 4-byte type). - Some minor memory optimizations done.
…r with the desired baud rate you want to establish communications, as additional parameter. Furthermore, comms won't fail while initializing if the FPS baud rate was established to something else than 9600.
- Detect serial overflow, stopping data download and clearing the buffer before resuming activity. - Disabled most debug messages during data download (It will fail pretty much always). - Disabled checksum handling. Arguably useless and slow down the data download, resulting in buffer overflows. Testing some use cases with data download from the FPS (GT-511C3): - 9600 and 19200 baud rates are too slow and will shutdown the FPS. - 38400 works pretty fast and stable. - 57600 also works, but you can't use debug messages and you MUST allocate all CPU time to the task. - 115200 is way too fast and will overflow the buffer immediately. Short summary, the moment you send the command packet to start downloading, you are in a race against the FPS to receive, process and send the data before your serial buffer overflow. A slower baud rate will allow you to allocate less CPU time to the task, but go too slow and the FPS will shutdown (some kind of timeout?).
…tRawImage(). Other changes: - Memory optimizations. - Some minor fixes in other methods. - Tested with GT-511C3: baud rates 38400 and 57600 work pretty well.
- Data overflow warning will only appear when UseDebugSerial is set. - Little memory optimizations. - Renamed a few variables to make the code easier to read.
…wnload enough to be an issue. Fixed some bugs too in the checksum code. Download methods will send 2 more bytes (byte addition checksum) after the data buffer, so you can check if the data is correct in whatever the destination device is.
… the comments in the code.
…Other changes: - Further optimizations. - Checksum enabled again after some testing. - Added a little "patch" for GetImage().
…l do), I implemented a function that allows you to return the template, instead of just simply sending it over Serial. Have fun.
…over 800 bytes in the SRAM). Instead, they are now saved in flash memory.
…ws you to download and return the template without sending it over serial. Other changes: - Further optimizations. - Fixed a few errors with the count of packets needed. - Debug methods won't use too much memory anymore. - A new way to enable or disable debug code. - ReturnData() method that works almost exactly as GetData(), but returning the data instead, allowing you for further data processing.
74ef4cb
to
41e37ca
Compare
bool retval = rp->ACK; | ||
delete rp; | ||
|
||
if (!patched) GetData(52116+6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these numbers for the size of the image? A constant, or comment here would help a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 824 indicates: // Gets an image that is 258x202 (52116 bytes + 2 bytes checksum) and sends it over serial
I'm missing the 4 bytes from the data code, but it's basically 52116 bytes from the image, + 4 bytes of data code and + 2 bytes from the checksum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please how do i implement this updated library for my arduino project
…hod (thanks @JoshHawley for finding this one). (cherry picked from commit aa06925)
c9891de
to
1b1afce
Compare
(cherry picked from commit 2303b53)
…lX() method would be ignored in Arduino code.
Please how i implement this updated library in my arduino project |
I have rewritten most of the code to implement some of the methods that were not implemented, mainly GetImage(), GetRawImage(), GetTemplate() and SetTemplate().
The change list goes like this:
Tested all methods with Arduino Uno and GT-511C3 FPS. Any existing code using this library shouldn't have any problem updating to this version, since the method declarations are mostly unmodified.
If this is accepted, any feedback about other FPS devices, implementations with Arduino, bugs, etc., would be very helpful.