From 8d4e2214125d2204052a19d0fa957b904de4c7a7 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Wed, 23 May 2012 00:15:28 -0500 Subject: [PATCH] Remove the disable IRQ commands in PIOS_COM since they aren't needed. --- flight/PiOS/Common/pios_com.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/flight/PiOS/Common/pios_com.c b/flight/PiOS/Common/pios_com.c index 20e32ffd3..ba54c1e61 100644 --- a/flight/PiOS/Common/pios_com.c +++ b/flight/PiOS/Common/pios_com.c @@ -197,9 +197,7 @@ static uint16_t PIOS_COM_RxInCallback(uint32_t context, uint8_t * buf, uint16_t PIOS_Assert(valid); PIOS_Assert(com_dev->has_rx); - PIOS_IRQ_Disable(); uint16_t bytes_into_fifo = fifoBuf_putData(&com_dev->rx, buf, buf_len); - PIOS_IRQ_Enable(); if (bytes_into_fifo > 0) { /* Data has been added to the buffer */ @@ -223,9 +221,7 @@ static uint16_t PIOS_COM_TxOutCallback(uint32_t context, uint8_t * buf, uint16_t PIOS_Assert(buf_len); PIOS_Assert(com_dev->has_tx); - PIOS_IRQ_Disable(); uint16_t bytes_from_fifo = fifoBuf_getData(&com_dev->tx, buf, buf_len); - PIOS_IRQ_Enable(); if (bytes_from_fifo > 0) { /* More space has been made in the buffer */ @@ -289,9 +285,7 @@ int32_t PIOS_COM_SendBufferNonBlocking(uint32_t com_id, const uint8_t *buffer, u return -2; } - PIOS_IRQ_Disable(); uint16_t bytes_into_fifo = fifoBuf_putData(&com_dev->tx, buffer, len); - PIOS_IRQ_Enable(); if (bytes_into_fifo > 0) { /* More data has been put in the tx buffer, make sure the tx is started */ @@ -469,6 +463,7 @@ uint16_t PIOS_COM_ReceiveBuffer(uint32_t com_id, uint8_t * buf, uint16_t buf_len { PIOS_Assert(buf); PIOS_Assert(buf_len); + uint16_t bytes_from_fifo; struct pios_com_dev * com_dev = (struct pios_com_dev *)com_id; @@ -479,9 +474,7 @@ uint16_t PIOS_COM_ReceiveBuffer(uint32_t com_id, uint8_t * buf, uint16_t buf_len PIOS_Assert(com_dev->has_rx); check_again: - PIOS_IRQ_Disable(); - uint16_t bytes_from_fifo = fifoBuf_getData(&com_dev->rx, buf, buf_len); - PIOS_IRQ_Enable(); + bytes_from_fifo = fifoBuf_getData(&com_dev->rx, buf, buf_len); if (bytes_from_fifo == 0) { /* No more bytes in receive buffer */