view target-utils/simagent/byterx.c @ 775:6ec781e61e68

simagent: enable CHKPAR and CONV at the end of sim-up
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 12 Mar 2021 22:08:07 +0000
parents 9c1d580b50fb
children badc5399d641
line wrap: on
line source

#include <stdlib.h>
#include "types.h"
#include "simregs.h"

rx_sim_byte(count)
	unsigned count;
{
	for (; count; count--) {
		if (!(SIMREGS.stat & SIM_STAT_FEMPTY))
			return SIMREGS.drx;
	}
	return(-1);
}

void
cmd_sertimeout(argbulk)
	char *argbulk;
{
	char *argv[2];
	int count;

	if (parse_args(argbulk, 1, 1, argv, 0) < 0)
		return;
	count = atoi(argv[0]);
	rx_sim_byte(count);
}