From e2459c89e420a87949614a4a5460dd87371b956e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20B=C3=A9rub=C3=A9?= Date: Thu, 30 May 2024 17:28:52 -0400 Subject: [PATCH] (Continued) --- src/hal/inge/tx_hal.c | 4 ++-- src/hal/inge/tx_isp.h | 2 +- src/hal/inge/tx_sys.h | 8 ++++---- src/video.c | 4 ++++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/hal/inge/tx_hal.c b/src/hal/inge/tx_hal.c index d506d8b..10e9204 100644 --- a/src/hal/inge/tx_hal.c +++ b/src/hal/inge/tx_hal.c @@ -91,8 +91,8 @@ int tx_system_init(char *sensor) } for (char i = 0; i < sizeof(tx_sensors) / sizeof(*tx_sensors); i++) { - if (strcmp(sensor, tx_sensors[i].name)) continue; - _tx_isp_snr = tx_sensors[i]; + if (strcmp(tx_sensors[i].name, sensor)) continue; + memcpy(&_tx_isp_snr, &tx_sensors[i], sizeof(tx_isp_snr)); ret = 0; break; } diff --git a/src/hal/inge/tx_isp.h b/src/hal/inge/tx_isp.h index 8475edb..49f59ff 100644 --- a/src/hal/inge/tx_isp.h +++ b/src/hal/inge/tx_isp.h @@ -26,7 +26,7 @@ typedef struct { } tx_isp_snr; static tx_isp_snr tx_sensors[] = { - { .name = "sc2335", .spiMode = 0, .i2c.type = "sc2335", .i2c.addr = 0x30, + { .name = "sc2335", .spiMode = 0, .i2c.type = "sc2335", .i2c.addr = 0x60, .rstPin = 18, .powDownPin = -1, .powUpPin = -1 } }; diff --git a/src/hal/inge/tx_sys.h b/src/hal/inge/tx_sys.h index 02f84f1..954cbaf 100644 --- a/src/hal/inge/tx_sys.h +++ b/src/hal/inge/tx_sys.h @@ -70,14 +70,14 @@ static int tx_sys_load(tx_sys_impl *sys_lib) { } if (!(sys_lib->fnBind = (int(*)(tx_sys_bind *source, tx_sys_bind *dest)) - dlsym(sys_lib->handle, "HI_MPI_SYS_Bind"))) { - fprintf(stderr, "[tx_sys] Failed to acquire symbol HI_MPI_SYS_Bind!\n"); + dlsym(sys_lib->handle, "IMP_System_Bind"))) { + fprintf(stderr, "[tx_sys] Failed to acquire symbol IMP_System_Bind!\n"); return EXIT_FAILURE; } if (!(sys_lib->fnUnbind = (int(*)(tx_sys_bind *source, tx_sys_bind *dest)) - dlsym(sys_lib->handle, "HI_MPI_SYS_UnBind"))) { - fprintf(stderr, "[tx_sys] Failed to acquire symbol HI_MPI_SYS_UnBind!\n"); + dlsym(sys_lib->handle, "IMP_System_UnBind"))) { + fprintf(stderr, "[tx_sys] Failed to acquire symbol IMP_System_UnBind!\n"); return EXIT_FAILURE; } diff --git a/src/video.c b/src/video.c index 78f48ee..a0e9eb3 100644 --- a/src/video.c +++ b/src/video.c @@ -162,6 +162,8 @@ int start_sdk() { case HAL_PLATFORM_I6E: ret = i6_hal_init(); break; case HAL_PLATFORM_I6C: ret = i6c_hal_init(); break; case HAL_PLATFORM_I6F: ret = i6f_hal_init(); break; + case HAL_PLATFORM_T21: + case HAL_PLATFORM_T31: ret = tx_hal_init(); break; case HAL_PLATFORM_V4: ret = v4_hal_init(); break; } if (ret) { @@ -185,6 +187,8 @@ int start_sdk() { case HAL_PLATFORM_I6E: ret = i6_system_init(); break; case HAL_PLATFORM_I6C: ret = i6c_system_init(); break; case HAL_PLATFORM_I6F: ret = i6f_system_init(); break; + case HAL_PLATFORM_T21: + case HAL_PLATFORM_T31: ret = tx_system_init("sc2335"); break; case HAL_PLATFORM_V4: ret = v4_system_init(app_config.sensor_config); break; } if (ret) {