auto-sync

This commit is contained in:
rusEfi 2016-07-05 09:01:23 -04:00
parent 13e349635f
commit 0f98b4625c
4 changed files with 37 additions and 16 deletions

View File

@ -31,18 +31,6 @@
static LoggingWithStorage logger("console");
//static char fatalErrorMessage[200];
//void fatal3(char *msg, char *file, int line) {
// strncpy(fatalErrorMessage, msg, sizeof(fatalErrorMessage) - 1);
// fatalErrorMessage[sizeof(fatalErrorMessage) - 1] = 0; // just to be sure
//#if EFI_CUSTOM_PANIC_METHOD
// chDbgPanic3(fatalErrorMessage, file, line);
//#else
// chDbgPanic(fatalErrorMessage);
//#endif
//}
static void myfatal(void) {
chDbgCheck(0, "my fatal");
}

View File

@ -508,6 +508,8 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
// performance optimization
boardConfiguration->sensorChartMode = SC_OFF;
engineConfiguration->storageMode = MS_AUTO;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;

View File

@ -24,6 +24,11 @@
#include "hardware.h"
#include "engine_configuration.h"
#include "status_loop.h"
#include "usb_msd.h"
#include "usb_msd_cfg.h"
EXTERN_ENGINE;
#define LOG_INDEX_FILENAME "index.txt"
#define RUSEFI_LOG_PREFIX "rus"
@ -32,6 +37,12 @@
extern board_configuration_s *boardConfiguration;
static USBDriver *ms_usb_driver = &USBD1;
static USBMassStorageDriver UMSD1;
extern const USBConfig msd_usb_config;
#define PUSHPULLDELAY 500
static THD_WORKING_AREA(mmcThreadStack,UTILITY_THREAD_STACK_SIZE); // MMC monitor thread
@ -278,6 +289,26 @@ static void MMCmount(void) {
return;
}
if (engineConfiguration->storageMode == MS_ALWAYS) {
BaseBlockDevice *bbdp = (BaseBlockDevice*)&MMCD1;
// const usb_msd_driver_state_t msd_driver_state = msdInit(ms_usb_driver, bbdp, &UMSD1, USB_MS_DATA_EP, USB_MSD_INTERFACE_NUMBER);
// UMSD1.chp = NULL;
//
// /*Disconnect the USB Bus*/
// usbDisconnectBus(ms_usb_driver);
// chThdSleepMilliseconds(200);
//
// /*Start the useful functions*/
// msdStart(&UMSD1);
// usbStart(ms_usb_driver, &msd_usb_config);
//
// /*Connect the USB Bus*/
// usbConnectBus(ms_usb_driver);
}
unlockSpi();
// if Ok - mount FS now
memset(&MMC_FS, 0, sizeof(FATFS));
@ -325,9 +356,9 @@ void initMmcCard(void) {
* FYI: SPI does not work with CCM memory, be sure to have main() stack in RAM, not in CCMRAM
*/
// start to initialize MMC/SD
mmcObjectInit(&MMCD1);
mmcStart(&MMCD1, &mmccfg);
// // start to initialize MMC/SD
// mmcObjectInit(&MMCD1);
// mmcStart(&MMCD1, &mmccfg);
chThdCreateStatic(mmcThreadStack, sizeof(mmcThreadStack), LOWPRIO, (tfunc_t) MMCmonThread, NULL);

View File

@ -173,7 +173,7 @@ void runRusEfi(void) {
#if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__)
/**
* This is so early because we want to init logger
* which would be used while finding trigger synch index
* which would be used while finding trigger sync index
* while reading configuration
*/
initTriggerDecoderLogger(&sharedLogger);