this fixes an issue with early discard of packets on MCUs with small number of transmit slots and higher packet send count
split into separate cpp files and avoid static functions