summaryrefslogtreecommitdiff
path: root/libcpu/m16c
diff options
context:
space:
mode:
authorWBI\nxf44444 <[email protected]>2022-01-26 01:43:05 +0800
committerWBI\nxf44444 <[email protected]>2022-01-26 01:43:05 +0800
commit8b0f50b7e211ee32ab08ba085ecd74588c3a3c63 (patch)
tree75440be5ecd30cc1403a9387851c0530ed057981 /libcpu/m16c
parent3be35fecae513b07c35bd6f3992bf7824434bdd6 (diff)
parent32a5668593c578b85560338c29d76f3a252c8dbc (diff)
Update i2c driver, add read ACK and BUS status check
Diffstat (limited to 'libcpu/m16c')
-rw-r--r--libcpu/m16c/m16c62p/context_gcc.S18
-rw-r--r--libcpu/m16c/m16c62p/context_iar.S10
-rw-r--r--libcpu/m16c/m16c62p/context_iar.asm10
-rw-r--r--libcpu/m16c/m16c62p/cpuport.c2
4 files changed, 20 insertions, 20 deletions
diff --git a/libcpu/m16c/m16c62p/context_gcc.S b/libcpu/m16c/m16c62p/context_gcc.S
index 45a2080800..0f131a922d 100644
--- a/libcpu/m16c/m16c62p/context_gcc.S
+++ b/libcpu/m16c/m16c62p/context_gcc.S
@@ -11,32 +11,32 @@
* Date Author Notes
* 2010-04-09 fify the first version
* 2010-04-19 fify rewrite rt_hw_interrupt_disable/enable fuction
- * 2010-04-20 fify move peripheral ISR to bsp/interrupts.s34
+ * 2010-04-20 fify move peripheral ISR to bsp/interrupts.s34
*/
.section .text
-
+
.globl _rt_interrupt_from_thread
.globl _rt_interrupt_to_thread
- .global _os_context_switch
- .type _os_context_switch, @function
+ .global _os_context_switch
+ .type _os_context_switch, @function
_os_context_switch:
PUSHM R0,R1,R2,R3,A0,A1,SB,FB
-
+
MOV.W _rt_interrupt_from_thread, A0
STC ISP, [A0]
MOV.W _rt_interrupt_to_thread, A0
LDC [A0], ISP
POPM R0,R1,R2,R3,A0,A1,SB,FB ; Restore registers from the new task's stack
- REIT ; Return from interrup
-
+ REIT ; Return from interrup
+
/*
* void rt_hw_context_switch_to(rt_uint32 to);
* this fucntion is used to perform the first thread switch
*/
- .global _rt_hw_context_switch_to
- .type _rt_hw_context_switch_to, @function
+ .global _rt_hw_context_switch_to
+ .type _rt_hw_context_switch_to, @function
_rt_hw_context_switch_to:
ENTER #0x0
MOV.W 0x5[FB], A0
diff --git a/libcpu/m16c/m16c62p/context_iar.S b/libcpu/m16c/m16c62p/context_iar.S
index 9415b2bdea..ada3bd4c28 100644
--- a/libcpu/m16c/m16c62p/context_iar.S
+++ b/libcpu/m16c/m16c62p/context_iar.S
@@ -11,7 +11,7 @@
* Date Author Notes
* 2010-04-09 fify the first version
* 2010-04-19 fify rewrite rt_hw_interrupt_disable/enable fuction
- * 2010-04-20 fify move peripheral ISR to bsp/interrupts.s34
+ * 2010-04-20 fify move peripheral ISR to bsp/interrupts.s34
*
* For : Renesas M16C
* Toolchain : IAR's EW for M16C v3.401
@@ -39,19 +39,19 @@ rt_hw_interrupt_disable:
rt_hw_interrupt_enable:
LDC R0, FLG ;fify 20100419
RTS
-
+
.EVEN
os_context_switch:
PUSHM R0,R1,R2,R3,A0,A1,SB,FB
-
+
MOV.W rt_interrupt_from_thread, A0
STC ISP, [A0]
MOV.W rt_interrupt_to_thread, A0
LDC [A0], ISP
POPM R0,R1,R2,R3,A0,A1,SB,FB ; Restore registers from the new task's stack
- REIT ; Return from interrup
-
+ REIT ; Return from interrup
+
/*
* void rt_hw_context_switch_to(rt_uint32 to);
* r0 --> to
diff --git a/libcpu/m16c/m16c62p/context_iar.asm b/libcpu/m16c/m16c62p/context_iar.asm
index 9415b2bdea..ada3bd4c28 100644
--- a/libcpu/m16c/m16c62p/context_iar.asm
+++ b/libcpu/m16c/m16c62p/context_iar.asm
@@ -11,7 +11,7 @@
* Date Author Notes
* 2010-04-09 fify the first version
* 2010-04-19 fify rewrite rt_hw_interrupt_disable/enable fuction
- * 2010-04-20 fify move peripheral ISR to bsp/interrupts.s34
+ * 2010-04-20 fify move peripheral ISR to bsp/interrupts.s34
*
* For : Renesas M16C
* Toolchain : IAR's EW for M16C v3.401
@@ -39,19 +39,19 @@ rt_hw_interrupt_disable:
rt_hw_interrupt_enable:
LDC R0, FLG ;fify 20100419
RTS
-
+
.EVEN
os_context_switch:
PUSHM R0,R1,R2,R3,A0,A1,SB,FB
-
+
MOV.W rt_interrupt_from_thread, A0
STC ISP, [A0]
MOV.W rt_interrupt_to_thread, A0
LDC [A0], ISP
POPM R0,R1,R2,R3,A0,A1,SB,FB ; Restore registers from the new task's stack
- REIT ; Return from interrup
-
+ REIT ; Return from interrup
+
/*
* void rt_hw_context_switch_to(rt_uint32 to);
* r0 --> to
diff --git a/libcpu/m16c/m16c62p/cpuport.c b/libcpu/m16c/m16c62p/cpuport.c
index c66f73b727..8f9a50d89a 100644
--- a/libcpu/m16c/m16c62p/cpuport.c
+++ b/libcpu/m16c/m16c62p/cpuport.c
@@ -113,4 +113,4 @@ void rt_hw_interrupt_enable(rt_base_t level)
temp = level & 0xffff;
asm("LDC %0, FLG": :"r" (temp));
}
-#endif \ No newline at end of file
+#endif