Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Mar 6, 2025
1 parent 15f9226 commit b05e6a4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/ds18x20/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
/***********************************************************************/
DS18X20Controller::DS18X20Controller() {
num_drivers = 0;
_num_drivers = 0;
_DS18X20_model = new DS18X20Model();
}

Expand All @@ -30,7 +30,7 @@ DS18X20Controller::DS18X20Controller() {
*/
/***********************************************************************/
DS18X20Controller::~DS18X20Controller() {
num_drivers = 0;
_num_drivers = 0;
delete _DS18X20_model;
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/ds18x20/hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ bool DS18X20Hardware::GetSensor() {
int pio_num;
if (_sensor_num < 4) {
// drivers 0 thru 4 are handled by PIO0/SM0..4
new (&_ow) OneWireNg_CurrentPlatform(onewire_pin, false, 0);
new (&_ow) OneWireNg_CurrentPlatform(_onewire_pin, false, 0);
} else if (_sensor_num >= 5) {
// drivers 5 thru 8 are handled by PIO1/SM1..4
new (&_ow) OneWireNg_CurrentPlatform(onewire_pin, false, 1);
new (&_ow) OneWireNg_CurrentPlatform(_onewire_pin, false, 1);
} else {
WS_DEBUG_PRINTLN(
"[ds18x20] ERROR: You may only add up to 8 sensors on RP2040!");
return false;
}
#else
// Initialize the standard bit-banged DS18X20 driver object
new (&_ow) OneWireNg_CurrentPlatform(onewire_pin, false);
new (&_ow) OneWireNg_CurrentPlatform(_onewire_pin, false);
#endif

OneWireNg::ErrorCode ec = _ow->readSingleId(_sensorId);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ds18x20/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "drivers/DSTherm.h"
#include "utils/Placeholder.h"

#ifdef(ARDUINO_ARCH_RP2040)
#if defined(ARDUINO_ARCH_RP2040)
#define CONFIG_RP2040_PIO_DRIVER ///< Enable the OneWireNg_PicoRP2040PIO driver
#define CONFIG_RP2040_PIOSM_NUM_USED \
1 ///< 4 drivers handled by PIO1, 4 drivers handled by PIO2
Expand Down

0 comments on commit b05e6a4

Please sign in to comment.