Commit dd3ae945 authored by Alessandro Rubini's avatar Alessandro Rubini

softpll: run the PPS pulse as 10ms wide

This is a bigger change than expected, as the width was defined
in two places. So I moved the definition in <wrc.h>, whence everybody
picks it.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent f5fa82e8
......@@ -19,10 +19,6 @@
/* Warning: references to "UTC" in the registers DO NOT MEAN actual UTC time, it's just a plain second counter
It doesn't care about leap seconds. */
/* Default width (in 8ns units) of the pulses on the PPS output */
#define PPS_WIDTH 100000
#define ppsg_write(reg, val) \
*(volatile uint32_t *) (BASE_PPS_GEN + (offsetof(struct PPSG_WB, reg))) = (val)
......
......@@ -24,6 +24,9 @@ void shell_init(void);
int wrc_log_stats(uint8_t onetime);
void wrc_debug_printf(int subsys, const char *fmt, ...);
/* Default width (in 8ns units) of the pulses on the PPS output */
#define PPS_WIDTH (10 * 1000 * 1000 / 8) /* 10ms */
/* This is in the library, somewhere */
extern int abs(int val);
......
......@@ -323,7 +323,7 @@ void spll_init(int mode, int slave_ref_channel, int align_pps)
SPLL->DEGLITCH_THR = 1000;
PPSG->ESCR = 0;
PPSG->CR = PPSG_CR_CNT_EN | PPSG_CR_CNT_RST | PPSG_CR_PWIDTH_W(100);
PPSG->CR = PPSG_CR_CNT_EN | PPSG_CR_CNT_RST | PPSG_CR_PWIDTH_W(PPS_WIDTH);
if(mode == SPLL_MODE_GRAND_MASTER)
{
......
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