From 375995e562cdae4429ae83a20044dd8e0420507b Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Fri, 12 Feb 2021 15:24:37 +0100 Subject: [PATCH] added all heater switches --- bsp_q7s/ObjectFactory.cpp | 28 ++++++++++++++++++++++++++++ mission/devices/HeaterHandler.cpp | 18 ++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/ObjectFactory.cpp index 06c1eca5..59c8c817 100644 --- a/bsp_q7s/ObjectFactory.cpp +++ b/bsp_q7s/ObjectFactory.cpp @@ -108,9 +108,37 @@ void ObjectFactory::produce(){ GpioConfig_t gpioConfigHeater0(std::string("gpiochip7"), 18, std::string("Heater0"), Gpio::OUT); gpioCookie->addGpio(gpioIds::HEATER_0, gpioConfigHeater0); + + /* Pin H2-12 on stack connector */ GpioConfig_t gpioConfigHeater1(std::string("gpiochip7"), 14, std::string("Heater1"), Gpio::OUT); gpioCookie->addGpio(gpioIds::HEATER_1, gpioConfigHeater1); + + /* Pin H2-13 on stack connector */ + GpioConfig_t gpioConfigHeater2(std::string("gpiochip7"), 20, + std::string("Heater2"), Gpio::OUT); + gpioCookie->addGpio(gpioIds::HEATER_2, gpioConfigHeater2); + + GpioConfig_t gpioConfigHeater3(std::string("gpiochip7"), 16, + std::string("Heater3"), Gpio::OUT); + gpioCookie->addGpio(gpioIds::HEATER_3, gpioConfigHeater3); + + GpioConfig_t gpioConfigHeater4(std::string("gpiochip7"), 24, + std::string("Heater4"), Gpio::OUT); + gpioCookie->addGpio(gpioIds::HEATER_4, gpioConfigHeater4); + + GpioConfig_t gpioConfigHeater5(std::string("gpiochip7"), 26, + std::string("Heater5"), Gpio::OUT); + gpioCookie->addGpio(gpioIds::HEATER_5, gpioConfigHeater5); + + GpioConfig_t gpioConfigHeater6(std::string("gpiochip7"), 22, + std::string("Heater6"), Gpio::OUT); + gpioCookie->addGpio(gpioIds::HEATER_6, gpioConfigHeater6); + + GpioConfig_t gpioConfigHeater7(std::string("gpiochip7"), 28, + std::string("Heater7"), Gpio::OUT); + gpioCookie->addGpio(gpioIds::HEATER_7, gpioConfigHeater7); + #endif new LinuxLibgpioIF(objects::GPIO_IF); new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER, diff --git a/mission/devices/HeaterHandler.cpp b/mission/devices/HeaterHandler.cpp index b7f03171..aedb4b03 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/mission/devices/HeaterHandler.cpp @@ -311,6 +311,24 @@ gpioId_t HeaterHandler::getGpioIdFromSwitchNr(int switchNr) { case heaterSwitches::HEATER_1: gpioId = gpioIds::HEATER_1; break; + case heaterSwitches::HEATER_2: + gpioId = gpioIds::HEATER_2; + break; + case heaterSwitches::HEATER_3: + gpioId = gpioIds::HEATER_3; + break; + case heaterSwitches::HEATER_4: + gpioId = gpioIds::HEATER_4; + break; + case heaterSwitches::HEATER_5: + gpioId = gpioIds::HEATER_5; + break; + case heaterSwitches::HEATER_6: + gpioId = gpioIds::HEATER_6; + break; + case heaterSwitches::HEATER_7: + gpioId = gpioIds::HEATER_7; + break; default: sif::error << "HeaterHandler::getGpioIdFromSwitchNr: Unknown heater switch number" << std::endl;