Skip to content

Commit

Permalink
Remove default DS18B20 driver
Browse files Browse the repository at this point in the history
Remove default DS18B20 driver and only support define DS18x20 (#6647)
  • Loading branch information
arendst committed Oct 16, 2019
1 parent ee8bb34 commit fb428a9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 272 deletions.
1 change: 1 addition & 0 deletions sonoff/_changelog.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Add rule support after every command execution like Fanspeed#Data=2 (#6636)
* Fix handling of ligth channels when pwm_multichannel (Option68) is enabled
* Add WebUI for multiple, independent PWM channels
* Remove default DS18B20 driver and only support define DS18x20 (#6647)
*
* 6.6.0.17 20191009
* Add command SetOption34 0..255 to set backlog delay. Default value is 200 (mSeconds) (#6562)
Expand Down
2 changes: 1 addition & 1 deletion sonoff/my_user_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
//#define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices

// -- One wire sensors ----------------------------
#define USE_DS18x20 // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
#define USE_DS18x20 // Add support for DS18x20 sensors with id sort, single scan and read retry (+2k6 code)
// #define W1_PARASITE_POWER // Optimize for parasite powered sensors
// #define DS18B20_INTERNAL_PULLUP // Use INPUT_PULLUP internal pullup resistor

Expand Down
18 changes: 3 additions & 15 deletions sonoff/sonoff_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c

#define USE_COUNTER // Enable counters
#undef USE_ADC_VCC // Add Analog input on selected devices
#define USE_DS18x20 // For more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
#define USE_DS18x20 // Add support for DS18x20 sensors with id sort, single scan and read retry (+1k3 code)

#define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram)
#define USE_SHT // Add I2C emulating code for SHT1X sensor (+1k4 code)
Expand Down Expand Up @@ -364,7 +364,7 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c
#undef USE_TUYA_MCU // Disable support for Tuya Serial MCU
#undef USE_ARMTRONIX_DIMMERS // Disable support for Armtronix Dimmers (+1k4 code)
#undef USE_PS_16_DZ // Disable support for PS-16-DZ Dimmer and Sonoff L1 (+2k code)
#undef USE_DS18x20 // Disable Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
#undef USE_DS18x20 // Disable support for DS18x20 sensors with id sort, single scan and read retry (+1k3 code)

#undef USE_I2C // Disable all I2C sensors
#undef USE_SPI // Disable all SPI devices
Expand Down Expand Up @@ -414,15 +414,6 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c

#endif // FIRMWARE_IR

/*********************************************************************************************\
* Mandatory define for DS18x20 if changed by above image selections
\*********************************************************************************************/

#if defined(USE_DS18x20)
#else
#define USE_DS18B20 // Default DS18B20 sensor needs no external library
#endif

/*********************************************************************************************\
* [sonoff-basic.bin]
* Provide an image without sensors
Expand Down Expand Up @@ -464,7 +455,6 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c

#undef USE_COUNTER // Disable counters
#undef USE_DS18x20 // Disable DS18x20 sensor
#undef USE_DS18B20 // Disable internal DS18B20 sensor
#undef USE_I2C // Disable all I2C sensors and devices
#undef USE_SPI // Disable all SPI devices
#undef USE_DISPLAY // Disable Display support
Expand Down Expand Up @@ -549,7 +539,6 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c

#undef USE_COUNTER // Disable counters
#undef USE_DS18x20 // Disable DS18x20 sensor
#undef USE_DS18B20 // Disable internal DS18B20 sensor
#undef USE_I2C // Disable all I2C sensors and devices
#undef USE_SPI // Disable all SPI devices
#undef USE_DISPLAY // Disable Display support
Expand Down Expand Up @@ -637,9 +626,8 @@ char* ToHex_P(const unsigned char * in, size_t insz, char * out, size_t outsz, c
#endif

#ifndef MESSZ
//#define MESSZ 405 // Max number of characters in JSON message string (6 x DS18x20 sensors)
//#define MESSZ 893 // Max number of characters in JSON message string (Hass discovery and nice MQTT_MAX_PACKET_SIZE = 1000)
#define MESSZ (MQTT_MAX_PACKET_SIZE -TOPSZ -7) // Max number of characters in JSON message string (6 x DS18x20 sensors)
#define MESSZ (MQTT_MAX_PACKET_SIZE -TOPSZ -7) // Max number of characters in JSON message string
#endif

//#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)
Expand Down
6 changes: 5 additions & 1 deletion sonoff/sonoff_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ const uint8_t kGpioNiceList[] PROGMEM = {
GPIO_DHT22, // DHT21, DHT22, AM2301, AM2302, AM2321
GPIO_SI7021, // iTead SI7021
#endif
#if defined(USE_DS18B20) || defined(USE_DS18x20)
#ifdef USE_DS18x20
GPIO_DSB, // Single wire DS18B20 or DS18S20
#endif

Expand Down Expand Up @@ -1363,7 +1363,11 @@ const mytmplt kModules[MAXMODULE] PROGMEM = {
// http://www.wykop.pl/ramka/3325399/diy-supla-do-puszki-instalacyjnej-podtynkowej-supla-org/
0, // GPIO00 Flash jumper
GPIO_USER, // GPIO01 Serial RXD and Optional sensor
#ifdef USE_DS18x20
GPIO_DSB, // GPIO02 DS18B20 sensor
#else
GPIO_USER, // GPIO02 Optional sensor
#endif
GPIO_USER, // GPIO03 Serial TXD and Optional sensor
GPIO_KEY1, // GPIO04 Button 1
GPIO_REL1, // GPIO05 Relay 1 (0 = Off, 1 = On)
Expand Down
4 changes: 2 additions & 2 deletions sonoff/support_features.ino
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ void GetFeatures(void)
feature_sns1 |= 0x00000008; // xnrg_03_pzem004t.ino
#endif
#ifdef USE_DS18B20
feature_sns1 |= 0x00000010; // xsns_05_ds18b20.ino
feature_sns1 |= 0x00000010; // xsns_05_ds18b20.ino - no more support since 6.6.0.18
#endif
#ifdef USE_DS18x20_LEGACY
feature_sns1 |= 0x00000020; // xsns_05_ds18x20_legacy.ino - no more supported since 6.6.0.14
feature_sns1 |= 0x00000020; // xsns_05_ds18x20_legacy.ino - no more support since 6.6.0.14
#endif
#ifdef USE_DS18x20
feature_sns1 |= 0x00000040; // xsns_05_ds18x20.ino
Expand Down
253 changes: 0 additions & 253 deletions sonoff/xsns_05_ds18b20.ino

This file was deleted.

0 comments on commit fb428a9

Please sign in to comment.