I tend to try my best to ask a specific question to a specific problem, but I don't think I can do that in this case.. I am trying to port over this QR encoding library: Github. I know there is qduino, but it is inefficient and uses malloc which I am trying to avoid.
I am modifying the library to be very specific. Create a QR code version 1, with M error correction, numeric, with 34 digits. I have shrunk down the library considerably, and when I throw it in arduino IDE, I am only at 11% SRAM.
If I run it as is with an arduino, it runs fine, but outputs an invalid QR code. If I try to debug it within the method "qrcodegen_encodeText()" using Serial monitor, I get a lot of garbage values, unless I add delays to slow it down.
All and all it is just really inconsistent, which is what is leading me to believe that I am still way off on my memory usage. But, I don't see anything that could be using up so much SRAM dynamically.
Could anyone please take a quick peek and let me know if I am missing something? I've been staring at this for a while, so it could be obvious.
Thank you so much
My modified code: Code