Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed00051a2c | ||
|
|
577092a4f9 |
No files matched your search
@@ -149,7 +149,7 @@ CONFIG_RT_DFS_ELM_LFN_UNICODE_2=y
|
||||
CONFIG_RT_DFS_ELM_LFN_UNICODE=2
|
||||
CONFIG_RT_DFS_ELM_MAX_LFN=255
|
||||
CONFIG_RT_DFS_ELM_DRIVES=2
|
||||
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512
|
||||
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=4096
|
||||
CONFIG_RT_DFS_ELM_USE_ERASE=y
|
||||
CONFIG_RT_DFS_ELM_REENTRANT=y
|
||||
CONFIG_RT_DFS_ELM_MUTEX_TIMEOUT=3000
|
||||
|
||||
@@ -76,7 +76,7 @@ void uart_thread_entry(void *parameter)
|
||||
// 等待处理完成
|
||||
if (rt_sem_take(req->sem, rt_tick_from_millisecond(100)) >= RT_EOK)
|
||||
{
|
||||
rs485_send(hinst, req->output, req->output_len);
|
||||
if(req->output_len>0) rs485_send(hinst, req->output, req->output_len);
|
||||
}
|
||||
}
|
||||
// 清理
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2025-12-01 Administrator the first version
|
||||
*/
|
||||
#include <rtthread.h>
|
||||
#include <dfs_posix.h>
|
||||
#include "ini.h"
|
||||
#include "Variable.h"
|
||||
|
||||
#define INI_config "/sys/828config.ini"
|
||||
|
||||
int read_write_sample(void)
|
||||
{
|
||||
//检查文件
|
||||
if (access(INI_config, F_OK) != 0)
|
||||
{
|
||||
int fd = open(INI_config, O_WRONLY | O_CREAT);//创建文件
|
||||
close(fd);
|
||||
}
|
||||
// 初始化INI解析器
|
||||
INI_File *ini = ini_init();
|
||||
if (!ini) {
|
||||
rt_kprintf("1\n");
|
||||
return -1;
|
||||
}
|
||||
// 解析INI文件
|
||||
if (ini_parse(ini, INI_config) != 0) {
|
||||
rt_kprintf("2\n");
|
||||
ini_free(ini);
|
||||
return -1;
|
||||
}
|
||||
// 读取各种类型的值
|
||||
strncpy(machine_ID, ini_get_value(ini, "CONFIG", "ID"),sizeof(machine_ID));
|
||||
machine_name = ini_get_value(ini, "CONFIG", "NAME");
|
||||
|
||||
//// ini_set_value(ini,"database", "host","192.168.9.1");
|
||||
|
||||
// ini_save(ini,INI_config);
|
||||
|
||||
// 清理资源
|
||||
ini_free(ini);
|
||||
return 0;
|
||||
}
|
||||
|
||||
INIT_APP_EXPORT(read_write_sample);
|
||||
@@ -0,0 +1,278 @@
|
||||
/**
|
||||
* Copyright (c) 2016 rxi
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "ini.h"
|
||||
|
||||
// 去除字符串首尾的空白字符
|
||||
char* trim(char* str) {
|
||||
char *end;
|
||||
|
||||
// 去除首部空白
|
||||
while(isspace((unsigned char)*str)) str++;
|
||||
|
||||
if(*str == 0) return str;
|
||||
|
||||
// 去除尾部空白
|
||||
end = str + strlen(str) - 1;
|
||||
while(end > str && isspace((unsigned char)*end)) end--;
|
||||
|
||||
end[1] = '\0';
|
||||
return str;
|
||||
}
|
||||
|
||||
// 初始化INI文件结构
|
||||
INI_File* ini_init() {
|
||||
INI_File *ini = malloc(sizeof(INI_File));
|
||||
if (!ini) return NULL;
|
||||
|
||||
ini->section_capacity = 10;
|
||||
ini->section_count = 0;
|
||||
ini->sections = malloc(sizeof(INI_Section) * ini->section_capacity);
|
||||
|
||||
return ini;
|
||||
}
|
||||
|
||||
// 释放INI文件结构
|
||||
void ini_free(INI_File *ini) {
|
||||
if (!ini) return;
|
||||
|
||||
for (int i = 0; i < ini->section_count; i++) {
|
||||
free(ini->sections[i].entries);
|
||||
}
|
||||
free(ini->sections);
|
||||
free(ini);
|
||||
}
|
||||
|
||||
// 解析INI文件
|
||||
int ini_parse(INI_File *ini, const char *filename) {
|
||||
FILE *file = fopen(filename, "r");
|
||||
if (!file) {
|
||||
return -1; // 文件打开失败
|
||||
}
|
||||
|
||||
char line[MAX_LINE_LENGTH];
|
||||
char current_section[MAX_SECTION_LENGTH] = "";
|
||||
int line_num = 0;
|
||||
|
||||
while (fgets(line, sizeof(line), file)) {
|
||||
line_num++;
|
||||
char *trimmed_line = trim(line);
|
||||
|
||||
// 跳过空行和注释
|
||||
if (strlen(trimmed_line) == 0 || trimmed_line[0] == ';' || trimmed_line[0] == '#') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 处理节(section)
|
||||
if (trimmed_line[0] == '[' && trimmed_line[strlen(trimmed_line)-1] == ']') {
|
||||
strncpy(current_section, trimmed_line + 1, strlen(trimmed_line) - 2);
|
||||
current_section[strlen(trimmed_line) - 2] = '\0';
|
||||
trim(current_section);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 处理键值对
|
||||
char *equal_pos = strchr(trimmed_line, '=');
|
||||
if (equal_pos) {
|
||||
*equal_pos = '\0';
|
||||
char *key = trim(trimmed_line);
|
||||
char *value = trim(equal_pos + 1);
|
||||
|
||||
// 如果key或value为空,跳过
|
||||
if (strlen(key) == 0 || strlen(value) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 添加到INI结构
|
||||
ini_set_value(ini, current_section, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 设置键值对
|
||||
int ini_set_value(INI_File *ini, const char *section, const char *key, const char *value) {
|
||||
// 查找或创建section
|
||||
INI_Section *current_section = NULL;
|
||||
for (int i = 0; i < ini->section_count; i++) {
|
||||
if (strcmp(ini->sections[i].section, section) == 0) {
|
||||
current_section = &ini->sections[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 如果section不存在,创建新的
|
||||
if (!current_section) {
|
||||
if (ini->section_count >= ini->section_capacity) {
|
||||
ini->section_capacity *= 2;
|
||||
ini->sections = realloc(ini->sections, sizeof(INI_Section) * ini->section_capacity);
|
||||
}
|
||||
|
||||
current_section = &ini->sections[ini->section_count];
|
||||
strncpy(current_section->section, section, MAX_SECTION_LENGTH - 1);
|
||||
current_section->section[MAX_SECTION_LENGTH - 1] = '\0';
|
||||
current_section->entry_capacity = 10;
|
||||
current_section->entry_count = 0;
|
||||
current_section->entries = malloc(sizeof(INI_Entry) * current_section->entry_capacity);
|
||||
ini->section_count++;
|
||||
}
|
||||
|
||||
// 查找是否已存在该key
|
||||
for (int i = 0; i < current_section->entry_count; i++) {
|
||||
if (strcmp(current_section->entries[i].key, key) == 0) {
|
||||
// 更新已存在的值
|
||||
strncpy(current_section->entries[i].value, value, MAX_VALUE_LENGTH - 1);
|
||||
current_section->entries[i].value[MAX_VALUE_LENGTH - 1] = '\0';
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 添加新的键值对
|
||||
if (current_section->entry_count >= current_section->entry_capacity) {
|
||||
current_section->entry_capacity *= 2;
|
||||
current_section->entries = realloc(current_section->entries,
|
||||
sizeof(INI_Entry) * current_section->entry_capacity);
|
||||
}
|
||||
|
||||
INI_Entry *entry = ¤t_section->entries[current_section->entry_count];
|
||||
strncpy(entry->key, key, MAX_KEY_LENGTH - 1);
|
||||
entry->key[MAX_KEY_LENGTH - 1] = '\0';
|
||||
strncpy(entry->value, value, MAX_VALUE_LENGTH - 1);
|
||||
entry->value[MAX_VALUE_LENGTH - 1] = '\0';
|
||||
current_section->entry_count++;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 保存INI文件到磁盘
|
||||
int ini_save(INI_File *ini, const char *filename) {
|
||||
FILE *file = fopen(filename, "w");
|
||||
if (!file) {
|
||||
return -1; // 文件打开失败
|
||||
}
|
||||
|
||||
// 首先处理空section(全局设置)
|
||||
for (int i = 0; i < ini->section_count; i++) {
|
||||
if (strlen(ini->sections[i].section) == 0) {
|
||||
for (int j = 0; j < ini->sections[i].entry_count; j++) {
|
||||
fprintf(file, "%s = %s\n",
|
||||
ini->sections[i].entries[j].key,
|
||||
ini->sections[i].entries[j].value);
|
||||
}
|
||||
if (ini->sections[i].entry_count > 0) {
|
||||
fprintf(file, "\n"); // 在节之间添加空行
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 处理其他section
|
||||
for (int i = 0; i < ini->section_count; i++) {
|
||||
if (strlen(ini->sections[i].section) > 0) {
|
||||
// 写入section头
|
||||
fprintf(file, "[%s]\n", ini->sections[i].section);
|
||||
|
||||
// 写入该section的所有键值对
|
||||
for (int j = 0; j < ini->sections[i].entry_count; j++) {
|
||||
fprintf(file, "%s = %s\n",
|
||||
ini->sections[i].entries[j].key,
|
||||
ini->sections[i].entries[j].value);
|
||||
}
|
||||
fprintf(file, "\n"); // 在节之间添加空行
|
||||
}
|
||||
}
|
||||
|
||||
fclose(file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 删除指定的键
|
||||
int ini_delete_key(INI_File *ini, const char *section, const char *key) {
|
||||
for (int i = 0; i < ini->section_count; i++) {
|
||||
if (strcmp(ini->sections[i].section, section) == 0) {
|
||||
for (int j = 0; j < ini->sections[i].entry_count; j++) {
|
||||
if (strcmp(ini->sections[i].entries[j].key, key) == 0) {
|
||||
// 将后面的元素前移
|
||||
for (int k = j; k < ini->sections[i].entry_count - 1; k++) {
|
||||
memcpy(&ini->sections[i].entries[k],
|
||||
&ini->sections[i].entries[k + 1],
|
||||
sizeof(INI_Entry));
|
||||
}
|
||||
ini->sections[i].entry_count--;
|
||||
return 0; // 成功删除
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return -1; // 未找到
|
||||
}
|
||||
// 获取键值
|
||||
char* ini_get_value(INI_File *ini, const char *section, const char *key) {
|
||||
for (int i = 0; i < ini->section_count; i++) {
|
||||
if (strcmp(ini->sections[i].section, section) == 0) {
|
||||
for (int j = 0; j < ini->sections[i].entry_count; j++) {
|
||||
if (strcmp(ini->sections[i].entries[j].key, key) == 0) {
|
||||
return ini->sections[i].entries[j].value;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return NULL; // 未找到
|
||||
}
|
||||
|
||||
// 获取整数值
|
||||
int ini_get_int(INI_File *ini, const char *section, const char *key, int default_value) {
|
||||
const char *value = ini_get_value(ini, section, key);
|
||||
if (!value) return default_value;
|
||||
return atoi(value);
|
||||
}
|
||||
|
||||
// 获取浮点数值
|
||||
double ini_get_double(INI_File *ini, const char *section, const char *key, double default_value) {
|
||||
const char *value = ini_get_value(ini, section, key);
|
||||
if (!value) return default_value;
|
||||
return atof(value);
|
||||
}
|
||||
|
||||
// 获取布尔值
|
||||
int ini_get_bool(INI_File *ini, const char *section, const char *key, int default_value) {
|
||||
const char *value = ini_get_value(ini, section, key);
|
||||
if (!value) return default_value;
|
||||
|
||||
if (strcasecmp(value, "true") == 0 || strcasecmp(value, "yes") == 0 ||
|
||||
strcasecmp(value, "1") == 0 || strcasecmp(value, "on") == 0) {
|
||||
return 1;
|
||||
}
|
||||
if (strcasecmp(value, "false") == 0 || strcasecmp(value, "no") == 0 ||
|
||||
strcasecmp(value, "0") == 0 || strcasecmp(value, "off") == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return default_value;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2021, RT-Thread Development Team
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2025-12-01 Administrator the first version
|
||||
*/
|
||||
#ifndef APPLICATIONS_INI_INI_H_
|
||||
#define APPLICATIONS_INI_INI_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#define MAX_LINE_LENGTH 256
|
||||
#define MAX_KEY_LENGTH 64
|
||||
#define MAX_VALUE_LENGTH 128
|
||||
#define MAX_SECTION_LENGTH 64
|
||||
|
||||
typedef struct {
|
||||
char key[MAX_KEY_LENGTH];
|
||||
char value[MAX_VALUE_LENGTH];
|
||||
} INI_Entry;
|
||||
|
||||
typedef struct {
|
||||
char section[MAX_SECTION_LENGTH];
|
||||
INI_Entry *entries;
|
||||
int entry_count;
|
||||
int entry_capacity;
|
||||
} INI_Section;
|
||||
|
||||
typedef struct {
|
||||
INI_Section *sections;
|
||||
int section_count;
|
||||
int section_capacity;
|
||||
} INI_File;
|
||||
|
||||
extern INI_File* ini_init();
|
||||
extern void ini_free(INI_File *ini);
|
||||
extern int ini_parse(INI_File *ini, const char *filename);
|
||||
extern int ini_set_value(INI_File *ini, const char *section, const char *key, const char *value);
|
||||
extern int ini_save(INI_File *ini, const char *filename);
|
||||
extern int ini_delete_key(INI_File *ini, const char *section, const char *key);
|
||||
extern char* ini_get_value(INI_File *ini, const char *section, const char *key);
|
||||
extern int ini_get_int(INI_File *ini, const char *section, const char *key, int default_value);
|
||||
extern double ini_get_double(INI_File *ini, const char *section, const char *key, double default_value);
|
||||
extern int ini_get_bool(INI_File *ini, const char *section, const char *key, int default_value);
|
||||
|
||||
#endif /* APPLICATIONS_INI_INI_H_ */
|
||||
@@ -7,8 +7,8 @@
|
||||
char *DATA_dat;
|
||||
char DATA_machins[3];
|
||||
char DATA_api[5];
|
||||
char *machine_name = "Q109";
|
||||
char machine_ID[3] = "23";
|
||||
char *machine_name = "828";
|
||||
char machine_ID[3] = "1";
|
||||
|
||||
// 状态标志
|
||||
char MACHINE_ERR = 0;
|
||||
|
||||
@@ -29,7 +29,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef DB_MAX_WAITING_MS
|
||||
#define DB_MAX_WAITING_MS (5000) /**< 命令最大等待时间(毫秒),默认 5 秒 */
|
||||
#define DB_MAX_WAITING_MS (500) /**< 命令最大等待时间(毫秒),默认 5 秒 */
|
||||
#endif
|
||||
|
||||
#ifndef DB_QUEUE_SIZE
|
||||
|
||||
@@ -267,10 +267,10 @@ void HAL_SD_MspInit(SD_HandleTypeDef* hsd)
|
||||
*/
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SDMMC;
|
||||
PeriphClkInitStruct.PLL2.PLL2M = 32;
|
||||
PeriphClkInitStruct.PLL2.PLL2N = 150;
|
||||
PeriphClkInitStruct.PLL2.PLL2N = 200;
|
||||
PeriphClkInitStruct.PLL2.PLL2P = 2;
|
||||
PeriphClkInitStruct.PLL2.PLL2Q = 2;
|
||||
PeriphClkInitStruct.PLL2.PLL2R = 2;
|
||||
PeriphClkInitStruct.PLL2.PLL2R = 4;
|
||||
PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_1;
|
||||
PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOWIDE;
|
||||
PeriphClkInitStruct.PLL2.PLL2FRACN = 0;
|
||||
|
||||
+10
-9
@@ -283,8 +283,8 @@ ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UAScriptAfterPath=
|
||||
ProjectManager.UAScriptBeforePath=
|
||||
ProjectManager.UnderRoot=false
|
||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_FMC_Init-FMC-false-HAL-true,5-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,6-MX_USART1_UART_Init-USART1-false-HAL-true,7-MX_USART2_UART_Init-USART2-false-HAL-true,8-MX_QUADSPI_Init-QUADSPI-false-HAL-true,9-MX_RTC_Init-RTC-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
|
||||
RCC.ADCFreq_Value=150000000
|
||||
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_FMC_Init-FMC-false-HAL-true,5-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,6-MX_USART1_UART_Init-USART1-false-HAL-true,7-MX_USART2_UART_Init-USART2-false-HAL-true,8-MX_QUADSPI_Init-QUADSPI-false-HAL-true,9-MX_RTC_Init-RTC-false-HAL-true,10-MX_IWDG1_Init-IWDG1-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
|
||||
RCC.ADCFreq_Value=200000000
|
||||
RCC.AHB12Freq_Value=240000000
|
||||
RCC.AHB4Freq_Value=240000000
|
||||
RCC.APB1Freq_Value=120000000
|
||||
@@ -305,16 +305,17 @@ RCC.DFSDMACLkFreq_Value=120000000
|
||||
RCC.DFSDMFreq_Value=120000000
|
||||
RCC.DIVM1=4
|
||||
RCC.DIVN1=60
|
||||
RCC.DIVN2=150
|
||||
RCC.DIVN2=200
|
||||
RCC.DIVP1Freq_Value=480000000
|
||||
RCC.DIVP2Freq_Value=150000000
|
||||
RCC.DIVP2Freq_Value=200000000
|
||||
RCC.DIVP3Freq_Value=129000000
|
||||
RCC.DIVQ1=8
|
||||
RCC.DIVQ1Freq_Value=120000000
|
||||
RCC.DIVQ2Freq_Value=150000000
|
||||
RCC.DIVQ2Freq_Value=200000000
|
||||
RCC.DIVQ3Freq_Value=129000000
|
||||
RCC.DIVR1Freq_Value=480000000
|
||||
RCC.DIVR2Freq_Value=150000000
|
||||
RCC.DIVR2=4
|
||||
RCC.DIVR2Freq_Value=100000000
|
||||
RCC.DIVR3Freq_Value=129000000
|
||||
RCC.FDCANFreq_Value=120000000
|
||||
RCC.FMCFreq_Value=240000000
|
||||
@@ -325,7 +326,7 @@ RCC.HPRE=RCC_HCLK_DIV2
|
||||
RCC.HRTIMFreq_Value=240000000
|
||||
RCC.I2C123Freq_Value=120000000
|
||||
RCC.I2C4Freq_Value=120000000
|
||||
RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,D1PPRE,D2PPRE1,D2PPRE2,D3PPRE,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVN1,DIVN2,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,HPRE,HRTIMFreq_Value,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL3FRACN,PLLFRACN,QSPICLockSelection,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI23Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMC1CLockSelection,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
|
||||
RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,D1PPRE,D2PPRE1,D2PPRE2,D3PPRE,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVN1,DIVN2,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1,DIVQ1Freq_Value,DIVQ2Freq_Value,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2,DIVR2Freq_Value,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,HPRE,HRTIMFreq_Value,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL3FRACN,PLLFRACN,QSPICLockSelection,QSPIFreq_Value,RNGFreq_Value,RTCFreq_Value,SAI1Freq_Value,SAI23Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMC1CLockSelection,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16Freq_Value,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
|
||||
RCC.LPTIM1Freq_Value=120000000
|
||||
RCC.LPTIM2Freq_Value=120000000
|
||||
RCC.LPTIM345Freq_Value=120000000
|
||||
@@ -345,7 +346,7 @@ RCC.SAI23Freq_Value=120000000
|
||||
RCC.SAI4AFreq_Value=120000000
|
||||
RCC.SAI4BFreq_Value=120000000
|
||||
RCC.SDMMC1CLockSelection=RCC_SDMMCCLKSOURCE_PLL2
|
||||
RCC.SDMMCFreq_Value=150000000
|
||||
RCC.SDMMCFreq_Value=100000000
|
||||
RCC.SPDIFRXFreq_Value=120000000
|
||||
RCC.SPI123Freq_Value=120000000
|
||||
RCC.SPI45Freq_Value=120000000
|
||||
@@ -360,7 +361,7 @@ RCC.USART16Freq_Value=120000000
|
||||
RCC.USART234578Freq_Value=120000000
|
||||
RCC.USBFreq_Value=120000000
|
||||
RCC.VCO1OutputFreq_Value=960000000
|
||||
RCC.VCO2OutputFreq_Value=300000000
|
||||
RCC.VCO2OutputFreq_Value=400000000
|
||||
RCC.VCO3OutputFreq_Value=258000000
|
||||
RCC.VCOInput1Freq_Value=16000000
|
||||
RCC.VCOInput2Freq_Value=2000000
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_CLOCK_FREQ
|
||||
#define SDIO_CLOCK_FREQ (150U * 1000 * 1000)
|
||||
#define SDIO_CLOCK_FREQ (200U * 1000 * 1000)
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_BUFF_SIZE
|
||||
@@ -44,7 +44,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef SDIO_MAX_FREQ
|
||||
#define SDIO_MAX_FREQ (25 * 1000 * 1000)
|
||||
#define SDIO_MAX_FREQ (50 * 1000 * 1000)
|
||||
#endif
|
||||
|
||||
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
|
||||
|
||||
Binary file not shown.
@@ -494,7 +494,7 @@ int dfs_tmpfs_stat(struct dfs_filesystem *fs,
|
||||
if (d_file == NULL)
|
||||
return -ENOENT;
|
||||
|
||||
st->st_dev = (rt_device_t)dfs_filesystem_lookup(fs->path);
|
||||
st->st_dev = (uintptr_t)dfs_filesystem_lookup(fs->path);
|
||||
st->st_mode = S_IFREG | S_IRUSR | S_IRGRP | S_IROTH |
|
||||
S_IWUSR | S_IWGRP | S_IWOTH;
|
||||
if (d_file->type == TMPFS_TYPE_DIR)
|
||||
|
||||
+2
-2
@@ -73,7 +73,7 @@
|
||||
#define RT_USING_FINSH
|
||||
#define FINSH_USING_MSH
|
||||
#define FINSH_THREAD_NAME "tshell"
|
||||
#define FINSH_THREAD_PRIORITY 30
|
||||
#define FINSH_THREAD_PRIORITY 20
|
||||
#define FINSH_THREAD_STACK_SIZE 4096
|
||||
#define FINSH_USING_HISTORY
|
||||
#define FINSH_HISTORY_LINES 5
|
||||
@@ -105,7 +105,7 @@
|
||||
#define RT_DFS_ELM_LFN_UNICODE 2
|
||||
#define RT_DFS_ELM_MAX_LFN 255
|
||||
#define RT_DFS_ELM_DRIVES 2
|
||||
#define RT_DFS_ELM_MAX_SECTOR_SIZE 512
|
||||
#define RT_DFS_ELM_MAX_SECTOR_SIZE 4096
|
||||
#define RT_DFS_ELM_USE_ERASE
|
||||
#define RT_DFS_ELM_REENTRANT
|
||||
#define RT_DFS_ELM_MUTEX_TIMEOUT 3000
|
||||
|
||||
Reference in new issue
Block a user