-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbscu.adb
40 lines (33 loc) · 877 Bytes
/
bscu.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
34
35
36
37
38
39
40
pragma SPARK_Mode (On);
with alarm, speedo, sensors, brakes, reset;
package body bscu
is
procedure Control_Unit
is
use type sensors.Sensor_Type;
begin
if sensors.Read_Sensor_Majority=Sensors.Enable then
brakes.Enable;
if brakes.enabled and speedo.Read_Speed > speedo.state then
alarm.enable;
end if;
end if;
if sensors.Read_Sensor_Majority = sensors.nosig then
alarm.disable;
brakes.disable;
end if;
--if speedo.read_speed > speedo.state then
--alarm.enable;
-- end if;
if maximum_speed < speedo.state then
alarm.enable;
brakes.enable;
end if;
if alarm.enabled then
brakes.enable;
end if;
if reset.enabled then
alarm.reset_cnt;
end if;
end Control_Unit;
end bscu;