|
RocketLogger
1.0
|
#include "util.h"
Include dependency graph for util.c:Go to the source code of this file.
Functions | |
| int | is_current (int index) |
| int | is_low_current (int index) |
| int | count_channels (int channels[NUM_CHANNELS]) |
| int | read_status (struct rl_status *status) |
| int | write_status (struct rl_status *status) |
| int | ceil_div (int n, int d) |
| void | sig_handler (int signo) |
| int | read_file_value (char filename[]) |
| int ceil_div | ( | int | n, |
| int | d | ||
| ) |
Integer division with ceiling.
| n | Numerator |
| d | Denominator |
Definition at line 116 of file util.c.
Referenced by pru_sample().
| int count_channels | ( | int | channels[NUM_CHANNELS] | ) |
Counts the number of channels sampled.
| channels | Channel array. |
Definition at line 39 of file util.c.
References CHANNEL_ENABLED, and NUM_CHANNELS.
Referenced by handle_data_buffer(), meter_print_buffer(), pru_sample(), and setup_lead_in().
| int is_current | ( | int | index | ) |
Copyright (c) 2016-2017, ETH Zurich, Computer Engineering Group Checks if channel is a current channel.
| index | Index of channel in array. |
Definition at line 13 of file util.c.
References I1H_INDEX, I1L_INDEX, I2H_INDEX, and I2L_INDEX.
Referenced by meter_print_buffer(), and setup_channels().
| int is_low_current | ( | int | index | ) |
Checks if channel is a low range current channel.
| index | Index of channel in array. |
Definition at line 26 of file util.c.
References I1L_INDEX, and I2L_INDEX.
Referenced by setup_channels().
| int read_file_value | ( | char | filename[] | ) |
Read a single integer from file.
| filename | Path to file. |
Definition at line 156 of file util.c.
References ERROR, FAILURE, and rl_log().
Referenced by map_pru_memory(), pru_data_setup(), pru_sample(), and unmap_pru_memory().
Here is the call graph for this function:| int read_status | ( | struct rl_status * | status | ) |
Reads the status of the running measurement from shared memory.
| status | Pointer to struct array. |
Definition at line 56 of file util.c.
References ERROR, FAILURE, rl_log(), SHMEM_PERMISSIONS, SHMEM_STATUS_KEY, and SUCCESS.
Referenced by rl_get_status(), and rl_read_status().
Here is the call graph for this function:| void sig_handler | ( | int | signo | ) |
Signal handler to catch stop signals.
| signo | Signal type. |
Definition at line 131 of file util.c.
References rl_status::sampling, SAMPLING_OFF, and status.
Referenced by rl_start().
| int write_status | ( | struct rl_status * | status | ) |
Writes the status to the shared memory.
| status | Pointer to struct array. |
Definition at line 85 of file util.c.
References ERROR, FAILURE, rl_log(), SHMEM_PERMISSIONS, SHMEM_STATUS_KEY, status, and SUCCESS.
Referenced by hw_close(), hw_init(), and pru_sample().
Here is the call graph for this function: