Guest User

Untitled

a guest
Jul 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. static void puttxt(char *text) {
  2.  
  3.  
  4. static uint8_t txbufferwritepos;
  5. char * tp1, *tp2;
  6.  
  7. tp1 = text;
  8. tp2 = txbuffer+txbufferwritepos;
  9.  
  10. cli();
  11. sei();
  12.  
  13. while(*tp1) {
  14. *(tp2++) = *(tp1++);
  15. charsleftintxbuffer++;
  16. txbufferwritepos++;
  17. if (txbufferwritepos == TX_BUF_SIZE) { tp2 = txbufferwritepos; }
  18. }
  19.  
  20. UCSR0B |= (1 << UDRIE0);
  21.  
  22. return;
  23. }
Add Comment
Please, Sign In to add comment