Skip to content

RTS only updates when DTR changes state #893

@dalbert2

Description

@dalbert2

I wrote a simple sketch to show the state of RTS and it doesn't work as expected. The RTS state is only updated when DTR changes state. Tested on windows 11 using TeraTerm and RealTerm (RealTerm is easier for this)

#include <Arduino.h>

USBSerial serial;

void setup() {
  delay(5000);
  serial.begin();
}

void loop() {
  if (serial.getRTS()) {
      serial.write('R');
  } else {
      serial.write('r');
  }
  delay(1000);
}

Details: In usb_cdcacm.c the state variable line_dtr_rts is updated in usbNoDataSetup() and the line control state,
but it doesn't look like that callback is being called when RTS changes state. Any ideas?

If this is unavoidable, USBSerial::getRTS() should probably have a comment to the effect of "Note: RTS only update when DTR changes state"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions