Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
756f9d6b
Commit
756f9d6b
authored
Feb 26, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arch-spec: removed unused source files
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
54bcd48a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
147 deletions
+0
-147
main-loop.c
arch-spec/main-loop.c
+0
-68
spec-startup.c
arch-spec/spec-startup.c
+0
-79
No files found.
arch-spec/main-loop.c
deleted
100644 → 0
View file @
54bcd48a
/*
* Alessandro Rubini for CERN, 2011 -- GNU LGPL v2.1 or later
*/
/*
* This is the main loop for the Spec board
*/
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
#include <syscon.h>
#include "spec.h"
void
spec_main_loop
(
struct
pp_instance
*
ppi
)
{
int
i
,
delay_ms
;
const
int
eth_ofst
=
sizeof
(
struct
spec_ethhdr
);
/*pp_diag_verbosity = 1;*/
/* SPEC is raw ethernet by default */
NP
(
ppi
)
->
proto_ofst
=
eth_ofst
;
/* FIXME now it is end-to-end mode by default */
OPTS
(
ppi
)
->
e2e_mode
=
1
;
/*
* The main loop here is polling every ms. While we are not
* doing anything else but the protocol, this allows extra stuff
* to fit.
*/
delay_ms
=
pp_state_machine
(
ppi
,
NULL
,
0
);
while
(
1
)
{
unsigned
char
_packet
[
1500
];
/* FIXME Alignment */
unsigned
char
*
packet
=
_packet
+
2
;
/* Wait for a packet or for the timeout */
while
(
delay_ms
&&
!
minic_poll_rx
())
{
timer_delay
(
1
);
delay_ms
--
;
}
if
(
!
minic_poll_rx
())
{
delay_ms
=
pp_state_machine
(
ppi
,
NULL
,
0
);
continue
;
}
/*
* We got a packet. If it's not ours, continue consuming
* the pending timeout
*/
i
=
spec_recv_packet
(
ppi
,
packet
,
sizeof
(
_packet
),
&
ppi
->
last_rcv_time
);
if
(
0
)
{
int
j
;
pp_printf
(
"recvd: %i
\n
"
,
i
);
for
(
j
=
0
;
j
<
i
-
eth_ofst
;
j
++
)
{
pp_printf
(
"%02x "
,
packet
[
j
+
eth_ofst
]);
if
(
(
j
+
1
)
%
16
==
0
)
pp_printf
(
"
\n
"
);
}
pp_printf
(
"
\n
"
);
}
/* Warning: PP_ETHERTYPE is endian-agnostic by design */
if
(((
struct
spec_ethhdr
*
)
packet
)
->
h_proto
!=
htons
(
PP_ETHERTYPE
))
continue
;
delay_ms
=
pp_state_machine
(
ppi
,
packet
+
eth_ofst
,
i
-
eth_ofst
);
}
pp_printf
(
"OUT MAIN LOOP
\n
"
);
}
arch-spec/spec-startup.c
deleted
100644 → 0
View file @
54bcd48a
/*
* Alessandro Rubini for CERN, 2011 -- GNU LGPL v2.1 or later
*/
#include <syscon.h>
#include <uart.h>
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
#include "../proto-ext-whiterabbit/wr-api.h"
/* FIXME: ugly */
#include "spec.h"
static
struct
pp_instance
ppi_static
;
/*ppi fields*/
static
UInteger16
sent_seq_id
[
16
];
static
DSDefault
defaultDS
;
static
DSCurrent
currentDS
;
static
DSParent
parentDS
;
static
DSPort
portDS
;
static
DSTimeProperties
timePropertiesDS
;
static
struct
pp_net_path
net_path
;
static
struct
pp_servo
servo
;
static
struct
pp_frgn_master
frgn_master
;
/* Calibration data (should be read from EEPROM, if available) */
#ifdef PPSI_MASTER
int32_t
sfp_alpha
=
-
73622176
;
#else
int32_t
sfp_alpha
=
73622176
;
#endif
int32_t
sfp_deltaTx
=
0
;
int32_t
sfp_deltaRx
=
0
;
uint32_t
cal_phase_transition
=
595
;
/* 7000 */
void
ppsi_main
(
void
)
{
struct
pp_instance
*
ppi
=
&
ppi_static
;
/* no malloc, one instance */
sdb_find_devices
();
uart_init
();
pp_puts
(
"Spec: starting. Compiled on "
__DATE__
"
\n
"
);
/* leds are off and button is input */
//gpio_dir(GPIO_PIN_BTN1, 0);
//gpio_dir(GPIO_PIN_LED_LINK, 1);
//gpio_dir(GPIO_PIN_LED_STATUS, 1);
ppi
->
sent_seq_id
=
sent_seq_id
;
ppi
->
defaultDS
=
&
defaultDS
;
ppi
->
currentDS
=
&
currentDS
;
ppi
->
parentDS
=
&
parentDS
;
ppi
->
portDS
=
&
portDS
;
ppi
->
timePropertiesDS
=
&
timePropertiesDS
;
ppi
->
net_path
=
&
net_path
;
ppi
->
servo
=
&
servo
;
ppi
->
frgn_master
=
&
frgn_master
;
ppi
->
arch_data
=
NULL
;
gpio_out
(
GPIO_PIN_LED_LINK
,
0
);
gpio_out
(
GPIO_PIN_LED_STATUS
,
0
);
if
(
spec_open_ch
(
ppi
))
{
pp_diag_error
(
ppi
,
spec_errno
);
pp_diag_fatal
(
ppi
,
"open_ch"
,
""
);
}
pp_open_instance
(
ppi
,
0
/* no opts */
);
#ifdef PPSI_SLAVE
OPTS
(
ppi
)
->
slave_only
=
1
;
DSPOR
(
ppi
)
->
wrConfig
=
WR_S_ONLY
;
#endif
spec_main_loop
(
ppi
);
}
/* Our crt0.S is unchanged: it wants a "main" function, and "_irq_entry" too" */
int
main
(
void
)
__attribute__
((
alias
(
"ppsi_main"
)));
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