mirror of
https://github.com/esphome/esphome.git
synced 2025-10-06 11:53:45 +01:00
@@ -790,7 +790,7 @@ uint8_t Pipsolar::check_incoming_crc_() {
|
||||
// send next command used
|
||||
uint8_t Pipsolar::send_next_command_() {
|
||||
uint16_t crc16;
|
||||
if (this->command_queue_[this->command_queue_position_].length() != 0) {
|
||||
if (!this->command_queue_[this->command_queue_position_].empty()) {
|
||||
const char *command = this->command_queue_[this->command_queue_position_].c_str();
|
||||
uint8_t byte_command[16];
|
||||
uint8_t length = this->command_queue_[this->command_queue_position_].length();
|
||||
@@ -846,7 +846,7 @@ void Pipsolar::queue_command_(const char *command, uint8_t length) {
|
||||
uint8_t next_position = command_queue_position_;
|
||||
for (uint8_t i = 0; i < COMMAND_QUEUE_LENGTH; i++) {
|
||||
uint8_t testposition = (next_position + i) % COMMAND_QUEUE_LENGTH;
|
||||
if (command_queue_[testposition].length() == 0) {
|
||||
if (command_queue_[testposition].empty()) {
|
||||
command_queue_[testposition] = command;
|
||||
ESP_LOGD(TAG, "Command queued successfully: %s with length %u at position %d", command,
|
||||
command_queue_[testposition].length(), testposition);
|
||||
|
Reference in New Issue
Block a user