![]() |
Speeduino
|
#include "globals.h"#include "engineProtection.h"#include "maths.h"#include "units.h"#include "unit_testing.h"#include "preprocessor.h"#include "decoders.h"| BEGIN_LTO_ALWAYS_INLINE | ( | bool | ) | & |

| BEGIN_LTO_ALWAYS_INLINE | ( | statuses::scheduler_cut_t | ) | & |


| TESTABLE_INLINE_STATIC bool checkAFRLimit | ( | const statuses & | current, |
| const config6 & | page6, | ||
| const config9 & | page9, | ||
| uint32_t | currMillis | ||
| ) |




| TESTABLE_INLINE_STATIC bool checkEngineProtect | ( | statuses & | current, |
| const config4 & | page4, | ||
| const config6 & | page6, | ||
| const config9 & | page9, | ||
| const config10 & | page10, | ||
| uint32_t | currMillis | ||
| ) |


| TESTABLE_INLINE_STATIC bool checkOilPressureLimit | ( | const statuses & | current, |
| const config6 & | page6, | ||
| const config10 & | page10, | ||
| uint32_t | currMillis | ||
| ) |


| uint8_t checkRevLimit | ( | statuses & | current, |
| const config4 & | page4, | ||
| const config6 & | page6, | ||
| const config9 & | page9 | ||
| ) |

| END_LTO_INLINE | ( | ) |


| if | ( | (current.flatShiftingHard==true) &&(current.clutchEngagedRPM< maxAllowedRPM) | ) |

| if | ( | (current.launchingHard==true) &&(page6.lnchHardLim< maxAllowedRPM) | ) |
| if | ( | (page2.hardCutType==HARD_CUT_FULL) &¤t. | hardLimitActive | ) |

| else if | ( | (page2.hardCutType==HARD_CUT_ROLLING) &&(current.RPM >(maxAllowedRPM+(rollingCutTable.axis[0] *10))) | ) |

| if | ( | checkEngineProtect(current, page4, page6, page9, page10) &&(page4.engineProtectMaxRPM< maxAllowedRPM) | ) |
| else if | ( | current. | hardLimitActive | ) |

| if | ( | current.RPM >= | maxAllowedRPM | ) |

| if | ( | current.startRevolutions >=page4. | StgCycles | ) |
|
inlinestatic |


| TESTABLE_STATIC unsigned long afrProtectedActivateTime = 0 |
| TESTABLE_STATIC bool checkAFRLimitActive = false |
|
constexpr |
| TESTABLE_CONSTEXPR table2D_i8_u8_4 rollingCutTable& configPage15 |
| TESTABLE_CONSTEXPR table2D_u8_u8_6 coolantProtectTable& configPage9 |
| return cutState |
| else |
| maxAllowedRPM = checkRevLimit(current, page4, page6, page9) |
| TESTABLE_STATIC uint32_t oilProtEndTime |
| TESTABLE_STATIC uint32_t rollingCutLastRev = 0 |
Tracks whether we're on the same or a different rev for the rolling cut
| TESTABLE_STATIC uint8_t(* rollingCutRandFunc) (void) | ( | void | ) | = random1to100 |