summaryrefslogtreecommitdiff
path: root/rs422lib
diff options
context:
space:
mode:
Diffstat (limited to 'rs422lib')
-rw-r--r--rs422lib/main.c11
-rw-r--r--rs422lib/sysctl.c3
2 files changed, 9 insertions, 5 deletions
diff --git a/rs422lib/main.c b/rs422lib/main.c
index 34cb03e..0b1b946 100644
--- a/rs422lib/main.c
+++ b/rs422lib/main.c
@@ -5,6 +5,7 @@
int cnt=0;
int cnt2=0;
+int cnt3=0;
void port_init(void)
{
@@ -22,6 +23,7 @@ void received(unsigned char* str,unsigned int len)
{
SWITCH_STATE(ST_RUN);
cnt2=0;
+ cnt3=0;
STATE(0)=0;
SYSCALL(TEST);
}
@@ -115,10 +117,13 @@ void init_devices(void)
// Clock tick using cycle estimation
void basic_running_ex()
{
- int i;
- for (i=950;i>0;--i)
- delay_ms(1);
+ delay_ms(2);
++cnt2;
+ if (cnt2==250)
+ {
+ ++cnt3;
+ cnt2=0;
+ }
SYSCALL(TEST);
}
diff --git a/rs422lib/sysctl.c b/rs422lib/sysctl.c
index ea05587..11af11b 100644
--- a/rs422lib/sysctl.c
+++ b/rs422lib/sysctl.c
@@ -19,8 +19,7 @@ void sysctl_void()
}
void sysroutine()
-// << Drawback: interrupt may happen between else and CPUOFF
-// Critical section -> unlikely to have a race condition
+// Critical section -> unlikely to have a race condition
{
if (!syscall)
_BIS_SR(CPUOFF);