Revert "Revert "add resistive frequency sensor, updated dependencies""

This reverts commit 42ce4cdda2.
This commit is contained in:
Empire
2023-02-12 12:51:52 +01:00
parent 42ce4cdda2
commit 3835bd96a1
8 changed files with 27 additions and 45 deletions

View File

@@ -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);