File: 0060-Default-SPI-flash-read-length-to-size-of-SPI-flash.patch

package info (click to toggle)
hackrf 2015.07.2-11
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 69,764 kB
  • ctags: 9,327
  • sloc: ansic: 13,907; python: 696; vhdl: 218; sh: 32; makefile: 15
file content (35 lines) | stat: -rw-r--r-- 1,261 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From a062596819369ff85cae4c3852ee8a37a8de8236 Mon Sep 17 00:00:00 2001
From: Dominic Spill <dominicgs@gmail.com>
Date: Wed, 9 Sep 2015 12:08:28 +0100
Subject: [PATCH 60/68] Default SPI flash read length to size of SPI flash
 Fixes #214

---
 host/hackrf-tools/src/hackrf_spiflash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/host/hackrf-tools/src/hackrf_spiflash.c b/host/hackrf-tools/src/hackrf_spiflash.c
index 098d2ad..20a50d3 100644
--- a/host/hackrf-tools/src/hackrf_spiflash.c
+++ b/host/hackrf-tools/src/hackrf_spiflash.c
@@ -87,7 +87,7 @@ static void usage()
 {
 	printf("Usage:\n");
 	printf("\t-a, --address <n>: starting address (default: 0)\n");
-	printf("\t-l, --length <n>: number of bytes to read (default: 0)\n");
+	printf("\t-l, --length <n>: number of bytes to read (default: %d)\n", MAX_LENGTH);
 	printf("\t-r <filename>: Read data into file.\n");
 	printf("\t-w <filename>: Write data from file.\n");
 	printf("\t-d <serialnumber>: Serial number of device, if multiple devices\n");
@@ -98,7 +98,7 @@ int main(int argc, char** argv)
 {
 	int opt;
 	uint32_t address = 0;
-	uint32_t length = 0;
+	uint32_t length = MAX_LENGTH;
 	uint32_t tmp_length;
 	uint16_t xfer_len = 0;
 	const char* path = NULL;
-- 
2.1.4