serialhdl: Calculate baudadjust from MCU's baud instead of host baud

Store the baud rate the MCU is configured for in the "identify" data
and use that rate when calculating the baudadjust parameter.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-07-11 11:41:49 -04:00
parent 4988ba9a71
commit 777a0b817b
5 changed files with 22 additions and 15 deletions

View file

@ -39,8 +39,7 @@ defs_serialqueue = """
double sent_time, receive_time;
};
struct serialqueue *serialqueue_alloc(int serial_fd, double baud_adjust
, int write_only);
struct serialqueue *serialqueue_alloc(int serial_fd, int write_only);
void serialqueue_exit(struct serialqueue *sq);
struct command_queue *serialqueue_alloc_commandqueue(void);
void serialqueue_send(struct serialqueue *sq, struct command_queue *cq
@ -49,6 +48,7 @@ defs_serialqueue = """
, struct command_queue *cq, uint32_t *data, int len
, uint64_t min_clock, uint64_t req_clock);
void serialqueue_pull(struct serialqueue *sq, struct pull_queue_message *pqm);
void serialqueue_set_baud_adjust(struct serialqueue *sq, double baud_adjust);
void serialqueue_set_clock_est(struct serialqueue *sq, double est_clock
, double last_ack_time, uint64_t last_ack_clock);
void serialqueue_flush_ready(struct serialqueue *sq);