bool boot_port_serial_detect_boot_pin()

in port/espressif/src/boot_serial_port.c [166:177]


bool boot_port_serial_detect_boot_pin( void )
{
    uint8_t aggregate = 0;
    const int n_samples = 5;
    for( int i=0; i<n_samples; i++ )
    {
        aggregate += gpio_ll_get_level( &GPIO, BOOT_SERIAL_TRIGGER_BUTTON );
        esp_rom_delay_us( 1000 );
    }

    return ( aggregate / n_samples ) == 1;
}