1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

f4 usb: ensure data buffers are 4-byte aligned

4-byte alignment is required for DMA.
This commit is contained in:
Stacey Sheldon 2013-02-21 00:40:54 -08:00 committed by Alessio Morale
parent 9cc70695d7
commit cb6f4a474e
2 changed files with 5 additions and 5 deletions

View File

@ -69,13 +69,13 @@ struct pios_usb_cdc_dev {
bool usb_ctrl_if_enabled;
bool usb_data_if_enabled;
uint8_t rx_packet_buffer[PIOS_USB_BOARD_CDC_DATA_LENGTH];
uint8_t rx_packet_buffer[PIOS_USB_BOARD_CDC_DATA_LENGTH] __attribute__ ((aligned(4)));
volatile bool rx_active;
uint8_t tx_packet_buffer[PIOS_USB_BOARD_CDC_DATA_LENGTH];
uint8_t tx_packet_buffer[PIOS_USB_BOARD_CDC_DATA_LENGTH] __attribute__ ((aligned(4)));
volatile bool tx_active;
uint8_t ctrl_tx_packet_buffer[PIOS_USB_BOARD_CDC_MGMT_LENGTH];
uint8_t ctrl_tx_packet_buffer[PIOS_USB_BOARD_CDC_MGMT_LENGTH] __attribute__ ((aligned(4)));
uint32_t rx_dropped;
uint32_t rx_oversize;

View File

@ -67,10 +67,10 @@ struct pios_usb_hid_dev {
bool usb_if_enabled;
uint8_t rx_packet_buffer[PIOS_USB_BOARD_HID_DATA_LENGTH];
uint8_t rx_packet_buffer[PIOS_USB_BOARD_HID_DATA_LENGTH] __attribute__ ((aligned(4)));
bool rx_active;
uint8_t tx_packet_buffer[PIOS_USB_BOARD_HID_DATA_LENGTH];
uint8_t tx_packet_buffer[PIOS_USB_BOARD_HID_DATA_LENGTH] __attribute__ ((aligned(4)));
bool tx_active;
uint32_t rx_dropped;