Skip to content

esp_sccb_transmit_reg_a8v16 transfer length error (AEGHB-1262) #45

@kangyaodong

Description

@kangyaodong

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

esp_err_t esp_sccb_transmit_reg_a8v16(esp_sccb_io_handle_t io_handle, uint8_t reg_addr, uint16_t reg_val)
{
esp_err_t ret = ESP_OK;
ESP_RETURN_ON_FALSE(io_handle, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer");
ESP_RETURN_ON_FALSE(io_handle->transmit_reg_a8v16, ESP_ERR_NOT_SUPPORTED, TAG, "controller driver function not supported");

uint8_t data[3] = {0};
data[0] = reg_addr & 0xff;
data[1] = (reg_val & 0xff00) >> 8;
data[2] = reg_val & 0xff;

ESP_RETURN_ON_ERROR(io_handle->transmit_reg_a8v16(io_handle, data, 3, ESP_SCCB_TRANS_DEALY), TAG, "failed to transmit_reg_a8v16");

return ret;

}

Actual behavior (suspected bug)

esp_err_t esp_sccb_transmit_reg_a8v16(esp_sccb_io_handle_t io_handle, uint8_t reg_addr, uint16_t reg_val)
{
esp_err_t ret = ESP_FAIL;
ESP_RETURN_ON_FALSE(io_handle, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer");
ESP_RETURN_ON_FALSE(io_handle->transmit_reg_a8v16, ESP_ERR_NOT_SUPPORTED, TAG, "controller driver function not supported");

uint8_t data[3] = {0};
data[0] = reg_addr & 0xff;
data[1] = (reg_val & 0xff00) >> 8;
data[2] = reg_val & 0xff;

ESP_RETURN_ON_ERROR(io_handle->transmit_reg_a8v16(io_handle, data, 3, -1), TAG, "failed to transmit_reg_a8v16");
reg_val = __builtin_bswap16(reg_val);
return ret;

}

Error logs or terminal output

Steps to reproduce the behavior

See Error

Project release version

latest

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Linux

Operating system version

Windows 10

Shell

ZSH

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions