adjust IR behaviour
This commit is contained in:
parent
6a15d99e52
commit
d4604d28c3
4 changed files with 253 additions and 133 deletions
118
src/main.cpp
118
src/main.cpp
|
|
@ -6,15 +6,15 @@
|
|||
***********************************************/
|
||||
|
||||
// Analog Card & Current Transformer Configuration
|
||||
bool analogCardAvailable = false;
|
||||
AnalogCard analogCard = AnalogCard();
|
||||
float voltage = CT_RMS_VOLTAGE;
|
||||
CurrentTransformerCard ct1 = CurrentTransformerCard(&analogCard, 0, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct2 = CurrentTransformerCard(&analogCard, 1, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct3 = CurrentTransformerCard(&analogCard, 2, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct4 = CurrentTransformerCard(&analogCard, 3, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct5 = CurrentTransformerCard(&analogCard, 4, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct6 = CurrentTransformerCard(&analogCard, 5, &voltage, &adc2current, 5000);
|
||||
// bool analogCardAvailable = false;
|
||||
// AnalogCard analogCard = AnalogCard();
|
||||
// float voltage = CT_RMS_VOLTAGE;
|
||||
// CurrentTransformerCard ct1 = CurrentTransformerCard(&analogCard, 0, &voltage, &adc2current, 5000);
|
||||
// CurrentTransformerCard ct2 = CurrentTransformerCard(&analogCard, 1, &voltage, &adc2current, 5000);
|
||||
// CurrentTransformerCard ct3 = CurrentTransformerCard(&analogCard, 2, &voltage, &adc2current, 5000);
|
||||
// CurrentTransformerCard ct4 = CurrentTransformerCard(&analogCard, 3, &voltage, &adc2current, 5000);
|
||||
// CurrentTransformerCard ct5 = CurrentTransformerCard(&analogCard, 4, &voltage, &adc2current, 5000);
|
||||
// CurrentTransformerCard ct6 = CurrentTransformerCard(&analogCard, 5, &voltage, &adc2current, 5000);
|
||||
|
||||
// Remote Variables
|
||||
RemoteVariable pm25_in = RemoteVariable();
|
||||
|
|
@ -165,29 +165,29 @@ void setup()
|
|||
climateCard_daikin.setFRAMAutoSave(true);
|
||||
espmega.display->bindClimateCard(&climateCard_daikin);
|
||||
|
||||
// Current Transformers
|
||||
espmega.installCard(4, &analogCard);
|
||||
// // Current Transformers
|
||||
// espmega.installCard(4, &analogCard);
|
||||
|
||||
espmega.installCard(5, &ct1);
|
||||
ct1.bindFRAM(&espmega.fram, 6000);
|
||||
espmega.iot->registerCard(5);
|
||||
// espmega.installCard(5, &ct1);
|
||||
// ct1.bindFRAM(&espmega.fram, 6000);
|
||||
// espmega.iot->registerCard(5);
|
||||
|
||||
espmega.installCard(6, &ct2);
|
||||
ct2.bindFRAM(&espmega.fram, 6100);
|
||||
espmega.iot->registerCard(6);
|
||||
// espmega.installCard(6, &ct2);
|
||||
// ct2.bindFRAM(&espmega.fram, 6100);
|
||||
// espmega.iot->registerCard(6);
|
||||
|
||||
espmega.installCard(7, &ct3);
|
||||
ct3.bindFRAM(&espmega.fram, 6200);
|
||||
espmega.iot->registerCard(7);
|
||||
espmega.installCard(8, &ct4);
|
||||
ct4.bindFRAM(&espmega.fram, 6300);
|
||||
espmega.iot->registerCard(8);
|
||||
espmega.installCard(9, &ct5);
|
||||
ct5.bindFRAM(&espmega.fram, 6400);
|
||||
espmega.iot->registerCard(9);
|
||||
espmega.installCard(10, &ct6);
|
||||
ct6.bindFRAM(&espmega.fram, 6500);
|
||||
espmega.iot->registerCard(10);
|
||||
// espmega.installCard(7, &ct3);
|
||||
// ct3.bindFRAM(&espmega.fram, 6200);
|
||||
// espmega.iot->registerCard(7);
|
||||
// espmega.installCard(8, &ct4);
|
||||
// ct4.bindFRAM(&espmega.fram, 6300);
|
||||
// espmega.iot->registerCard(8);
|
||||
// espmega.installCard(9, &ct5);
|
||||
// ct5.bindFRAM(&espmega.fram, 6400);
|
||||
// espmega.iot->registerCard(9);
|
||||
// espmega.installCard(10, &ct6);
|
||||
// ct6.bindFRAM(&espmega.fram, 6500);
|
||||
// espmega.iot->registerCard(10);
|
||||
|
||||
// ------------ Climate Cards Initialization Routine ------------
|
||||
ESP_LOGD("ISE OS", "Setting up climate cards");
|
||||
|
|
@ -210,40 +210,40 @@ void setup()
|
|||
// ------------ End Climate Cards Initialization Routine ------------
|
||||
|
||||
// ------------ Current Transformer Cards Initialization Routine ------------
|
||||
ESP_LOGD("ISE OS", "Installing current transformer cards");
|
||||
//ESP_LOGD("ISE OS", "Installing current transformer cards");
|
||||
// First try to install the analog card
|
||||
analogCardAvailable = espmega.installCard(4, &analogCard);
|
||||
//analogCardAvailable = espmega.installCard(4, &analogCard);
|
||||
// If the analog card is available, install the current transformer cards
|
||||
// If the analog card is not available, current transformer cards will not be installed
|
||||
// Unless CT_FORCE_ENABLE is set to true
|
||||
// This is to prevent soft locking the device when the device tries to read from an ADC channel that does not exist
|
||||
if (analogCardAvailable || CT_FORCE_ENABLE)
|
||||
{
|
||||
ESP_LOGV("ISE OS", "Analog card available, installing current transformer cards");
|
||||
espmega.installCard(5, &ct1);
|
||||
ct1.bindFRAM(&espmega.fram, 5010);
|
||||
espmega.installCard(6, &ct2);
|
||||
ct2.bindFRAM(&espmega.fram, 5020);
|
||||
espmega.installCard(7, &ct3);
|
||||
ct3.bindFRAM(&espmega.fram, 5030);
|
||||
espmega.installCard(8, &ct4);
|
||||
ct4.bindFRAM(&espmega.fram, 5040);
|
||||
espmega.installCard(9, &ct5);
|
||||
ct5.bindFRAM(&espmega.fram, 5050);
|
||||
espmega.installCard(10, &ct5);
|
||||
ct6.bindFRAM(&espmega.fram, 5060);
|
||||
espmega.iot->registerCard(5);
|
||||
espmega.iot->registerCard(6);
|
||||
espmega.iot->registerCard(7);
|
||||
espmega.iot->registerCard(8);
|
||||
espmega.iot->registerCard(9);
|
||||
espmega.iot->registerCard(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGE("ISE OS", "Analog card not available, current transformer cards cannot and will not be installed.");
|
||||
}
|
||||
ESP_LOGD("ISE OS", "Registering Current Transformer Cards with IoT Module");
|
||||
// if (analogCardAvailable || CT_FORCE_ENABLE)
|
||||
// {
|
||||
// ESP_LOGV("ISE OS", "Analog card available, installing current transformer cards");
|
||||
// // espmega.installCard(5, &ct1);
|
||||
// // ct1.bindFRAM(&espmega.fram, 5010);
|
||||
// // espmega.installCard(6, &ct2);
|
||||
// // ct2.bindFRAM(&espmega.fram, 5020);
|
||||
// // espmega.installCard(7, &ct3);
|
||||
// // ct3.bindFRAM(&espmega.fram, 5030);
|
||||
// // espmega.installCard(8, &ct4);
|
||||
// // ct4.bindFRAM(&espmega.fram, 5040);
|
||||
// // espmega.installCard(9, &ct5);
|
||||
// // ct5.bindFRAM(&espmega.fram, 5050);
|
||||
// // espmega.installCard(10, &ct5);
|
||||
// // ct6.bindFRAM(&espmega.fram, 5060);
|
||||
// espmega.iot->registerCard(5);
|
||||
// espmega.iot->registerCard(6);
|
||||
// espmega.iot->registerCard(7);
|
||||
// espmega.iot->registerCard(8);
|
||||
// espmega.iot->registerCard(9);
|
||||
// espmega.iot->registerCard(10);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ESP_LOGE("ISE OS", "Analog card not available, current transformer cards cannot and will not be installed.");
|
||||
// }
|
||||
//ESP_LOGD("ISE OS", "Registering Current Transformer Cards with IoT Module")
|
||||
// ------------ End Current Transformer Cards Initialization Routine ------------
|
||||
|
||||
|
||||
|
|
@ -291,7 +291,7 @@ void setup()
|
|||
|
||||
// ------------ External Display Initialization Routine ------------
|
||||
auto bindedGetTime = std::bind(&ESPMegaPRO::getTime, &espmega);
|
||||
iseDisplay.begin(&espmega.inputs, &espmega.outputs, &climateCard_daikin, &climateCard_york, &pm_switch, &pm_fan_speed, &pm_lock, &ac_lock);
|
||||
iseDisplay.begin(&espmega.inputs, &espmega.outputs, &climateCard_daikin, &climateCard_york, &pm_switch, &pm_fan_speed, &pm_lock, &ac_lock, espmega.iot);
|
||||
espmega.iot->registerRelativeMqttCallback(&handleMqttMessage);
|
||||
iseDisplay.registerPageChangeCallback(&handlePageChange);
|
||||
// ------------ End External Display Initialization Routine ------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue