diff options
| author | Bdale Garbee <bdale@gag.com> | 2017-04-24 18:22:03 -0600 | 
|---|---|---|
| committer | Bdale Garbee <bdale@gag.com> | 2017-04-24 18:22:03 -0600 | 
| commit | b91f67005709cb7f65e0a461b49b5cb0952cb391 (patch) | |
| tree | e9f6c0f30a81cf30a9cfd52887171168f7830f85 /src/stm/ao_usb_stm.c | |
| parent | 1e956f93e0c9f8ed6180490f80e8aead5538f818 (diff) | |
| parent | 8a10ddb0bca7d6f6aa4aedda171899abd165fd74 (diff) | |
Merge branch 'branch-1.7' into debian
Diffstat (limited to 'src/stm/ao_usb_stm.c')
| -rw-r--r-- | src/stm/ao_usb_stm.c | 18 | 
1 files changed, 11 insertions, 7 deletions
diff --git a/src/stm/ao_usb_stm.c b/src/stm/ao_usb_stm.c index 9d72844e..33e0617c 100644 --- a/src/stm/ao_usb_stm.c +++ b/src/stm/ao_usb_stm.c @@ -1015,7 +1015,7 @@ ao_usb_enable(void)  	ao_arch_block_interrupts();  	/* Route interrupts */ -	stm_nvic_set_priority(STM_ISR_USB_LP_POS, 3); +	stm_nvic_set_priority(STM_ISR_USB_LP_POS, AO_STM_NVIC_LOW_PRIORITY);  	stm_nvic_set_enable(STM_ISR_USB_LP_POS);  	ao_usb_configuration = 0; @@ -1109,7 +1109,7 @@ struct ao_usb_dbg {  	int		line;  	char		*msg;  	uint32_t	value; -	uint32_t	primask; +	uint32_t	prival;  #if TX_DBG  	uint16_t	in_count;  	uint32_t	in_epr; @@ -1125,19 +1125,23 @@ struct ao_usb_dbg {  #endif  }; -#define NUM_USB_DBG	128 +#define NUM_USB_DBG	16 -static struct ao_usb_dbg dbg[128]; +static struct ao_usb_dbg dbg[NUM_USB_DBG];  static int dbg_i;  static void _dbg(int line, char *msg, uint32_t value)  { -	uint32_t	primask; +	uint32_t	prival;  	dbg[dbg_i].line = line;  	dbg[dbg_i].msg = msg;  	dbg[dbg_i].value = value; -	asm("mrs %0,primask" : "=&r" (primask)); -	dbg[dbg_i].primask = primask; +#if AO_NONMASK_INTERRUPT +	asm("mrs %0,basepri" : "=&r" (prival)); +#else +	asm("mrs %0,primask" : "=&r" (prival)); +#endif +	dbg[dbg_i].prival = prival;  #if TX_DBG  	dbg[dbg_i].in_count = in_count;  	dbg[dbg_i].in_epr = stm_usb.epr[AO_USB_IN_EPR];  | 
