Beispiel #1
0
/* u2_unix_io_poll(): update unix IO state.
*/
void
u2_unix_io_poll(void)
{
  u2_unix* unx_u = &u2_Host.unx_u;
  u2_noun  wen = u2_reck_keep(u2A, u2nt(u2_blip, c3__clay, u2_nul));

  if ( (u2_nul != wen) &&
       (u2_yes == u2du(wen)) &&
       (u2_yes == u2ud(u2t(wen))) )
  {
    c3_d gap_d = u2_time_gap_ms(u2k(u2A->now), u2k(u2t(wen)));

    if ( u2_yes == unx_u->alm ) {
      uv_timer_stop(&unx_u->tim_u);
    }
    else unx_u->alm = u2_yes;

    if ( gap_d < 1000 ) { gap_d = 1000; }   // band-aid on an unknown clay timer bug
    uv_timer_start(&unx_u->tim_u, _unix_time_cb, gap_d, 0);
  }
  else {
    if ( u2_yes == unx_u->alm ) {
      uv_timer_stop(&unx_u->tim_u);
    }
    unx_u->alm = u2_no;
  }
  u2z(wen);
}
Beispiel #2
0
/* u2_unix_io_poll(): update unix IO state.
*/
void
u2_unix_io_poll(void)
{
  u2_unix* unx_u = &u2_Host.unx_u;
  u2_noun  wen = u2_reck_keep(u2A, u2nt(c3__gold, c3__clay, u2_nul));
 
  if ( (u2_nul != wen) && 
       (u2_yes == u2du(wen)) &&
       (u2_yes == u2ud(u2t(wen))) )
  {
    c3_d gap_d = u2_time_gap_ms(u2k(u2A->now), u2k(u2t(wen)));

    if ( u2_yes == unx_u->alm ) {
      uv_timer_stop(&unx_u->tim_u);
    }
    else unx_u->alm = u2_yes;

    uv_timer_start(&unx_u->tim_u, _unix_time_cb, gap_d, 0);
  }
  else {
    if ( u2_yes == unx_u->alm ) {
      uv_timer_stop(&unx_u->tim_u);
    }
    unx_u->alm = u2_no;
  }
  u2z(wen);
}
Beispiel #3
0
/* u2_batz_io_poll(): update batz IO state.
*/
void
u2_batz_io_poll(void)
{
  u2_batz* beh_u = &u2_Host.beh_u;
  u2_noun  wen   = u2_reck_keep(u2A, u2nt(c3__gold, c3__batz, u2_nul));
 
  if ( (u2_nul != wen) && 
       (u2_yes == u2du(wen)) &&
       (u2_yes == u2ud(u2t(wen))) )
  {
    c3_d gap_d = u2_time_gap_ms(u2k(u2A->now), u2k(u2t(wen)));

    if ( u2_yes == beh_u->alm ) {
      uv_timer_stop(&beh_u->tim_u);
    }
    else beh_u->alm = u2_yes;

    uv_timer_start(&beh_u->tim_u, _batz_time_cb, gap_d, 0);
  }
  else {
    if ( u2_yes == beh_u->alm ) {
      uv_timer_stop(&beh_u->tim_u);
    }
    beh_u->alm = u2_no;
  }
  u2z(wen);
}