-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspeedo.ads
More file actions
39 lines (30 loc) · 867 Bytes
/
speedo.ads
File metadata and controls
39 lines (30 loc) · 867 Bytes
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
-- Author: A. Ireland
--
-- Address: School Mathematical & Computer Sciences
-- Heriot-Watt University
-- Edinburgh, EH14 4AS
--
-- E-mail: a.ireland@hw.ac.uk
--
-- Last modified: 10.9.2022
--
-- Filename: speedo.ads
--
-- Description: Models the speedo device associated with the BSCU.
pragma SPARK_Mode (On);
package Speedo
is
pragma Elaborate_Body;
subtype Speed_Type is Integer range 0..100;
State: Speed_Type;
-- sets speedo state to S
procedure Write_Speed(S: in Speed_Type)
with
Global => (Output => State),
Depends => (State => S);
-- returns speedo state
function Read_Speed return Speed_Type
with
Global => (Input => State),
Depends => (Read_Speed'Result => State);
end Speedo;