From 033b2ed796ffbf8327ab51be0d6f528c83bbab1a Mon Sep 17 00:00:00 2001
From: Stefan Rueger <stefan.rueger@open.ac.uk>
Date: Fri, 29 Apr 2022 00:37:28 +0100
Subject: [PATCH 1/2] Treat x bits in .conf SPI commands as 0

---
 src/avrpart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/avrpart.c b/src/avrpart.c
index dc6def44..fdff0f78 100644
--- a/src/avrpart.c
+++ b/src/avrpart.c
@@ -82,11 +82,11 @@ int avr_set_bits(OPCODE * op, unsigned char * cmd)
   unsigned char mask;
 
   for (i=0; i<32; i++) {
-    if (op->bit[i].type == AVR_CMDBIT_VALUE) {
+    if (op->bit[i].type == AVR_CMDBIT_VALUE || op->bit[i].type == AVR_CMDBIT_IGNORE) {
       j = 3 - i / 8;
       bit = i % 8;
       mask = 1 << bit;
-      if (op->bit[i].value)
+      if (op->bit[i].value && op->bit[i].type == AVR_CMDBIT_VALUE)
         cmd[j] = cmd[j] | mask;
       else
         cmd[j] = cmd[j] & ~mask;

From 43c6b0422681ca271b9f32537bdba488df221e06 Mon Sep 17 00:00:00 2001
From: Stefan Rueger <stefan.rueger@urclocks.com>
Date: Tue, 28 Jun 2022 22:46:06 +0100
Subject: [PATCH 2/2] Update NEWS

---
 NEWS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/NEWS b/NEWS
index d5ce1df4..e78362b3 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,7 @@ Changes since version 7.0:
     - adding support for all Linux baud rates v.2 #993
     - Replace internal knowledge in jtag3.c by a public API #996
     - JTAG3 UPDI EEPROM fix #1013
+    - Treat x bits in .conf SPI commands as 0 #943
 
   * Internals: