-
Notifications
You must be signed in to change notification settings - Fork 0
/
shared_data.adb
33 lines (28 loc) · 960 Bytes
/
shared_data.adb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package body Shared_Data is
protected body Sensor_Reading is
procedure Set (Meassured_Value : in Float) is
begin
Current_Value := Meassured_Value;
Updated := True;
end Set;
entry Get (Value : out Float) when Updated is
begin
Value := Current_Value;
Updated := False;
end Get;
end Sensor_Reading;
protected body Actuator_Write is
procedure Set (Calculated_Value : in RPM; Motor : in Motor_Direction) is
begin
Current_Value := Calculated_Value;
Current_Motor := Motor;
Updated := True;
end Set;
entry Get (Value : out RPM; Motor : out Motor_Direction) when Updated is
begin
Value := Current_Value;
Motor := Current_Motor;
Updated := False;
end Get;
end Actuator_Write;
end Shared_Data;