This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Getting battery status on ipaq



I'm calling the function get_batt_status from a endless loop and the
cyg_thread_delay() is also within the loop body. There is only this thread
running on the system in my tests.

---------------------------------------------------------------------------

int main(void)
{
  int count = 0;
  batt_device_t batt;

  while (1) {
    if (get_batt_status(&batt)) {
      /* printf a lot of info */
    }
    cyg_thread_delay(50);
  }
  return 0;
}

---------------------------------------------------------------------------

Thanks,
Cristiano.

------------------------------------------------------------
Cristiano Ligieri Pereira - http://www.ics.uci.edu/~cpereira

> Sorry, where are you calling cyg_thread_delay()? Could it just be as simple
> as the cyg_thread_delay causing another thread to be scheduled which
> doesn't relinquish control? Or perhaps the deschedule causes another device
> to talk to the Atmel and confuse it.
> 
> Just a suggestion anyway, even though I know little about the Atmel.
> 
> Jifl
> -- 
> Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
> Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]