/trunk/fat16.c |
---|
62,6 → 62,7 |
#include "uart1.h" |
#include "main.h" |
//________________________________________________________________________________________________________________________________________ |
// Module name: fat16.c |
// Compiler used: avr-gcc 3.4.5 |
983,26 → 984,14 |
u16 last_cluster, new_cluster = CLUSTER_UNDEFINED; |
u32 fat_byte_offset, sector, byte; |
Fat16Entry_t * fat; |
// s8 text[64]; |
if((!Partition.IsValid) || (file == NULL)) return(new_cluster); |
new_cluster = FindNextFreeCluster(file); // the next free cluster found on the disk. |
if(new_cluster != CLUSTER_UNDEFINED) |
{ // A free cluster was found and can be added to the end of the file. |
// is there at least one cluster appended to the file? |
if(file->FirstSectorOfLastCluster == CLUSTER_UNDEFINED) |
{ |
fseek_(file, 0, SEEK_END); // jump to the end of the file |
// remember the first sector of the last cluster |
file->FirstSectorOfLastCluster = file->FirstSectorOfCurrCluster; |
last_cluster = SectorToFat16Cluster(file->FirstSectorOfCurrCluster); // determine current file cluster |
} |
else |
{ |
last_cluster = SectorToFat16Cluster(file->FirstSectorOfLastCluster); // determine current file cluster |
} |
{ // A free cluster was found and can be added to the end of the file. |
fseek_(file, 0, SEEK_END); // jump to the end of the file |
last_cluster = SectorToFat16Cluster(file->FirstSectorOfCurrCluster); // determine current file cluster |
if(last_cluster != CLUSTER_UNDEFINED) |
{ |
// update FAT entry of last cluster |
1026,8 → 1015,6 |
Fat16_Deinit(); |
return(0); |
} |
// now the new cluster appended to the fat is the last cluster |
file->FirstSectorOfLastCluster = Fat16ClusterToSector(new_cluster); |
} |
else // last cluster of the file is undefined |
{ // then the new cluster must be the first one of the file |
1056,7 → 1043,6 |
} |
// update file info |
file->FirstSectorOfFirstCluster = Fat16ClusterToSector(new_cluster); |
file->FirstSectorOfLastCluster = file->FirstSectorOfFirstCluster; |
file->Size = 0; |
file->Position = 0; |
} |
1818,6 → 1804,7 |
file->ByteOfCurrSector++; // goto next byte in sector |
if(file->ByteOfCurrSector >= BYTES_PER_SECTOR) // if the end of this sector is reached yet |
{ // save the sector to the sd-card |
if(SD_SUCCESS != SDC_PutSector(file->SectorInCache, file->Cache)) |
{ |
Fat16_Deinit(); |
/trunk/main.c |
---|
335,7 → 335,7 |
newErrorCode = 26; |
DebugOut.StatusRed |= AMPEL_NC; |
} |
else if((SD_LoggingError || (SD_WatchDog == 0)) && Parameter.GlobalConfig3 & CFG3_NO_SDCARD_NO_START ) |
else if((SD_LoggingError || (SD_WatchDog < 2000 && SD_WatchDog != 0)) && Parameter.GlobalConfig3 & CFG3_NO_SDCARD_NO_START) |
{ |
LED_RED_ON; |
sprintf(ErrorMSG,"ERR:SD Logging abort"); |
/trunk/settings.c |
---|
79,7 → 79,6 |
Parameter_t CFG_Parameter[] = |
{ |
//{PID , "1234567890123456" , Comment, Group, Value, Default, Min, Max }, |
87,10 → 86,10 |
{PID_GPX_LOGGING , "GPXLOGGING \0" ,"GPX logging interval in ms (0 = disabled) ", 1, 1000, 1000, 0, 60000}, // the log interval for GPX logging, 0 = off |
{PID_ABSOLUTE_FLYING_ALT , "MAX_FLYING_ALT \0" ,"max. altitude in m ", 1, 0, 0, 0, 30000}, // in [m] |
{PID_ABSOLUTE_FLYING_RANGE , "MAX_FLYING_RANGE\0" ,"max. range in m ", 1, 0, 0, 0, 60000}, // in [m] |
{PID_AUTO_DESCEND_RANGE , "DESCEND_RANGE \0" ,"range in m ", 1, 0, 0, 0, 60000}, // in [m] |
{PID_GPS_SBAS_CONFIG , "GPS_SBAS_DGPS_ON\0" ,"GPS SBAS mode (0 = off, 1 = on) ", 1, 1, 1, 0, 1}, |
{PID_MIN_EVENT_TIME , "MIN_EVENT_TIME \0" ,"in seconds ", 1, 2, 2, 0, 600}, // in seconds |
{PID_GPS_AUTOCONFIG , "GPSAUTOCONFIG \0" ,"GPS configmode (0 = off, 1 = on) ", 1, 1, 1, 0, 1} |
{PID_AUTO_DESCEND_RANGE , "DESCEND_RANGE \0" ,"Auto-descend range in m (0 = disabled) (only comm. License) ", 1, 0, 0, 0, 60000}, // in [m] |
{PID_GPS_SBAS_CONFIG , "GPS_SBAS_DGPS_ON\0" ,"GPS SBAS mode (0 = off, 1 = on) ", 1, 1, 1, 0, 1}, |
{PID_MIN_EVENT_TIME , "MIN_EVENT_TIME \0" ,"minimum time of the Waypoint-Event value (seconds) ", 1, 2, 2, 0, 600}, // in seconds |
{PID_GPS_AUTOCONFIG , "GPSAUTOCONFIG \0" ,"GPS configmode (0 = off, 1 = on) ", 1, 1, 1, 0, 1} |
}; |
/trunk/spi_slave.c |
---|
718,13 → 718,13 |
/* |
//+++++++++++++++++++++++++++++++++++++++++++++++++++ |
*/ |
/* |
if(Parameter.User8 < 100) FC.StatusFlags = 0; |
else |
if(Parameter.User8 < 150) FC.StatusFlags = FC_STATUS_START; |
else FC.StatusFlags = FC_STATUS_FLY | FC_STATUS_MOTOR_RUN; |
BL_MinOfMaxPWM = 255; |
*/ |
DebugOut.Analog[0] = FromFlightCtrl.AngleNick; |
DebugOut.Analog[1] = FromFlightCtrl.AngleRoll; |
DebugOut.Analog[2] = FromFlightCtrl.AccNick; |