Skip to content
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

Fix/gen3 fix no fixture unit test #1694

Merged
merged 3 commits into from Mar 6, 2019

Conversation

@YutingYou
Copy link
Contributor

commented Feb 13, 2019

Problem

This PR is additional fixes for some issue in [Gen 3] Fix on-device unit tests

GPIO_05, GPIO_06 take too long and eventually fail.

This is because PWM function is not available on D1 pin, use D2 instead

GPIO_08 expects HAL_ADC_Read() to change the pin mode to AN_INPUT.

AN_INPUT is only for Gen2 device

LED_11 fails to validate the state of the RGB LED (possibly, due to HAL_Led_Rgb_Get_Max_Value() returning a value that doesn't work well with the test logic).

A7 is not available on Gen3 device and HAL_Led_Rgb_Get_Max_Value() is fixed in mirror button and led

Solution

N/A

Steps to Test

user/tests/wiring/no_fixture

wait until mirror button and led merged

References

[CH28410]


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

  • [Internal] [Mesh] Fixes TEST=wiring/no_fixture #1694

@YutingYou YutingYou requested a review from sergeuz Feb 13, 2019

@sergeuz

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

AN_INPUT is only for Gen2 device

Should we rework the test, or mixing analogRead() and digitalRead() without reconfiguring the pin is not supported on gen 3 devices?

@YutingYou

This comment has been minimized.

Copy link
Contributor Author

commented Feb 14, 2019

For Gen3 device, analogRead() and digitalRead() can work concurrently without changing pin mode. So this test case is not needed on Gen3 device.

@sergeuz

This comment has been minimized.

Copy link
Member

commented Feb 14, 2019

For Gen3 device, analogRead() and digitalRead() can work concurrently without changing pin mode. So this test case is not needed on Gen3 device.

That's exactly what the test attempts to verify though

@YutingYou

This comment has been minimized.

Copy link
Contributor Author

commented Feb 15, 2019

The GPIO hardware structure is different on Gen2 and Gen3 device.

On Gen2 device, in analogRead(), the driver saves current pin mode and configure the pin mode to AN_INPUT to read analog value. Then in digitalRead(), the driver restores pin mode to read digital value. Because there is the pin mode transform operation, the unit test wants to make sure the save/restore operation is correct.

But on Gen3 device, even if you configure it to OUTPUT mode, we can read the analog value. we don't need the save/restore pin mode operation.

@avtolstoy avtolstoy self-requested a review Mar 4, 2019

@YutingYou YutingYou force-pushed the fix/gen3-fix-no-fixture-unit-test branch from 1582a99 to 09855f4 Mar 5, 2019

@avtolstoy avtolstoy dismissed stale reviews from sergeuz and themself via 09855f4 Mar 5, 2019

@avtolstoy avtolstoy changed the base branch from mesh-develop to develop Mar 5, 2019

@avtolstoy avtolstoy force-pushed the fix/gen3-fix-no-fixture-unit-test branch from 09855f4 to 41bac7c Mar 6, 2019

@avtolstoy avtolstoy merged commit 7df1667 into develop Mar 6, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@avtolstoy avtolstoy deleted the fix/gen3-fix-no-fixture-unit-test branch Mar 6, 2019

@technobly technobly added this to the 1.0.2-rc.1 milestone Mar 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.