added code to flush the adc channel's fifo if not empty