auto-sync

This commit is contained in:
rusEfi 2014-12-06 22:03:14 -06:00
parent 01f7182787
commit 6a907c84e0
3 changed files with 7 additions and 10 deletions

View File

@ -79,17 +79,17 @@ extern persistent_config_container_s persistentState;
static efitimems_t previousWriteReportMs = 0;
static int ts_serail_ready(void) {
static int ts_serial_ready(void) {
#if EFI_PROD_CODE
if (isSerialOverUart()) {
// TS uses USB when console uses serial
return is_usb_serial_ready();
} else {
// TS uses serial when console uses USB
return TRUE;
return true;
}
#else
return TRUE;
return true;
#endif
}
@ -381,7 +381,7 @@ static msg_t tsThreadEntryPoint(void *arg) {
int wasReady = false;
while (true) {
int isReady = ts_serail_ready();
int isReady = ts_serial_ready();
if (!isReady) {
chThdSleepMilliseconds(10);
wasReady = false;
@ -389,7 +389,7 @@ static msg_t tsThreadEntryPoint(void *arg) {
}
if (!wasReady) {
wasReady = TRUE;
wasReady = true;
// scheduleSimpleMsg(&logger, "ts channel is now ready ", hTimeNow());
}

View File

@ -31,17 +31,14 @@ void usb_serial_start(void) {
* after a reset.
*/
usbDisconnectBus(serusbcfg.usbp);
chThdSleepMilliseconds(1000);
chThdSleepMilliseconds(1500);
usbStart(serusbcfg.usbp, &usbcfg);
usbConnectBus(serusbcfg.usbp);
/*
* Activates the serial driver 2 using the driver default configuration.
* PA2(TX) and PA3(RX) are routed to USART2.
*/
sdStart(&SD2, NULL);
palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7));
palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7));
}
bool is_usb_serial_ready(void) {

View File

@ -185,7 +185,7 @@ void runRusEfi(void) {
startStatusThreads(engine);
print("Running main loop\r\n");
main_loop_started = TRUE;
main_loop_started = true;
/**
* This loop is the closes we have to 'main loop' - but here we only publish the status. The main logic of engine
* control is around main_trigger_callback