rusefi-1/firmware/console/console_io.h

44 lines
1008 B
C
Raw Normal View History

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
*/
2020-04-01 16:00:56 -07:00
#pragma once
#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
#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);
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