summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-01-22 18:47:35 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-01-22 18:47:35 +0000
commit8f1d3c944b509874be07a1f12387de37adf12626 (patch)
tree717ea932ac6f19f566eaff4187b87f87700bd114
parent86352ccc3f47bc0f6bdcdcdc7b752f0836900fcd (diff)
downloadrockbox-8f1d3c944b509874be07a1f12387de37adf12626.tar.gz
rockbox-8f1d3c944b509874be07a1f12387de37adf12626.zip
Ludovic Lange's patch to make the ROLO feature work on the FM Recorder.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3151 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/config-fmrecorder.h9
-rw-r--r--firmware/config-player.h9
-rw-r--r--firmware/config-recorder.h9
-rw-r--r--firmware/rolo.c8
4 files changed, 31 insertions, 4 deletions
diff --git a/firmware/config-fmrecorder.h b/firmware/config-fmrecorder.h
index 584b1d5d54..a760c39907 100644
--- a/firmware/config-fmrecorder.h
+++ b/firmware/config-fmrecorder.h
@@ -30,3 +30,12 @@
30 30
31/* Define this if you control power on PBDR (instead of PADR) */ 31/* Define this if you control power on PBDR (instead of PADR) */
32#define HAVE_POWEROFF_ON_PBDR 32#define HAVE_POWEROFF_ON_PBDR
33
34/* Offset ( in the firmware file's header ) to the file length */
35#define FIRMWARE_OFFSET_FILE_LENGTH 20
36
37/* Offset ( in the firmware file's header ) to the file CRC */
38#define FIRMWARE_OFFSET_FILE_CRC 6
39
40/* Offset ( in the firmware file's header ) to the real data */
41#define FIRMWARE_OFFSET_FILE_DATA 24
diff --git a/firmware/config-player.h b/firmware/config-player.h
index 8b4efcc7b4..d9a713d368 100644
--- a/firmware/config-player.h
+++ b/firmware/config-player.h
@@ -22,3 +22,12 @@
22 22
23/* Define this if you control power on PADR (instead of PBDR) */ 23/* Define this if you control power on PADR (instead of PBDR) */
24#define HAVE_POWEROFF_ON_PADR 24#define HAVE_POWEROFF_ON_PADR
25
26/* Offset ( in the firmware file's header ) to the file length */
27#define FIRMWARE_OFFSET_FILE_LENGTH 0
28
29/* Offset ( in the firmware file's header ) to the file CRC */
30#define FIRMWARE_OFFSET_FILE_CRC 4
31
32/* Offset ( in the firmware file's header ) to the real data */
33#define FIRMWARE_OFFSET_FILE_DATA 6
diff --git a/firmware/config-recorder.h b/firmware/config-recorder.h
index 7f7c5e2683..33e40b7790 100644
--- a/firmware/config-recorder.h
+++ b/firmware/config-recorder.h
@@ -27,3 +27,12 @@
27 27
28/* Define this if you control power on PBDR (instead of PADR) */ 28/* Define this if you control power on PBDR (instead of PADR) */
29#define HAVE_POWEROFF_ON_PBDR 29#define HAVE_POWEROFF_ON_PBDR
30
31/* Offset ( in the firmware file's header ) to the file length */
32#define FIRMWARE_OFFSET_FILE_LENGTH 0
33
34/* Offset ( in the firmware file's header ) to the file CRC */
35#define FIRMWARE_OFFSET_FILE_CRC 4
36
37/* Offset ( in the firmware file's header ) to the real data */
38#define FIRMWARE_OFFSET_FILE_DATA 6
diff --git a/firmware/rolo.c b/firmware/rolo.c
index 92c8cc4003..f8aad52546 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -68,8 +68,8 @@ int rolo_load(char* filename)
68 } 68 }
69 69
70 /* Read file length from header and compare to real file length */ 70 /* Read file length from header and compare to real file length */
71 length=lseek(fd,0,SEEK_END)-6; 71 length=lseek(fd,0,SEEK_END)-FIRMWARE_OFFSET_FILE_DATA;
72 lseek(fd, 0, SEEK_SET); 72 lseek(fd, FIRMWARE_OFFSET_FILE_LENGTH, SEEK_SET);
73 if(read(fd, &file_length, 4) != 4) { 73 if(read(fd, &file_length, 4) != 4) {
74 rolo_error("Error Reading File Length"); 74 rolo_error("Error Reading File Length");
75 return -1; 75 return -1;
@@ -80,12 +80,12 @@ int rolo_load(char* filename)
80 } 80 }
81 81
82 /* Read and save checksum */ 82 /* Read and save checksum */
83 lseek(fd, 4, SEEK_SET); 83 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
84 if (read(fd, &file_checksum, 2) != 2) { 84 if (read(fd, &file_checksum, 2) != 2) {
85 rolo_error("Error Reading checksum"); 85 rolo_error("Error Reading checksum");
86 return -1; 86 return -1;
87 } 87 }
88 lseek(fd, 6, SEEK_SET); 88 lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET);
89 89
90 /* verify that file can be read and descrambled */ 90 /* verify that file can be read and descrambled */
91 if ((&mp3buf[0] + (2*length)+4) >= &mp3end) { 91 if ((&mp3buf[0] + (2*length)+4) >= &mp3end) {