Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Stuff
Monday, March 12th, 2007 at 9:53:28pm UTC 

  1. void sleep(int ticks)
  2. {
  3. #if CONFIG_CPU == S3C2440 && defined(BOOTLOADER)
  4.     volatile int counter;
  5.     TCON &= ~(1 << 20); // stop timer 4
  6.     // TODO: this constant depends on dividers settings inherited from
  7.     // firmware. Set them explicitly somwhere.
  8.     TCNTB4 = 12193 * ticks / HZ;
  9.     TCON |= 1 << 21; // set manual bit
  10.     TCON &= ~(1 << 21); // reset manual bit
  11.     TCON &= ~(1 << 22); //autoreload Off
  12.     TCON |= (1 << 20); // start timer 4
  13.     do {
  14.        counter = TCNTO4;
  15.     } while(counter > 0);
  16.  
  17. #elif defined(CPU_PP) && defined(BOOTLOADER)
  18.     unsigned stop = USEC_TIMER + ticks*10000;
  19.     while (TIME_BEFORE(USEC_TIMER, stop))
  20.         switch_thread(true,NULL);
  21. #else
  22.     sleep_thread(ticks);
  23. #endif
  24. }

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right
worth-right