活动介绍

这个警告怎么处理 warning: initializing 'const uint8_t *' (aka 'const unsigned char

时间: 2024-02-06 17:12:29 浏览: 781
*') with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]? 这个警告是因为你尝试使用一个指向const char类型的指针来初始化一个指向const uint8_t类型的指针,这会导致const限定符丢失。解决这个警告的方法是将指向const char类型的指针转换为指向const uint8_t类型的指针。你可以使用强制类型转换来实现这个目的,如下所示: ```c++ const char* str = "hello"; const uint8_t* ptr = reinterpret_cast<const uint8_t*>(str); ``` 这样,你就可以使用指向const char类型的指针来初始化指向const uint8_t类型的指针,而不会丢失const限定符了。但是,请注意,这种类型转换可能会导致未定义行为,因此请谨慎使用。
相关问题

Arduino:1.8.19 (Windows 10), 开发板:"ESP32 Dev Module, Disabled, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 115200, Core 1, Core 1, None, Disabled, Disabled" D:\TFT\Demo_Arduino\Demo_UNO_Hardware_SPI\Example_10_touch_pen\touch_pen\touch_pen.ino: In function 'void show_color_select_menu()': touch_pen:94:16: error: invalid conversion from 'const char*' to 'uint8_t*' {aka 'unsigned char*'} [-fpermissive] 94 | show_string("OK",CENTER,COLORBOXSIZE/2+4,2,RED, BLACK,1); | ^~~~ | | | const char* D:\TFT\Demo_Arduino\Demo_UNO_Hardware_SPI\Example_10_touch_pen\touch_pen\touch_pen.ino:74:27: note: initializing argument 1 of 'void show_string(uint8_t*, int16_t, int16_t, uint8_t, uint16_t, uint16_t, boolean)' 74 | void show_string(uint8_t *str,int16_t x,int16_t y,uint8_t csize,uint16_t fc, uint16_t bc,boolean mode) | ~~~~~~~~~^~~ D:\TFT\Demo_Arduino\Demo_UNO_Hardware_SPI\Example_10_touch_pen\touch_pen\touch_pen.ino: In function 'void show_pen_size_select_menu()': touch_pen:113:16: error: invalid conversion from 'const char*' to 'uint8_t*' {aka 'unsigned char*'} [-fpermissive] 113 | show_string("OK",CENTER,COLORBOXSIZE/2+4,2,RED, BLACK,1); | ^~~~ | | | const char* D:\TFT\Demo_Arduino\Demo_UNO_Hardware_SPI\Example_10_touch_pen\touch_pen\touch_pen.ino:74:27: note: initializing argument 1 of 'void show_string(uint8_t*, int16_t, int16_t, uint8_t, uint16_t, uint16_t, boolean)' 74 | void show_string(uint8_t *str,int16_t x,int16_t y,uint8_t csize,uint16_t fc, uint16_t bc,boolean mode) | ~~~~~~~~~^~~ D:\TFT\Demo_Arduino\Demo_UNO_Hardware_SPI\Example_10_touch_pen\touch_pen\touch_pen.ino: In function 'void show_main_menu()': touch_pen:124:16: error: invalid conversion from 'const char*' to 'uint8_t*' {aka '

<think>好的,我现在需要解决用户在Arduino项目中遇到的编译错误:invalid conversion from 'const char*' to 'uint8_t*',具体是在show_string函数中。这个问题看起来是关于指针类型转换的错误。让我仔细分析一下。 首先,用户提到的错误信息显示,在代码中将一个const char*类型的指针传递给了一个期望uint8_t*类型参数的函数。C++是类型安全的,不允许隐式转换从const char*到uint8_t*,尤其是在涉及到const的情况下。所以需要显式转换或者调整函数参数类型。 接下来,我需要查看用户提供的代码示例。用户引用了两个引用:引用[1]和引用[2]。在引用[2]中,错误出现在Adafruit_SPIDevice.cpp文件的transferBytes函数调用,其中传递了prefix_buffer和nullptr。错误的原因是transferBytes期望的是uint8_t*类型的参数,但传入的可能是一个const uint8_t*,导致类型不匹配。类似的情况可能出现在用户的show_string函数中,即传递了const char*而函数参数是uint8_t*。 可能的解决方案包括: 1. 修改函数参数类型:如果函数show_string不需要修改传入的字符串,可以将参数声明为const uint8_t*,或者更准确地说,使用const char*,并在内部进行必要的类型转换。例如: void show_string(const char* str) { // 使用reinterpret_cast<uint8_t*>(const_cast<char*>(str))进行转换 } 但这种方法需要确保函数内部不会修改字符串内容,否则会导致未定义行为。 2. 显式类型转换:在调用函数时,将const char*显式转换为uint8_t*。例如: show_string(reinterpret_cast<uint8_t*>(const_cast<char*>("Hello"))); 但这种方法需要谨慎,因为它去除了const修饰符,如果函数试图修改字符串内容,会导致问题。 3. 使用中间变量:如果字符串内容需要修改,可以将其复制到一个非const的数组中,然后传递该数组。例如: char buffer[] = "Hello"; show_string(reinterpret_cast<uint8_t*>(buffer)); 这样buffer是可修改的,转换是安全的。 此外,用户可能需要检查函数show_string的原型是否正确声明。例如,如果函数应该接受const char*,则直接修改参数类型为const char*,并在内部处理相应的操作。如果涉及到底层硬件操作,可能需要保持参数为uint8_t*,但需要确保传入的数据是可变的。 还需要注意Arduino中字符串常量的处理。例如,字符串字面量如"Hello"是const char*类型,不能直接转换为非const的指针。因此,在调用函数时,必须确保类型匹配,或者进行适当的转换。 总结,解决方案的关键在于正确处理const修饰符和指针类型转换,确保类型安全,同时满足函数的需求。需要根据函数的具体用途来决定是调整参数类型还是进行显式转换。</think>### Arduino ESP32编译错误解决方案:无效转换从'const char*'到'uint8_t*' #### 错误原因分析 编译错误`invalid conversion from 'const char*' to 'uint8_t*'`表明代码中存在**类型不匹配**问题。具体表现为: 1. 函数`show_string`的形参类型为`uint8_t*`(即`unsigned char*`),但实际传入的是`const char*`类型的字符串字面量(如`"Hello"`)。 2. C++不允许将`const`指针隐式转换为非`const`指针[^2]。 #### 解决方法 根据代码场景选择以下方案: ##### 方案1:修改函数参数类型(推荐) 如果`show_string`不需要修改字符串内容: ```cpp void show_string(const uint8_t* str) { // 或 const char* // 函数内部操作 } ``` 调用时直接传递字符串字面量: ```cpp show_string(reinterpret_cast<const uint8_t*>("Hello")); // 类型匹配 ``` ##### 方案2:显式强制类型转换 若必须保留`uint8_t*`参数类型(需确保不修改字符串): ```cpp show_string(reinterpret_cast<uint8_t*>(const_cast<char*>("Hello"))); ``` ⚠️ 注意:此操作会移除`const`属性,若函数尝试修改字符串内容,可能导致程序崩溃。 ##### 方案3:使用可变缓冲区 如果需要动态修改字符串内容: ```cpp char buffer[] = "Hello"; // 非const数组 show_string(reinterpret_cast<uint8_t*>(buffer)); // 安全转换 ``` #### 补充建议 1. **检查函数原型**:确认`show_string`是否需要`uint8_t*`参数。若仅用于显示字符串,更推荐使用`const char*`类型。 2. **硬件库兼容性**:部分Arduino库(如SPI)强制要求`uint8_t*`参数时,需参考库文档确认是否支持`const`修饰符。

../Middle/MALLOC/MALLOC.c(29): error: incompatible pointer to integer conversion initializing 'uint8_t' (aka 'unsigned char') with an expression of type 'uint16_t[1280]' (aka 'unsigned short[1280]') [-Wint-conversion]

<think>嗯,用户遇到了一个编译错误,错误信息是关于指针和整数转换不兼容的问题。让我仔细看一下错误信息的内容。错误发生在MALLOC.c文件的第29行,提示是用uint16_t数组初始化uint8_t类型的指针时出现了类型不兼容的问题。用户可能是在动态内存分配或者初始化某个内存池的时候出错了。 首先,我需要理解错误的具体原因。错误信息提到“incompatible pointer to integer conversion”,也就是说,用户可能试图将一个数组(可能是uint16_t类型)赋值给一个uint8_t类型的变量,而这里可能是一个指针或者整数类型的变量。因为C语言中数组名会被隐式转换为指针,所以如果用户把一个uint16_t数组赋值给一个uint8_t指针,类型不匹配就会导致这个错误。 接下来,我需要考虑用户代码的结构。例如,用户可能在MALLOC.c中定义了一个内存池,比如: uint16_t mem1base[MEM1_MAX_SIZE]; // 假设MEM1_MAX_SIZE是1280 然后在某个地方试图将这个数组赋值给一个uint8_t类型的变量: uint8_t *memory_pool = mem1base; 这时候,mem1base作为uint16_t数组,其类型是uint16_t*,而memory_pool是uint8_t*,直接赋值会导致类型不兼容的错误,编译器会警告。 这种情况下,正确的做法应该是进行显式的类型转换,告诉编译器用户确实需要将uint16_t指针转换为uint8_t指针,可能涉及到字节寻址的问题。或者,用户可能原本应该使用uint8_t数组来初始化指针,但错误地用了uint16_t数组。 另一种可能是用户在结构体或联合体中定义变量时,错误地混合了不同的类型,导致初始化时的类型不匹配。例如,定义了一个结构体成员为uint8_t,但试图用uint16_t数组来初始化它。 接下来,我需要回顾用户提供的错误信息中的具体代码行:../Middle/MALLOC/MALLOC.c(29): error: incompatible pointer to integer conversion initializing 'uint8_t' (aka 'unsigned char') with an expression of type 'uint16_t[1280]' (aka 'unsigned short[1280]') [-Wint-conversion] 这里的关键点在于初始化(initializing)一个uint8_t类型的变量,使用了uint16_t数组的表达式。可能用户是声明了一个uint8_t类型的变量,但试图将一个uint16_t数组的地址赋值给它,例如: uint8_t memory_pool = mem1base; // mem1base是uint16_t数组 这里的问题在于memory_pool是一个uint8_t类型的变量(即一个字节),而mem1base是一个数组名,转换为指针后是uint16_t*类型。将一个指针赋值给一个uint8_t类型的整数变量,会导致指针到整数的转换,而类型不匹配,所以编译器报错。 正确的做法应该是将memory_pool声明为指针类型,例如: uint8_t *memory_pool = (uint8_t *)mem1base; 或者,如果用户确实需要将数组的地址存储在一个变量中,应该使用正确的指针类型: uint16_t *memory_pool = mem1base; 但根据错误信息,用户的目标变量是uint8_t类型,这可能意味着用户需要以字节为单位操作内存,而mem1base是uint16_t数组,每个元素占两个字节。因此,可能需要显式转换指针类型,以便正确地进行字节级别的访问。 总结可能的情况和解决方案: 1. 用户可能错误地将一个uint16_t数组赋值给uint8_t类型的变量,而不是指针。需要将变量声明为指针,并进行显式类型转换。 2. 用户可能在初始化时混淆了指针和数组的类型,需要检查变量声明和赋值的类型是否一致。 3. 如果用户确实需要使用uint8_t指针来访问uint16_t数组的内存,需要确保类型转换正确,并且了解这样做可能带来的对齐和访问问题。 此外,用户可能在内存管理模块中定义了不同内存池,例如使用不同的数据类型来管理堆内存,这时候需要确保类型的一致性。例如,malloc的实现可能需要字节指针来管理内存块,而用户可能错误地使用其他类型的数组作为基础内存池。 可能的代码示例: 错误的代码: uint16_t mem1base[1280]; uint8_t *mem1 = mem1base; // 错误:uint16_t* 转换为 uint8_t* 需要显式转换 正确的代码: uint16_t mem1base[1280]; uint8_t *mem1 = (uint8_t *)mem1base; // 显式转换指针类型 或者,如果用户需要使用uint16_t类型的数组作为内存池,但希望以字节为单位进行管理,可能需要重新定义数组为uint8_t类型: uint8_t mem1base[1280 * sizeof(uint16_t)]; // 根据需求调整大小 但这样可能不太直观,所以显式转换更常见。 另外,检查是否在结构体或变量声明中错误地使用了类型。例如,在结构体中有一个uint8_t类型的成员,但试图将数组地址赋给它: struct { uint8_t *pool; } malloc_info; malloc_info.pool = mem1base; // mem1base是uint16_t数组,需要转换 此时应改为: malloc_info.pool = (uint8_t *)mem1base; 总之,解决方案的核心在于正确地进行指针类型转换,或者调整变量/数组的类型以匹配。同时,用户需要明确自己是要以字节还是其他单位来管理内存,选择合适的类型和转换方式。</think>在C语言中,将不同类型的指针直接赋值会导致类型不兼容错误。错误 **`incompatible pointer to integer conversion initializing 'uint8_t' with 'uint16_t[1280]'`** 表明您尝试将 `uint16_t` 数组的地址(指针类型)赋值给一个 `uint8_t` 类型的变量(整数类型),或尝试隐式转换指针类型。以下是逐步分析和解决方案: --- ### **错误原因分析** 1. **类型不匹配** - `uint16_t[1280]` 是 `unsigned short` 类型的数组,其地址类型为 `uint16_t*`(指针)。 - 您试图将此指针赋值给一个 `uint8_t` 类型(`unsigned char`)的变量,导致 **指针到整数的隐式转换**,这是未定义行为。 2. **典型场景** - 在动态内存管理(如 `malloc` 实现)中,若内存池定义为 `uint16_t` 数组,但试图通过 `uint8_t*` 指针操作时,未显式转换指针类型。 --- ### **解决方案** #### **方法1:显式强制类型转换** 若需要将 `uint16_t` 数组的地址赋值给 `uint8_t*` 指针(例如以字节为单位管理内存),需显式转换指针类型。 **错误代码示例:** ```c uint16_t mem1base[1280]; // 定义uint16_t数组 uint8_t *memory_pool = mem1base; // 错误:隐式转换uint16_t*到uint8_t* ``` **修正代码:** ```c uint16_t mem1base[1280]; uint8_t *memory_pool = (uint8_t *)mem1base; // 显式强制类型转换 ``` --- #### **方法2:统一内存池类型** 若内存池需要以字节为单位操作,直接定义为 `uint8_t` 数组: ```c uint8_t mem1base[1280 * sizeof(uint16_t)]; // 按需调整大小(如1280个uint16_t占2560字节) uint8_t *memory_pool = mem1base; // 类型匹配,无需转换 ``` --- #### **方法3:检查变量声明** 确保目标变量是**指针类型**而非整数类型。 **错误示例:** ```c uint16_t mem1base[1280]; uint8_t memory_pool = mem1base; // 错误:将指针赋值给uint8_t整数变量 ``` **正确声明:** ```c uint16_t mem1base[1280]; uint8_t *memory_pool = (uint8_t *)mem1base; // 目标变量必须是指针类型 ``` --- ### **深入理解** 1. **指针类型转换的意义** - `uint16_t*` 指针的步长为2字节(每次 `+1` 移动2字节),而 `uint8_t*` 指针的步长为1字节。 - 显式转换后,通过 `uint8_t*` 指针访问内存时,可逐字节操作,但需自行处理对齐问题。 2. **内存对齐警告** 若 `uint16_t` 数组的地址未按2字节对齐,强制转换为 `uint8_t*` 可能导致性能下降或硬件异常(某些架构严格要求对齐)。 --- ### **验证步骤** 1. 检查报错行代码,确认赋值操作的目标变量是否为指针类型。 2. 添加显式类型转换 `(uint8_t *)` 或调整数组类型。 3. 重新编译,观察错误是否消除。 4. 若涉及硬件内存操作(如DMA),需验证地址对齐是否符合要求。 --- ### **扩展建议** - **使用联合体(Union)处理多类型访问** 若需同一块内存以不同数据类型访问,可定义联合体: ```c union MemoryPool { uint16_t as_uint16[1280]; uint8_t as_uint8[2560]; // 1280*2字节 } mem_pool; uint8_t *byte_ptr = mem_pool.as_uint8; // 直接获取字节指针 ``` - **启用编译器警告** 在Keil中开启 `-Wall` 和 `-Wpedantic` 选项,提前捕获类型不匹配问题。 --- 通过显式类型转换或统一内存池类型,可解决此错误。核心原则是 **确保指针类型与操作的内存单元一致**,避免隐式类型转换的风险。
阅读全文

相关推荐

使用C语言、vscode软件、g++编译器、utf-8编码环境 WJ文件中有三个文件,运行WJ文件 WJ文件的三个子文件有以下内容: Recipe.h文件:#ifndef RECIPE_H #define RECIPE_H #define MAX_NAME_LEN 50 #define MAX_CATEGORY_LEN 30 #define MAX_INGREDIENTS_LEN 200 #define MAX_STEPS_LEN 500 #define MAX_RECIPES 100 #define FILENAME "recipes.dat" // 菜谱结构体 typedef struct { int id; // 唯一标识符 char name[MAX_NAME_LEN]; char category[MAX_CATEGORY_LEN]; char ingredients[MAX_INGREDIENTS_LEN]; char steps[MAX_STEPS_LEN]; } Recipe; // 函数声明 void init_system(); int add_recipe(const char *name, const char *category, const char *ingredients, const char *steps); int delete_recipe(int id); int modify_recipe(int id, const char *name, const char *category, const char *ingredients, const char *steps); Recipe* find_recipe_by_id(int id); Recipe* find_recipe_by_name(const char *name); void list_all_recipes(); Recipe* get_random_recipe(); void save_to_file(); void load_from_file(); #endif Recipe.c文件:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "Recipe.h" // 全局变量 Recipe recipes[MAX_RECIPES]; int recipe_count = 0; int next_id = 1; // 初始化系统 void init_system() { load_from_file(); } // 添加菜谱 int add_recipe(const char *name, const char *category, const char *ingredients, const char *steps) { if (recipe_count >= MAX_RECIPES) return 0; Recipe *r = &recipes[recipe_count]; r->id = next_id++; strncpy(r->name, name, MAX_NAME_LEN); strncpy(r->category, category, MAX_CATEGORY_LEN); strncpy(r->ingredients, ingredients, MAX_INGREDIENTS_LEN); strncpy(r->steps, steps, MAX_STEPS_LEN); recipe_count++; save_to_file(); return r->id; } // 删除菜谱 int delete_recipe(int id) { for (int i = 0; i < recipe_count; i++) { if (recipes[i].id == id) { // 移动数组元素 for (int j = i; j < recipe_count - 1; j++) { recipes[j] = recipes[j + 1]; } recipe_count--; save_to_file(); return 1; } } return 0; } // 修改菜谱 int modify_recipe(int id, const char *name, const char *category, const char *ingredients, const char *steps) { for (int i = 0; i < recipe_count; i++) { if (recipes[i].id == id) { if (name) strncpy(recipes[i].name, name, MAX_NAME_LEN); if (category) strncpy(recipes[i].category, category, MAX_CATEGORY_LEN); if (ingredients) strncpy(recipes[i].ingredients, ingredients, MAX_INGREDIENTS_LEN); if (steps) strncpy(recipes[i].steps, steps, MAX_STEPS_LEN); save_to_file(); return 1; } } return 0; } // 通过ID查找 Recipe* find_recipe_by_id(int id) { for (int i = 0; i < recipe_count; i++) { if (recipes[i].id == id) { return &recipes[i]; } } return NULL; } // 通过名称查找 Recipe* find_recipe_by_name(const char *name) { for (int i = 0; i < recipe_count; i++) { if (strstr(recipes[i].name, name) != NULL) { return &recipes[i]; } } return NULL; } // 列出所有菜谱 void list_all_recipes() { printf("\n==== 所有菜谱 (%d) ====\n", recipe_count); for (int i = 0; i < recipe_count; i++) { printf("[ID:%d] %s (%s)\n", recipes[i].id, recipes[i].name, recipes[i].category); } printf("=====================\n"); } // 随机推荐菜谱 Recipe* get_random_recipe() { if (recipe_count == 0) return NULL; srand(time(NULL)); return &recipes[rand() % recipe_count]; } // 保存到文件 void save_to_file() { FILE *file = fopen(FILENAME, "wb"); if (!file) return; // 写入数据 fwrite(&recipe_count, sizeof(int), 1, file); fwrite(&next_id, sizeof(int), 1, file); fwrite(recipes, sizeof(Recipe), recipe_count, file); fclose(file); } // 从文件加载 void load_from_file() { FILE *file = fopen(FILENAME, "rb"); if (!file) return; // 读取数据 fread(&recipe_count, sizeof(int), 1, file); fread(&next_id, sizeof(int), 1, file); fread(recipes, sizeof(Recipe), recipe_count, file); fclose(file); } main.c文件:#include <stdio.h> #include <string.h> #include "Recipe.h" #include <locale.h> #include <wchar.h> #include <windows.h> int main() { // 设置控制台输出为UTF-8编码 SetConsoleOutputCP(65001); // 设置本地化环境,用于宽字符处理 setlocale(LC_ALL, "zh_CN.UTF-8"); init_system(); int choice; do{ printf("\n==== 家庭菜谱管理系统 ====\n"); printf("1. 添加菜谱\n"); printf("2. 删除菜谱\n"); printf("3. 修改菜谱\n"); printf("4. 查找菜谱(ID)\n"); printf("5. 查找菜谱(名称)\n"); printf("6. 列出所有菜谱\n"); printf("7. 随机推荐菜谱\n"); printf("8. 退出系统\n"); printf("请选择操作: "); canf("%d", &choice); getchar(); // 清除输入缓冲区 } while (choice != 8); return 0; { /* code */ } } // 显示菜单 // 添加菜谱界面 void add_recipe_ui() { char name[MAX_NAME_LEN]; char category[MAX_CATEGORY_LEN]; char ingredients[MAX_INGREDIENTS_LEN]; char steps[MAX_STEPS_LEN]; printf("\n--- 添加新菜谱 ---\n"); printf("菜谱名称: "); fgets(name, MAX_NAME_LEN, stdin); name[strcspn(name, "\n")] = 0; // 移除换行符 printf("菜谱类别: "); fgets(category, MAX_CATEGORY_LEN, stdin); category[strcspn(category, "\n")] = 0; printf("所需食材: "); fgets(ingredients, MAX_INGREDIENTS_LEN, stdin); ingredients[strcspn(ingredients, "\n")] = 0; printf("制作步骤: "); fgets(steps, MAX_STEPS_LEN, stdin); steps[strcspn(steps, "\n")] = 0; int id = add_recipe(name, category, ingredients, steps); if (id) { printf("添加成功! 菜谱ID: %d\n", id); } else { printf("添加失败! 已达最大菜谱数量\n"); } } // 显示菜谱详情 void display_recipe(Recipe *r) { if (!r) { printf("未找到菜谱!\n"); return; } printf("\n==== 菜谱详情 ====\n"); printf("ID: %d\n", r->id); printf("名称: %s\n", r->name); printf("类别: %s\n", r->category); printf("食材: %s\n", r->ingredients); printf("步骤: %s\n", r->steps); printf("=================\n"); } int main() { init_system(); int choice; do { display_menu(); scanf("%d", &choice); getchar(); // 清除输入缓冲区 switch (choice) { case 1: // 添加 add_recipe_ui(); break; case 2: { // 删除 int id; wprintf("输入要删除的菜谱ID: "); scanf("%d", &id); getchar(); if (delete_recipe(id)) { wprintf("删除成功!\n"); } else { wprintf("删除失败! 无效ID\n"); } break; } case 3: { // 修改 int id; wprintf("输入要修改的菜谱ID: "); scanf("%d", &id); getchar(); Recipe *r = find_recipe_by_id(id); if (!r) { wprintf("菜谱不存在!\n"); break; } char name[MAX_NAME_LEN]; char category[MAX_CATEGORY_LEN]; char ingredients[MAX_INGREDIENTS_LEN]; char steps[MAX_STEPS_LEN]; wprintf("新名称(回车保持原值): "); fgets(name, MAX_NAME_LEN, stdin); name[strcspn(name, "\n")] = 0; wprintf("新类别(回车保持原值): "); fgets(category, MAX_CATEGORY_LEN, stdin); category[strcspn(category, "\n")] = 0; wprintf("新食材(回车保持原值): "); fgets(ingredients, MAX_INGREDIENTS_LEN, stdin); ingredients[strcspn(ingredients, "\n")] = 0; wprintf("新步骤(回车保持原值): "); fgets(steps, MAX_STEPS_LEN, stdin); steps[strcspn(steps, "\n")] = 0; modify_recipe(id, *name ? name : NULL, *category ? category : NULL, *ingredients ? ingredients : NULL, *steps ? steps : NULL); wprintf("修改成功!\n"); break; } case 4: { // 按ID查找 int id; wprintf("输入菜谱ID: "); scanf("%d", &id); getchar(); display_recipe(find_recipe_by_id(id)); break; } case 5: { // 按名称查找 char name[MAX_NAME_LEN]; wprintf("输入菜谱名称: "); fgets(name, MAX_NAME_LEN, stdin); name[strcspn(name, "\n")] = 0; display_recipe(find_recipe_by_name(name)); break; } case 6: // 列出所有 list_all_recipes(); break; case 7: // 随机推荐 display_recipe(get_random_recipe()); break; case 8: // 退出 wprintf("感谢使用!\n"); break; default: wprintf("无效选择!\n"); } } while (choice != 8); return 0; } 在运行输入:g++ -o WJ Recipe.c main.c 出现以下错误:Microsoft Windows [版本 10.0.26100.4652] (c) Microsoft Corporation。保留所有权利。 C:\Users\34171\Desktop\code\WJ>g++ -o WJ Recipe.c main.c main.c: In function 'int main()': main.c:28:9: error: 'canf' was not declared in this scope; did you mean 'scanf'? 28 | canf("%d", &choice); | ^~~~ | scanf main.c: At global scope: main.c:89:5: error: redefinition of 'int main()' 89 | int main() { | ^~~~ main.c:8:5: note: 'int main()' previously defined here 8 | int main() | ^~~~ main.c: In function 'int main()': main.c:94:9: error: 'display_menu' was not declared in this scope; did you mean 'display_recipe'? 94 | display_menu(); | ^~~~~~~~~~~~ | display_recipe main.c:105:25: error: cannot convert 'const char*' to 'const wchar_t*' 105 | wprintf("杈D: "); | ^~~~~~~~~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:110:29: error: cannot convert 'const char*' to 'const wchar_t*' 110 | wprintf("錸"); | ^~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:112:29: error: cannot convert 'const char*' to 'const wchar_t*' 112 | wprintf("錎\n"); | ^~~~~~~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:119:25: error: cannot convert 'const char*' to 'const wchar_t*' 119 | wprintf("杈D: "); | ^~~~~~~~~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:125:33: error: cannot convert 'const char*' to 'const wchar_t*' 125 | wprintf("鑞"); | ^~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:134:25: error: cannot convert 'const char*' to 'const wchar_t*' 134 | wprintf("鎚); | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:138:25: error: cannot convert 'const char*' to 'const wchar_t*' 138 | wprintf("鎚); | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:142:25: error: cannot convert 'const char*' to 'const wchar_t*' 142 | wprintf("鎚); | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:146:25: error: cannot convert 'const char*' to 'const wchar_t*' 146 | wprintf("鎚); | ^~~~~~~~~~~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:156:25: error: cannot convert 'const char*' to 'const wchar_t*' 156 | wprintf("淇n"); | ^~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:162:25: error: cannot convert 'const char*' to 'const wchar_t*' 162 | wprintf("杈D: "); | ^~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:172:25: error: cannot convert 'const char*' to 'const wchar_t*' 172 | wprintf("杈m); | ^~~~~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:189:25: error: cannot convert 'const char*' to 'const wchar_t*' 189 | wprintf("鎛"); | ^~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ main.c:193:25: error: cannot convert 'const char*' to 'const wchar_t*' 193 | wprintf("鎛"); | ^~~~~~~~~~~~~ | | | const char* In file included from main.c:1: D:/TDM-GCC/x86_64-w64-mingw32/include/stdio.h:1093:29: note: initializing argument 1 of 'int wprintf(const wchar_t*, ...)' 1093 | int wprintf (const wchar_t *__format, ...) | ~~~~~~~~~~~~~~~^~~~~~~~ C:\Users\34171\Desktop\code\WJ>

void TestSuite_update2dsdk_cpp_802ca10e::test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_1() { /* Pre-condition initialization */ /* Initializing argument 1 (env) */ ::JNIEnv * _env = 0 ; /* Initializing argument 2 (thiz) */ ::jobject _thiz = 0 ; /* Pre-condition report */ CPPTEST_REPORT_PTR("Input: JNIEnv * _env ", ( _env )); CPPTEST_REPORT_PTR("Input: ::jobject _thiz", ( _thiz )); /* Tested function call */ ::Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp(_env, _thiz); /* Post-condition report */ CPPTEST_REPORT_PTR("Output: JNIEnv * _env ", ( _env )); CPPTEST_REPORT_PTR("Output: ::jobject _thiz", ( _thiz )); /* Post-condition check */ CPPTEST_ASSERT_EQUAL(NULL, ( _env )); CPPTEST_ASSERT_EQUAL(NULL, ( _thiz )); } /* CPPTEST_TEST_CASE_END test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_1 */ /* CPPTEST_TEST_CASE_BEGIN test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_2 */ /* CPPTEST_TEST_CASE_CONTEXT void Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp(JNIEnv *, jobject) */ void TestSuite_update2dsdk_cpp_802ca10e::test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_2() { /* Pre-condition initialization */ /* Initializing argument 1 (env) */ ::JNIEnv _env_0 ; ::JNIEnv * _env = & _env_0; /* Initializing argument 2 (thiz) */ ::jobject _thiz = 0 ; /* Pre-condition report */ CPPTEST_REPORT_PTR("Input: JNIEnv * _env ", ( _env )); CPPTEST_REPORT_PTR("Input: ::jobject _thiz", ( _thiz )); /* Tested function call */ ::Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp(_env, _thiz); /* Post-condition report */ CPPTEST_REPORT_PTR("Output: JNIEnv * _env ", ( _env )); CPPTEST_REPORT_PTR("Output: ::jobject _thiz", ( _thiz )); /* Post-condition check */ CPPTEST_ASSERT(0 != ( _env )); CPPTEST_ASSERT_EQUAL(NULL, ( _thiz )); } /* CPPTEST_TEST_CASE_END test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_2 */ /* CPPTEST_TEST_CASE_BEGIN test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_3 */ /* CPPTEST_TEST_CASE_CONTEXT void Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp(JNIEnv *, jobject) */ void TestSuite_update2dsdk_cpp_802ca10e::test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_3() { /* Pre-condition initialization */ /* Initializing argument 1 (env) */ ::JNIEnv * _env = 0 ; /* Initializing argument 2 (thiz) */ ::_jobject _thiz_0 ; ::jobject _thiz = & _thiz_0; /* Pre-condition report */ CPPTEST_REPORT_PTR("Input: JNIEnv * _env ", ( _env )); CPPTEST_REPORT_PTR("Input: ::jobject _thiz", ( _thiz )); /* Tested function call */ ::Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp(_env, _thiz); /* Post-condition report */ CPPTEST_REPORT_PTR("Output: JNIEnv * _env ", ( _env )); CPPTEST_REPORT_PTR("Output: ::jobject _thiz", ( _thiz )); /* Post-condition check */ CPPTEST_ASSERT_EQUAL(NULL, ( _env )); CPPTEST_ASSERT(0 != ( _thiz )); } /* CPPTEST_TEST_CASE_END test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_3 */ /* CPPTEST_TEST_CASE_BEGIN test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_4 */ /* CPPTEST_TEST_CASE_CONTEXT void Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp(JNIEnv *, jobject) */ void TestSuite_update2dsdk_cpp_802ca10e::test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_4() { /* Pre-condition initialization */ /* Initializing argument 1 (env) */ ::JNIEnv _env_0 ; ::JNIEnv * _env = & _env_0; /* Initializing argument 2 (thiz) */ ::_jobject _thiz_1 ; ::jobject _thiz = & _thiz_1; /* Pre-condition report */ CPPTEST_REPORT_PTR("Input: JNIEnv * _env ", ( _env )); CPPTEST_REPORT_PTR("Input: ::jobject _thiz", ( _thiz )); /* Tested function call */ ::Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp(_env, _thiz); /* Post-condition report */ CPPTEST_REPORT_PTR("Output: JNIEnv * _env ", ( _env )); CPPTEST_REPORT_PTR("Output: ::jobject _thiz", ( _thiz )); /* Post-condition check */ CPPTEST_ASSERT(0 != ( _env )); CPPTEST_ASSERT(0 != ( _thiz )); } /* CPPTEST_TEST_CASE_END test_Java_com_isa_navi_jni_hmi_HmiProxyJNI_InitializeCpp_4 */ 这里的四个测试用例有什么区别?

EPRobot@EPRobot:~/robot_ws$ roscd usb_cam EPRobot@EPRobot:/opt/ros/melodic/share/usb_cam$ source/opt/ros/melodic/setup.bash bash: source/opt/ros/melodic/setup.bash: No such file or directory EPRobot@EPRobot:/opt/ros/melodic/share/usb_cam$ cd ~/robot_ws EPRobot@EPRobot:~/robot_ws$ source devel/setup.bash EPRobot@EPRobot:~/robot_ws$ roslaunch eprobot_start one_car_start.launch ... logging to /home/EPRobot/.ros/log/99f833d2-6236-11f0-a6b3-e45f0131f240/roslaunch-EPRobot-14068.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://EPRobot:33445/ SUMMARY ======== CLEAR PARAMETERS * /ekf_se/ PARAMETERS * /amcl/base_frame_id: base_footprint * /amcl/global_frame_id: map * /amcl/gui_publish_rate: 10.0 * /amcl/initial_pose_a: 0.0 * /amcl/initial_pose_x: 0.0 * /amcl/initial_pose_y: 0.0 * /amcl/kld_err: 0.05 * /amcl/kld_z: 0.99 * /amcl/laser_lambda_short: 0.1 * /amcl/laser_likelihood_max_dist: 5.0 * /amcl/laser_max_beams: 60 * /amcl/laser_max_range: 12.0 * /amcl/laser_model_type: likelihood_field * /amcl/laser_sigma_hit: 0.2 * /amcl/laser_z_hit: 0.7 * /amcl/laser_z_max: 0.1 * /amcl/laser_z_rand: 0.3 * /amcl/laser_z_short: 0.1 * /amcl/max_particles: 2000 * /amcl/min_particles: 600 * /amcl/odom_alpha1: 0.2 * /amcl/odom_alpha2: 0.2 * /amcl/odom_alpha3: 0.2 * /amcl/odom_alpha4: 0.2 * /amcl/odom_alpha5: 0.1 * /amcl/odom_frame_id: odom * /amcl/odom_model_type: diff * /amcl/recovery_alpha_fast: 0.2 * /amcl/recovery_alpha_slow: 0.005 * /amcl/resample_interval: 0.4 * /amcl/transform_tolerance: 0.5 * /amcl/update_min_a: 0.05 * /amcl/update_min_d: 0.05 * /amcl/use_map_topic: True * /base_control/base_kd: 0.0 * /base_control/base_ki: 100.0 * /base_control/base_kp: 1000.0 * /base_control/base_kv: 1.0 * /base_control/is_send_anger: false * /camera_uri: http://192.168.3.... * /ekf_se/base_link_frame: /base_footprint * /ekf_se/debug: False * /ekf_se/debug_out_file: /path/to/debug/fi... * /ekf_se/frequency: 30 * /ekf_se/imu0: /imu_data * /ekf_se/imu0_config: [False, False, Fa... * /ekf_se/imu0_differential: False * /ekf_se/imu0_nodelay: True * /ekf_se/imu0_pose_rejection_threshold: 0.8 * /ekf_se/imu0_queue_size: 8 * /ekf_se/imu0_relative: True * /ekf_se/imu0_remove_gravitational_acceleration: True * /ekf_se/initial_estimate_covariance: ['1e-9', 0, 0, 0,... * /ekf_se/map_frame: /map * /ekf_se/odom0: /odom * /ekf_se/odom0_config: [False, False, Fa... * /ekf_se/odom0_differential: False * /ekf_se/odom0_nodelay: True * /ekf_se/odom0_queue_size: 5 * /ekf_se/odom0_relative: True * /ekf_se/odom_frame: /odom * /ekf_se/print_diagnostics: True * /ekf_se/process_noise_covariance: [0.01, 0, 0, 0, 0... * /ekf_se/publish_acceleration: True * /ekf_se/publish_tf: True * /ekf_se/sensor_timeout: 0.025 * /ekf_se/transform_time_offset: 0.0001 * /ekf_se/transform_timeout: 0.025 * /ekf_se/two_d_mode: True * /ekf_se/world_frame: /odom * /image_view/autosize: True * /laser_filter/scan_filter_chain: [{'type': 'laser_... * /lslidar_driver_node/angle_disable_max: 0 * /lslidar_driver_node/angle_disable_min: 0 * /lslidar_driver_node/compensation: False * /lslidar_driver_node/frame_id: base_laser_link * /lslidar_driver_node/high_reflection: False * /lslidar_driver_node/interface_selection: serial * /lslidar_driver_node/lidar_name: M10 * /lslidar_driver_node/max_range: 100.0 * /lslidar_driver_node/min_range: 0.1 * /lslidar_driver_node/pubPointCloud2: False * /lslidar_driver_node/pubScan: True * /lslidar_driver_node/scan_topic: scan * /lslidar_driver_node/serial_port: /dev/EPRobot_laser * /lslidar_driver_node/use_gps_ts: False * /map_server/frame_id: map * /move_base/TebLocalPlannerROS/acc_lim_theta: 0.3 * /move_base/TebLocalPlannerROS/acc_lim_x: 0.2 * /move_base/TebLocalPlannerROS/allow_init_with_backwards_motion: True * /move_base/TebLocalPlannerROS/cmd_angle_instead_rotvel: False * /move_base/TebLocalPlannerROS/costmap_converter_plugin: * /move_base/TebLocalPlannerROS/costmap_converter_rate: 5 * /move_base/TebLocalPlannerROS/costmap_converter_spin_thread: True * /move_base/TebLocalPlannerROS/costmap_obstacles_behind_robot_dist: 1.0 * /move_base/TebLocalPlannerROS/dt_hysteresis: 0.1 * /move_base/TebLocalPlannerROS/dt_ref: 0.3 * /move_base/TebLocalPlannerROS/dynamic_obstacle_inflation_dist: 0.2 * /move_base/TebLocalPlannerROS/enable_homotopy_class_planning: False * /move_base/TebLocalPlannerROS/enable_multithreading: True * /move_base/TebLocalPlannerROS/exact_arc_length: False * /move_base/TebLocalPlannerROS/feasibility_check_no_poses: 3 * /move_base/TebLocalPlannerROS/footprint_model/line_end: [0.1, 0.0] * /move_base/TebLocalPlannerROS/footprint_model/line_start: [-0.1, 0.0] * /move_base/TebLocalPlannerROS/footprint_model/type: line * /move_base/TebLocalPlannerROS/force_reinit_new_goal_dist: 0.5 * /move_base/TebLocalPlannerROS/free_goal_vel: False * /move_base/TebLocalPlannerROS/global_plan_overwrite_orientation: True * /move_base/TebLocalPlannerROS/global_plan_viapoint_sep: 3.0 * /move_base/TebLocalPlannerROS/h_signature_prescaler: 0.5 * /move_base/TebLocalPlannerROS/h_signature_threshold: 0.1 * /move_base/TebLocalPlannerROS/include_costmap_obstacles: True * /move_base/TebLocalPlannerROS/include_dynamic_obstacles: True * /move_base/TebLocalPlannerROS/inflation_dist: 0.35 * /move_base/TebLocalPlannerROS/is_footprint_dynamic: False * /move_base/TebLocalPlannerROS/legacy_obstacle_association: False * /move_base/TebLocalPlannerROS/max_global_plan_lookahead_dist: 10.0 * /move_base/TebLocalPlannerROS/max_number_classes: 2 * /move_base/TebLocalPlannerROS/max_vel_theta: 1.0 * /move_base/TebLocalPlannerROS/max_vel_x: 0.6 * /move_base/TebLocalPlannerROS/max_vel_x_backwards: 0.3 * /move_base/TebLocalPlannerROS/max_vel_y: 0.0 * /move_base/TebLocalPlannerROS/min_obstacle_dist: 0.55 * /move_base/TebLocalPlannerROS/min_turning_radius: 0.6 * /move_base/TebLocalPlannerROS/no_inner_iterations: 5 * /move_base/TebLocalPlannerROS/no_outer_iterations: 4 * /move_base/TebLocalPlannerROS/obstacle_association_cutoff_factor: 5.0 * /move_base/TebLocalPlannerROS/obstacle_association_force_inclusion_factor: 1.5 * /move_base/TebLocalPlannerROS/obstacle_cost_exponent: 5.5 * /move_base/TebLocalPlannerROS/obstacle_heading_threshold: 0.45 * /move_base/TebLocalPlannerROS/obstacle_keypoint_offset: 0.1 * /move_base/TebLocalPlannerROS/obstacle_poses_affected: 15 * /move_base/TebLocalPlannerROS/odom_topic: odom * /move_base/TebLocalPlannerROS/optimization_activate: True * /move_base/TebLocalPlannerROS/optimization_verbose: False * /move_base/TebLocalPlannerROS/oscillation_recovery: True * /move_base/TebLocalPlannerROS/penalty_epsilon: 0.08 * /move_base/TebLocalPlannerROS/roadmap_graph_area_length_scale: 1.0 * /move_base/TebLocalPlannerROS/roadmap_graph_area_width: 5 * /move_base/TebLocalPlannerROS/roadmap_graph_no_samples: 15 * /move_base/TebLocalPlannerROS/selection_alternative_time_cost: False * /move_base/TebLocalPlannerROS/selection_cost_hysteresis: 1.0 * /move_base/TebLocalPlannerROS/selection_obst_cost_scale: 1.0 * /move_base/TebLocalPlannerROS/selection_viapoint_cost_scale: 1.0 * /move_base/TebLocalPlannerROS/shrink_horizon_backup: True * /move_base/TebLocalPlannerROS/simple_exploration: False * /move_base/TebLocalPlannerROS/teb_autosize: True * /move_base/TebLocalPlannerROS/via_points_ordered: False * /move_base/TebLocalPlannerROS/visualize_hc_graph: False * /move_base/TebLocalPlannerROS/weight_acc_lim_theta: 1 * /move_base/TebLocalPlannerROS/weight_acc_lim_x: 1 * /move_base/TebLocalPlannerROS/weight_adapt_factor: 1.0 * /move_base/TebLocalPlannerROS/weight_dynamic_obstacle: 100 * /move_base/TebLocalPlannerROS/weight_dynamic_obstacle_inflation: 0.6 * /move_base/TebLocalPlannerROS/weight_inflation: 1.0 * /move_base/TebLocalPlannerROS/weight_kinematics_forward_drive: 800 * /move_base/TebLocalPlannerROS/weight_kinematics_nh: 1000 * /move_base/TebLocalPlannerROS/weight_kinematics_turning_radius: 6.0 * /move_base/TebLocalPlannerROS/weight_max_vel_theta: 1 * /move_base/TebLocalPlannerROS/weight_max_vel_x: 2 * /move_base/TebLocalPlannerROS/weight_obstacle: 190 * /move_base/TebLocalPlannerROS/weight_optimaltime: 15 * /move_base/TebLocalPlannerROS/weight_shortest_path: 5.0 * /move_base/TebLocalPlannerROS/weight_viapoint: 10.0 * /move_base/TebLocalPlannerROS/wheelbase: 0.3 * /move_base/TebLocalPlannerROS/xy_goal_tolerance: 0.1 * /move_base/TebLocalPlannerROS/yaw_goal_tolerance: 0.1 * /move_base/base_local_planner: teb_local_planner... * /move_base/clearing_rotation_allowed: False * /move_base/conservative_reset_dist: 0.2 * /move_base/controller_frequency: 5.0 * /move_base/controller_patience: 15.0 * /move_base/global_costmap/footprint: [[-0.18, -0.18], ... * /move_base/global_costmap/global_frame: map * /move_base/global_costmap/inflation_layer/cost_scaling_factor: 10.0 * /move_base/global_costmap/inflation_layer/enabled: True * /move_base/global_costmap/inflation_layer/inflation_radius: 0.3 * /move_base/global_costmap/inflation_radius: 0.4 * /move_base/global_costmap/laser_scan_sensor/clearing: True * /move_base/global_costmap/laser_scan_sensor/data_type: LaserScan * /move_base/global_costmap/laser_scan_sensor/marking: True * /move_base/global_costmap/laser_scan_sensor/topic: scan * /move_base/global_costmap/map_type: costmap * /move_base/global_costmap/observation_sources: laser_scan_sensor * /move_base/global_costmap/obstacle_layer/combination_method: 1 * /move_base/global_costmap/obstacle_layer/enabled: True * /move_base/global_costmap/obstacle_layer/inflation_radius: 0.2 * /move_base/global_costmap/obstacle_layer/obstacle_range: 6.5 * /move_base/global_costmap/obstacle_layer/raytrace_range: 6.0 * /move_base/global_costmap/obstacle_layer/track_unknown_space: False * /move_base/global_costmap/plugins: [{'type': 'costma... * /move_base/global_costmap/publish_frequency: 5.0 * /move_base/global_costmap/robot_base_frame: base_footprint * /move_base/global_costmap/static_layer/enabled: True * /move_base/global_costmap/static_layer/map_topic: /map * /move_base/global_costmap/static_map: True * /move_base/global_costmap/transform_tolerance: 0.5 * /move_base/global_costmap/update_frequency: 5.0 * /move_base/local_costmap/cost_scaling_factor: 10 * /move_base/local_costmap/footprint: [[-0.18, -0.18], ... * /move_base/local_costmap/global_frame: map * /move_base/local_costmap/height: 3 * /move_base/local_costmap/inflation_layer/cost_scaling_factor: 10.0 * /move_base/local_costmap/inflation_layer/enabled: True * /move_base/local_costmap/inflation_layer/inflation_radius: 0.3 * /move_base/local_costmap/inflation_radius: 0.16 * /move_base/local_costmap/laser_scan_sensor/clearing: True * /move_base/local_costmap/laser_scan_sensor/data_type: LaserScan * /move_base/local_costmap/laser_scan_sensor/marking: True * /move_base/local_costmap/laser_scan_sensor/topic: scan * /move_base/local_costmap/map_type: costmap * /move_base/local_costmap/observation_sources: laser_scan_sensor * /move_base/local_costmap/obstacle_layer/combination_method: 1 * /move_base/local_costmap/obstacle_layer/enabled: True * /move_base/local_costmap/obstacle_layer/inflation_radius: 0.2 * /move_base/local_costmap/obstacle_layer/obstacle_range: 6.5 * /move_base/local_costmap/obstacle_layer/raytrace_range: 6.0 * /move_base/local_costmap/obstacle_layer/track_unknown_space: False * /move_base/local_costmap/plugins: [{'type': 'costma... * /move_base/local_costmap/publish_frequency: 5.0 * /move_base/local_costmap/resolution: 0.05 * /move_base/local_costmap/robot_base_frame: base_footprint * /move_base/local_costmap/rolling_window: True * /move_base/local_costmap/static_layer/enabled: True * /move_base/local_costmap/static_layer/map_topic: /map * /move_base/local_costmap/static_map: False * /move_base/local_costmap/transform_tolerance: 0.5 * /move_base/local_costmap/update_frequency: 5.0 * /move_base/local_costmap/width: 3 * /move_base/oscillation_distance: 0.2 * /move_base/oscillation_timeout: 10.0 * /move_base/planner_frequency: 1.0 * /move_base/planner_patience: 5.0 * /robot_description: <?xml version="1.... * /rosdistro: melodic * /rosversion: 1.14.13 * /time0: 5.0 * /time1: 15.0 * /time2: 2.0 * /time3: 10.0 * /time4: 2.0 * /time5: 5.0 * /usb_cam/camera_frame_id: usb_cam * /usb_cam/color_format: yuv422p * /usb_cam/image_height: 960 * /usb_cam/image_width: 1280 * /usb_cam/io_method: mmap * /usb_cam/pixel_format: yuyv * /usb_cam/video_device: /dev/video0 NODES / amcl (amcl/amcl) base_control (eprobot_start/art_racecar.py) base_to_camera (tf/static_transform_publisher) base_to_gyro (tf/static_transform_publisher) base_to_laser (tf/static_transform_publisher) base_to_link (tf/static_transform_publisher) ekf_se (robot_localization/ekf_localization_node) image_view (image_view/image_view) joint_state_publisher (joint_state_publisher/joint_state_publisher) laser_filter (laser_filters/scan_to_scan_filter_chain) lslidar_driver_node (lslidar_driver/lslidar_driver_node) map_server (map_server/map_server) move_base (move_base/move_base) one_car_start (eprobot_start/one_car_start.py) robot_state_publisher (robot_state_publisher/robot_state_publisher) usb_cam (usb_cam/usb_cam_node) auto-starting new master process[master]: started with pid [14090] ROS_MASTER_URI=http://EPRobot:11311 setting /run_id to 99f833d2-6236-11f0-a6b3-e45f0131f240 process[rosout-1]: started with pid [14119] started core service [/rosout] process[usb_cam-2]: started with pid [14127] [ INFO] [1752664718.321383044]: using default calibration URL [ INFO] [1752664718.324520524]: camera calibration URL: file:///home/EPRobot/.ros/camera_info/head_camera.yaml [ INFO] [1752664718.326800107]: Starting 'head_camera' (/dev/video0) at 1280x960 via mmap (yuyv) at 30 FPS [ WARN] [1752664718.735313971]: unknown control 'focus_auto' process[image_view-3]: started with pid [14141] [ INFO] [1752664719.297416290]: Initializing nodelet with 4 worker threads. [ INFO] [1752664719.636365059]: Using transport "raw" Unable to init server: Could not connect: Connection refused (image_raw:14141): Gtk-WARNING **: 19:18:39.655: cannot open display: process[base_to_link-4]: started with pid [14162] [image_view-3] process has died [pid 14141, exit code -7, cmd /opt/ros/melodic/lib/image_view/image_view image:=/usb_cam/image_raw __name:=image_view __log:=/home/EPRobot/.ros/log/99f833d2-6236-11f0-a6b3-e45f0131f240/image_view-3.log]. log file: /home/EPRobot/.ros/log/99f833d2-6236-11f0-a6b3-e45f0131f240/image_view-3*.log process[base_to_gyro-5]: started with pid [14179] process[base_to_laser-6]: started with pid [14185] process[base_to_camera-7]: started with pid [14207] process[joint_state_publisher-8]: started with pid [14230] process[robot_state_publisher-9]: started with pid [14236] /opt/ros/melodic/lib/python2.7/dist-packages/roslib/packages.py:470: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if resource_name in files: process[base_control-10]: started with pid [14254] process[lslidar_driver_node-11]: started with pid [14290] [ INFO] [1752664729.962119437]: Lidar is M10 [ INFO] [1752664729.966360145]: Opening PCAP file port = /dev/EPRobot_laser, baud_rate = 460800 open_port /dev/EPRobot_laser OK ! [ INFO] [1752664729.975351998]: Initialised lslidar without error process[laser_filter-12]: started with pid [14294] [ INFO] [1752664731.668764248]: clear_inside(!invert): true [INFO] [1752664731.987782]: base control start... [INFO] [1752664732.050161]: LaserMode : Express [INFO] [1752664732.054070]: is_pub_odom_tf : false [INFO] [1752664732.058682]: is_send_anger : false [INFO] [1752664732.064063]: Opening Serial [INFO] [1752664732.068745]: Serial Open Succeed process[map_server-13]: started with pid [14302] process[amcl-14]: started with pid [14345] [ INFO] [1752664734.603713766]: Subscribed to map topic. process[move_base-15]: started with pid [14392] [ INFO] [1752664738.288776006]: Received a 113 X 155 map @ 0.050 m/pix [ INFO] [1752664738.342521599]: Initializing likelihood field model; this can take some time on large maps... [ INFO] [1752664738.564463605]: Done initializing likelihood field model. process[ekf_se-16]: started with pid [14487] ERROR: cannot launch node of type [eprobot_start/one_car_start.py]: Cannot locate node of type [one_car_start.py] in package [eprobot_start]. Make sure file exists in package path and permission is set to executable (chmod +x) [ WARN] [1752664744.622110021]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist. canTransform: source_frame base_footprint does not exist.. canTransform returned after 0.100855 timeout was 0.1. [ WARN] [1752664749.662226961]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.100879 timeout was 0.1. [ WARN] [1752664750.045300032]: No laser scan received (and thus no pose updates have been published) for 1752664750.045188 seconds. Verify that data is being published on the /scan_filtered topic. [ WARN] [1752664750.909388277]: global_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided [ WARN] [1752664750.910831334]: global_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided [ INFO] [1752664750.913784170]: global_costmap: Using plugin "static_layer" [ INFO] [1752664750.939597140]: Requesting the map... [ INFO] [1752664752.449678715]: Resizing costmap to 113 X 155 at 0.050000 m/pix [ INFO] [1752664752.547678812]: Received a 113 X 155 map at 0.050000 m/pix [ INFO] [1752664752.561273484]: global_costmap: Using plugin "obstacle_layer" [ INFO] [1752664752.575820460]: Subscribed to Topics: [ INFO] [1752664752.633974493]: global_costmap: Using plugin "inflation_layer" [ WARN] [1752664752.791761769]: local_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided [ WARN] [1752664752.792967329]: local_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided [ INFO] [1752664752.796072737]: local_costmap: Using plugin "static_layer" [ INFO] [1752664752.811786347]: Requesting the map... [ INFO] [1752664752.817690388]: Resizing static layer to 113 X 155 at 0.050000 m/pix [ INFO] [1752664752.917396353]: Received a 113 X 155 map at 0.050000 m/pix [ INFO] [1752664752.929664634]: local_costmap: Using plugin "obstacle_layer" [ INFO] [1752664752.939666756]: Subscribed to Topics: [ INFO] [1752664752.965128769]: local_costmap: Using plugin "inflation_layer" [ INFO] [1752664753.095626908]: Created local_planner teb_local_planner/TebLocalPlannerROS [ INFO] [1752664753.341522310]: Footprint model 'line' (line_start: [-0.1,0]m, line_end: [0.1,0]m) loaded for trajectory optimization. [ INFO] [1752664753.342274171]: Parallel planning in distinctive topologies disabled. [ INFO] [1752664753.342459132]: No costmap conversion plugin specified. All occupied costmap cells are treaten as point obstacles. [ INFO] [1752664754.285150804]: Recovery behavior will clear layer 'obstacles' [ INFO] [1752664754.293909996]: Recovery behavior will clear layer 'obstacles' [ INFO] [1752664754.905121673]: odom received! ^C[ekf_se-16] killing on exit [move_base-15] killing on exit [amcl-14] killing on exit [map_server-13] killing on exit [laser_filter-12] killing on exit [lslidar_driver_node-11] killing on exit [base_control-10] killing on exit [joint_state_publisher-8] killing on exit [robot_state_publisher-9] killing on exit [base_to_camera-7] killing on exit ^C[base_to_laser-6] killing on exit lslidar_driver_node: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:116: boost::condition_variable::~condition_variable(): Assertion !ret' failed. [base_to_gyro-5] killing on exit [base_to_link-4] killing on exit ^C[usb_cam-2] killing on exit ^C^C^C^C^C^C[rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done

/** * @brief 传感器外参标定库 * @author ZhengfengGu. any question please send mail to *[email protected] * @date 2025-5-22 * @version V1.0.0 * @copyright Copyright (c) 2003-无固定期限 杭州士腾科技有限公司 ********************************************************************* * @attention * 重要信息: * @par 修改日志: * * Date Version Author Description * 2025/5/22 1.0.0 ZhengfengGu 创建初始版本 * * ********************************************************************** */ #pragma once #include <common/sys_logger.h> #include #include <rclcpp/rclcpp.hpp> #include <sensor_msgs/msg/imu.hpp> #include <sensor_msgs/msg/laser_scan.hpp> #include <string> #include "calib_cfg/calib_cfg.h" #include "calib_common/time.h" #include "calibration_component/calibration_def.h" #include "geometry_msgs/msg/twist.hpp" #include "sensor/sensor_dispatch.h" // #include "mrp_interfaces/msg/motor_data.hpp" #include "mrp_interfaces/msg/motor_status_data.hpp" #include "mrp_interfaces/msg/motor_control_data.hpp" namespace mrp { namespace calib { // template <typename NodeT = rclcpp::Node::SharedPtr> class CalibrationComponent { public: /** * @brief 传感器外参标定库. * @param[in] i_lg [mrp::common::LoggerPtr] 日志库指针 * @param[in] i_init_param [InitExternalParam] * i_init_param.laser: 激光初始外参 * i_init_param.laser.x: 激光x轴偏移 * ... * i_init_param.imu: IMU初始外参 * i_init_param.imu.x: IMU x轴偏移 * ... * 初始外参(机械安装值),不标定的传感器初始外参可以不赋值 * @param[in] i_robot_param 机器人参数 * i_robot_param.model 0:差速, 1:阿克曼, 2:单舵轮 * i_robot_param.l:轴距, * i_robot_param.d:舵轮距离中心偏移, * i_robot_param.steer_offset:舵轮零偏(一般给0) */ CalibrationComponent( mrp::common::LoggerPtr i_lg, mrp_interfaces::calibration_component::InitExternalParam i_init_param, mrp_interfaces::calibration_component::RobotParam i_robot_param); ~CalibrationComponent(); /* * @brief * 单舵轮模型添加里程计数据,在标定雷达和里程计时,需要实时添加车辆控制信息, * 时间戳必须准确添加 * @param[in] header [std_msgs::msg::Header] * @param[in] msg [mrp_interfaces::calibration_component::SingleSteerControl] * 里程计数据 * @return void */ void AddSensorData( const std_msgs::msg::Header& header, const std::vector<mrp_interfaces::msg::MotorStatusData>& motor_datas); /* * @brief * 添加雷达数据 * @param[in] msg [sensor_msgs::msg::LaserScan::SharedPt] 雷达数据 * @return void */ void AddSensorData(const sensor_msgs::msg::LaserScan::SharedPtr msg); /* * @brief * 添加IMU数据 * @param[in] msg [sensor_msgs::msg::Imu::SharedPtr msg] IMU数据 * @return void */ void AddSensorData(const sensor_msgs::msg::Imu::SharedPtr msg); /** * @breif 复位状态,开始标定 * @param[in] i_calib_mode [CalibMode] * i_calib_mode.mode:标定模式,0:激光+里程计+IMU, * 1:激光+里程计,2:IMU * i_calib_mode.move_dist:移动距离 (单位m) * @return error_code [int] -1:模式错误 -2:机器人模型错误 * @retval int. */ int StartCalibration( mrp_interfaces::calibration_component::CalibMode i_calib_mode); /** * @brief 停止标定 */ void StopCalibration(); /* * @brief 获取单舵轮模型标定运动指令 * @param[out] cmd_vel * [mrp_interfaces::calibration_component::SingleSteerControl] 标定运动指令 * @retval void */ void GetCalibrationMoveCommand( std::vector<mrp_interfaces::msg::MotorControlData>& motor_datas); /** * @brief 获取标定状态和结果 * @param[out] calib_result [std::map<std::string, * mrp_interfaces::calibration_component::ExternalParam>] 标定结果   * first: 外设类型(可选值: "lidar", "odom", "imu", "camera")     * second: 外参结构体(其中舵角零偏在second.yaw中) * @return calib_status [int] 0:未开始 3:进行中 5:完成 6:失败 * 状态为 NONE = 0, * WAITING, * INITIALIZING, * RUNNING, * PAUSED, * FINISHED, * FAILED * @retval int */ int GetCalibrationStatusAndResult( std::map<std::string, mrp_interfaces::calibration_component::ExternalParam>& calib_result); void DebugPrint(); private: void CalcuteOdom(const sensor::MotorData& msg); enum class ActionStatus { NONE = 0, WAITING, INITIALIZING, RUNNING, PAUSED, FINISHED, FAILED }; std::shared_ptr<CalibCfg> config_; mrp::common::LoggerPtr logger_; std::shared_ptr<sensor::SensorDispatch> sensor_dispatch_; std::deque<sensor::MotorData> odom_buffer_; struct { double x = 0.0; double y = 0.0; double yaw = 0.0; } current_odom_; bool is_forward_phase_ = true, is_left_phase_ = true; double origin_x = 0, origin_y = 0, origin_yaw = 0; bool move_initialized_ = false; std::deque<common::Time> control_times_; }; } // namespace calib } // namespace mrp 逐行翻译

#include <Wire.h> #include "MAX30105.h" #include "spo2_algorithm.h" #include <U8g2lib.h> // 初始化OLED (SH1106, I2C) U8g2 SH1106_I2C_128x64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // 初始化MAX30102 MAX30105 particleSensor; // 血氧算法缓冲区 #define MAX_BRIGHTNESS 255 uint32_t irBuffer[100]; // 红外光数据 uint32_t redBuffer[100]; // 红光数据 int32_t spo2; // 血氧值 int8_t validSPO2; // 有效性标志 int32_t heartRate; // 心率 int8_t validHeartRate; // 有效性标志 void setup() { Serial.begin(115200); // 初始化OLED u8g2.begin(); u8g2.setFont(u8g2_font_ncenB14_tr); u8g2.clearBuffer(); u8g2.drawStr(0, 20, "Initializing..."); u8g2.sendBuffer(); // 初始化传感器 if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) { u8g2.clearBuffer(); u8g2.drawStr(0, 20, "Sensor Error!"); u8g2.sendBuffer(); while (1); } // 配置MAX30102 byte ledBrightness = 60; // 0-255 byte sampleAverage = 4; // 采样平均 byte ledMode = 2; // 红光+红外光模式 int sampleRate = 400; // 采样率(Hz) int pulseWidth = 411; // 脉冲宽度(us) int adcRange = 4096; // ADC范围 particleSensor.setup(ledBrightness, sampleAverage, ledMode, sampleRate, pulseWidth, adcRange); particleSensor.enableDIETEMPRDY(); // 预热传感器 for (int i = 0; i < 100; i++) { particleSensor.check(); // 清空缓冲区 delay(10); } } void loop() { // 采集100个样本 for (byte i = 0; i < 100; i++) { while (!particleSensor.available()) particleSensor.check(); redBuffer[i] = particleSensor.getRed(); irBuffer[i] = particleSensor.getIR(); particleSensor.nextSample(); } // 计算血氧和心率 maxim_heart_rate_and_oxygen_saturation( irBuffer, 100, redBuffer, &spo2, &validSPO2, &heartRate, &validHeartRate ); // OLED显示结果 u8g2.clearBuffer(); u8g2.setFont(u8g2_font_ncenB14_tr); if (validSPO2 && validHeartRate) { u8g2.setCursor(0, 20); u8g2.print("SpO2: "); u8g2.print(spo2); u8g2.print("%"); u8g2.setCursor(0, 45); u8g2.print("BPM: "); u8g2.print(heartRate); } else { u8g2.drawStr(0, 20, "Place finger"); u8g2.drawStr(0, 45, "on sensor..."); } // 显示波形 static int wavePos = 0; u8g2.drawPixel(wavePos, 63 - map(irBuffer[99] % 2000, 0, 2000, 0, 30)); wavePos = (wavePos + 1) % 128; u8g2.sendBuffer(); delay(10); } D:\徐景川作业相关\传感器实验\智能传感与检测技术 实习\sketch_jul10a_copy_20250714175331\sketch_jul10a_copy_20250714175331.ino:7:1: error: 'U8g2' does not name a type; did you mean 'U8G2'? D:\徐景川作业相关\传感器实验\智能传感与检测技术 实习\sketch_jul10a_copy_20250714175331\sketch_jul10a_copy_20250714175331.ino: In function 'void setup()': D:\徐景川作业相关\传感器实验\智能传感与检测技术 实习\sketch_jul10a_copy_20250714175331\sketch_jul10a_copy_20250714175331.ino:25:3: error: 'u8g2' was not declared in this scope D:\徐景川作业相关\传感器实验\智能传感与检测技术 实习\sketch_jul10a_copy_20250714175331\sketch_jul10a_copy_20250714175331.ino:25:3: note: suggested alternative: 'U8G2' D:\徐景川作业相关\传感器实验\智能传感与检测技术 实习\sketch_jul10a_copy_20250714175331\sketch_jul10a_copy_20250714175331.ino: In function 'void loop()': D:\徐景川作业相关\传感器实验\智能传感与检测技术 实习\sketch_jul10a_copy_20250714175331\sketch_jul10a_copy_20250714175331.ino:72:3: error: cannot convert 'uint32_t* {aka long unsigned int*}' to 'uint16_t* {aka unsigned int*}' for argument '1' to 'void maxim_heart_rate_and_oxygen_saturation(uint16_t*, int32_t, uint16_t*, int32_t*, int8_t*, int32_t*, int8_t*)' D:\徐景川作业相关\传感器实验\智能传感与检测技术 实习\sketch_jul10a_copy_20250714175331\sketch_jul10a_copy_20250714175331.ino:75:3: error: 'u8g2' was not declared in this scope D:\徐景川作业相关\传感器实验\智能传感与检测技术 实习\sketch_jul10a_copy_20250714175331\sketch_jul10a_copy_20250714175331.ino:75:3: note: suggested alternative: 'U8G2' exit status 1 Compilation error: 'U8g2' does not name a type; did you mean 'U8G2'?

--------------------Configuration: My - Win32 Debug-------------------- Compiling resources... Compiling... StdAfx.cpp Compiling... My.cpp MainFrm.cpp MyDoc.cpp MyView.cpp F:\My\MyView.cpp(59) : error C2065: 'dotMatrix_Liu' : undeclared identifier F:\My\MyView.cpp(59) : error C2109: subscript requires array or pointer type F:\My\MyView.cpp(59) : error C2109: subscript requires array or pointer type F:\My\MyView.cpp(108) : error C2039: 'DrawVectorName' : is not a member of 'CMyView' f:\my\myview.h(13) : see declaration of 'CMyView' F:\My\MyView.cpp(116) : error C2084: function 'const struct AFX_MSGMAP *__stdcall CMyView::_GetBaseMessageMap(void)' already has a body F:\My\MyView.cpp(116) : error C2084: function 'const struct AFX_MSGMAP *__thiscall CMyView::GetMessageMap(void) const' already has a body F:\My\MyView.cpp(116) : error C2374: 'protected: static struct AFX_MSGMAP const CMyView::messageMap' : redefinition; multiple initialization f:\my\myview.h(54) : see declaration of 'protected: static struct AFX_MSGMAP const CMyView::messageMap' F:\My\MyView.cpp(116) : error C2374: 'private: static struct AFX_MSGMAP_ENTRY const * const CMyView::_messageEntries' : redefinition; multiple initialization f:\my\myview.h(54) : see declaration of 'private: static struct AFX_MSGMAP_ENTRY const * const CMyView::_messageEntries' F:\My\MyView.cpp(118) : error C2509: 'OnKeyDown' : member function not declared in 'CMyView' f:\my\myview.h(13) : see declaration of 'CMyView' F:\My\MyView.cpp(123) : error C2040: 'dotMatrix_Liu' : 'unsigned char [16][16]' differs in levels of indirection from 'int' Generating Code... 执行 cl.exe 时出错. My.exe - 1 error(s), 0 warning(s) 怎么解决

#include "camera_pins.h" #include <WiFi.h> #include "esp_camera.h" #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> // Edge Impulse模型库(需手动添加到项目目录) #include "shibie_inferencing.h" #include "edge-impulse-sdk/dsp/image/image.hpp" #include "esp_task_wdt.h" #include "freertos/semphr.h" #include <SD_MMC.h> // SD卡库(使用SPI或SDMMC接口) #include <SPIFFS.h> #include <SD.h> // SPI接口SD卡库(新增) #include <Time.h> // 时间函数库(新增) #include "esp_task_wdt.h" #include "freertos/semphr.h" // 功能开关 #define ENABLE_INFERENCE 1 #define ENABLE_HTTP_SERVER 1 #define ENABLE_OLED_DISPLAY 1 #define ENABLE_SD_CARD 1 // 启用SD卡功能 #define SUPPORT_OBJECT_DETECTION 0 // 摄像头配置 #define CAMERA_MODEL_AI_THINKER #define XCLK_FREQ_HZ 2000000 // 降低时钟频率 #define FRAME_SIZE FRAMESIZE_QVGA // 320x240分辨率 #define JPEG_QUALITY 12 #define MAX_CAPTURE_RETRIES 3 // 图像尺寸 #define EI_CAMERA_COLS 320 #define EI_CAMERA_ROWS 240 #define MODEL_INPUT_WIDTH EI_CLASSIFIER_INPUT_WIDTH #define MODEL_INPUT_HEIGHT EI_CLASSIFIER_INPUT_HEIGHT // OLED配置 #define OLED_WIDTH 128 #define OLED_HEIGHT 64 #define OLED_RESET -1 #define OLED_SDA 21 #define OLED_SCL 22 Adafruit_SSD1306 display(OLED_WIDTH, OLED_HEIGHT, &Wire, OLED_RESET); // WiFi配置 const char* ssid = "88888888"; const char* password = "11111111"; // SD卡配置(SPI接口) #define SD_MOUNT_POINT "/sdcard" #define SD_PIN_CS 15 // 改为常用的SPI CS引脚(原5可能冲突) // 全局变量 WiFiServer server(80); static bool is_initialised = false; static bool wifi_connected = false; static bool sd_ready = false; uint8_t* model_buf = NULL; camera_fb_t* fb = NULL; SemaphoreHandle_t camera_mutex = NULL; SemaphoreHandle_t sd_mutex = NULL; // 摄像头配置 static camera_config_t camera_config = { .pin_pwdn = PWDN_GPIO_NUM, .pin_reset = RESET_GPIO_NUM, .pin_xclk = XCLK_GPIO_NUM, .pin_sscb_sda = SIOD_GPIO_NUM, .pin_sscb_scl = SIOC_GPIO_NUM, .pin_d7 = Y9_GPIO_NUM, .pin_d6 = Y8_GPIO_NUM, .pin_d5 = Y7_GPIO_NUM, .pin_d4 = Y6_GPIO_NUM, .pin_d3 = Y5_GPIO_NUM, .pin_d2 = Y4_GPIO_NUM, .pin_d1 = Y3_GPIO_NUM, .pin_d0 = Y2_GPIO_NUM, .pin_vsync = VSYNC_GPIO_NUM, .pin_href = HREF_GPIO_NUM, .pin_pclk = PCLK_GPIO_NUM, .xclk_freq_hz = XCLK_FREQ_HZ, .ledc_timer = LEDC_TIMER_0, .ledc_channel = LEDC_CHANNEL_0, .pixel_format = PIXFORMAT_JPEG, .frame_size = FRAME_SIZE, .jpeg_quality = JPEG_QUALITY, .fb_count = 1, .fb_location = CAMERA_FB_IN_PSRAM, .grab_mode = CAMERA_GRAB_WHEN_EMPTY, }; /* -------------------------- 时间初始化 -------------------------- */ // 初始化时间(使用NTP同步) void init_time() { configTime(8 * 3600, 0, "pool.ntp.org", "time.nist.gov"); // 北京时间(UTC+8) Serial.println("等待时间同步..."); time_t now = time(nullptr); int retry_count = 0; // 等待时间同步,超时则跳过 while (now < 1609459200 && retry_count < 10) { // 等待同步到2021年之后 delay(1000); Serial.print("."); now = time(nullptr); retry_count++; } if (now >= 1609459200) { Serial.println("\n时间同步完成"); struct tm* tm_info = localtime(&now); char time_str[26]; strftime(time_str, 26, "%Y-%m-%d %H:%M:%S", tm_info); Serial.print("当前时间: "); Serial.println(time_str); } else { Serial.println("\n时间同步超时,使用默认时间"); } } /* -------------------------- SD卡操作 -------------------------- */ #ifdef ENABLE_SD_CARD bool sd_init() { sd_mutex = xSemaphoreCreateMutex(); if (!sd_mutex) { Serial.println("SD卡互斥锁创建失败"); return false; } Serial.println("初始化SD卡..."); // 尝试SDMMC模式(仅适用于支持SDMMC的板子) if (!SD_MMC.begin("/sdcard", true)) { // 1线模式 Serial.println("SDMMC模式失败,尝试SPI模式..."); // SPI模式初始化(低速模式提高兼容性) if (!SD.begin(SD_PIN_CS, SPI, 1000000)) { // 1MHz低速率 Serial.println("SPI模式初始化失败,检查:"); Serial.println("1. 引脚连接是否正确(CS=" + String(SD_PIN_CS) + ", SCK=18, MOSI=23, MISO=19)"); Serial.println("2. SD卡是否为FAT32格式"); Serial.println("3. 尝试更换SD卡"); return false; } } // 验证SD卡读写功能 File testFile = SD.open("/test.txt", FILE_WRITE); if (testFile) { testFile.println("SD卡测试成功"); testFile.close(); // 读取测试 testFile = SD.open("/test.txt", FILE_READ); if (testFile) { String content = testFile.readString(); testFile.close(); SD.remove("/test.txt"); // 删除测试文件 Serial.println("SD卡读写验证成功: " + content); } } else { Serial.println("SD卡写入测试失败"); return false; } // 创建目录 if (!SD.exists("/logs")) SD.mkdir("/logs"); if (!SD.exists("/images")) SD.mkdir("/images"); sd_ready = true; Serial.println("SD卡初始化成功"); return true; } // 写入日志到SD卡 void sd_log(const char* message) { if (!sd_ready) return; if (xSemaphoreTake(sd_mutex, 1000 / portTICK_PERIOD_MS) != pdTRUE) return; time_t now = time(nullptr); struct tm* tm = localtime(&now); char filename[32]; sprintf(filename, "/logs/%04d%02d%02d.txt", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); File file = SD.open(filename, FILE_APPEND); if (file) { char timestamp[32]; sprintf(timestamp, "[%02d:%02d:%02d] ", tm->tm_hour, tm->tm_min, tm->tm_sec); file.print(timestamp); file.println(message); file.close(); } xSemaphoreGive(sd_mutex); } // 保存图像到SD卡 bool sd_save_image(const uint8_t* data, size_t size) { if (!sd_ready || !data || size == 0) return false; if (xSemaphoreTake(sd_mutex, 1000 / portTICK_PERIOD_MS) != pdTRUE) return false; time_t now = time(nullptr); struct tm* tm = localtime(&now); char filename[64]; sprintf(filename, "/images/img_%04d%02d%02d_%02d%02d%02d.jpg", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); File file = SD.open(filename, FILE_WRITE); if (!file) { xSemaphoreGive(sd_mutex); return false; } bool success = (file.write(data, size) == size); file.close(); xSemaphoreGive(sd_mutex); if (success) { Serial.printf("图像保存到: %s\n", filename); sd_log((String("图像保存: ") + filename).c_str()); } return success; } // 从SD卡读取图像 size_t sd_read_image(const char* filename, uint8_t* buffer, size_t max_size) { if (!sd_ready || !buffer || max_size == 0) return 0; if (xSemaphoreTake(sd_mutex, 1000 / portTICK_PERIOD_MS) != pdTRUE) return 0; File file = SD.open(filename, FILE_READ); if (!file) { xSemaphoreGive(sd_mutex); return 0; } size_t size = file.size(); if (size > max_size) size = max_size; size_t read = file.read(buffer, size); file.close(); xSemaphoreGive(sd_mutex); return read; } #endif /* -------------------------- 图像处理函数 -------------------------- */ bool convert_jpeg_to_rgb888_from_sd(const char* jpeg_path, uint8_t* rgb_data, size_t rgb_size) { if (!sd_ready || !rgb_data) return false; File file = SD.open(jpeg_path, FILE_READ); if (!file) return false; size_t jpeg_size = file.size(); if (jpeg_size == 0 || jpeg_size > 1024*200) { file.close(); return false; } uint8_t* jpeg_buf = (uint8_t*)ps_malloc(jpeg_size); if (!jpeg_buf) { file.close(); return false; } size_t read = file.read(jpeg_buf, jpeg_size); file.close(); if (read != jpeg_size) { free(jpeg_buf); return false; } bool success = fmt2rgb888(jpeg_buf, jpeg_size, PIXFORMAT_JPEG, rgb_data); free(jpeg_buf); return success; } // 备用缩放函数(当默认缩放失败时使用) bool backup_resize_rgb888(const uint8_t* src, uint32_t src_width, uint32_t src_height, uint8_t* dst, uint32_t dst_width, uint32_t dst_height) { if (!src || !dst || src_width == 0 || src_height == 0 || dst_width == 0 || dst_height == 0) { return false; } if (((uintptr_t)dst) % 4 != 0) { Serial.println("错误:输出缓冲区未4字节对齐"); return false; } float x_ratio = (float)src_width / (float)dst_width; float y_ratio = (float)src_height / (float)dst_height; for (uint32_t y = 0; y < dst_height; y++) { for (uint32_t x = 0; x < dst_width; x++) { float src_x = x * x_ratio; float src_y = y * y_ratio; uint32_t x1 = (uint32_t)src_x; uint32_t y1 = (uint32_t)src_y; uint32_t x2 = (x1 < src_width - 1) ? x1 + 1 : x1; uint32_t y2 = (y1 < src_height - 1) ? y1 + 1 : y1; float fx = src_x - x1; float fy = src_y - y1; for (uint8_t c = 0; c < 3; c++) { uint8_t v11 = src[(y1 * src_width + x1) * 3 + c]; uint8_t v12 = src[(y2 * src_width + x1) * 3 + c]; uint8_t v21 = src[(y1 * src_width + x2) * 3 + c]; uint8_t v22 = src[(y2 * src_width + x2) * 3 + c]; uint8_t v1 = (uint8_t)((1 - fx) * v11 + fx * v21); uint8_t v2 = (uint8_t)((1 - fx) * v12 + fx * v22); dst[(y * dst_width + x) * 3 + c] = (uint8_t)((1 - fy) * v1 + fy * v2); } } } return true; } /* -------------------------- 工具函数 -------------------------- */ void oled_print(const char* line1, const char* line2 = "", const char* line3 = "") { #ifdef ENABLE_OLED_DISPLAY display.clearDisplay(); display.setTextSize(1); display.setTextColor(SSD1306_WHITE); display.setCursor(0, 0); display.println(line1); if (strlen(line2) > 0) { display.setCursor(0, 16); display.println(line2); } if (strlen(line3) > 0) { display.setCursor(0, 32); display.println(line3); } display.display(); #endif } /* -------------------------- 摄像头操作 -------------------------- */ bool camera_init() { if (is_initialised) return true; Serial.println("\n===== 摄像头初始化 ====="); camera_mutex = xSemaphoreCreateMutex(); #ifdef ENABLE_SD_CARD // 初始化SD卡(允许失败,不影响主功能) if (!sd_init()) { Serial.println("SD卡初始化失败,继续启动系统"); } #endif gpio_uninstall_isr_service(); esp_err_t err; int init_retry = 0; while (init_retry < 3) { err = esp_camera_init(&camera_config); if (err == ESP_OK) break; Serial.printf("摄像头初始化失败(重试%d): %s\n", init_retry+1, esp_err_to_name(err)); #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log((String("摄像头初始化失败: ") + esp_err_to_name(err)).c_str()); } #endif if (err == ESP_ERR_INVALID_STATE) { gpio_uninstall_isr_service(); } init_retry++; vTaskDelay(1000 / portTICK_PERIOD_MS); } if (err != ESP_OK) { Serial.println("摄像头初始化彻底失败"); #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log("摄像头初始化彻底失败"); } #endif return false; } sensor_t* s = esp_camera_sensor_get(); if (s) { s->set_vflip(s, 1); s->set_hmirror(s, 1); s->set_awb_gain(s, 1); } size_t model_size = MODEL_INPUT_WIDTH * MODEL_INPUT_HEIGHT * 3; model_size = (model_size + 3) & ~3; // 4字节对齐 model_buf = (uint8_t*)aligned_alloc(4, model_size); if (!model_buf) { Serial.println("模型缓冲区分配失败"); camera_deinit(); return false; } Serial.printf("模型缓冲区: %zu bytes\n", model_size); is_initialised = true; Serial.println("摄像头初始化成功"); #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log("摄像头初始化成功"); } #endif return true; } void camera_deinit() { if (!is_initialised) return; esp_camera_deinit(); if (model_buf) free(model_buf); model_buf = NULL; is_initialised = false; } bool camera_capture_to_sd() { if (!is_initialised) return false; if (xSemaphoreTake(camera_mutex, 2000 / portTICK_PERIOD_MS) != pdTRUE) { return false; } bool success = false; fb = esp_camera_fb_get(); if (fb && fb->len > 1024) { #ifdef ENABLE_SD_CARD if (sd_ready) { success = sd_save_image(fb->buf, fb->len); } #endif esp_camera_fb_return(fb); fb = NULL; } xSemaphoreGive(camera_mutex); return success; } bool process_image_from_sd(uint8_t* model_buf, size_t model_size) { if (!sd_ready || !model_buf) return false; File dir = SD.open("/images"); if (!dir) return false; File latest_file; time_t latest_time = 0; while (File file = dir.openNextFile()) { if (!file.isDirectory() && strstr(file.name(), ".jpg")) { time_t t = file.getLastWrite(); if (t > latest_time) { latest_time = t; if (latest_file) latest_file.close(); latest_file = file; } else { file.close(); } } } dir.close(); if (!latest_file) return false; const char* img_path = latest_file.path(); latest_file.close(); size_t rgb_size = EI_CAMERA_COLS * EI_CAMERA_ROWS * 3; uint8_t* rgb_buf = (uint8_t*)ps_malloc(rgb_size); if (!rgb_buf) return false; bool success = false; if (convert_jpeg_to_rgb888_from_sd(img_path, rgb_buf, rgb_size)) { success = ei::image::processing::crop_and_interpolate_rgb888( rgb_buf, EI_CAMERA_COLS, EI_CAMERA_ROWS, model_buf, MODEL_INPUT_WIDTH, MODEL_INPUT_HEIGHT ); if (!success) { success = backup_resize_rgb888( rgb_buf, EI_CAMERA_COLS, EI_CAMERA_ROWS, model_buf, MODEL_INPUT_WIDTH, MODEL_INPUT_HEIGHT ); } } free(rgb_buf); return success; } /* -------------------------- 推理核心 -------------------------- */ #ifdef ENABLE_INFERENCE void run_inference() { if (!is_initialised || !model_buf) { oled_print("未就绪", "设备异常"); return; } Serial.println("\n===== 开始推理 ====="); oled_print("识别中..."); if (!camera_capture_to_sd()) { oled_print("处理失败", "图像捕获失败"); #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log("图像捕获失败"); } #endif return; } if (!process_image_from_sd(model_buf, MODEL_INPUT_WIDTH * MODEL_INPUT_HEIGHT * 3)) { oled_print("处理失败", "图像转换失败"); #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log("图像转换失败"); } #endif return; } ei::signal_t signal; signal.total_length = MODEL_INPUT_WIDTH * MODEL_INPUT_HEIGHT; signal.get_data = [](size_t offset, size_t length, float* out) { size_t pixel_ix = offset * 3; if (pixel_ix + 3*length > MODEL_INPUT_WIDTH * MODEL_INPUT_HEIGHT * 3) { Serial.println("错误:模型输入数据越界"); return -1; } for (size_t i = 0; i < length; i++) { uint8_t r = model_buf[pixel_ix]; uint8_t g = model_buf[pixel_ix + 1]; uint8_t b = model_buf[pixel_ix + 2]; out[i] = (r - 127.5f) / 127.5f; out[i + length] = (g - 127.5f) / 127.5f; out[i + length * 2] = (b - 127.5f) / 127.5f; pixel_ix += 3; } return 0; }; ei_impulse_result_t result; memset(&result, 0, sizeof(result)); EI_IMPULSE_ERROR err = run_classifier(&signal, &result, false); if (err != EI_IMPULSE_OK) { Serial.printf("推理失败: %d\n", err); oled_print("推理错误", String(err).c_str()); #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log((String("推理失败: ") + String(err)).c_str()); } #endif return; } float max_prob = 0; const char* max_label = "未知"; for (uint16_t i = 0; i < EI_CLASSIFIER_LABEL_COUNT; i++) { if (result.classification[i].value > max_prob) { max_prob = result.classification[i].value; max_label = ei_classifier_inferencing_categories[i]; } } Serial.printf("识别结果: %s (%.1f%%)\n", max_label, max_prob*100); oled_print("识别为:", max_label, (String(max_prob*100, 1) + "%").c_str()); #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log((String("识别结果: ") + max_label + " (" + String(max_prob*100) + "%)").c_str()); } #endif } #endif /* -------------------------- HTTP服务 -------------------------- */ #ifdef ENABLE_HTTP_SERVER void handle_client(WiFiClient& client) { String req = client.readStringUntil('\n'); req.trim(); Serial.println("HTTP请求: " + req); if (req.startsWith("GET /photo")) { client.println("HTTP/1.1 200 OK"); client.println("Content-Type: image/jpeg"); client.println("Connection: close"); client.println(); #ifdef ENABLE_SD_CARD if (sd_ready) { File dir = SD.open("/images"); File latest_file; while (File file = dir.openNextFile()) { if (!file.isDirectory() && strstr(file.name(), ".jpg")) { if (!latest_file || file.getLastWrite() > latest_file.getLastWrite()) { if (latest_file) latest_file.close(); latest_file = file; } else { file.close(); } } } dir.close(); if (latest_file) { size_t fileSize = latest_file.size(); const size_t bufferSize = 1024; uint8_t buffer[bufferSize]; while (fileSize > 0) { size_t read = latest_file.read(buffer, min(bufferSize, fileSize)); client.write(buffer, read); fileSize -= read; } latest_file.close(); } else { client.print("无图像文件"); } } else { client.print("SD卡未就绪"); } #else client.print("SD卡功能未启用"); #endif } else if (req.startsWith("GET /infer")) { client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/plain"); client.println("Connection: close"); client.println(); run_inference(); client.println("推理已触发"); } else if (req.startsWith("GET /")) { client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println("Connection: close"); client.println(); client.println("<html><body>"); client.println("ESP32 识别系统"); client.println("查看最新照片
"); client.println("运行识别
"); client.println("</body></html>"); } else { client.println("HTTP/1.1 404 Not Found"); client.println("Content-Type: text/plain"); client.println("Connection: close"); client.println(); client.println("404 Not Found"); } delay(1); client.stop(); } #endif /* -------------------------- WiFi连接 -------------------------- */ void connect_wifi() { if (wifi_connected) return; Serial.println("\n===== WiFi连接 ====="); oled_print("连接WiFi...", ssid); WiFi.begin(ssid, password); int attempt = 0; while (WiFi.status() != WL_CONNECTED && attempt < 20) { delay(500); Serial.print("."); attempt++; } if (WiFi.status() == WL_CONNECTED) { wifi_connected = true; Serial.println("\nWiFi连接成功"); Serial.print("IP地址: "); Serial.println(WiFi.localIP()); oled_print("WiFi已连接", WiFi.localIP().toString().c_str()); #ifdef ENABLE_HTTP_SERVER server.begin(); Serial.println("HTTP服务启动"); #endif #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log((String("WiFi连接成功 - IP: ") + WiFi.localIP().toString()).c_str()); } #endif } else { Serial.println("\nWiFi连接失败"); oled_print("WiFi连接失败", "请检查配置"); #ifdef ENABLE_SD_CARD if (sd_ready) { sd_log("WiFi连接失败"); } #endif } } /* -------------------------- 初始化和主循环 -------------------------- */ void setup() { Serial.begin(115200); Serial.println("Edge Impulse 识别系统启动中"); // 初始化OLED #ifdef ENABLE_OLED_DISPLAY Wire.begin(OLED_SDA, OLED_SCL); if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(F("SSD1306 OLED显示屏初始化失败")); } else { display.clearDisplay(); display.setTextSize(1); display.setTextColor(SSD1306_WHITE); display.setCursor(0, 0); display.println("Edge Impulse"); display.println("识别系统启动中"); display.display(); } #endif // 初始化时间 init_time(); // 初始化摄像头 if (!camera_init()) { oled_print("错误", "摄像头初始化失败"); delay(5000); } // 连接WiFi connect_wifi(); // 启动看门狗 esp_task_wdt_init(10, false); } void loop() { // 喂狗 esp_task_wdt_reset(); // 检查WiFi连接 if (!wifi_connected || WiFi.status() != WL_CONNECTED) { wifi_connected = false; connect_wifi(); } // 处理HTTP请求 #ifdef ENABLE_HTTP_SERVER if (wifi_connected) { WiFiClient client = server.available(); if (client) { handle_client(client); } } #endif // 主循环逻辑 static unsigned long last_inference_time = 0; if (millis() - last_inference_time > 10000) { // 每10秒运行一次推理 last_inference_time = millis(); #ifdef ENABLE_INFERENCE run_inference(); #endif } delay(100); }

root@localhost:~/5.15-13# tools/bazel run //common:kernel_aarch64_dist --config=fast INFO: Analyzed target //common:kernel_aarch64_dist (0 packages loaded, 0 targets configured). INFO: Found 1 target... ERROR: /root/5.15-13/common/BUILD.bazel:52:22: Building kernel kernel_aarch64 failed: (Exit 2): bash failed: error executing command (from target //common:kernel_aarch64) /bin/bash -c ... (remaining 1 argument skipped) /root/5.15-13/common/kernel/sys.c:3099:20: error: initializing 'struct perf_event *' with an expression of incompatible type 'typeof (*(*bp_ptr))' (aka 'struct perf_event'); remove * struct perf_event *cpu_event = *this_cpu_ptr(*bp_ptr); ^ ~~~~~~~~~~~~~~~~~~~~~~ /root/5.15-13/common/kernel/sys.c:3124:8: error: incompatible pointer types assigning to 'struct perf_event *' from 'struct perf_event **'; dereference with * [-Werror,-Wincompatible-pointer-types] new_bp = register_wide_hw_breakpoint(&new_attr, hwbp_handler, current); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * /root/5.15-13/common/kernel/sys.c:3131:31: error: incompatible pointer types passing 'struct perf_event *' to parameter of type 'struct perf_event **'; remove * [-Werror,-Wincompatible-pointer-types] unregister_wide_hw_breakpoint(*bp_ptr); ^~~~~~~ /root/5.15-13/common/include/linux/hw_breakpoint.h:76:73: note: passing argument to parameter 'cpu_events' here extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events); ^ /root/5.15-13/common/kernel/sys.c:3137:18: error: assigning to 'struct perf_event *' from incompatible type 'typeof (*(new_bp))' (aka 'struct perf_event'); remove * info->sample_hbp = *this_cpu_ptr(new_bp); ^ ~~~~~~~~~~~~~~~~~~~~~ /root/5.15-13/common/kernel/sys.c:3099:20: error: mixing declarations and code is a C99 extension [-Werror,-Wdeclaration-after-statement] struct perf_event *cpu_event = *this_cpu_ptr(*bp_ptr); ^ /root/5.15-13/common/kernel/sys.c:3161:9: error: incompatible pointer types assigning to 'struct perf_event *' from 'struct perf_event **'; dereference with * [-Werror,-Wincompatible-pointer-types] orig_bp = register_wide_hw_breakpoint(&orig_attr, hwbp_handler, current); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * /root/5.15-13/common/kernel/sys.c:3168:31: error: incompatible pointer types passing 'struct perf_event *' to parameter of type 'struct perf_event **'; remove * [-Werror,-Wincompatible-pointer-types] unregister_wide_hw_breakpoint(*bp_ptr); ^~~~~~~ /root/5.15-13/common/include/linux/hw_breakpoint.h:76:73: note: passing argument to parameter 'cpu_events' here extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events); ^ /root/5.15-13/common/kernel/sys.c:3174:18: error: assigning to 'struct perf_event *' from incompatible type 'typeof (*(orig_bp))' (aka 'struct perf_event'); remove * info->sample_hbp = *this_cpu_ptr(orig_bp); ^ ~~~~~~~~~~~~~~~~~~~~~~ /root/5.15-13/common/kernel/sys.c:3334:31: error: incompatible pointer types passing 'struct perf_event *' to parameter of type 'struct perf_event **'; take the address with & [-Werror,-Wincompatible-pointer-types] unregister_wide_hw_breakpoint(bp); ^~ & /root/5.15-13/common/include/linux/hw_breakpoint.h:76:73: note: passing argument to parameter 'cpu_events' here extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events); ^ /root/5.15-13/common/kernel/sys.c:3423:31: error: incompatible pointer types passing 'struct perf_event *' to parameter of type 'struct perf_event **'; take the address with & [-Werror,-Wincompatible-pointer-types] unregister_wide_hw_breakpoint(bp); ^~ & /root/5.15-13/common/include/linux/hw_breakpoint.h:76:73: note: passing argument to parameter 'cpu_events' here extern void unregister_wide_hw_breakpoint(struct perf_event * __percpu *cpu_events); ^ /root/5.15-13/common/kernel/sys.c:3499:4: error: incompatible pointer types assigning to 'struct perf_event *' from 'struct perf_event **'; dereference with * [-Werror,-Wincompatible-pointer-types] bp = register_wide_hw_breakpoint(&attr, hwbp_handler, tsk); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * /root/5.15-13/common/kernel/sys.c:3507:22: error: assigning to 'struct perf_event *' from incompatible type 'typeof (*(bp))' (aka 'struct perf_event'); remove * new_info->sample_hbp = *this_cpu_ptr(bp); // 关联断点句柄 ^ ~~~~~~~~~~~~~~~~~ 12 errors generated. make[2]: *** [/root/5.15-13/common/scripts/Makefile.build:287: kernel/sys.o] Error 1 make[1]: *** [/root/5.15-13/common/Makefile:1953: kernel] Error 2 make: *** [Makefile:244: __sub-make] Error 2 仔细检查问题修复好 5.15内核 安卓14 确保所有逻辑正常使用无任何编译报错后 完整发给我代码

D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\XClk.cpp: In function 'bool ClockEnable(int, int)': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\XClk.cpp:7:26: error: 'PERIPH_LEDC_MODULE' was not declared in this scope 7 | periph_module_enable(PERIPH_LEDC_MODULE); | ^~~~~~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\XClk.cpp:7:5: error: 'periph_module_enable' was not declared in this scope 7 | periph_module_enable(PERIPH_LEDC_MODULE); | ^~~~~~~~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\XClk.cpp:10:16: error: 'struct ledc_timer_config_t' has no member named 'bit_num' 10 | timer_conf.bit_num = (ledc_timer_bit_t)1; | ^~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\XClk.cpp:12:29: error: 'LEDC_HIGH_SPEED_MODE' was not declared in this scope; did you mean 'LEDC_LOW_SPEED_MODE'? 12 | timer_conf.speed_mode = LEDC_HIGH_SPEED_MODE; | ^~~~~~~~~~~~~~~~~~~~ | LEDC_LOW_SPEED_MODE D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\XClk.cpp: In function 'void ClockDisable()': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\XClk.cpp:36:27: error: 'PERIPH_LEDC_MODULE' was not declared in this scope 36 | periph_module_disable(PERIPH_LEDC_MODULE); | ^~~~~~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\XClk.cpp:36:5: error: 'periph_module_disable' was not declared in this scope 36 | periph_module_disable(PERIPH_LEDC_MODULE); | ^~~~~~~~~~~~~~~~~~~~~ In file included from D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\OV7670.h:2, from D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\OV7670.cpp:1: D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:87:15: error: variable or field 'IRAM_ATTR' declared void 87 | static void IRAM_ATTR i2sInterrupt(void* arg); | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:87:15: error: expected ';' at end of member declaration 87 | static void IRAM_ATTR i2sInterrupt(void* arg); | ^~~~~~~~~ | ; D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:87:25: error: ISO C++ forbids declaration of 'i2sInterrupt' with no type [-fpermissive] 87 | static void IRAM_ATTR i2sInterrupt(void* arg); | ^~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:88:15: error: variable or field 'IRAM_ATTR' declared void 88 | static void IRAM_ATTR vSyncInterrupt(void* arg); | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:88:15: error: expected ';' at end of member declaration 88 | static void IRAM_ATTR vSyncInterrupt(void* arg); | ^~~~~~~~~ | ; D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:88:25: error: ISO C++ forbids declaration of 'vSyncInterrupt' with no type [-fpermissive] 88 | static void IRAM_ATTR vSyncInterrupt(void* arg); | ^~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h: In static member function 'static void I2SCamera::i2sConfReset()': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:42: error: 'I2S_IN_RST_M' was not declared in this scope; did you mean 'I2S_RX_RESET_M'? 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~ | I2S_RX_RESET_M D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:57: error: 'I2S_AHBM_RST_M' was not declared in this scope 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:74: error: 'I2S_AHBM_FIFO_RST_M' was not declared in this scope; did you mean 'I2S_RX_FIFO_RESET_M'? 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~~~~~~~~ | I2S_RX_FIFO_RESET_M D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:52:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'lc_conf'; did you mean 'rx_conf'? 52 | I2S0.lc_conf.val |= lc_conf_reset_flags; | ^~~~~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:53:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'lc_conf'; did you mean 'rx_conf'? 53 | I2S0.lc_conf.val &= ~lc_conf_reset_flags; | ^~~~~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:56:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 56 | I2S0.conf.val |= conf_reset_flags; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:57:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 57 | I2S0.conf.val &= ~conf_reset_flags; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:58:23: error: 'volatile union i2s_dev_s::<unnamed>' has no member named 'rx_fifo_reset_back' 58 | while (I2S0.state.rx_fifo_reset_back); | ^~~~~~~~~~~~~~~~~~ In file included from D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:2: D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:87:15: error: variable or field 'IRAM_ATTR' declared void 87 | static void IRAM_ATTR i2sInterrupt(void* arg); | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:87:15: error: expected ';' at end of member declaration 87 | static void IRAM_ATTR i2sInterrupt(void* arg); | ^~~~~~~~~ | ; D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:87:25: error: ISO C++ forbids declaration of 'i2sInterrupt' with no type [-fpermissive] 87 | static void IRAM_ATTR i2sInterrupt(void* arg); | ^~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:88:15: error: variable or field 'IRAM_ATTR' declared void 88 | static void IRAM_ATTR vSyncInterrupt(void* arg); | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:88:15: error: expected ';' at end of member declaration 88 | static void IRAM_ATTR vSyncInterrupt(void* arg); | ^~~~~~~~~ | ; D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:88:25: error: ISO C++ forbids declaration of 'vSyncInterrupt' with no type [-fpermissive] 88 | static void IRAM_ATTR vSyncInterrupt(void* arg); | ^~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h: In static member function 'static void I2SCamera::i2sConfReset()': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:42: error: 'I2S_IN_RST_M' was not declared in this scope; did you mean 'I2S_RX_RESET_M'? 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~ | I2S_RX_RESET_M D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:57: error: 'I2S_AHBM_RST_M' was not declared in this scope 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:74: error: 'I2S_AHBM_FIFO_RST_M' was not declared in this scope; did you mean 'I2S_RX_FIFO_RESET_M'? 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~~~~~~~~ | I2S_RX_FIFO_RESET_M D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:52:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'lc_conf'; did you mean 'rx_conf'? 52 | I2S0.lc_conf.val |= lc_conf_reset_flags; | ^~~~~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:53:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'lc_conf'; did you mean 'rx_conf'? 53 | I2S0.lc_conf.val &= ~lc_conf_reset_flags; | ^~~~~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:56:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 56 | I2S0.conf.val |= conf_reset_flags; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:57:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 57 | I2S0.conf.val &= ~conf_reset_flags; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:58:23: error: 'volatile union i2s_dev_s::<unnamed>' has no member named 'rx_fifo_reset_back' 58 | while (I2S0.state.rx_fifo_reset_back); | ^~~~~~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp: At global scope: D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:20:16: error: no declaration matches 'void I2SCamera::i2sInterrupt(void*)' 20 | void IRAM_ATTR I2SCamera::i2sInterrupt(void* arg) | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:87:25: note: candidate is: 'int I2SCamera::i2sInterrupt(void*)' 87 | static void IRAM_ATTR i2sInterrupt(void* arg); | ^~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:15:7: note: 'class I2SCamera' defined here 15 | class I2SCamera | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:46:16: error: no declaration matches 'void I2SCamera::vSyncInterrupt(void*)' 46 | void IRAM_ATTR I2SCamera::vSyncInterrupt(void* arg) | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:88:25: note: candidate is: 'int I2SCamera::vSyncInterrupt(void*)' 88 | static void IRAM_ATTR vSyncInterrupt(void* arg); | ^~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:15:7: note: 'class I2SCamera' defined here 15 | class I2SCamera | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp: In static member function 'static void I2SCamera::i2sStop()': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:61:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 61 | I2S0.conf.rx_start = 0; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp: In static member function 'static void I2SCamera::i2sRun()': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:77:49: error: no match for 'operator=' (operand types are 'volatile i2s_dev_s::<unnamed union>' and 'int') 77 | I2S0.rx_eof_num = dmaBuffer[0]->sampleCount(); | ^ In file included from D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:7: C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-858a988d-v1\esp32s3/include/soc/esp32s3/register/soc/i2s_struct.h:306:11: note: candidate: 'constexpr i2s_dev_s::<unnamed union>& i2s_dev_s::<unnamed union>::operator=(const i2s_dev_s::<unnamed union>&)' 306 | union { | ^ C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-858a988d-v1\esp32s3/include/soc/esp32s3/register/soc/i2s_struct.h:306:11: note: no known conversion for argument 1 from 'int' to 'const i2s_dev_s::<unnamed union>&' C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-858a988d-v1\esp32s3/include/soc/esp32s3/register/soc/i2s_struct.h:306:11: note: candidate: 'constexpr i2s_dev_s::<unnamed union>& i2s_dev_s::<unnamed union>::operator=(i2s_dev_s::<unnamed union>&&)' C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-858a988d-v1\esp32s3/include/soc/esp32s3/register/soc/i2s_struct.h:306:11: note: no known conversion for argument 1 from 'int' to 'i2s_dev_s::<unnamed union>&&' D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:78:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'in_link' 78 | I2S0.in_link.addr = (uint32_t)&(dmaBuffer[0]->descriptor); | ^~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:79:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'in_link' 79 | I2S0.in_link.start = 1; | ^~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:82:18: error: 'volatile union i2s_dev_s::<unnamed>' has no member named 'in_done' 82 | I2S0.int_ena.in_done = 1; | ^~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:85:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 85 | I2S0.conf.rx_start = 1; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp: In static member function 'static bool I2SCamera::initVSync(int)': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:94:25: error: ISO C++ forbids taking the address of a bound member function to form a pointer to member function. Say '&I2SCamera::vSyncInterrupt' [-fpermissive] 94 | if(gpio_isr_register(&vSyncInterrupt, (void*)"vSyncInterrupt", ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_IRAM, &vSyncInterruptHandle) != ESP_OK) | ^~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:94:24: error: cannot convert 'int (I2SCamera::*)(void*)' to 'void (*)(void*)' 94 | if(gpio_isr_register(&vSyncInterrupt, (void*)"vSyncInterrupt", ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_IRAM, &vSyncInterruptHandle) != ESP_OK) | ^~~~~~~~~~~~~~~ | | | int (I2SCamera::*)(void*) In file included from D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:9: C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-858a988d-v1\esp32s3/include/esp_driver_gpio/include/driver/gpio.h:251:36: note: initializing argument 1 of 'esp_err_t gpio_isr_register(void (*)(void*), void*, int, intr_handle_data_t**)' 251 | esp_err_t gpio_isr_register(void (*fn)(void *), void *arg, int intr_alloc_flags, gpio_isr_handle_t *handle); | ~~~~~~~^~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp: In static member function 'static bool I2SCamera::i2sInit(int, int, int, int, int, int, int, int, int, int, int)': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:141:27: error: 'I2S0I_DATA_IN0_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 141 | gpio_matrix_in(D0, I2S0I_DATA_IN0_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:141:5: error: 'gpio_matrix_in' was not declared in this scope 141 | gpio_matrix_in(D0, I2S0I_DATA_IN0_IDX, false); | ^~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:142:27: error: 'I2S0I_DATA_IN1_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 142 | gpio_matrix_in(D1, I2S0I_DATA_IN1_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:143:27: error: 'I2S0I_DATA_IN2_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 143 | gpio_matrix_in(D2, I2S0I_DATA_IN2_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:144:27: error: 'I2S0I_DATA_IN3_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 144 | gpio_matrix_in(D3, I2S0I_DATA_IN3_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:145:27: error: 'I2S0I_DATA_IN4_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 145 | gpio_matrix_in(D4, I2S0I_DATA_IN4_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:146:27: error: 'I2S0I_DATA_IN5_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 146 | gpio_matrix_in(D5, I2S0I_DATA_IN5_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:147:27: error: 'I2S0I_DATA_IN6_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 147 | gpio_matrix_in(D6, I2S0I_DATA_IN6_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:148:27: error: 'I2S0I_DATA_IN7_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 148 | gpio_matrix_in(D7, I2S0I_DATA_IN7_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:149:27: error: 'I2S0I_DATA_IN8_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 149 | gpio_matrix_in(0x30, I2S0I_DATA_IN8_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:150:27: error: 'I2S0I_DATA_IN9_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 150 | gpio_matrix_in(0x30, I2S0I_DATA_IN9_IDX, false); | ^~~~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:151:27: error: 'I2S0I_DATA_IN10_IDX' was not declared in this scope; did you mean 'CAM_DATA_IN10_IDX'? 151 | gpio_matrix_in(0x30, I2S0I_DATA_IN10_IDX, false); | ^~~~~~~~~~~~~~~~~~~ | CAM_DATA_IN10_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:152:27: error: 'I2S0I_DATA_IN11_IDX' was not declared in this scope; did you mean 'CAM_DATA_IN11_IDX'? 152 | gpio_matrix_in(0x30, I2S0I_DATA_IN11_IDX, false); | ^~~~~~~~~~~~~~~~~~~ | CAM_DATA_IN11_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:153:27: error: 'I2S0I_DATA_IN12_IDX' was not declared in this scope; did you mean 'CAM_DATA_IN12_IDX'? 153 | gpio_matrix_in(0x30, I2S0I_DATA_IN12_IDX, false); | ^~~~~~~~~~~~~~~~~~~ | CAM_DATA_IN12_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:154:27: error: 'I2S0I_DATA_IN13_IDX' was not declared in this scope; did you mean 'CAM_DATA_IN13_IDX'? 154 | gpio_matrix_in(0x30, I2S0I_DATA_IN13_IDX, false); | ^~~~~~~~~~~~~~~~~~~ | CAM_DATA_IN13_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:155:27: error: 'I2S0I_DATA_IN14_IDX' was not declared in this scope; did you mean 'CAM_DATA_IN14_IDX'? 155 | gpio_matrix_in(0x30, I2S0I_DATA_IN14_IDX, false); | ^~~~~~~~~~~~~~~~~~~ | CAM_DATA_IN14_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:156:27: error: 'I2S0I_DATA_IN15_IDX' was not declared in this scope; did you mean 'CAM_DATA_IN15_IDX'? 156 | gpio_matrix_in(0x30, I2S0I_DATA_IN15_IDX, false); | ^~~~~~~~~~~~~~~~~~~ | CAM_DATA_IN15_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:158:27: error: 'I2S0I_V_SYNC_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 158 | gpio_matrix_in(VSYNC, I2S0I_V_SYNC_IDX, true); | ^~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:159:27: error: 'I2S0I_H_SYNC_IDX' was not declared in this scope; did you mean 'I2S0I_WS_IN_IDX'? 159 | gpio_matrix_in(0x38, I2S0I_H_SYNC_IDX, false); //0x30 sends 0, 0x38 sends 1 | ^~~~~~~~~~~~~~~~ | I2S0I_WS_IN_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:160:27: error: 'I2S0I_H_ENABLE_IDX' was not declared in this scope; did you mean 'LCD_H_ENABLE_IDX'? 160 | gpio_matrix_in(HREF, I2S0I_H_ENABLE_IDX, false); | ^~~~~~~~~~~~~~~~~~ | LCD_H_ENABLE_IDX D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:170:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 170 | I2S0.conf.rx_slave_mod = 1; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:172:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf2' 172 | I2S0.conf2.lcd_en = 1; | ^~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:174:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf2' 174 | I2S0.conf2.camera_en = 1; | ^~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:176:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'clkm_conf'; did you mean 'rx_clkm_conf'? 176 | I2S0.clkm_conf.clkm_div_a = 1; | ^~~~~~~~~ | rx_clkm_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:177:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'clkm_conf'; did you mean 'rx_clkm_conf'? 177 | I2S0.clkm_conf.clkm_div_b = 0; | ^~~~~~~~~ | rx_clkm_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:178:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'clkm_conf'; did you mean 'rx_clkm_conf'? 178 | I2S0.clkm_conf.clkm_div_num = 2; | ^~~~~~~~~ | rx_clkm_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:180:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'fifo_conf' 180 | I2S0.fifo_conf.dscr_en = 1; | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:183:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'fifo_conf' 183 | I2S0.fifo_conf.rx_fifo_mod = SM_0A0B_0C0D; //pack two bytes in one dword see :https://github.com/igrr/esp32-cam-demo/issues/29 | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:184:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'fifo_conf' 184 | I2S0.fifo_conf.rx_fifo_mod_force_en = 1; | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:185:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf_chan' 185 | I2S0.conf_chan.rx_chan_mod = 1; | ^~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:187:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'sample_rate_conf' 187 | I2S0.sample_rate_conf.rx_bits_mod = 0; | ^~~~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:188:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 188 | I2S0.conf.rx_right_first = 0; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:189:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 189 | I2S0.conf.rx_msb_right = 0; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:190:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 190 | I2S0.conf.rx_msb_shift = 0; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:191:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 191 | I2S0.conf.rx_mono = 0; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:192:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 192 | I2S0.conf.rx_short_sync = 0; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:193:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'timing'; did you mean 'rx_timing'? 193 | I2S0.timing.val = 0; | ^~~~~~ | rx_timing D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:196:115: error: ISO C++ forbids taking the address of a bound member function to form a pointer to member function. Say '&I2SCamera::i2sInterrupt' [-fpermissive] 196 | esp_intr_alloc(ETS_I2S0_INTR_SOURCE, ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_LEVEL1 | ESP_INTR_FLAG_IRAM, &i2sInterrupt, NULL, &i2sInterruptHandle); | ^~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.cpp:196:114: error: cannot convert 'int (I2SCamera::*)(void*)' to 'intr_handler_t' {aka 'void (*)(void*)'} 196 | esp_intr_alloc(ETS_I2S0_INTR_SOURCE, ESP_INTR_FLAG_INTRDISABLED | ESP_INTR_FLAG_LEVEL1 | ESP_INTR_FLAG_IRAM, &i2sInterrupt, NULL, &i2sInterruptHandle); | ^~~~~~~~~~~~~ | | | int (I2SCamera::*)(void*) In file included from C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-858a988d-v1\esp32s3/include/esp_driver_gpio/include/driver/gpio.h:13: C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\tools\esp32-arduino-libs\idf-release_v5.4-858a988d-v1\esp32s3/include/esp_hw_support/include/esp_intr_alloc.h:148:64: note: initializing argument 3 of 'esp_err_t esp_intr_alloc(int, int, intr_handler_t, void*, intr_handle_data_t**)' 148 | esp_err_t esp_intr_alloc(int source, int flags, intr_handler_t handler, void *arg, intr_handle_t *ret_handle); | ~~~~~~~~~~~~~~~^~~~~~~ In file included from D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\OV7670.h:2, from D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\OV7670_ESP32S.ino:1: D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h: In static member function 'static void I2SCamera::i2sConfReset()': D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:42: error: 'I2S_IN_RST_M' was not declared in this scope; did you mean 'I2S_RX_RESET_M'? 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~ | I2S_RX_RESET_M D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:57: error: 'I2S_AHBM_RST_M' was not declared in this scope 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~~~ D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:51:74: error: 'I2S_AHBM_FIFO_RST_M' was not declared in this scope; did you mean 'I2S_TX_FIFO_RESET_M'? 51 | const uint32_t lc_conf_reset_flags = I2S_IN_RST_M | I2S_AHBM_RST_M | I2S_AHBM_FIFO_RST_M; | ^~~~~~~~~~~~~~~~~~~ | I2S_TX_FIFO_RESET_M D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:52:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'lc_conf'; did you mean 'rx_conf'? 52 | I2S0.lc_conf.val |= lc_conf_reset_flags; | ^~~~~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:53:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'lc_conf'; did you mean 'rx_conf'? 53 | I2S0.lc_conf.val &= ~lc_conf_reset_flags; | ^~~~~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:56:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 56 | I2S0.conf.val |= conf_reset_flags; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:57:10: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'? 57 | I2S0.conf.val &= ~conf_reset_flags; | ^~~~ | rx_conf D:\LIULANQI\OV7670_ESP32S-main\OV7670_ESP32S-main\OV7670_ESP32S\I2SCamera.h:58:23: error: 'volatile union i2s_dev_s::<unnamed>' has no member named 'rx_fifo_reset_back' 58 | while (I2S0.state.rx_fifo_reset_back); | ^~~~~~~~~~~~~~~~~~ Using library WiFi at version 3.2.1 in folder: C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.1\libraries\WiFi Using library Networking at version 3.2.1 in folder: C:\Users\h9978\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.2.1\libraries\Network exit status 1 Compilation error: 'PERIPH_LEDC_MODULE' was not declared in this scope分析错误

最新推荐

recommend-type

PLC控制变频器:三菱与汇川PLC通过485通讯板实现变频器正反转及调速控制

内容概要:本文介绍了如何利用三菱和汇川PLC通过485通讯板实现变频器的正转、反转及调速控制。主要内容涵盖硬件配置、软件编程、具体控制逻辑及上机测试。文中详细描述了各个步骤的操作方法和注意事项,包括关键寄存器的设置及其含义。程序中有详细的中文注释,便于理解和维护。最终通过上机测试验证系统的稳定性和可靠性。 适合人群:从事工业自动化领域的工程师和技术人员,尤其是熟悉PLC编程和变频器控制的专业人士。 使用场景及目标:适用于需要对电机进行精确控制的工业应用场景,如生产线、机械设备等。目标是提高控制系统灵活性和效率,确保系统稳定可靠。 其他说明:本文不仅提供理论指导,还附带实际操作经验,有助于读者更好地掌握相关技术和应用。
recommend-type

Python桌面版数独(五版)-优化选择模式触发新棋盘生成

Python桌面版数独(五版)-优化选择模式触发新棋盘生成
recommend-type

jmeter 下载使用5.6.3

jmeter 下载使用5.6.3
recommend-type

数据工程ETL工程师全解析:从数据抽取到加载的技术要点与职业发展路径

内容概要:文章详细介绍了ETL工程师这一职业,解释了ETL(Extract-Transform-Load)的概念及其在数据处理中的重要性。ETL工程师负责将分散、不统一的数据整合为有价值的信息,支持企业的决策分析。日常工作包括数据整合、存储管理、挖掘设计支持和多维分析展现。文中强调了ETL工程师所需的核心技能,如数据库知识、ETL工具使用、编程能力、业务理解能力和问题解决能力。此外,还盘点了常见的ETL工具,包括开源工具如Kettle、XXL-JOB、Oozie、Azkaban和海豚调度,以及企业级工具如TASKCTL和Moia Comtrol。最后,文章探讨了ETL工程师的职业发展路径,从初级到高级的技术晋升,以及向大数据工程师或数据产品经理的横向发展,并提供了学习资源和求职技巧。 适合人群:对数据处理感兴趣,尤其是希望从事数据工程领域的人士,如数据分析师、数据科学家、软件工程师等。 使用场景及目标:①了解ETL工程师的职责和技能要求;②选择适合自己的ETL工具;③规划ETL工程师的职业发展路径;④获取相关的学习资源和求职建议。 其他说明:随着大数据技术的发展和企业数字化转型的加速,ETL工程师的需求不断增加,尤其是在金融、零售、制造、人工智能、物联网和区块链等领域。数据隐私保护法规的完善也使得ETL工程师在数据安全和合规处理方面的作用更加重要。
recommend-type

基于51单片机的嵌入式系统开发_DS18B20温度传感器_LCD1602显示_I2C通信_24C02存储_Proteus仿真_Keil开发_温度监测与智能调控系统_包含温度上下限设.zip

基于51单片机的嵌入式系统开发_DS18B20温度传感器_LCD1602显示_I2C通信_24C02存储_Proteus仿真_Keil开发_温度监测与智能调控系统_包含温度上下限设.zip
recommend-type

Web前端开发:CSS与HTML设计模式深入解析

《Pro CSS and HTML Design Patterns》是一本专注于Web前端设计模式的书籍,特别针对CSS(层叠样式表)和HTML(超文本标记语言)的高级应用进行了深入探讨。这本书籍属于Pro系列,旨在为专业Web开发人员提供实用的设计模式和实践指南,帮助他们构建高效、美观且可维护的网站和应用程序。 在介绍这本书的知识点之前,我们首先需要了解CSS和HTML的基础知识,以及它们在Web开发中的重要性。 HTML是用于创建网页和Web应用程序的标准标记语言。它允许开发者通过一系列的标签来定义网页的结构和内容,如段落、标题、链接、图片等。HTML5作为最新版本,不仅增强了网页的表现力,还引入了更多新的特性,例如视频和音频的内置支持、绘图API、离线存储等。 CSS是用于描述HTML文档的表现(即布局、颜色、字体等样式)的样式表语言。它能够让开发者将内容的表现从结构中分离出来,使得网页设计更加模块化和易于维护。随着Web技术的发展,CSS也经历了多个版本的更新,引入了如Flexbox、Grid布局、过渡、动画以及Sass和Less等预处理器技术。 现在让我们来详细探讨《Pro CSS and HTML Design Patterns》中可能包含的知识点: 1. CSS基础和选择器: 书中可能会涵盖CSS基本概念,如盒模型、边距、填充、边框、背景和定位等。同时还会介绍CSS选择器的高级用法,例如属性选择器、伪类选择器、伪元素选择器以及选择器的组合使用。 2. CSS布局技术: 布局是网页设计中的核心部分。本书可能会详细讲解各种CSS布局技术,包括传统的浮动(Floats)布局、定位(Positioning)布局,以及最新的布局模式如Flexbox和CSS Grid。此外,也会介绍响应式设计的媒体查询、视口(Viewport)单位等。 3. 高级CSS技巧: 这些技巧可能包括动画和过渡效果,以及如何优化性能和兼容性。例如,CSS3动画、关键帧动画、转换(Transforms)、滤镜(Filters)和混合模式(Blend Modes)。 4. HTML5特性: 书中可能会深入探讨HTML5的新标签和语义化元素,如`<article>`、`<section>`、`<nav>`等,以及如何使用它们来构建更加标准化和语义化的页面结构。还会涉及到Web表单的新特性,比如表单验证、新的输入类型等。 5. 可访问性(Accessibility): Web可访问性越来越受到重视。本书可能会介绍如何通过HTML和CSS来提升网站的无障碍访问性,比如使用ARIA标签(Accessible Rich Internet Applications)来增强屏幕阅读器的使用体验。 6. 前端性能优化: 性能优化是任何Web项目成功的关键。本书可能会涵盖如何通过优化CSS和HTML来提升网站的加载速度和运行效率。内容可能包括代码压缩、合并、避免重绘和回流、使用Web字体的最佳实践等。 7. JavaScript与CSS/HTML的交互: 在现代Web开发中,JavaScript与CSS及HTML的交云并用是不可或缺的。书中可能会讲解如何通过JavaScript动态地修改样式、操作DOM元素以及使用事件监听和响应用户交互。 8. Web框架和预处理器: 这本书可能会提到流行的Web开发框架和预处理器,比如Bootstrap、Foundation、Sass和Less等,它们是如何简化和加速开发流程的。 9. 测试和维护: 书中也可能包含关于如何测试网页以及如何持续优化和维护CSS和HTML代码的章节。例如,使用断言测试、自动化测试、性能分析工具等。 最后,鉴于文件名称列表中的“压缩包子文件”的表述,这可能是对“压缩包”文件的一种误译或误用,此处“压缩包”应该指的是包含该书籍PDF文件的压缩文件格式,如ZIP或RAR。而“Pro CSS and HTML Design Patterns.pdf”指的就是该书籍的PDF格式电子版文件。 以上所述,构成了《Pro CSS and HTML Design Patterns》一书可能包含的核心知识点。通过学习这些内容,Web前端开发者可以掌握更为高效和优雅的设计模式,从而在日常工作中更高效地解决实际问题。
recommend-type

Zotero 7数据同步:Attanger插件安装&设置,打造文献管理利器

/i.s3.glbimg.com/v1/AUTH_08fbf48bc0524877943fe86e43087e7a/internal_photos/bs/2018/L/j/ipKA8TRPyt4ptaG1DGww/t-m-01.png) # 1. Zotero 7数据同步简介 在数字时代,管理研究数据变得日益重要,而Zot
recommend-type

卷积神经网络的基础理论200字

<think>我们正在回答用户关于卷积神经网络(CNN)基础理论的询问。根据提供的引用资料,我们可以概述CNN的基本结构和工作原理。引用[1]提到CNN是一种前馈神经网络,信息从输入单向流动到输出。引用[2]指出CNN在图像处理等领域应用广泛,通过层次结构和参数调整实现模式识别。引用[3]说明CNN包含卷积层,使用卷积核提取局部特征,减少参数量,提高效率。引用[4]则提到了训练过程,包括前向传播、误差计算和反向传播(梯度下降)。因此,我们将从以下几个方面概述CNN:1.CNN的基本结构(卷积层、池化层、全连接层)2.卷积操作的工作原理(局部感受野、权重共享)3.训练过程(前向传播、损失函数、反
recommend-type

轻便实用的Java库类查询工具介绍

标题 "java2库类查询" 和描述表明,所提及的工具是一个专门用于查询Java库类的应用程序。此软件旨在帮助开发者快速地查找和引用Java的标准开发工具包(SDK)中包含的所有应用程序编程接口(API)类。通过这样的工具,开发者可以节省大量在官方文档或搜索引擎上寻找类定义和使用方法的时间。它被描述为轻巧且方便,这表明其占用的系统资源相对较少,同时提供直观的用户界面,使得查询过程简洁高效。 从描述中可以得出几个关键知识点: 1. Java SDK:Java的软件开发工具包(SDK)是Java平台的一部分,提供了一套用于开发Java应用软件的软件包和库。这些软件包通常被称为API,为开发者提供了编程界面,使他们能够使用Java语言编写各种类型的应用程序。 2. 库类查询:这个功能对于开发者来说非常关键,因为它提供了一个快速查找特定库类及其相关方法、属性和使用示例的途径。良好的库类查询工具可以帮助开发者提高工作效率,减少因查找文档而中断编程思路的时间。 3. 轻巧性:软件的轻巧性通常意味着它对计算机资源的要求较低。这样的特性对于资源受限的系统尤为重要,比如老旧的计算机、嵌入式设备或是当开发者希望最小化其开发环境占用空间时。 4. 方便性:软件的方便性通常关联于其用户界面设计,一个直观、易用的界面可以让用户快速上手,并减少在使用过程中遇到的障碍。 5. 包含所有API:一个优秀的Java库类查询软件应当能够覆盖Java所有标准API,这包括Java.lang、Java.util、Java.io等核心包,以及Java SE平台的所有其他标准扩展包。 从标签 "java 库 查询 类" 可知,这个软件紧密关联于Java编程语言的核心功能——库类的管理和查询。这些标签可以关联到以下知识点: - Java:一种广泛用于企业级应用、移动应用(如Android应用)、网站后端、大型系统和许多其他平台的编程语言。 - 库:在Java中,库是一组预打包的类和接口,它们可以被应用程序重复使用。Java提供了庞大的标准库,以支持各种常见的任务和功能。 - 查询:查询指的是利用软件工具搜索、定位和检索信息的过程。对于Java库类查询工具来说,这意味着可以通过类名、方法签名或其他标识符来查找特定的API条目。 最后,压缩包文件列表包含了两个文件:“java.dit”和“Java.exe”。其中“Java.exe”很可能是程序的可执行文件,而“java.dit”可能是一个数据文件,用于存储Java类的索引或数据。由于文件名后缀通常与文件类型相关联,但“dit”并不是一个常见的文件扩展名。这可能是一个特定于软件的自定义格式,或是一个打字错误。 总结来说,"java2库类查询" 是一个针对Java开发者的实用工具,它提供了一个轻量级、易用的平台来查询和定位Java标准库中的所有类和API。此工具对优化开发流程,减少查找Java类文档的时间大有裨益,尤其适合需要频繁查阅Java API的开发者使用。
recommend-type

【Zotero 7终极指南】:新手必备!Attanger插件全攻略与数据同步神技

# 1. Zotero 7与Attanger插件的介绍 在当今的学术研究和知识管理领域,高效的文献管理工具至关重要。Zotero 7作为一个流行的参考文献管理软件,因其强大的功能和用户友好的界面而受到专业人士的青睐。而Attanger插件则为Zotero 7带来了更多定制化和高级功能,极大地增强