Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sequencer-2-2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
epics-modules
sequencer-2-2
Commits
5caaf707
Commit
5caaf707
authored
14 years ago
by
benjamin.franksen
Browse files
Options
Downloads
Patches
Plain Diff
no actual change, just minor formatting
parent
3996f330
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/seq/seqCommands.c
+21
-22
21 additions, 22 deletions
src/seq/seqCommands.c
with
21 additions
and
22 deletions
src/seq/seqCommands.c
+
21
−
22
View file @
5caaf707
...
@@ -33,11 +33,11 @@ static struct sequencerProgram *seqHead;
...
@@ -33,11 +33,11 @@ static struct sequencerProgram *seqHead;
* This routine is called before multitasking has started, so there's
* This routine is called before multitasking has started, so there's
* no race condition in creating the linked list.
* no race condition in creating the linked list.
*/
*/
epicsShareFunc
void
epicsShareAPI
seqRegisterSequencerProgram
(
struct
seqProgram
*
p
)
epicsShareFunc
void
epicsShareAPI
seqRegisterSequencerProgram
(
struct
seqProgram
*
p
)
{
{
struct
sequencerProgram
*
sp
;
struct
sequencerProgram
*
sp
;
sp
=
(
struct
sequencerProgram
*
)
mallocMustSucceed
(
sizeof
*
sp
,
"seqRegisterSequencerProgram"
);
sp
=
(
struct
sequencerProgram
*
)
mallocMustSucceed
(
sizeof
*
sp
,
"seqRegisterSequencerProgram"
);
sp
->
prog
=
p
;
sp
->
prog
=
p
;
sp
->
next
=
seqHead
;
sp
->
next
=
seqHead
;
seqHead
=
sp
;
seqHead
=
sp
;
...
@@ -46,19 +46,18 @@ epicsShareFunc void epicsShareAPI seqRegisterSequencerProgram (struct seqProgram
...
@@ -46,19 +46,18 @@ epicsShareFunc void epicsShareAPI seqRegisterSequencerProgram (struct seqProgram
/*
/*
* Find a thread by name or ID number
* Find a thread by name or ID number
*/
*/
static
epicsThreadId
static
epicsThreadId
findThread
(
const
char
*
name
)
findThread
(
const
char
*
name
)
{
{
epicsThreadId
id
;
epicsThreadId
id
;
char
*
term
;
char
*
term
;
id
=
(
epicsThreadId
)
strtoul
(
name
,
&
term
,
16
);
id
=
(
epicsThreadId
)
strtoul
(
name
,
&
term
,
16
);
if
((
term
!=
name
)
&&
(
*
term
==
'\0'
))
if
((
term
!=
name
)
&&
(
*
term
==
'\0'
))
return
id
;
return
id
;
id
=
epicsThreadGetId
(
name
);
id
=
epicsThreadGetId
(
name
);
if
(
id
)
if
(
id
)
return
id
;
return
id
;
printf
(
"No such thread.
\n
"
);
printf
(
"No such thread.
\n
"
);
return
NULL
;
return
NULL
;
}
}
...
@@ -76,18 +75,18 @@ static void seqCallFunc(const iocshArgBuf *args)
...
@@ -76,18 +75,18 @@ static void seqCallFunc(const iocshArgBuf *args)
struct
sequencerProgram
*
sp
;
struct
sequencerProgram
*
sp
;
if
(
!
table
)
{
if
(
!
table
)
{
printf
(
"No sequencer specified.
\n
"
);
printf
(
"No sequencer specified.
\n
"
);
return
;
return
;
}
}
if
(
*
table
==
'&'
)
if
(
*
table
==
'&'
)
table
++
;
table
++
;
for
(
sp
=
seqHead
;
sp
!=
NULL
;
sp
=
sp
->
next
)
{
for
(
sp
=
seqHead
;
sp
!=
NULL
;
sp
=
sp
->
next
)
{
if
(
!
strcmp
(
table
,
sp
->
prog
->
pProgName
))
{
if
(
!
strcmp
(
table
,
sp
->
prog
->
pProgName
))
{
seq
(
sp
->
prog
,
macroDef
,
stackSize
);
seq
(
sp
->
prog
,
macroDef
,
stackSize
);
return
;
return
;
}
}
}
}
printf
(
"Can't find sequencer `%s'.
\n
"
,
table
);
printf
(
"Can't find sequencer `%s'.
\n
"
,
table
);
}
}
/* seqShow */
/* seqShow */
...
@@ -100,9 +99,9 @@ static void seqShowCallFunc(const iocshArgBuf *args)
...
@@ -100,9 +99,9 @@ static void seqShowCallFunc(const iocshArgBuf *args)
char
*
name
=
args
[
0
].
sval
;
char
*
name
=
args
[
0
].
sval
;
if
(
name
==
NULL
)
if
(
name
==
NULL
)
seqShow
(
NULL
);
seqShow
(
NULL
);
else
if
((
id
=
findThread
(
name
))
!=
NULL
)
else
if
((
id
=
findThread
(
name
))
!=
NULL
)
seqShow
(
id
);
seqShow
(
id
);
}
}
/* seqQueueShow */
/* seqQueueShow */
...
@@ -114,8 +113,8 @@ static void seqQueueShowCallFunc(const iocshArgBuf *args)
...
@@ -114,8 +113,8 @@ static void seqQueueShowCallFunc(const iocshArgBuf *args)
epicsThreadId
id
;
epicsThreadId
id
;
char
*
name
=
args
[
0
].
sval
;
char
*
name
=
args
[
0
].
sval
;
if
((
name
!=
NULL
)
&&
((
id
=
findThread
(
name
))
!=
NULL
))
if
((
name
!=
NULL
)
&&
((
id
=
findThread
(
name
))
!=
NULL
))
seqQueueShow
(
id
);
seqQueueShow
(
id
);
}
}
/* seqStop */
/* seqStop */
...
@@ -127,8 +126,8 @@ static void seqStopCallFunc(const iocshArgBuf *args)
...
@@ -127,8 +126,8 @@ static void seqStopCallFunc(const iocshArgBuf *args)
epicsThreadId
id
;
epicsThreadId
id
;
char
*
name
=
args
[
0
].
sval
;
char
*
name
=
args
[
0
].
sval
;
if
((
name
!=
NULL
)
&&
((
id
=
findThread
(
name
))
!=
NULL
))
if
((
name
!=
NULL
)
&&
((
id
=
findThread
(
name
))
!=
NULL
))
seqStop
(
id
);
seqStop
(
id
);
}
}
/* seqChanShow */
/* seqChanShow */
...
@@ -142,8 +141,8 @@ static void seqChanShowCallFunc(const iocshArgBuf *args)
...
@@ -142,8 +141,8 @@ static void seqChanShowCallFunc(const iocshArgBuf *args)
char
*
name
=
args
[
0
].
sval
;
char
*
name
=
args
[
0
].
sval
;
char
*
chan
=
args
[
1
].
sval
;
char
*
chan
=
args
[
1
].
sval
;
if
((
name
!=
NULL
)
&&
((
id
=
findThread
(
name
))
!=
NULL
))
if
((
name
!=
NULL
)
&&
((
id
=
findThread
(
name
))
!=
NULL
))
seqChanShow
(
id
,
chan
);
seqChanShow
(
id
,
chan
);
}
}
/* seqcar */
/* seqcar */
...
@@ -152,14 +151,14 @@ static const iocshArg * const seqcarArgs[1] = {&seqcarArg0};
...
@@ -152,14 +151,14 @@ static const iocshArg * const seqcarArgs[1] = {&seqcarArg0};
static
const
iocshFuncDef
seqcarFuncDef
=
{
"seqcar"
,
1
,
seqcarArgs
};
static
const
iocshFuncDef
seqcarFuncDef
=
{
"seqcar"
,
1
,
seqcarArgs
};
static
void
seqcarCallFunc
(
const
iocshArgBuf
*
args
)
static
void
seqcarCallFunc
(
const
iocshArgBuf
*
args
)
{
{
seqcar
(
args
[
0
].
ival
);
seqcar
(
args
[
0
].
ival
);
}
}
/*
/*
* This routine is called before multitasking has started, so there's
* This routine is called before multitasking has started, so there's
* no race condition in the test/set of firstTime.
* no race condition in the test/set of firstTime.
*/
*/
epicsShareFunc
void
epicsShareAPI
seqRegisterSequencerCommands
(
void
)
epicsShareFunc
void
epicsShareAPI
seqRegisterSequencerCommands
(
void
)
{
{
static
int
firstTime
=
1
;
static
int
firstTime
=
1
;
if
(
firstTime
)
{
if
(
firstTime
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment