Skip to content

Commit

Permalink
Fix relay template
Browse files Browse the repository at this point in the history
  • Loading branch information
FredM67 committed Jan 22, 2024
1 parent eef84ea commit 90204aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Mk2_3phase_RFdatalog_temp/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ inline void printConfiguration()
{
DBUGLN(F("is present"));

relayOutput<>::printRelayConfiguration(relay_Output);
relay_Output.printRelayConfiguration();
}
else
{
Expand Down
16 changes: 8 additions & 8 deletions Mk2_3phase_RFdatalog_temp/utils_relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,32 +164,32 @@ template< uint8_t T = 1 > class relayOutput
* @brief Print the configuration of the current relay-diversion
*
*/
static void printRelayConfiguration(const relayOutput& relay)
void printRelayConfiguration() const
{
Serial.println(F("\tRelay configuration:"));

Serial.print(F("\t\tPin is "));
Serial.println(relay.get_pin());
Serial.println(get_pin());

Serial.print(F("\t\tSurplus threshold: "));
Serial.println(relay.get_surplusThreshold());
Serial.println(get_surplusThreshold());

Serial.print(F("\t\tImport threshold: "));
Serial.println(relay.get_importThreshold());
Serial.println(get_importThreshold());

Serial.print(F("\t\tMinimum working time in minutes: "));
Serial.println(relay.get_minON() / 60);
Serial.println(get_minON() / 60);

Serial.print(F("\t\tMinimum stop time in minutes: "));
Serial.println(relay.get_minOFF() / 60);
Serial.println(get_minOFF() / 60);
}

private:
/**
* @brief Turn ON the relay if the 'time' condition is met
*
*/
void try_turnON()
void try_turnON() const
{
if (relayIsON || duration < minOFF)
{
Expand All @@ -208,7 +208,7 @@ template< uint8_t T = 1 > class relayOutput
* @brief Turn OFF the relay if the 'time' condition is met
*
*/
void try_turnOFF()
void try_turnOFF() const
{
if (!relayIsON || duration < minON)
{
Expand Down

0 comments on commit 90204aa

Please sign in to comment.