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

View File

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

View File

@ -185,7 +185,7 @@ void runRusEfi(void) {
startStatusThreads(engine); startStatusThreads(engine);
print("Running main loop\r\n"); 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 * 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 * control is around main_trigger_callback