/* This ISR is called when the handshake line goes high.  */
static void IRAM_ATTR gpio_handshake_isr_handler(void *arg)
/* This ISR is called when the handshake line goes high.  */
static void IRAM_ATTR gpio_handshake_isr_handler(void *arg)
{
    static uint32_t lasthandshaketime;
    uint32_t currtime=xthal_get_ccount();
    uint32_t diff=currtime-lasthandshaketime;
    if (diff<240000) return;
    lasthandshaketime=currtime;
    BaseType_t mustYield=false;
    xSemaphoreGiveFromISR(rdySem, &mustYield);
    if (mustYield) portYIELD_FROM_ISR();
}