diff --git a/src/temp.cpp b/src/temp.cpp index 8d89547..43bd8c7 100644 --- a/src/temp.cpp +++ b/src/temp.cpp @@ -1,9 +1,9 @@ #include #include #include +#include #include #include - /* 1 = enable verbose diagnostics (per-second channel dump). */ #ifndef APP_DEBUG_PRINT #define APP_DEBUG_PRINT 0 @@ -48,7 +48,7 @@ static void OnSendTick(struct k_work *work) { Com::SendTemp(r.value().second); } #if APP_DEBUG_PRINT - static uint32_t s_send_tick; /* diag: send counter, ~1s cadence */ + static uint32_t s_send_tick; /* diag: send counter, ~1s cadence */ if (++s_send_tick % 50 == 0) { /* every ~1 s */ const auto all = Infrared::GetAllSensorValues(); printk("[%s]diag tick=%u mask=0x%02X val:", MODULE, (unsigned)s_send_tick, @@ -63,7 +63,14 @@ static void OnSendTick(struct k_work *work) { } } // namespace +#define ZEPHYR_USER_NODE DT_PATH(zephyr_user) +auto InitEnblePins() { + const gpio_dt_spec en_pin = GPIO_DT_SPEC_GET(ZEPHYR_USER_NODE, en_ir_gpios); + gpio_pin_configure_dt(&en_pin, GPIO_OUTPUT_ACTIVE); +} + static auto Init() -> int { + InitEnblePins(); printk("[%s]temp init\n", MODULE); if (auto r = Infrared::Init(); r.code_id() != zpp::error_code::k_ok) { printk("[%s] Infrared::Init failed: %d\n", MODULE,