Skip to content

Commit 57d3a14

Browse files
authored
Minor optimisation to mcr20a-rf-driver code
This is a minor optimisation to the mcr20a-rf-driver code: 1. The function parameter is 'uint8_t *byteArray', (byteArray == NULL) instead of using (byteArray == 0). The code is more readable.
1 parent d7f3341 commit 57d3a14

File tree

1 file changed

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

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void MCR20Drv_DirectAccessSPIMultiByteWrite
165165
{
166166
uint8_t txData;
167167

168-
if ((numOfBytes == 0) || (byteArray == 0)) {
168+
if ((numOfBytes == 0) || (byteArray == NULL)) {
169169
return;
170170
}
171171

@@ -230,7 +230,7 @@ void MCR20Drv_PB_SPIBurstWrite
230230
{
231231
uint8_t txData;
232232

233-
if ((numOfBytes == 0) || (byteArray == 0)) {
233+
if ((numOfBytes == 0) || (byteArray == NULL)) {
234234
return;
235235
}
236236

@@ -301,7 +301,7 @@ uint8_t MCR20Drv_DirectAccessSPIMultiByteRead
301301
uint8_t txData;
302302
uint8_t phyIRQSTS1;
303303

304-
if ((numOfBytes == 0) || (byteArray == 0)) {
304+
if ((numOfBytes == 0) || (byteArray == NULL)) {
305305
return 0;
306306
}
307307

@@ -338,7 +338,7 @@ uint8_t MCR20Drv_PB_SPIBurstRead
338338
uint8_t txData;
339339
uint8_t phyIRQSTS1;
340340

341-
if ((numOfBytes == 0) || (byteArray == 0)) {
341+
if ((numOfBytes == 0) || (byteArray == NULL)) {
342342
return 0;
343343
}
344344

@@ -406,7 +406,7 @@ void MCR20Drv_IndirectAccessSPIMultiByteWrite
406406
{
407407
uint16_t txData;
408408

409-
if ((numOfBytes == 0) || (byteArray == 0)) {
409+
if ((numOfBytes == 0) || (byteArray == NULL)) {
410410
return;
411411
}
412412

@@ -473,7 +473,7 @@ void MCR20Drv_IndirectAccessSPIMultiByteRead
473473
{
474474
uint16_t txData;
475475

476-
if ((numOfBytes == 0) || (byteArray == 0)) {
476+
if ((numOfBytes == 0) || (byteArray == NULL)) {
477477
return;
478478
}
479479

0 commit comments

Comments
 (0)