Skip to content

Commit 4ce2526

Browse files
authored
Merge pull request #12427 from DavidLin1577/patch-1
Minor optimisation to mcr20a-rf-driver code
2 parents 9f5ced3 + f1c4796 commit 4ce2526

File tree

1 file changed

+7
-6
lines changed
  • components/802.15.4_RF/mcr20a-rf-driver/source

1 file changed

+7
-6
lines changed

components/802.15.4_RF/mcr20a-rf-driver/source/MCR20Drv.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#if defined(MBED_CONF_NANOSTACK_CONFIGURATION) && DEVICE_SPI && DEVICE_INTERRUPTIN && defined(MBED_CONF_RTOS_PRESENT)
4646

4747
#include "platform/mbed_critical.h"
48+
#include <string.h>
4849

4950
/*****************************************************************************
5051
* PRIVATE VARIABLES *
@@ -165,7 +166,7 @@ void MCR20Drv_DirectAccessSPIMultiByteWrite
165166
{
166167
uint8_t txData;
167168

168-
if ((numOfBytes == 0) || (byteArray == 0)) {
169+
if ((numOfBytes == 0) || (byteArray == NULL)) {
169170
return;
170171
}
171172

@@ -230,7 +231,7 @@ void MCR20Drv_PB_SPIBurstWrite
230231
{
231232
uint8_t txData;
232233

233-
if ((numOfBytes == 0) || (byteArray == 0)) {
234+
if ((numOfBytes == 0) || (byteArray == NULL)) {
234235
return;
235236
}
236237

@@ -301,7 +302,7 @@ uint8_t MCR20Drv_DirectAccessSPIMultiByteRead
301302
uint8_t txData;
302303
uint8_t phyIRQSTS1;
303304

304-
if ((numOfBytes == 0) || (byteArray == 0)) {
305+
if ((numOfBytes == 0) || (byteArray == NULL)) {
305306
return 0;
306307
}
307308

@@ -338,7 +339,7 @@ uint8_t MCR20Drv_PB_SPIBurstRead
338339
uint8_t txData;
339340
uint8_t phyIRQSTS1;
340341

341-
if ((numOfBytes == 0) || (byteArray == 0)) {
342+
if ((numOfBytes == 0) || (byteArray == NULL)) {
342343
return 0;
343344
}
344345

@@ -406,7 +407,7 @@ void MCR20Drv_IndirectAccessSPIMultiByteWrite
406407
{
407408
uint16_t txData;
408409

409-
if ((numOfBytes == 0) || (byteArray == 0)) {
410+
if ((numOfBytes == 0) || (byteArray == NULL)) {
410411
return;
411412
}
412413

@@ -473,7 +474,7 @@ void MCR20Drv_IndirectAccessSPIMultiByteRead
473474
{
474475
uint16_t txData;
475476

476-
if ((numOfBytes == 0) || (byteArray == 0)) {
477+
if ((numOfBytes == 0) || (byteArray == NULL)) {
477478
return;
478479
}
479480

0 commit comments

Comments
 (0)