auto-sync
This commit is contained in:
parent
7cb23afdef
commit
f71b639bbf
|
@ -38,7 +38,7 @@ int lastWriteActual;
|
||||||
|
|
||||||
static bool isSerialConsoleStarted = false;
|
static bool isSerialConsoleStarted = false;
|
||||||
|
|
||||||
static EventListener consoleEventListener;
|
static event_listener_t consoleEventListener;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Reads a whole line from the input channel.
|
* @brief Reads a whole line from the input channel.
|
||||||
|
@ -164,7 +164,7 @@ bool consoleInBinaryMode = false;
|
||||||
ts_channel_s binaryConsole;
|
ts_channel_s binaryConsole;
|
||||||
|
|
||||||
static THD_WORKING_AREA(consoleThreadStack, 3 * UTILITY_THREAD_STACK_SIZE);
|
static THD_WORKING_AREA(consoleThreadStack, 3 * UTILITY_THREAD_STACK_SIZE);
|
||||||
static msg_t consoleThreadThreadEntryPoint(void *arg) {
|
static THD_FUNCTION(consoleThreadThreadEntryPoint, arg) {
|
||||||
(void) arg;
|
(void) arg;
|
||||||
chRegSetThreadName("console thread");
|
chRegSetThreadName("console thread");
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ static msg_t consoleThreadThreadEntryPoint(void *arg) {
|
||||||
binaryConsole.channel = (BaseChannel *) getConsoleChannel();
|
binaryConsole.channel = (BaseChannel *) getConsoleChannel();
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
efiAssert(getRemainingStack(chThdSelf()) > 256, "lowstck#9e", 0);
|
efiAssertVoid(getRemainingStack(chThdSelf()) > 256, "lowstck#9e");
|
||||||
bool end = getConsoleLine((BaseSequentialStream*) getConsoleChannel(), consoleInput, sizeof(consoleInput));
|
bool end = getConsoleLine((BaseSequentialStream*) getConsoleChannel(), consoleInput, sizeof(consoleInput));
|
||||||
if (end) {
|
if (end) {
|
||||||
// firmware simulator is the only case when this happens
|
// firmware simulator is the only case when this happens
|
||||||
|
@ -199,9 +199,6 @@ static msg_t consoleThreadThreadEntryPoint(void *arg) {
|
||||||
runBinaryProtocolLoop(&binaryConsole, true);
|
runBinaryProtocolLoop(&binaryConsole, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined __GNUC__
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void consolePutChar(int x) {
|
void consolePutChar(int x) {
|
||||||
|
@ -250,13 +247,13 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p)
|
||||||
|
|
||||||
isSerialConsoleStarted = true;
|
isSerialConsoleStarted = true;
|
||||||
|
|
||||||
chEvtRegisterMask((EventSource *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1);
|
chEvtRegisterMask((event_source_t *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
is_serial_over_uart = false;
|
is_serial_over_uart = false;
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, consoleThreadThreadEntryPoint, NULL);
|
chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, (tfunc_t)consoleThreadThreadEntryPoint, NULL);
|
||||||
addConsoleAction(SWITCH_TO_BINARY_COMMAND, switchToBinaryProtocol);
|
addConsoleAction(SWITCH_TO_BINARY_COMMAND, switchToBinaryProtocol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,9 @@ static void sayHello(void) {
|
||||||
scheduleMsg(&logger, "*** Chibios Kernel: %s", CH_KERNEL_VERSION);
|
scheduleMsg(&logger, "*** Chibios Kernel: %s", CH_KERNEL_VERSION);
|
||||||
scheduleMsg(&logger, "*** Compiled: " __DATE__ " - " __TIME__ "");
|
scheduleMsg(&logger, "*** Compiled: " __DATE__ " - " __TIME__ "");
|
||||||
scheduleMsg(&logger, "COMPILER=%s", __VERSION__);
|
scheduleMsg(&logger, "COMPILER=%s", __VERSION__);
|
||||||
|
#ifdef CH_FREQUENCY
|
||||||
scheduleMsg(&logger, "CH_FREQUENCY=%d", CH_FREQUENCY);
|
scheduleMsg(&logger, "CH_FREQUENCY=%d", CH_FREQUENCY);
|
||||||
|
#endif
|
||||||
#ifdef SERIAL_SPEED
|
#ifdef SERIAL_SPEED
|
||||||
scheduleMsg(&logger, "SERIAL_SPEED=%d", SERIAL_SPEED);
|
scheduleMsg(&logger, "SERIAL_SPEED=%d", SERIAL_SPEED);
|
||||||
#endif
|
#endif
|
||||||
|
@ -87,7 +89,9 @@ static void sayHello(void) {
|
||||||
scheduleMsg(&logger, "PORT_IDLE_THREAD_STACK_SIZE=%d", PORT_IDLE_THREAD_STACK_SIZE);
|
scheduleMsg(&logger, "PORT_IDLE_THREAD_STACK_SIZE=%d", PORT_IDLE_THREAD_STACK_SIZE);
|
||||||
|
|
||||||
scheduleMsg(&logger, "CH_DBG_ENABLE_ASSERTS=%d", CH_DBG_ENABLE_ASSERTS);
|
scheduleMsg(&logger, "CH_DBG_ENABLE_ASSERTS=%d", CH_DBG_ENABLE_ASSERTS);
|
||||||
|
#ifdef CH_DBG_ENABLED
|
||||||
scheduleMsg(&logger, "CH_DBG_ENABLED=%d", CH_DBG_ENABLED);
|
scheduleMsg(&logger, "CH_DBG_ENABLED=%d", CH_DBG_ENABLED);
|
||||||
|
#endif
|
||||||
scheduleMsg(&logger, "CH_DBG_SYSTEM_STATE_CHECK=%d", CH_DBG_SYSTEM_STATE_CHECK);
|
scheduleMsg(&logger, "CH_DBG_SYSTEM_STATE_CHECK=%d", CH_DBG_SYSTEM_STATE_CHECK);
|
||||||
scheduleMsg(&logger, "CH_DBG_ENABLE_STACK_CHECK=%d", CH_DBG_ENABLE_STACK_CHECK);
|
scheduleMsg(&logger, "CH_DBG_ENABLE_STACK_CHECK=%d", CH_DBG_ENABLE_STACK_CHECK);
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
* integer time in milliseconds
|
* integer time in milliseconds
|
||||||
* 32 bit 4B / 1000 = 4M seconds = 1111.11 hours = 46 days.
|
* 32 bit 4B / 1000 = 4M seconds = 1111.11 hours = 46 days.
|
||||||
* Please restart your ECU every 46 days? :)
|
* Please restart your ECU every 46 days? :)
|
||||||
|
* See getTimeNowUs()
|
||||||
*/
|
*/
|
||||||
typedef uint32_t efitimems_t;
|
typedef uint32_t efitimems_t;
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ void initErrorHandling(void) {
|
||||||
msObjectInit(&warningStream, (uint8_t *) warningBuffer, WARNING_BUFFER_SIZE, 0);
|
msObjectInit(&warningStream, (uint8_t *) warningBuffer, WARNING_BUFFER_SIZE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern VTList vtlist;
|
extern virtual_timers_list_t vtlist;
|
||||||
extern bool main_loop_started;
|
extern bool main_loop_started;
|
||||||
|
|
||||||
int getVtSizeEstimate(void) {
|
int getVtSizeEstimate(void) {
|
||||||
|
|
|
@ -57,6 +57,9 @@ typedef unsigned int time_t;
|
||||||
typedef VirtualTimer virtual_timer_t;
|
typedef VirtualTimer virtual_timer_t;
|
||||||
typedef EventListener event_listener_t;
|
typedef EventListener event_listener_t;
|
||||||
typedef Thread thread_t;
|
typedef Thread thread_t;
|
||||||
|
typedef EventListener event_listener_t;
|
||||||
|
typedef EventSource event_source_t;
|
||||||
|
typedef VTList virtual_timers_list_t;
|
||||||
|
|
||||||
#define THD_WORKING_AREA WORKING_AREA
|
#define THD_WORKING_AREA WORKING_AREA
|
||||||
#define THD_FUNCTION(tname, arg) void tname(void *arg)
|
#define THD_FUNCTION(tname, arg) void tname(void *arg)
|
||||||
|
|
Loading…
Reference in New Issue