05-14-2015, 10:20 PM
Hi,
The new config section is about done and it would be nice to have a decent interface for it. For starters, can you tell me what you would like to see for each struct in the master config struct? I'll start by telling you what exists now:
/* Master config */
typedef struct MasterConfig {
  MechanicalProperties   mechanicalProperties;
  TachDecoderSettings   tachDecoderSettings;
  CylinderConfig      CylinderSetup[MAX_CYLINDER_COUNT];
  CylinderAngleConfig   CylindersAngles[MAX_CYLINDER_COUNT];
  FuelingProperties    fuelingProperties;
  SensorProperties     sensorProperties;
  OperatingLimits     operatingLimits[NUM_OPERATING_LEVELS];
  GPIOchannel       GPIOchannels[NUM_GPIO_CHANNELS];
  XGateOutputCHpinMapping xGateOutputCHpinMapping[XGATE_CHANNEL_COUNT];
  ComSettings       comSettings;
  uint8_t         configMessage[25];
}MasterConfig;
/*Â CylinderConfig details */
typedef struct {
  SyncedData *syncedEngineData;   /* done by firmware config */
  outputEvent *igntionEvent;        /* done by firmware config */
  outputEvent *primaryFuelEvent;    /* done by firmware config */
  outputEvent *secondaryFuelEvent;  /* done by firmware config */
  uint16_t TDCAngle;             /* Specified by user */
  uint16_t ReadAngle;             /* Specified by user */
  uint16_t InjectionAngle;          /* Specified by user */
}CylinderConfig;
Given the two nested structs above, if you wanted to change your injection angle, you would want to modify the CylinderConfig member variable "InjectionAngle". I suppose at a minimum I need to provide you with:
 1. A DATA_ID so you can push and pull the CylinderConfig over the serial port.
 2. A size of the data in total, we could just include the three 16-bit variables in the payload, so there is no chance of corrupting anything else.
 3. A data-offset for each member
 4. A description for each member
 5. A scaler, much like what is provided in the data-log descriptor
The other side of things, is how to generate this data, but I think we should worry about that after the first part of it is done.
-Sean
The new config section is about done and it would be nice to have a decent interface for it. For starters, can you tell me what you would like to see for each struct in the master config struct? I'll start by telling you what exists now:
/* Master config */
typedef struct MasterConfig {
  MechanicalProperties   mechanicalProperties;
  TachDecoderSettings   tachDecoderSettings;
  CylinderConfig      CylinderSetup[MAX_CYLINDER_COUNT];
  CylinderAngleConfig   CylindersAngles[MAX_CYLINDER_COUNT];
  FuelingProperties    fuelingProperties;
  SensorProperties     sensorProperties;
  OperatingLimits     operatingLimits[NUM_OPERATING_LEVELS];
  GPIOchannel       GPIOchannels[NUM_GPIO_CHANNELS];
  XGateOutputCHpinMapping xGateOutputCHpinMapping[XGATE_CHANNEL_COUNT];
  ComSettings       comSettings;
  uint8_t         configMessage[25];
}MasterConfig;
/*Â CylinderConfig details */
typedef struct {
  SyncedData *syncedEngineData;   /* done by firmware config */
  outputEvent *igntionEvent;        /* done by firmware config */
  outputEvent *primaryFuelEvent;    /* done by firmware config */
  outputEvent *secondaryFuelEvent;  /* done by firmware config */
  uint16_t TDCAngle;             /* Specified by user */
  uint16_t ReadAngle;             /* Specified by user */
  uint16_t InjectionAngle;          /* Specified by user */
}CylinderConfig;
Given the two nested structs above, if you wanted to change your injection angle, you would want to modify the CylinderConfig member variable "InjectionAngle". I suppose at a minimum I need to provide you with:
 1. A DATA_ID so you can push and pull the CylinderConfig over the serial port.
 2. A size of the data in total, we could just include the three 16-bit variables in the payload, so there is no chance of corrupting anything else.
 3. A data-offset for each member
 4. A description for each member
 5. A scaler, much like what is provided in the data-log descriptor
The other side of things, is how to generate this data, but I think we should worry about that after the first part of it is done.
-Sean