Ticket #22867: patch-ser_win32.c.diff

File patch-ser_win32.c.diff, 1014 bytes (added by ranauei@…, 15 years ago)
  • ser_win32.c

    old new  
    1818 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1919 */
    2020
    21 /* $Id: ser_win32.c 825 2009-07-02 10:23:57Z joerg_wunsch $ */
     21/* $Id: ser_win32.c 865 2009-10-12 06:51:53Z mludvig $ */
    2222
    2323/*
    2424 * Native Win32 serial interface for avrdude.
     
    203203        hComPort = INVALID_HANDLE_VALUE;
    204204}
    205205
     206static int ser_set_dtr_rts(union filedescriptor *fd, int is_on)
     207{
     208        HANDLE hComPort=(HANDLE)fd->pfd;
     209
     210        if (is_on) {
     211                EscapeCommFunction(hComPort, SETDTR);
     212                EscapeCommFunction(hComPort, SETRTS);
     213        } else {
     214                EscapeCommFunction(hComPort, CLRDTR);
     215                EscapeCommFunction(hComPort, CLRRTS);
     216        }
     217        return 0;
     218}
     219
    206220
    207221static int ser_send(union filedescriptor *fd, unsigned char * buf, size_t buflen)
    208222{
     
    378392  .send = ser_send,
    379393  .recv = ser_recv,
    380394  .drain = ser_drain,
     395  .set_dtr_rts = ser_set_dtr_rts,
    381396  .flags = SERDEV_FL_CANSETSPEED,
    382397};
    383398