getHip_state_e(hip_state_e value) method for usability

This commit is contained in:
rusefi 2018-05-31 00:23:20 -04:00
parent c7b604a0f6
commit f7ca461c32
4 changed files with 46 additions and 24 deletions

View File

@ -130,7 +130,26 @@ case ZIL_130:
}
return NULL;
}
const char *getTrigger_type_e(trigger_type_e value){
const char *getHip_state_e(hip_state_e value) {
switch (value) {
case NOT_READY:
return "NOT_READY";
case READY_TO_INTEGRATE:
return "READY_TO_INTEGRATE";
case IS_INTEGRATING:
return "IS_INTEGRATING";
case WAITING_FOR_ADC_TO_SKIP:
return "WAITING_FOR_ADC_TO_SKIP";
case WAITING_FOR_RESULT_ADC:
return "WAITING_FOR_RESULT_ADC";
case IS_SENDING_SPI_COMMAND:
return "IS_SENDING_SPI_COMMAND";
}
return NULL;
}
const char *getTrigger_type_e(trigger_type_e value) {
switch(value) {
case Force_4b_trigger_type:
return "Force_4b_trigger_type";

View File

@ -9,6 +9,7 @@
#include "rusefi_enums.h"
const char *getEngine_type_e(engine_type_e value);
const char *getHip_state_e(hip_state_e value);
const char *getTrigger_type_e(trigger_type_e value);
const char *getAdc_channel_mode_e(adc_channel_mode_e value);
const char *getTrigger_value_e(trigger_value_e value);

View File

@ -889,4 +889,29 @@ typedef enum {
Internal_ForceMyEnumIntSize_can_nbc = ENUM_32_BITS,
} can_nbc_e;
typedef enum {
NOT_READY,
/**
* the step after this one is always IS_INTEGRATING
* We only integrate if we have RPM
*/
READY_TO_INTEGRATE,
/**
* the step after this one is always WAITING_FOR_ADC_TO_SKIP
*/
IS_INTEGRATING,
/**
* the step after this one is always WAITING_FOR_RESULT_ADC
*/
WAITING_FOR_ADC_TO_SKIP,
/**
* the step after this one is always IS_SENDING_SPI_COMMAND or READY_TO_INTEGRATE
*/
WAITING_FOR_RESULT_ADC,
/**
* the step after this one is always READY_TO_INTEGRATE
*/
IS_SENDING_SPI_COMMAND,
} hip_state_e;
#endif /* RUSEFI_ENUMS_H_ */

View File

@ -9,29 +9,6 @@
#ifndef HIP9011_H_
#define HIP9011_H_
typedef enum {
NOT_READY,
/**
* the step after this one is always IS_INTEGRATING
*/
READY_TO_INTEGRATE,
/**
* the step after this one is always WAITING_FOR_ADC_TO_SKIP
*/
IS_INTEGRATING,
/**
* the step after this one is always WAITING_FOR_RESULT_ADC
*/
WAITING_FOR_ADC_TO_SKIP,
/**
* the step after this one is always IS_SENDING_SPI_COMMAND or READY_TO_INTEGRATE
*/
WAITING_FOR_RESULT_ADC,
/**
* the step after this one is always READY_TO_INTEGRATE
*/
IS_SENDING_SPI_COMMAND,
} hip_state_e;
// 0b01000000
#define SET_PRESCALER_CMD 0x40