Author Topic: Change Baud Rate on Serial Port  (Read 2748 times)

Offline Phil

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Change Baud Rate on Serial Port
« on: February 11, 2020, 01:22:21 AM »
Mark,

How do we change serial port settings on an open port?  I need to change the baud rate (and possibly other settings) on an open serial port.  I have used the serial port feature for years now. This is the first time I've needed to change a port setting in real time.

Thank you.

Phil

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Change Baud Rate on Serial Port
« Reply #1 on: February 11, 2020, 02:46:09 AM »
Phil

See the "set_baud" command on the command line menu (in debug.c).
It calls
fnSetNewSerialMode(0, MODIFY_CONFIG);
to make changes that were made to the UARTs Baud rate or other settings.

Basically one uses the open configuration but instead of FOR_I_O (which allocates queue resources and configures it) as flag one uses MODIFY_CONFIG instead - this just changes the configuration on-the-fly.

Regards

Mark

Offline Phil

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Change Baud Rate on Serial Port
« Reply #2 on: February 11, 2020, 05:15:43 PM »
Mark,

I should have known. Sorry.

Thank you for your quick reply.

Best regards,

Phil