blockDetailsLookup.c File Reference

Memory block details lookup. More...

#include "inc/freeEMS.h"
#include "inc/interrupts.h"
#include "inc/pagedLocationBuffers.h"
#include "inc/blockDetailsLookup.h"

Include dependency graph for blockDetailsLookup.c:

Go to the source code of this file.

Defines

#define BLOCK_DETAILS_LOOKUP_C

Functions

unsigned short lookupBlockDetails (unsigned short locationID, blockDetails *details)
 Lookup memory block details.


Detailed Description

Memory block details lookup.

This file holds the single function lookupBlockDetails() which functions as a sort of address book for logical blocks of memory.

Author:
Fred Cooke

Definition in file blockDetailsLookup.c.


Define Documentation

#define BLOCK_DETAILS_LOOKUP_C

Definition at line 38 of file blockDetailsLookup.c.


Function Documentation

unsigned short lookupBlockDetails ( unsigned short  locationID,
blockDetails details 
)

Lookup memory block details.

Flash only blocks leave the ram address and page values set to zero. ID's that don't exist leave all set to zero. Error handling is to be done externally based on that.

Author:
Fred Cooke
Note:
This function is an exception to the style rule switch statement blocks of using a {} pair for each case statement. Readability is better without them in this case.
Parameters:
locationID is the ID of the memory location for which details are required.
details is a pointer to the blockDetails struct to populate with the details.
Returns:
An error code. Zero means success, anything else is a failure.

Definition at line 62 of file blockDetailsLookup.c.

