zhyinch
2022-04-26 95f736655c46ec4974e89c7f0ca6a542cdbf3532
源码/核心板/Src/decadriver/deca_device.c
@@ -113,6 +113,7 @@
int dwt_initialise(uint16_t config)
{
      u32 power_temp,power_input;
    u8 iderrortimes;
    uint8_t plllockdetect = EC_CTRL_PLLLCK;
    uint16_t otp_addr = 0;
    uint32_t ldo_tune = 0;
@@ -128,9 +129,10 @@
    // Read and validate device ID return -1 if not recognised
    dw1000local.deviceID =  dwt_readdevid() ;
    while (DWT_DEVICE_ID != dw1000local.deviceID) // MP IC ONLY (i.e. DW1000) FOR THIS CODE
    while (DWT_DEVICE_ID != dw1000local.deviceID&&iderrortimes<100) // MP IC ONLY (i.e. DW1000) FOR THIS CODE
    {
          dw1000local.deviceID =  dwt_readdevid() ;
        iderrortimes++;
    }
    _dwt_enableclocks(FORCE_SYS_XTI); // NOTE: set system clock to XTI - this is necessary to make sure the values read by _dwt_otpread are reliable