auto-sync
This commit is contained in:
parent
f7e8f1f567
commit
b3bb926ee8
|
@ -14,6 +14,9 @@
|
||||||
#include "flash.h"
|
#include "flash.h"
|
||||||
#include "rusefi.h"
|
#include "rusefi.h"
|
||||||
|
|
||||||
|
// this message is part of console API, see FLASH_SUCCESS_MSG in java code
|
||||||
|
#define FLASH_SUCCESS_MSG "FLASH_SUCESS"
|
||||||
|
|
||||||
#if EFI_TUNER_STUDIO || defined(__DOXYGEN__)
|
#if EFI_TUNER_STUDIO || defined(__DOXYGEN__)
|
||||||
#include "tunerstudio.h"
|
#include "tunerstudio.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -67,15 +70,20 @@ void writeToFlashNow(void) {
|
||||||
persistentState.size = PERSISTENT_SIZE;
|
persistentState.size = PERSISTENT_SIZE;
|
||||||
persistentState.version = FLASH_DATA_VERSION;
|
persistentState.version = FLASH_DATA_VERSION;
|
||||||
scheduleMsg(logger, "flash compatible with %d", persistentState.version);
|
scheduleMsg(logger, "flash compatible with %d", persistentState.version);
|
||||||
crc_t result = flashStateCrc(&persistentState);
|
crc_t crcResult = flashStateCrc(&persistentState);
|
||||||
persistentState.value = result;
|
persistentState.value = crcResult;
|
||||||
scheduleMsg(logger, "Reseting flash: size=%d", PERSISTENT_SIZE);
|
scheduleMsg(logger, "Reseting flash: size=%d", PERSISTENT_SIZE);
|
||||||
flashErase(FLASH_ADDR, PERSISTENT_SIZE);
|
flashErase(FLASH_ADDR, PERSISTENT_SIZE);
|
||||||
scheduleMsg(logger, "Flashing with CRC=%d", result);
|
scheduleMsg(logger, "Flashing with CRC=%d", crcResult);
|
||||||
efitimems_t nowMs = currentTimeMillis();
|
efitimems_t nowMs = currentTimeMillis();
|
||||||
result = flashWrite(FLASH_ADDR, (const char *) &persistentState, PERSISTENT_SIZE);
|
int result = flashWrite(FLASH_ADDR, (const char *) &persistentState, PERSISTENT_SIZE);
|
||||||
scheduleMsg(logger, "Flash programmed in (ms): %d", currentTimeMillis() - nowMs);
|
scheduleMsg(logger, "Flash programmed in %dms", currentTimeMillis() - nowMs);
|
||||||
scheduleMsg(logger, "Flashing result: %d", result);
|
bool_t isSuccess = result == FLASH_RETURN_SUCCESS;
|
||||||
|
if (isSuccess) {
|
||||||
|
scheduleMsg(logger, FLASH_SUCCESS_MSG);
|
||||||
|
} else {
|
||||||
|
scheduleMsg(logger, "Flashing failed");
|
||||||
|
}
|
||||||
maxLockTime = 0;
|
maxLockTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -915,7 +915,6 @@ static void printAllInfo(void) {
|
||||||
#endif
|
#endif
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
scheduleMsg(&logger, "console mode jumper: %s", boolToString(!GET_CONSOLE_MODE_VALUE()));
|
scheduleMsg(&logger, "console mode jumper: %s", boolToString(!GET_CONSOLE_MODE_VALUE()));
|
||||||
scheduleMsg(&logger, "board test mode jumper: %s", boolToString(GET_BOARD_TEST_MODE_VALUE()));
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -282,7 +282,12 @@ void initHardware(Logging *l) {
|
||||||
|
|
||||||
mySetPadMode2("board test", boardConfiguration->boardTestModeJumperPin,
|
mySetPadMode2("board test", boardConfiguration->boardTestModeJumperPin,
|
||||||
PAL_MODE_INPUT_PULLUP);
|
PAL_MODE_INPUT_PULLUP);
|
||||||
bool isBoardTestMode_b = GET_BOARD_TEST_MODE_VALUE();
|
bool isBoardTestMode_b = (!palReadPad(getHwPort(boardConfiguration->boardTestModeJumperPin), getHwPin(boardConfiguration->boardTestModeJumperPin)));
|
||||||
|
|
||||||
|
// we can now relese this pin, it is actually used as output sometimes
|
||||||
|
unmarkPin(boardConfiguration->boardTestModeJumperPin);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if HAL_USE_ADC || defined(__DOXYGEN__)
|
#if HAL_USE_ADC || defined(__DOXYGEN__)
|
||||||
initAdcInputs(isBoardTestMode_b);
|
initAdcInputs(isBoardTestMode_b);
|
||||||
|
|
|
@ -41,8 +41,6 @@ brain_pin_e getSckPin(spi_device_e device);
|
||||||
|
|
||||||
#endif /* HAL_USE_SPI */
|
#endif /* HAL_USE_SPI */
|
||||||
|
|
||||||
#define GET_BOARD_TEST_MODE_VALUE() (!palReadPad(getHwPort(boardConfiguration->boardTestModeJumperPin), getHwPin(boardConfiguration->boardTestModeJumperPin)))
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
|
|
|
@ -149,6 +149,9 @@ void initPinRepository(void) {
|
||||||
addConsoleAction("pins", reportPins);
|
addConsoleAction("pins", reportPins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See also unmarkPin()
|
||||||
|
*/
|
||||||
static inline void markUsed(int index, const char *msg) {
|
static inline void markUsed(int index, const char *msg) {
|
||||||
PIN_USED[index] = msg;
|
PIN_USED[index] = msg;
|
||||||
totalPinsUsed++;
|
totalPinsUsed++;
|
||||||
|
|
Loading…
Reference in New Issue