Move back to swapping pointers
This commit is contained in:
@@ -3,11 +3,10 @@
|
|||||||
static uint8_t hardwareConfig[HARDWARE_CONFIG_SIZE];
|
static uint8_t hardwareConfig[HARDWARE_CONFIG_SIZE];
|
||||||
config_buffer_t HardwareConfigBuffer = {hardwareConfig};
|
config_buffer_t HardwareConfigBuffer = {hardwareConfig};
|
||||||
|
|
||||||
static uint8_t userConfig[USER_CONFIG_SIZE];
|
static uint8_t userConfig1[USER_CONFIG_SIZE];
|
||||||
static uint8_t __attribute__((section (".m_data_2"))) stagingUserConfig[USER_CONFIG_SIZE];
|
static uint8_t __attribute__((section (".m_data_2"))) userConfig2[USER_CONFIG_SIZE];
|
||||||
|
config_buffer_t UserConfigBuffer = { userConfig1 };
|
||||||
config_buffer_t UserConfigBuffer = { userConfig };
|
config_buffer_t StagingUserConfigBuffer = { userConfig2 };
|
||||||
config_buffer_t StagingUserConfigBuffer = { stagingUserConfig };
|
|
||||||
|
|
||||||
bool ParserRunDry;
|
bool ParserRunDry;
|
||||||
|
|
||||||
|
|||||||
@@ -95,9 +95,13 @@ void TestConfig(void)
|
|||||||
|
|
||||||
void applyConfig(void)
|
void applyConfig(void)
|
||||||
{
|
{
|
||||||
|
uint8_t *temp;
|
||||||
|
|
||||||
TestConfig(); // This line will be removed. TestConfig will be called by Agent separately.
|
TestConfig(); // This line will be removed. TestConfig will be called by Agent separately.
|
||||||
memcpy(&UserConfigBuffer, &StagingUserConfigBuffer, USER_CONFIG_SIZE);
|
|
||||||
ParserRunDry = false;
|
ParserRunDry = false;
|
||||||
|
temp = UserConfigBuffer.buffer;
|
||||||
|
UserConfigBuffer.buffer = StagingUserConfigBuffer.buffer;
|
||||||
|
StagingUserConfigBuffer.buffer = temp;
|
||||||
UserConfigBuffer.offset = 0;
|
UserConfigBuffer.offset = 0;
|
||||||
GenericHidOutBuffer[0] = ParseConfig(&UserConfigBuffer);
|
GenericHidOutBuffer[0] = ParseConfig(&UserConfigBuffer);
|
||||||
GenericHidOutBuffer[1] = UserConfigBuffer.offset;
|
GenericHidOutBuffer[1] = UserConfigBuffer.offset;
|
||||||
|
|||||||
Reference in New Issue
Block a user