Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tammo Jan Dijkema
dt_ctrl
Commits
451a3008
Commit
451a3008
authored
Mar 03, 2015
by
Jeroen Vreeken
Browse files
Change and block from il to C.
Add and4 variant. Fix memory allocator alignment, it was to enthousiastic.
parent
c453e032
Changes
4
Hide whitespace changes
Inline
Side-by-side
controller/block/block_and2.il
deleted
100644 → 0
View file @
c453e032
(* A simple and port with 2 inputs *)
PROGRAM and2
VAR_INPUT
a: BOOL;
b: BOOL;
END_VAR
VAR_OUTPUT
q: BOOL;
END_VAR
LD a
AND b
ST q
controller/block/build.mk
View file @
451a3008
...
...
@@ -5,6 +5,7 @@ $(eval $(call SUBDIR,il2c))
BLOCKS
:=
\
add
\
and
\
bridge_pwm
\
command_bool
\
command_float
\
...
...
@@ -49,7 +50,6 @@ BLOCKS := \
oneshot
BLOCKS_IL
:=
\
and2
\
not
\
or2
\
or3
\
...
...
@@ -57,6 +57,10 @@ BLOCKS_IL := \
register
\
setreset
BLOCKS_NO_C
:=
\
and2
\
and4
ifneq
($(OS), FreeBSD)
BLOCKS
+=
\
joystick
...
...
@@ -79,7 +83,7 @@ $(LIBDIR)/libblock.la: libcontroller.la liblog.la
$(LIBDIR)/libblock.la
:
$(BLOCK_OBJS)
$(LIB_LINK)
CTRL_BLOCKS
+=
$(BLOCKS)
$(BLOCKS_IL)
CTRL_BLOCKS
+=
$(BLOCKS)
$(BLOCKS_IL)
$(BLOCKS_NO_C)
CTRL_BLOCK_LIBS
+=
libblock.la
TARGETS
+=
$(BLOCK_TARGETS)
...
...
controller/controller/controller_mem.c
View file @
451a3008
...
...
@@ -91,10 +91,20 @@ void *controller_mem_calloc(int flags, size_t nmemb, size_t size)
return
calloc
(
nmemb
,
size
);
}
#if defined(__x86_64__)
align
=
16
;
#else
align
=
size
&
15
;
if
(
!
align
)
align
=
16
;
switch
(
align
)
{
case
0
:
align
=
16
;
break
;
default:
align
=
8
;
break
;
}
#endif
total
+=
sz
;
if
(
flags
&
CONTROLLER_MEM_PERIODIC_WRITE
)
total_w
+=
sz
;
...
...
controller/dt_ctrl.ctrl
View file @
451a3008
...
...
@@ -35,7 +35,7 @@ import "dt_ctrl_ec_sim.ctrl"
blocks ($(frequency), $(delay)) {
{ "setpoint_generator_3d", "azimuth_spg", "Azimuth_Setpoint", "rad" }
{ "servo_state", "azimuth_servo_state" }
{ "and
2
", "azimuth_safe_and" }
{ "and
4
", "azimuth_safe_and" }
{ "subtract", "azimuth_setpoint_error" }
{ "subtract", "azimuth_error" }
{ "pid_aw", "azimuth_pid" }
...
...
@@ -118,6 +118,8 @@ links {
{ "azimuth_spg", "a", "azimuth_servo_state", "spg_a" , true }
{ "azimuth_position_range", "q", "azimuth_safe_and", "a" , true }
{ "ethercat", "operational","azimuth_safe_and", "b" , true }
{ $<Azimuth_Drive_Safety_p270>, "azimuth_safe_and", "c" , true }
{ $<Azimuth_Drive_Safety_m270>, "azimuth_safe_and", "d" , true }
{ "azimuth_safe_and", "q", "azimuth_servo_state", "safe" , true }
{ "azimuth_recover", "value", "azimuth_servo_state", "override" , true }
{ "azimuth_recover", "value", "azimuth_range_limit", "enable", true }
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment