Merge branch 'feature/bootloader_pin_level_pr7089' into 'master'
bootloader: Add configurable pin level for factory reset (PR) Closes IDFGH-5337 See merge request espressif/esp-idf!13956
This commit is contained in:
@@ -40,6 +40,11 @@
|
||||
static const char* TAG = "boot_comm";
|
||||
|
||||
esp_comm_gpio_hold_t bootloader_common_check_long_hold_gpio(uint32_t num_pin, uint32_t delay_sec)
|
||||
{
|
||||
return bootloader_common_check_long_hold_gpio_level(num_pin, delay_sec, false);
|
||||
}
|
||||
|
||||
esp_comm_gpio_hold_t bootloader_common_check_long_hold_gpio_level(uint32_t num_pin, uint32_t delay_sec, bool level)
|
||||
{
|
||||
esp_rom_gpio_pad_select_gpio(num_pin);
|
||||
if (GPIO_PIN_MUX_REG[num_pin]) {
|
||||
@@ -47,11 +52,11 @@ esp_comm_gpio_hold_t bootloader_common_check_long_hold_gpio(uint32_t num_pin, ui
|
||||
}
|
||||
esp_rom_gpio_pad_pullup_only(num_pin);
|
||||
uint32_t tm_start = esp_log_early_timestamp();
|
||||
if (gpio_ll_get_level(&GPIO, num_pin) == 1) {
|
||||
if (gpio_ll_get_level(&GPIO, num_pin) != level) {
|
||||
return GPIO_NOT_HOLD;
|
||||
}
|
||||
do {
|
||||
if (gpio_ll_get_level(&GPIO, num_pin) != 0) {
|
||||
if (gpio_ll_get_level(&GPIO, num_pin) != level) {
|
||||
return GPIO_SHORT_HOLD;
|
||||
}
|
||||
} while (delay_sec > ((esp_log_early_timestamp() - tm_start) / 1000L));
|
||||
|
||||
Reference in New Issue
Block a user