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
28
Issues
28
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
4dfb79f6
Commit
4dfb79f6
authored
Apr 14, 2011
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main module for the demo + new Makfeile
parent
8c720d7c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
46 deletions
+34
-46
Makefile
Makefile
+3
-3
wrc_main.c
wrc_main.c
+31
-43
No files found.
Makefile
View file @
4dfb79f6
PLATFORM
=
lm32
OBJS_WRC
=
wrc_main.o dev/uart.o dev/endpoint.o dev/minic.o dev/pps_gen.o dev/timer.o dev/softpll.o lib/mprintf.o
OBJS_WRC
=
wrc_main.o dev/uart.o dev/endpoint.o dev/minic.o dev/pps_gen.o dev/timer.o dev/softpll.o lib/mprintf.o
dev/i2c.o monitor/monitor.o
D
=
ptp
d
-noposix
D
=
ptp-noposix
PTPD_CFLAGS
=
-ffreestanding
-DPTPD_FREESTANDING
-DWRPC_EXTRA_SLIM
-DPTPD_MSBF
-DPTPD_DBG
PTPD_CFLAGS
+=
-Wall
-ggdb
-I
$D
/wrsw_hal
\
-I
$D
/libptpnetif
-I
$D
/PTPWRd
\
...
...
@@ -39,7 +39,7 @@ endif
CC
=
$(CROSS_COMPILE)
gcc
OBJCOPY
=
$(CROSS_COMPILE)
objcopy
OBJDUMP
=
$(CROSS_COMPILE)
objdump
CFLAGS
=
$(CFLAGS_PLATFORM)
-ffunction-sections
-fdata-sections
-Os
-Iinclude
-include
include/trace.h
$(PTPD_CFLAGS)
CFLAGS
=
$(CFLAGS_PLATFORM)
-ffunction-sections
-fdata-sections
-Os
-Iinclude
-include
include/trace.h
$(PTPD_CFLAGS)
-Iptp-noposix
/PTPWRd
LDFLAGS
=
$(LDFLAGS_PLATFORM)
-ffunction-sections
-fdata-sections
-Os
-Iinclude
SIZE
=
$(CROSS_COMPILE)
size
OBJS
=
$(OBJS_PLATFORM)
$(OBJS_WRC)
$(OBJS_PTPD)
$(OBJS_PTPD_FREE)
...
...
wrc_main.c
View file @
4dfb79f6
...
...
@@ -6,8 +6,7 @@
#include "endpoint.h"
#include "minic.h"
#include "pps_gen.h"
#include "ptpd-noposix/PTPWRd/ptpd.h"
//#include "ptpd-noposix/PTPWRd/datatypes.h"
#include "ptpd.h"
...
...
@@ -92,10 +91,21 @@ void test_transition()
timer_delay
(
10
);
}
}
}
int
last_btn0
;
int
button_pressed
()
{
int
p
;
int
btn0
=
gpio_in
(
GPIO_PIN_BTN1
);
p
=!
btn0
&&
last_btn0
;
last_btn0
=
btn0
;
return
p
;
}
int
enable_tracking
=
1
;
int
main
(
void
)
{
int
rx
,
tx
;
...
...
@@ -111,55 +121,33 @@ int main(void)
ep_enable
(
1
,
0
);
mprintf
(
"is link up ?
\n
"
);
while
(
!
ep_link_up
());
mprintf
(
"yes it is
\n
"
);
ep_get_deltas
(
&
tx
,
&
rx
);
mprintf
(
"delta: tx = %d, rx=%d
\n
"
,
tx
,
rx
);
minic_init
();
//minic_disable();
pps_gen_init
();
// test_transition();
netStartup
();
ptpclock
=
ptpdStartup
(
0
,
NULL
,
&
ret
,
&
rtOpts
);
// mi2c_init();
// mi2c_scan();
toState
(
PTP_INITIALIZING
,
&
rtOpts
,
ptpclock
);
for
(;;)
{
//mprintf("\n\n\n");
protocol_nonblock
(
&
rtOpts
,
ptpclock
);
gpio_dir
(
GPIO_PIN_BTN1
,
0
);
update_rx_queues
();
timer_delay
(
10
);
}
ptpclock
=
ptpdStartup
(
0
,
NULL
,
&
ret
,
&
rtOpts
);
toState
(
PTP_INITIALIZING
,
&
rtOpts
,
ptpclock
);
for
(;;)
{
wr_mon_debug
();
if
(
button_pressed
())
{
enable_tracking
=
1
-
enable_tracking
;
wr_servo_enable_tracking
(
enable_tracking
);
}
protocol_nonblock
(
&
rtOpts
,
ptpclock
);
update_rx_queues
();
timer_delay
(
10
);
}
//(unsigned int *)(0x40000) = 0x1;
// *(unsigned int *)(0x40024) = 0x1;
//for(;;)
// {
// struct hw_timestamp hwts;
// uint32_t utc, nsec;
// uint8_t buf[1024];
// memcpy(hdr, dst_mac_addr, 6);
// hdr[12] = 0x88;
// hdr[13] = 0xf7;
//
// minic_tx_frame(hdr, buf, 500, &hwts);
// mprintf("TxTs: utc %d nsec %d\n", hwts.utc, hwts.nsec);
//
// delay(1000000);
// mprintf("cnt:%d\n", count);
// }
}
...
...
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