Skip to content

Commit

Permalink
feat(ethernet/ptp): support for responding to peer delay req
Browse files Browse the repository at this point in the history
respond to peer delay req, and minor cleanup for consistency/readability; tested with Motu AVB switch and receiving syncs from switch which indicates that AVB is happy with peer delay
  • Loading branch information
scrambletools committed Dec 9, 2024
1 parent 2c1ed44 commit b348d98
Show file tree
Hide file tree
Showing 4 changed files with 227 additions and 49 deletions.
2 changes: 2 additions & 0 deletions components/hal/emac_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ esp_err_t emac_hal_ptp_start(emac_hal_context_t *hal, const emac_hal_ptp_config_
{
uint8_t base_increment;

emac_ll_ts_ptp_snap_type_sel(hal->ptp_regs, 1);

// Enable time stamping frame filtering (applicable to receive)
emac_ll_ts_ptp_ether_enable(hal->ptp_regs, true);
// Process frames with v2 format
Expand Down
3 changes: 2 additions & 1 deletion examples/ethernet/ptp/components/ptpd/include/ptpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ struct ptpd_status_s

long drift_ppb;

/* Averaged path delay */
/* Averaged delay */

long path_delay_ns;
long peer_delay_ns;

/* Timestamps of latest received packets (CLOCK_MONOTONIC) */

Expand Down
Loading

0 comments on commit b348d98

Please sign in to comment.