Added Injection time and a phase macro
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "global_state.h"
|
||||
#ifdef DEBUG
|
||||
#include "SEGGER_RTT.h"
|
||||
#define INJECTION_PHASE 0
|
||||
#define DEBUG_LOG(fmt, ...) SEGGER_RTT_printf(0, fmt "\n", ##__VA_ARGS__)
|
||||
#else
|
||||
#define DEBUG_LOG(fmt, ...) \
|
||||
|
||||
@@ -72,6 +72,9 @@ void crankHandler(void *argument) {
|
||||
uint32_t d_spark = d1a * (45 - SPARK_ADVANCE) / 180;
|
||||
uint32_t t_spark = CRANK(0) + d_spark;
|
||||
// TODO: schedule spark
|
||||
} else if (state_g.crank_state == CYCLE_EXHAUST) {
|
||||
uint32_t t_injection = CRANK(0) + (45+INJECTION_PHASE) * (CRANK(4) - CRANK(0)) / 720;
|
||||
//TODO Schedule injection
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user