| 359 | } |
| 360 | |
| 361 | static void sensor_fifo_rx_entry(void *parameter) |
| 362 | { |
| 363 | rt_sensor_t sensor = (rt_sensor_t)parameter; |
| 364 | struct rt_sensor_data *data = RT_NULL; |
| 365 | rt_size_t res, i; |
| 366 | |
| 367 | data = (struct rt_sensor_data *)rt_calloc(sensor->info.fifo_max, sizeof(struct rt_sensor_data)); |
| 368 | if (data == RT_NULL) |
| 369 | { |
| 370 | LOG_E("Memory allocation failed!"); |
| 371 | } |
| 372 | |
| 373 | while (1) |
| 374 | { |
| 375 | rt_sem_take(sensor_rx_sem, RT_WAITING_FOREVER); |
| 376 | |
| 377 | res = rt_device_read((rt_device_t)sensor, 0, data, sensor->info.fifo_max); |
| 378 | for (i = 0; i < res; i++) |
| 379 | { |
| 380 | sensor_show_data(i, sensor, &data[i]); |
| 381 | } |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | static void sensor_fifo(int argc, char **argv) |
| 386 | { |
nothing calls this directly
no test coverage detected