Revert "Revert "add resistive frequency sensor, updated dependencies""
This reverts commit 42ce4cdda2.
This commit is contained in:
@@ -23,7 +23,6 @@ Plant::Plant(int pinSensor, int pinPump, int plantId, HomieNode *plant, PlantSet
|
||||
this->mSetting = setting;
|
||||
this->mPlantId = plantId;
|
||||
this->mSensorMode = mode;
|
||||
this->sht20 = SHT2x();
|
||||
}
|
||||
|
||||
void Plant::init(void)
|
||||
@@ -65,7 +64,7 @@ void Plant::initSensors(void)
|
||||
{
|
||||
switch (getSensorMode())
|
||||
{
|
||||
case CAPACITIVE_FREQUENCY:
|
||||
case FREQUENCY_MOD_RESISTANCE_PROBE:
|
||||
{
|
||||
|
||||
pcnt_unit_t unit = (pcnt_unit_t)(PCNT_UNIT_0 + this->mPlantId);
|
||||
@@ -112,7 +111,7 @@ void Plant::blockingMoistureMeasurement(void)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CAPACITIVE_FREQUENCY:
|
||||
case FREQUENCY_MOD_RESISTANCE_PROBE:
|
||||
case NONE:
|
||||
{
|
||||
// nothing to do here
|
||||
@@ -125,7 +124,7 @@ void Plant::startMoistureMeasurement(void)
|
||||
{
|
||||
switch (getSensorMode())
|
||||
{
|
||||
case CAPACITIVE_FREQUENCY:
|
||||
case FREQUENCY_MOD_RESISTANCE_PROBE:
|
||||
{
|
||||
pcnt_unit_t unit = (pcnt_unit_t)(PCNT_UNIT_0 + this->mPlantId);
|
||||
pcnt_counter_resume(unit);
|
||||
@@ -143,7 +142,7 @@ void Plant::stopMoistureMeasurement(void)
|
||||
{
|
||||
switch (getSensorMode())
|
||||
{
|
||||
case CAPACITIVE_FREQUENCY:
|
||||
case FREQUENCY_MOD_RESISTANCE_PROBE:
|
||||
{
|
||||
int16_t pulses;
|
||||
pcnt_unit_t unit = (pcnt_unit_t)(PCNT_UNIT_0 + this->mPlantId);
|
||||
|
||||
Reference in New Issue
Block a user