Skip to content
Snippets Groups Projects
Commit e3aa6461 authored by Arist's avatar Arist
Browse files

fix(max86150): avoid stack overflow in pycardium by using smaller buf

parent ab3a77a2
No related branches found
No related tags found
1 merge request!359max86150 pycardium api
......@@ -28,7 +28,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(
STATIC mp_obj_t mp_max86150_read_sensor(mp_obj_t stream_id_in)
{
struct max86150_sensor_data buf[256];
// do not use too big buf
// 256*12 is close to stack size of 4096, reduced to 64
struct max86150_sensor_data buf[64];
int stream_id = mp_obj_get_int(stream_id_in);
int n = epic_stream_read(stream_id, buf, sizeof(buf));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment