Don't use RF230_CONF_CCA_THRES if it is not defined.
This commit is contained in:
parent
5a054c82d2
commit
581d081ffe
|
@ -742,14 +742,20 @@ void rf230_warm_reset(void) {
|
||||||
|
|
||||||
/* CCA energy threshold = -91dB + 2*SR_CCA_ED_THRESH. Reset defaults to -77dB */
|
/* CCA energy threshold = -91dB + 2*SR_CCA_ED_THRESH. Reset defaults to -77dB */
|
||||||
/* Use RF230 base of -91; RF231 base is -90 according to datasheet */
|
/* Use RF230 base of -91; RF231 base is -90 according to datasheet */
|
||||||
|
#ifdef RF230_CONF_CCA_THRES
|
||||||
#if RF230_CONF_CCA_THRES < -91
|
#if RF230_CONF_CCA_THRES < -91
|
||||||
|
#warning
|
||||||
#warning RF230_CONF_CCA_THRES below hardware limit, setting to -91dBm
|
#warning RF230_CONF_CCA_THRES below hardware limit, setting to -91dBm
|
||||||
|
#warning
|
||||||
hal_subregister_write(SR_CCA_ED_THRES,0);
|
hal_subregister_write(SR_CCA_ED_THRES,0);
|
||||||
#elif RF230_CONF_CCA_THRES > -61
|
#elif RF230_CONF_CCA_THRES > -61
|
||||||
|
#warning
|
||||||
#warning RF230_CONF_CCA_THRES above hardware limit, setting to -61dBm
|
#warning RF230_CONF_CCA_THRES above hardware limit, setting to -61dBm
|
||||||
|
#warning
|
||||||
hal_subregister_write(SR_CCA_ED_THRES,15);
|
hal_subregister_write(SR_CCA_ED_THRES,15);
|
||||||
#else
|
#else
|
||||||
hal_subregister_write(SR_CCA_ED_THRES,(RF230_CONF_CCA_THRES+91)/2);
|
hal_subregister_write(SR_CCA_ED_THRES,(RF230_CONF_CCA_THRES+91)/2);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Use automatic CRC unless manual is specified */
|
/* Use automatic CRC unless manual is specified */
|
||||||
|
|
Loading…
Reference in a new issue