Closed jerryneedell closed 5 years ago
just to check, did you mpycross before importing and taking the gc memory readings?
@ladyada yes -- both readings were with .mpy file
I tested thsi on a trinket_M0 and on a Raspberry Pi 3B + -- Note: I cannot test the "led" example since I don't have that hardware.
@jerryneedell - thank you!
@tannewt is 500 bytes ok?
I think its fine for now. How about moving it into a private function? That way if I ever do lazy bytecode loading it'll stay out of memory.
Are there plans to add pulseio support to Blinka? We should remove it at that time.
How do I move it to a private function? do you mean create two functions - one for pulseio one for non-pulseio and make them private then call the one wanted for each case? Sorry -- still not fully comfortable in Python...
pulseio for blinka is a long ways away
@jerryneedell yup! and by private I mean named with a starting underscore.
Ok. I’ll try it and post it for your review. Hopefully this weekend.
@tannewt Is this what you are looking for re: private functions?
@tannewt does this need more work?
This replaces PR #14 - it reconciles the changes with the current master with a few additional changes from the original PR from @ladyada 1)Main fix was to correct a bug in the pulseio code that had the relational test for the delay waiting for pulses inverted. This broke the pulseio version -- OK now 2)Attempted to make the non-pulseio more like the pulseio in its treatment of the incoming string of transitions - only use the last 81 transitions received. There are still a lot of errors when running on a Raspberry Pi, but this seems to help a bit - still > 10% failed readings 2) changed timeout waiting for pulses on non-pulseio to .25 sec (was .1) to match pulseio version. No apparent impact.
To look at the memory impact I ran the test code from @brennen to look at gc.mem_free at various points with the new code and with the current master code.
It looks like the new code consumes ~500bytes additional RAM if I am interpreting this correctly. Is that OK?
Here is the same test with the current master - (no RPi code )