* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include <math.h>
#include "protocol.h"
SR_PRIV unsigned int get_memory_size(int type)
{
if (type == MEMORY_SIZE_8K)
- return 8 * 1024;
+ return (8 * 1024);
else if (type <= MEMORY_SIZE_8M)
return (32 * 1024) << type;
else
devc->limit_samples = samples;
- if (samples <= 2 * 1024)
+ if (samples <= (2 * 1024))
devc->memory_size = MEMORY_SIZE_8K;
- else if (samples <= 16 * 1024)
+ else if (samples <= (16 * 1024))
devc->memory_size = MEMORY_SIZE_64K;
else
devc->memory_size = 19 - clz(samples - 1);
return SR_OK;
}
-SR_PRIV int set_capture_ratio(struct dev_context *devc, uint64_t ratio)
-{
- if (ratio > 100) {
- sr_err("Invalid capture ratio: %" PRIu64 ".", ratio);
- return SR_ERR_ARG;
- }
-
- devc->capture_ratio = ratio;
-
- sr_info("Setting capture ratio to %d%%.", devc->capture_ratio);
-
- return SR_OK;
-}
-
SR_PRIV int set_voltage_threshold(struct dev_context *devc, double thresh)
{
if (thresh > 6.0)
trigger_depth = devc->limit_samples;
if (devc->trigger)
- triggerbar = trigger_depth * devc->capture_ratio / 100;
+ triggerbar = (trigger_depth * devc->capture_ratio) / 100;
else
triggerbar = 0;