X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fcem-dt-885x%2Fprotocol.c;h=78b02f6a0728213207209b095fb6c3fabbeaf782;hb=bbabdaf1e2802aeef7d48fab4b0dc3507a69ffe9;hp=74531b1eee9dbfbda9ab9cd4f354331afbe609eb;hpb=cea26f6e9f1a58f28a4b790756a2f95dcf0eaa9d;p=libsigrok.git diff --git a/hardware/cem-dt-885x/protocol.c b/hardware/cem-dt-885x/protocol.c index 74531b1e..78b02f6a 100644 --- a/hardware/cem-dt-885x/protocol.c +++ b/hardware/cem-dt-885x/protocol.c @@ -405,7 +405,7 @@ SR_PRIV int cem_dt_885x_receive_data(int fd, int revents, void *cb_data) } -static int wait_for_token(const struct sr_dev_inst *sdi, char *tokens, int timeout) +static int wait_for_token(const struct sr_dev_inst *sdi, int8_t *tokens, int timeout) { struct dev_context *devc; struct sr_serial_dev_inst *serial; @@ -440,8 +440,8 @@ static int wait_for_token(const struct sr_dev_inst *sdi, char *tokens, int timeo /* cmd is the command to send, tokens are the tokens that denote the state * which the command affects. The first token is the desired state. */ -SR_PRIV int cem_dt_885x_toggle(const struct sr_dev_inst *sdi, uint8_t cmd, - char *tokens, int timeout) +static int cem_dt_885x_toggle(const struct sr_dev_inst *sdi, uint8_t cmd, + int8_t *tokens, int timeout) { struct dev_context *devc; struct sr_serial_dev_inst *serial; @@ -469,7 +469,7 @@ SR_PRIV gboolean cem_dt_885x_recording_get(const struct sr_dev_inst *sdi, int *state) { struct dev_context *devc; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; if (devc->recording == -1) { @@ -490,7 +490,7 @@ SR_PRIV int cem_dt_885x_recording_set(const struct sr_dev_inst *sdi, { struct dev_context *devc; int ret; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; @@ -526,7 +526,7 @@ SR_PRIV int cem_dt_885x_weight_freq_get(const struct sr_dev_inst *sdi) { struct dev_context *devc; int cur_setting; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; @@ -544,14 +544,13 @@ SR_PRIV int cem_dt_885x_weight_freq_get(const struct sr_dev_inst *sdi) return SR_MQFLAG_SPL_FREQ_WEIGHT_C; } else return cur_setting; - } SR_PRIV int cem_dt_885x_weight_freq_set(const struct sr_dev_inst *sdi, int freqw) { struct dev_context *devc; int cur_setting, ret; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; @@ -589,7 +588,7 @@ SR_PRIV int cem_dt_885x_weight_time_get(const struct sr_dev_inst *sdi) { struct dev_context *devc; int cur_setting; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; @@ -607,14 +606,13 @@ SR_PRIV int cem_dt_885x_weight_time_get(const struct sr_dev_inst *sdi) return SR_MQFLAG_SPL_TIME_WEIGHT_S; } else return cur_setting; - } SR_PRIV int cem_dt_885x_weight_time_set(const struct sr_dev_inst *sdi, int timew) { struct dev_context *devc; int cur_setting, ret; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; @@ -652,7 +650,7 @@ SR_PRIV int cem_dt_885x_holdmode_get(const struct sr_dev_inst *sdi, gboolean *holdmode) { struct dev_context *devc; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; @@ -677,7 +675,7 @@ SR_PRIV int cem_dt_885x_holdmode_set(const struct sr_dev_inst *sdi, int holdmode { struct dev_context *devc; int cur_setting, ret; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; @@ -721,7 +719,7 @@ SR_PRIV int cem_dt_885x_meas_range_get(const struct sr_dev_inst *sdi, uint64_t *low, uint64_t *high) { struct dev_context *devc; - char tokens[5]; + int8_t tokens[5]; devc = sdi->priv; if (devc->cur_meas_range == 0) { @@ -764,7 +762,7 @@ SR_PRIV int cem_dt_885x_meas_range_set(const struct sr_dev_inst *sdi, { struct dev_context *devc; int ret; - char token, tokens[6]; + int8_t token, tokens[6]; devc = sdi->priv; if (low == 30 && high == 130)