As the 'is_tx = 0' can not be moved in the entire handler thanks to a possible race involving the hold off in switching to STATE_RX_AACK_ON along with a new interrupt, we introduce an intermediate 'was_tx' boolean only for this intent. There's no Fixes tag applying below, lots of improvements https://websitedesignservice83837.blogdemls.com/28460893/the-smart-trick-of-lifetime-hosting-service-that-nobody-is-discussing