Commit 51b5432b authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

wrc_main: cleanup, remove unused stuff

parent aa9d754d
...@@ -66,86 +66,74 @@ static PtpClockDS ptpClockDS; ...@@ -66,86 +66,74 @@ static PtpClockDS ptpClockDS;
volatile int count = 0;
uint32_t tag_prev; //void test_transition()
//{
uint32_t tics_last; //
// int phase = 0;
//
void test_transition() // softpll_enable();
{ // while(!softpll_check_lock()) timer_delay(1000);
//
int phase = 0; // for(;;)
// { struct hw_timestamp hwts;
softpll_enable(); // uint8_t buf_hdr[18], buf[128];
while(!softpll_check_lock()) timer_delay(1000); //
// if(minic_rx_frame(buf_hdr, buf, 128, &hwts) > 0)
for(;;) // {
{ struct hw_timestamp hwts; // printf("phase %d ahead %d\n", phase, hwts.ahead);
uint8_t buf_hdr[18], buf[128]; // phase+=100;
// softpll_set_phase(phase);
if(minic_rx_frame(buf_hdr, buf, 128, &hwts) > 0) // timer_delay(10);
{ // }
printf("phase %d ahead %d\n", phase, hwts.ahead); // }
phase+=100; //}
softpll_set_phase(phase);
timer_delay(10); //int last_btn0;
} //int button_pressed()
} //{
} // int p;
// int btn0 = gpio_in(GPIO_BTN1);
int last_btn0; // p=!btn0 && last_btn0;
// last_btn0 = btn0;
int button_pressed() // return p;
{ //}
int p;
int btn0 = gpio_in(GPIO_BTN1); //void rx_test()
p=!btn0 && last_btn0; //{
last_btn0 = btn0; // uint8_t mac[]= {0x1, 0x1b, 0x19, 0,0,0};
return p; // uint16_t buf[100];
} // wr_socket_t *sock;
// wr_sockaddr_t addr;
int enable_tracking = 1; //
// memcpy(addr.mac, mac, 6);
void rx_test() // addr.ethertype = 0x88f7;
{ //
uint8_t mac[]= {0x1, 0x1b, 0x19, 0,0,0}; // ptpd_netif_init();
uint16_t buf[100]; // sock = ptpd_netif_create_socket(PTPD_SOCK_RAW_ETHERNET, 0, &addr);
wr_socket_t *sock; // mprintf("Sock @ %x\n", sock);
wr_sockaddr_t addr; // wrc_extra_debug = 0;
// for(;;)
memcpy(addr.mac, mac, 6); // {
addr.ethertype = 0x88f7; // update_rx_queues();
// int n = ptpd_netif_recvfrom(sock, &addr, buf, sizeof(buf), NULL);
ptpd_netif_init(); // if(n>0)
sock = ptpd_netif_create_socket(PTPD_SOCK_RAW_ETHERNET, 0, &addr); // {
mprintf("Sock @ %x\n", sock); // uint16_t sum = 0 ,i, rx;
wrc_extra_debug = 0; // rx=n;
for(;;) // n= buf[0];
{ // for(i=1;i<n;i++) sum+=buf[i];
update_rx_queues(); // mprintf("%x %x\n", sum, buf[n]);
int n = ptpd_netif_recvfrom(sock, &addr, buf, sizeof(buf), NULL); // if(sum != buf[n])
if(n>0) // {
{ // mprintf("****************** ERR: rxed %d size %d\n", rx, n);
uint16_t sum = 0 ,i, rx; // }
rx=n; //
n= buf[0]; // }
for(i=1;i<n;i++) sum+=buf[i]; // timer_delay(10);
mprintf("%x %x\n", sum, buf[n]); // mprintf(".");
if(sum != buf[n]) // }
{ //}
mprintf("****************** ERR: rxed %d size %d\n", rx, n);
}
}
timer_delay(10);
mprintf(".");
}
}
void wrc_initialize() void wrc_initialize()
...@@ -291,11 +279,6 @@ extern volatile int irq_cnt; ...@@ -291,11 +279,6 @@ extern volatile int irq_cnt;
int main(void) int main(void)
{ {
int rx, tx;
int link_went_up, link_went_down;
int prev_link_state= 0, link_state;
int16_t ret;
wrc_initialize(); wrc_initialize();
for(;;) for(;;)
...@@ -325,12 +308,9 @@ int main(void) ...@@ -325,12 +308,9 @@ int main(void)
softpll_disable(); softpll_disable();
break; break;
} }
// mprintf(".");
protocol_nonblock(&rtOpts, ptpPortDS); protocol_nonblock(&rtOpts, ptpPortDS);
} }
} }
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