c - Checking THRE to send characters via serial -


i'm trying send string serial port using:

#define uart    0x03f8 ... #define uart_lsr_thre 0x20 ... void uart_send(unsigned char *data){      int = 0, k = strlen(data);      printk("uart_send invoked, data %s , k %d\n", data, k);      while(i < k){        while( !(inb(uart + uart_lsr_thre)) ){              printk("called\n");              schedule();        }        if(i < k){              outb(data[i++], (uart + uart_tx));        }     } } 

when trying write abcdef, example, skips letters or prints them more once. guess i'm not verifying status of thre correctly, seeing it's not wrong result, while() being there or not doesn't seem doing anything. ideas?


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -