]> sigrok.org Git - sigrok-dumps.git/blobdiff - spi/nrf24l01/gen-testfiles.py
caliper: rename dump files and probes
[sigrok-dumps.git] / spi / nrf24l01 / gen-testfiles.py
index 6377539b3050fdd811cfdbc1a1cc427733de441e..906c025ab3ad11279841eff583da6622af32fef5 100755 (executable)
@@ -15,8 +15,7 @@
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
 ##
 
 ## This script generates test cases for the nrf24l01 protocol decoder.
@@ -40,8 +39,8 @@ class SPI:
 
     def add(self, mosi, miso):
         for _ in range(8):
-            mo = mosi & 0x80
-            mi = miso & 0x80
+            mo = (mosi & 0x80) >> 7
+            mi = (miso & 0x80) >> 7
             mosi <<= 1
             miso <<= 1
             self._data.append([0, 0, mo, mi])
@@ -57,7 +56,7 @@ class SPI:
                 w.writerows(self._data)
 
             fn = '{}.sr'.format(self._filename)
-            I = 'csv:header=true:samplerate=1k'
+            I = 'csv:header=true:samplerate=1000'
             subprocess.check_call(['sigrok-cli', '-I', I, '-i', tf.name, '-o', fn])
 
 spi = SPI('nrf24l01-test-activate')