X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fopenbench-logic-sniffer%2Fols.c;h=51379d930391c95517b74888612e5ab326d43273;hb=f437ea3fe2cada77634eb3a06d34abf680b9c092;hp=95da9a248e4bfa99bb59e9528cd1b93818657b44;hpb=8a2efef2d5900cb3dd935af92a0e22528660c4be;p=libsigrok.git diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index 95da9a24..51379d93 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -49,7 +49,7 @@ #define NUM_TRIGGER_STAGES 4 #define TRIGGER_TYPES "01" #define SERIAL_SPEED B115200 -#define CLOCK_RATE MHZ(100) +#define CLOCK_RATE SR_MHZ(100) #define MIN_NUM_SAMPLES 4 /* Command opcodes */ @@ -91,11 +91,11 @@ static int capabilities[] = { 0, }; -static struct samplerates samplerates = { - 10, - MHZ(200), - 1, - 0, +static struct sr_samplerates samplerates = { + SR_HZ(10), + SR_MHZ(200), + SR_HZ(1), + NULL, }; /* List of struct sr_serial_device_instance */ @@ -219,7 +219,7 @@ static uint32_t reverse32(uint32_t in) return out; } -static int hw_init(char *deviceinfo) +static int hw_init(const char *deviceinfo) { struct sr_device_instance *sdi; GSList *ports, *l; @@ -321,7 +321,7 @@ static int hw_init(char *deviceinfo) free(serial_params); g_slist_free(ports); - cur_samplerate = KHZ(200); + cur_samplerate = SR_KHZ(200); return final_devcnt; } @@ -506,8 +506,8 @@ static int receive_data(int fd, int revents, void *user_data) * longer than it takes to send a byte, that means it's * finished. We'll double that to 30ms to be sure... */ - source_remove(fd); - source_add(fd, G_IO_IN, 30, receive_data, user_data); + sr_source_remove(fd); + sr_source_add(fd, G_IO_IN, 30, receive_data, user_data); raw_sample_buf = malloc(limit_samples * 4); /* fill with 1010... for debugging */ memset(raw_sample_buf, 0x82, limit_samples * 4); @@ -755,8 +755,8 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) if (send_shortcommand(sdi->serial->fd, CMD_RUN) != SR_OK) return SR_ERR; - source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, - session_device_id); + sr_source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, + session_device_id); /* Send header packet to the session bus. */ packet = g_malloc(sizeof(struct sr_datafeed_packet));