2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file console_io.h
|
|
|
|
*
|
|
|
|
* @date Dec 29, 2012
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
#ifndef CONSOLE_IO_H_
|
|
|
|
#define CONSOLE_IO_H_
|
|
|
|
|
2017-03-27 19:46:09 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
typedef void (*CommandHandler)(char *);
|
|
|
|
|
|
|
|
#include "efifeatures.h"
|
|
|
|
#include "datalogging.h"
|
|
|
|
|
2019-04-06 05:41:37 -07:00
|
|
|
#ifdef CONFIG_RESET_SWITCH_PORT
|
2019-04-11 19:15:06 -07:00
|
|
|
// this pin is not configurable at runtime so that we have a reliable way to reset configuration
|
2019-04-08 08:57:16 -07:00
|
|
|
#define SHOULD_INGORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
|
2019-04-06 05:41:37 -07:00
|
|
|
#else
|
|
|
|
#define SHOULD_INGORE_FLASH() (false)
|
|
|
|
#endif
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2017-05-23 10:10:43 -07:00
|
|
|
BaseChannel * getConsoleChannel(void);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
void consolePutChar(int x);
|
|
|
|
void consoleOutputBuffer(const uint8_t *buf, int size);
|
|
|
|
void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p);
|
2016-02-13 18:02:14 -08:00
|
|
|
void onDataArrived(void);
|
2019-04-01 11:18:21 -07:00
|
|
|
bool isUsbSerial(BaseChannel * channel);
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
#if EFI_PROD_CODE || EFI_SIMULATOR || EFI_EGT
|
2017-01-05 01:03:02 -08:00
|
|
|
bool isCommandLineConsoleReady(void);
|
2015-07-10 06:01:56 -07:00
|
|
|
#else
|
2017-01-05 01:03:02 -08:00
|
|
|
#define isCommandLineConsoleReady() true
|
2015-07-10 06:01:56 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* CONSOLE_IO_H_ */
|