mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 22:24:26 +00:00
Remove unnecessary ellipsis (#8964)
This commit is contained in:
@@ -112,7 +112,7 @@ void WeikaiComponent::loop() {
|
||||
transferred += child->xfer_fifo_to_buffer_();
|
||||
}
|
||||
if (transferred > 0) {
|
||||
ESP_LOGV(TAG, "we transferred %d bytes from fifo to buffer...", transferred);
|
||||
ESP_LOGV(TAG, "transferred %d bytes from fifo to buffer", transferred);
|
||||
}
|
||||
|
||||
#ifdef TEST_COMPONENT
|
||||
@@ -121,8 +121,8 @@ void WeikaiComponent::loop() {
|
||||
uint32_t time = 0;
|
||||
|
||||
if (test_mode_ == 1) { // test component in loopback
|
||||
ESP_LOGI(TAG, "Component loop %" PRIu32 " for %s : %" PRIu32 " ms since last call ...", loop_count++,
|
||||
this->get_name(), millis() - loop_time);
|
||||
ESP_LOGI(TAG, "Component loop %" PRIu32 " for %s : %" PRIu32 " ms since last call", loop_count++, this->get_name(),
|
||||
millis() - loop_time);
|
||||
loop_time = millis();
|
||||
char message[64];
|
||||
elapsed_ms(time); // set time to now
|
||||
@@ -134,14 +134,14 @@ void WeikaiComponent::loop() {
|
||||
uint32_t const start_time = millis();
|
||||
while (children_[i]->tx_fifo_is_not_empty_()) { // wait until buffer empty
|
||||
if (millis() - start_time > 1500) {
|
||||
ESP_LOGE(TAG, "timeout while flushing - %d bytes left in buffer...", children_[i]->tx_in_fifo_());
|
||||
ESP_LOGE(TAG, "timeout while flushing - %d bytes left in buffer", children_[i]->tx_in_fifo_());
|
||||
break;
|
||||
}
|
||||
yield(); // reschedule our thread to avoid blocking
|
||||
}
|
||||
bool status = children_[i]->uart_receive_test_(message);
|
||||
ESP_LOGI(TAG, "Test %s => send/received %u bytes %s - execution time %" PRIu32 " ms...", message,
|
||||
RING_BUFFER_SIZE, status ? "correctly" : "with error", elapsed_ms(time));
|
||||
ESP_LOGI(TAG, "Test %s => send/received %u bytes %s - execution time %" PRIu32 " ms", message, RING_BUFFER_SIZE,
|
||||
status ? "correctly" : "with error", elapsed_ms(time));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,10 +255,10 @@ std::string WeikaiGPIOPin::dump_summary() const {
|
||||
// The WeikaiChannel methods
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void WeikaiChannel::setup_channel() {
|
||||
ESP_LOGCONFIG(TAG, " Setting up UART %s:%s ...", this->parent_->get_name(), this->get_channel_name());
|
||||
ESP_LOGCONFIG(TAG, " Setting up UART %s:%s", this->parent_->get_name(), this->get_channel_name());
|
||||
// we enable transmit and receive on this channel
|
||||
if (this->check_channel_down()) {
|
||||
ESP_LOGCONFIG(TAG, " Error channel %s not working...", this->get_channel_name());
|
||||
ESP_LOGCONFIG(TAG, " Error channel %s not working", this->get_channel_name());
|
||||
}
|
||||
this->reset_fifo_();
|
||||
this->receive_buffer_.clear();
|
||||
@@ -267,7 +267,7 @@ void WeikaiChannel::setup_channel() {
|
||||
}
|
||||
|
||||
void WeikaiChannel::dump_channel() {
|
||||
ESP_LOGCONFIG(TAG, " UART %s ...", this->get_channel_name());
|
||||
ESP_LOGCONFIG(TAG, " UART %s", this->get_channel_name());
|
||||
ESP_LOGCONFIG(TAG, " Baud rate: %" PRIu32 " Bd", this->baud_rate_);
|
||||
ESP_LOGCONFIG(TAG, " Data bits: %u", this->data_bits_);
|
||||
ESP_LOGCONFIG(TAG, " Stop bits: %u", this->stop_bits_);
|
||||
@@ -407,7 +407,7 @@ bool WeikaiChannel::read_array(uint8_t *buffer, size_t length) {
|
||||
bool status = true;
|
||||
auto available = this->receive_buffer_.count();
|
||||
if (length > available) {
|
||||
ESP_LOGW(TAG, "read_array: buffer underflow requested %d bytes only %d bytes available...", length, available);
|
||||
ESP_LOGW(TAG, "read_array: buffer underflow requested %d bytes only %d bytes available", length, available);
|
||||
length = available;
|
||||
status = false;
|
||||
}
|
||||
@@ -422,7 +422,7 @@ bool WeikaiChannel::read_array(uint8_t *buffer, size_t length) {
|
||||
|
||||
void WeikaiChannel::write_array(const uint8_t *buffer, size_t length) {
|
||||
if (length > XFER_MAX_SIZE) {
|
||||
ESP_LOGE(TAG, "Write_array: invalid call - requested %d bytes but max size %d ...", length, XFER_MAX_SIZE);
|
||||
ESP_LOGE(TAG, "Write_array: invalid call - requested %d bytes but max size %d", length, XFER_MAX_SIZE);
|
||||
length = XFER_MAX_SIZE;
|
||||
}
|
||||
this->reg(0).write_fifo(const_cast<uint8_t *>(buffer), length);
|
||||
@@ -432,7 +432,7 @@ void WeikaiChannel::flush() {
|
||||
uint32_t const start_time = millis();
|
||||
while (this->tx_fifo_is_not_empty_()) { // wait until buffer empty
|
||||
if (millis() - start_time > 200) {
|
||||
ESP_LOGW(TAG, "WARNING flush timeout - still %d bytes not sent after 200 ms...", this->tx_in_fifo_());
|
||||
ESP_LOGW(TAG, "WARNING flush timeout - still %d bytes not sent after 200 ms", this->tx_in_fifo_());
|
||||
return;
|
||||
}
|
||||
yield(); // reschedule our thread to avoid blocking
|
||||
@@ -509,7 +509,7 @@ void WeikaiChannel::uart_send_test_(char *message) {
|
||||
this->flush();
|
||||
to_send -= XFER_MAX_SIZE;
|
||||
}
|
||||
ESP_LOGV(TAG, "%s => sent %d bytes - exec time %d µs ...", message, RING_BUFFER_SIZE, micros() - start_exec);
|
||||
ESP_LOGV(TAG, "%s => sent %d bytes - exec time %d µs", message, RING_BUFFER_SIZE, micros() - start_exec);
|
||||
}
|
||||
|
||||
/// @brief test read_array method
|
||||
@@ -526,7 +526,7 @@ bool WeikaiChannel::uart_receive_test_(char *message) {
|
||||
while (XFER_MAX_SIZE > this->available()) {
|
||||
this->xfer_fifo_to_buffer_();
|
||||
if (millis() - start_time > 1500) {
|
||||
ESP_LOGE(TAG, "uart_receive_test_() timeout: only %d bytes received...", this->available());
|
||||
ESP_LOGE(TAG, "uart_receive_test_() timeout: only %d bytes received", this->available());
|
||||
break;
|
||||
}
|
||||
yield(); // reschedule our thread to avoid blocking
|
||||
@@ -538,20 +538,20 @@ bool WeikaiChannel::uart_receive_test_(char *message) {
|
||||
uint8_t peek_value = 0;
|
||||
this->peek_byte(&peek_value);
|
||||
if (peek_value != 0) {
|
||||
ESP_LOGE(TAG, "Peek first byte value error...");
|
||||
ESP_LOGE(TAG, "Peek first byte value error");
|
||||
status = false;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < RING_BUFFER_SIZE; i++) {
|
||||
if (buffer[i] != i % XFER_MAX_SIZE) {
|
||||
ESP_LOGE(TAG, "Read buffer contains error...b=%x i=%x", buffer[i], i % XFER_MAX_SIZE);
|
||||
ESP_LOGE(TAG, "Read buffer contains error b=%x i=%x", buffer[i], i % XFER_MAX_SIZE);
|
||||
print_buffer(buffer);
|
||||
status = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ESP_LOGV(TAG, "%s => received %d bytes status %s - exec time %d µs ...", message, received, status ? "OK" : "ERROR",
|
||||
ESP_LOGV(TAG, "%s => received %d bytes status %s - exec time %d µs", message, received, status ? "OK" : "ERROR",
|
||||
micros() - start_exec);
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user