Skip to content

Commit 61433c4

Browse files
nwfdevsaurus
authored andcommitted
Deprecate C ds18b20 module (#2581)
1 parent 47a6ed0 commit 61433c4

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

app/modules/ds18b20.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ static int ds18b20_lua_readoutdone(void);
6767
// Setup onewire bus for DS18B20 temperature sensors
6868
// Lua: ds18b20.setup(OW_BUS_PIN)
6969
static int ds18b20_lua_setup(lua_State *L) {
70+
71+
platform_print_deprecation_note("ds18b20 C module superseded by Lua implementation", "soon");
72+
7073
// check ow bus pin value
7174
if (!lua_isnumber(L, 1) || lua_isnumber(L, 1) == 0) {
7275
return luaL_error(L, "wrong 1-wire pin");

docs/en/modules/ds18b20.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
| :----- | :-------------------- | :---------- | :------ |
44
| 2017-06-11 | [fetchbot](https://github.com/fetchbot) | [fetchbot](https://github.com/fetchbot) | [ds18b20.c](../../../app/modules/ds18b20.c)|
55

6-
This module provides access to the DS18B20 1-Wire digital thermometer. Note that NodeMCU offers both a C module (this one) and [a Lua module for this sensor](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_modules/ds18b20). See [#2003](https://github.com/nodemcu/nodemcu-firmware/pull/2003) for a discussion on the respective merits of them.
6+
This module provides access to the DS18B20 1-Wire digital thermometer.
7+
8+
## Deprecation Notice
9+
10+
Note that NodeMCU offers both a C module (this one) and [a Lua module for this
11+
sensor](https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua_modules/ds18b20).
12+
The C implementation is deprecated and will be removed soon; please transition
13+
to Lua code.
714

815
## ds18b20.read()
916
Issues a temperature conversion of all connected sensors on the onewire bus and returns the measurment results after a conversion delay in a callback function.

lua_modules/ds18b20/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DS18B20 Module
22

3-
This is a Lua module for the DS18B20 1-Wire digital thermometer. Note that NodeMCU offers both a Lua module (this one) and [a C module for this sensor](http://nodemcu.readthedocs.io/en/latest/en/modules/ds18b20/). See [#2003](https://github.com/nodemcu/nodemcu-firmware/pull/2003) for a discussion on the respective merits of them.
3+
This is a Lua module for the DS18B20 1-Wire digital thermometer.
44

55
## Require
66
```lua

0 commit comments

Comments
 (0)