Skip to content
Snippets Groups Projects
Commit 2148903b authored by Grzegorz Daniluk's avatar Grzegorz Daniluk
Browse files

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

parent 061364a8
No related merge requests found
#ifndef __SHELL_H #ifndef __SHELL_H
#define __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* fromhex(const char* hex, int* v);
const char* fromdec(const char* dec, int* v); const char* fromdec(const char* dec, int* v);
......
...@@ -5,10 +5,8 @@ ...@@ -5,10 +5,8 @@
#include "shell.h" #include "shell.h"
extern int wrc_gui_mode;
int cmd_gui(const char *args[]) int cmd_gui(const char *args[])
{ {
wrc_gui_mode = 1; wrc_ui_mode = UI_GUI_MODE;
return 0; return 0;
} }
\ No newline at end of file
...@@ -14,10 +14,13 @@ ...@@ -14,10 +14,13 @@
//#include "eeprom.h" //#include "eeprom.h"
#include "softpll_ng.h" #include "softpll_ng.h"
#include "onewire.h" #include "onewire.h"
#include "shell.h"
#include "lib/ipv4.h" #include "lib/ipv4.h"
#include "wrc_ptp.h" #include "wrc_ptp.h"
int wrc_ui_mode = 0;
/////////////////////////////////// ///////////////////////////////////
//Calibration data (from EEPROM if available) //Calibration data (from EEPROM if available)
#ifdef WRPC_MASTER #ifdef WRPC_MASTER
...@@ -99,13 +102,12 @@ int wrc_check_link() ...@@ -99,13 +102,12 @@ int wrc_check_link()
} }
int wrc_extra_debug = 0; int wrc_extra_debug = 0;
int wrc_gui_mode = 0;
void wrc_debug_printf(int subsys, const char *fmt, ...) void wrc_debug_printf(int subsys, const char *fmt, ...)
{ {
va_list ap; va_list ap;
if(wrc_gui_mode) return; if(wrc_ui_mode) return;
va_start(ap, fmt); va_start(ap, fmt);
...@@ -122,13 +124,13 @@ int wrc_man_phase = 0; ...@@ -122,13 +124,13 @@ int wrc_man_phase = 0;
static void ui_update() static void ui_update()
{ {
if(wrc_gui_mode) if(wrc_ui_mode == UI_GUI_MODE)
{ {
wrc_mon_gui(); wrc_mon_gui();
if(uart_read_byte() == 27) if(uart_read_byte() == 27)
{ {
shell_init(); shell_init();
wrc_gui_mode = 0; wrc_ui_mode = UI_SHELL_MODE;
} }
} }
else else
...@@ -139,7 +141,7 @@ static void ui_update() ...@@ -139,7 +141,7 @@ static void ui_update()
int main(void) int main(void)
{ {
wrc_extra_debug = 1; wrc_extra_debug = 1;
wrc_gui_mode = 0; wrc_ui_mode = UI_SHELL_MODE;
wrc_initialize(); wrc_initialize();
shell_init(); shell_init();
......
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