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); chSequentialStreamPut(chp, (uint8_t)filler);
} while (++width != 0); } while (++width != 0);
} }
if (i > 0) {
chSequentialStreamWrite(chp, (uint8_t*)s, i); chSequentialStreamWrite(chp, (uint8_t*)s, i);
}
s += i; s += i;
while (width) { while (width) {

View File

@ -18,6 +18,15 @@
#define EFI_USE_CCM TRUE #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 #define EFI_ENABLE_ASSERTS TRUE
#ifndef EFI_ENABLE_ASSERTS #ifndef EFI_ENABLE_ASSERTS

View File

@ -25,7 +25,7 @@ static Logging *logger;
static SimplePwm alternatorControl; static SimplePwm alternatorControl;
static OutputPin alternatorPin; 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); static THD_WORKING_AREA(alternatorControlThreadStack, UTILITY_THREAD_STACK_SIZE);

View File

@ -55,6 +55,18 @@ uint32_t efiStrlen(const char *param) {
return (s - 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) { bool startsWith(const char *line, const char *prefix) {
uint32_t len = efiStrlen(prefix); uint32_t len = efiStrlen(prefix);
if (efiStrlen(line) < len) { if (efiStrlen(line) < len) {
@ -177,7 +189,6 @@ int efiPow10(int param) {
return 10 * efiPow10(10 - 1); return 10 * efiPow10(10 - 1);
} }
/** /**
* string to float * string to float
* @return NAN in case of invalid string * @return NAN in case of invalid string

View File

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