]> git.sur5r.net Git - openocd/commitdiff
stm32f1x: Fix option byte flag parsing
authorAndreas Fritiofson <andreas.fritiofson@gmail.com>
Fri, 21 Feb 2014 16:17:32 +0000 (17:17 +0100)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 24 Feb 2014 11:55:45 +0000 (11:55 +0000)
Change-Id: Ifa04e1f215ac5790db3d432cc0d7d532660459f2
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/1963
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
src/flash/nor/stm32f1x.c

index 105bd79c0873ab31e64932639b2151f796bab74c..1b67ff0331d0a07619a5cd2da202307261765d53 100644 (file)
@@ -1433,12 +1433,12 @@ COMMAND_HANDLER(stm32x_handle_options_write_command)
                else if (strcmp("HWWDG", CMD_ARGV[0]) == 0)
                        optionbyte &= ~(1 << 0);
                else if (strcmp("NORSTSTOP", CMD_ARGV[0]) == 0)
-                       optionbyte &= ~(1 << 1);
-               else if (strcmp("RSTSTNDBY", CMD_ARGV[0]) == 0)
+                       optionbyte |= (1 << 1);
+               else if (strcmp("RSTSTOP", CMD_ARGV[0]) == 0)
                        optionbyte &= ~(1 << 1);
                else if (strcmp("NORSTSTNDBY", CMD_ARGV[0]) == 0)
-                       optionbyte &= ~(1 << 2);
-               else if (strcmp("RSTSTOP", CMD_ARGV[0]) == 0)
+                       optionbyte |= (1 << 2);
+               else if (strcmp("RSTSTNDBY", CMD_ARGV[0]) == 0)
                        optionbyte &= ~(1 << 2);
                else if (stm32x_info->has_dual_banks) {
                        if (strcmp("BOOT0", CMD_ARGV[0]) == 0)