diff --git a/chip/zgpio.cpp b/chip/zgpio.cpp index fe0ed54..4167f11 100644 --- a/chip/zgpio.cpp +++ b/chip/zgpio.cpp @@ -313,7 +313,7 @@ bool ZGPIO::getState() { bool ZGPIO::setState(bool state) { if (m_mirror) state = !state; - if (m_log_when_setstate) ZEARLY_LOGI(TAG, "%s:%s set %d", chip_gpio_group_get_name(m_gpio), chip_pinoff_get_name(m_pinoff), state); + if (m_log_when_setstate) ZEARLY_LOGI(TAG, "%s%s set %d", chip_gpio_group_get_name(m_gpio), chip_pinoff_get_name(m_pinoff), state); if (state) { HAL_GPIO_WritePin(m_gpio, m_pinoff, GPIO_PIN_SET); } else { diff --git a/components/sensors/mcp41xxx/mcp41xxx.cpp b/components/sensors/mcp41xxx/mcp41xxx.cpp index 9248bed..1b685b3 100644 --- a/components/sensors/mcp41xxx/mcp41xxx.cpp +++ b/components/sensors/mcp41xxx/mcp41xxx.cpp @@ -35,15 +35,15 @@ void MCP41XXX::initialize(hardware_config_t* hardwareconfig) { // } void MCP41XXX::setPotentiometerValue_0(uint8_t value) { - ZLOGI(TAG, " %s set ohm0 %d", m_hardwareconfig.mark, value); + ZLOGI(TAG, " set ohm0 %s %d", m_hardwareconfig.mark, value); sendValue(POTENTIOMETER_ONE, value); } void MCP41XXX::setPotentiometerValue_1(uint8_t value) { - ZLOGI(TAG, " %s set ohm1 %d", m_hardwareconfig.mark, value); + ZLOGI(TAG, " set ohm1 %s %d", m_hardwareconfig.mark, value); sendValue(POTENTIOMETER_TWO, value); } void MCP41XXX::setPotentiometerValue_both(uint8_t value) { - ZLOGI(TAG, " %s set ohm0&1 %d", m_hardwareconfig.mark, value); + ZLOGI(TAG, " set ohm0&1 %s %d", m_hardwareconfig.mark, value); sendValue(POTENTIOMETER_BOTH, value); } void MCP41XXX::spi_send(uint8_t* data, int32_t len) { diff --git a/components/sensors/mcp41xxx/mcp41xxx.hpp b/components/sensors/mcp41xxx/mcp41xxx.hpp index aedde6d..6674222 100644 --- a/components/sensors/mcp41xxx/mcp41xxx.hpp +++ b/components/sensors/mcp41xxx/mcp41xxx.hpp @@ -14,6 +14,7 @@ class MCP41XXX { Pin_t nshdn; Pin_t nrs; const char* mark; + bool log_when_set; } hardware_config_t; private: diff --git a/components/zprotocols/zcancmder_v2 b/components/zprotocols/zcancmder_v2 index f295d11..ca6ac3e 160000 --- a/components/zprotocols/zcancmder_v2 +++ b/components/zprotocols/zcancmder_v2 @@ -1 +1 @@ -Subproject commit f295d111c4dd63201d1b02bad7465c1946b93a98 +Subproject commit ca6ac3ed8ad4f5d4c40fda1d467c31be176347fa diff --git a/os/zoslogger.hpp b/os/zoslogger.hpp index 8019ecb..55027e0 100644 --- a/os/zoslogger.hpp +++ b/os/zoslogger.hpp @@ -15,25 +15,25 @@ extern bool g_enable_log; } #define ZLOGI(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu INFO [%-8s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu INFO [%-10s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZLOGI_NOT_END_LINE(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu INFO [%-8s] " fmt "", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu INFO [%-10s] " fmt "", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZLOGD(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu DEBU [%-8s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu DEBU [%-10s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZLOGE(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu ERRO [%-8s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu ERRO [%-10s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZLOGW(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu WARN [%-8s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu WARN [%-10s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZASSERT(cond) \