while(wait_for_packet() != APP_CMD_START);
}
+void appserver_link_t::wait_for_tohost()
+{
+ while(wait_for_packet() != APP_CMD_READ_CONTROL_REG);
+}
+
+void appserver_link_t::wait_for_fromhost()
+{
+ while(wait_for_packet() != APP_CMD_WRITE_CONTROL_REG);
+}
+
void appserver_link_t::send_packet(packet* p)
{
while(1) try
{
fromhost = 0;
tohost = val;
+ applink->wait_for_tohost();
}
reg_t sim_t::get_fromhost()
{
- while(fromhost == 0)
- applink->wait_for_packet();
+ applink->wait_for_fromhost();
return fromhost;
}