[Taranis] EEPROM write from USB massstorage seems working on windows here! Not tested again on Linux
This commit is contained in:
@@ -663,13 +663,21 @@ int32_t fat12Read( uint8_t *buffer, uint16_t sector, uint16_t count )
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
int32_t fat12Write(const uint8_t *buffer, uint16_t sector, uint32_t count )
|
int32_t fat12Write(const uint8_t *buffer, uint16_t sector, uint32_t count )
|
||||||
{
|
{
|
||||||
|
static int offset = 0;
|
||||||
|
|
||||||
while (count) {
|
while (count) {
|
||||||
if (sector >= 4) {
|
const EeFs * test = (const EeFs *)buffer;
|
||||||
eeWriteBlockCmp((uint8_t *)buffer, (sector-4)*512, 512);
|
if (test->version==EEFS_VERS && test->mySize==sizeof(eeFs) && test->bs==BS) {
|
||||||
|
offset = sector;
|
||||||
|
}
|
||||||
|
if (offset && sector >= offset) {
|
||||||
|
eeWriteBlockCmp((uint8_t *)buffer, (sector-offset)*512, 512);
|
||||||
}
|
}
|
||||||
buffer += 512;
|
buffer += 512;
|
||||||
sector++;
|
sector++;
|
||||||
count--;
|
count--;
|
||||||
|
if (sector-offset+1==EESIZE/512)
|
||||||
|
offset = 0;
|
||||||
}
|
}
|
||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user