From 61433c448e472539343e78ee0a19a6ec16e026ff Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Wed, 5 Dec 2018 20:38:11 +0000 Subject: [PATCH] Deprecate C ds18b20 module (#2581) --- app/modules/ds18b20.c | 3 +++ docs/en/modules/ds18b20.md | 9 ++++++++- lua_modules/ds18b20/README.md | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/modules/ds18b20.c b/app/modules/ds18b20.c index 3a211e3a..fe091581 100644 --- a/app/modules/ds18b20.c +++ b/app/modules/ds18b20.c @@ -67,6 +67,9 @@ static int ds18b20_lua_readoutdone(void); // Setup onewire bus for DS18B20 temperature sensors // Lua: ds18b20.setup(OW_BUS_PIN) static int ds18b20_lua_setup(lua_State *L) { + + platform_print_deprecation_note("ds18b20 C module superseded by Lua implementation", "soon"); + // check ow bus pin value if (!lua_isnumber(L, 1) || lua_isnumber(L, 1) == 0) { return luaL_error(L, "wrong 1-wire pin"); diff --git a/docs/en/modules/ds18b20.md b/docs/en/modules/ds18b20.md index ed15ff78..b95512cf 100644 --- a/docs/en/modules/ds18b20.md +++ b/docs/en/modules/ds18b20.md @@ -3,7 +3,14 @@ | :----- | :-------------------- | :---------- | :------ | | 2017-06-11 | [fetchbot](https://github.com/fetchbot) | [fetchbot](https://github.com/fetchbot) | [ds18b20.c](../../../app/modules/ds18b20.c)| -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. +This module provides access to the DS18B20 1-Wire digital thermometer. + +## Deprecation Notice + +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). +The C implementation is deprecated and will be removed soon; please transition +to Lua code. ## ds18b20.read() 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. diff --git a/lua_modules/ds18b20/README.md b/lua_modules/ds18b20/README.md index deb8a683..6e574846 100644 --- a/lua_modules/ds18b20/README.md +++ b/lua_modules/ds18b20/README.md @@ -1,6 +1,6 @@ # DS18B20 Module -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. +This is a Lua module for the DS18B20 1-Wire digital thermometer. ## Require ```lua