GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: vehicle.c Lines: 8 8 100.0 %
Date: 2023-10-04 02:52:31 Branches: 4 4 100.0 %

Line Branch Exec Source
1
#include "calibration.h"
2
#include "vehicle.h"
3
4
10
DriverIntention getDriverIntention(const Vehicle vehicle){
5
6
10
DriverIntention driverIntention = DRIVE_INTENTION_NOTHING;
7
8
10
      if( vehicle.angleBrakePedal > VehicleMinBrakePedal )
9
    {
10
3
        driverIntention = DRIVE_INTENTION_REDUCE_SPEED;
11
    }
12
    else
13
    {
14
7
        if( vehicle.angleAccPedal > VehicleMinAccPedal )
15
        {
16
3
            driverIntention = DRIVE_INTENTION_INCREASE_SPEED;
17
        }
18
        else
19
        {
20
4
            driverIntention = DRIVE_INTENTION_NOTHING;
21
        }
22
    }
23
24
10
    return driverIntention;
25
}