blob: 8ecce2547fc41a98a939972d96410647d9787414 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include "PR/os_internal.h"
#include "PRinternal/controller.h"
s32 osEepromLongWrite(OSMesgQueue* mq, u8 address, u8* buffer, int length) {
s32 ret = 0;
while (length > 0) {
ERRCK(osEepromWrite(mq, address, buffer));
length -= EEPROM_BLOCK_SIZE;
address++;
buffer += EEPROM_BLOCK_SIZE;
osSetTimer(&__osEepromTimer, OS_USEC_TO_CYCLES(12000), 0, &__osEepromTimerQ, &__osEepromTimerMsg);
osRecvMesg(&__osEepromTimerQ, NULL, OS_MESG_BLOCK);
}
return ret;
}
|