summaryrefslogtreecommitdiff
path: root/tinyusb/common/fifo.h
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-10 13:13:13 +0700
committerhathach <[email protected]>2014-03-10 13:13:13 +0700
commitad72db5aeacf7d969f5c091c59a2f279eaf1c19c (patch)
tree328b462bcd4443e1eadba638509ebb4076b36b04 /tinyusb/common/fifo.h
parent1c73d2f923aade6c6640d41c4b9dc3ec8865d3da (diff)
change IAR TUSB_CFG_ATTR_USBRAM to _Pragma("location=\".ahb_sram1\"") instead of @ .ahb_sram1 so that we can place it before the variable for a cleaner code
change pipe xfer API buffer from void* to uint8_t* change FIFO_DEF to have a separated buffer to be compatible with IAR\ refractor IAR data alignment pragma
Diffstat (limited to 'tinyusb/common/fifo.h')
-rw-r--r--tinyusb/common/fifo.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/tinyusb/common/fifo.h b/tinyusb/common/fifo.h
index daef4a84a..4a518ca0c 100644
--- a/tinyusb/common/fifo.h
+++ b/tinyusb/common/fifo.h
@@ -55,23 +55,24 @@
*/
typedef struct
{
+ uint8_t* const buffer ; ///< buffer pointer
uint16_t const depth ; ///< max items
uint16_t const item_size ; ///< size of each item
volatile uint16_t count ; ///< number of items in queue
volatile uint16_t wr_idx ; ///< write pointer
volatile uint16_t rd_idx ; ///< read pointer
bool overwritable ;
- uint8_t buffer[] ; ///< buffer pointer
// IRQn_Type irq;
} fifo_t;
#define FIFO_DEF(name, ff_depth, type, is_overwritable) /*, irq_mutex)*/ \
+ uint8_t name##_buffer[ff_depth*sizeof(type)];\
fifo_t name = {\
+ .buffer = name##_buffer,\
.depth = ff_depth,\
.item_size = sizeof(type),\
.overwritable = is_overwritable,\
/*.irq = irq_mutex*/\
- .buffer = { [ff_depth*sizeof(type) - 1] = 0 },\
}
bool fifo_write(fifo_t* f, void const * p_data);