The Big Refactoring of 2019: folder structure #723
This commit is contained in:
parent
293b6b30e7
commit
583d189e3b
|
@ -271,7 +271,6 @@ INCDIR = $(CHIBIOS)/os/license \
|
|||
config \
|
||||
ext \
|
||||
ext_algo \
|
||||
util \
|
||||
console_util \
|
||||
console \
|
||||
$(PROJECT_DIR)/console/binary \
|
||||
|
@ -285,6 +284,7 @@ INCDIR = $(CHIBIOS)/os/license \
|
|||
hw_layer/mass_storage \
|
||||
hw_layer/$(CPU_HWLAYER) \
|
||||
$(HW_LAYER_DRIVERS_INC) \
|
||||
$(UTIL_INC) \
|
||||
development \
|
||||
development/hw_layer \
|
||||
development/test \
|
||||
|
|
|
@ -7,19 +7,18 @@
|
|||
|
||||
#include "biquad.h"
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
Biquad::Biquad() {
|
||||
a0 = a1 = a2 = b1 = b2 = 0;
|
||||
z1 = z2 = 0;
|
||||
}
|
||||
|
||||
void Biquad::initValue(float input DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
a0 = engineConfiguration->biQuad.a0;
|
||||
a1 = engineConfiguration->biQuad.a1;
|
||||
a2 = engineConfiguration->biQuad.a2;
|
||||
b1 = engineConfiguration->biQuad.b1;
|
||||
b2 = engineConfiguration->biQuad.b2;
|
||||
// todo: decouple from engine and just use bi_quard_s
|
||||
void Biquad::initValue(float input, bi_quard_s *settings) {
|
||||
a0 = settings->a0;
|
||||
a1 = settings->a1;
|
||||
a2 = settings->a2;
|
||||
b1 = settings->b1;
|
||||
b2 = settings->b2;
|
||||
|
||||
z1 = input * (1 - a0);
|
||||
z2 = input * (1 - a0 - a1 + b1);
|
||||
|
|
|
@ -8,12 +8,14 @@
|
|||
#ifndef CONTROLLERS_MATH_BIQUAD_H_
|
||||
#define CONTROLLERS_MATH_BIQUAD_H_
|
||||
|
||||
#include "engine.h"
|
||||
// todo: narrow this dependency further? only 'bi_quard_s' is needed, should it be extracted / moved to a smaller header?
|
||||
// todo: do we need to make code generation smarted and produce a larger number of smaller headers instead of one monster header?
|
||||
#include "engine_configuration.h"
|
||||
|
||||
class Biquad {
|
||||
public:
|
||||
Biquad();
|
||||
void initValue(float input DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
void initValue(float input, bi_quard_s *settings);
|
||||
float getValue(float input);
|
||||
|
||||
float a0, a1, a2, b1, b2;
|
||||
|
|
|
@ -6,10 +6,6 @@
|
|||
*/
|
||||
|
||||
#include "data_buffer.h"
|
||||
#include "global.h"
|
||||
#if EFI_PROD_CODE
|
||||
//#include "eficonsole.h"
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
int dbIsFull(data_buffer_s *db) {
|
||||
return db->size == DB_MAX_SIZE;
|
|
@ -0,0 +1,3 @@
|
|||
In this folder we have all the tiny utility stuff.
|
||||
|
||||
Ideally, code from this folder should not depend on code from any other folder.
|
|
@ -1,3 +0,0 @@
|
|||
In this folder we have all the tiny utility stuff.
|
||||
|
||||
Ideally, code from this fould should not depend on code from any other folder.
|
|
@ -1,10 +1,11 @@
|
|||
UTIL_DIR=$(PROJECT_DIR)/util
|
||||
|
||||
UTILSRC = $(PROJECT_DIR)/util/crc.c \
|
||||
$(PROJECT_DIR)/util/data_buffer.c \
|
||||
$(PROJECT_DIR)/util/rfiutil.c \
|
||||
$(PROJECT_DIR)/util/histogram.c
|
||||
UTILSRC = $(UTIL_DIR)/crc.c \
|
||||
$(UTIL_DIR)/containers/data_buffer.c \
|
||||
$(UTIL_DIR)/rfiutil.c \
|
||||
$(UTIL_DIR)/histogram.c
|
||||
|
||||
UTILSRC_CPP = $(PROJECT_DIR)/util/cyclic_buffer.cpp \
|
||||
UTILSRC_CPP = $(UTIL_DIR)/cyclic_buffer.cpp \
|
||||
$(PROJECT_DIR)/util/datalogging.cpp \
|
||||
$(PROJECT_DIR)/util/loggingcentral.cpp \
|
||||
$(PROJECT_DIR)/util/listener_array.cpp \
|
||||
|
@ -14,3 +15,8 @@ UTILSRC_CPP = $(PROJECT_DIR)/util/cyclic_buffer.cpp \
|
|||
$(PROJECT_DIR)/util/efilib.cpp \
|
||||
$(PROJECT_DIR)/util/efilib2.cpp \
|
||||
$(PROJECT_DIR)/util/LocalVersionHolder.cpp
|
||||
|
||||
UTIL_INC = \
|
||||
$(UTIL_DIR) \
|
||||
$(UTIL_DIR)/containers \
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ INCDIR = . \
|
|||
$(HALINC) \
|
||||
$(PLATFORMINC) \
|
||||
$(BOARDINC) \
|
||||
$(PROJECT_DIR)/util \
|
||||
$(UTIL_INC) \
|
||||
$(PROJECT_DIR)/console \
|
||||
$(PROJECT_DIR)/console/binary \
|
||||
$(PROJECT_DIR)/console/fl_binary \
|
||||
|
|
|
@ -143,7 +143,7 @@ ASMSRC = $(PORTASM)
|
|||
|
||||
|
||||
INCDIR = . \
|
||||
$(PROJECT_DIR)/util \
|
||||
$(UTIL_INC) \
|
||||
$(PROJECT_DIR)/config/engines \
|
||||
$(PROJECT_DIR)/controllers \
|
||||
$(PROJECT_DIR)/controllers/sensors \
|
||||
|
|
Loading…
Reference in New Issue