auto-sync
This commit is contained in:
parent
de6d5eb7ca
commit
f0cb558733
|
@ -355,7 +355,7 @@ bit is_enabled_spi_2
|
|||
|
||||
pin_output_mode_e triggerErrorPinMode;
|
||||
|
||||
float idleSolenoidPwm;value between 0 and 1
|
||||
float idleSolenoidPwm;value between 0 and 1;"%", 1, 0, 0, 100, 0
|
||||
brain_pin_e acRelayPin;
|
||||
pin_output_mode_e acRelayPinMode;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated by ConfigDefinition.jar on Sun Mar 22 19:43:39 EDT 2015
|
||||
; this section was generated by ConfigDefinition.jar on Fri Mar 27 21:40:54 EDT 2015
|
||||
|
||||
page = 1
|
||||
engineType = bits, S32, 0, [0:2], "AUDI_AAN", "DODGE_NEON_1995", "FORD_ASPIRE_1996", "FORD_FIESTA", "NISSAN_PRIMERA", "HONDA_ACCORD", "FORD_INLINE_6_1995", "GY6_139QMB"
|
||||
|
@ -308,7 +308,7 @@ page = 1
|
|||
joystickPins5 = bits, U32, 1456, [0:6], "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4", "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9", "GPIOA_10", "GPIOA_11", "GPIOA_12", "GPIOA_13", "GPIOA_14", "GPIOA_15", "GPIOB_0", "GPIOB_1", "GPIOB_2", "GPIOB_3", "GPIOB_4", "GPIOB_5", "GPIOB_6", "GPIOB_7", "GPIOB_8", "GPIOB_9", "GPIOB_10", "GPIOB_11", "GPIOB_12", "GPIOB_13", "GPIOB_14", "GPIOB_15", "GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4", "GPIOC_5", "GPIOC_6", "GPIOC_7", "GPIOC_8", "GPIOC_9", "GPIOC_10", "GPIOC_11", "GPIOC_12", "GPIOC_13", "GPIOC_14", "GPIOC_15", "GPIOD_0", "GPIOD_1", "GPIOD_2", "GPIOD_3", "GPIOD_4", "GPIOD_5", "GPIOD_6", "GPIOD_7", "GPIOD_8", "GPIOD_9", "GPIOD_10", "GPIOD_11", "GPIOD_12", "GPIOD_13", "GPIOD_14", "GPIOD_15", "GPIOE_0", "GPIOE_1", "GPIOE_2", "GPIOE_3", "GPIOE_4", "GPIOE_5", "GPIOE_6", "GPIOE_7", "GPIOE_8", "GPIOE_9", "GPIOE_10", "GPIOE_11", "GPIOE_12", "GPIOE_13", "GPIOE_14", "GPIOE_15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||
triggerErrorPin = bits, U32, 1460, [0:6], "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4", "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9", "GPIOA_10", "GPIOA_11", "GPIOA_12", "GPIOA_13", "GPIOA_14", "GPIOA_15", "GPIOB_0", "GPIOB_1", "GPIOB_2", "GPIOB_3", "GPIOB_4", "GPIOB_5", "GPIOB_6", "GPIOB_7", "GPIOB_8", "GPIOB_9", "GPIOB_10", "GPIOB_11", "GPIOB_12", "GPIOB_13", "GPIOB_14", "GPIOB_15", "GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4", "GPIOC_5", "GPIOC_6", "GPIOC_7", "GPIOC_8", "GPIOC_9", "GPIOC_10", "GPIOC_11", "GPIOC_12", "GPIOC_13", "GPIOC_14", "GPIOC_15", "GPIOD_0", "GPIOD_1", "GPIOD_2", "GPIOD_3", "GPIOD_4", "GPIOD_5", "GPIOD_6", "GPIOD_7", "GPIOD_8", "GPIOD_9", "GPIOD_10", "GPIOD_11", "GPIOD_12", "GPIOD_13", "GPIOD_14", "GPIOD_15", "GPIOE_0", "GPIOE_1", "GPIOE_2", "GPIOE_3", "GPIOE_4", "GPIOE_5", "GPIOE_6", "GPIOE_7", "GPIOE_8", "GPIOE_9", "GPIOE_10", "GPIOE_11", "GPIOE_12", "GPIOE_13", "GPIOE_14", "GPIOE_15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||
triggerErrorPinMode = bits, U32, 1464, [0:1], "default", "default inverted", "open", "open inverted"
|
||||
;skipping idleSolenoidPwm offset 1468
|
||||
idleSolenoidPwm = scalar, F32, 1468, "%", 1, 0, 0, 100, 0
|
||||
acRelayPin = bits, U32, 1472, [0:6], "GPIOA_0", "GPIOA_1", "GPIOA_2", "GPIOA_3", "GPIOA_4", "GPIOA_5", "GPIOA_6", "GPIOA_7", "GPIOA_8", "GPIOA_9", "GPIOA_10", "GPIOA_11", "GPIOA_12", "GPIOA_13", "GPIOA_14", "GPIOA_15", "GPIOB_0", "GPIOB_1", "GPIOB_2", "GPIOB_3", "GPIOB_4", "GPIOB_5", "GPIOB_6", "GPIOB_7", "GPIOB_8", "GPIOB_9", "GPIOB_10", "GPIOB_11", "GPIOB_12", "GPIOB_13", "GPIOB_14", "GPIOB_15", "GPIOC_0", "GPIOC_1", "GPIOC_2", "GPIOC_3", "GPIOC_4", "GPIOC_5", "GPIOC_6", "GPIOC_7", "GPIOC_8", "GPIOC_9", "GPIOC_10", "GPIOC_11", "GPIOC_12", "GPIOC_13", "GPIOC_14", "GPIOC_15", "GPIOD_0", "GPIOD_1", "GPIOD_2", "GPIOD_3", "GPIOD_4", "GPIOD_5", "GPIOD_6", "GPIOD_7", "GPIOD_8", "GPIOD_9", "GPIOD_10", "GPIOD_11", "GPIOD_12", "GPIOD_13", "GPIOD_14", "GPIOD_15", "GPIOE_0", "GPIOE_1", "GPIOE_2", "GPIOE_3", "GPIOE_4", "GPIOE_5", "GPIOE_6", "GPIOE_7", "GPIOE_8", "GPIOE_9", "GPIOE_10", "GPIOE_11", "GPIOE_12", "GPIOE_13", "GPIOE_14", "GPIOE_15", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||
acRelayPinMode = bits, U32, 1476, [0:1], "default", "default inverted", "open", "open inverted"
|
||||
fsioFrequency1 = scalar, U16, 1480, "Hz", 1, 0, 0, 3000, 0
|
||||
|
@ -1112,6 +1112,7 @@ fileVersion = { 20150314 }
|
|||
field = "Idle Valve Pin Mode", idleValvePinMode
|
||||
field = "Idle Valve Pin", idleValvePin
|
||||
field = "Idle Frequency", idleSolenoidFrequency
|
||||
field = "Idle Duty Cycle", idleSolenoidPwm
|
||||
field = ""
|
||||
field = "Fan Pin Mode", fanPinMode
|
||||
field = "Fan Pin", fanPin
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
/**
|
||||
* @file cyclic_buffer.cpp
|
||||
* @brief A cyclic buffer is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end.
|
||||
*
|
||||
* http://en.wikipedia.org/wiki/Circular_buffer
|
||||
*
|
||||
* @date Dec 8, 2013
|
||||
* @author Andrey Belomutskiy, Daniel Hill (c) 2012-2014
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/**
|
||||
* @file cyclic_buffer.h
|
||||
* @brief A cyclic buffer is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end.
|
||||
*
|
||||
* http://en.wikipedia.org/wiki/Circular_buffer
|
||||
*
|
||||
* @date Dec 8, 2013
|
||||
* @author Andrey Belomutskiy, Daniel Hill
|
||||
|
@ -30,15 +33,15 @@ class cyclic_buffer
|
|||
cyclic_buffer& operator=(const cyclic_buffer& rhCb);
|
||||
|
||||
public:
|
||||
void add(int value);
|
||||
void add(T value);
|
||||
int get(int index);
|
||||
int sum(int length);
|
||||
T sum(int length);
|
||||
void setSize(int size);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
void baseC(int size);
|
||||
volatile int elements[CB_MAX_SIZE];
|
||||
volatile T elements[CB_MAX_SIZE];
|
||||
volatile int currentIndex;
|
||||
volatile int count;
|
||||
int size;
|
||||
|
@ -88,7 +91,7 @@ cyclic_buffer<T>::~cyclic_buffer() {
|
|||
//}
|
||||
|
||||
template<typename T>
|
||||
void cyclic_buffer<T>::add(int value) {
|
||||
void cyclic_buffer<T>::add(T value) {
|
||||
++currentIndex;
|
||||
if (currentIndex == size) {
|
||||
currentIndex = 0;
|
||||
|
@ -110,13 +113,13 @@ int cyclic_buffer<T>::get(int index) {
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
int cyclic_buffer<T>::sum(int length) {
|
||||
T cyclic_buffer<T>::sum(int length) {
|
||||
if (length > count) {
|
||||
length = count;
|
||||
}
|
||||
|
||||
int ci = currentIndex; // local copy to increase thread-safety
|
||||
int result = 0;
|
||||
T result = 0;
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
int index = ci - i;
|
||||
|
|
Loading…
Reference in New Issue