Author Topic: Can one use fnFlush(..., FLUSH_TX) on ontput buffers?  (Read 8156 times)

Offline syakovlev

  • Newbie
  • *
  • Posts: 20
    • View Profile
Can one use fnFlush(..., FLUSH_TX) on ontput buffers?
« on: July 29, 2008, 05:58:42 PM »
At first glance it looks OK, but has anyone positive experience of doing so?
Thx.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Can one use fnFlush(..., FLUSH_TX) on ontput buffers?
« Reply #1 on: July 31, 2008, 05:56:36 PM »
Hi

Ensure that the following define is set in config.h - this will activate the flush support
    #define SUPPORT_FLUSH                                                // support rx flush

Usage is:
    fnFlush(SerialPortID, FLUSH_TX); // flush output buffer of serial interface
    fnFlush(SerialPortID, FLUSH_RX); // flush input buffer of serial interface


Note that
    fnFlush(SerialPortID, (FLUSH_RX | FLUSH_TX));
is not valid - it will only flush the Tx buffer (i.e. one call for each buffer necessary).

Regards

Mark