demo: fix infinite loop with 0 channels of one type
The following command line exhibits the inifinit loop: sigrok-cli -d demo:analog_channels=0 --samples=8
This commit is contained in:
parent
e922790220
commit
9dfacd8706
|
@ -784,8 +784,8 @@ static int prepare_data(int fd, int revents, void *cb_data)
|
|||
*/
|
||||
todo_us = samples_todo * G_USEC_PER_SEC / devc->cur_samplerate;
|
||||
|
||||
logic_done = 0;
|
||||
analog_done = 0;
|
||||
logic_done = devc->num_logic_channels > 0 ? 0 : samples_todo;
|
||||
analog_done = devc->num_analog_channels > 0 ? 0 : samples_todo;
|
||||
|
||||
while (logic_done < samples_todo || analog_done < samples_todo) {
|
||||
/* Logic */
|
||||
|
|
Loading…
Reference in New Issue