Skip to content

Commit

Permalink
stub vvt live data
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Jul 2, 2023
1 parent 406aeae commit d17d902
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
1 change: 1 addition & 0 deletions firmware/console/binary/live_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "knock_controller_generated.h"
#include "fuel_computer.h"
#include "antilag_system_state_generated.h"
#include "vvt_generated.h"

template<>
const output_channels_s* getLiveData(size_t) {
Expand Down
17 changes: 13 additions & 4 deletions firmware/controllers/actuators/vvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

#define NO_PIN_PERIOD 500

#if defined(HAS_OS_ACCESS)
#error "Unexpected OS ACCESS HERE"
#endif /* HAS_OS_ACCESS */

using vvt_map_t = Map3D<SCRIPT_TABLE_8, SCRIPT_TABLE_8, int8_t, uint16_t, uint16_t>;

static vvt_map_t vvtTable1;
Expand Down Expand Up @@ -184,3 +180,16 @@ void initVvtActuators() {
}

#endif

template<>
const vvt_s* getLiveData(size_t idx) {
#if EFI_AUX_PID
if (idx >= efi::size(instances)) {
return nullptr;
}

return &instances[idx];
#else
return nullptr;
#endif
}
3 changes: 2 additions & 1 deletion firmware/controllers/actuators/vvt.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
#include "closed_loop_controller.h"
#include "pwm_generator_logic.h"
#include "efi_pid.h"
#include "vvt_generated.h"

class ValueProvider3D;

void initVvtActuators();
void startVvtControlPins();
void stopVvtControlPins();

class VvtController : public PeriodicTimerController, public ClosedLoopController<angle_t, percent_t> {
class VvtController : public PeriodicTimerController, public ClosedLoopController<angle_t, percent_t>, public vvt_s {
public:
void init(int index, int bankIndex, int camIndex, const ValueProvider3D* targetMap);

Expand Down
3 changes: 3 additions & 0 deletions firmware/controllers/actuators/vvt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
struct_no_prefix vvt_s
int vvt_placeholder
end_struct
6 changes: 5 additions & 1 deletion firmware/integration/LiveData.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,9 @@ Usages:

- name: sent_state
java: SentState.java
folder: controllers/sensors/
folder: controllers/sensors
prepend: integration/rusefi_config_shared.txt

- name: vvt
java: VvtState.java
folder: controllers/actuators

0 comments on commit d17d902

Please sign in to comment.