Skip to content

Commit c1deaf5

Browse files
committed
[coco] more fuji commands.
1 parent 66b8518 commit c1deaf5

File tree

4 files changed

+59
-1
lines changed

4 files changed

+59
-1
lines changed

coco/fn_fuji/Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ OBJS=fuji_reset.o \
2121
fuji_get_adapter_config.o \
2222
fuji_unmount_host_slot.o \
2323
fuji_get_directory_position.o \
24-
fuji_set_directory_position.o
24+
fuji_set_directory_position.o \
25+
fuji_get_device_filename.o \
26+
fuji_set_device_filename.o
2527

2628
libfuji.a: $(OBJS)
2729
$(AR) --create libfuji.a $(OBJS)
@@ -89,5 +91,11 @@ fuji_get_directory_position.o: fuji_get_directory_position.c fuji.h
8991
fuji_set_directory_position.o: fuji_set_directory_position.c fuji.h
9092
$(CC) -o fuji_set_directory_position.o -c fuji_set_directory_position.c
9193

94+
fuji_get_device_filename.o: fuji_get_device_filename.c fuji.h
95+
$(CC) -o fuji_get_device_filename.o -c fuji_get_device_filename.c
96+
97+
fuji_set_device_filename.o: fuji_set_device_filename.c fuji.h
98+
$(CC) -o fuji_set_device_filename.o -c fuji_set_device_filename.c
99+
92100
clean:
93101
$(RM) *.o *.a *~

coco/fn_fuji/fuji.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,11 @@ unsigned int fuji_get_directory_position(void);
247247
*/
248248
void fuji_set_directory_position(unsigned int pos);
249249

250+
/**
251+
* @brief Return device filename to string pointer s (needs to be 256 bytes!)
252+
* @param ds the device slot to return (0-3)
253+
* @param s Destination pointer
254+
*/
255+
void fuji_set_device_filename(byte ds, char *s);
256+
250257
#endif /* FUJI_H */
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <cmoc.h>
2+
#include <coco.h>
3+
#include <dw.h>
4+
#include "fuji.h"
5+
6+
/**
7+
* @brief Return device filename to string pointer s (needs to be 256 bytes!)
8+
* @param ds the device slot to return (0-3)
9+
* @param s Destination pointer
10+
*/
11+
void fuji_get_device_filename(byte ds, char *s)
12+
{
13+
byte gdfcmd[3]={OP_FUJI,FUJICMD_GET_DEVICE_FULLPATH,0x00};
14+
15+
gdfcmd[2] = ds;
16+
17+
dwwrite(gdfcmd,sizeof(gdfcmd));
18+
dwread((byte *)s,256);
19+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <cmoc.h>
2+
#include <coco.h>
3+
#include <dw.h>
4+
#include "fuji.h"
5+
6+
/**
7+
* @brief Return device filename to string pointer s (needs to be 256 bytes!)
8+
* @param ds the device slot to return (0-3)
9+
* @param s Destination pointer
10+
*/
11+
void fuji_set_device_filename(byte ds, char *s)
12+
{
13+
byte sdfcmd[259];
14+
15+
memset(sdfcmd,0,sizeof(sdfcmd));
16+
17+
sdfcmd[0] = OP_FUJI;
18+
sdfcmd[1] = FUJICMD_SET_DEVICE_FULLPATH;
19+
sdfcmd[2] = ds;
20+
strcpy((char *)&sdfcmd[3],s);
21+
22+
dwwrite(sdfcmd,sizeof(sdfcmd));
23+
dwread((byte *)s,256);
24+
}

0 commit comments

Comments
 (0)