Skip to content
Snippets Groups Projects
Commit b965b47d authored by Jose Alamos's avatar Jose Alamos
Browse files

drivers/cc2420: move flush sequence to inline function

parent 22d59cbb
No related branches found
No related tags found
No related merge requests found
...@@ -158,6 +158,12 @@ void cc2420_tx_exec(cc2420_t *dev) ...@@ -158,6 +158,12 @@ void cc2420_tx_exec(cc2420_t *dev)
} }
} }
static inline void _flush_rx_fifo(cc2420_t *dev)
{
cc2420_strobe(dev, CC2420_STROBE_FLUSHRX);
cc2420_strobe(dev, CC2420_STROBE_FLUSHRX);
}
int cc2420_rx(cc2420_t *dev, uint8_t *buf, size_t max_len, void *info) int cc2420_rx(cc2420_t *dev, uint8_t *buf, size_t max_len, void *info)
{ {
(void)info; (void)info;
...@@ -202,8 +208,7 @@ int cc2420_rx(cc2420_t *dev, uint8_t *buf, size_t max_len, void *info) ...@@ -202,8 +208,7 @@ int cc2420_rx(cc2420_t *dev, uint8_t *buf, size_t max_len, void *info)
} }
/* finally flush the FIFO */ /* finally flush the FIFO */
cc2420_strobe(dev, CC2420_STROBE_FLUSHRX); _flush_rx_fifo(dev);
cc2420_strobe(dev, CC2420_STROBE_FLUSHRX);
} }
return (int)len; return (int)len;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment