auto-sync

This commit is contained in:
rusEfi 2015-03-19 20:11:55 -05:00
parent 09aeb43a43
commit 055a24df6c
5 changed files with 27 additions and 5 deletions

View File

@ -271,7 +271,9 @@ unsigned_common:
chSequentialStreamPut(chp, (uint8_t)filler);
} while (++width != 0);
}
chSequentialStreamWrite(chp, (uint8_t*)s, i);
if (i > 0) {
chSequentialStreamWrite(chp, (uint8_t*)s, i);
}
s += i;
while (width) {

View File

@ -18,6 +18,15 @@
#define EFI_USE_CCM TRUE
/**
* if you have a 60-2 trigger, or if you just want better performance, you
* probably want EFI_ENABLE_ASSERTS to be FALSE. Also you would probably want to FALSE
* CH_DBG_ENABLE_CHECKS
* CH_DBG_ENABLE_ASSERTS
* CH_DBG_ENABLE_TRACE
* in chconf.h
*
*/
#define EFI_ENABLE_ASSERTS TRUE
#ifndef EFI_ENABLE_ASSERTS

View File

@ -25,7 +25,7 @@ static Logging *logger;
static SimplePwm alternatorControl;
static OutputPin alternatorPin;
static Pid altPid(10, 0, 0, 10, 90);
static Pid altPid(10, 0, 0, 1, 90);
static THD_WORKING_AREA(alternatorControlThreadStack, UTILITY_THREAD_STACK_SIZE);

View File

@ -55,6 +55,18 @@ uint32_t efiStrlen(const char *param) {
return (s - param);
}
char * efiTrim(char *param) {
while (param[0] == ' ') {
param++; // that would skip leading spaces
}
int len = efiStrlen(param);
while (len > 0 && param[len - 1] == ' ') {
param[len - 1] = 0;
len--;
}
return param;
}
bool startsWith(const char *line, const char *prefix) {
uint32_t len = efiStrlen(prefix);
if (efiStrlen(line) < len) {
@ -177,7 +189,6 @@ int efiPow10(int param) {
return 10 * efiPow10(10 - 1);
}
/**
* string to float
* @return NAN in case of invalid string
@ -257,7 +268,7 @@ void printHistogram(Logging *logging, histogram_s *histogram) {
appendMsgPrefix(logging);
appendPrintf(logging, "histogram %s *", histogram->name);
for (int i = 0; i < len; i++)
appendPrintf(logging, "%d ", report[i]);
appendPrintf(logging, "%d ", report[i]);
appendPrintf(logging, "*");
appendMsgPostfix(logging);
scheduleLogging(logging);

View File

@ -35,6 +35,7 @@ extern "C"
{
#endif /* __cplusplus */
char * efiTrim(char *param);
uint32_t efiStrlen(const char *param);
int efiPow10(int param);
bool startsWith(const char *line, const char *prefix);
@ -47,7 +48,6 @@ int atoi(const char *string);
*/
#define cisnan(f) (*(((int*) (&f))) == 0x7FC00000)
int absI(int32_t value);
float absF(float value);
float efiRound(float value, float precision);