References CHTTransferTableLocation, CHTTransferTableLocationID, fixedConfig1::coreSettingsA, coreSettingsALocationID, dwellDesiredVersusVoltageTable2Location, dwellDesiredVersusVoltageTable2LocationID, dwellDesiredVersusVoltageTableLocation, dwellDesiredVersusVoltageTableLocationID, dwellMaxVersusRPMTable2Location, dwellMaxVersusRPMTable2LocationID, dwellMaxVersusRPMTableLocation, dwellMaxVersusRPMTableLocationID, ENGINE_SETTINGS_SIZE, fixedConfig1::engineSettings, engineSettingsLocationID, engineTempEnrichmentTableFixed2Location, engineTempEnrichmentTableFixed2LocationID, engineTempEnrichmentTableFixedLocation, engineTempEnrichmentTableFixedLocationID, engineTempEnrichmentTablePercent2Location, engineTempEnrichmentTablePercent2LocationID, engineTempEnrichmentTablePercentLocation, engineTempEnrichmentTablePercentLocationID, fillerA2Location, fillerA2LocationID, fillerALocation, fillerALocationID, fillerB2Location, fillerB2LocationID, fillerBLocation, fillerBLocationID, fillerC2Location, fillerC2LocationID, fillerCLocation, fillerCLocationID, fillerD2Location, fillerD2LocationID, fillerDLocation, fillerDLocationID, FixedConfig1LocationID, FixedConfig2LocationID, fixedConfigs1, fixedConfigs2, blockDetails::FlashAddress, blockDetails::FlashPage, FUELTABLES_PPAGE, IATTransferTableLocation, IATTransferTableLocationID, IgnitionAdvanceTableMain2LocationID, IgnitionAdvanceTableMainFlash2Location, IgnitionAdvanceTableMainFlashLocation, IgnitionAdvanceTableMainLocationID, IgnitionAdvanceTableSecondary2LocationID, IgnitionAdvanceTableSecondaryFlash2Location, IgnitionAdvanceTableSecondaryFlashLocation, IgnitionAdvanceTableSecondaryLocationID, InjectionAdvanceTableMain2LocationID, InjectionAdvanceTableMainFlash2Location, InjectionAdvanceTableMainFlashLocation, InjectionAdvanceTableMainLocationID, InjectionAdvanceTableSecondary2LocationID, InjectionAdvanceTableSecondaryFlash2Location, InjectionAdvanceTableSecondaryFlashLocation, InjectionAdvanceTableSecondaryLocationID, injectorDeadTimeTable2Location, injectorDeadTimeTable2LocationID, injectorDeadTimeTableLocation, injectorDeadTimeTableLocationID, LambdaTable2LocationID, LambdaTableFlash2Location, LambdaTableFlashLocation, LambdaTableLocationID, locationIDNotFound, LOOKUP_PPAGE, MAFTransferTableLocation, MAFTransferTableLocationID, MAINTABLE_SIZE, perCylinderFuelTrims2Location, perCylinderFuelTrims2LocationID, perCylinderFuelTrimsLocation, perCylinderFuelTrimsLocationID, postStartEnrichmentTable2Location, postStartEnrichmentTable2LocationID, postStartEnrichmentTableLocation, postStartEnrichmentTableLocationID, PPAGE, primingVolumeTable2Location, primingVolumeTable2LocationID, primingVolumeTableLocation, primingVolumeTableLocationID, blockDetails::RAMAddress, blockDetails::RAMPage, RPAGE_FUEL_ONE, RPAGE_FUEL_TWO, RPAGE_TIME_ONE, RPAGE_TIME_TWO, RPAGE_TUNE_ONE, RPAGE_TUNE_TWO, SENSOR_PRESETS_SIZE, SENSOR_RANGES_SIZE, SENSOR_SETTINGS_SIZE, fixedConfig2::sensorPresets, sensorPresetsLocationID, fixedConfig2::sensorRanges, sensorRangesLocationID, fixedConfig2::sensorSettings, sensorSettingsLocationID, SERIAL_SETTINGS_SIZE, fixedConfig1::serialSettings, serialSettingsLocationID, blockDetails::size, SmallTablesA2LocationID, SmallTablesAFlash2Location, SmallTablesAFlashLocation, SmallTablesALocationID, SmallTablesB2LocationID, SmallTablesBFlash2Location, SmallTablesBFlashLocation, SmallTablesBLocationID, SmallTablesC2LocationID, SmallTablesCFlash2Location, SmallTablesCFlashLocation, SmallTablesCLocationID, SmallTablesD2LocationID, SmallTablesDFlash2Location, SmallTablesDFlashLocation, SmallTablesDLocationID, TACHO_SETTINGS_SIZE, fixedConfig1::tachoSettings, tachoSettingsLocationID, TestTransferTableLocation, TestTransferTableLocationID, TIMETABLES_PPAGE, TransferTableSize, TUNETABLES_PPAGE, TWODTABLEUS_SIZE, fixedConfig1::userTextField, fixedConfig2::userTextField2, userTextField2LocationID, userTextFieldArrayLength1, userTextFieldArrayLength2, userTextFieldLocationID, VETableMain2LocationID, VETableMainFlash2Location, VETableMainFlashLocation, VETableMainLocationID, VETableSecondary2LocationID, VETableSecondaryFlash2Location, VETableSecondaryFlashLocation, VETableSecondaryLocationID, VETableTertiary2LocationID, VETableTertiaryFlash2Location, VETableTertiaryFlashLocation, and VETableTertiaryLocationID.

Referenced by decodePacketAndRespond().

