Skip to content

Commit 8c1e061

Browse files
Apply fix, provided by @slammer, for issue with USB Serial on GCC 4.9
1 parent 9695c36 commit 8c1e061

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

STM32F1/system/libmaple/usb/stm32f1/usb_reg_map.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ static inline uint16 usb_get_ep_tx_addr(uint8 ep) {
439439
}
440440

441441
static inline void usb_set_ep_tx_addr(uint8 ep, uint16 addr) {
442-
uint32 *tx_addr = usb_ep_tx_addr_ptr(ep);
442+
volatile uint32 *tx_addr = usb_ep_tx_addr_ptr(ep);
443443
*tx_addr = addr & ~0x1;
444444
}
445445

@@ -454,7 +454,7 @@ static inline uint16 usb_get_ep_rx_addr(uint8 ep) {
454454
}
455455

456456
static inline void usb_set_ep_rx_addr(uint8 ep, uint16 addr) {
457-
uint32 *rx_addr = usb_ep_rx_addr_ptr(ep);
457+
volatile uint32 *rx_addr = usb_ep_rx_addr_ptr(ep);
458458
*rx_addr = addr & ~0x1;
459459
}
460460

@@ -471,7 +471,7 @@ static inline uint16 usb_get_ep_tx_count(uint8 ep) {
471471
}
472472

473473
static inline void usb_set_ep_tx_count(uint8 ep, uint16 count) {
474-
uint32 *txc = usb_ep_tx_count_ptr(ep);
474+
volatile uint32 *txc = usb_ep_tx_count_ptr(ep);
475475
*txc = count;
476476
}
477477

0 commit comments

Comments
 (0)