From 0e5a5a62ac9338c092e016e221d46c40819c5286 Mon Sep 17 00:00:00 2001 From: Brian Taylor Date: Fri, 3 Mar 2023 12:48:02 -0800 Subject: [PATCH] 74F550 and 74F551 have only fall delays on the inverters. Use the fall delay for both rise and fall. --- src/frontend/udevices.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/frontend/udevices.c b/src/frontend/udevices.c index fd5fb3335..f3f617b2f 100644 --- a/src/frontend/udevices.c +++ b/src/frontend/udevices.c @@ -2625,6 +2625,7 @@ static char *get_delays_ugate(char *rem) { char *rising, *falling, *delays = NULL; struct timing_data *tdp1, *tdp2; + BOOL has_rising = FALSE, has_falling = FALSE; tdp1 = create_min_typ_max("tplh", rem); estimate_typ(tdp1); @@ -2632,13 +2633,19 @@ static char *get_delays_ugate(char *rem) tdp2 = create_min_typ_max("tphl", rem); estimate_typ(tdp2); falling = get_estimate(tdp2); - if (rising && falling) { - if (strlen(rising) > 0 && strlen(falling) > 0) { + has_rising = (rising && strlen(rising) > 0); + has_falling = (falling && strlen(falling) > 0); + if (has_rising) { + if (has_falling) { delays = tprintf("(inertial_delay=true rise_delay = %s fall_delay = %s)", rising, falling); - } else { - delays = get_zero_rise_fall(); + } else { /* use rising for both rise/fall */ + delays = tprintf("(inertial_delay=true rise_delay = %s fall_delay = %s)", + rising, rising); } + } else if (has_falling) { /* use falling for both rise/fall */ + delays = tprintf("(inertial_delay=true rise_delay = %s fall_delay = %s)", + falling, falling); } else { delays = get_zero_rise_fall(); } @@ -2655,6 +2662,7 @@ static char *get_delays_utgate(char *rem) struct timing_data *tdp3, *tdp4, *tdp5, *tdp6; char *tplz, *tphz, *tpzl, *tpzh, *larger, *larger1, *larger2, *larger3; BOOL use_zdelays = FALSE; + BOOL has_rising = FALSE, has_falling = FALSE; tdp1 = create_min_typ_max("tplh", rem); estimate_typ(tdp1); @@ -2662,14 +2670,16 @@ static char *get_delays_utgate(char *rem) tdp2 = create_min_typ_max("tphl", rem); estimate_typ(tdp2); falling = get_estimate(tdp2); - if (rising && strlen(rising) > 0) { - if (falling && strlen(falling) > 0) { + has_rising = (rising && strlen(rising) > 0); + has_falling = (falling && strlen(falling) > 0); + if (has_rising) { + if (has_falling) { larger = larger_delay(rising, falling); delays = tprintf("(inertial_delay=true delay = %s)", larger); } else { delays = tprintf("(inertial_delay=true delay = %s)", rising); } - } else if (falling && strlen(falling) > 0) { + } else if (has_falling) { delays = tprintf("(inertial_delay=true delay = %s)", falling); } else if (use_zdelays) { /* No lh/hl delays, so try the largest lz/hz/zl/zh delay */