[Taranis] EEPROM write from USB massstorage seems working on windows here! Not tested again on Linux
This commit is contained in:
+1
-1
@@ -383,7 +383,7 @@ void generalDefault()
|
|||||||
uint16_t evalChkSum()
|
uint16_t evalChkSum()
|
||||||
{
|
{
|
||||||
uint16_t sum=0;
|
uint16_t sum=0;
|
||||||
for (int i=0; i<NUM_STICKS+NUM_POTS+5;i++)
|
for (int i=0; i<NUM_STICKS+NUM_POTS+5; i++)
|
||||||
sum += g_eeGeneral.calibMid[i];
|
sum += g_eeGeneral.calibMid[i];
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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