Annotations in C++ code to produce formulas in rusEfi console #807

This commit is contained in:
rusefi 2019-06-30 09:38:51 -04:00
parent 10b8989dc8
commit ded41e5efe
3 changed files with 28 additions and 5 deletions

View File

@ -0,0 +1,21 @@
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/trigger.txt Sat Jun 29 20:53:25 EDT 2019
// begin
#ifndef CONTROLLERS_GENERATED_TRIGGER_STRUCTS_H
#define CONTROLLERS_GENERATED_TRIGGER_STRUCTS_H
#include "rusefi_types.h"
#define HW_EVENT_TYPES 6
// start of trigger_central_s
struct trigger_central_s {
trigger_central_s();
/**
* offset 0
*/
int hwEventCounters[HW_EVENT_TYPES];
/** total size 24*/
};
typedef struct trigger_central_s trigger_central_s;
#endif
// end
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/trigger.txt Sat Jun 29 20:53:25 EDT 2019

View File

@ -24,7 +24,11 @@
#include "rpm_calculator.h"
TriggerCentral::TriggerCentral() : hwEventCounters() {
trigger_central_s::trigger_central_s() : hwEventCounters() {
}
TriggerCentral::TriggerCentral() : trigger_central_s() {
// we need this initial to have not_running at first invocation
previousShaftEventTimeNt = (efitimems_t) -10 * US2NT(US_PER_SECOND_LL);

View File

@ -11,20 +11,19 @@
#include "rusefi_enums.h"
#include "listener_array.h"
#include "trigger_decoder.h"
#include "trigger_structs.h"
class Engine;
typedef void (*ShaftPositionListener)(trigger_event_e signal, uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX);
#define HAVE_CAM_INPUT() engineConfiguration->camInput != GPIO_UNASSIGNED
#define HW_EVENT_TYPES 6
/**
* Maybe merge TriggerCentral and TriggerState classes into one class?
* Probably not: we have an instance of TriggerState which is used for trigger initialization,
* also composition probably better than inheritance here
*/
class TriggerCentral {
class TriggerCentral : public trigger_central_s {
public:
TriggerCentral();
void addEventListener(ShaftPositionListener handler, const char *name, Engine *engine);
@ -49,7 +48,6 @@ public:
volatile efitime_t previousShaftEventTimeNt;
private:
IntListenerArray<15> triggerListeneres;
int hwEventCounters[HW_EVENT_TYPES];
// Used by 'useNoiselessTriggerDecoder', see handleShaftSignal()
efitick_t lastSignalTimes[HW_EVENT_TYPES];