Make EEPROM transfers receive an operation and a buffer id parameter. This allows reading and writing both staging and validated user configurations which will aid future debugging. This API is also cleaner.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "config_globals.h"
|
||||
#include "attributes.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
static uint8_t hardwareConfig[HARDWARE_CONFIG_SIZE];
|
||||
static uint8_t ATTR_DATA2 stagingUserConfig[USER_CONFIG_SIZE];
|
||||
@@ -10,3 +11,17 @@ config_buffer_t StagingUserConfigBuffer = { stagingUserConfig };
|
||||
config_buffer_t ValidatedUserConfigBuffer = { validatedUserConfig };
|
||||
|
||||
bool ParserRunDry;
|
||||
|
||||
config_buffer_t* ConfigBufferIdToConfigBuffer(config_buffer_id_t configBufferId)
|
||||
{
|
||||
switch (configBufferId) {
|
||||
case ConfigBufferId_HardwareConfig:
|
||||
return &HardwareConfigBuffer;
|
||||
case ConfigBufferId_StagingUserConfig:
|
||||
return &StagingUserConfigBuffer;
|
||||
case ConfigBufferId_ValidatedUserConfig:
|
||||
return &ValidatedUserConfigBuffer;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,14 +4,8 @@
|
||||
// Includes:
|
||||
|
||||
#include "fsl_common.h"
|
||||
#include "eeprom.h"
|
||||
#include "basic_types.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#define HARDWARE_CONFIG_SIZE 64
|
||||
#define USER_CONFIG_SIZE (EEPROM_SIZE - HARDWARE_CONFIG_SIZE)
|
||||
|
||||
// Typedefs:
|
||||
|
||||
typedef enum {
|
||||
@@ -27,4 +21,8 @@
|
||||
extern config_buffer_t StagingUserConfigBuffer;
|
||||
extern config_buffer_t ValidatedUserConfigBuffer;
|
||||
|
||||
// Functions:
|
||||
|
||||
config_buffer_t* ConfigBufferIdToConfigBuffer(config_buffer_id_t configBufferId);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user