1
WXK
2023-12-18 37e61b5bf9aba18b6d0a5a4892494f0016c6e9c6
decadriver/deca_device.c
@@ -180,6 +180,11 @@
    _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
    dw1000local.deviceID =  dwt_readdevid() ;
        module_power=67;
   if(module_power>67)
         {module_power=67;}
         if(module_power<0)
         {module_power=0;}
      if(module_power>36)
      {
         power_temp =(module_power-36);
@@ -428,6 +433,7 @@
 *
 * returns DWT_SUCCESS for success, or DWT_ERROR for error
 */
int dwt_configure(dwt_config_t *config)
{
    uint8_t nsSfd_result  = 0;
@@ -435,7 +441,7 @@
    uint8_t chan = config->chan ;
    uint32_t regval ;
    uint16_t reg16 = lde_replicaCoeff[config->rxCode];
    uint8_t prfIndex = dw1000local.prfIndex = config->prf - DWT_PRF_16M;
    volatile uint8_t prfIndex = dw1000local.prfIndex = config->prf - DWT_PRF_16M;
    uint8_t bw = ((chan == 4) || (chan == 7)) ? 1 : 0 ; // Select wide or narrow band
    dw1000local.chan = config->chan ;
@@ -2879,7 +2885,7 @@
 */
void dwt_forcetrxoff(void)
{
    decaIrqStatus_t stat ;
//    decaIrqStatus_t stat ;
    uint8_t temp ;
    uint32_t mask;
@@ -3101,7 +3107,7 @@
 */
void dwt_setinterrupt(uint32_t bitmask, uint8_t enable)
{
    decaIrqStatus_t stat ;
//    decaIrqStatus_t stat ;
    uint32_t mask ;
    // Need to beware of interrupts occurring in the middle of following read modify write cycle