Closed soramame21 closed 7 years ago
I am bit confused with lines a-d above. Could you possible to provide each separately and the behaviour actual/expected? Looking at it, seems like line d should fix what you are seeing but the start of the test sets the outputs to 0 also.
sorry for unclear description. There's 2 ways to fix the issue. 1st way (I called plan A) Just added a while loop at beginning withno line d. I could not observe the loop taking longer time than 100ms actually.
while(ain.read()>0.0f){ //line b, actually the loop only run once on xxxM066
wait(0.1); // plan A : the effective delay is required for xxxM066. 7/12 - ren
}
2nd way (I called plan B) It's the alternative fix of above while loop. line d only is added instead of the while loop.
@mray19027
@soramame21 what platform are you testing this on? This is the first time we've seen this issue.
It may be worth adding a corner case test to catch this. Either way if the platform cannot meet the current testing infrastructure it needs to have a warning on its platform page about limitations on its AnalogIn speed.
@BlackstoneEngineering This is a pre-release platform working with 5v not 3.3v. the ci-test-shield is modified specially, it's quite different from others. I think we may not need to make further investigation on it. I'd like to close this issue. What is your comment or suggestion?
@BlackstoneEngineering I close it now. if it's necessary to go deeper, we can reopen it.
I got a AnalogIn test failure.
Log analysis
TEST_ASSERT_MESSAGE(ain.read() > prev_value,"Analog Input did not increment. Check that you have assigned valid pins in mbed_app.json file")
at 1st loop infor(x = 0; x<5; x++)
in AnalogInput_Test().A. The log with more printf, the failed point is marked by <<****
Fax plan A & B
prev_value
will be a big value > followed ain.read() to hit the TEST_ASSERT_MESSAGE(). but I'm not sure how many targets will have this voltage dropping slow issue. it seems like that the most of targets don't need the 100ms wait to run AnalogIn test case. so I made another fix.B. ci-test-shield\TESTS\API\AnalogIn\AnalogIn.cpp, with fixed code