diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cc1111/ao_serial.c | 64 | ||||
| -rw-r--r-- | src/drivers/ao_cc115l.c | 2 | ||||
| -rw-r--r-- | src/drivers/ao_trng_send.c | 10 | ||||
| -rw-r--r-- | src/lpc/ao_usb_lpc.c | 72 | ||||
| -rw-r--r-- | src/stm/ao_usb_stm.c | 27 | ||||
| -rw-r--r-- | src/stmf0/ao_arch_funcs.h | 3 | ||||
| -rw-r--r-- | src/stmf0/ao_usb_stm.c | 79 | ||||
| -rw-r--r-- | src/telegps-v1.0/ao_pins.h | 10 | 
8 files changed, 199 insertions, 68 deletions
| diff --git a/src/cc1111/ao_serial.c b/src/cc1111/ao_serial.c index 81727836..b4f57908 100644 --- a/src/cc1111/ao_serial.c +++ b/src/cc1111/ao_serial.c @@ -42,6 +42,18 @@ const __code struct ao_serial_speed ao_serial_speeds[] = {  #define AO_SERIAL_SPEED_MAX	AO_SERIAL_SPEED_115200 +#if HAS_SERIAL_1_ALT_1 +#define SERIAL_1_RTS P0_3 +#else +#define SERIAL_1_RTS P1_5 +#endif + +#if HAS_SERIAL_0_ALT_1 +#define SERIAL_0_RTS P0_5 +#else +#define SERIAL_0_RTS P1_3 +#endif +  #if HAS_SERIAL_0  volatile __xdata struct ao_fifo	ao_serial0_rx_fifo; @@ -56,6 +68,10 @@ ao_serial0_rx_isr(void) __interrupt 2  #if USE_SERIAL_0_STDIN  	ao_wakeup(&ao_stdin_ready);  #endif +#if HAS_SERIAL_0_HW_FLOW +	if (ao_fifo_mostly(ao_serial0_rx_fifo)) +		SERIAL_0_RTS = 1; +#endif  }  static __xdata uint8_t ao_serial0_tx_started; @@ -87,6 +103,10 @@ ao_serial0_getchar(void) __critical  	while (ao_fifo_empty(ao_serial0_rx_fifo))  		ao_sleep(&ao_serial0_rx_fifo);  	ao_fifo_remove(ao_serial0_rx_fifo, c); +#if HAS_SERIAL_0_HW_FLOW +	if (ao_fifo_barely(ao_serial0_rx_fifo)) +		SERIAL_0_RTS = 0; +#endif  	return c;  } @@ -98,6 +118,10 @@ _ao_serial0_pollchar(void)  	if (ao_fifo_empty(ao_serial0_rx_fifo))  		return AO_READ_AGAIN;  	ao_fifo_remove(ao_serial0_rx_fifo,c); +#if HAS_SERIAL_0_HW_FLOW +	if (ao_fifo_barely(ao_serial0_rx_fifo)) +		SERIAL_0_RTS = 0; +#endif  	return c;  }  #endif @@ -144,6 +168,10 @@ ao_serial1_rx_isr(void) __interrupt 3  #if USE_SERIAL_1_STDIN  	ao_wakeup(&ao_stdin_ready);  #endif +#if HAS_SERIAL_1_HW_FLOW +	if (ao_fifo_mostly(ao_serial1_rx_fifo)) +		SERIAL_1_RTS = 1; +#endif  }  static __xdata uint8_t ao_serial1_tx_started; @@ -175,6 +203,10 @@ ao_serial1_getchar(void) __critical  	while (ao_fifo_empty(ao_serial1_rx_fifo))  		ao_sleep(&ao_serial1_rx_fifo);  	ao_fifo_remove(ao_serial1_rx_fifo, c); +#if HAS_SERIAL_1_HW_FLOW +	if (ao_fifo_barely(ao_serial1_rx_fifo)) +		SERIAL_1_RTS = 0; +#endif  	return c;  } @@ -186,6 +218,10 @@ _ao_serial1_pollchar(void)  	if (ao_fifo_empty(ao_serial1_rx_fifo))  		return AO_READ_AGAIN;  	ao_fifo_remove(ao_serial1_rx_fifo,c); +#if HAS_SERIAL_1_HW_FLOW +	if (ao_fifo_barely(ao_serial1_rx_fifo)) +		SERIAL_1_RTS = 0; +#endif  	return c;  }  #endif @@ -232,7 +268,11 @@ ao_serial_init(void)  	/* Make the USART pins be controlled by the USART */  	P0SEL |= (1 << 2) | (1 << 3);  #if HAS_SERIAL_0_HW_FLOW -	P0SEL |= (1 << 4) | (1 << 5); +	SERIAL_0_RTS = 0; +	P0DIR |= (1 << 5); + +	P0SEL |= (1 << 4); +	P0INP |= (1 << 4);  #endif  #else  	/* Set up the USART pin assignment */ @@ -244,7 +284,11 @@ ao_serial_init(void)  	/* Make the USART pins be controlled by the USART */  	P1SEL |= (1 << 5) | (1 << 4);  #if HAS_SERIAL_0_HW_FLOW -	P1SEL |= (1 << 3) | (1 << 2); +	SERIAL_0_RTS = 0; +	P1DIR |= (1 << 3); + +	P1SEL |= (1 << 2); +	P1INP |= (1 << 2);  #endif  #endif @@ -287,7 +331,13 @@ ao_serial_init(void)  	/* Make the USART pins be controlled by the USART */  	P0SEL |= (1 << 5) | (1 << 4);  #if HAS_SERIAL_1_HW_FLOW -	P0SEL |= (1 << 3) | (1 << 2); +	/* SW RTS control (hw doesn't work) */ +	SERIAL_1_RTS = 0; +	P0DIR |= 1 << 3; + +	/* HW CTS. Maybe this works? */ +	P0SEL |= 1 << 2; +	P0INP |= 1 << 2;  #endif  #else  	/* Set up the USART pin assignment */ @@ -299,7 +349,13 @@ ao_serial_init(void)  	/* Make the USART pins be controlled by the USART */  	P1SEL |= (1 << 6) | (1 << 7);  #if HAS_SERIAL_1_HW_FLOW -	P1SEL |= (1 << 5) | (1 << 4); +	/* SW RTS control (hw doesn't work) */ +	SERIAL_1_RTS = 0; +	P1DIR |= (1 << 5); + +	/* HW CTS. Maybe this works? */ +	P1SEL |= (1 << 4); +	P1INP |= (1 << 4);  #endif  #endif diff --git a/src/drivers/ao_cc115l.c b/src/drivers/ao_cc115l.c index 0246ba02..24180f34 100644 --- a/src/drivers/ao_cc115l.c +++ b/src/drivers/ao_cc115l.c @@ -70,7 +70,7 @@ struct ao_cc115l_trace {  	const char			*comment;  }; -#define NUM_TRACE	256 +#define NUM_TRACE	32  static struct ao_cc115l_trace	trace[NUM_TRACE];  static int			trace_i; diff --git a/src/drivers/ao_trng_send.c b/src/drivers/ao_trng_send.c index 171a345f..4ac6ee5e 100644 --- a/src/drivers/ao_trng_send.c +++ b/src/drivers/ao_trng_send.c @@ -22,7 +22,7 @@  #include <ao_exti.h>  #include <ao_power.h> -static struct ao_task	ao_trng_send_task, ao_trng_send_raw_task; +static struct ao_task	ao_trng_send_task;  static uint8_t		trng_running;  static AO_TICK_TYPE	trng_power_time; @@ -30,6 +30,10 @@ static AO_TICK_TYPE	trng_power_time;  static uint8_t		random_mutex; +#if AO_USB_HAS_IN2 + +static struct ao_task	ao_trng_send_raw_task; +  static void  ao_trng_get_raw(uint16_t *buf)  { @@ -90,6 +94,8 @@ ao_trng_send_raw(void)  	}  } +#endif +  /* Make sure there's at least 8 bits of variance in the samples */  #define MIN_VARIANCE		(128 * 128) @@ -181,7 +187,9 @@ ao_trng_send(void)  	if (failed > AO_TRNG_START_CHECK / 4)  		ao_panic(AO_PANIC_DMA); +#if AO_USB_HAS_IN2  	ao_add_task(&ao_trng_send_raw_task, ao_trng_send_raw, "trng_send_raw"); +#endif  #ifdef AO_USB_START_DISABLED  	ao_usb_enable(); diff --git a/src/lpc/ao_usb_lpc.c b/src/lpc/ao_usb_lpc.c index 0dfaece4..3b3226ad 100644 --- a/src/lpc/ao_usb_lpc.c +++ b/src/lpc/ao_usb_lpc.c @@ -269,13 +269,10 @@ ao_usb_epn_in_count(uint8_t n)  	return ao_usb_ep_count(ao_usb_epn_in(n, 0));  } -static uint8_t * -ao_usb_enable_ep(vuint32_t *ep, uint16_t nbytes, uint16_t set_nbytes) +static void +ao_usb_enable_ep(vuint32_t *ep, uint8_t *addr, uint16_t set_nbytes)  { -	uint8_t	*addr = ao_usb_alloc_sram(nbytes); -  	ao_usb_set_ep(ep, addr, set_nbytes); -	return addr;  }  static void @@ -293,23 +290,13 @@ ao_usb_disable_ep(vuint32_t *ep)  static void  ao_usb_enable_epn(uint8_t n, -		  uint16_t out_bytes, uint8_t *out_addrs[2], -		  uint16_t in_bytes, uint8_t *in_addrs[2]) +		  uint16_t out_bytes, uint8_t *out_addr, +		  uint8_t *in_addr)  { -	uint8_t	*addr; - -	addr = ao_usb_enable_ep(ao_usb_epn_out(n, 0), out_bytes * 2, out_bytes); -	if (out_addrs) { -		out_addrs[0] = addr; -		out_addrs[1] = addr + out_bytes; -	} +	ao_usb_enable_ep(ao_usb_epn_out(n, 0), out_addr, out_bytes);  	ao_usb_disable_ep(ao_usb_epn_out(n, 1)); -	addr = ao_usb_enable_ep(ao_usb_epn_in(n, 0), in_bytes * 2, 0); -	if (in_addrs) { -		in_addrs[0] = addr; -		in_addrs[1] = addr + in_bytes; -	} +	ao_usb_enable_ep(ao_usb_epn_in(n, 0), in_addr, 0);  	ao_usb_disable_ep(ao_usb_epn_in(n, 1));  } @@ -327,6 +314,14 @@ ao_usb_reset(void)  {  	ao_usb_set_address(0);  	ao_usb_configuration = 0; + +	ao_usb_ep0_state = AO_USB_EP0_IDLE; +	ao_usb_ep0_in_data = NULL; +	ao_usb_ep0_in_len = 0; +	ao_usb_ep0_in_max = 0; + +	ao_usb_ep0_out_data = NULL; +	ao_usb_ep0_out_len = 0;  }  static void @@ -341,17 +336,14 @@ ao_usb_set_ep0(void)  	lpc_usb.intstat = 0xc00003ff; -	ao_usb_sram = lpc_usb_sram; -  	lpc_usb.epliststart = (uint32_t) (intptr_t) &lpc_usb_endpoint;  	lpc_usb.databufstart = ((uint32_t) (intptr_t) ao_usb_sram) & 0xffc00000;  	/* Set up EP 0 - a Control end point with 32 bytes of in and out buffers */ -	ao_usb_ep0_rx_buffer = ao_usb_enable_ep(ao_usb_ep0_out(), AO_USB_CONTROL_SIZE, AO_USB_CONTROL_SIZE); -	ao_usb_ep0_setup_buffer = ao_usb_alloc_sram(AO_USB_CONTROL_SIZE); +	ao_usb_enable_ep(ao_usb_ep0_out(), ao_usb_ep0_rx_buffer, AO_USB_CONTROL_SIZE);  	lpc_usb_endpoint.setup = ao_usb_sram_offset(ao_usb_ep0_setup_buffer); -	ao_usb_ep0_tx_buffer = ao_usb_enable_ep(ao_usb_ep0_in(), AO_USB_CONTROL_SIZE, 0); +	ao_usb_enable_ep(ao_usb_ep0_in(), ao_usb_ep0_tx_buffer, 0);  	/* Clear all of the other endpoints */  	for (e = 1; e <= 4; e++) @@ -365,10 +357,10 @@ ao_usb_set_configuration(void)  	debug ("ao_usb_set_configuration\n");  	/* Set up the INT end point */ -	ao_usb_enable_epn(AO_USB_INT_EP, 0, NULL, 0, NULL); +	ao_usb_enable_epn(AO_USB_INT_EP, 0, NULL, NULL);  	/* Set up the OUT end point */ -	ao_usb_enable_epn(AO_USB_OUT_EP, AO_USB_OUT_SIZE, ao_usb_out_rx_buffer, 0, NULL); +	ao_usb_enable_epn(AO_USB_OUT_EP, AO_USB_OUT_SIZE, ao_usb_out_rx_buffer[0], NULL);  	/* Set the current RX pointer to the *other* buffer so that when buffer 0 gets  	 * data, we'll switch to it and pull bytes from there @@ -376,10 +368,18 @@ ao_usb_set_configuration(void)  	ao_usb_out_rx_cur = 1;  	/* Set up the IN end point */ -	ao_usb_enable_epn(AO_USB_IN_EP, 0, NULL, AO_USB_IN_SIZE, ao_usb_in_tx_buffer); +	ao_usb_enable_epn(AO_USB_IN_EP, 0, NULL, ao_usb_in_tx_buffer[0]);  	ao_usb_in_tx_cur = 0; +	ao_usb_in_flushed = 0; +	ao_usb_in_pending = 0; +	ao_wakeup(&ao_usb_in_pending); + +	ao_usb_out_avail = 0; +	ao_usb_configuration = 0; +  	ao_usb_running = 1; +	ao_wakeup(&ao_usb_running);  }  /* Send an IN data packet */ @@ -481,7 +481,7 @@ static struct ao_usb_line_coding ao_usb_line_coding = {115200, 0, 0, 8};  /* Walk through the list of descriptors and find a match   */  static void -ao_usb_get_descriptor(uint16_t value) +ao_usb_get_descriptor(uint16_t value, uint16_t length)  {  	const uint8_t		*descriptor;  	uint8_t		type = value >> 8; @@ -495,6 +495,8 @@ ao_usb_get_descriptor(uint16_t value)  				len = descriptor[2];  			else  				len = descriptor[0]; +			if (len > length) +				len = length;  			ao_usb_ep0_in_set(descriptor, len);  			break;  		} @@ -539,7 +541,7 @@ ao_usb_ep0_setup(void)  				break;  			case AO_USB_REQ_GET_DESCRIPTOR:  				debug ("get descriptor %d\n", ao_usb_setup.value); -				ao_usb_get_descriptor(ao_usb_setup.value); +				ao_usb_get_descriptor(ao_usb_setup.value, ao_usb_setup.length);  				break;  			case AO_USB_REQ_GET_CONFIGURATION:  				debug ("get configuration %d\n", ao_usb_configuration); @@ -958,6 +960,17 @@ ao_usb_enable(void)  	for (t = 0; t < 1000; t++)  		ao_arch_nop(); +	ao_usb_sram = lpc_usb_sram; + +	ao_usb_ep0_rx_buffer    = ao_usb_alloc_sram(AO_USB_CONTROL_SIZE); +	ao_usb_ep0_tx_buffer    = ao_usb_alloc_sram(AO_USB_CONTROL_SIZE); +	ao_usb_ep0_setup_buffer = ao_usb_alloc_sram(AO_USB_CONTROL_SIZE); + +	ao_usb_out_rx_buffer[0] = ao_usb_alloc_sram(AO_USB_OUT_SIZE); +	ao_usb_out_rx_buffer[1] = ao_usb_alloc_sram(AO_USB_OUT_SIZE); +	ao_usb_in_tx_buffer[0]  = ao_usb_alloc_sram(AO_USB_IN_SIZE); +	ao_usb_in_tx_buffer[1]  = ao_usb_alloc_sram(AO_USB_IN_SIZE); +  	ao_usb_set_ep0();  #if HAS_USB_PULLUP @@ -1001,7 +1014,6 @@ ao_usb_init(void)  #if HAS_USB_PULLUP  	ao_enable_output(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0);  #endif -  	ao_usb_enable();  	debug ("ao_usb_init\n"); diff --git a/src/stm/ao_usb_stm.c b/src/stm/ao_usb_stm.c index 4e9d1f14..3d26466b 100644 --- a/src/stm/ao_usb_stm.c +++ b/src/stm/ao_usb_stm.c @@ -349,6 +349,19 @@ ao_usb_set_ep0(void)  	}  	ao_usb_set_address(0); + +	ao_usb_running = 0; + +	/* Reset our internal state +	 */ + +	ao_usb_ep0_state = AO_USB_EP0_IDLE; + +	ao_usb_ep0_in_data = NULL; +	ao_usb_ep0_in_len = 0; + +	ao_usb_ep0_out_data = 0; +	ao_usb_ep0_out_len = 0;  }  static void @@ -393,7 +406,15 @@ ao_usb_set_configuration(void)  		       STM_USB_EPR_STAT_RX_DISABLED,  		       STM_USB_EPR_STAT_TX_NAK); +	ao_usb_in_flushed = 0; +	ao_usb_in_pending = 0; +	ao_wakeup(&ao_usb_in_pending); + +	ao_usb_out_avail = 0; +	ao_usb_configuration = 0; +  	ao_usb_running = 1; +	ao_wakeup(&ao_usb_running);  }  static uint16_t	control_count; @@ -581,7 +602,7 @@ static struct ao_usb_line_coding ao_usb_line_coding = {115200, 0, 0, 8};  /* Walk through the list of descriptors and find a match   */  static void -ao_usb_get_descriptor(uint16_t value) +ao_usb_get_descriptor(uint16_t value, uint16_t length)  {  	const uint8_t		*descriptor;  	uint8_t		type = value >> 8; @@ -595,6 +616,8 @@ ao_usb_get_descriptor(uint16_t value)  				len = descriptor[2];  			else  				len = descriptor[0]; +			if (len > length) +				len = length;  			ao_usb_ep0_in_set(descriptor, len);  			break;  		} @@ -639,7 +662,7 @@ ao_usb_ep0_setup(void)  				break;  			case AO_USB_REQ_GET_DESCRIPTOR:  				debug ("get descriptor %d\n", ao_usb_setup.value); -				ao_usb_get_descriptor(ao_usb_setup.value); +				ao_usb_get_descriptor(ao_usb_setup.value, ao_usb_setup.length);  				break;  			case AO_USB_REQ_GET_CONFIGURATION:  				debug ("get configuration %d\n", ao_usb_configuration); diff --git a/src/stmf0/ao_arch_funcs.h b/src/stmf0/ao_arch_funcs.h index ccfa3fc7..64311b23 100644 --- a/src/stmf0/ao_arch_funcs.h +++ b/src/stmf0/ao_arch_funcs.h @@ -409,9 +409,6 @@ uint16_t *  ao_usb_alloc(void);  void -ao_usb_free(uint16_t *buffer); - -void  ao_usb_write(uint16_t *buffer, uint16_t len);  void diff --git a/src/stmf0/ao_usb_stm.c b/src/stmf0/ao_usb_stm.c index 253506d5..fb3d8c85 100644 --- a/src/stmf0/ao_usb_stm.c +++ b/src/stmf0/ao_usb_stm.c @@ -83,7 +83,9 @@ static uint8_t 	ao_usb_ep0_out_len;  /* Buffer description tables */  static union stm_usb_bdt	*ao_usb_bdt;  /* USB address of end of allocated storage */ +#if AO_USB_DIRECTIO  static uint16_t	ao_usb_sram_addr; +#endif  /* Pointer to ep0 tx/rx buffers in USB memory */  static uint16_t	*ao_usb_ep0_tx_buffer; @@ -362,39 +364,43 @@ ao_usb_init_ep(uint8_t ep, uint32_t addr, uint32_t type, uint32_t stat_rx, uint3  static void  ao_usb_alloc_buffers(void)  { -	ao_usb_sram_addr = 0; +	uint16_t sram_addr = 0;  	ao_usb_bdt = (void *) stm_usb_sram; -	ao_usb_sram_addr += 8 * STM_USB_BDT_SIZE; +	sram_addr += 8 * STM_USB_BDT_SIZE; -	ao_usb_ep0_tx_buffer = ao_usb_packet_buffer_addr(ao_usb_sram_addr); -	ao_usb_sram_addr += AO_USB_CONTROL_SIZE; +	ao_usb_ep0_tx_buffer = ao_usb_packet_buffer_addr(sram_addr); +	sram_addr += AO_USB_CONTROL_SIZE; -	ao_usb_ep0_rx_buffer = ao_usb_packet_buffer_addr(ao_usb_sram_addr); -	ao_usb_sram_addr += AO_USB_CONTROL_SIZE; +	ao_usb_ep0_rx_buffer = ao_usb_packet_buffer_addr(sram_addr); +	sram_addr += AO_USB_CONTROL_SIZE;  #if AO_USB_HAS_INT -	ao_usb_int_tx_offset = ao_usb_sram_addr; -	ao_usb_sram_addr += AO_USB_INT_SIZE; +	ao_usb_int_tx_offset = sram_addr; +	sram_addr += AO_USB_INT_SIZE;  #endif  #if AO_USB_HAS_OUT -	ao_usb_out_rx_buffer = ao_usb_packet_buffer_addr(ao_usb_sram_addr); -	ao_usb_out_rx_offset = ao_usb_sram_addr; -	ao_usb_sram_addr += AO_USB_OUT_SIZE; +	ao_usb_out_rx_buffer = ao_usb_packet_buffer_addr(sram_addr); +	ao_usb_out_rx_offset = sram_addr; +	sram_addr += AO_USB_OUT_SIZE;  #endif  #if AO_USB_HAS_IN -	ao_usb_in_tx_buffer = ao_usb_packet_buffer_addr(ao_usb_sram_addr); -	ao_usb_in_tx_offset = ao_usb_sram_addr; -	ao_usb_sram_addr += AO_USB_IN_SIZE; +	ao_usb_in_tx_buffer = ao_usb_packet_buffer_addr(sram_addr); +	ao_usb_in_tx_offset = sram_addr; +	sram_addr += AO_USB_IN_SIZE;  #endif  #if AO_USB_HAS_IN2 -	ao_usb_in2_tx_buffer = ao_usb_packet_buffer_addr(ao_usb_sram_addr); -	ao_usb_in2_tx_offset = ao_usb_sram_addr; -	ao_usb_sram_addr += AO_USB_IN_SIZE; +	ao_usb_in2_tx_buffer = ao_usb_packet_buffer_addr(sram_addr); +	ao_usb_in2_tx_offset = sram_addr; +	sram_addr += AO_USB_IN_SIZE; +#endif + +#if AO_USB_DIRECTIO +	ao_usb_sram_addr = sram_addr;  #endif  } @@ -437,6 +443,17 @@ ao_usb_set_ep0(void)  	ao_usb_set_address(0);  	ao_usb_running = 0; + +	/* Reset our internal state +	 */ + +	ao_usb_ep0_state = AO_USB_EP0_IDLE; + +	ao_usb_ep0_in_data = NULL; +	ao_usb_ep0_in_len = 0; + +	ao_usb_ep0_out_data = 0; +	ao_usb_ep0_out_len = 0;  }  static void @@ -493,6 +510,20 @@ ao_usb_set_configuration(void)  		       STM_USB_EPR_STAT_TX_NAK);  #endif +	ao_usb_in_flushed = 0; +	ao_usb_in_pending = 0; +	ao_wakeup(&ao_usb_in_pending); +#if AO_USB_HAS_IN2 +	ao_usb_in2_flushed = 0; +	ao_usb_in2_pending = 0; +	ao_wakeup(&ao_usb_in2_pending); +#endif + +	ao_usb_out_avail = 0; +	ao_usb_configuration = 0; + +	ao_wakeup(AO_USB_OUT_SLEEP_ADDR); +  	ao_usb_running = 1;  #if AO_USB_DIRECTIO  	ao_wakeup(&ao_usb_running); @@ -658,7 +689,7 @@ ao_usb_serial_init(void)  /* Walk through the list of descriptors and find a match   */  static void -ao_usb_get_descriptor(uint16_t value) +ao_usb_get_descriptor(uint16_t value, uint16_t length)  {  	const uint8_t		*descriptor;  	uint8_t		type = value >> 8; @@ -679,6 +710,8 @@ ao_usb_get_descriptor(uint16_t value)  				len = sizeof (ao_usb_serial);  			}  #endif +			if (len > length) +				len = length;  			ao_usb_ep0_in_set(descriptor, len);  			break;  		} @@ -723,7 +756,7 @@ ao_usb_ep0_setup(void)  				break;  			case AO_USB_REQ_GET_DESCRIPTOR:  				debug ("get descriptor %d\n", ao_usb_setup.value); -				ao_usb_get_descriptor(ao_usb_setup.value); +				ao_usb_get_descriptor(ao_usb_setup.value, ao_usb_setup.length);  				break;  			case AO_USB_REQ_GET_CONFIGURATION:  				debug ("get configuration %d\n", ao_usb_configuration); @@ -1159,14 +1192,6 @@ ao_usb_alloc(void)  }  void -ao_usb_free(uint16_t *addr) -{ -	uint16_t	offset = ao_usb_packet_buffer_offset(addr); -	if (offset < ao_usb_sram_addr) -		ao_usb_sram_addr = offset; -} - -void  ao_usb_write(uint16_t *buffer, uint16_t len)  {  	ao_arch_block_interrupts(); diff --git a/src/telegps-v1.0/ao_pins.h b/src/telegps-v1.0/ao_pins.h index d2382a56..eb1033da 100644 --- a/src/telegps-v1.0/ao_pins.h +++ b/src/telegps-v1.0/ao_pins.h @@ -105,6 +105,16 @@  #define AO_CC115L_DONE_INT_PORT		0  #define AO_CC115L_DONE_INT_PIN		2 +/* SN 1959, owned by J. Patrick Bowers, had a hard landing and appears to have broken the + * internal connection between pin 8 and the chip. This board + * has been fixed by jumpering pin 8 to pin 10, which means that + * the DONE_INT_PIN is now 4 instead of 2. When building custom firmware for + * this board, just adjust the ao_pins.h value before compiling + + #define AO_CC115L_DONE_INT_PIN_SN_1959	4 + + */ +  /*   * Flash (M25)   */ | 
