mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
code cleanup
This commit is contained in:
@@ -41,7 +41,7 @@ using uuid::log::Level;
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
||||||
#define LOG_DEBUG(...) if (logger_.enabled(Level::DEBUG)) {logger_.debug(__VA_ARGS__);}
|
#define LOG_DEBUG(...) logger_.debug(__VA_ARGS__)
|
||||||
#define LOG_INFO(...) logger_.info(__VA_ARGS__)
|
#define LOG_INFO(...) logger_.info(__VA_ARGS__)
|
||||||
#define LOG_TRACE(...) logger_.trace(__VA_ARGS__)
|
#define LOG_TRACE(...) logger_.trace(__VA_ARGS__)
|
||||||
#define LOG_NOTICE(...) logger_.notice(__VA_ARGS__)
|
#define LOG_NOTICE(...) logger_.notice(__VA_ARGS__)
|
||||||
@@ -51,7 +51,6 @@ using uuid::log::Level;
|
|||||||
#define MAKE_PSTR(string_name, string_literal) static const char __pstr__##string_name[] __attribute__((__aligned__(sizeof(int)))) PROGMEM = string_literal;
|
#define MAKE_PSTR(string_name, string_literal) static const char __pstr__##string_name[] __attribute__((__aligned__(sizeof(int)))) PROGMEM = string_literal;
|
||||||
#define MAKE_PSTR_WORD(string_name) MAKE_PSTR(string_name, #string_name)
|
#define MAKE_PSTR_WORD(string_name) MAKE_PSTR(string_name, #string_name)
|
||||||
#define F_(string_name) FPSTR(__pstr__##string_name)
|
#define F_(string_name) FPSTR(__pstr__##string_name)
|
||||||
#define NO_ARGUMENTS std::vector<std::string>{}
|
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
|||||||
@@ -466,8 +466,6 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) {
|
|||||||
tx_telegram.id_,
|
tx_telegram.id_,
|
||||||
telegram->to_string(telegram_raw, length).c_str());
|
telegram->to_string(telegram_raw, length).c_str());
|
||||||
|
|
||||||
// send the telegram to the UART Tx
|
|
||||||
uint16_t status = EMSuart::transmit(telegram_raw, length);
|
|
||||||
#ifdef EMSESP_DEBUG
|
#ifdef EMSESP_DEBUG
|
||||||
// if watching in 'raw' mode
|
// if watching in 'raw' mode
|
||||||
if (EMSESP::watch() == 2) {
|
if (EMSESP::watch() == 2) {
|
||||||
@@ -475,6 +473,9 @@ void TxService::send_telegram(const QueuedTxTelegram & tx_telegram) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// send the telegram to the UART Tx
|
||||||
|
uint16_t status = EMSuart::transmit(telegram_raw, length);
|
||||||
|
|
||||||
if (status == EMS_TX_STATUS_ERR) {
|
if (status == EMS_TX_STATUS_ERR) {
|
||||||
LOG_ERROR(F("Failed to transmit Tx via UART."));
|
LOG_ERROR(F("Failed to transmit Tx via UART."));
|
||||||
increment_telegram_fail_count(); // another Tx fail
|
increment_telegram_fail_count(); // another Tx fail
|
||||||
@@ -616,7 +617,6 @@ void TxService::remember_tx(const uint8_t * data, const uint8_t length) {
|
|||||||
if (ems_mask() != EMS_MASK_UNSET) {
|
if (ems_mask() != EMS_MASK_UNSET) {
|
||||||
telegram_last_[0] ^= ems_mask();
|
telegram_last_[0] ^= ems_mask();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// add last Tx to tx queue and increment count
|
// add last Tx to tx queue and increment count
|
||||||
|
|||||||
Reference in New Issue
Block a user