Allow use of a null status argument.
authorNathael Pajani <nathael.pajani@ed3l.fr>
Wed, 22 Oct 2014 00:29:09 +0000 (02:29 +0200)
committerNathael Pajani <nathael.pajani@ed3l.fr>
Tue, 8 Nov 2022 16:03:04 +0000 (17:03 +0100)
drivers/cc1101.c

index b263a84..c49b7e4 100644 (file)
@@ -276,7 +276,9 @@ int cc1101_receive_packet(uint8_t* buffer, uint8_t size, uint8_t* status)
 
        /* Get fifo state */
        rx_status = cc1101_read_reg(CC1101_STATUS(rx_bytes));
-       *status = rx_status;
+       if (status != NULL) {
+               *status = rx_status;
+       }
 
        /* Empty fifo ? */
        if (rx_status == 0) {