Skip to content

Commit

Permalink
change all portTICK_RATE_MS to portTICK_PERIOD_MS
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Nov 8, 2023
1 parent 20de288 commit 3d2f96c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
12 changes: 6 additions & 6 deletions ports/espressif/boards/boards.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,16 @@ void board_init(void)
i2c_master_write_byte(cmd, TCA9554_CONFIGURATION_REG, true);
i2c_master_write_byte(cmd, TCA9554_DEFAULT_CONFIG, true);
i2c_master_stop(cmd);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
vTaskDelay(30 / portTICK_RATE_MS);
vTaskDelay(30 / portTICK_PERIOD_MS);
cmd = i2c_cmd_link_create();
i2c_master_start(cmd);
i2c_master_write_byte(cmd, TCA9554_ADDR << 1 | I2C_MASTER_WRITE, true);
i2c_master_write_byte(cmd, TCA9554_OUTPUT_PORT_REG, true);
i2c_master_write_byte(cmd, TCA9554_DEFAULT_VALUE, true);
i2c_master_stop(cmd);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);

#endif
Expand All @@ -182,7 +182,7 @@ void board_init(void)
i2c_master_write_byte(cmd, AW9523_REG_SOFTRESET, true);
i2c_master_write_byte(cmd, 0, true);
i2c_master_stop(cmd);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);

cmd = i2c_cmd_link_create();
Expand All @@ -192,7 +192,7 @@ void board_init(void)
i2c_master_write_byte(cmd, AW9523_DEFAULT_CONFIG >> 8, true);
i2c_master_write_byte(cmd, AW9523_DEFAULT_CONFIG & 0xff, true);
i2c_master_stop(cmd);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);

cmd = i2c_cmd_link_create();
Expand All @@ -202,7 +202,7 @@ void board_init(void)
i2c_master_write_byte(cmd, AW9523_DEFAULT_OUTPUT >> 8, true);
i2c_master_write_byte(cmd, AW9523_DEFAULT_OUTPUT & 0xff, true);
i2c_master_stop(cmd);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_RATE_MS);
i2c_master_cmd_begin(i2c_num, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
#endif

Expand Down
7 changes: 3 additions & 4 deletions ports/espressif/boards/lilygo_ttgo_t_twr_plus/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int pmu_register_read(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uint8_t l
i2c_master_write_byte(cmd, (devAddr << 1) | WRITE_BIT, ACK_CHECK_EN);
i2c_master_write_byte(cmd, regAddr, ACK_CHECK_EN);
i2c_master_stop(cmd);
esp_err_t ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
esp_err_t ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "PMU i2c_master_cmd_begin FAILED! > ");
Expand All @@ -75,7 +75,7 @@ int pmu_register_read(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uint8_t l
}
i2c_master_read_byte(cmd, &data[len - 1], NACK_VAL);
i2c_master_stop(cmd);
ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "PMU READ FAILED! > ");
Expand All @@ -97,7 +97,7 @@ int pmu_register_write_byte(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uin
i2c_master_write_byte(cmd, regAddr, ACK_CHECK_EN);
i2c_master_write(cmd, data, len, ACK_CHECK_EN);
i2c_master_stop(cmd);
esp_err_t ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
esp_err_t ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "PMU WRITE FAILED! < ");
Expand Down Expand Up @@ -185,4 +185,3 @@ extern "C" bool board_init_extension()

return true;
}

7 changes: 3 additions & 4 deletions ports/espressif/boards/lilygo_ttgo_tbeam_s3/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int pmu_register_read(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uint8_t l
i2c_master_write_byte(cmd, (devAddr << 1) | WRITE_BIT, ACK_CHECK_EN);
i2c_master_write_byte(cmd, regAddr, ACK_CHECK_EN);
i2c_master_stop(cmd);
esp_err_t ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
esp_err_t ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "PMU i2c_master_cmd_begin FAILED! > ");
Expand All @@ -76,7 +76,7 @@ int pmu_register_read(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uint8_t l
}
i2c_master_read_byte(cmd, &data[len - 1], NACK_VAL);
i2c_master_stop(cmd);
ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "PMU READ FAILED! > ");
Expand All @@ -98,7 +98,7 @@ int pmu_register_write_byte(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uin
i2c_master_write_byte(cmd, regAddr, ACK_CHECK_EN);
i2c_master_write(cmd, data, len, ACK_CHECK_EN);
i2c_master_stop(cmd);
esp_err_t ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_RATE_MS);
esp_err_t ret = i2c_master_cmd_begin(I2C_MASTER_NUM, cmd, 1000 / portTICK_PERIOD_MS);
i2c_cmd_link_delete(cmd);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "PMU WRITE FAILED! < ");
Expand Down Expand Up @@ -194,4 +194,3 @@ extern "C" bool board_init_extension()

return true;
}

0 comments on commit 3d2f96c

Please sign in to comment.