00062                                                                                    {
00063     /* Initialise the four values needed for operations on memory at 0 for error checking */
00064     details->RAMPage = 0;
00065     details->FlashPage = 0;
00066     details->RAMAddress = 0;
00067     details->FlashAddress = 0;
00068 
00069     /* Initialise the block size to 1024 to save code space and increase readability */
00070     details->size = MAINTABLE_SIZE;
00071 
00072     /* Look up the locations and set non default sizes */
00073     switch (locationID) {
00074     /* flash only fixed conf full blocks */
00075     case FixedConfig1LocationID:
00076         details->FlashPage = PPAGE;
00077         details->FlashAddress = (void*)&fixedConfigs1;
00078         break;
00079     case FixedConfig2LocationID:
00080         details->FlashPage = PPAGE;
00081         details->FlashAddress = (void*)&fixedConfigs2;
00082         break;
00083 
00084     /* lookup tables */
00085     case IATTransferTableLocationID:
00086         details->size = TransferTableSize;
00087         details->FlashPage = LOOKUP_PPAGE;
00088         details->FlashAddress = IATTransferTableLocation;
00089         break;
00090     case CHTTransferTableLocationID:
00091         details->size = TransferTableSize;
00092         details->FlashPage = LOOKUP_PPAGE;
00093         details->FlashAddress = CHTTransferTableLocation;
00094         break;
00095     case MAFTransferTableLocationID:
00096         details->size = TransferTableSize;
00097         details->FlashPage = LOOKUP_PPAGE;
00098         details->FlashAddress = MAFTransferTableLocation;
00099         break;
00100     case TestTransferTableLocationID:
00101         details->size = TransferTableSize;
00102         details->FlashPage = LOOKUP_PPAGE;
00103         details->FlashAddress = TestTransferTableLocation;
00104         break;
00105 
00106     /* fuel tables */
00107     case VETableMainLocationID:
00108         details->RAMPage = RPAGE_FUEL_ONE;
00109         details->FlashPage = FUELTABLES_PPAGE;
00110         details->RAMAddress = (void*)&TablesA;
00111         details->FlashAddress = VETableMainFlashLocation;
00112         break;
00113     case VETableMain2LocationID:
00114         details->RAMPage = RPAGE_FUEL_TWO;
00115         details->FlashPage = FUELTABLES_PPAGE;
00116         details->RAMAddress = (void*)&TablesA;
00117         details->FlashAddress = VETableMainFlash2Location;
00118         break;
00119     case VETableSecondaryLocationID:
00120         details->RAMPage = RPAGE_FUEL_ONE;
00121         details->FlashPage = FUELTABLES_PPAGE;
00122         details->RAMAddress = (void*)&TablesB;
00123         details->FlashAddress = VETableSecondaryFlashLocation;
00124         break;
00125     case VETableSecondary2LocationID:
00126         details->RAMPage = RPAGE_FUEL_TWO;
00127         details->FlashPage = FUELTABLES_PPAGE;
00128         details->RAMAddress = (void*)&TablesB;
00129         details->FlashAddress = VETableSecondaryFlash2Location;
00130         break;
00131     case VETableTertiaryLocationID:
00132         details->RAMPage = RPAGE_FUEL_ONE;
00133         details->FlashPage = FUELTABLES_PPAGE;
00134         details->RAMAddress = (void*)&TablesC;
00135         details->FlashAddress = VETableTertiaryFlashLocation;
00136         break;
00137     case VETableTertiary2LocationID:
00138         details->RAMPage = RPAGE_FUEL_TWO;
00139         details->FlashPage = FUELTABLES_PPAGE;
00140         details->RAMAddress = (void*)&TablesC;
00141         details->FlashAddress = VETableTertiaryFlash2Location;
00142         break;
00143     case LambdaTableLocationID:
00144         details->RAMPage = RPAGE_FUEL_ONE;
00145         details->FlashPage = FUELTABLES_PPAGE;
00146         details->RAMAddress = (void*)&TablesD;
00147         details->FlashAddress = LambdaTableFlashLocation;
00148         break;
00149     case LambdaTable2LocationID:
00150         details->RAMPage = RPAGE_FUEL_TWO;
00151         details->FlashPage = FUELTABLES_PPAGE;
00152         details->RAMAddress = (void*)&TablesD;
00153         details->FlashAddress = LambdaTableFlash2Location;
00154         break;
00155 
00156     /* timing tables */
00157     case IgnitionAdvanceTableMainLocationID:
00158         details->RAMPage = RPAGE_TIME_ONE;
00159         details->FlashPage = TIMETABLES_PPAGE;
00160         details->RAMAddress = (void*)&TablesA;
00161         details->FlashAddress = IgnitionAdvanceTableMainFlashLocation;
00162         break;
00163     case IgnitionAdvanceTableMain2LocationID:
00164         details->RAMPage = RPAGE_TIME_TWO;
00165         details->FlashPage = TIMETABLES_PPAGE;
00166         details->RAMAddress = (void*)&TablesA;
00167         details->FlashAddress = IgnitionAdvanceTableMainFlash2Location;
00168         break;
00169     case IgnitionAdvanceTableSecondaryLocationID:
00170         details->RAMPage = RPAGE_TIME_ONE;
00171         details->FlashPage = TIMETABLES_PPAGE;
00172         details->RAMAddress = (void*)&TablesB;
00173         details->FlashAddress = IgnitionAdvanceTableSecondaryFlashLocation;
00174         break;
00175     case IgnitionAdvanceTableSecondary2LocationID:
00176         details->RAMPage = RPAGE_TIME_TWO;
00177         details->FlashPage = TIMETABLES_PPAGE;
00178         details->RAMAddress = (void*)&TablesB;
00179         details->FlashAddress = IgnitionAdvanceTableSecondaryFlash2Location;
00180         break;
00181     case InjectionAdvanceTableMainLocationID:
00182         details->RAMPage = RPAGE_TIME_ONE;
00183         details->FlashPage = TIMETABLES_PPAGE;
00184         details->RAMAddress = (void*)&TablesC;
00185         details->FlashAddress = InjectionAdvanceTableMainFlashLocation;
00186         break;
00187     case InjectionAdvanceTableMain2LocationID:
00188         details->RAMPage = RPAGE_TIME_TWO;
00189         details->FlashPage = TIMETABLES_PPAGE;
00190         details->RAMAddress = (void*)&TablesC;
00191         details->FlashAddress = InjectionAdvanceTableMainFlash2Location;
00192         break;
00193     case InjectionAdvanceTableSecondaryLocationID:
00194         details->RAMPage = RPAGE_TIME_ONE;
00195         details->FlashPage = TIMETABLES_PPAGE;
00196         details->RAMAddress = (void*)&TablesD;
00197         details->FlashAddress = InjectionAdvanceTableSecondaryFlashLocation;
00198         break;
00199     case InjectionAdvanceTableSecondary2LocationID:
00200         details->RAMPage = RPAGE_TIME_TWO;
00201         details->FlashPage = TIMETABLES_PPAGE;
00202         details->RAMAddress = (void*)&TablesD;
00203         details->FlashAddress = InjectionAdvanceTableSecondaryFlash2Location;
00204         break;
00205 
00206     /* small table full blocks */
00207     case SmallTablesALocationID:
00208         details->RAMPage = RPAGE_TUNE_ONE;
00209         details->FlashPage = TUNETABLES_PPAGE;
00210         details->RAMAddress = (void*)&TablesA;
00211         details->FlashAddress = SmallTablesAFlashLocation;
00212         break;
00213     case SmallTablesA2LocationID:
00214         details->RAMPage = RPAGE_TUNE_TWO;
00215         details->FlashPage = TUNETABLES_PPAGE;
00216         details->RAMAddress = (void*)&TablesA;
00217         details->FlashAddress = SmallTablesAFlash2Location;
00218         break;
00219     case SmallTablesBLocationID:
00220         details->RAMPage = RPAGE_TUNE_ONE;
00221         details->FlashPage = TUNETABLES_PPAGE;
00222         details->RAMAddress = (void*)&TablesB;
00223         details->FlashAddress = SmallTablesBFlashLocation;
00224         break;
00225     case SmallTablesB2LocationID:
00226         details->RAMPage = RPAGE_TUNE_TWO;
00227         details->FlashPage = TUNETABLES_PPAGE;
00228         details->RAMAddress = (void*)&TablesB;
00229         details->FlashAddress = SmallTablesBFlash2Location;
00230         break;
00231     case SmallTablesCLocationID:
00232         details->RAMPage = RPAGE_TUNE_ONE;
00233         details->FlashPage = TUNETABLES_PPAGE;
00234         details->RAMAddress = (void*)&TablesC;
00235         details->FlashAddress = SmallTablesCFlashLocation;
00236         break;
00237     case SmallTablesC2LocationID:
00238         details->RAMPage = RPAGE_TUNE_TWO;
00239         details->FlashPage = TUNETABLES_PPAGE;
00240         details->RAMAddress = (void*)&TablesC;
00241         details->FlashAddress = SmallTablesCFlash2Location;
00242         break;
00243     case SmallTablesDLocationID:
00244         details->RAMPage = RPAGE_TUNE_ONE;
00245         details->FlashPage = TUNETABLES_PPAGE;
00246         details->RAMAddress = (void*)&TablesD;
00247         details->FlashAddress = SmallTablesDFlashLocation;
00248         break;
00249     case SmallTablesD2LocationID:
00250         details->RAMPage = RPAGE_TUNE_TWO;
00251         details->FlashPage = TUNETABLES_PPAGE;
00252         details->RAMAddress = (void*)&TablesD;
00253         details->FlashAddress = SmallTablesDFlash2Location;
00254         break;
00255 
00256     /* TablesA small tables */
00257     case dwellDesiredVersusVoltageTableLocationID:
00258         details->size = TWODTABLEUS_SIZE;
00259         details->RAMPage = RPAGE_TUNE_ONE;
00260         details->FlashPage = TUNETABLES_PPAGE;
00261         details->RAMAddress = (void*)&TablesA.SmallTablesA.dwellDesiredVersusVoltageTable;
00262         details->FlashAddress = dwellDesiredVersusVoltageTableLocation;
00263         break;
00264     case dwellDesiredVersusVoltageTable2LocationID:
00265         details->size = TWODTABLEUS_SIZE;
00266         details->RAMPage = RPAGE_TUNE_TWO;
00267         details->FlashPage = TUNETABLES_PPAGE;
00268         details->RAMAddress = (void*)&TablesA.SmallTablesA.dwellDesiredVersusVoltageTable;
00269         details->FlashAddress = dwellDesiredVersusVoltageTable2Location;
00270         break;
00271     case injectorDeadTimeTableLocationID:
00272         details->size = TWODTABLEUS_SIZE;
00273         details->RAMPage = RPAGE_TUNE_ONE;
00274         details->FlashPage = TUNETABLES_PPAGE;
00275         details->RAMAddress = (void*)&TablesA.SmallTablesA.injectorDeadTimeTable;
00276         details->FlashAddress = injectorDeadTimeTableLocation;
00277         break;
00278     case injectorDeadTimeTable2LocationID:
00279         details->size = TWODTABLEUS_SIZE;
00280         details->RAMPage = RPAGE_TUNE_TWO;
00281         details->FlashPage = TUNETABLES_PPAGE;
00282         details->RAMAddress = (void*)&TablesA.SmallTablesA.injectorDeadTimeTable;
00283         details->FlashAddress = injectorDeadTimeTable2Location;
00284         break;
00285     case postStartEnrichmentTableLocationID:
00286         details->size = TWODTABLEUS_SIZE;
00287         details->RAMPage = RPAGE_TUNE_ONE;
00288         details->FlashPage = TUNETABLES_PPAGE;
00289         details->RAMAddress = (void*)&TablesA.SmallTablesA.postStartEnrichmentTable;
00290         details->FlashAddress = postStartEnrichmentTableLocation;
00291         break;
00292     case postStartEnrichmentTable2LocationID:
00293         details->size = TWODTABLEUS_SIZE;
00294         details->RAMPage = RPAGE_TUNE_TWO;
00295         details->FlashPage = TUNETABLES_PPAGE;
00296         details->RAMAddress = (void*)&TablesA.SmallTablesA.postStartEnrichmentTable;
00297         details->FlashAddress = postStartEnrichmentTable2Location;
00298         break;
00299     case engineTempEnrichmentTableFixedLocationID:
00300         details->size = TWODTABLEUS_SIZE;
00301         details->RAMPage = RPAGE_TUNE_ONE;
00302         details->FlashPage = TUNETABLES_PPAGE;
00303         details->RAMAddress = (void*)&TablesA.SmallTablesA.engineTempEnrichmentTableFixed;
00304         details->FlashAddress = engineTempEnrichmentTableFixedLocation;
00305         break;
00306     case engineTempEnrichmentTableFixed2LocationID:
00307         details->size = TWODTABLEUS_SIZE;
00308         details->RAMPage = RPAGE_TUNE_TWO;
00309         details->FlashPage = TUNETABLES_PPAGE;
00310         details->RAMAddress = (void*)&TablesA.SmallTablesA.engineTempEnrichmentTableFixed;
00311         details->FlashAddress = engineTempEnrichmentTableFixed2Location;
00312         break;
00313     case primingVolumeTableLocationID:
00314         details->size = TWODTABLEUS_SIZE;
00315         details->RAMPage = RPAGE_TUNE_ONE;
00316         details->FlashPage = TUNETABLES_PPAGE;
00317         details->RAMAddress = (void*)&TablesA.SmallTablesA.primingVolumeTable;
00318         details->FlashAddress = primingVolumeTableLocation;
00319         break;
00320     case primingVolumeTable2LocationID:
00321         details->size = TWODTABLEUS_SIZE;
00322         details->RAMPage = RPAGE_TUNE_TWO;
00323         details->FlashPage = TUNETABLES_PPAGE;
00324         details->RAMAddress = (void*)&TablesA.SmallTablesA.primingVolumeTable;
00325         details->FlashAddress = primingVolumeTable2Location;
00326         break;
00327     case engineTempEnrichmentTablePercentLocationID:
00328         details->size = TWODTABLEUS_SIZE;
00329         details->RAMPage = RPAGE_TUNE_ONE;
00330         details->FlashPage = TUNETABLES_PPAGE;
00331         details->RAMAddress = (void*)&TablesA.SmallTablesA.engineTempEnrichmentTablePercent;
00332         details->FlashAddress = engineTempEnrichmentTablePercentLocation;
00333         break;
00334     case engineTempEnrichmentTablePercent2LocationID:
00335         details->size = TWODTABLEUS_SIZE;
00336         details->RAMPage = RPAGE_TUNE_TWO;
00337         details->FlashPage = TUNETABLES_PPAGE;
00338         details->RAMAddress = (void*)&TablesA.SmallTablesA.engineTempEnrichmentTablePercent;
00339         details->FlashAddress = engineTempEnrichmentTablePercent2Location;
00340         break;
00341     case dwellMaxVersusRPMTableLocationID:
00342         details->size = TWODTABLEUS_SIZE;
00343         details->RAMPage = RPAGE_TUNE_ONE;
00344         details->FlashPage = TUNETABLES_PPAGE;
00345         details->RAMAddress = (void*)&TablesA.SmallTablesA.dwellMaxVersusRPMTable;
00346         details->FlashAddress = dwellMaxVersusRPMTableLocation;
00347         break;
00348     case dwellMaxVersusRPMTable2LocationID:
00349         details->size = TWODTABLEUS_SIZE;
00350         details->RAMPage = RPAGE_TUNE_TWO;
00351         details->FlashPage = TUNETABLES_PPAGE;
00352         details->RAMAddress = (void*)&TablesA.SmallTablesA.dwellMaxVersusRPMTable;
00353         details->FlashAddress = dwellMaxVersusRPMTable2Location;
00354         break;
00355 
00356     /* TablesB small tables */
00357     case perCylinderFuelTrimsLocationID:
00358         details->size = 12;
00359         details->RAMPage = RPAGE_TUNE_ONE;
00360         details->FlashPage = TUNETABLES_PPAGE;
00361         details->RAMAddress = (void*)&TablesB.SmallTablesB.perCylinderFuelTrims;
00362         details->FlashAddress = perCylinderFuelTrimsLocation;
00363         break;
00364     case perCylinderFuelTrims2LocationID:
00365         details->size = 12;
00366         details->RAMPage = RPAGE_TUNE_TWO;
00367         details->FlashPage = TUNETABLES_PPAGE;
00368         details->RAMAddress = (void*)&TablesB.SmallTablesB.perCylinderFuelTrims;
00369         details->FlashAddress = perCylinderFuelTrims2Location;
00370         break;
00371 
00372     /* TablesC small tables */
00373         // TODO add data chunks from TablesC when some are put in
00374 
00375     /* TablesD small tables */
00376         // TODO add data chunks from TablesD when some are put in
00377 
00378     /* filler block entries */
00379     case fillerALocationID:
00380         details->size = 576;
00381         details->RAMPage = RPAGE_TUNE_ONE;
00382         details->FlashPage = TUNETABLES_PPAGE;
00383         details->RAMAddress = (void*)&TablesA.SmallTablesA.filler;
00384         details->FlashAddress = fillerALocation;
00385         break;
00386     case fillerA2LocationID:
00387         details->size = 576;
00388         details->RAMPage = RPAGE_TUNE_TWO;
00389         details->FlashPage = TUNETABLES_PPAGE;
00390         details->RAMAddress = (void*)&TablesA.SmallTablesA.filler;
00391         details->FlashAddress = fillerA2Location;
00392         break;
00393     case fillerBLocationID:
00394         details->size = 1012;
00395         details->RAMPage = RPAGE_TUNE_ONE;
00396         details->FlashPage = TUNETABLES_PPAGE;
00397         details->RAMAddress = (void*)&TablesB.SmallTablesB.filler;
00398         details->FlashAddress = fillerBLocation;
00399         break;
00400     case fillerB2LocationID:
00401         details->size = 1012;
00402         details->RAMPage = RPAGE_TUNE_TWO;
00403         details->FlashPage = TUNETABLES_PPAGE;
00404         details->RAMAddress = (void*)&TablesB.SmallTablesB.filler;
00405         details->FlashAddress = fillerB2Location;
00406         break;
00407     case fillerCLocationID:
00408         details->size = 1024;
00409         details->RAMPage = RPAGE_TUNE_ONE;
00410         details->FlashPage = TUNETABLES_PPAGE;
00411         details->RAMAddress = (void*)&TablesC.SmallTablesC.filler;
00412         details->FlashAddress = fillerCLocation;
00413         break;
00414     case fillerC2LocationID:
00415         details->size = 1024;
00416         details->RAMPage = RPAGE_TUNE_TWO;
00417         details->FlashPage = TUNETABLES_PPAGE;
00418         details->RAMAddress = (void*)&TablesC.SmallTablesC.filler;
00419         details->FlashAddress = fillerC2Location;
00420         break;
00421     case fillerDLocationID:
00422         details->size = 1024;
00423         details->RAMPage = RPAGE_TUNE_ONE;
00424         details->FlashPage = TUNETABLES_PPAGE;
00425         details->RAMAddress = (void*)&TablesD.SmallTablesD.filler;
00426         details->FlashAddress = fillerDLocation;
00427         break;
00428     case fillerD2LocationID:
00429         details->size = 1024;
00430         details->RAMPage = RPAGE_TUNE_TWO;
00431         details->FlashPage = TUNETABLES_PPAGE;
00432         details->RAMAddress = (void*)&TablesD.SmallTablesD.filler;
00433         details->FlashAddress = fillerD2Location;
00434         break;
00435 
00436     /* Fixed conf 1 small chunks */
00437     case engineSettingsLocationID:
00438         details->size = ENGINE_SETTINGS_SIZE;
00439         details->FlashPage = PPAGE;
00440         details->FlashAddress = (void*)&(fixedConfigs1.engineSettings);
00441         break;
00442     case serialSettingsLocationID:
00443         details->size = SERIAL_SETTINGS_SIZE;
00444         details->FlashPage = PPAGE;
00445         details->FlashAddress = (void*)&(fixedConfigs1.serialSettings);
00446         break;
00447     case tachoSettingsLocationID:
00448         details->size = TACHO_SETTINGS_SIZE;
00449         details->FlashPage = PPAGE;
00450         details->FlashAddress = (void*)&(fixedConfigs1.tachoSettings);
00451         break;
00452     case coreSettingsALocationID:
00453         details->size = 2;
00454         details->FlashPage = PPAGE;
00455         details->FlashAddress = (void*)&(fixedConfigs1.coreSettingsA);
00456         break;
00457     case userTextFieldLocationID:
00458         details->size = userTextFieldArrayLength1;
00459         details->FlashPage = PPAGE;
00460         details->FlashAddress = (void*)&(fixedConfigs1.userTextField);
00461         break;
00462 
00463     /* Fixed conf 2 small chunks */
00464     case sensorRangesLocationID:
00465         details->size = SENSOR_RANGES_SIZE;
00466         details->FlashPage = PPAGE;
00467         details->FlashAddress = (void*)&(fixedConfigs2.sensorRanges);
00468         break;
00469     case sensorPresetsLocationID:
00470         details->size = SENSOR_PRESETS_SIZE;
00471         details->FlashPage = PPAGE;
00472         details->FlashAddress = (void*)&(fixedConfigs2.sensorPresets);
00473         break;
00474     case sensorSettingsLocationID:
00475         details->size = SENSOR_SETTINGS_SIZE;
00476         details->FlashPage = PPAGE;
00477         details->FlashAddress = (void*)&(fixedConfigs2.sensorSettings);
00478         break;
00479     case userTextField2LocationID:
00480         details->size = userTextFieldArrayLength2;
00481         details->FlashPage = PPAGE;
00482         details->FlashAddress = (void*)&(fixedConfigs2.userTextField2);
00483         break;
00484 
00485     default:
00486         /* Return early if locationID is not valid. */
00487         return locationIDNotFound;
00488     }
00489 
00490     /* Fall through to not return error */
00491     return 0;
00492 }


Generated on Mon Jan 26 00:16:17 2009 for FreeEMS by  doxygen 1.5.8