Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
3fb2c7d4
Commit
3fb2c7d4
authored
Oct 18, 2018
by
devsaurus
Browse files
fix intr_alloc setting
re-enable i2s.read()
parent
96adbabf
Changes
1
Hide whitespace changes
Inline
Side-by-side
components/modules/i2s.c
View file @
3fb2c7d4
...
...
@@ -158,7 +158,7 @@ static int node_i2s_start( lua_State *L )
lua_getfield
(
L
,
2
,
"buffer_len"
);
i2s_config
.
dma_buf_len
=
luaL_optint
(
L
,
-
1
,
i2s_config
.
sample_rate
/
100
);
//
i2s_config
.
intr_alloc_flags
=
ESP_INTR_FLAG_L
OWMED
|
ESP_INTR_FLAG_IRAM
;
i2s_config
.
intr_alloc_flags
=
ESP_INTR_FLAG_L
EVEL1
;
//
lua_getfield
(
L
,
2
,
"bck_pin"
);
pin_config
.
bck_io_num
=
luaL_optint
(
L
,
-
1
,
I2S_PIN_NO_CHANGE
);
...
...
@@ -269,10 +269,10 @@ static int node_i2s_read( lua_State *L )
I2S_CHECK_ID
(
i2s_id
);
size_t
bytes
=
luaL_checkinteger
(
L
,
2
);
//
int wait_ms = luaL_optint(L, 3, 0);
int
wait_ms
=
luaL_optint
(
L
,
3
,
0
);
char
*
data
=
luaM_malloc
(
L
,
bytes
);
size_t
read
=
0
;
//read =
i2s_read
_bytes
(i2s_id, data, bytes, wait_ms / portTICK_RATE_MS);
size_t
read
;
i2s_read
(
i2s_id
,
data
,
bytes
,
&
read
,
wait_ms
/
portTICK_RATE_MS
);
lua_pushlstring
(
L
,
data
,
read
);
luaM_free
(
L
,
data
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment