diff options
| author | HiFIPhile <[email protected]> | 2020-12-17 22:20:56 +0100 |
|---|---|---|
| committer | Mengsk <[email protected]> | 2020-12-23 16:54:55 +0100 |
| commit | baa5417f3eaf3f05f414c7d6ac31e08ac7b7977a (patch) | |
| tree | b9e36e11c9cae3157e427472eb01acf714eaa172 /src | |
| parent | cc8329f3e436f49dc7305bfc2de8255116da0557 (diff) | |
Fix IAR error on memcpy and warnings.
Signed-off-by: MasterPhi <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/tusb_fifo.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/common/tusb_fifo.c b/src/common/tusb_fifo.c index 608bfd081..00f2434a7 100644 --- a/src/common/tusb_fifo.c +++ b/src/common/tusb_fifo.c @@ -30,6 +30,12 @@ #include "osal/osal.h" #include "tusb_fifo.h" +// Supress IAR warning +// Warning[Pa082]: undefined behavior: the order of volatile accesses is undefined in this statement +#if defined(__ICCARM__) +#pragma diag_suppress = Pa082 +#endif + // implement mutex lock and unlock #if CFG_FIFO_MUTEX @@ -106,7 +112,7 @@ static void _ff_push_n(tu_fifo_t* f, void const * data, uint16_t n, uint16_t wRe memcpy(f->buffer + (wRel * f->item_size), data, nLin*f->item_size); // Write data wrapped around - memcpy(f->buffer, data + nLin*f->item_size, (n - nLin) * f->item_size); + memcpy(f->buffer, ((uint8_t const*) data) + nLin*f->item_size, (n - nLin) * f->item_size); } } @@ -131,7 +137,7 @@ static void _ff_pull_n(tu_fifo_t* f, void * p_buffer, uint16_t n, uint16_t rRel) memcpy(p_buffer, f->buffer + (rRel * f->item_size), nLin*f->item_size); // Read data wrapped part - memcpy(p_buffer + nLin*f->item_size, f->buffer, (n - nLin) * f->item_size); + memcpy((uint8_t*)p_buffer + nLin*f->item_size, f->buffer, (n - nLin) * f->item_size); } } |
