fixes for idf 5.x
This commit is contained in:
parent
bc57b32d87
commit
f8b0f34a59
18 changed files with 84 additions and 83 deletions
|
@ -196,21 +196,21 @@ void il3820_init(void)
|
|||
uint8_t tmp[3] = {0};
|
||||
|
||||
/* Initialize non-SPI GPIOs */
|
||||
gpio_pad_select_gpio(IL3820_DC_PIN);
|
||||
gpio_reset_pin(IL3820_DC_PIN);
|
||||
gpio_set_direction(IL3820_DC_PIN, GPIO_MODE_OUTPUT);
|
||||
|
||||
gpio_pad_select_gpio(IL3820_BUSY_PIN);
|
||||
gpio_reset_pin(IL3820_BUSY_PIN);
|
||||
gpio_set_direction(IL3820_BUSY_PIN, GPIO_MODE_INPUT);
|
||||
|
||||
#if IL3820_USE_RST
|
||||
gpio_pad_select_gpio(IL3820_RST_PIN);
|
||||
gpio_reset_pin(IL3820_RST_PIN);
|
||||
gpio_set_direction(IL3820_RST_PIN, GPIO_MODE_OUTPUT);
|
||||
|
||||
/* Harware reset */
|
||||
gpio_set_level( IL3820_RST_PIN, 0);
|
||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_RATE_MS);
|
||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_PERIOD_MS);
|
||||
gpio_set_level( IL3820_RST_PIN, 1);
|
||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_RATE_MS);
|
||||
vTaskDelay(IL3820_RESET_DELAY / portTICK_PERIOD_MS);
|
||||
#endif
|
||||
|
||||
/* Software reset */
|
||||
|
@ -267,14 +267,14 @@ static void il3820_waitbusy(int wait_ms)
|
|||
{
|
||||
int i = 0;
|
||||
|
||||
vTaskDelay(10 / portTICK_RATE_MS); // 10ms delay
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS); // 10ms delay
|
||||
|
||||
for(i = 0; i < (wait_ms * 10); i++) {
|
||||
if(gpio_get_level(IL3820_BUSY_PIN) != IL3820_BUSY_LEVEL) {
|
||||
return;
|
||||
}
|
||||
|
||||
vTaskDelay(10 / portTICK_RATE_MS);
|
||||
vTaskDelay(10 / portTICK_PERIOD_MS);
|
||||
}
|
||||
|
||||
ESP_LOGE( TAG, "busy exceeded %dms", i*10 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue