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

Line Branch Exec Source
1
#include "engine.h"
2
#include "calibration.h"
3
4
10
StateEngine getEngineState(Engine engine) {
5
10
  StateEngine stateEngine = ENGINE_OFF;
6
7
10
  if (engine.rpm == 0) {
8
4
    stateEngine = ENGINE_OFF;
9
  } else {
10
6
    if (engine.rpm >= EngineRPMMaximum) {
11
1
      stateEngine = ENGINE_RPM_MAXIMUM;
12
    } else {
13
5
      stateEngine = ENGINE_WORKING;
14
    }
15
  }
16
10
  return stateEngine;
17
}