正在显示
29 个修改的文件
包含
640 行增加
和
189 行删除
| 1 | # 编译链的配置 | 1 | # 编译链的配置 |
| 2 | 2 | ||
| 3 | #1、编译链与设备类型的选择 | 3 | #1、编译链与设备类型的选择 |
| 4 | -set(DEVICE_NAME JZ_T40S) | 4 | +set(DEVICE_NAME JZ_H150A) |
| 5 | #上一行为禁止修改行 | 5 | #上一行为禁止修改行 |
| 6 | 6 | ||
| 7 | message("**************************JZSDK构建编译开始***************************\n") | 7 | message("**************************JZSDK构建编译开始***************************\n") |
| 1 | -#include <stdio.h> | 1 | +#include <stdio.h> |
| 2 | #include "./JZsdk_FileSystm.h" | 2 | #include "./JZsdk_FileSystm.h" |
| 3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
| 4 | #include <stdbool.h> | 4 | #include <stdbool.h> |
| @@ -396,7 +396,7 @@ T_JZsdkReturnCode JZsdk_create_file(const char* file_path) | @@ -396,7 +396,7 @@ T_JZsdkReturnCode JZsdk_create_file(const char* file_path) | ||
| 396 | if (file != NULL) | 396 | if (file != NULL) |
| 397 | { | 397 | { |
| 398 | fclose(file); | 398 | fclose(file); |
| 399 | - fsync(file); | 399 | + fsync(fileno(file)); |
| 400 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 400 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 401 | } | 401 | } |
| 402 | 402 |
| 1 | -#include <stdio.h> | 1 | +#include <stdio.h> |
| 2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | #include <string.h> // Include this for strncpy | 4 | #include <string.h> // Include this for strncpy |
| 5 | 5 | ||
| 6 | #include "./JZsdk_Task.h" | 6 | #include "./JZsdk_Task.h" |
| 7 | 7 | ||
| 8 | + | ||
| 8 | T_JZsdkReturnCode JZsdk_Osal_TaskCreate(const char *name, void *(*taskFunc)(void *), unsigned int stackSize, void *arg, | 9 | T_JZsdkReturnCode JZsdk_Osal_TaskCreate(const char *name, void *(*taskFunc)(void *), unsigned int stackSize, void *arg, |
| 9 | T_JZTaskHandle *task) | 10 | T_JZTaskHandle *task) |
| 10 | { | 11 | { |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -33,12 +33,15 @@ T_JZsdkReturnCode JZ_h10_init(int mode) | @@ -33,12 +33,15 @@ T_JZsdkReturnCode JZ_h10_init(int mode) | ||
| 33 | if (mode == APP_UART) | 33 | if (mode == APP_UART) |
| 34 | { | 34 | { |
| 35 | //串口设备1初始化 | 35 | //串口设备1初始化 |
| 36 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 37 | - .BitRate = UART_DEV1_BITRATE, | ||
| 38 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | 36 | + T_JZsdk_UartInfo UartInfo = { |
| 37 | + .Base.PortId = UART_DEV_1, | ||
| 38 | + .DevicePath = UART_DEV1_NUM, | ||
| 39 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 40 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 39 | }; | 41 | }; |
| 40 | - | ||
| 41 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 42 | + |
| 43 | + //串口设备1初始化 | ||
| 44 | + JZsdk_HalUartInit(&UartInfo); | ||
| 42 | } | 45 | } |
| 43 | 46 | ||
| 44 | if (mode == APP_PSDK) | 47 | if (mode == APP_PSDK) |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -39,12 +39,15 @@ T_JZsdkReturnCode JZ_h10t_init(int mode) | @@ -39,12 +39,15 @@ T_JZsdkReturnCode JZ_h10t_init(int mode) | ||
| 39 | if (mode == APP_UART) | 39 | if (mode == APP_UART) |
| 40 | { | 40 | { |
| 41 | //串口设备1初始化 | 41 | //串口设备1初始化 |
| 42 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 43 | - .BitRate = UART_DEV1_BITRATE, | ||
| 44 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | 42 | + T_JZsdk_UartInfo UartInfo = { |
| 43 | + .Base.PortId = UART_DEV_1, | ||
| 44 | + .DevicePath = UART_DEV1_NUM, | ||
| 45 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 46 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 45 | }; | 47 | }; |
| 46 | - | ||
| 47 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 48 | + |
| 49 | + //串口设备1初始化 | ||
| 50 | + JZsdk_HalUartInit(&UartInfo); | ||
| 48 | } | 51 | } |
| 49 | 52 | ||
| 50 | if (mode == APP_PSDK) | 53 | if (mode == APP_PSDK) |
| @@ -53,13 +56,14 @@ T_JZsdkReturnCode JZ_h10t_init(int mode) | @@ -53,13 +56,14 @@ T_JZsdkReturnCode JZ_h10t_init(int mode) | ||
| 53 | JZsdk_data_transmisson_Receive_Init(); | 56 | JZsdk_data_transmisson_Receive_Init(); |
| 54 | } | 57 | } |
| 55 | 58 | ||
| 56 | - //4g设备初始化 | ||
| 57 | - s_JZ_SerialPortHalRegInfo Serial_4G_Info = { | ||
| 58 | - .BitRate = COMM_4G_UART_BITRATE, | ||
| 59 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | 59 | + //4G初始化 |
| 60 | + T_JZsdk_UartInfo Uart4GInfo = { | ||
| 61 | + .Base.PortId = UART_4G, | ||
| 62 | + .DevicePath = COMM_4G_UART_NUM, | ||
| 63 | + .Baudrate = COMM_4G_UART_BITRATE, | ||
| 64 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 60 | }; | 65 | }; |
| 61 | - | ||
| 62 | - JZsdk_HalPort_Init(UART_4G, (void *)&Serial_4G_Info); | 66 | + JZsdk_HalUartInit(&Uart4GInfo); |
| 63 | 67 | ||
| 64 | //音频库初始化 | 68 | //音频库初始化 |
| 65 | AudioDeal_Init(); | 69 | AudioDeal_Init(); |
| @@ -74,12 +74,22 @@ T_JZsdkReturnCode JZ_H150A_init(int mode) | @@ -74,12 +74,22 @@ T_JZsdkReturnCode JZ_H150A_init(int mode) | ||
| 74 | if (mode == APP_UART) | 74 | if (mode == APP_UART) |
| 75 | { | 75 | { |
| 76 | //串口设备1初始化 | 76 | //串口设备1初始化 |
| 77 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 78 | - .BitRate = UART_DEV1_BITRATE, | ||
| 79 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 80 | - }; | 77 | + T_JZsdk_UartInfo UartInfo = { |
| 78 | + .Base.PortId = UART_DEV_1, | ||
| 79 | + .DevicePath = UART_DEV1_NUM, | ||
| 80 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 81 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 82 | + }; | ||
| 83 | + | ||
| 84 | + //去检查有没有额外输入串口号 | ||
| 85 | + const char* devicepath = JZsdk_ParamterParsing_GetUart1Device(); | ||
| 86 | + if (devicepath != NULL) | ||
| 87 | + { | ||
| 88 | + memcpy(UartInfo.DevicePath, devicepath, sizeof(UartInfo.DevicePath)); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + JZsdk_HalUartInit(&UartInfo); | ||
| 81 | 92 | ||
| 82 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | ||
| 83 | } | 93 | } |
| 84 | 94 | ||
| 85 | if (mode == APP_PSDK) | 95 | if (mode == APP_PSDK) |
| @@ -88,12 +98,14 @@ T_JZsdkReturnCode JZ_H150A_init(int mode) | @@ -88,12 +98,14 @@ T_JZsdkReturnCode JZ_H150A_init(int mode) | ||
| 88 | JZsdk_data_transmisson_Receive_Init(); | 98 | JZsdk_data_transmisson_Receive_Init(); |
| 89 | } | 99 | } |
| 90 | 100 | ||
| 91 | - //4G串口初始化 | ||
| 92 | - s_JZ_SerialPortHalRegInfo SerialInfo3 = { | ||
| 93 | - .BitRate = COMM_4G_UART_BITRATE, | ||
| 94 | - .ConnectType = PORT_CONNECT_TYPE_AS_MAIN, | 101 | + //4g设备初始化 |
| 102 | + T_JZsdk_UartInfo Uart4GInfo = { | ||
| 103 | + .Base.PortId = UART_4G, | ||
| 104 | + .DevicePath = COMM_4G_UART_NUM, | ||
| 105 | + .Baudrate = COMM_4G_UART_BITRATE, | ||
| 106 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 95 | }; | 107 | }; |
| 96 | - JZsdk_HalPort_Init(UART_4G, (void *)&SerialInfo3); | 108 | + JZsdk_HalUartInit(&Uart4GInfo); |
| 97 | 109 | ||
| 98 | //音频库初始化 | 110 | //音频库初始化 |
| 99 | AudioDeal_Init(); | 111 | AudioDeal_Init(); |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -82,13 +82,15 @@ T_JZsdkReturnCode JZ_h150s_h150t_init(int mode) | @@ -82,13 +82,15 @@ T_JZsdkReturnCode JZ_h150s_h150t_init(int mode) | ||
| 82 | 82 | ||
| 83 | if (mode == APP_UART) | 83 | if (mode == APP_UART) |
| 84 | { | 84 | { |
| 85 | - //串口设备1初始化 | ||
| 86 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 87 | - .BitRate = UART_DEV1_BITRATE, | ||
| 88 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | 85 | + T_JZsdk_UartInfo UartInfo = { |
| 86 | + .Base.PortId = UART_DEV_1, | ||
| 87 | + .DevicePath = UART_DEV1_NUM, | ||
| 88 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 89 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 89 | }; | 90 | }; |
| 90 | - | ||
| 91 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 91 | + |
| 92 | + //串口设备1初始化 | ||
| 93 | + JZsdk_HalUartInit(&UartInfo); | ||
| 92 | } | 94 | } |
| 93 | 95 | ||
| 94 | if (mode == APP_PSDK) | 96 | if (mode == APP_PSDK) |
| @@ -100,13 +102,14 @@ T_JZsdkReturnCode JZ_h150s_h150t_init(int mode) | @@ -100,13 +102,14 @@ T_JZsdkReturnCode JZ_h150s_h150t_init(int mode) | ||
| 100 | //h150t额外开启4g | 102 | //h150t额外开启4g |
| 101 | if (DEVICE_VERSION == JZ_H150T) | 103 | if (DEVICE_VERSION == JZ_H150T) |
| 102 | { | 104 | { |
| 103 | - //串口设备4g初始化 | ||
| 104 | - s_JZ_SerialPortHalRegInfo Serial_4G_Info = { | ||
| 105 | - .BitRate = COMM_4G_UART_BITRATE, | ||
| 106 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | 105 | + //4G初始化 |
| 106 | + T_JZsdk_UartInfo Uart4GInfo = { | ||
| 107 | + .Base.PortId = UART_4G, | ||
| 108 | + .DevicePath = COMM_4G_UART_NUM, | ||
| 109 | + .Baudrate = COMM_4G_UART_BITRATE, | ||
| 110 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 107 | }; | 111 | }; |
| 108 | - | ||
| 109 | - JZsdk_HalPort_Init(UART_4G, (void *)&Serial_4G_Info); | 112 | + JZsdk_HalUartInit(&Uart4GInfo); |
| 110 | } | 113 | } |
| 111 | 114 | ||
| 112 | if (mode == APP_UART) | 115 | if (mode == APP_UART) |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -47,12 +47,13 @@ T_JZsdkReturnCode JZ_h1e_init(int mode) | @@ -47,12 +47,13 @@ T_JZsdkReturnCode JZ_h1e_init(int mode) | ||
| 47 | if (mode == APP_UART) | 47 | if (mode == APP_UART) |
| 48 | { | 48 | { |
| 49 | //串口设备1初始化 | 49 | //串口设备1初始化 |
| 50 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 51 | - .BitRate = UART_DEV1_BITRATE, | ||
| 52 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | 50 | + T_JZsdk_UartInfo UartInfo = { |
| 51 | + .Base.PortId = UART_DEV_1, | ||
| 52 | + .DevicePath = UART_DEV1_NUM, | ||
| 53 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 54 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 53 | }; | 55 | }; |
| 54 | - | ||
| 55 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 56 | + JZsdk_HalUartInit(&UartInfo); |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | if (mode == APP_PSDK) | 59 | if (mode == APP_PSDK) |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -45,13 +45,16 @@ T_JZsdkReturnCode JZ_h1t_init(int mode) | @@ -45,13 +45,16 @@ T_JZsdkReturnCode JZ_h1t_init(int mode) | ||
| 45 | if (mode == APP_UART) | 45 | if (mode == APP_UART) |
| 46 | { | 46 | { |
| 47 | //串口设备1初始化 | 47 | //串口设备1初始化 |
| 48 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 49 | - .BitRate = UART_DEV1_BITRATE, | ||
| 50 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 51 | - }; | 48 | + T_JZsdk_UartInfo UartInfo = { |
| 49 | + .Base.PortId = UART_DEV_1, | ||
| 50 | + .DevicePath = UART_DEV1_NUM, | ||
| 51 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 52 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 53 | + }; | ||
| 54 | + JZsdk_HalUartInit(&UartInfo); | ||
| 52 | 55 | ||
| 53 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | ||
| 54 | } | 56 | } |
| 57 | + | ||
| 55 | 58 | ||
| 56 | if (mode == APP_PSDK) | 59 | if (mode == APP_PSDK) |
| 57 | { | 60 | { |
| @@ -60,11 +63,13 @@ T_JZsdkReturnCode JZ_h1t_init(int mode) | @@ -60,11 +63,13 @@ T_JZsdkReturnCode JZ_h1t_init(int mode) | ||
| 60 | } | 63 | } |
| 61 | 64 | ||
| 62 | //4g设备初始化 | 65 | //4g设备初始化 |
| 63 | - s_JZ_SerialPortHalRegInfo Serial_4G_Info = { | ||
| 64 | - .BitRate = COMM_4G_UART_BITRATE, | ||
| 65 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 66 | - }; | ||
| 67 | - JZsdk_HalPort_Init(UART_4G, (void *)&Serial_4G_Info); | 66 | + T_JZsdk_UartInfo Uart4GInfo = { |
| 67 | + .Base.PortId = UART_4G, | ||
| 68 | + .DevicePath = COMM_4G_UART_NUM, | ||
| 69 | + .Baudrate = COMM_4G_UART_BITRATE, | ||
| 70 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 71 | + }; | ||
| 72 | + JZsdk_HalUartInit(&Uart4GInfo); | ||
| 68 | 73 | ||
| 69 | //音频库初始化 | 74 | //音频库初始化 |
| 70 | AudioDeal_Init(); | 75 | AudioDeal_Init(); |
| @@ -19,6 +19,8 @@ | @@ -19,6 +19,8 @@ | ||
| 19 | #include "UI_control/Psdk_ui_value_menu.h" | 19 | #include "UI_control/Psdk_ui_value_menu.h" |
| 20 | #include "UI_control/UI_control.h" | 20 | #include "UI_control/UI_control.h" |
| 21 | 21 | ||
| 22 | +#include "../../ParamterParsing.h" | ||
| 23 | + | ||
| 22 | static int LeftDeviceId = 0; //t40专用分别左右id,用于判断是不是强激光 | 24 | static int LeftDeviceId = 0; //t40专用分别左右id,用于判断是不是强激光 |
| 23 | static int RightDeviceId = 0; | 25 | static int RightDeviceId = 0; |
| 24 | static int DeviceType = 0; //两边装的设备类型 | 26 | static int DeviceType = 0; //两边装的设备类型 |
| @@ -341,7 +343,6 @@ void *JZ_T40_CheckLightTemperatureTask(void *arg) | @@ -341,7 +343,6 @@ void *JZ_T40_CheckLightTemperatureTask(void *arg) | ||
| 341 | HalSend_type1Send_CheckStatus_SearchLight_Temperture(UART_DEV_2, 0x21); | 343 | HalSend_type1Send_CheckStatus_SearchLight_Temperture(UART_DEV_2, 0x21); |
| 342 | } | 344 | } |
| 343 | 345 | ||
| 344 | - | ||
| 345 | delayMs(10); | 346 | delayMs(10); |
| 346 | 347 | ||
| 347 | //检查右灯温度 | 348 | //检查右灯温度 |
| @@ -763,12 +764,16 @@ T_JZsdkReturnCode JZ_T40_init_DT(int mode) | @@ -763,12 +764,16 @@ T_JZsdkReturnCode JZ_T40_init_DT(int mode) | ||
| 763 | //子设备连接 | 764 | //子设备连接 |
| 764 | JZ_T40_SubDevice_Init(); | 765 | JZ_T40_SubDevice_Init(); |
| 765 | 766 | ||
| 767 | +#if DEVICE_VERSION == JZ_T40S | ||
| 768 | + | ||
| 766 | //音频库初始化 | 769 | //音频库初始化 |
| 767 | AudioDeal_Init(); | 770 | AudioDeal_Init(); |
| 768 | 771 | ||
| 769 | //喊话器初始化 | 772 | //喊话器初始化 |
| 770 | Megaphone_Init(); | 773 | Megaphone_Init(); |
| 771 | 774 | ||
| 775 | +#endif | ||
| 776 | + | ||
| 772 | //云台初始化 | 777 | //云台初始化 |
| 773 | Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); | 778 | Gimbal_Init(JZ_MODULE_CONTROL_WAY_INDEPENDENT); |
| 774 | 779 |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -44,13 +44,15 @@ T_JZsdkReturnCode JZ_u3_init(int mode) | @@ -44,13 +44,15 @@ T_JZsdkReturnCode JZ_u3_init(int mode) | ||
| 44 | 44 | ||
| 45 | if (mode == APP_UART) | 45 | if (mode == APP_UART) |
| 46 | { | 46 | { |
| 47 | - //串口设备1初始化 | ||
| 48 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 49 | - .BitRate = UART_DEV1_BITRATE, | ||
| 50 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 51 | - }; | 47 | + T_JZsdk_UartInfo UartInfo = { |
| 48 | + .Base.PortId = UART_DEV_1, | ||
| 49 | + .DevicePath = UART_DEV1_NUM, | ||
| 50 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 51 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 52 | + }; | ||
| 52 | 53 | ||
| 53 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 54 | + //串口设备1初始化 |
| 55 | + JZsdk_HalUartInit(&UartInfo); | ||
| 54 | } | 56 | } |
| 55 | 57 | ||
| 56 | if (mode == APP_PSDK) | 58 | if (mode == APP_PSDK) |
| @@ -60,12 +62,14 @@ T_JZsdkReturnCode JZ_u3_init(int mode) | @@ -60,12 +62,14 @@ T_JZsdkReturnCode JZ_u3_init(int mode) | ||
| 60 | } | 62 | } |
| 61 | 63 | ||
| 62 | //串口设备2初始化 | 64 | //串口设备2初始化 |
| 63 | - s_JZ_SerialPortHalRegInfo SerialInfo2 = { | ||
| 64 | - .BitRate = UART_DEV2_BITRATE, | ||
| 65 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 66 | - }; | 65 | + T_JZsdk_UartInfo Uart2Info = { |
| 66 | + .Base.PortId = UART_DEV_2, | ||
| 67 | + .DevicePath = UART_DEV2_NUM, | ||
| 68 | + .Baudrate = UART_DEV2_BITRATE, | ||
| 69 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 70 | + }; | ||
| 71 | + JZsdk_HalUartInit(&Uart2Info); | ||
| 67 | 72 | ||
| 68 | - JZsdk_HalPort_Init(UART_DEV_2, (void *)&SerialInfo2); | ||
| 69 | 73 | ||
| 70 | //音频库初始化 | 74 | //音频库初始化 |
| 71 | AudioDeal_Init(); | 75 | AudioDeal_Init(); |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -31,16 +31,17 @@ T_JZsdkReturnCode JZ_u30_init(int mode) | @@ -31,16 +31,17 @@ T_JZsdkReturnCode JZ_u30_init(int mode) | ||
| 31 | 31 | ||
| 32 | if (mode == APP_UART) | 32 | if (mode == APP_UART) |
| 33 | { | 33 | { |
| 34 | - //串口设备1初始化 | ||
| 35 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 36 | - .BitRate = UART_DEV1_BITRATE, | ||
| 37 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 38 | - }; | 34 | + T_JZsdk_UartInfo UartInfo = { |
| 35 | + .Base.PortId = UART_DEV_1, | ||
| 36 | + .DevicePath = UART_DEV1_NUM, | ||
| 37 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 38 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 39 | + }; | ||
| 39 | 40 | ||
| 40 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 41 | + //串口设备1初始化 |
| 42 | + JZsdk_HalUartInit(&UartInfo); | ||
| 41 | } | 43 | } |
| 42 | 44 | ||
| 43 | - | ||
| 44 | if (mode == APP_PSDK) | 45 | if (mode == APP_PSDK) |
| 45 | { | 46 | { |
| 46 | //外接传输模块,用于与飞机的数据通信 | 47 | //外接传输模块,用于与飞机的数据通信 |
| @@ -48,12 +49,13 @@ T_JZsdkReturnCode JZ_u30_init(int mode) | @@ -48,12 +49,13 @@ T_JZsdkReturnCode JZ_u30_init(int mode) | ||
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | //串口设备2初始化 | 51 | //串口设备2初始化 |
| 51 | - s_JZ_SerialPortHalRegInfo SerialInfo2 = { | ||
| 52 | - .BitRate = UART_DEV2_BITRATE, | ||
| 53 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 54 | - }; | ||
| 55 | - | ||
| 56 | - JZsdk_HalPort_Init(UART_DEV_2, (void *)&SerialInfo2); | 52 | + T_JZsdk_UartInfo Uart2Info = { |
| 53 | + .Base.PortId = UART_DEV_2, | ||
| 54 | + .DevicePath = UART_DEV2_NUM, | ||
| 55 | + .Baudrate = UART_DEV2_BITRATE, | ||
| 56 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 57 | + }; | ||
| 58 | + JZsdk_HalUartInit(&Uart2Info); | ||
| 57 | 59 | ||
| 58 | //音频库初始化 | 60 | //音频库初始化 |
| 59 | AudioDeal_Init(); | 61 | AudioDeal_Init(); |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -30,13 +30,15 @@ T_JZsdkReturnCode JZ_u3d_init(int mode) | @@ -30,13 +30,15 @@ T_JZsdkReturnCode JZ_u3d_init(int mode) | ||
| 30 | 30 | ||
| 31 | if (mode == APP_UART) | 31 | if (mode == APP_UART) |
| 32 | { | 32 | { |
| 33 | - //串口设备1初始化 | ||
| 34 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 35 | - .BitRate = UART_DEV1_BITRATE, | ||
| 36 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 37 | - }; | 33 | + T_JZsdk_UartInfo UartInfo = { |
| 34 | + .Base.PortId = UART_DEV_1, | ||
| 35 | + .DevicePath = UART_DEV1_NUM, | ||
| 36 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 37 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 38 | + }; | ||
| 38 | 39 | ||
| 39 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 40 | + //串口设备1初始化 |
| 41 | + JZsdk_HalUartInit(&UartInfo); | ||
| 40 | } | 42 | } |
| 41 | 43 | ||
| 42 | if (mode == APP_PSDK) | 44 | if (mode == APP_PSDK) |
| @@ -46,12 +48,13 @@ T_JZsdkReturnCode JZ_u3d_init(int mode) | @@ -46,12 +48,13 @@ T_JZsdkReturnCode JZ_u3d_init(int mode) | ||
| 46 | } | 48 | } |
| 47 | 49 | ||
| 48 | //串口设备2初始化 | 50 | //串口设备2初始化 |
| 49 | - s_JZ_SerialPortHalRegInfo SerialInfo2 = { | ||
| 50 | - .BitRate = UART_DEV2_BITRATE, | ||
| 51 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 52 | - }; | ||
| 53 | - | ||
| 54 | - JZsdk_HalPort_Init(UART_DEV_2, (void *)&SerialInfo2); | 51 | + T_JZsdk_UartInfo Uart2Info = { |
| 52 | + .Base.PortId = UART_DEV_2, | ||
| 53 | + .DevicePath = UART_DEV2_NUM, | ||
| 54 | + .Baudrate = UART_DEV2_BITRATE, | ||
| 55 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 56 | + }; | ||
| 57 | + JZsdk_HalUartInit(&Uart2Info); | ||
| 55 | 58 | ||
| 56 | //音频库初始化 | 59 | //音频库初始化 |
| 57 | AudioDeal_Init(); | 60 | AudioDeal_Init(); |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -62,13 +62,15 @@ T_JZsdkReturnCode JZ_u3s_init(int mode) | @@ -62,13 +62,15 @@ T_JZsdkReturnCode JZ_u3s_init(int mode) | ||
| 62 | 62 | ||
| 63 | if (mode == APP_UART) | 63 | if (mode == APP_UART) |
| 64 | { | 64 | { |
| 65 | - //串口设备1初始化 | ||
| 66 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 67 | - .BitRate = UART_DEV1_BITRATE, | ||
| 68 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 69 | - }; | 65 | + T_JZsdk_UartInfo UartInfo = { |
| 66 | + .Base.PortId = UART_DEV_1, | ||
| 67 | + .DevicePath = UART_DEV1_NUM, | ||
| 68 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 69 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 70 | + }; | ||
| 70 | 71 | ||
| 71 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 72 | + //串口设备1初始化 |
| 73 | + JZsdk_HalUartInit(&UartInfo); | ||
| 72 | } | 74 | } |
| 73 | 75 | ||
| 74 | if (mode == APP_PSDK) | 76 | if (mode == APP_PSDK) |
| @@ -78,12 +80,13 @@ T_JZsdkReturnCode JZ_u3s_init(int mode) | @@ -78,12 +80,13 @@ T_JZsdkReturnCode JZ_u3s_init(int mode) | ||
| 78 | } | 80 | } |
| 79 | 81 | ||
| 80 | //串口设备2初始化 | 82 | //串口设备2初始化 |
| 81 | - s_JZ_SerialPortHalRegInfo SerialInfo2 = { | ||
| 82 | - .BitRate = UART_DEV2_BITRATE, | ||
| 83 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 84 | - }; | ||
| 85 | - | ||
| 86 | - JZsdk_HalPort_Init(UART_DEV_2, (void *)&SerialInfo2); | 83 | + T_JZsdk_UartInfo Uart2Info = { |
| 84 | + .Base.PortId = UART_DEV_2, | ||
| 85 | + .DevicePath = UART_DEV2_NUM, | ||
| 86 | + .Baudrate = UART_DEV2_BITRATE, | ||
| 87 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 88 | + }; | ||
| 89 | + JZsdk_HalUartInit(&Uart2Info); | ||
| 87 | 90 | ||
| 88 | //音频库初始化 | 91 | //音频库初始化 |
| 89 | AudioDeal_Init(); | 92 | AudioDeal_Init(); |
| 1 | -#include "JZsdkLib.h" | 1 | +#include "JZsdkLib.h" |
| 2 | #include "BaseConfig.h" | 2 | #include "BaseConfig.h" |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | 4 | ||
| @@ -29,16 +29,17 @@ T_JZsdkReturnCode TF_a1_init(int mode) | @@ -29,16 +29,17 @@ T_JZsdkReturnCode TF_a1_init(int mode) | ||
| 29 | 29 | ||
| 30 | Ircut_Init(ircut_info); | 30 | Ircut_Init(ircut_info); |
| 31 | 31 | ||
| 32 | - //hal层初始化 | ||
| 33 | if (mode == APP_UART) | 32 | if (mode == APP_UART) |
| 34 | { | 33 | { |
| 35 | - //串口设备1初始化 | ||
| 36 | - s_JZ_SerialPortHalRegInfo SerialInfo = { | ||
| 37 | - .BitRate = UART_DEV1_BITRATE, | ||
| 38 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 39 | - }; | 34 | + T_JZsdk_UartInfo UartInfo = { |
| 35 | + .Base.PortId = UART_DEV_1, | ||
| 36 | + .DevicePath = UART_DEV1_NUM, | ||
| 37 | + .Baudrate = UART_DEV1_BITRATE, | ||
| 38 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 39 | + }; | ||
| 40 | 40 | ||
| 41 | - JZsdk_HalPort_Init(UART_DEV_1, (void *)&SerialInfo); | 41 | + //串口设备1初始化 |
| 42 | + JZsdk_HalUartInit(&UartInfo); | ||
| 42 | } | 43 | } |
| 43 | 44 | ||
| 44 | if (mode == APP_PSDK) | 45 | if (mode == APP_PSDK) |
| @@ -46,14 +47,15 @@ T_JZsdkReturnCode TF_a1_init(int mode) | @@ -46,14 +47,15 @@ T_JZsdkReturnCode TF_a1_init(int mode) | ||
| 46 | //外接传输模块,用于与飞机的数据通信 | 47 | //外接传输模块,用于与飞机的数据通信 |
| 47 | JZsdk_data_transmisson_Receive_Init(); | 48 | JZsdk_data_transmisson_Receive_Init(); |
| 48 | } | 49 | } |
| 49 | - | ||
| 50 | - //串口设备2初始化 | ||
| 51 | - s_JZ_SerialPortHalRegInfo SerialInfo2 = { | ||
| 52 | - .BitRate = UART_DEV2_BITRATE, | ||
| 53 | - .ConnectType = PORT_CONNECT_TYPE_AS_SUB | ||
| 54 | - }; | ||
| 55 | 50 | ||
| 56 | - JZsdk_HalPort_Init(UART_DEV_2, (void *)&SerialInfo2); | 51 | + //串口设备2初始化 |
| 52 | + T_JZsdk_UartInfo Uart2Info = { | ||
| 53 | + .Base.PortId = UART_DEV_2, | ||
| 54 | + .DevicePath = UART_DEV2_NUM, | ||
| 55 | + .Baudrate = UART_DEV2_BITRATE, | ||
| 56 | + .Base.HalStatus.ConnectType = PORT_CONNECT_TYPE_AS_SUB, | ||
| 57 | + }; | ||
| 58 | + JZsdk_HalUartInit(&Uart2Info); | ||
| 57 | 59 | ||
| 58 | //音频库初始化 | 60 | //音频库初始化 |
| 59 | AudioDeal_Init(); | 61 | AudioDeal_Init(); |
| 1 | -#include <stdio.h> | 1 | +#include <stdio.h> |
| 2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
| 3 | #include <string.h> | 3 | #include <string.h> |
| 4 | #include <unistd.h> | 4 | #include <unistd.h> |
| @@ -36,6 +36,7 @@ typedef enum parameter{ | @@ -36,6 +36,7 @@ typedef enum parameter{ | ||
| 36 | PARAMETER_OUT_TIMEFLAG = 0x1010, //备用超时标志位 | 36 | PARAMETER_OUT_TIMEFLAG = 0x1010, //备用超时标志位 |
| 37 | PARAMETER_OUT_TIMEOUT = 0x1011, //备用超时时间 | 37 | PARAMETER_OUT_TIMEOUT = 0x1011, //备用超时时间 |
| 38 | PARAMETER_PLAY_PROMPT_TTS = 0x1012, //播放提示音 | 38 | PARAMETER_PLAY_PROMPT_TTS = 0x1012, //播放提示音 |
| 39 | + PARAMETER_UART1 = 0x1013, //修改串口1 | ||
| 39 | }parameter; | 40 | }parameter; |
| 40 | 41 | ||
| 41 | static const struct option storage_opts[] = { | 42 | static const struct option storage_opts[] = { |
| @@ -43,6 +44,7 @@ static const struct option storage_opts[] = { | @@ -43,6 +44,7 @@ static const struct option storage_opts[] = { | ||
| 43 | { "OutTime", required_argument, 0, PARAMETER_OUT_TIMEOUT }, //超时时间 | 44 | { "OutTime", required_argument, 0, PARAMETER_OUT_TIMEOUT }, //超时时间 |
| 44 | 45 | ||
| 45 | { "play_prompt_tts", required_argument, NULL, PARAMETER_PLAY_PROMPT_TTS }, //提示选项 | 46 | { "play_prompt_tts", required_argument, NULL, PARAMETER_PLAY_PROMPT_TTS }, //提示选项 |
| 47 | + { "uart1", required_argument, NULL, PARAMETER_UART1 }, //连接的串口1 | ||
| 46 | { 0, 0, 0, 0 } | 48 | { 0, 0, 0, 0 } |
| 47 | }; | 49 | }; |
| 48 | 50 | ||
| @@ -50,6 +52,7 @@ static const struct option storage_opts[] = { | @@ -50,6 +52,7 @@ static const struct option storage_opts[] = { | ||
| 50 | static int Timeout_flag = JZ_FLAGCODE_OFF; //超时标记位,默认关闭 | 52 | static int Timeout_flag = JZ_FLAGCODE_OFF; //超时标记位,默认关闭 |
| 51 | static int Timeout_time = 60; //超时时间 | 53 | static int Timeout_time = 60; //超时时间 |
| 52 | unsigned char *g_JZsdkParam_PlayPromptTTS = NULL; //播放提示音 | 54 | unsigned char *g_JZsdkParam_PlayPromptTTS = NULL; //播放提示音 |
| 55 | +static char* g_extern_uart1_device = NULL; //额外输入的串口1 | ||
| 53 | 56 | ||
| 54 | int JZsdk_ParamterParsing_GetTimeOutFlag() | 57 | int JZsdk_ParamterParsing_GetTimeOutFlag() |
| 55 | { | 58 | { |
| @@ -61,6 +64,12 @@ int JZsdk_ParamterParsing_GetTimeOutTime() | @@ -61,6 +64,12 @@ int JZsdk_ParamterParsing_GetTimeOutTime() | ||
| 61 | return Timeout_time; | 64 | return Timeout_time; |
| 62 | } | 65 | } |
| 63 | 66 | ||
| 67 | +// getter 函数 | ||
| 68 | +const char* JZsdk_ParamterParsing_GetUart1Device(void) | ||
| 69 | +{ | ||
| 70 | + return g_extern_uart1_device; | ||
| 71 | +} | ||
| 72 | + | ||
| 64 | /************************************* | 73 | /************************************* |
| 65 | * | 74 | * |
| 66 | * * 程序参数解析 | 75 | * * 程序参数解析 |
| @@ -105,6 +114,12 @@ T_JZsdkReturnCode JZsdk_ParamterParsing(int argc, char *argv[], unsigned int *mo | @@ -105,6 +114,12 @@ T_JZsdkReturnCode JZsdk_ParamterParsing(int argc, char *argv[], unsigned int *mo | ||
| 105 | *mode = 1; | 114 | *mode = 1; |
| 106 | break; | 115 | break; |
| 107 | 116 | ||
| 117 | + //uart1选项 | ||
| 118 | + case PARAMETER_UART1: | ||
| 119 | + printf("uart1 device: %s\n", optarg); | ||
| 120 | + g_extern_uart1_device = optarg; | ||
| 121 | + break; | ||
| 122 | + | ||
| 108 | case 'f': //超时标记位 | 123 | case 'f': //超时标记位 |
| 109 | Timeout_flag = atoi(optarg); | 124 | Timeout_flag = atoi(optarg); |
| 110 | break; | 125 | break; |
| 1 | -/** | 1 | +/** |
| 2 | ******************************************************************** | 2 | ******************************************************************** |
| 3 | * @file ParamterParsing.h | 3 | * @file ParamterParsing.h |
| 4 | * 用于文件系统操作 | 4 | * 用于文件系统操作 |
| @@ -27,6 +27,7 @@ extern "C" { | @@ -27,6 +27,7 @@ extern "C" { | ||
| 27 | T_JZsdkReturnCode JZsdk_ParamterParsing(int argc, char *argv[], unsigned int *mode); | 27 | T_JZsdkReturnCode JZsdk_ParamterParsing(int argc, char *argv[], unsigned int *mode); |
| 28 | int JZsdk_ParamterParsing_GetTimeOutFlag(); | 28 | int JZsdk_ParamterParsing_GetTimeOutFlag(); |
| 29 | int JZsdk_ParamterParsing_GetTimeOutTime(); | 29 | int JZsdk_ParamterParsing_GetTimeOutTime(); |
| 30 | +const char* JZsdk_ParamterParsing_GetUart1Device(void); | ||
| 30 | 31 | ||
| 31 | #ifdef __cplusplus | 32 | #ifdef __cplusplus |
| 32 | } | 33 | } |
JZsdk_Config/sediCNI4X
已删除
100644 → 0
| 1 | -/* ******************************************************************** | ||
| 2 | -* | ||
| 3 | -* 用于确认对应设备的选择 | ||
| 4 | -* | ||
| 5 | -***********************************************/ | ||
| 6 | -#ifndef VERSION_CHOOSE_H | ||
| 7 | -#define VERSION_CHOOSE_H | ||
| 8 | -#include "JZsdk_Base/JZsdk_Code/JZsdk_DeviceCode.h" | ||
| 9 | -//1~10行 除了D可以修改版本选择 禁止动任何东西 | ||
| 10 | -#define DEVICE_VERSION JZ_T40 | ||
| 11 | - | ||
| 12 | -//禁止修改行 选择是串口程序 还是 psdk程序 | ||
| 13 | -#define APP_VERSION APP_PSDK | ||
| 14 | - | ||
| 15 | -//禁止修改行 板子型号 | ||
| 16 | -#define PLATFORM_VERSION PLATFORM_V3S | ||
| 17 | - | ||
| 18 | -//禁止修改行 串口连接程序的软件版本号 | ||
| 19 | -#define MAJOR_VERSION_TEN_POSITION 0 | ||
| 20 | -#define MAJOR_VERSION_ONE_POSITION 0 |
| @@ -7,28 +7,28 @@ | @@ -7,28 +7,28 @@ | ||
| 7 | #define VERSION_CHOOSE_H | 7 | #define VERSION_CHOOSE_H |
| 8 | #include "JZsdk_Base/JZsdk_Code/JZsdk_DeviceCode.h" | 8 | #include "JZsdk_Base/JZsdk_Code/JZsdk_DeviceCode.h" |
| 9 | //1~10行 除了D可以修改版本选择 禁止动任何东西 | 9 | //1~10行 除了D可以修改版本选择 禁止动任何东西 |
| 10 | -#define DEVICE_VERSION JZ_T40S | 10 | +#define DEVICE_VERSION JZ_H150A |
| 11 | 11 | ||
| 12 | //禁止修改行 选择是串口程序 还是 psdk程序 | 12 | //禁止修改行 选择是串口程序 还是 psdk程序 |
| 13 | -#define APP_VERSION APP_UART | 13 | +#define APP_VERSION APP_PSDK |
| 14 | 14 | ||
| 15 | //禁止修改行 板子型号 | 15 | //禁止修改行 板子型号 |
| 16 | #define PLATFORM_VERSION PLATFORM_V3S | 16 | #define PLATFORM_VERSION PLATFORM_V3S |
| 17 | 17 | ||
| 18 | //禁止修改行 串口连接程序的软件版本号 | 18 | //禁止修改行 串口连接程序的软件版本号 |
| 19 | #define MAJOR_VERSION_TEN_POSITION 0 | 19 | #define MAJOR_VERSION_TEN_POSITION 0 |
| 20 | -#define MAJOR_VERSION_ONE_POSITION 0 | 20 | +#define MAJOR_VERSION_ONE_POSITION 1 |
| 21 | #define MINOR_VERSION_TEN_POSITION 0 | 21 | #define MINOR_VERSION_TEN_POSITION 0 |
| 22 | -#define MINOR_VERSION_ONE_POSITION 0 | ||
| 23 | -#define MODIFY_VERSION_TEN_POSITION 0 | ||
| 24 | -#define MODIFY_VERSION_ONE_POSITION 2 | ||
| 25 | -#define DEBUG_VERSION_TEN_POSITION 2 | ||
| 26 | -#define DEBUG_VERSION_ONE_POSITION 8 | 22 | +#define MINOR_VERSION_ONE_POSITION 3 |
| 23 | +#define MODIFY_VERSION_TEN_POSITION 1 | ||
| 24 | +#define MODIFY_VERSION_ONE_POSITION 5 | ||
| 25 | +#define DEBUG_VERSION_TEN_POSITION 0 | ||
| 26 | +#define DEBUG_VERSION_ONE_POSITION 2 | ||
| 27 | 27 | ||
| 28 | #define FIRMWARE_ORIGIN DOMESTIC_VERSION | 28 | #define FIRMWARE_ORIGIN DOMESTIC_VERSION |
| 29 | 29 | ||
| 30 | //禁止修改行31 特殊版本号 | 30 | //禁止修改行31 特殊版本号 |
| 31 | -#define SPECIAL_VERSION SPECIAL_DAOTONG | 31 | +#define SPECIAL_VERSION SPECIAL_NORMAL |
| 32 | 32 | ||
| 33 | //版本号 | 33 | //版本号 |
| 34 | #define MAJOR_VERSION (MAJOR_VERSION_TEN_POSITION*10+MAJOR_VERSION_ONE_POSITION) | 34 | #define MAJOR_VERSION (MAJOR_VERSION_TEN_POSITION*10+MAJOR_VERSION_ONE_POSITION) |
| @@ -88,6 +88,9 @@ static T_JZsdkReturnCode RecvDeal_AskForConnect(int Port, char *getbuf) | @@ -88,6 +88,9 @@ static T_JZsdkReturnCode RecvDeal_AskForConnect(int Port, char *getbuf) | ||
| 88 | if (Port == UART_DEV_1) | 88 | if (Port == UART_DEV_1) |
| 89 | { | 89 | { |
| 90 | Main_WorkModeSet(JZ_FLAGCODE_ON); | 90 | Main_WorkModeSet(JZ_FLAGCODE_ON); |
| 91 | + | ||
| 92 | + //设置 | ||
| 93 | + JZsdk_Hal_config_use_uart1(3); | ||
| 91 | } | 94 | } |
| 92 | 95 | ||
| 93 | //5、打开连接状态 | 96 | //5、打开连接状态 |
JZsdk_hal/JZsdk_Config.c
0 → 100644
| 1 | +#include "JZsdkLib.h" | ||
| 2 | +#include <string.h> // 确保包含头文件 | ||
| 3 | + | ||
| 4 | +#include "./JZsdk_Hal.h" | ||
| 5 | +#include "BaseConfig.h" | ||
| 6 | + | ||
| 7 | +#define JZSDK_HAL_CONFIG_FILE "/root/sdcard/config.ini" | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 读取INI配置文件中的指定键值对 | ||
| 11 | + * @param config_file 配置文件路径 | ||
| 12 | + * @param section 配置段名称 | ||
| 13 | + * @param key 键名称 | ||
| 14 | + * @return 成功返回动态分配的字符串(需调用者 free),失败返回 NULL | ||
| 15 | + */ | ||
| 16 | +char* JZsdk_HalConfig_Read(const char* config_file, const char* section, const char* key) { | ||
| 17 | + FILE* fp = fopen(config_file, "r"); | ||
| 18 | + if (!fp) return NULL; | ||
| 19 | + | ||
| 20 | + char line[1024]; | ||
| 21 | + char section_buf[256]; | ||
| 22 | + int in_target_section = 0; | ||
| 23 | + char* result = NULL; | ||
| 24 | + | ||
| 25 | + while (fgets(line, sizeof(line), fp)) { | ||
| 26 | + // 去除行尾换行符 | ||
| 27 | + size_t len = strlen(line); | ||
| 28 | + while (len > 0 && (line[len - 1] == '\n' || line[len - 1] == '\r')) { | ||
| 29 | + line[--len] = '\0'; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + if (line[0] == '[') { | ||
| 33 | + if (sscanf(line, "[%[^]]]", section_buf) == 1) { | ||
| 34 | + // 去除空格 | ||
| 35 | + char* start = section_buf; | ||
| 36 | + char* end = section_buf + strlen(section_buf) - 1; | ||
| 37 | + while (start <= end && (*start == ' ' || *start == '\t')) start++; | ||
| 38 | + while (end >= start && (*end == ' ' || *end == '\t')) end--; | ||
| 39 | + if (start <= end) { | ||
| 40 | + *(end + 1) = '\0'; | ||
| 41 | + in_target_section = (strcmp(start, section) == 0); | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + continue; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + if (in_target_section) { | ||
| 48 | + char current_key[256], current_value[256]; | ||
| 49 | + if (sscanf(line, "%[^=]=%[^\n]", current_key, current_value) == 2) { | ||
| 50 | + // 去除key两端空格 | ||
| 51 | + char* k_start = current_key; | ||
| 52 | + char* k_end = current_key + strlen(current_key) - 1; | ||
| 53 | + while (k_start <= k_end && (*k_start == ' ' || *k_start == '\t')) k_start++; | ||
| 54 | + while (k_end >= k_start && (*k_end == ' ' || *k_end == '\t')) k_end--; | ||
| 55 | + if (k_start <= k_end) { | ||
| 56 | + *(k_end + 1) = '\0'; | ||
| 57 | + if (strcmp(k_start, key) == 0) { | ||
| 58 | + // 去除value两端空格和行尾注释 | ||
| 59 | + char* v_start = current_value; | ||
| 60 | + char* v_end = current_value + strlen(current_value) - 1; | ||
| 61 | + while (v_start <= v_end && (*v_start == ' ' || *v_start == '\t')) v_start++; | ||
| 62 | + while (v_end >= v_start) { | ||
| 63 | + if (*v_end == ' ' || *v_end == '\t' || *v_end == '#') { | ||
| 64 | + v_end--; | ||
| 65 | + } | ||
| 66 | + else { | ||
| 67 | + break; | ||
| 68 | + } | ||
| 69 | + } | ||
| 70 | + if (v_start <= v_end) { | ||
| 71 | + size_t val_len = v_end - v_start + 1; | ||
| 72 | + result = (char*)malloc(val_len + 1); | ||
| 73 | + if (result) { | ||
| 74 | + strncpy(result, v_start, val_len); | ||
| 75 | + result[val_len] = '\0'; | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + break; | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + fclose(fp); | ||
| 85 | + return result; | ||
| 86 | +} | ||
| 87 | + | ||
| 88 | +/** | ||
| 89 | + * 修改INI配置文件中的指定键值对 | ||
| 90 | + * @param config_file 配置文件路径 | ||
| 91 | + * @param section 配置段名称(如 "APP_RUN_TYPE") | ||
| 92 | + * @param key 键名称(如 "appmode") | ||
| 93 | + * @param new_value 新的值(字符串形式) | ||
| 94 | + * @return 0成功,-1失败 | ||
| 95 | + */ | ||
| 96 | +T_JZsdkReturnCode JZsdk_HalConfig_Write(const char* config_file, const char* section, | ||
| 97 | + const char* key, const char* new_value) | ||
| 98 | +{ | ||
| 99 | + FILE* fp, * fp_temp; | ||
| 100 | + char temp_file[512]; | ||
| 101 | + char line[1024]; | ||
| 102 | + char section_buf[256]; | ||
| 103 | + int in_target_section = 0; | ||
| 104 | + int key_found = 0; | ||
| 105 | + int ret = 0; | ||
| 106 | + | ||
| 107 | + // 参数检查 | ||
| 108 | + if (!config_file || !section || !key || !new_value) { | ||
| 109 | + printf("错误:参数不能为空\n"); | ||
| 110 | + return -1; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + // 检查原文件是否存在 | ||
| 114 | + fp = fopen(config_file, "r"); | ||
| 115 | + if (!fp) { | ||
| 116 | + JZSDK_LOG_ERROR("错误:无法打开配置文件 %s\n", config_file); | ||
| 117 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + // 创建临时文件 | ||
| 121 | + snprintf(temp_file, sizeof(temp_file), "%s.tmp", config_file); | ||
| 122 | + fp_temp = fopen(temp_file, "w"); | ||
| 123 | + if (!fp_temp) { | ||
| 124 | + JZSDK_LOG_ERROR("错误:无法创建临时文件\n"); | ||
| 125 | + fclose(fp); | ||
| 126 | + return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + // 逐行读取原文件并处理 | ||
| 130 | + while (fgets(line, sizeof(line), fp)) { | ||
| 131 | + // 去除行尾的换行符(保留用于写入) | ||
| 132 | + size_t len = strlen(line); | ||
| 133 | + if (len > 0 && (line[len - 1] == '\n' || line[len - 1] == '\r')) { | ||
| 134 | + line[len - 1] = '\0'; | ||
| 135 | + len--; | ||
| 136 | + } | ||
| 137 | + if (len > 0 && line[len - 1] == '\r') { | ||
| 138 | + line[len - 1] = '\0'; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + // 检查是否是section行 | ||
| 142 | + if (line[0] == '[') { | ||
| 143 | + // 解析section名称 | ||
| 144 | + if (sscanf(line, "[%[^]]]", section_buf) == 1) { | ||
| 145 | + // 去除section名称两端的空格 | ||
| 146 | + char* start = section_buf; | ||
| 147 | + char* end = section_buf + strlen(section_buf) - 1; | ||
| 148 | + while (start <= end && (*start == ' ' || *start == '\t')) start++; | ||
| 149 | + while (end >= start && (*end == ' ' || *end == '\t')) end--; | ||
| 150 | + if (start <= end) { | ||
| 151 | + *(end + 1) = '\0'; | ||
| 152 | + // 判断是否是目标section | ||
| 153 | + if (strcmp(start, section) == 0) { | ||
| 154 | + in_target_section = 1; | ||
| 155 | + printf("进入目标段: [%s]\n", section); | ||
| 156 | + } | ||
| 157 | + else { | ||
| 158 | + in_target_section = 0; | ||
| 159 | + } | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + // 写入原section行 | ||
| 163 | + fprintf(fp_temp, "%s\n", line); | ||
| 164 | + continue; | ||
| 165 | + } | ||
| 166 | + | ||
| 167 | + // 如果在目标section内,查找key | ||
| 168 | + if (in_target_section && !key_found) { | ||
| 169 | + char current_key[256]; | ||
| 170 | + char current_value[256]; | ||
| 171 | + | ||
| 172 | + // 尝试解析key=value格式 | ||
| 173 | + if (sscanf(line, "%[^=]=%[^\n]", current_key, current_value) == 2) { | ||
| 174 | + // 去除key两端的空格 | ||
| 175 | + char* key_start = current_key; | ||
| 176 | + char* key_end = current_key + strlen(current_key) - 1; | ||
| 177 | + while (key_start <= key_end && (*key_start == ' ' || *key_start == '\t')) key_start++; | ||
| 178 | + while (key_end >= key_start && (*key_end == ' ' || *key_end == '\t')) key_end--; | ||
| 179 | + if (key_start <= key_end) { | ||
| 180 | + *(key_end + 1) = '\0'; | ||
| 181 | + | ||
| 182 | + // 检查是否是目标key | ||
| 183 | + if (strcmp(key_start, key) == 0) { | ||
| 184 | + printf("找到目标键: %s,原值: %s,修改为新值: %s\n", | ||
| 185 | + key, current_value, new_value); | ||
| 186 | + | ||
| 187 | + // 保留原行的缩进和格式 | ||
| 188 | + // 找到等号的位置 | ||
| 189 | + char* eq_pos = strchr(line, '='); | ||
| 190 | + if (eq_pos) { | ||
| 191 | + // 计算等号前的部分(包括空格) | ||
| 192 | + int prefix_len = eq_pos - line + 1; | ||
| 193 | + // 写入key部分(保持原格式) | ||
| 194 | + fprintf(fp_temp, "%.*s%s\n", prefix_len, line, new_value); | ||
| 195 | + } | ||
| 196 | + else { | ||
| 197 | + // 如果找不到等号(不应该发生),简单写入 | ||
| 198 | + fprintf(fp_temp, "%s=%s\n", key, new_value); | ||
| 199 | + } | ||
| 200 | + key_found = 1; | ||
| 201 | + continue; | ||
| 202 | + } | ||
| 203 | + } | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + // 如果不是目标key,写入原行 | ||
| 208 | + fprintf(fp_temp, "%s\n", line); | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + // 如果在目标section内没有找到目标key,则在section末尾添加 | ||
| 212 | + if (in_target_section && !key_found) { | ||
| 213 | + printf("未找到键 %s,在段末添加: %s=%s\n", key, key, new_value); | ||
| 214 | + fprintf(fp_temp, "%s=%s\n", key, new_value); | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + // 关闭文件 | ||
| 218 | + fclose(fp); | ||
| 219 | + fclose(fp_temp); | ||
| 220 | + | ||
| 221 | + // 用临时文件替换原文件 | ||
| 222 | + if (remove(config_file) != 0) { | ||
| 223 | + printf("警告:无法删除原文件 %s\n", config_file); | ||
| 224 | + ret = -1; | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + if (rename(temp_file, config_file) != 0) { | ||
| 228 | + printf("错误:无法重命名临时文件为 %s\n", config_file); | ||
| 229 | + ret = -1; | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + if (ret == 0) { | ||
| 233 | + printf("成功修改配置文件: %s\n", config_file); | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + return ret; | ||
| 237 | +} | ||
| 238 | + | ||
| 239 | + | ||
| 240 | +T_JZsdkReturnCode JZsdk_Hal_config_use_uart1(int num) | ||
| 241 | +{ | ||
| 242 | +// const char* config_file = JZSDK_HAL_CONFIG_FILE; | ||
| 243 | +// const char* target_value = NULL; | ||
| 244 | +// char* current_value = NULL; | ||
| 245 | +// int need_write = 0; | ||
| 246 | +// | ||
| 247 | +// // 确定目标值 | ||
| 248 | +// if (num == 0) { | ||
| 249 | +// target_value = "0"; | ||
| 250 | +// } | ||
| 251 | +// else if (num == 1) { | ||
| 252 | +// target_value = "1"; | ||
| 253 | +// } | ||
| 254 | +// else if (num == 3) { | ||
| 255 | +//#if DEVICE_VERSION == JZ_H150A | ||
| 256 | +// T_JZsdkHalHandle* handle = JZsdk_Platform_GetHalHandle(); | ||
| 257 | +// if (handle != NULL) { | ||
| 258 | +// T_JZsdk_HalInfo HalInfo; | ||
| 259 | +// handle->GetHalInfo(&HalInfo); | ||
| 260 | +// for (int i = 0; i < HalInfo.UartNum; i++) { | ||
| 261 | +// if (strcmp(HalInfo.UartInfo[i].DevicePath, "/dev/ttyS2") == 0) { | ||
| 262 | +// target_value = "0"; | ||
| 263 | +// break; | ||
| 264 | +// } | ||
| 265 | +// else if (strcmp(HalInfo.UartInfo[i].DevicePath, "/dev/ttyGS0") == 0) { | ||
| 266 | +// target_value = "1"; | ||
| 267 | +// break; | ||
| 268 | +// } | ||
| 269 | +// } | ||
| 270 | +// } | ||
| 271 | +//#endif | ||
| 272 | +// if (!target_value) { | ||
| 273 | +// JZSDK_LOG_ERROR("无法确定目标设备类型"); | ||
| 274 | +// return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 275 | +// } | ||
| 276 | +// } | ||
| 277 | +// else { | ||
| 278 | +// return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; // 其他num不处理 | ||
| 279 | +// } | ||
| 280 | +// | ||
| 281 | +// // 读取当前配置值 | ||
| 282 | +// current_value = JZsdk_HalConfig_Read(config_file, "UART1", "device"); | ||
| 283 | +// if (current_value) { | ||
| 284 | +// if (strcmp(current_value, target_value) != 0) { | ||
| 285 | +// need_write = 1; | ||
| 286 | +// } | ||
| 287 | +// free(current_value); | ||
| 288 | +// } | ||
| 289 | +// else { | ||
| 290 | +// // 读取失败(如文件不存在或键不存在),需要写入 | ||
| 291 | +// need_write = 1; | ||
| 292 | +// } | ||
| 293 | +// | ||
| 294 | +// if (need_write) { | ||
| 295 | +// if (JZsdk_HalConfig_Write(config_file, "UART1", "device", target_value) == 0) { | ||
| 296 | +// JZSDK_LOG_INFO("成功修改device为 %s\n", target_value); | ||
| 297 | +// } | ||
| 298 | +// else { | ||
| 299 | +// JZSDK_LOG_ERROR("修改device失败"); | ||
| 300 | +// return JZ_ERROR_SYSTEM_MODULE_CODE_FAILURE; | ||
| 301 | +// } | ||
| 302 | +// } | ||
| 303 | +// else { | ||
| 304 | +// JZSDK_LOG_INFO("device已经是 %s,无需修改\n", target_value); | ||
| 305 | +// } | ||
| 306 | + | ||
| 307 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 308 | +} | ||
| 309 | + | ||
| 310 | +T_JZsdkReturnCode JZsdk_HalConfigInit() | ||
| 311 | +{ | ||
| 312 | + | ||
| 313 | + | ||
| 314 | + | ||
| 315 | + return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | ||
| 316 | +} | ||
| 317 | + | ||
| 318 | + |
| @@ -165,6 +165,8 @@ T_JZsdkReturnCode JZsdk_HalDirectDataInit(T_JZsdk_DirectDataInfo* pDirectDataInf | @@ -165,6 +165,8 @@ T_JZsdkReturnCode JZsdk_HalDirectDataInit(T_JZsdk_DirectDataInfo* pDirectDataInf | ||
| 165 | int JZsdk_HalPort_UseFlag(int PortName); | 165 | int JZsdk_HalPort_UseFlag(int PortName); |
| 166 | 166 | ||
| 167 | 167 | ||
| 168 | +T_JZsdkReturnCode JZsdk_Hal_config_use_uart1(int num); | ||
| 169 | + | ||
| 168 | #ifdef __cplusplus | 170 | #ifdef __cplusplus |
| 169 | } | 171 | } |
| 170 | #endif | 172 | #endif |
| 1 | -#include <stdio.h> | 1 | +#include <stdio.h> |
| 2 | #include <string.h> | 2 | #include <string.h> |
| 3 | #include <pthread.h> | 3 | #include <pthread.h> |
| 4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
| @@ -531,7 +531,7 @@ T_JZsdkReturnCode JZsdk_Uart_UartSend_NotTask(int Uart_Name, unsigned char *str, | @@ -531,7 +531,7 @@ T_JZsdkReturnCode JZsdk_Uart_UartSend_NotTask(int Uart_Name, unsigned char *str, | ||
| 531 | //printf("向串口1号设备发送\n"); | 531 | //printf("向串口1号设备发送\n"); |
| 532 | write(Uart_DEV1_fd, str, str_lenth); | 532 | write(Uart_DEV1_fd, str, str_lenth); |
| 533 | } | 533 | } |
| 534 | - else if (Uart_Name = UART_DEV_2) | 534 | + else if (Uart_Name == UART_DEV_2) |
| 535 | { | 535 | { |
| 536 | //printf("向串口2号设备发送\n"); | 536 | //printf("向串口2号设备发送\n"); |
| 537 | write(Uart_DEV2_fd, str, str_lenth); | 537 | write(Uart_DEV2_fd, str, str_lenth); |
| @@ -650,7 +650,7 @@ static T_JZsdkReturnCode JZsdk_Uart_CloseUartFd(int UartPort) | @@ -650,7 +650,7 @@ static T_JZsdkReturnCode JZsdk_Uart_CloseUartFd(int UartPort) | ||
| 650 | else if (UartPort == UART_DEV_2) | 650 | else if (UartPort == UART_DEV_2) |
| 651 | { | 651 | { |
| 652 | JZSDK_LOG_INFO("关闭串口2识别符\n"); | 652 | JZSDK_LOG_INFO("关闭串口2识别符\n"); |
| 653 | - close(Uart_DEV1_fd); | 653 | + close(Uart_DEV2_fd); |
| 654 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; | 654 | return JZ_ERROR_SYSTEM_MODULE_CODE_SUCCESS; |
| 655 | } | 655 | } |
| 656 | } | 656 | } |
| @@ -393,7 +393,7 @@ T_JZsdkReturnCode FF_Filter_Init(struct AudioDealInfo *AD_Info, int AudioType) | @@ -393,7 +393,7 @@ T_JZsdkReturnCode FF_Filter_Init(struct AudioDealInfo *AD_Info, int AudioType) | ||
| 393 | break; | 393 | break; |
| 394 | 394 | ||
| 395 | case FILTER_FORMAL_H150A: | 395 | case FILTER_FORMAL_H150A: |
| 396 | - ret = FF_Filter_ParamInit(AD_Info, FILTER_PARAM_NORMAL_AUDIO); | 396 | + ret = FF_Filter_ParamInit(AD_Info, FILTER_FORMAL_15_H150A); |
| 397 | break; | 397 | break; |
| 398 | 398 | ||
| 399 | default: | 399 | default: |
| 1 | -/** | 1 | +/** |
| 2 | ******************************************************************** | 2 | ******************************************************************** |
| 3 | * @file FF_FilterParam.h | 3 | * @file FF_FilterParam.h |
| 4 | * FF_FilterParam.h | 4 | * FF_FilterParam.h |
| @@ -350,6 +350,7 @@ extern "C" { | @@ -350,6 +350,7 @@ extern "C" { | ||
| 350 | lowpass=f=6000:width_type=q:w=1.8, \ | 350 | lowpass=f=6000:width_type=q:w=1.8, \ |
| 351 | volume=0.98" | 351 | volume=0.98" |
| 352 | 352 | ||
| 353 | +//测试 34~35度 26.3.18 | ||
| 353 | #define FILTER_FORMAL_11_H150A "equalizer=f=250:t=q:w=2.0:g=-14, \ | 354 | #define FILTER_FORMAL_11_H150A "equalizer=f=250:t=q:w=2.0:g=-14, \ |
| 354 | equalizer=f=500:t=q:w=2.0:g=-6, \ | 355 | equalizer=f=500:t=q:w=2.0:g=-6, \ |
| 355 | equalizer=f=1000:t=q:w=2.0:g=+0, \ | 356 | equalizer=f=1000:t=q:w=2.0:g=+0, \ |
| @@ -368,10 +369,28 @@ extern "C" { | @@ -368,10 +369,28 @@ extern "C" { | ||
| 368 | highpass=f=80:width_type=q:w=1.2, \ | 369 | highpass=f=80:width_type=q:w=1.2, \ |
| 369 | volume=0.98" | 370 | volume=0.98" |
| 370 | 371 | ||
| 371 | -#define FILTER_FORMAL_12_H150A "equalizer=f=250:t=q:w=2.0:g=-16, \ | ||
| 372 | - equalizer=f=500:t=q:w=2.0:g=-8, \ | ||
| 373 | - equalizer=f=1000:t=q:w=2.0:g=-4, \ | ||
| 374 | - equalizer=f=2000:t=q:w=2.0:g=-2, \ | 372 | +//温度过高,半小时61度,可能是aphaser带来的频谱位移导致 |
| 373 | +#define FILTER_MUSIC_13_H150A "equalizer=f=31:t=q:w=2.0:g=-12, \ | ||
| 374 | + equalizer=f=62:t=q:w=2.0:g=-3, \ | ||
| 375 | + equalizer=f=125:t=q:w=2.0:g=0, \ | ||
| 376 | + equalizer=f=250:t=q:w=2.0:g=-3, \ | ||
| 377 | + equalizer=f=500:t=q:w=2.0:g=0, \ | ||
| 378 | + equalizer=f=1000:t=q:w=2.0:g=+1, \ | ||
| 379 | + equalizer=f=2000:t=q:w=2.0:g=+1, \ | ||
| 380 | + equalizer=f=4000:t=q:w=2.0:g=+1, \ | ||
| 381 | + equalizer=f=8000:t=q:w=2.0:g=+2, \ | ||
| 382 | + equalizer=f=16000:t=q:w=2.0:g=+2, \ | ||
| 383 | + lowpass=f=18000:width_type=q:w=1.0, \ | ||
| 384 | + highpass=f=60:width_type=q:w=1.2, \ | ||
| 385 | + compand=attacks=0:decays=0.3:points=-60/-60|-30/-24|-20/-18|-10/-12|0/-6:gain=2, \ | ||
| 386 | + aphaser=delay=1:decay=0.1:speed=0.5, \ | ||
| 387 | + volume=1.0" | ||
| 388 | + | ||
| 389 | +//比11补偿点中低频, 温度34,音量126-127 | ||
| 390 | +#define FILTER_FORMAL_14_H150A "equalizer=f=250:t=q:w=2.0:g=-14, \ | ||
| 391 | + equalizer=f=500:t=q:w=2.0:g=-6, \ | ||
| 392 | + equalizer=f=1000:t=q:w=2.0:g=+0, \ | ||
| 393 | + equalizer=f=2000:t=q:w=2.0:g=+0, \ | ||
| 375 | equalizer=f=4000:t=q:w=2.0:g=+0, \ | 394 | equalizer=f=4000:t=q:w=2.0:g=+0, \ |
| 376 | equalizer=f=8000:t=q:w=2.0:g=-8, \ | 395 | equalizer=f=8000:t=q:w=2.0:g=-8, \ |
| 377 | equalizer=f=16000:t=q:w=2.0:g=-2, \ | 396 | equalizer=f=16000:t=q:w=2.0:g=-2, \ |
| @@ -384,14 +403,38 @@ extern "C" { | @@ -384,14 +403,38 @@ extern "C" { | ||
| 384 | equalizer=f=125:t=q:w=2.0:g=-48, \ | 403 | equalizer=f=125:t=q:w=2.0:g=-48, \ |
| 385 | lowpass=f=6000:width_type=q:w=1.8, \ | 404 | lowpass=f=6000:width_type=q:w=1.8, \ |
| 386 | highpass=f=80:width_type=q:w=1.2, \ | 405 | highpass=f=80:width_type=q:w=1.2, \ |
| 406 | + aphaser=delay=1:decay=0.1:speed=0.5, \ | ||
| 387 | volume=0.98" | 407 | volume=0.98" |
| 388 | 408 | ||
| 389 | -#define FILTER_FORMAL_13_H150A "equalizer=f=250:t=q:w=2.0:g=-24, \ | ||
| 390 | - equalizer=f=500:t=q:w=2.0:g=-16, \ | ||
| 391 | - equalizer=f=1000:t=q:w=2.0:g=-8, \ | ||
| 392 | - equalizer=f=2000:t=q:w=2.0:g=-4, \ | 409 | + |
| 410 | +//温度33,音量126 | ||
| 411 | +#define FILTER_FORMAL_15_H150A "equalizer=f=250:t=q:w=2.0:g=-10, \ | ||
| 412 | + equalizer=f=500:t=q:w=2.0:g=-3, \ | ||
| 413 | + equalizer=f=1000:t=q:w=2.0:g=+0, \ | ||
| 414 | + equalizer=f=2000:t=q:w=2.0:g=+0, \ | ||
| 393 | equalizer=f=4000:t=q:w=2.0:g=+0, \ | 415 | equalizer=f=4000:t=q:w=2.0:g=+0, \ |
| 394 | - equalizer=f=8000:t=q:w=2.0:g=-8, \ | 416 | + equalizer=f=8000:t=q:w=2.0:g=-6, \ |
| 417 | + equalizer=f=16000:t=q:w=2.0:g=-2, \ | ||
| 418 | + compand=attacks=0:decays=0.3:points=-60/-60|-30/-20|-20/-15|-10/-10|0/-5:gain=3, \ | ||
| 419 | + equalizer=f=4:t=q:w=2.0:g=-96, \ | ||
| 420 | + equalizer=f=8:t=q:w=2.0:g=-96, \ | ||
| 421 | + equalizer=f=15:t=q:w=2.0:g=-96, \ | ||
| 422 | + equalizer=f=31:t=q:w=2.0:g=-72, \ | ||
| 423 | + equalizer=f=62:t=q:w=2.0:g=-48, \ | ||
| 424 | + equalizer=f=125:t=q:w=2.0:g=-48, \ | ||
| 425 | + lowpass=f=6000:width_type=q:w=1.8, \ | ||
| 426 | + highpass=f=80:width_type=q:w=1.2, \ | ||
| 427 | + aphaser=delay=1:decay=0.1:speed=0.5, \ | ||
| 428 | + volume=0.98" | ||
| 429 | + | ||
| 430 | + | ||
| 431 | +//温度37,音量125-126 温度高了 | ||
| 432 | +#define FILTER_FORMAL_16_H150A "equalizer=f=250:t=q:w=2.0:g=-10, \ | ||
| 433 | + equalizer=f=500:t=q:w=2.0:g=-3, \ | ||
| 434 | + equalizer=f=1000:t=q:w=2.0:g=+0, \ | ||
| 435 | + equalizer=f=2000:t=q:w=2.0:g=+0, \ | ||
| 436 | + equalizer=f=4000:t=q:w=2.0:g=+0, \ | ||
| 437 | + equalizer=f=8000:t=q:w=2.0:g=-4, \ | ||
| 395 | equalizer=f=16000:t=q:w=2.0:g=-2, \ | 438 | equalizer=f=16000:t=q:w=2.0:g=-2, \ |
| 396 | compand=attacks=0:decays=0.3:points=-60/-60|-30/-20|-20/-15|-10/-10|0/-5:gain=3, \ | 439 | compand=attacks=0:decays=0.3:points=-60/-60|-30/-20|-20/-15|-10/-10|0/-5:gain=3, \ |
| 397 | equalizer=f=4:t=q:w=2.0:g=-96, \ | 440 | equalizer=f=4:t=q:w=2.0:g=-96, \ |
| @@ -402,6 +445,7 @@ extern "C" { | @@ -402,6 +445,7 @@ extern "C" { | ||
| 402 | equalizer=f=125:t=q:w=2.0:g=-48, \ | 445 | equalizer=f=125:t=q:w=2.0:g=-48, \ |
| 403 | lowpass=f=6000:width_type=q:w=1.8, \ | 446 | lowpass=f=6000:width_type=q:w=1.8, \ |
| 404 | highpass=f=80:width_type=q:w=1.2, \ | 447 | highpass=f=80:width_type=q:w=1.2, \ |
| 448 | + aphaser=delay=1:decay=0.1:speed=0.5, \ | ||
| 405 | volume=0.98" | 449 | volume=0.98" |
| 406 | 450 | ||
| 407 | 451 |
| 1 | -/** | 1 | +/** |
| 2 | ******************************************************************** | 2 | ******************************************************************** |
| 3 | * @file VolumeLimit.h | 3 | * @file VolumeLimit.h |
| 4 | * VolumeLimit.h 的头文件 | 4 | * VolumeLimit.h 的头文件 |
| @@ -114,12 +114,12 @@ extern "C" { | @@ -114,12 +114,12 @@ extern "C" { | ||
| 114 | // #define MAX_VOLUME (80) | 114 | // #define MAX_VOLUME (80) |
| 115 | // #define MAX_TTS_VOLUME (75) | 115 | // #define MAX_TTS_VOLUME (75) |
| 116 | 116 | ||
| 117 | - //2.1~2.2欧姆的振膜 默认参数87 88 11号参数 73 73 | ||
| 118 | - //#define MAX_VOLUME (71) | ||
| 119 | - //#define MAX_TTS_VOLUME (71) | 117 | + #define MAX_VOLUME (85) |
| 118 | + #define MAX_TTS_VOLUME (85) | ||
| 120 | 119 | ||
| 121 | - #define MAX_VOLUME (73) | ||
| 122 | - #define MAX_TTS_VOLUME (73) | 120 | + //旧滤波 和 11参 |
| 121 | + //#define MAX_VOLUME (73) | ||
| 122 | + //#define MAX_TTS_VOLUME (73) | ||
| 123 | #else | 123 | #else |
| 124 | #define MAX_VOLUME (75) | 124 | #define MAX_VOLUME (75) |
| 125 | #define MAX_TTS_VOLUME (75) | 125 | #define MAX_TTS_VOLUME (75) |
| @@ -62,6 +62,13 @@ extern "C" { | @@ -62,6 +62,13 @@ extern "C" { | ||
| 62 | #define USER_DEVELOPER_ACCOUNT "jizhisdk@163.com" | 62 | #define USER_DEVELOPER_ACCOUNT "jizhisdk@163.com" |
| 63 | #define USER_BAUD_RATE "921600" | 63 | #define USER_BAUD_RATE "921600" |
| 64 | 64 | ||
| 65 | + //#define USER_APP_NAME "ID0570" | ||
| 66 | + //#define USER_APP_ID "177576" | ||
| 67 | + //#define USER_APP_KEY "5ce1ab19916613ec389a17c99670176" | ||
| 68 | + //#define USER_APP_LICENSE "tSm/nAFGayFQ1WZ4WwR+OfHzopYB978IMd87NYb4zeXe/7rZHFVm8RIFZHi2MGZXx9VJJDovigWm6oGjiiRShshD8TmRC8mO4wcQKmZOaAuae915caKzsvFeMb0ekYyeYpzRB43cWH+Rvri3Sb6SMeAdxHI+i7FA/uGre0nNGhv6A+UXBUreufKMq9Rf9Y9qccQqGY8YtgldNlDJHapRuqKJsdZejkCEccNFv1O5AVZO63A7r/UfF49EkljCAhlAaSu1Z7qHHqBb9NbovuTf4d+omlL/ys+2ug7RPxhAdTKAbvvP49k8ObMze9FZTF4vBSuXzuveKCg/XMgWWP3dSw==" | ||
| 69 | + //#define USER_DEVELOPER_ACCOUNT "acme20251208@163.com" | ||
| 70 | + //#define USER_BAUD_RATE "921600" | ||
| 71 | + | ||
| 65 | //#define USER_APP_NAME "H150A" | 72 | //#define USER_APP_NAME "H150A" |
| 66 | //#define USER_APP_ID "180445" | 73 | //#define USER_APP_ID "180445" |
| 67 | //#define USER_APP_KEY "0164ed60d70b438c5ff26fde60c6609" | 74 | //#define USER_APP_KEY "0164ed60d70b438c5ff26fde60c6609" |
| @@ -68,6 +68,8 @@ | @@ -68,6 +68,8 @@ | ||
| 68 | #include "CommonMod/PowerManger/PowerManger.h" | 68 | #include "CommonMod/PowerManger/PowerManger.h" |
| 69 | #include "DJI_Expansion.h" | 69 | #include "DJI_Expansion.h" |
| 70 | 70 | ||
| 71 | +#include "JZsdk_Hal.h" | ||
| 72 | + | ||
| 71 | #ifdef AUDIODEAL_CONFIG_STATUS_ON | 73 | #ifdef AUDIODEAL_CONFIG_STATUS_ON |
| 72 | #include "AudioDeal/AudioDeal.h" | 74 | #include "AudioDeal/AudioDeal.h" |
| 73 | #endif | 75 | #endif |
| @@ -1250,4 +1252,24 @@ void *getworkmodeTask(void *arg) | @@ -1250,4 +1252,24 @@ void *getworkmodeTask(void *arg) | ||
| 1250 | int flag = 0x01; | 1252 | int flag = 0x01; |
| 1251 | Main_StartupPriority(&flag); | 1253 | Main_StartupPriority(&flag); |
| 1252 | 1254 | ||
| 1255 | +#if DEVICE_VERSION == JZ_H150A | ||
| 1256 | + //h150a新增,如果是h150a,增加一个新的识别 | ||
| 1257 | + //如果是m400,输入1 如果是m350输入0 | ||
| 1258 | + T_DjiAircraftInfoBaseInfo aircraftInfoBaseInfo; | ||
| 1259 | + DjiAircraftInfo_GetBaseInfo(&aircraftInfoBaseInfo); | ||
| 1260 | + | ||
| 1261 | + if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_SERIES_M350) | ||
| 1262 | + { | ||
| 1263 | + //在hal层中写入uart口 | ||
| 1264 | + JZsdk_Hal_config_use_uart1(0); | ||
| 1265 | + } | ||
| 1266 | + else if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M400) | ||
| 1267 | + { | ||
| 1268 | + //在hal层中写入uart口 | ||
| 1269 | + JZsdk_Hal_config_use_uart1(1); | ||
| 1270 | + } | ||
| 1271 | + | ||
| 1272 | +#endif // DEVICE_VERSION == JZ_H150A | ||
| 1273 | + | ||
| 1274 | + | ||
| 1253 | } | 1275 | } |
| 1 | -/** | 1 | +/** |
| 2 | ******************************************************************** | 2 | ******************************************************************** |
| 3 | * @file hal_uart.c | 3 | * @file hal_uart.c |
| 4 | * @brief | 4 | * @brief |
| @@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
| 25 | /* Includes ------------------------------------------------------------------*/ | 25 | /* Includes ------------------------------------------------------------------*/ |
| 26 | #include <dji_logger.h> | 26 | #include <dji_logger.h> |
| 27 | #include "hal_uart.h" | 27 | #include "hal_uart.h" |
| 28 | -#include "version_choose.h" | 28 | +#include "BaseConfig.h" |
| 29 | 29 | ||
| 30 | /* Private constants ---------------------------------------------------------*/ | 30 | /* Private constants ---------------------------------------------------------*/ |
| 31 | #define UART_DEV_NAME_STR_SIZE (128) | 31 | #define UART_DEV_NAME_STR_SIZE (128) |
| @@ -59,14 +59,25 @@ T_DjiReturnCode HalUart_Init(E_DjiHalUartNum uartNum, uint32_t baudRate, T_DjiUa | @@ -59,14 +59,25 @@ T_DjiReturnCode HalUart_Init(E_DjiHalUartNum uartNum, uint32_t baudRate, T_DjiUa | ||
| 59 | return DJI_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED; | 59 | return DJI_ERROR_SYSTEM_MODULE_CODE_MEMORY_ALLOC_FAILED; |
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | - if (uartNum == DJI_HAL_UART_NUM_0) { | ||
| 63 | - strcpy(uartName, LINUX_UART_DEV1); | ||
| 64 | - } else if (uartNum == DJI_HAL_UART_NUM_1) { | ||
| 65 | - strcpy(uartName, LINUX_UART_DEV2); | ||
| 66 | - } else { | ||
| 67 | - goto free_uart_handle; | 62 | + //获取 输入参数是否存在串口 |
| 63 | + if (JZsdk_ParamterParsing_GetUart1Device() == NULL) | ||
| 64 | + { | ||
| 65 | + if (uartNum == DJI_HAL_UART_NUM_0) { | ||
| 66 | + strcpy(uartName, LINUX_UART_DEV1); | ||
| 67 | + } | ||
| 68 | + else if (uartNum == DJI_HAL_UART_NUM_1) { | ||
| 69 | + strcpy(uartName, LINUX_UART_DEV2); | ||
| 70 | + } | ||
| 71 | + else { | ||
| 72 | + goto free_uart_handle; | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + else | ||
| 76 | + { | ||
| 77 | + strcpy(uartName, JZsdk_ParamterParsing_GetUart1Device()); | ||
| 68 | } | 78 | } |
| 69 | 79 | ||
| 80 | + | ||
| 70 | #ifdef USE_CLION_DEBUG | 81 | #ifdef USE_CLION_DEBUG |
| 71 | sprintf(systemCmd, "ls -l %s", uartName); | 82 | sprintf(systemCmd, "ls -l %s", uartName); |
| 72 | fp = popen(systemCmd, "r"); | 83 | fp = popen(systemCmd, "r"); |
-
请 注册 或 登录 后发表评论