Advertisement
aperles

Clase timers

Oct 15th, 2020
2,043
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void delayus (uint32_t microseconds)
  2. {
  3.     uint32_t overflows;
  4.     uint32_t partial;
  5.  
  6.     overflows = microseconds/65536 + 1;
  7.     //partial = microseconds - overflow * 65536;  
  8.     partial = microseconds % 65536;
  9.  
  10.     counter_flags = 0;
  11.     while (counter_flags < overflows)
  12.     {
  13.         while(comprobar flag) {};
  14.         borrar flag
  15.         counter_flags++;
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement