CT analog avail awareness
This commit is contained in:
parent
439dc7480e
commit
7f82967f84
4 changed files with 12 additions and 9 deletions
|
|
@ -12,6 +12,6 @@
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
board = wt32-eth01
|
board = wt32-eth01
|
||||||
framework = arduino
|
framework = arduino
|
||||||
lib_deps = siwats/ESPMegaPROR3@^2.3.7
|
lib_deps = siwats/ESPMegaPROR3@^2.3.8
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
build_flags = -DCORE_DEBUG_LEVEL=5
|
build_flags = -DCORE_DEBUG_LEVEL=5
|
||||||
|
|
@ -1,13 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//start definition
|
//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
|
tentetive pin mapping
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ void setup()
|
||||||
espmega.display->bindClimateCard(&climateCard);
|
espmega.display->bindClimateCard(&climateCard);
|
||||||
ESP_LOGD("ISE OS", "Installing current transformer cards");
|
ESP_LOGD("ISE OS", "Installing current transformer cards");
|
||||||
analogCardAvailable = espmega.installCard(4, &analogCard);
|
analogCardAvailable = espmega.installCard(4, &analogCard);
|
||||||
if (analogCardAvailable) {
|
if (analogCardAvailable || CT_FORCE_ENABLE) {
|
||||||
ESP_LOGV("ISE OS", "Analog card available, installing current transformer cards");
|
ESP_LOGV("ISE OS", "Analog card available, installing current transformer cards");
|
||||||
espmega.installCard(5, &ct_light_phase1);
|
espmega.installCard(5, &ct_light_phase1);
|
||||||
ct_light_phase1.bindFRAM(&espmega.fram, 5010);
|
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_IR_PIN 5
|
||||||
#define AIR_CONDITIONER_RMT_CHANNEL RMT_CHANNEL_0
|
#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 handleMqttMessage(char *topic, char *payload);
|
||||||
void subscribeToMqttTopics();
|
void subscribeToMqttTopics();
|
||||||
void handlePageChange(uint8_t page);
|
void handlePageChange(uint8_t page);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue