From b661c6a414294eb3765a34a9b4e04cbb080e85fc Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 27 Aug 2019 15:44:30 +0200 Subject: [PATCH] Fix baudrate calculation allowing max 30600 baud Fix baudrate calculation allowing max 30600 baud (#6294) --- sonoff/support_command.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonoff/support_command.ino b/sonoff/support_command.ino index bd07643e9..3ea81e2f2 100644 --- a/sonoff/support_command.ino +++ b/sonoff/support_command.ino @@ -963,7 +963,7 @@ void CmndBaudrate(void) { if (XdrvMailbox.payload > 1200) { XdrvMailbox.payload /= 1200; // Make it a valid baudrate - baudrate = XdrvMailbox.payload * 1200; + baudrate = (XdrvMailbox.payload & 0xFF) * 1200; SetSerialBaudrate(baudrate); } ResponseCmndNumber(Settings.baudrate * 1200);