* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <config.h>
#include "protocol.h"
#include "beaglelogic.h"
/* Set fd and local attributes */
devc->pollfd.fd = devc->fd;
devc->pollfd.events = G_IO_IN;
+ devc->pollfd.revents = 0;
/* Get the default attributes */
beaglelogic_get_samplerate(devc);
return beaglelogic_set_triggerflags(devc);
case SR_CONF_CAPTURE_RATIO:
devc->capture_ratio = g_variant_get_uint64(data);
- if (devc->capture_ratio > 100) {
- devc->capture_ratio = 0;
+ if (devc->capture_ratio > 100)
return SR_ERR;
- }
return SR_OK;
default:
return SR_ERR_NA;
#define BUFUNIT_TIMEOUT_MS(devc) (100 + ((devc->bufunitsize * 1000) / \
(uint32_t)(devc->cur_samplerate)))
-static int dev_acquisition_start(const struct sr_dev_inst *sdi,
- void *cb_data)
+static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
{
- (void)cb_data;
struct dev_context *devc = sdi->priv;
struct sr_trigger *trigger;
+ (void)cb_data;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
struct dev_context *devc = sdi->priv;
- struct sr_datafeed_packet pkt;
(void)cb_data;
/* Remove session source and send EOT packet */
sr_session_source_remove_pollfd(sdi->session, &devc->pollfd);
- pkt.type = SR_DF_END;
- pkt.payload = NULL;
- sr_session_send(sdi, &pkt);
+ std_session_send_df_end(sdi, LOG_PREFIX);
return SR_OK;
}