diff options
author | Martin Burnicki <martin.burnicki@meinberg.de> | 2023-12-05 21:43:09 +0100 |
---|---|---|
committer | Martin Burnicki <martin.burnicki@meinberg.de> | 2023-12-05 21:43:09 +0100 |
commit | c66de5314faf7f59c339e4287f39259713d7041b (patch) | |
tree | e37861fc024d8530423fec6036bb103d146a3ba0 | |
parent | ebbffa36fe96289be988a1eadef3fd1597a5b651 (diff) | |
download | mbgtools-lx-c66de5314faf7f59c339e4287f39259713d7041b.tar.gz mbgtools-lx-c66de5314faf7f59c339e4287f39259713d7041b.zip |
Update some mbglib files
-rw-r--r-- | mbglib/common/mbgdevio.c | 223 | ||||
-rw-r--r-- | mbglib/common/mbgdevio.h | 103 | ||||
-rw-r--r-- | mbglib/common/mbgerror.h | 22 | ||||
-rw-r--r-- | mbglib/common/pci_asic.h | 10 |
4 files changed, 336 insertions, 22 deletions
diff --git a/mbglib/common/mbgdevio.c b/mbglib/common/mbgdevio.c index b3f7b97..ad31355 100644 --- a/mbglib/common/mbgdevio.c +++ b/mbglib/common/mbgdevio.c @@ -1,7 +1,7 @@ /************************************************************************** * - * $Id: mbgdevio.c 1.59 2023/02/23 10:51:56 martin.burnicki REL_M $ + * $Id: mbgdevio.c 1.60 2023/12/05 20:21:39 martin.burnicki REL_M $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -10,6 +10,9 @@ * * ----------------------------------------------------------------------- * $Log: mbgdevio.c $ + * Revision 1.60 2023/12/05 20:21:39 martin.burnicki + * New functions mbg_set_and_check_gps_ant_cable_len + * and mbg_set_and_check_tr_distance. * Revision 1.59 2023/02/23 10:51:56 martin.burnicki * Fixed a bug in mbg_save_all_irig_rx_settings(), which incorrectly * checked for the presence of a timecode output instead of @@ -6543,9 +6546,13 @@ _MBG_API_ATTR int _MBG_API mbg_get_gps_ant_cable_len( MBG_DEV_HANDLE dh, ANT_CAB * The API call ::mbg_chk_dev_has_cab_len checks whether * this call is supported by a device. * - * @note Different devices may accept different maximum values, so the - * written value should be re-read using ::mbg_get_gps_ant_cable_len - * to check if the parameter has been accepted. + * @note Unfortunately, the maximum value accepted by a device + * may vary depending on the device type and/or firmware version, + * and likewise the device may behave differently when attempting + * to configure a value that exceeds this maximum value. + * The function ::mbg_set_and_check_gps_ant_cable_len checks + * whether the new value was accepted by the device, and therefore + * should be used preferably. * * @param[in] dh Valid ::MBG_DEV_HANDLE handle to a Meinberg device. * @param[out] p Pointer to an ::ANT_CABLE_LEN structure to be written. @@ -6554,6 +6561,7 @@ _MBG_API_ATTR int _MBG_API mbg_get_gps_ant_cable_len( MBG_DEV_HANDLE dh, ANT_CAB * * @see ::mbg_chk_dev_has_cab_len * @see ::mbg_get_gps_ant_cable_len + * @see ::mbg_set_and_check_gps_ant_cable_len */ _MBG_API_ATTR int _MBG_API mbg_set_gps_ant_cable_len( MBG_DEV_HANDLE dh, const ANT_CABLE_LEN *p ) @@ -6575,6 +6583,105 @@ _MBG_API_ATTR int _MBG_API mbg_set_gps_ant_cable_len( MBG_DEV_HANDLE dh, /*HDR*/ /** + * @brief Write and check the GPS antenna cable length. + * + * The antenna cable length parameter is used by GPS/GNSS receivers + * to compensate the propagation delay of the RF signal over the antenna + * cable, which is about 5 ns/m. + * + * The API call ::mbg_chk_dev_has_cab_len checks whether + * this call is supported by a device. + * + * Unfortunately, the maximum value accepted by a device may + * vary depending on the device type and/or firmware version, + * and likewise the device may behave differently when attempting + * to configure a value that exceeds this maximum value: + * + * - Some devices truncate the new value to the maximum value that + * is hard-coded in the firmware, so that the effective value + * corresponds to the maximum value, but neither matches the + * original value, nor the desired new value. This case can only + * be determined if the optional parameter @p p_org_val is provided. + * + * - Some devices simply don't accept and store a value that is + * out of range, so the original value is left unchanged. + * + * @param[in] dh Valid ::MBG_DEV_HANDLE handle to a Meinberg device. + * @param[in,out] p_new_val Pointer to a ::ANT_CABLE_LEN variable to be written. + * @param[in] p_org_val Optional pointer to a ::ANT_CABLE_LEN variable with + * the original value read previously, may be @a NULL. + * + * @return ::MBG_SUCCESS on success, else one of the @ref MBG_ERROR_CODES. + * If the return code is ::MBG_ERR_CFG or ::MBG_ERR_CFG_TRUNC, + * the re-read value is stored in @p p_new_val for convenience. + * + * @see ::mbg_chk_dev_has_cab_len + * @see ::mbg_set_gps_ant_cable_len + * @see ::mbg_get_gps_ant_cable_len + */ +_MBG_API_ATTR int _MBG_API mbg_set_and_check_gps_ant_cable_len( MBG_DEV_HANDLE dh, + ANT_CABLE_LEN *p_new_val, + const ANT_CABLE_LEN *p_org_val ) +{ + ANT_CABLE_LEN re_read_val = 0; + int rc; + + // Write the new value to the device. + rc = mbg_set_gps_ant_cable_len( dh, p_new_val ); + + if ( mbg_rc_is_error( rc ) ) + goto out; + + + // Read back the parameter. + rc = mbg_get_gps_ant_cable_len( dh, &re_read_val ); + + if ( mbg_rc_is_error( rc ) ) + goto out; + + + if ( re_read_val == *p_new_val ) + { + // Saved successfully. + rc = MBG_SUCCESS; + goto out; + } + + + // If execution gets here, the re-read value doesn't match + // the desired new value. Either the original value is unchanged, + // or the device has stored a truncated value. + + // Only if the original value has been provided, we can also check + // whether the re-read value matches the original value, or not. + if ( p_org_val ) + { + if ( re_read_val != *p_org_val ) + { + // The re-read value doesn't match the original value, either, + // so a truncated value has been saved by the device. + rc = MBG_ERR_CFG_TRUNC; + goto out_ret_re_read; + } + } + + // The new value has not been accepted. + rc = MBG_ERR_CFG; + +out_ret_re_read: + // For convenience, we store the re-read value in *p_new_val, + // so it can be made available to the caller. + *p_new_val = re_read_val; + +out: + return rc; + +} // mbg_set_and_check_gps_ant_cable_len + + + +/*HDR*/ +/** * @brief Read the ::RECEIVER_INFO structure from a device. * * The API call ::mbg_chk_dev_has_receiver_info checks @@ -8303,14 +8410,22 @@ _MBG_API_ATTR int _MBG_API mbg_get_tr_distance( MBG_DEV_HANDLE dh, TR_DISTANCE * * The API call ::mbg_chk_dev_has_tr_distance checks whether * this call is supported by a device. * + * @note Unfortunately, the maximum value accepted by a device + * may vary depending on the device type and/or firmware version, + * and likewise the device may behave differently when attempting + * to configure a value that exceeds this maximum value. + * The function ::mbg_set_and_check_tr_distance checks whether + * the new value was accepted by the device, and therefore + * should be used preferably. + * * @param[in] dh Valid ::MBG_DEV_HANDLE handle to a Meinberg device. * @param[in] p Pointer to a ::TR_DISTANCE variable to be written. * * @return ::MBG_SUCCESS on success, else one of the @ref MBG_ERROR_CODES. * - * @see ::mbg_chk_dev_has_pzf * @see ::mbg_chk_dev_has_tr_distance * @see ::mbg_get_tr_distance + * @see ::mbg_set_and_check_tr_distance */ _MBG_API_ATTR int _MBG_API mbg_set_tr_distance( MBG_DEV_HANDLE dh, const TR_DISTANCE *p ) { @@ -8330,6 +8445,104 @@ _MBG_API_ATTR int _MBG_API mbg_set_tr_distance( MBG_DEV_HANDLE dh, const TR_DIST /*HDR*/ /** + * @brief Write and check the configurable "distance from transmitter" parameter. + * + * The distance from transmitter parameter is used to compensate + * the RF propagation delay, usually in long wave receivers. + * + * The API call ::mbg_chk_dev_has_tr_distance checks whether + * this call is supported by a device. + * + * Unfortunately, the maximum value accepted by a device may + * vary depending on the device type and/or firmware version, + * and likewise the device may behave differently when attempting + * to configure a value that exceeds this maximum value: + * + * - Some devices truncate the new value to the maximum value that + * is hard-coded in the firmware, so that the effective value + * corresponds to the maximum value, but neither matches the + * original value, nor the desired new value. This case can only + * be determined if the optional parameter @p p_org_val is provided. + * + * - Some devices simply don't accept and store a value that is + * out of range, so the original value is left unchanged. + * + * @param[in] dh Valid ::MBG_DEV_HANDLE handle to a Meinberg device. + * @param[in,out] p_new_val Pointer to a ::TR_DISTANCE variable to be written. + * @param[in] p_org_val Optional pointer to a ::TR_DISTANCE variable with + * the original value read previously, may be @a NULL. + * + * @return ::MBG_SUCCESS on success, else one of the @ref MBG_ERROR_CODES. + * If the return code is ::MBG_ERR_CFG or ::MBG_ERR_CFG_TRUNC, + * the re-read value is stored in @p p_new_val for convenience. + * + * @see ::mbg_chk_dev_has_tr_distance + * @see ::mbg_set_tr_distance + * @see ::mbg_get_tr_distance + */ +_MBG_API_ATTR int _MBG_API mbg_set_and_check_tr_distance( MBG_DEV_HANDLE dh, + TR_DISTANCE *p_new_val, + const TR_DISTANCE *p_org_val ) +{ + TR_DISTANCE re_read_val = 0; + int rc; + + // Write the new value to the device. + rc = mbg_set_tr_distance( dh, p_new_val ); + + if ( mbg_rc_is_error( rc ) ) + goto out; + + + // Read back the parameter. + rc = mbg_get_tr_distance( dh, &re_read_val ); + + if ( mbg_rc_is_error( rc ) ) + goto out; + + + if ( re_read_val == *p_new_val ) + { + // Saved successfully. + rc = MBG_SUCCESS; + goto out; + } + + + // If execution gets here, the re-read value doesn't match + // the desired new value. Either the original value is unchanged, + // or the device has stored a truncated value. + + // Only if the original value has been provided, we can also check + // whether the re-read value matches the original value, or not. + if ( p_org_val ) + { + if ( re_read_val != *p_org_val ) + { + // The re-read value doesn't match the original value, either, + // so a truncated value has been saved by the device. + rc = MBG_ERR_CFG_TRUNC; + goto out_ret_re_read; + } + } + + // The new value has not been accepted. + rc = MBG_ERR_CFG; + +out_ret_re_read: + // For convenience, we store the re-read value in *p_new_val, + // so it can be made available to the caller. + *p_new_val = re_read_val; + +out: + return rc; + +} // mbg_set_and_check_tr_distance + + + +/*HDR*/ +/** * @brief Read a debug status word from a device. * * This is mainly supported by IRIG timecode receivers, and the status diff --git a/mbglib/common/mbgdevio.h b/mbglib/common/mbgdevio.h index 4af60c2..6b65a3c 100644 --- a/mbglib/common/mbgdevio.h +++ b/mbglib/common/mbgdevio.h @@ -1,7 +1,7 @@ /************************************************************************** * - * $Id: mbgdevio.h 1.66 2023/02/23 10:52:32 martin.burnicki REL_M $ + * $Id: mbgdevio.h 1.67 2023/12/05 20:21:36 martin.burnicki REL_M $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -10,6 +10,9 @@ * * ----------------------------------------------------------------------- * $Log: mbgdevio.h $ + * Revision 1.67 2023/12/05 20:21:36 martin.burnicki + * New functions mbg_set_and_check_gps_ant_cable_len + * and mbg_set_and_check_tr_distance. * Revision 1.66 2023/02/23 10:52:32 martin.burnicki * Updated a doxygen comment. * Revision 1.65 2022/12/21 15:26:48 martin.burnicki @@ -4181,9 +4184,13 @@ typedef int _MBG_API MBG_CHK_SUPP_FNC( MBG_DEV_HANDLE dh ); * The API call ::mbg_chk_dev_has_cab_len checks whether * this call is supported by a device. * - * @note Different devices may accept different maximum values, so the - * written value should be re-read using ::mbg_get_gps_ant_cable_len - * to check if the parameter has been accepted. + * @note Unfortunately, the maximum value accepted by a device + * may vary depending on the device type and/or firmware version, + * and likewise the device may behave differently when attempting + * to configure a value that exceeds this maximum value. + * The function ::mbg_set_and_check_gps_ant_cable_len checks + * whether the new value was accepted by the device, and therefore + * should be used preferably. * * @param[in] dh Valid ::MBG_DEV_HANDLE handle to a Meinberg device. * @param[out] p Pointer to an ::ANT_CABLE_LEN structure to be written. @@ -4192,10 +4199,50 @@ typedef int _MBG_API MBG_CHK_SUPP_FNC( MBG_DEV_HANDLE dh ); * * @see ::mbg_chk_dev_has_cab_len * @see ::mbg_get_gps_ant_cable_len + * @see ::mbg_set_and_check_gps_ant_cable_len */ _MBG_API_ATTR int _MBG_API mbg_set_gps_ant_cable_len( MBG_DEV_HANDLE dh, const ANT_CABLE_LEN *p ) ; /** + * @brief Write and check the GPS antenna cable length. + * + * The antenna cable length parameter is used by GPS/GNSS receivers + * to compensate the propagation delay of the RF signal over the antenna + * cable, which is about 5 ns/m. + * + * The API call ::mbg_chk_dev_has_cab_len checks whether + * this call is supported by a device. + * + * Unfortunately, the maximum value accepted by a device may + * vary depending on the device type and/or firmware version, + * and likewise the device may behave differently when attempting + * to configure a value that exceeds this maximum value: + * + * - Some devices truncate the new value to the maximum value that + * is hard-coded in the firmware, so that the effective value + * corresponds to the maximum value, but neither matches the + * original value, nor the desired new value. This case can only + * be determined if the optional parameter @p p_org_val is provided. + * + * - Some devices simply don't accept and store a value that is + * out of range, so the original value is left unchanged. + * + * @param[in] dh Valid ::MBG_DEV_HANDLE handle to a Meinberg device. + * @param[in,out] p_new_val Pointer to a ::ANT_CABLE_LEN variable to be written. + * @param[in] p_org_val Optional pointer to a ::ANT_CABLE_LEN variable with + * the original value read previously, may be @a NULL. + * + * @return ::MBG_SUCCESS on success, else one of the @ref MBG_ERROR_CODES. + * If the return code is ::MBG_ERR_CFG or ::MBG_ERR_CFG_TRUNC, + * the re-read value is stored in @p p_new_val for convenience. + * + * @see ::mbg_chk_dev_has_cab_len + * @see ::mbg_set_gps_ant_cable_len + * @see ::mbg_get_gps_ant_cable_len + */ + _MBG_API_ATTR int _MBG_API mbg_set_and_check_gps_ant_cable_len( MBG_DEV_HANDLE dh, ANT_CABLE_LEN *p_new_val, const ANT_CABLE_LEN *p_org_val ) ; + + /** * @brief Read the ::RECEIVER_INFO structure from a device. * * The API call ::mbg_chk_dev_has_receiver_info checks @@ -5080,18 +5127,64 @@ typedef int _MBG_API MBG_CHK_SUPP_FNC( MBG_DEV_HANDLE dh ); * The API call ::mbg_chk_dev_has_tr_distance checks whether * this call is supported by a device. * + * @note Unfortunately, the maximum value accepted by a device + * may vary depending on the device type and/or firmware version, + * and likewise the device may behave differently when attempting + * to configure a value that exceeds this maximum value. + * The function ::mbg_set_and_check_tr_distance checks whether + * the new value was accepted by the device, and therefore + * should be used preferably. + * * @param[in] dh Valid ::MBG_DEV_HANDLE handle to a Meinberg device. * @param[in] p Pointer to a ::TR_DISTANCE variable to be written. * * @return ::MBG_SUCCESS on success, else one of the @ref MBG_ERROR_CODES. * - * @see ::mbg_chk_dev_has_pzf * @see ::mbg_chk_dev_has_tr_distance * @see ::mbg_get_tr_distance + * @see ::mbg_set_and_check_tr_distance */ _MBG_API_ATTR int _MBG_API mbg_set_tr_distance( MBG_DEV_HANDLE dh, const TR_DISTANCE *p ) ; /** + * @brief Write and check the configurable "distance from transmitter" parameter. + * + * The distance from transmitter parameter is used to compensate + * the RF propagation delay, usually in long wave receivers. + * + * The API call ::mbg_chk_dev_has_tr_distance checks whether + * this call is supported by a device. + * + * Unfortunately, the maximum value accepted by a device may + * vary depending on the device type and/or firmware version, + * and likewise the device may behave differently when attempting + * to configure a value that exceeds this maximum value: + * + * - Some devices truncate the new value to the maximum value that + * is hard-coded in the firmware, so that the effective value + * corresponds to the maximum value, but neither matches the + * original value, nor the desired new value. This case can only + * be determined if the optional parameter @p p_org_val is provided. + * + * - Some devices simply don't accept and store a value that is + * out of range, so the original value is left unchanged. + * + * @param[in] dh Valid ::MBG_DEV_HANDLE handle to a Meinberg device. + * @param[in,out] p_new_val Pointer to a ::TR_DISTANCE variable to be written. + * @param[in] p_org_val Optional pointer to a ::TR_DISTANCE variable with + * the original value read previously, may be @a NULL. + * + * @return ::MBG_SUCCESS on success, else one of the @ref MBG_ERROR_CODES. + * If the return code is ::MBG_ERR_CFG or ::MBG_ERR_CFG_TRUNC, + * the re-read value is stored in @p p_new_val for convenience. + * + * @see ::mbg_chk_dev_has_tr_distance + * @see ::mbg_set_tr_distance + * @see ::mbg_get_tr_distance + */ + _MBG_API_ATTR int _MBG_API mbg_set_and_check_tr_distance( MBG_DEV_HANDLE dh, TR_DISTANCE *p_new_val, const TR_DISTANCE *p_org_val ) ; + + /** * @brief Read a debug status word from a device. * * This is mainly supported by IRIG timecode receivers, and the status diff --git a/mbglib/common/mbgerror.h b/mbglib/common/mbgerror.h index fe97576..1b90fd6 100644 --- a/mbglib/common/mbgerror.h +++ b/mbglib/common/mbgerror.h @@ -1,7 +1,7 @@ /************************************************************************** * - * $Id: mbgerror.h 1.34 2021/12/01 15:51:25 martin.burnicki REL_M $ + * $Id: mbgerror.h 1.35 2023/12/05 19:59:33 martin REL_M $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -11,6 +11,9 @@ * * ----------------------------------------------------------------------- * $Log: mbgerror.h $ + * Revision 1.35 2023/12/05 19:59:33 martin + * New error code MBG_ERR_CFG_TRUNC. + * Also modified some error strings. * Revision 1.34 2021/12/01 15:51:25 martin.burnicki * New error code MBG_ERR_OP_NOT_SUPP for EOPNOTSUPP and ENOTSUP. * Revision 1.33 2021/11/03 16:57:02 martin.burnicki @@ -434,6 +437,8 @@ extern "C" { #define MBG_ERR_NOT_SUPP_BY_DRVR -124 ///< Requested feature is not supported by the driver #define MBG_ERR_OP_NOT_SUPP -125 ///< Requested operation is not supported +#define MBG_ERR_CFG_TRUNC -126 ///< Configuration parameter was truncated by the device + // NOTE: New codes have to be appended to this list, and the sequence of codes must not // be changed. Whenever new codes have been defined, appropriate entries have to be added // to the ::MBG_ERR_STR_TABLE_ENG table initializer below, and the Windows-specific message @@ -466,7 +471,7 @@ extern "C" { #define MBG_ERR_STR_TABLE_BASE_ENG \ { MBG_SUCCESS, "Success" }, \ { MBG_ERR_STIME, "Invalid date/time for device" }, \ - { MBG_ERR_CFG, "Invalid configuration parameters for device" }, \ + { MBG_ERR_CFG, "Invalid configuration parameter for device" }, \ { MBG_ERR_GENERIC, "Generic error" }, \ { MBG_ERR_TIMEOUT, "Timeout" }, \ { MBG_ERR_FW_ID, "Invalid firmware ID" }, \ @@ -476,7 +481,7 @@ extern "C" { { MBG_ERR_NOT_READY, "Device not ready" }, \ { MBG_ERR_INV_TYPE, "Unsupported data type" }, \ { MBG_ERR_NO_MEM, "Memory allocation error" }, \ - { MBG_ERR_CLAIM_RSRC, "Faild to claim resources" }, \ + { MBG_ERR_CLAIM_RSRC, "Failed to claim resources" }, \ { MBG_ERR_DEV_NOT_SUPP, "Device not supported" }, \ { MBG_ERR_INV_DEV_REQUEST, "Request not supported" }, \ { MBG_ERR_NOT_SUPP_BY_DEV, "Not supported by device" }, \ @@ -502,7 +507,7 @@ extern "C" { { MBG_ERR_CONN_TYPE, "Invalid I/O connection type" }, \ { MBG_ERR_BYTES_WRITTEN, "Failed to write all bytes" }, \ { MBG_ERR_IO, "Input/output error" }, \ - { MBG_ERR_INV_PARM, "Invalid parameter passed to function" }, \ + { MBG_ERR_INV_PARM, "Invalid parameter" }, \ { MBG_ERR_NO_DEV, "No such device, or attempted an inappropriate function." }, \ { MBG_ERR_NOT_FOUND, "Specified item not found" }, \ { MBG_ERR_OVERFLOW, "Buffer overflow" }, \ @@ -513,7 +518,7 @@ extern "C" { { MBG_ERR_DECRYPT, "Decryption failed" }, \ { MBG_ERR_DISCONN, "Connection closed by remote site/host" }, \ { MBG_ERR_INV_CFG, "Invalid/inconsistent configuration read from device" }, \ - { MBG_ERR_RANGE, "Input parameter was out of range" }, \ + { MBG_ERR_RANGE, "Input parameter out of range" }, \ { MBG_ERR_INV_TLV_ANN_BYTES, "TLV num of transferred bytes differs from num of announced bytes" }, \ { MBG_ERR_INV_TLV_SIZE, "MBG_ERR_INV_TLV_SIZE" }, /* ### TODO */ \ { MBG_ERR_INV_TLV_UID, "MBG_ERR_INV_TLV_UID" }, /* ### TODO */ \ @@ -526,7 +531,7 @@ extern "C" { { MBG_ERR_UNKNOWN, "Unknown error code from external API" }, \ { MBG_ERR_PAM, "PAM authentication error" }, \ { MBG_ERR_TIMER, "Timer expired" }, \ - { MBG_ERR_AGAIN, "Try again (later)" }, \ + { MBG_ERR_AGAIN, "Try again later" }, \ { MBG_ERR_STR_CHAR, "Invalid character in string" }, \ { MBG_ERR_STR_LEN, "Wrong string length" }, \ { MBG_ERR_SN_GCODE_LEN, "Invalid device group code length" }, \ @@ -535,14 +540,15 @@ extern "C" { { MBG_ERR_SN_VRFY, "Serial number could not be verified" }, \ { MBG_ERR_RSRC_ITEM, "Too many resource items" }, \ { MBG_ERR_BUFFER_TOO_SMALL, "Data buffer too small" }, \ - { MBG_ERR_OUTDATED, "Software/Module is too old/outdated. Please update!" }, \ + { MBG_ERR_OUTDATED, "Software/module is too old/outdated. Please update!" }, \ { MBG_ERR_STR_SUBSTR, "Invalid substring in string" }, \ { MBG_ERR_IN_PROGRESS, "Long lasting operation in progress" }, \ { MBG_ERR_INV_USER, "Invalid user" }, \ { MBG_ERR_INV_GROUP, "Invalid group" }, \ { MBG_ERR_NAME, "Invalid name" }, \ { MBG_ERR_NOT_SUPP_BY_DRVR, "Not supported by the driver" }, \ - { MBG_ERR_OP_NOT_SUPP, "Requested operation is not supported" } + { MBG_ERR_OP_NOT_SUPP, "Requested operation not supported" }, \ + { MBG_ERR_CFG_TRUNC, "Value was truncated" } /** diff --git a/mbglib/common/pci_asic.h b/mbglib/common/pci_asic.h index 09962ef..31d8d79 100644 --- a/mbglib/common/pci_asic.h +++ b/mbglib/common/pci_asic.h @@ -1,7 +1,7 @@ /************************************************************************** * - * $Id: pci_asic.h 1.32 2021/03/22 22:40:24 martin REL_M $ + * $Id: pci_asic.h 1.33 2023/08/31 16:48:13 martin.burnicki REL_M $ * * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany * @@ -10,7 +10,9 @@ * * ----------------------------------------------------------------------- * $Log: pci_asic.h $ - * Revision 1.32 2021/03/22 22:40:24 martin + * Revision 1.33 2023/08/31 16:48:13 martin.burnicki + * Cast the result of some macros to fix printing. + * Revision 1.32 2021/03/22 22:40:24Z martin * Updated some comments. * Revision 1.31 2018/06/25 12:32:19 martin * Added PCPS_ASIC_STR_FMT format specifier. @@ -345,14 +347,14 @@ typedef struct * @brief Extract the major part of an ASIC version number. */ #define _pcps_asic_version_major( _v ) \ - ( ( (_v) >> 8 ) & 0xFF ) + ( (unsigned) ( ( (_v) >> 8 ) & 0xFF ) ) /** * @brief Extract the minor part of an ASIC version number. */ #define _pcps_asic_version_minor( _v ) \ - ( (_v) & 0xFF ) + ( (unsigned) ( (_v) & 0xFF ) ) |