CT analog avail awareness
This commit is contained in:
parent
439dc7480e
commit
7f82967f84
4 changed files with 12 additions and 9 deletions
|
|
@ -1,13 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
//start definition
|
||||
#define CT_RMS_VOLTAGE 220.0
|
||||
#define CT_PIN_LIGHT_PHASE1 0
|
||||
#define CT_PIN_LIGHT_PHASE2 1
|
||||
#define CT_PIN_SOCKET 2
|
||||
#define CT_PIN_AC_PHASE1 3
|
||||
#define CT_PIN_AC_PHASE2 4
|
||||
#define CT_PIN_AC_PHASE3 5
|
||||
/*
|
||||
tentetive pin mapping
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ void setup()
|
|||
espmega.display->bindClimateCard(&climateCard);
|
||||
ESP_LOGD("ISE OS", "Installing current transformer cards");
|
||||
analogCardAvailable = espmega.installCard(4, &analogCard);
|
||||
if (analogCardAvailable) {
|
||||
if (analogCardAvailable || CT_FORCE_ENABLE) {
|
||||
ESP_LOGV("ISE OS", "Analog card available, installing current transformer cards");
|
||||
espmega.installCard(5, &ct_light_phase1);
|
||||
ct_light_phase1.bindFRAM(&espmega.fram, 5010);
|
||||
|
|
|
|||
10
src/main.hpp
10
src/main.hpp
|
|
@ -22,6 +22,16 @@ SET_LOOP_TASK_STACK_SIZE(32*1024);
|
|||
#define AIR_CONDITIONER_IR_PIN 5
|
||||
#define AIR_CONDITIONER_RMT_CHANNEL RMT_CHANNEL_0
|
||||
|
||||
// CT Configuration
|
||||
#define CT_FORCE_ENABLE false
|
||||
#define CT_RMS_VOLTAGE 220.0
|
||||
#define CT_PIN_LIGHT_PHASE1 0
|
||||
#define CT_PIN_LIGHT_PHASE2 1
|
||||
#define CT_PIN_SOCKET 2
|
||||
#define CT_PIN_AC_PHASE1 3
|
||||
#define CT_PIN_AC_PHASE2 4
|
||||
#define CT_PIN_AC_PHASE3 5
|
||||
|
||||
void handleMqttMessage(char *topic, char *payload);
|
||||
void subscribeToMqttTopics();
|
||||
void handlePageChange(uint8_t page);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue