Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
9f3bcfa0
Commit
9f3bcfa0
authored
Feb 06, 2014
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
declare global variable for refresh command and monitors in wrc_main where also UI mode is stored
parent
a41d4f11
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
12 deletions
+11
-12
monitor.c
monitor/monitor.c
+3
-3
monitor_ppsi.c
monitor/monitor_ppsi.c
+3
-3
cmd_refresh.c
shell/cmd_refresh.c
+2
-2
wrc_main.c
wrc_main.c
+3
-4
No files found.
monitor/monitor.c
View file @
9f3bcfa0
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "lib/ipv4.h"
#include "lib/ipv4.h"
int
UI_REFRESH_PERIOD
=
TICS_PER_SECOND
;
/* 1 sec */
extern
int
wrc_ui_refperiod
;
#define PRINT64_FACTOR 1000000000
#define PRINT64_FACTOR 1000000000
char
*
print64
(
unsigned
long
long
x
)
char
*
print64
(
unsigned
long
long
x
)
...
@@ -55,7 +55,7 @@ void wrc_mon_gui(void)
...
@@ -55,7 +55,7 @@ void wrc_mon_gui(void)
uint8_t
ip
[
4
];
uint8_t
ip
[
4
];
#endif
#endif
if
(
timer_get_tics
()
-
last
<
UI_REFRESH_PERIOD
)
if
(
timer_get_tics
()
-
last
<
wrc_ui_refperiod
)
return
;
return
;
last
=
timer_get_tics
();
last
=
timer_get_tics
();
...
@@ -200,7 +200,7 @@ int wrc_log_stats(uint8_t onetime)
...
@@ -200,7 +200,7 @@ int wrc_log_stats(uint8_t onetime)
uint64_t
sec
;
uint64_t
sec
;
uint32_t
nsec
;
uint32_t
nsec
;
if
(
!
onetime
&&
timer_get_tics
()
-
last
<
UI_REFRESH_PERIOD
)
if
(
!
onetime
&&
timer_get_tics
()
-
last
<
wrc_ui_refperiod
)
return
0
;
return
0
;
last
=
timer_get_tics
();
last
=
timer_get_tics
();
...
...
monitor/monitor_ppsi.c
View file @
9f3bcfa0
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include "hal_exports.h"
#include "hal_exports.h"
#include "lib/ipv4.h"
#include "lib/ipv4.h"
int
UI_REFRESH_PERIOD
=
TICS_PER_SECOND
;
/* 1 sec */
extern
int
wrc_ui_refperiod
;
struct
ptpdexp_sync_state_t
;
struct
ptpdexp_sync_state_t
;
extern
ptpdexp_sync_state_t
cur_servo_state
;
extern
ptpdexp_sync_state_t
cur_servo_state
;
...
@@ -86,7 +86,7 @@ void wrc_mon_gui(void)
...
@@ -86,7 +86,7 @@ void wrc_mon_gui(void)
uint8_t
ip
[
4
];
uint8_t
ip
[
4
];
#endif
#endif
if
(
timer_get_tics
()
-
last
<
UI_REFRESH_PERIOD
)
if
(
timer_get_tics
()
-
last
<
wrc_ui_refperiod
)
return
;
return
;
last
=
timer_get_tics
();
last
=
timer_get_tics
();
...
@@ -265,7 +265,7 @@ int wrc_log_stats(uint8_t onetime)
...
@@ -265,7 +265,7 @@ int wrc_log_stats(uint8_t onetime)
uint64_t
sec
;
uint64_t
sec
;
uint32_t
nsec
;
uint32_t
nsec
;
if
(
!
onetime
&&
timer_get_tics
()
-
last
<
UI_REFRESH_PERIOD
)
if
(
!
onetime
&&
timer_get_tics
()
-
last
<
wrc_ui_refperiod
)
return
0
;
return
0
;
last
=
timer_get_tics
();
last
=
timer_get_tics
();
...
...
shell/cmd_refresh.c
View file @
9f3bcfa0
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
#include "wrc_ptp.h"
#include "wrc_ptp.h"
#include <syscon.h>
#include <syscon.h>
extern
int
UI_REFRESH_PERIOD
;
extern
int
wrc_ui_refperiod
;
static
int
cmd_refresh
(
const
char
*
args
[])
static
int
cmd_refresh
(
const
char
*
args
[])
{
{
...
@@ -29,7 +29,7 @@ static int cmd_refresh(const char *args[])
...
@@ -29,7 +29,7 @@ static int cmd_refresh(const char *args[])
return
0
;
return
0
;
}
}
UI_REFRESH_PERIOD
=
sec
*
TICS_PER_SECOND
;
wrc_ui_refperiod
=
sec
*
TICS_PER_SECOND
;
mprintf
(
"
\n
"
);
mprintf
(
"
\n
"
);
}
}
...
...
wrc_main.c
View file @
9f3bcfa0
...
@@ -32,10 +32,9 @@
...
@@ -32,10 +32,9 @@
#include "wrc_ptp.h"
#include "wrc_ptp.h"
int
wrc_ui_mode
=
UI_SHELL_MODE
;
int
wrc_ui_mode
=
UI_SHELL_MODE
;
int
wrc_ui_refperiod
=
TICS_PER_SECOND
;
/* 1 sec */
int
wrc_phase_tracking
=
1
;
int
wrc_phase_tracking
=
1
;
extern
int
UI_REFRESH_PERIOD
;
///////////////////////////////////
///////////////////////////////////
//Calibration data (from EEPROM if available)
//Calibration data (from EEPROM if available)
int32_t
sfp_alpha
=
73622176
;
//default values if could not read EEPROM
int32_t
sfp_alpha
=
73622176
;
//default values if could not read EEPROM
...
@@ -144,13 +143,13 @@ static void ui_update()
...
@@ -144,13 +143,13 @@ static void ui_update()
if
(
wrc_ui_mode
==
UI_GUI_MODE
)
{
if
(
wrc_ui_mode
==
UI_GUI_MODE
)
{
wrc_mon_gui
();
wrc_mon_gui
();
if
(
uart_read_byte
()
==
27
||
UI_REFRESH_PERIOD
==
0
)
{
if
(
uart_read_byte
()
==
27
||
wrc_ui_refperiod
==
0
)
{
shell_init
();
shell_init
();
wrc_ui_mode
=
UI_SHELL_MODE
;
wrc_ui_mode
=
UI_SHELL_MODE
;
}
}
}
else
if
(
wrc_ui_mode
==
UI_STAT_MODE
)
{
}
else
if
(
wrc_ui_mode
==
UI_STAT_MODE
)
{
wrc_log_stats
(
0
);
wrc_log_stats
(
0
);
if
(
uart_read_byte
()
==
27
||
UI_REFRESH_PERIOD
==
0
)
{
if
(
uart_read_byte
()
==
27
||
wrc_ui_refperiod
==
0
)
{
shell_init
();
shell_init
();
wrc_ui_mode
=
UI_SHELL_MODE
;
wrc_ui_mode
=
UI_SHELL_MODE
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment