auto-sync

This commit is contained in:
rusEfi 2016-07-25 22:01:42 -04:00
parent 444860b2fc
commit f1207fa292
4 changed files with 38 additions and 2 deletions

View File

@ -828,6 +828,8 @@ static void setSpiMode(int index, bool mode) {
static void enableOrDisable(const char *param, bool isEnabled) {
if (strEqualCaseInsensitive(param, "fastadc")) {
boardConfiguration->isFastAdcEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "cj125")) {
boardConfiguration->isCJ125Enabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "engine_sniffer")) {
engineConfiguration->isEngineChartEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "step1limimter")) {

View File

@ -21,6 +21,8 @@ static SimplePwm wboHeaderControl;
static OutputPin wboHeaderPin;
static OutputPin cj125Cs;
static THD_WORKING_AREA(cjThreadStack, UTILITY_THREAD_STACK_SIZE);
// todo: make this configurable
spi_device_e cj125SpiDevice = SPI_DEVICE_2;
@ -60,6 +62,25 @@ SPI_CR1_MSTR |
|----------- ENABLE/HOLD - Must be set to 1 to enable
***********************************************************************************/
static cj125_state_e state = CJ125_IDLE;
#if defined __GNUC__
__attribute__((noreturn)) static msg_t cjThread(void)
#else
static msg_t cjThread(void)
#endif
{
chRegSetThreadName("cj125");
// while(1) {
// }
}
static void cj125test(void) {
}
void initCJ125(void) {
// still a lot to be done here :)
@ -83,6 +104,11 @@ void initCJ125(void) {
}
addConsoleAction("cj125", cj125test);
chThdCreateStatic(cjThreadStack, sizeof(cjThreadStack), LOWPRIO, (tfunc_t) cjThread, NULL);
}

View File

@ -8,8 +8,16 @@
#ifndef HW_LAYER_SENSORS_CJ125_H_
#define HW_LAYER_SENSORS_CJ125_H_
#define IDENT_REG_RD 0x48 // Read Identity Register
#define IDENT_REG_RD 0x48 // Read Identity Register, decimal 72
#define INIT_REG1_WR 0x56 // Write To Initialization Register 1, decimal 86
#define CJ125_NORMAL 0x89 // 137 decimal
#define CJ125_CALBRT 0x9D // 157 decimal
void initCJ125(void);
typedef enum {
CJ125_IDLE = 0
} cj125_state_e;
#endif /* HW_LAYER_SENSORS_CJ125_H_ */

View File

@ -287,7 +287,7 @@ void firmwareError(const char *errorMsg, ...) {
}
}
static char UNUSED_RAM_SIZE[1900];
static char UNUSED_RAM_SIZE[1100];
static char UNUSED_CCM_SIZE[8500] CCM_OPTIONAL;