osEepromLongRead.c (691B)
1 #include "libultra_internal.h" 2 #include "controller.h" 3 4 s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, s32 nbytes) { 5 s32 status = 0; 6 7 #ifndef VERSION_CN 8 if (address > 0x40) { 9 return -1; 10 } 11 #endif 12 13 while (nbytes > 0) { 14 status = osEepromRead(mq, address, buffer); 15 if (status != 0) { 16 return status; 17 } 18 19 nbytes -= EEPROM_BLOCK_SIZE; 20 address++; 21 buffer += EEPROM_BLOCK_SIZE; 22 #ifndef VERSION_CN 23 osSetTimer(&__osEepromTimer, 12000 * osClockRate / 1000000, 0, &__osEepromTimerQ, __osEepromTimerMsg); 24 osRecvMesg(&__osEepromTimerQ, NULL, OS_MESG_BLOCK); 25 #endif 26 } 27 28 return status; 29 }