Commit 2148903b authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

move shell.h to include and add defines for running GUI and STAT logs

parent 061364a8
#ifndef __SHELL_H
#define __SHELL_H
#define UI_SHELL_MODE 0
#define UI_GUI_MODE 1
#define UI_STAT_MODE 2
extern int wrc_ui_mode;
const char* fromhex(const char* hex, int* v);
const char* fromdec(const char* dec, int* v);
......
......@@ -5,10 +5,8 @@
#include "shell.h"
extern int wrc_gui_mode;
int cmd_gui(const char *args[])
{
wrc_gui_mode = 1;
wrc_ui_mode = UI_GUI_MODE;
return 0;
}
\ No newline at end of file
}
......@@ -14,10 +14,13 @@
//#include "eeprom.h"
#include "softpll_ng.h"
#include "onewire.h"
#include "shell.h"
#include "lib/ipv4.h"
#include "wrc_ptp.h"
int wrc_ui_mode = 0;
///////////////////////////////////
//Calibration data (from EEPROM if available)
#ifdef WRPC_MASTER
......@@ -99,13 +102,12 @@ int wrc_check_link()
}
int wrc_extra_debug = 0;
int wrc_gui_mode = 0;
void wrc_debug_printf(int subsys, const char *fmt, ...)
{
va_list ap;
if(wrc_gui_mode) return;
if(wrc_ui_mode) return;
va_start(ap, fmt);
......@@ -122,13 +124,13 @@ int wrc_man_phase = 0;
static void ui_update()
{
if(wrc_gui_mode)
if(wrc_ui_mode == UI_GUI_MODE)
{
wrc_mon_gui();
if(uart_read_byte() == 27)
{
shell_init();
wrc_gui_mode = 0;
wrc_ui_mode = UI_SHELL_MODE;
}
}
else
......@@ -139,7 +141,7 @@ static void ui_update()
int main(void)
{
wrc_extra_debug = 1;
wrc_gui_mode = 0;
wrc_ui_mode = UI_SHELL_MODE;
wrc_initialize();
shell_init();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment