|
|
@@ -145,7 +145,7 @@ func (b *MCUCtrlBoard) StartUartWriter() {
|
|
|
|
|
|
// 保存控制板的配置参数
|
|
|
func SaveMCUConfig(data []byte) error {
|
|
|
- path := filepath.Join(baseapp.CFG_DIR, "mcu_param.json")
|
|
|
+ path := filepath.Join(baseapp.CFG_DIR, "mcu_config.json")
|
|
|
tmpPath := path + ".tmp"
|
|
|
|
|
|
f, err := os.Create(tmpPath)
|
|
|
@@ -177,7 +177,7 @@ func SaveMCUConfig(data []byte) error {
|
|
|
|
|
|
// 读取控制板的配置参数
|
|
|
func LoadMCUConfig() ([]byte, error) {
|
|
|
- path := filepath.Join(baseapp.CFG_DIR, "mcu_param.json")
|
|
|
+ path := filepath.Join(baseapp.CFG_DIR, "mcu_config.json")
|
|
|
|
|
|
data, err := os.ReadFile(path)
|
|
|
if err != nil {
|
|
|
@@ -185,7 +185,7 @@ func LoadMCUConfig() ([]byte, error) {
|
|
|
}
|
|
|
|
|
|
if !json.Valid(data) {
|
|
|
- return nil, errors.New("invalid mcu param json")
|
|
|
+ return nil, errors.New("无效的MCU配置文件")
|
|
|
}
|
|
|
|
|
|
return data, nil
|