提交 2c0f89d9 编写于 作者: K kyle.hu.gz

Checks for nested interrupt. Fixed USART TX problem.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@672 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 5c2b75cc
...@@ -202,16 +202,21 @@ _int\priority: ...@@ -202,16 +202,21 @@ _int\priority:
call rt_interrupt_enter call rt_interrupt_enter
icall r12 icall r12
call rt_interrupt_leave call rt_interrupt_leave
_spint\priority: ssrf AVR32_SR_GM_OFFSET /* Disable global interrupt */
lda.w r12, rt_thread_switch_interrupt_flag lda.w r12, rt_interrupt_nest /* Is nested interrupt? */
ld.w r11, r12[0]
cp.w r11, 0
brne _spint\priority
lda.w r12, rt_thread_switch_interrupt_flag /* Is thread switch required? */
ld.w r11, r12[0] ld.w r11, r12[0]
cp.w r11, 1 cp.w r11, 1
breq rt_hw_context_switch_interrupt_do breq rt_hw_context_switch_interrupt_do
_spint\priority:
csrf AVR32_SR_GM_OFFSET /* Enable global interrupt */
rete // If this was a spurious interrupt (R12 == NULL), return from event handler. rete // If this was a spurious interrupt (R12 == NULL), return from event handler.
.endr .endr
rt_hw_context_switch_interrupt_do: rt_hw_context_switch_interrupt_do:
ssrf AVR32_SR_GM_OFFSET /* Disable global interrupt */
mov r11, 0 mov r11, 0
st.w r12[0], r11 /* Clear rt_thread_switch_interrupt_flag */ st.w r12[0], r11 /* Clear rt_thread_switch_interrupt_flag */
stm --sp, r0-r7 /* Push R0-R7 */ stm --sp, r0-r7 /* Push R0-R7 */
......
...@@ -160,7 +160,7 @@ static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buf ...@@ -160,7 +160,7 @@ static rt_size_t rt_serial_write (rt_device_t dev, rt_off_t pos, const void* buf
/* write data directly */ /* write data directly */
while (size) while (size)
{ {
while (usart_write_char(uart->uart_device, (int) *ptr) != USART_SUCCESS); while (usart_bw_write_char(uart->uart_device, (int) *ptr) != USART_SUCCESS);
++ptr; --size; ++ptr; --size;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册