- 論壇徽章:
- 0
|
本人在調試串口驅動時遇到這樣的問題:
在串口接收數據部分:一收到數據就會產生中斷,把字符存在變量ch中,然后調用tty_insert_flip_char(tty, ch, flg);這個函數把它存到內核的buffer,最后調用tty_flip_buffer_push(tty);應用層卻得不到數據,為什么?
硬件方面是肯定沒有問題的,打印變量ch的值就是我傳輸的值。請高手解答啊。
- static inline int tty_insert_flip_char(struct tty_struct *tty,
- 12 unsigned char ch, char flag)
- 13{
- 14 struct tty_buffer *tb = tty->buf.tail;
- 15 if (tb && tb->active && tb->used < tb->size) {
- 16 tb->flag_buf_ptr[tb->used] = flag;
- 17 tb->char_buf_ptr[tb->used++] = ch;
- 18 return 1;
- 19 }
- 20 return tty_insert_flip_string_flags(tty, &ch, &flag, 1);
- 21}
復制代碼
|
|