Commit e142b2b7 authored by Peter Jansweijer's avatar Peter Jansweijer

TEMP: some link_sweep debugging and (commented out) test lines

parent 168f5e44
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <ppsi/ppsi.h> #include <ppsi/ppsi.h>
// #include "wrs-constants.h" // #include "wrs-constants.h"
#include "../proto-standard/common-fun.h" #include "../proto-standard/common-fun.h"
#include "board.h"
#if CONFIG_ARCH_IS_WRS #if CONFIG_ARCH_IS_WRS
#include <libwr/shmem.h> #include <libwr/shmem.h>
...@@ -53,6 +54,8 @@ int wrh_servo_init(struct pp_instance *ppi) ...@@ -53,6 +54,8 @@ int wrh_servo_init(struct pp_instance *ppi)
pp_servo_init(ppi); // Initialize the standard servo data pp_servo_init(ppi); // Initialize the standard servo data
pp_printf("lock sweep: %d\n",lock_sweep());
/* shmem lock */ /* shmem lock */
wrs_shm_write(ppsi_head, WRS_SHM_WRITE_BEGIN); wrs_shm_write(ppsi_head, WRS_SHM_WRITE_BEGIN);
...@@ -274,6 +277,14 @@ static int __wrh_servo_update(struct pp_instance *ppi) ...@@ -274,6 +277,14 @@ static int __wrh_servo_update(struct pp_instance *ppi)
break; break;
case WRH_SYNC_NSEC: case WRH_SYNC_NSEC:
// if (lock_sweep()) {
// WRH_OPER()->adjust_counters(0, offset_ticks + s->clock_period_ps);
// setState(ppi,WRH_SYNC_NSEC);
// pp_printf("ls: %d %d\n", offset_ticks, s->clock_period_ps);
// } else {
// WRH_OPER()->adjust_counters(0, offset_ticks);
// setState(ppi,WRH_SYNC_PHASE);
// }
WRH_OPER()->adjust_counters(0, offset_ticks); WRH_OPER()->adjust_counters(0, offset_ticks);
gs->flags |= PP_SERVO_FLAG_WAIT_HW; gs->flags |= PP_SERVO_FLAG_WAIT_HW;
setState(ppi,WRH_SYNC_PHASE); setState(ppi,WRH_SYNC_PHASE);
......
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