diff --git a/firmware/config/engines/mazda_miata.cpp b/firmware/config/engines/mazda_miata.cpp
index 3dbbae9098..a9b8a0755e 100644
--- a/firmware/config/engines/mazda_miata.cpp
+++ b/firmware/config/engines/mazda_miata.cpp
@@ -208,6 +208,12 @@ static void setMiata1994_common(engine_configuration_s *engineConfiguration, boa
commonMiataNa(engineConfiguration, boardConfiguration);
engineConfiguration->displacement = 1.839;
+ // set_cranking_timing_angle 0
+ engineConfiguration->crankingTimingAngle = 0;
+
+ engineConfiguration->crankingChargeAngle = 70;
+
+
// todo: extract an array16x16 type? extract a method?
for (int k = 0; k < FUEL_LOAD_COUNT; k++) {
for (int r = 0; r < FUEL_RPM_COUNT; r++) {
diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp
index 12300b343d..a055a1f4df 100644
--- a/firmware/controllers/trigger/main_trigger_callback.cpp
+++ b/firmware/controllers/trigger/main_trigger_callback.cpp
@@ -198,7 +198,7 @@ static ALWAYS_INLINE void handleSparkEvent(uint32_t eventIndex, IgnitionEvent *i
}
static ALWAYS_INLINE void handleSpark(uint32_t eventIndex, int rpm, IgnitionEventList *list DECLATE_ENGINE_PARAMETER) {
- if (!isValidRpm(rpm) || !engine->engineConfiguration->isIgnitionEnabled)
+ if (!isValidRpm(rpm) || !engineConfiguration->isIgnitionEnabled)
return; // this might happen for instance in case of a single trigger event after a pause
/**
diff --git a/firmware/controllers/trigger/rpm_calculator.cpp b/firmware/controllers/trigger/rpm_calculator.cpp
index 94f55de40f..3b3ecf51b0 100644
--- a/firmware/controllers/trigger/rpm_calculator.cpp
+++ b/firmware/controllers/trigger/rpm_calculator.cpp
@@ -34,8 +34,6 @@ extern WaveChart waveChart;
#include "analog_chart.h"
#endif /* EFI_PROD_CODE */
-#define UNREALISTIC_RPM 30000
-
#define TOP_DEAD_CENTER_MESSAGE "r"
/**
@@ -112,10 +110,6 @@ int RpmCalculator::rpm(void) {
return rpmValue;
}
-bool isValidRpm(int rpm) {
- return rpm > 0 && rpm < UNREALISTIC_RPM;
-}
-
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
bool isCrankingE(Engine *engine) {
int rpm = getRpmE(engine);
diff --git a/firmware/controllers/trigger/rpm_calculator.h b/firmware/controllers/trigger/rpm_calculator.h
index 87a5caf87b..c48cfbccde 100644
--- a/firmware/controllers/trigger/rpm_calculator.h
+++ b/firmware/controllers/trigger/rpm_calculator.h
@@ -18,6 +18,7 @@
#define WC_CRANK3 "c3"
#define NOISY_RPM -1
+#define UNREALISTIC_RPM 30000
#ifdef __cplusplus
@@ -76,7 +77,8 @@ extern "C" {
bool isCranking(void);
int getRevolutionCounter(void);
-bool isValidRpm(int rpm);
+
+#define isValidRpm(rpm) ((rpm) > 0 && (rpm) < UNREALISTIC_RPM)
void addWaveChartEvent(const char *name, const char *msg, const char *msg2);
#ifdef __cplusplus
diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp
index 772b6c8b0a..edbed838a6 100644
--- a/firmware/controllers/trigger/trigger_central.cpp
+++ b/firmware/controllers/trigger/trigger_central.cpp
@@ -78,7 +78,7 @@ int TriggerCentral::getHwEventCounter(int index) {
static char shaft_signal_msg_index[15];
-static void reportEventToWaveChart(trigger_event_e ckpSignalType, int index) {
+static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType, int index) {
itoa10(&shaft_signal_msg_index[1], index);
if (ckpSignalType == SHAFT_PRIMARY_UP) {
addWaveChartEvent(WC_CRANK1, WC_UP, (char*) shaft_signal_msg_index);
diff --git a/firmware/iar/ch.ewp b/firmware/iar/ch.ewp
index b2d0062476..884673089b 100644
--- a/firmware/iar/ch.ewp
+++ b/firmware/iar/ch.ewp
@@ -2299,7 +2299,7 @@
$PROJ_DIR$\..\controllers\sensors\ego.h
- $PROJ_DIR$\..\controllers\sensors\maf.c
+ $PROJ_DIR$\..\controllers\sensors\maf.cpp
$PROJ_DIR$\..\controllers\sensors\maf.h
@@ -2326,7 +2326,7 @@
$PROJ_DIR$\..\controllers\sensors\tps.h
- $PROJ_DIR$\..\controllers\sensors\voltage.c
+ $PROJ_DIR$\..\controllers\sensors\voltage.cpp
$PROJ_DIR$\..\controllers\sensors\voltage.h