drive | Extension socket number |
*fname | File name |
*buf | Read address |
nblock | Number of blocks to be read |
*time | Time stamp |
flag | flag |
BUD_FLAG_VERIFY:Verify enabled | |
BUD_FLAG_COPY(n):Copy flag ("n" is the value of the copy flag) |
BUD_ERR_OK | Processing request was received | |
BUD_ERR_BUSY | Busy - request could not be accepted |
The following values can be designated for the argument drive which specifies extension sockets.
BUD_DRIVE_A1 | Extension socket 1 on board A |
BUD_DRIVE_A2 | Extension socket 2 on board A |
BUD_DRIVE_B1 | Extension socket 1 on board B |
BUD_DRIVE_B2 | Extension socket 2 on board B |
BUD_DRIVE_C1 | Extension socket 1 on board C |
BUD_DRIVE_C2 | Extension socket 2 on board C |
BUD_DRIVE_D1 | Extension socket 1 on board D |
BUD_DRIVE_D2 | Extension socket 2 on board D |
In a normal application, this function saves an entire file. If an executable file exists or if a file with the same name already exists, an error results.
Sint32 ret; Sint32 blocks, flag; BUS_TIME time; SYS_RTC_DATE rtc; extern char SaveData[]; /* Data to be saved(512*10 bytes) */ blocks = 10; /* File size is 10 blocks */ flag = BUD_FLAG_VERIFY | BUD_FLAG_COPY(0xff); /* Verify enabled | Set copy flag to FFH */ syRtcGetDate( &rtc ); time = ( BUS_TIME )rtc; /* Time stamp setting */ ret = buSaveExecFile(BUD_DRIVE_A1, "SAVEDATA", SaveData, blocks, &time, flag); if (ret != BUD_ERR_OK) return NG; while (buStat(BUD_DRIVE_A1) == BUD_STAT_BUSY) { } if (buGetLastError(BUD_DRIVE_A1) != BUD_ERR_OK) return NG; return OK;
BUD_ERR_OK | Normal end |
BUD_ERR_UNFORMAT | Disk is not formatted |
BUD_ERR_NO_DISK | Memory card is not found |
BUD_ERR_DISK_FULL | Executable file already exists |
BUD_ERR_FILE_EXIST | File with the same name already exists |