Skip to content

Commit

Permalink
Fixed indexing error in aci_queue's peek function
Browse files Browse the repository at this point in the history
  • Loading branch information
trond-snekvik committed Aug 22, 2014
1 parent 65e656c commit 58b5012
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/BLE/aci_queue.cpp
Expand Up @@ -170,7 +170,7 @@ bool aci_queue_peek(aci_queue_t *aci_q, hal_aci_data_t *p_data)
return false;
}

memcpy((uint8_t *)p_data, (uint8_t *)&(aci_q->aci_data[aci_q->head]), sizeof(hal_aci_data_t));
memcpy((uint8_t *)p_data, (uint8_t *)&(aci_q->aci_data[aci_q->head % ACI_QUEUE_SIZE]), sizeof(hal_aci_data_t));

return true;
}
Expand All @@ -185,7 +185,7 @@ bool aci_queue_peek_from_isr(aci_queue_t *aci_q, hal_aci_data_t *p_data)
return false;
}

memcpy((uint8_t *)p_data, (uint8_t *)&(aci_q->aci_data[aci_q->head]), sizeof(hal_aci_data_t));
memcpy((uint8_t *)p_data, (uint8_t *)&(aci_q->aci_data[aci_q->head % ACI_QUEUE_SIZE]), sizeof(hal_aci_data_t));

return true;
}

0 comments on commit 58b5012

Please sign in to comment.