-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add support for the ESP8266 env. Fix headers in readme. #57
Conversation
- PROGMEM doesn't really make sense in ESP land. - Sprinkle yield()s in likely spots to reduce the Watch Dog timer firing. This happened regularly on the advanced.ino example. [Tested using basic.ino & advanced.ino. They seem to run as expected.]
A white space is needed after '#' headings for them to work. Fixed malformed headings.
Sorry I have not looked at this sooner. I don't see how the changes can break the standard arduino platforms, but I cant test these on the ESP. Are you willing to support the ESP changes going forward? If so, merging seems like a good idea. |
I'm not going to offer great support, but I can but try.
…On Fri., 28 Jul. 2017, 12:41 am Warren MacEvoy, ***@***.***> wrote:
Sorry I have not looked at this sooner. I don't see how the changes can
break the standard arduino platforms, but I cant test these on the ESP. Are
you willing to support the ESP changes going forward? If so, merging seems
like a good idea.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMInDEV3vWteycJ-swVWodZhM9_KD3Bdks5sSKGXgaJpZM4NTmRH>
.
|
Ok I have looked more carefully at your code. If yeilds are necessary frequently I think there are better places for it. Instead of adding yeild inside the isLess functions (there are a lot of them, and these have grown in other branches), define the assertOp to have the yeild instead, this is more generic and covers all the other cases. Similarly, instead of placing the yeild in resolve, put it after line 234 in the run() method, which calls the others. Can you please see if this works? If it does it should be easier to maintain. |
SGTM, I'll take a look later. |
On second thought; maybe just strip the yield method. Having it part of every assert makes testing the watchdog hard on that platform, but add a section suggesting a yield at the end of every test. Turning off testing should have as few side effects as possible. |
1 similar comment
On second thought; maybe just strip the yield method. Having it part of every assert makes testing the watchdog hard on that platform, but add a section suggesting a yield at the end of every test. Turning off testing should have as few side effects as possible. |
I see your point, but that's a fairly a-typical use case. It would be by far a less likely use case. In another OS etc, you wouldn't expect to be feeding the OS watch dog etc in a unit test. Given the nature of these AVR-esque devices, we effectively are the OS. If you wanted to test the watchdog, you could construct a test-case such that it waits the appropriate time without feeding it (e.g. 1 sec, without deliberate feeding, delay()s, or yield()s) So, its easy to still test for it. Given the watchdog causes a device reset, it's kind of out of the scope of a simple unit test. i.e. You are not likely to catch it in an exception etc. Perhaps a better approach would be to have it configurable. Defaulting to feeding it, as that's the desired and expected case. However, I think that is unnecessary. For a typical use case/example: Assume the watchdog causes a reset/reboot after 1 sec (1000ms) of no feeding. If I'm testing a function, that takes say 100ms to finish. And I happen to call it 10+ times in a unit test I'm not really testing if the an individual instance of a function call itself exceeds the watch dog timer (WDT). I'm not thinking about it if I have a number of asserts in my unit tests etc. Having people code around a property of the OS in a unit test is just yuck IMHO. Especially as it is the majority use case. |
Ok this has an alternate merge #58 with an arguably partly more correct solution and supports another board. It does not add yield and there is a philosophy problem there, which is why this has taken a long time to resolve. I think there should be a yield between tests, since AU has control over running multiple tests the user cannot easily influence. But adding yields at every assert I think breaks orthogonality; something you think passes a tests actually does not work on the tested platform because it takes too long to perform. Between this, #58 and these ideas I think there is a good update. |
Should this line: |
@ssilverman I think you are correct. It's was too long ago for me to remember why it was outside of that block in the first place. Probably human error. Moved. |
Ok, branch iss58 includes, I think, the changes to support ESP 8266 and ESP 32. Can someone please verify that? I don't have these boards. |
iss58 changes the way these are implemented: Compare.h is auto-generated (in meta), and so I edited the generator for Compare instead. And since |
@crankyoldgit, @ssilverman : a version of this has been pulled into the v2.3.X-alpha next release. That version adds a single yield after every test called in the loop. I hope this is a reasonable compromise. |
Initial support for the ESP8266 env.:
This happened regularly on the advanced.ino example.
That is, the ESP module will fire the software Watch Dog timer if it isn't fed approximately ever second or so. delay(), wdt_reset(), or yield()'s will feed it.
Fixes #55
readme.md:
[Tested using basic.ino & advanced.ino. They seem to run as expected.]