drivers/ds18: move to ztimer#21804
Conversation
ad46da8 to
dc2a805
Compare
|
Can you give me a short rundown on how to use the test? The Readme is... not super helpful. How is the Onewire pin set? |
|
The Onewire pin is configured in When you flash the application it shows in endless loop temperature reading each 2 s. |
dc2a805 to
673cce4
Compare
Enoch247
left a comment
There was a problem hiding this comment.
Tested and works on my hardware. Here is how I tested:
diff --git a/tests/drivers/ds18/Makefile b/tests/drivers/ds18/Makefile
index 6ec1631e03..1e3cddba93 100644
--- a/tests/drivers/ds18/Makefile
+++ b/tests/drivers/ds18/Makefile
@@ -2,6 +2,10 @@ include ../Makefile.drivers_common
BOARD_WHITELIST := sensebox_samd21 samr21-xpro nucleo-l152re nucleo-l432kc nucleo-l073rz b-l072z-lrwan arduino-nano
+BOARD = stm32f429i-disc1
+BOARD_WHITELIST += stm32f429i-disc1
+CFLAGS += -DDS18_PARAM_PIN="GPIO_PIN(PORT_C, 0)"
+
USEMODULE += ds18
USEMODULE += ztimer_sec
USEMODULE += printf_float|
Perhaps we can use the opportunity to improve the documentation a bit: diff --git a/tests/drivers/ds18/Readme.md b/tests/drivers/ds18/Readme.md
index 108faa555a..6737dbf9a4 100644
--- a/tests/drivers/ds18/Readme.md
+++ b/tests/drivers/ds18/Readme.md
@@ -1,7 +1,21 @@
## About
-This is a test application for the Maxime [DS18B20](https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf) 1-Wire temperature
-sensor.
+This is a test application for the Maxim
+[DS18B20](https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf)
+1-Wire temperature sensor.
## Usage
-The application will initialize the DS18B20 sensor and every 2 seconds will read
-the temperature and print the measurement to STDOUT.
\ No newline at end of file
+The application will initialize the DS18B20 sensor, read
+the temperature and print the measurement to STDOUT every two seconds.
+
+The default GPIO pin is (0,0), which equates for example to PA0 for STM32s.
+You can change the pin by setting the according CFLAG in the Makefile
+or on the command line:
+
+```shell
+CFLAGS+=-DDS18_PARAM_PIN="GPIO_PIN(PORT_C,0)" BOARD=nucleo-l152re make flash term -j
+```
+
+Please note that only certain boards are tested and therefore whitelisted
+due to the timing requirements of the underlying code.
+If your board is not on that whitelist, you can either extend the list in
+the Makefile. The test might still fail for your specific board though!It would also be nice if you could rename the |
|
|
6d7a89e to
c90b96d
Compare
c90b96d to
aeeebd9
Compare
…timer drivers/ds18: move to ztimer
Enoch247
left a comment
There was a problem hiding this comment.
See my review comments. Just a few nits.
207f39b to
d8dde79
Compare
|
You could have saved your time - |
|
I would like to sum up all information, and agree final solution.
All comments are welcome. If there is no veto - I prepare new version of |
d8dde79 to
56660dd
Compare
|
I commit new version of Murdock is happy. Can we finalize this PR? |
|
Did you intend to squash to a single commit? When I first reviewed this PR, I believe you had broken it into several commits, but now there is only one. |
|
After approval. @crasbe asked me for squashing commits. |
That's fine with me 👍 |
Ahh, ok. Thanks for the clarification. |
Enoch247
left a comment
There was a problem hiding this comment.
Looks good. Thanks for submitting.
Contribution description
This PR moves in the
drivers/ds18andtests/drivers/ds18deprecatedxtimertoztimer.Moreover, it moves licenses to SPDX format.
Testing procedure
I tested working code on
nucleo-f439ziusingtests/drivers/ds18.Observed output, each new reading appears in 2 seconds, when I touched ds18 sensor:
Issues/PRs references
#18560