Split config_state.[ch] to config_globals.[ch] and basic_types.[ch]
This commit is contained in:
@@ -1,14 +1,4 @@
|
|||||||
#include "config_state.h"
|
#include "basic_types.h"
|
||||||
|
|
||||||
static uint8_t hardwareConfig[HARDWARE_CONFIG_SIZE];
|
|
||||||
config_buffer_t HardwareConfigBuffer = {hardwareConfig};
|
|
||||||
|
|
||||||
static uint8_t userConfig1[USER_CONFIG_SIZE];
|
|
||||||
static uint8_t __attribute__((section (".m_data_2"))) userConfig2[USER_CONFIG_SIZE];
|
|
||||||
config_buffer_t UserConfigBuffer = { userConfig1 };
|
|
||||||
config_buffer_t StagingUserConfigBuffer = { userConfig2 };
|
|
||||||
|
|
||||||
bool ParserRunDry;
|
|
||||||
|
|
||||||
uint8_t readUInt8(config_buffer_t *buffer) {
|
uint8_t readUInt8(config_buffer_t *buffer) {
|
||||||
return buffer->buffer[buffer->offset++];
|
return buffer->buffer[buffer->offset++];
|
||||||
@@ -1,16 +1,9 @@
|
|||||||
#ifndef __CONFIG_STATE_H__
|
#ifndef __BASIC_TYPES_H__
|
||||||
#define __CONFIG_STATE_H__
|
#define __BASIC_TYPES_H__
|
||||||
|
|
||||||
// Includes:
|
// Includes:
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "fsl_common.h"
|
#include "fsl_common.h"
|
||||||
#include "eeprom.h"
|
|
||||||
|
|
||||||
// Macros:
|
|
||||||
|
|
||||||
#define HARDWARE_CONFIG_SIZE 64
|
|
||||||
#define USER_CONFIG_SIZE (EEPROM_SIZE - HARDWARE_CONFIG_SIZE)
|
|
||||||
|
|
||||||
// Typedefs:
|
// Typedefs:
|
||||||
|
|
||||||
@@ -19,13 +12,6 @@
|
|||||||
uint16_t offset;
|
uint16_t offset;
|
||||||
} config_buffer_t;
|
} config_buffer_t;
|
||||||
|
|
||||||
// Variables:
|
|
||||||
|
|
||||||
extern bool ParserRunDry;
|
|
||||||
extern config_buffer_t HardwareConfigBuffer;
|
|
||||||
extern config_buffer_t UserConfigBuffer;
|
|
||||||
extern config_buffer_t StagingUserConfigBuffer;
|
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
uint8_t readUInt8(config_buffer_t *buffer);
|
uint8_t readUInt8(config_buffer_t *buffer);
|
||||||
11
right/src/config_parser/config_globals.c
Normal file
11
right/src/config_parser/config_globals.c
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#include "config_globals.h"
|
||||||
|
|
||||||
|
static uint8_t hardwareConfig[HARDWARE_CONFIG_SIZE];
|
||||||
|
config_buffer_t HardwareConfigBuffer = {hardwareConfig};
|
||||||
|
|
||||||
|
static uint8_t userConfig1[USER_CONFIG_SIZE];
|
||||||
|
static uint8_t __attribute__((section (".m_data_2"))) userConfig2[USER_CONFIG_SIZE];
|
||||||
|
config_buffer_t UserConfigBuffer = { userConfig1 };
|
||||||
|
config_buffer_t StagingUserConfigBuffer = { userConfig2 };
|
||||||
|
|
||||||
|
bool ParserRunDry;
|
||||||
22
right/src/config_parser/config_globals.h
Normal file
22
right/src/config_parser/config_globals.h
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#ifndef __CONFIG_STATE_H__
|
||||||
|
#define __CONFIG_STATE_H__
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern bool ParserRunDry;
|
||||||
|
extern config_buffer_t HardwareConfigBuffer;
|
||||||
|
extern config_buffer_t UserConfigBuffer;
|
||||||
|
extern config_buffer_t StagingUserConfigBuffer;
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
#include "parse_keymap.h"
|
#include "parse_keymap.h"
|
||||||
#include "parse_macro.h"
|
#include "parse_macro.h"
|
||||||
#include "keymaps.h"
|
#include "keymaps.h"
|
||||||
|
#include "config_globals.h"
|
||||||
|
|
||||||
static parser_error_t parseModuleConfiguration(config_buffer_t *buffer) {
|
static parser_error_t parseModuleConfiguration(config_buffer_t *buffer) {
|
||||||
uint8_t id = readUInt8(buffer);
|
uint8_t id = readUInt8(buffer);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
// Includes:
|
// Includes:
|
||||||
|
|
||||||
#include "config_state.h"
|
#include "basic_types.h"
|
||||||
|
|
||||||
// Typedefs:
|
// Typedefs:
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#include "config_parser/config_globals.h"
|
||||||
|
#include "config_parser/parse_config.h"
|
||||||
#include "config_parser/parse_keymap.h"
|
#include "config_parser/parse_keymap.h"
|
||||||
#include "key_action.h"
|
#include "key_action.h"
|
||||||
#include "keymaps.h"
|
#include "keymaps.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "fsl_common.h"
|
#include "fsl_common.h"
|
||||||
#include "config_parser/config_state.h"
|
#include "config_parser/config_globals.h"
|
||||||
#include "i2c_addresses.h"
|
#include "i2c_addresses.h"
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
#include "eeprom.h"
|
#include "eeprom.h"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "keymaps.h"
|
#include "keymaps.h"
|
||||||
#include "led_display.h"
|
#include "led_display.h"
|
||||||
#include "config_parser/parse_keymap.h"
|
#include "config_parser/parse_keymap.h"
|
||||||
|
#include "config_parser/config_globals.h"
|
||||||
|
|
||||||
// TODO: Restore Ctrl and Super keys and Mod+N.
|
// TODO: Restore Ctrl and Super keys and Mod+N.
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "peripherals/led_driver.h"
|
#include "peripherals/led_driver.h"
|
||||||
#include "peripherals/merge_sensor.h"
|
#include "peripherals/merge_sensor.h"
|
||||||
#include "config_parser/parse_config.h"
|
#include "config_parser/parse_config.h"
|
||||||
#include "config_parser/config_state.h"
|
#include "config_parser/config_globals.h"
|
||||||
#include "led_pwm.h"
|
#include "led_pwm.h"
|
||||||
#include "slave_scheduler.h"
|
#include "slave_scheduler.h"
|
||||||
#include "slave_drivers/uhk_module_driver.h"
|
#include "slave_drivers/uhk_module_driver.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user