kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/i2c_const_function_signature' into 'master'
I2C: add const to signature of master_write function Closes IDFGH-3324 See merge request espressif/esp-idf!9306pull/5688/head
commit
1aabab0160
|
@ -900,7 +900,7 @@ esp_err_t i2c_master_stop(i2c_cmd_handle_t cmd_handle)
|
|||
return i2c_cmd_link_append(cmd_handle, &cmd);
|
||||
}
|
||||
|
||||
esp_err_t i2c_master_write(i2c_cmd_handle_t cmd_handle, uint8_t *data, size_t data_len, bool ack_en)
|
||||
esp_err_t i2c_master_write(i2c_cmd_handle_t cmd_handle, const uint8_t *data, size_t data_len, bool ack_en)
|
||||
{
|
||||
I2C_CHECK((data != NULL), I2C_ADDR_ERROR_STR, ESP_ERR_INVALID_ARG);
|
||||
I2C_CHECK(cmd_handle != NULL, I2C_CMD_LINK_INIT_ERR_STR, ESP_ERR_INVALID_ARG);
|
||||
|
@ -917,7 +917,7 @@ esp_err_t i2c_master_write(i2c_cmd_handle_t cmd_handle, uint8_t *data, size_t da
|
|||
cmd.hw_cmd.ack_val = 0;
|
||||
cmd.hw_cmd.op_code = I2C_CMD_WRITE;
|
||||
cmd.hw_cmd.byte_num = len_tmp;
|
||||
cmd.data = data + data_offset;
|
||||
cmd.data = (uint8_t*) data + data_offset;
|
||||
ret = i2c_cmd_link_append(cmd_handle, &cmd);
|
||||
data_offset += len_tmp;
|
||||
if (ret != ESP_OK) {
|
||||
|
|
|
@ -225,7 +225,7 @@ esp_err_t i2c_master_write_byte(i2c_cmd_handle_t cmd_handle, uint8_t data, bool
|
|||
* - ESP_OK Success
|
||||
* - ESP_ERR_INVALID_ARG Parameter error
|
||||
*/
|
||||
esp_err_t i2c_master_write(i2c_cmd_handle_t cmd_handle, uint8_t *data, size_t data_len, bool ack_en);
|
||||
esp_err_t i2c_master_write(i2c_cmd_handle_t cmd_handle, const uint8_t *data, size_t data_len, bool ack_en);
|
||||
|
||||
/**
|
||||
* @brief Queue command for I2C master to read one byte from I2C bus
|
||||
|
|
Ładowanie…
Reference in New Issue