Skip to content

Commit 94c0aba

Browse files
committed
Merge branch 'master' of https://gitee.com/openLuat/LuatOS
2 parents 0f2fa58 + df35e14 commit 94c0aba

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

components/camera/luat_camera.h

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ typedef struct luat_camera_conf
4444
uint8_t color_bit;
4545
uint8_t id_reg;
4646
uint8_t id_value;
47+
uint8_t usb_port;
4748
size_t init_cmd_size;
4849
uint8_t *init_cmd;
4950
#ifdef __LUATOS__
@@ -66,6 +67,7 @@ typedef struct
6667
uint8_t is_msb; //0 or 1;
6768
uint8_t is_two_line_rx; //0 or 1;
6869
uint8_t seq_type; //0 or 1
70+
uint8_t usb_port;
6971
uint8_t plat_param[4];
7072
#ifdef __LUATOS__
7173
luat_lcd_conf_t* lcd_conf;

components/camera/luat_lib_camera.c

+8
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ static int l_camera_init(lua_State *L){
161161
conf.id = luaL_checkinteger(L, -1);
162162
}
163163
lua_pop(L, 1);
164+
165+
lua_pushliteral(L, "usb_port");
166+
lua_gettable(L, 1);
167+
if (lua_isinteger(L, -1)) {
168+
conf.usb_port = luaL_checkinteger(L, -1);
169+
}
170+
lua_pop(L, 1);
171+
164172
lua_pushliteral(L, "init_cmd");
165173
lua_gettable(L, 1);
166174
if (lua_istable(L, -1)) {

demo/camera/usb_cam/main.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ local camera_id = camera.USB
1515
local usb_camera_table = {
1616
id = camera_id,
1717
sensor_width = 1280,
18-
sensor_height = 720
18+
sensor_height = 720,
19+
usb_port = 1
1920
}
2021

2122
camera.on(camera_id, "scanned", function(id, str)

0 commit comments

Comments
 (0)