1. 测试了wifi的驱动,连带着蓝牙一同测试,带着蓝牙则测试不通过,需要重写蓝牙驱动代码
2. 修改wifi与蓝牙的驱动代码,并且进行了测试,测试通过 3. 新增分区表,为板载16M的flash作分区规划,预留ota分区 4. 测试了SD卡的驱动,正常读出数据,测试通过 5. 新增了CMake配置,just_monitor(monitor_only.sh),只监视,无编译,无烧录
This commit is contained in:
@@ -43,3 +43,94 @@ void battery_test(void)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#include "Wireless.h"
|
||||
void wireless_test(void)
|
||||
{
|
||||
printf("Starting wireless scan test...\n");
|
||||
|
||||
// 初始化无线模块
|
||||
Wireless_Init();
|
||||
|
||||
// 等待扫描完成
|
||||
while (!Scan_finish) {
|
||||
printf("Waiting for scan to complete...\n");
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
}
|
||||
|
||||
// 打印所有WiFi AP信息
|
||||
wireless_print_wifi_aps();
|
||||
|
||||
// 打印所有BLE设备信息
|
||||
wireless_print_ble_devices();
|
||||
}
|
||||
|
||||
|
||||
#include "SD_MMC.h"
|
||||
void sd_card_module_test(void)
|
||||
{
|
||||
printf("\n=== 开始SD卡模块测试 ===\n\n");
|
||||
|
||||
// 1. 初始化SD卡
|
||||
printf("1. 初始化SD卡...\n");
|
||||
SD_Init();
|
||||
if(SDCard_Size > 0) {
|
||||
printf(" SD卡初始化成功,容量: %lu MB\n", SDCard_Size);
|
||||
} else {
|
||||
printf(" SD卡初始化失败!\n");
|
||||
return; // 如果SD卡初始化失败,终止测试
|
||||
}
|
||||
|
||||
// 2. 获取Flash大小
|
||||
printf("2. 获取Flash大小...\n");
|
||||
Flash_Searching();
|
||||
printf(" Flash大小: %lu MB\n", Flash_Size);
|
||||
|
||||
// 3. 测试文件写入
|
||||
printf("3. 测试文件写入...\n");
|
||||
char test_file_path[] = MOUNT_POINT"/test.txt";
|
||||
char test_data[] = "这是一段测试数据,用于验证SD卡写入功能。";
|
||||
esp_err_t write_result = s_example_write_file(test_file_path, test_data);
|
||||
if(write_result == ESP_OK) {
|
||||
printf(" 文件写入成功: %s\n", test_file_path);
|
||||
} else {
|
||||
printf(" 文件写入失败!\n");
|
||||
}
|
||||
|
||||
// 4. 测试文件读取
|
||||
printf("4. 测试文件读取...\n");
|
||||
esp_err_t read_result = s_example_read_file(test_file_path);
|
||||
if(read_result != ESP_OK) {
|
||||
printf(" 文件读取失败!\n");
|
||||
}
|
||||
|
||||
// 5. 测试文件打开功能
|
||||
printf("5. 测试文件打开功能...\n");
|
||||
FILE* test_file = Open_File(test_file_path);
|
||||
if(test_file != NULL) {
|
||||
printf(" 文件打开成功\n");
|
||||
fclose(test_file); // 记得关闭文件
|
||||
} else {
|
||||
printf(" 文件打开失败!\n");
|
||||
}
|
||||
|
||||
// 6. 测试文件夹检索功能
|
||||
printf("6. 测试文件夹检索功能...\n");
|
||||
char file_names[10][100]; // 存储最多10个文件名
|
||||
uint16_t file_count = Folder_retrieval(MOUNT_POINT, ".txt", file_names, 10);
|
||||
printf(" 找到 %d 个txt文件:\n", file_count);
|
||||
for(int i = 0; i < file_count; i++) {
|
||||
printf(" %d. %s\n", i+1, file_names[i]);
|
||||
}
|
||||
|
||||
// 7. 清理测试文件
|
||||
printf("7. 清理测试文件...\n");
|
||||
if(remove(test_file_path)) {
|
||||
printf(" 删除文件失败: %s\n", test_file_path);
|
||||
} else {
|
||||
printf(" 成功删除测试文件: %s\n", test_file_path);
|
||||
}
|
||||
|
||||
printf("\n=== SD卡模块测试完成 ===\n");
|
||||
}
|
||||
@@ -11,5 +11,11 @@ void imu_test(void);
|
||||
// 电池adc测试
|
||||
void battery_test(void);
|
||||
|
||||
// 无线测试
|
||||
void wireless_test(void);
|
||||
|
||||
// SD卡测试
|
||||
void sd_card_module_test(void);
|
||||
|
||||
|
||||
#endif //BIONIC_SPHERE_DRIVERS_TEST_H
|
||||
Reference in New Issue
Block a user