auto-sync
This commit is contained in:
parent
444860b2fc
commit
f1207fa292
|
@ -828,6 +828,8 @@ static void setSpiMode(int index, bool mode) {
|
||||||
static void enableOrDisable(const char *param, bool isEnabled) {
|
static void enableOrDisable(const char *param, bool isEnabled) {
|
||||||
if (strEqualCaseInsensitive(param, "fastadc")) {
|
if (strEqualCaseInsensitive(param, "fastadc")) {
|
||||||
boardConfiguration->isFastAdcEnabled = isEnabled;
|
boardConfiguration->isFastAdcEnabled = isEnabled;
|
||||||
|
} else if (strEqualCaseInsensitive(param, "cj125")) {
|
||||||
|
boardConfiguration->isCJ125Enabled = isEnabled;
|
||||||
} else if (strEqualCaseInsensitive(param, "engine_sniffer")) {
|
} else if (strEqualCaseInsensitive(param, "engine_sniffer")) {
|
||||||
engineConfiguration->isEngineChartEnabled = isEnabled;
|
engineConfiguration->isEngineChartEnabled = isEnabled;
|
||||||
} else if (strEqualCaseInsensitive(param, "step1limimter")) {
|
} else if (strEqualCaseInsensitive(param, "step1limimter")) {
|
||||||
|
|
|
@ -21,6 +21,8 @@ static SimplePwm wboHeaderControl;
|
||||||
static OutputPin wboHeaderPin;
|
static OutputPin wboHeaderPin;
|
||||||
static OutputPin cj125Cs;
|
static OutputPin cj125Cs;
|
||||||
|
|
||||||
|
static THD_WORKING_AREA(cjThreadStack, UTILITY_THREAD_STACK_SIZE);
|
||||||
|
|
||||||
// todo: make this configurable
|
// todo: make this configurable
|
||||||
spi_device_e cj125SpiDevice = SPI_DEVICE_2;
|
spi_device_e cj125SpiDevice = SPI_DEVICE_2;
|
||||||
|
|
||||||
|
@ -60,6 +62,25 @@ SPI_CR1_MSTR |
|
||||||
|----------- ENABLE/HOLD - Must be set to 1 to enable
|
|----------- 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) {
|
void initCJ125(void) {
|
||||||
// still a lot to be done here :)
|
// 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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,16 @@
|
||||||
#ifndef HW_LAYER_SENSORS_CJ125_H_
|
#ifndef HW_LAYER_SENSORS_CJ125_H_
|
||||||
#define 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);
|
void initCJ125(void);
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
CJ125_IDLE = 0
|
||||||
|
|
||||||
|
} cj125_state_e;
|
||||||
|
|
||||||
#endif /* HW_LAYER_SENSORS_CJ125_H_ */
|
#endif /* HW_LAYER_SENSORS_CJ125_H_ */
|
||||||
|
|
|
@ -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;
|
static char UNUSED_CCM_SIZE[8500] CCM_OPTIONAL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue